var ie=false;
      	var ns6=false;
      	var ns4=false;
      	if(document.all)ie = true;
      	else if(document.getElementById)ns6 = true;	
      	else ns4 = true;
      	var clicked=null;
      
       function clickon(capa,capa2){	   
	   if(clicked!=null){
	   	clickoff(clicked,clicked2);
	   }
	   clicked=capa;
	   clicked2=capa2;
	   divsee(capa);	   	   
	   divsee(capa2);	   
      }
      
      function clickoff(capa,capa2){
         divhide(capa);
         divhide(capa2);
      }
      
      function divhide(divn){
      	if(ns4)document.layers[divn].visibility="hidden";
      	else if(ie)eval("document.all."+divn+".style.visibility='hidden'");
      	else if(ns6)document.getElementById(divn).style.visibility="hidden";
      }      
      
      function divsee(divn){
      	if(ns4)document.layers[divn].visibility="visible";
      	else if(ie)eval("document.all."+divn+".style.visibility='visible'");
      	else if(ns6)document.getElementById(divn).style.visibility="visible";
      }


      function over(cambiar,nombre){
        
		  //el archivo rollover siempre tiene que acabar en loquesea_ro.laextensionquesea
		  
		  var pathImagen = document.getElementById(nombre).src;
		  var longitud = pathImagen.length;
		  var ext = pathImagen.substr(longitud-4);
		  
		  var arch = cambiar.indexOf('_ro');
		  
		  if (arch != -1){
		  		var pos = (cambiar.length - 3)+4;		
				var dir = pathImagen.substr(0,longitud - pos);
		  }else{
		  		var pos = (cambiar.length + 3)+4;		
				var dir = pathImagen.substr(0,longitud - pos);
		  }		  	
		  //alert(dir +'   ' + arch + '   ' + longitud + '   '+ pathImagen);
		  
		  if (navigator.appName.toLowerCase() == 'netscape' && navigator.appVersion.substring(0,3) < 5.0)
        {
           document.RestoPagina.document.images[nombre].src = dir + cambiar + ext;
        }
        else
        {
           window.document.images[nombre].src = dir + cambiar + ext;
        }
     
}



  var popWnd; //Objeto ventana de popup

  function abrir1(htmlfile, wndWidth, wndHeight) {
    var maxWidth = screen.width-10;
    var maxHeight = screen.height-56;

    //Preprocesado de parámetros
    if (wndHeight==0) wndHeight = maxHeight;
    if (wndWidth==0) wndWidth = maxWidth;

    //Calculo de la posición para centrar la ventana
    var posX = maxWidth/2 - wndWidth/2;
    var posY = maxHeight/2 - wndHeight/2;

    if (popWnd) popWnd.close();
    popWnd = open(htmlfile, 'popup', 'resizable=0,toolbar=0,scrollbars=1,location=0,directories=0,status=0,menubar=0,width='+wndWidth+',height='+wndHeight+',screenX=0,screenY=0,left='+posX+',top='+posY);

    //this.blur();
    popWnd.focus();
  }
  
  function abrir_sinscroll(htmlfile, wndWidth, wndHeight) {
    var maxWidth = screen.width-10;
    var maxHeight = screen.height-56;

    //Preprocesado de parámetros
    if (wndHeight==0) wndHeight = maxHeight;
    if (wndWidth==0) wndWidth = maxWidth;

    //Calculo de la posición para centrar la ventana
    var posX = maxWidth/2 - wndWidth/2;
    var posY = maxHeight/2 - wndHeight/2;

    if (popWnd) popWnd.close();
    popWnd = open(htmlfile, 'popup', 'resizable=0,toolbar=0,scrollbars=no,location=0,directories=0,status=0,menubar=0,width='+wndWidth+',height='+wndHeight+',screenX=0,screenY=0,left='+posX+',top='+posY);

    //this.blur();
    popWnd.focus();
  } 
  
  function abrirX(htmlfile, wndWidth, wndHeight) {
    var maxWidth = screen.width-10;
    var maxHeight = screen.height-56;

    //Preprocesado de parámetros
    if (wndHeight==0) wndHeight = maxHeight;
    if (wndWidth==0) wndWidth = maxWidth;

    //Calculo de la posición para centrar la ventana
    var posX = maxWidth/2 - wndWidth/2;
    var posY = maxHeight/2 - wndHeight/2;

    if (popWnd) popWnd.close();
    popWnd = open(htmlfile, 'popup2', 'resizable=1,toolbar=0,scrollbars=1,location=0,directories=0,status=0,menubar=0,width='+wndWidth+',height='+wndHeight+',screenX=0,screenY=0,left='+posX+',top='+posY);

    //this.blur();
    popWnd.focus();
  }
	function on(src,color_entrada,estilo) { 
    	src.bgColor=color_entrada; 
		src.style.cursor="hand";
	} 
	function off(src,color_default) { 
    	src.bgColor=color_default; 
		src.style.cursor="default"; 
	}
	
	
	
	//Funcion de Envio ed formulario de búsqueda
	function EnviarBusqueda(){
		if (document.frmBuscar.clave.value == ""){
				alert('Debe introducir un criterio de busqueda');
			}
		else{
			if (document.frmBuscar.clave.value.length < 3){
				alert('Debe introducir al menos 3 caracteres');
				}
			else{
				document.frmBuscar.submit();
				}
			} 				
	}
	
	//Funcion de Envio ed formulario de búsqueda
	function EnviarBusqueda2(){
		if (document.frmBuscar.clave.value == ""){
				alert('You must input one search criteria at least');
			}
		else{
			if (document.frmBuscar.clave.value.length < 3){
				alert('You must input 3 characters at least');
				}
			else{
				document.frmBuscar.submit();
				}
			} 				
	}
	
	function abrirImpresion(htmlfile, nombre, wndWidth, wndHeight) {
  			var popWnd; //Objeto ventana de popup
    		var maxWidth = screen.width-10;
    		var maxHeight = screen.height-56;

    		//Preprocesado de parámetros
    		if (wndHeight==0) wndHeight = maxHeight;
    		if (wndWidth==0) wndWidth = maxWidth;

    		//Calculo de la posición para centrar la ventana
    		var posX = maxWidth/2 - wndWidth/2;
    		var posY = 5000;

    		if (popWnd) popWnd.close();
   			popWnd = open(htmlfile, nombre, 'resizable=0,toolbar=0,scrollbars=1,location=0,directories=0,status=0,menubar=0,width='+wndWidth+',height='+wndHeight+',screenX=0,screenY=0,left='+posX+',top='+posY);

    		//this.blur();
    		popWnd.focus();
  		}
