    if (window.opera != undefined){
        document.write("<style type='text/css'>");
		document.write(".delimita { max-width: 450px; max-height:485px;}");
		document.write("#cajainventario {max-height:500px;}");
		document.write("</style>");
	}

function imprSelec(nombre1,nombre2)
{
  var ficha1 = document.getElementById(nombre1);
  var ficha2 = document.getElementById(nombre2);
  var ventimp = window.open('','popimpr','top=0,left=0,height=600,width=800');
  	  ventimp.document.write("<head>");
      ventimp.document.write("<link href='../css/estilos.css' rel='stylesheet' type='text/css'/>");
	  ventimp.document.write("<link href='http://www.mcu.es/comun/css/estilos_wai.css' rel='stylesheet' type='text/css' />");
	  ventimp.document.write("<script language='javascript'>");
	  ventimp.document.write("function imprimirPagina() { if (window.opera != undefined){window.print(); window.close();} }");
	  ventimp.document.write("</script>");
	  ventimp.document.write("</head>");
	  ventimp.document.write("<body onload='imprimirPagina();' />");
	  ventimp.document.write( ficha1.innerHTML );
	  ventimp.document.write("<div id='caja2'>");
	  ventimp.document.write("<ul id='nada'>");
	  ventimp.document.write( ficha2.innerHTML );
	  ventimp.document.write("</ul>");
	  ventimp.document.write("</div>");
      ventimp.document.write("</body>");
      ventimp.document.close();
  if (window.opera != undefined){
  }
  else{
   	      ventimp.print();  
          ventimp.close(); 
  } 
}

function abre_cierra(n)
{
    if (eval("document.getElementsByTagName('DIV').subMenu"+n+".getAttribute('state') == 0"))
    {
    	
         eval("document.getElementsByTagName('DIV').subMenu"+n+".style.display = 'block';");
         eval("document.getElementsByTagName('DIV').subMenu"+n+".setAttribute('state','1')");
		 eval("document.images.im"+n+".src='../imagenes/lista_on.gif'");
		 if (window.opera != undefined){
 			eval("window.formu.desplegado"+n+".value='true'");

		 }
		 else{ 
		 	eval("document.formu.desplegado"+n+".value='true'");
		  	}
    } else
    {
        eval("document.getElementsByTagName('DIV').subMenu"+n+".style.display = 'none';");
        eval("document.getElementsByTagName('DIV').subMenu"+n+".setAttribute('state','0')");
		eval("document.images.im"+n+".src='../imagenes/lista_off.gif'");
		if (window.opera != undefined){
 			eval("window.formu.desplegado"+n+".value='false'");
		}
		else{ 
			eval("document.formu.desplegado"+n+".value='false'");
		}
    }
}

function abre_cierra2(n,nombre)
{
    if (eval("document.getElementsByTagName('DIV').subMenu"+n+".getAttribute('state') == 0"))
    {
        eval("document.getElementsByTagName('DIV').subMenu"+n+".style.display = 'block';");
        eval("document.getElementsByTagName('DIV').subMenu"+n+".setAttribute('state','1')");
		eval("document.images.im"+n+".src='../imagenes/lista_on.gif'");
		if (window.opera != undefined){
 			eval("window.formu."+nombre+".value='true'");
		}
		else eval("document.formu."+nombre+".value='true'");
    } else
    {
        eval("document.getElementsByTagName('DIV').subMenu"+n+".style.display = 'none';");
        eval("document.getElementsByTagName('DIV').subMenu"+n+".setAttribute('state','0')");
		eval("document.images.im"+n+".src='../imagenes/lista_off.gif'");
		if (window.opera != undefined){
 			eval("window.formu."+nombre+".value='false'");
		}
		else eval("document.formu."+nombre+".value='false'");
    }
}

function abre_cierra3(n)
{
    if (eval("document.getElementsByTagName('DIV').subMenu"+n+".getAttribute('state') == 0"))
    {
         eval("document.getElementsByTagName('DIV').subMenu"+n+".style.display = 'block';");
         eval("document.getElementsByTagName('DIV').subMenu"+n+".setAttribute('state','1')");
		 eval("document.images.im"+n+".src='../imagenes/lista_on.gif'");
    } else
    {
        eval("document.getElementsByTagName('DIV').subMenu"+n+".style.display = 'none';");
        eval("document.getElementsByTagName('DIV').subMenu"+n+".setAttribute('state','0')");
		eval("document.images.im"+n+".src='../imagenes/lista_off.gif'");
    }
}

function deseleccionar_todo(formu,estado){
if(estado==true){
	for (i=0;i<document.formu.elements.length;i++){
		if(document.formu.elements[i].type == 'checkbox'){
			if(document.formu.elements[i].id=="checkbox"+formu){	
				document.formu.elements[i].checked=0;
				document.formu.elements[i].disabled=true;
				}
			}
			}
}else{
for (i=0;i<document.formu.elements.length;i++){
		if(document.formu.elements[i].type == 'checkbox'){
			if(document.formu.elements[i].id=="checkbox"+formu){	
				document.formu.elements[i].disabled=false;
				}
			}
			}
}
}
//jesus
function Abrir_ventana_integracion(pagina) {

	 var ids = "";
	
	 if (document.formuVisor != null)	//vengo de unidaddescripcion
	 {
		 
		var checkboxes = document.getElementsByName('txt_id_descs');
		for (var i = 0; i < checkboxes.length; i++)        
		{		
    	    if(checkboxes[i].checked == true)
		   	ids += (checkboxes[i].value).toString() + ",";
		}
		ids = ids.substring(0,ids.length-1); 
		//alert(pagina);
	 	
	 	ventana=window.open(pagina, "integracionPares", "toolbar=no, location=no, directories=no, status=no, menubar=no ,scrollbars=no, resizable=no, fullscreen=no" + ",width=" + eval(screen.availWidth-8) + ",height=" + eval(screen.availHeight-65) + ",top=0, left=0");
	 //	ventana.location.reload(true);
	 	
	 }
	 else	// vengo de unidaddocumental
	 {
		
		var checkboxes = document.getElementsByName('txt_id_descs');
		for (var i = 0; i < checkboxes.length; i++)        
		{		
    	    if(checkboxes[i].checked == true)
		   	ids += (checkboxes[i].value).toString() + ",";
		}
			
		ids = ids.substring(0,ids.length-1); 
		//alert("la ids compuesta es " + ids);
		pagina += "&iddesc=" + ids;
		//alert(pagina);
		if (ids != "")
		{
			ventana=window.open(pagina, "integracionPares", "toolbar=no, location=no, directories=no, status=no, menubar=no ,scrollbars=no, resizable=no, fullscreen=no" + ",width=" + eval(screen.availWidth-8) + ",height=" + eval(screen.availHeight-65) + ",top=0, left=0");
		//	ventana.location.reload(true);
		}
		
	 }
	 

 	
 
}