
 function irA(menu){
     if (menu.options[menu.selectedIndex].value!='')
      window.location.href = menu.options[menu.selectedIndex].value;
  }

function formatear_consulta(frm) {
frm.ct.value="Segunda" ;
frm.consulta.value=frm.qu.value ;
return true;
}

function mOvr(id_TD,bgColor,id_link,fontColor) {
	document.getElementById(id_TD).style.cursor = 'hand';
	document.getElementById(id_TD).style.background = bgColor;
	document.getElementById(id_link).style.color = fontColor;
}
function mOut(id_TD,fontColor,id_link,bgColor) {
	document.getElementById(id_TD).style.cursor = 'default';
	document.getElementById(id_TD).style.background = fontColor;
	document.getElementById(id_link).style.color = bgColor;
}
  function mClk(src) {
    if(event.srcElement.tagName=='TD'){
   src.children.tags('A')[0].click();
    }
  }

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
  if (theURL)   window.open(theURL,winName,features);
}

function MostrarPVI(URL)
{
    var PVI=window.open(URL,'','scrollbars=yes,resizable=yes,fullscreen=YES');
    if(PVI)
    {
        PVI.moveTo(0,0);
        PVI.resizeTo(screen.availWidth,screen.availHeight);
        PVI.focus();
    }
    else
    {
        alert('Deshabilite el bloqueador de pop-up de su navegador');
    }
}

function openPortadilla(URL,strWindow)
{
    var PORT=window.open(URL,strWindow,'scrollbars=yes,resizable=yes');
    if(PORT)
    {
        PORT.moveTo(0,0);
        PORT.resizeTo(screen.availWidth,screen.availHeight);
		PORT.focus();
    }
    else
    {
        alert('Desahabilite el bloqueador de pop-up de su navegador');
    }
}

function AnchorPosition_getPageOffsetTop (el) {
	var ot=el.offsetTop;
	while((el=el.offsetParent) != null) { ot += el.offsetTop; }
	return ot;
	}

function AnchorPosition_getWindowOffsetTop (el) {
	return AnchorPosition_getPageOffsetTop(el)-document.body.scrollTop;
	}

function isGecko()  {
		var ua = navigator.userAgent.substring(0,11);
		if(ua=='Mozilla/5.0')  {
		return true;
		}
		else {
		return false;
		}
	}
	
function getQueryVariable(variable) {
  var query = window.location.search.substring(1);
  var vars = query.split("&");
  for (var i=0;i<vars.length;i++) {
    var pair = vars[i].split("=");
    if (pair[0] == variable) {
      return pair[1];
    }
  } 
  return "";
}	

function ajustarSitio()
{
  if(jsCheckMonitor()<1024)
      window.scrollTo(1000,0);
}

function jsCheckMonitor() {
	if ( screen.width < 1024) 
		return 800;
	else if ( screen.width < 1280)
		return 1024;
	else if ( screen.width < 1600)
		return 1280;
	else if ( screen.width >= 1600)
		return 1600;
	else 
		return 1024;
}

function setFolder(iResolucion)
{
	var strFolder;
	iResolucion = parseInt(iResolucion);
	
	if(iResolucion <= 800) strFolder = "800";
	else if(iResolucion <= 1024 || iResolucion < 1260 ) strFolder = "1000";
		 else if(iResolucion >= 1260) strFolder = "1260";
			  else strFolder = "1000";

	return strFolder;
}

function SetDimensionBox(iResolucion,pviFile)
{
	var isRev="";
	var constWidth = 1570; // proporcion ancho
	var constHeight = 3000; // proporcion alto

	iWidth = iResolucion - 25; // se resta scrollbar

	if (pviFile.charAt(11) == 'P' || pviFile.charAt(11) == 'F'){ 
		constHeight = 1680;
		isRev = "_DEP";
	}

	iHeight = parseInt((constHeight * iWidth) / constWidth); // se calcula alto proporcional segun ancho

	return isRev;

	/*var isRev="";
	var isDepClas = false;
	
	if (pviFile.charAt(11) == 'P' || pviFile.charAt(11) == 'F') isDepClas = true;
			
	iResolucion = parseInt(iResolucion);
	if(iResolucion < 1024){

			if (isDepClas == true) {
					iHeight = 850;
					isRev = "_DEP";
			} else {
					iHeight = 1435;	
			}
			iWidth = 775;

	}	
	else{ 
		if(iResolucion < 1280 ){ 

			if (isDepClas == true) {
					iHeight = 1100;
					isRev = "_DEP";
			} else {
					iHeight = 1845;
			}
			iWidth = 1000;				

		}
		else{ 
			if(iResolucion < 1600){

				if (isDepClas == true) {
						iHeight = 1320;
						isRev = "_DEP";
				} else {
						iHeight = 2310;
				}
				iWidth = 1255;					
				
			}	
			else{ 
				if(iResolucion >= 1600){

					if (isDepClas == true) {
							iHeight = 1680;
							isRev = "_DEP";
					} else {
							iHeight = 3000;
					}
					iWidth = 1570;		
				}
				
			 }	
		}
	}
	return isRev;
	*/
}
/*
function SetDimensionBox(iResolucion,pviFile)
{
	var isRev="";

	iResolucion = parseInt(iResolucion);
	if(iResolucion <= 800){

			if (pviFile.charAt(11) == 'P' || pviFile.charAt(11) == 'F') {
					iHeight = 850;
					isRev = "_DEP";
			} else {
					iHeight = 1435;	
			}
			iWidth = 775;

	}	
	else if(iResolucion <= 1024 || iResolucion < 1260 ){ 

			if (pviFile.charAt(11) == 'P' || pviFile.charAt(11) == 'F') {
					iHeight = 1100;
					isRev = "_DEP";
			} else {
					iHeight = 1845;
			}
			iWidth = 1000;				

		 }
	 else if(iResolucion >= 1260){

			if (pviFile.charAt(11) == 'P' || pviFile.charAt(11) == 'F') {
					iHeight = 1320;
					isRev = "_DEP";
			} else {
					iHeight = 2310;
			}
			iWidth = 1255;					
			
		  }	
		  else{
			iWidth = 1000;
			iHeight = 2000;
		  }
	return isRev;
}
*/

function showHideDiv(idThumb,iFlag)
{
	var existObj = document.getElementById(idThumb);

	if(existObj != null){
		if(iFlag == "S"){
			document.getElementById(idThumb).style.visibility = "visible";
		}
		else{
			document.getElementById(idThumb).style.visibility = "hidden";
		}
	}
}

function destacaTitle(idNota)
{
	for (i=0; i<=arrIdsNotas.length-1; i++)
	{
		if(arrIdsNotas[i] == idNota){ 
			document.getElementById(idNota).style.background = "yellow";
		}
		else document.getElementById(arrIdsNotas[i]).style.background = "white";
	}
}
function openHojearFull(strUrl)
{
	var HojearFull=window.open(strUrl,'HojearFull','scrollbars=yes,resizable=no,fullscreen=YES');
    if(HojearFull)
    {
        HojearFull.focus();
    }
    else
    {
        alert('Deshabilite el bloqueador de pop-up de su navegador');
    }
}

function submitLink(cuerpo,fecha,loadCuerpo,strLink,method,target) 
{
	document.loadCuerpo.action = strLink;
	document.loadCuerpo.target = target;
	document.loadCuerpo.method = method;
	document.loadCuerpo.cuerpo.value = cuerpo;
	document.loadCuerpo.fecha.value = fecha;
	document.loadCuerpo.submit();
}