n4 = (document.layers)? true:false
ie = (document.all)? true:false
n6 = (document.getElementById)? true:false
var popTimer=0;
function showhide(Que){
 if (Que.style.display=='none'){
  Que.style.display='';
 } else {
  Que.style.display='none';
 }
}
function MasInfoShow(Objeto) {
 clearTimeout(popTimer);
 if (n4)
  document.ventana.document.layers[Objeto].visibility="show"
 else if (ie)
  document.all[Objeto].style.visibility="visible"
 else if (n6)
  document.getElementById(Objeto).style.visibility="visible"
}
function MasInfoHide(Objeto) {
 if (n4)
  document.ventana.document.layers[Objeto].visibility="hide"
 else if (ie)
  document.all[Objeto].style.visibility="hidden"
 else if (n6)
  document.getElementById(Objeto).style.visibility="hidden";
}

function PopUp(pagina,paginan,ancho,alto,left,top,sb) {
 if (paginan==undefined){paginan='KingEuphorea'}
 if (sb==undefined){sb='yes'}
 open(pagina,paginan,'width='+ ancho +',height='+ alto +',left='+ left +',top='+ top +',scrollbars='+ sb +',toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,titlebar=no');
}
function mOvr(src,colorc) {
// if (!src.contains(event.fromElement)) {
  src.style.cursor='pointer';
  src.bgColor=colorc;
// }
}
function mOut(src,colorc) {
// if (!src.contains(event.toElement)) {
  src.style.cursor='default';
  src.bgColor=colorc;
// }
}
function mClk(src) {
 self.location.href=document.getElementById(src).href;
}
function ColorCelda(id,tipo) {
 var id=eval("document.all."+id);
 if (tipo==1) {
  id.bgColor='yellow';
 } else {
  id.bgColor='#ffffff';
 }
}
function Abrir(Cual,Pagina,Ancho,Alto,Izquierda,Arriba) { 
 Abre=open(Cual,Pagina,'width='+Ancho+',height='+Alto+',left='+Izquierda+',top='+Arriba+',scrollbars=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,titlebar=no');
}

function VerFoto(foto,fondo,texto){
 var foto, fondo, texto;
 if (!fondo || fondo=='') fondo="white";
 window.open('mostrarfoto.php?foto='+ foto +'&fondo='+ fondo +'&texto='+ texto,'',"toolbar=no,scrollbars=no,left=200,width=10,height=10");
}
function MM_findObj(n, d) { //v4.01 - Busca Objeto
 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);
 if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_preloadImages() { //v3.0 - PRE Cargar imágenes
 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_swapImage() { //v3.0 - Intercambiar Imagen
 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_swapImgRestore() { //v3.0 - Restaurar Imagen
 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 MuestraOculta(Que){
 if (document.getElementById(Que).style.display=='none'){
  document.getElementById(Que).style.display='';
 } else {
  document.getElementById(Que).style.display='none'
 }
}
function InsertarEnContenedor(id,html,ProcesarScripts) {
 ContenedorPrincipal = document.getElementById(id);
 ContenedorPrincipal.innerHTML = html;
 if (ProcesarScripts!=false) {
  var elementos = ContenedorPrincipal.getElementsByTagName('script');
  for (i=0;i<elementos.length;i++) {
   var etiquetaScript=document.createElement("script");
   document.getElementsByTagName("head")[0].appendChild(etiquetaScript);
   etiquetaScript.text=elementos[0].innerHTML;
  }
 }
}
function nuevoAjax() {
 if (window.XMLHttpRequest)
  oAjax = new XMLHttpRequest();
 else if (window.ActiveXObject)
  oAjax = new ActiveXObject("Microsoft.XMLHTTP");
 if (oAjax) return(oAjax);
}
function AbreURL(url,cont,valores,metodo) {
 if (url == '') return;
 cont_id = document.getElementById(cont);
 var oAjax = nuevoAjax();
 oAjax.onreadystatechange = function ajaxStateChange() {
  if(oAjax.readyState == 4) {
   InsertarEnContenedor(cont, oAjax.responseText, true); 
  } else {
   cont_id.innerHTML = "<div align=center style='font-family:verdana;font-size:8pt;'>procesando...</div>";
  }
 }
 if (metodo.toUpperCase() == "POST") {
  oAjax.open("POST", url, true);
  oAjax.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
  oAjax.send(valores);
 } else if (metodo.toUpperCase() == "GET") {
  oAjax.open("GET", url, true);
  oAjax.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
  oAjax.send(null);
 }
}

