	function EditorArt(Url){

	   var parentObj = document.getElementById('capafoto7');
	    var content;
	   parentObj.innerHTML = ""
	   var editBox = document.createElement('DIV');
	    editBox.style.clear='both';
	    editBox.id = 'noticia';
	    editBox.style.display='inline';
	    if (Url=='bloqueAD_1.asp?editar=1'){
	      content ='<iframe src="./CentroGestion/'+ Url +'" align="left" frameborder="0" marginwidth="0" marginheight="0" width="550px" height="300px" scrolling="yes"></iframe>' 
		}else{
		  content ='<iframe src="./CentroGestion/'+ Url +'" align="left" frameborder="0" marginwidth="0" marginheight="0" width="540px" height="500px" scrolling="yes"></iframe>' 
		}
		editBox.innerHTML = content;
	    parentObj.appendChild(editBox);
        
        thisMenu=document.getElementById('capanot').style
			thisMenu.top="0px";
			  if (mx>0){   
				thisMenu.left=mx-220;
		     }else{
		        thisMenu.left="0px"
		     }
				b = 0
			    c = 0
			 
			
			if (b > 0) {
				my = my + b;
				}
			if (c > 0) {
				mx = mx + c;
				}	
			if (Url=='bloqueAD_1.asp?editar=1'){
	        thisMenu.width="550";
			thisMenu.height="300";
			 document.getElementById('capafoto7').style.width="380";
			 document.getElementById('capafoto7').style.height="300";
			}else{
			thisMenu.width="550";
			thisMenu.height="500";
			 document.getElementById('capafoto7').style.width="550";
			 document.getElementById('capafoto7').style.height="500";
			}
			thisMenu.position="absolute";
			thisMenu.top=0;
			thisMenu.left=mx-100;
		    if (thisMenu.visibility=="visible"){
			 document.getElementById('capafoto7').style.visibility="hidden";
			 document.getElementById('capafoto7').style.display="none";
			  thisMenu.visibility="hidden";
			  thisMenu.display="none";
			
			  }else{
			   document.getElementById('capafoto7').style.visibility="visible";
			 document.getElementById('capafoto7').style.display="inline";
			thisMenu.visibility="visible";
			thisMenu.display="inline";
			
			  }
    	
	}
	function Modificar(cap,cvc){
			
			if(document.getElementById){
			
			thisElemForm=document.getElementById(cap)
			
			thisMenu=document.getElementById(cap).style
		   	
				b = 0
			    c = 0
			 
			
			if (b > 0) {
				my = my + b;
				}
				
				if (c > 0) {
				mx = mx + c;
				}	
			thisMenu.position="absolute"
			thisMenu.top="0px";
			thisMenu.left="0px";
			thisMenu.top=my;
		    thisMenu.top="0px";
			if (mx>200){   
				thisMenu.left=mx-200;
		     }else{
		        thisMenu.left="0px"
		     }
		     
		     //vamos a poner a cero todos los campos do formulario
		     
		     formulario.TitNotCVC.value=""
		     formulario.enlNotCVC.value=""
		     formulario.resumenNotCVC.value=""
		     formulario.destacada.checked=0
		     formulario.txtUrlNotCVC.value=""
		     
		     

		     
			if (thisMenu.visibility=="visible"){
			  thisMenu.visibility="hidden";
			  thisMenu.display="none";
			 document.formulario.cvcmenu1.value=0
			}else{
			thisMenu.visibility="visible";
		    thisMenu.display="inline";
		    document.formulario.cvcmenu1.value=cvc
			  }
			}
		}
		
		
		function ModificarCVC(cap,cvc,apa){
			
			if(document.getElementById){
			
			thisMenu=document.getElementById(cap).style
		   	
				b = 0
			    c = 0
			 
			
			if (b > 0) {
				my = my + b;
				}
				
				if (c > 0) {
				mx = mx + c;
				}	
			thisMenu.position="absolute"
			thisMenu.top="0px";
			thisMenu.left="0px";
		  	thisMenu.top=my;
		    if (mx>220){   
				thisMenu.left=mx-220;
		     }else{
		        thisMenu.left="0px"
		     }
			if (thisMenu.visibility=="visible"){
			  thisMenu.visibility="hidden";
			  thisMenu.display="none";
			 document.formulario.cvcmenu1.value=0
			 document.formulario.apariencia.value=0
			}else{
			thisMenu.visibility="visible";
		    thisMenu.display="inline";
		    document.formulario.cvcmenu1.value=cvc
		    document.formulario.apariencia.value=1
			  }
			}
			

			
		}
		function SetUrl(url)
		{
		  		
  		
  		 if (document.getElementById('capa2').style.visibility=="visible"){
			 document.formulario.txtUrl.value = url ;
  			 document.getElementById('capafoto2').style.visibility="visible";
  			 document.getElementById('capafoto2').innerHTML ='<img alt="" src="./imagenes' + url + '"  border="0">';
			}
			
			if (document.getElementById('capaNotCVC').style.visibility=="visible"){
			 document.formulario.txtUrlNotCVC.value = url ;
  			 document.getElementById('capanotfotocvc').style.visibility="visible";
  			 document.getElementById('capanotfotocvc').innerHTML ='<img alt="" src="./imagenes' + url + '"  border="0">';
			}
			
  		 if (document.getElementById('capa3').style.visibility=="visible"){
			 document.formulario.txtUrl3.value = url ;
  			 document.getElementById('capafoto3').style.visibility="visible";
  			 document.getElementById('capafoto3').innerHTML ='<img alt="" src="./imagenes' + url + '"  border="0">';
			}
	
}

	
	
	
		function ModificarMenu(cap,cod,cod2){
		     document.formulario.grabar2.value=0
		     document.formulario.grabar1.value=cod
			 document.formulario.grabar2.value=cod
			 document.formulario.grabar3.value=cod2
		if(document.getElementById){
			
			thisMenu=document.getElementById(cap).style
		
				b = 0
			    c = 0
			 var e;
			
			if (b > 0) {
				my = my + b;
				}
				
				if (c > 0) {
				mx = mx + c;
				}	
		   
		     
			thisMenu.width="220";
			thisMenu.height="150";
		    thisMenu.position="absolute"
		    thisMenu.top='0px';
		    thisMenu.left='0px';
			thisMenu.top=my;
			
		     if (mx>250){   
				thisMenu.left=mx-200;
		     }else{
		        thisMenu.left="0px"
		     }
		    if (thisMenu.visibility=="visible"){
			  thisMenu.visibility="hidden";
			  thisMenu.display="none";
			}else{
			thisMenu.visibility="visible";
			thisMenu.display="inline";
			  }
			}
		}
			
		
		function ModMenu1(Nombre,url,color,cod){
		     var flecha=cod;
		     var capa;
		
		     document.formulario.grabar1.value=1;
			 document.formulario.borrar1.value=0;
			 document.formulario.borrar2.value=0;
			 document.formulario.borrar3.value=0;
			 document.formulario.grabar3.value=0;
			 document.formulario.borrar3.value=0;
			 document.formulario.nombre.value=Nombre;
			 document.formulario.enlace.value=url;
			 document.formulario.mod1.value=cod
			 document.formulario.mod2.value=0
			 document.formulario.mod3.value=0

	/*	var parentObj = document.getElementById(capa);
		var editLink = document.createElement('A');
		editLink.href = '#';
		editLink.onclick = cancelEvent;
		editLink.style.cssText = 'float:right';
		editLink.style.styleFloat = 'right';
		editLink.id = capa;
		editLink.innerHTML =  txt_editLink ;
		editLink.className = 'dragableBoxEditLink';
		editLink.style.cursor = 'pointer'; 
	    editLink.style.visibility = 'hidden';
		editLink.style.visibility = 'visible';
		editLink.onmousedown = editRSSContent;
		parentObj.appendChild(editLink)
        var editBox = document.createElement('DIV');
		editBox.style.clear='both';
		boxIndex=1
		editBox.id = 'dragableBoxEdit' + boxIndex;
		editBox.style.display='none';
	
	//	var content = '<form><table cellpadding="1" cellspacing="1"><tr><td>Source:<\/td><td><input type="text" id="rssUrl[' + boxIndex + ']" v size="25" maxlength="255"><\/td><\/tr>'
		//+ '<tr><td>Items:<\/td><td width="30"><input type="text" id="maxRssItems[' + boxIndex + ']" onblur="this.value = this.value.replace(/[^0-9]/g,\'\');if(!this.value)this.value=' + dragableBoxesArray[boxIndex]['maxRssItems'] + '" value="' + dragableBoxesArray[boxIndex]['maxRssItems'] + '" size="2" maxlength="2"><\/td><\/tr><tr><td>Fixed height:<\/td><td><input type="text" id="heightOfBox[' + boxIndex + ']" onblur="this.value = this.value.replace(/[^0-9]/g,\'\');if(!this.value)this.value=' + dragableBoxesArray[boxIndex]['heightOfBox'] + '" value="' + dragableBoxesArray[boxIndex]['heightOfBox'] + '" size="2" maxlength="3"><\/td><\/tr><tr>'
	//	//+'<tr><td>Reload every:<\/td><td width="30"><input type="text" id="minutesBeforeReload[' + boxIndex + ']" onblur="this.value = this.value.replace(/[^0-9]/g,\'\');if(!this.value || this.value/1<5)this.value=' + dragableBoxesArray[boxIndex]['minutesBeforeReload'] + '" value="' + dragableBoxesArray[boxIndex]['minutesBeforeReload'] + '" size="2" maxlength="3">&nbsp;minute<\/td><\/tr>'
	//	+'<tr><td><input type="button" onclick="saveFeed(' + boxIndex + ')" value="Save"><\/td><\/tr><\/table><\/form>';
		//editBox.innerHTML = content;
		
		parentObj.appendChild(editBox);*/
			 
			  if (color=="72776D"){
		    	 document.formulario.color.selectedIndex=1;
		       }else if (color=="5E5D6E"){
		       document.formulario.color.selectedIndex=2;
		       }else if (color=="AF2B2B"){
		       document.formulario.color.selectedIndex=3;
		       }else if (color=="FF0000"){
		       document.formulario.color.selectedIndex=4;
		       }else{
		       document.formulario.color.selectedIndex=0;
		       }
			if(document.getElementById){
			thisMenu=document.getElementById('capa1').style
			b = 0
		    thisMenu.position="absolute"
		    thisMenu.left='0px';
		    thisMenu.top='0px';
		    thisMenu.left='0px';
			thisMenu.top=my;
			  if (mx>220){   
				thisMenu.left=mx-200;
		     }else{
		        thisMenu.left="0px"
		     }
		    if (thisMenu.visibility=="visible"){
			  thisMenu.visibility="hidden";
			  thisMenu.display="none";
			  //document.getElementById(flecha).src='./imagenes/abajo.gif';
			  }else{
			thisMenu.visibility="visible";
			thisMenu.display="inline";
			//document.getElementById(flecha).src='./imagenes/arriba.gif';
			  }
			}
		}
		
		function editRSSContent()
	{
		
	   	var numericId = this.id.replace(/[^0-9]/g,'');
	  
		var obj = document.getElementById('dragableBoxEdit1');
	 
		if(obj.style.display=='none'){
			obj.style.display='inline';
			this.innerHTML = txt_editLink_stop;
			document.getElementById('dragableBoxEdit1').style.height = '135px';
		}else{
			obj.style.display='none';
			this.innerHTML = txt_editLink;
			document.getElementById('dragableBoxEdit1').style.height = '20px';
		}
		setTimeout('dragDropCounter=-5',5);
	}
		
		function ModMenu2(Nombre,url,foto,ap,cod,cod2){
		     var flecha=cod2;
		     
		     document.formulario.grabar1.value=1;
			 document.formulario.borrar1.value=0;
			 document.formulario.borrar2.value=0;
			 document.formulario.borrar3.value=0;
			 document.formulario.grabar3.value=0;
			 document.formulario.borrar3.value=0;
			 document.formulario.nombremenu2.value=Nombre;
			 document.formulario.enlacemenu2.value=url;
			 document.formulario.txtUrl.value=foto
			 
			  if (ap==1){
		    	 document.formulario.Radio5.checked=true;
		       }else if (ap==2){
				  document.formulario.Radio7.checked=true;
		       }else if (ap==3){
				 document.formulario.Radio6.checked=true;;
		       }else{
				 document.formulario.Radio5.selectedIndex=0;
		       }
			 
			 document.formulario.mod1.value=cod
			 document.formulario.mod2.value=cod2
			 document.formulario.mod3.value=0
			
			 
			if(document.getElementById){
			
			thisMenu=document.getElementById('capa2').style
			thisMenu.top="0px";
			thisMenu.left="0px";
				b = 0
			    c = 0
			 
			
			if (b > 0) {
				my = my + b;
				}
				
				if (c > 0) {
				mx = mx + c;
				}	
			thisMenu.position="absolute"
			thisMenu.top=my;
			thisMenu.left='0px';
			thisMenu.width="220";
			thisMenu.height="150";
			  if (mx>220){   
				thisMenu.left=mx-220;
		     }else{
		        thisMenu.left="0px"
		     }
		    if (thisMenu.visibility=="visible"){
			   thisMenu.visibility="hidden";
			  thisMenu.display="none";
			//  document.getElementById(flecha).src='./imagenes/abajo.gif';
			  }else{
			thisMenu.visibility="visible";
			thisMenu.display="inline";
			//document.getElementById(flecha).src='./imagenes/arriba.gif';
			  }
			}
		}
	function ModificarNot(titulo,resumen,url,foto,ap,cod,destacada){
				
	         document.formulario.grabar1.value=0;
			 document.formulario.borrar1.value=0;
			 document.formulario.borrar2.value=0;
			 document.formulario.borrar3.value=0;
			 document.formulario.grabar3.value=0;
			 document.formulario.borrar3.value=0;
			 document.formulario.TitNotCVC.value=titulo;
			 document.formulario.enlNotCVC.value=url;
			 document.formulario.txtUrlNotCVC.value=foto;
			 document.formulario.resumenNotCVC.value=resumen;
			 document.formulario.ModCVC.value=cod;
			 if (destacada==1){
			      document.formulario.destacada.checked=true;
			      document.formulario.destacada.disabled=true;
			 }else{
				document.formulario.destacada.checked=false;
				document.formulario.destacada.disabled=false;
			 }
			  if (ap==1){
		    		 document.formulario.centralNotCVC.checked=true;
		       }else if (ap==3){
				  document.formulario.IzqNotCVC.checked=true;
		       }else if (ap==2){
				 document.formulario.derchNotCVC.checked=true;;
		       }else{
				 document.formulario.centralNotCVC.selectedIndex=0;
		       }
			 
			 
		       
			if(document.getElementById){
			
			thisMenu=document.getElementById('capanotcvc').style
				thisMenu.top="0px";
			thisMenu.left="0px";
				b = 0
			    c = 0
			 
			
			if (b > 0) {
				my = my + b;
				}
				
				if (c > 0) {
				mx = mx + c;
				}	
			
			thisMenu.width="220";
			thisMenu.height="150";
			thisMenu.position="absolute";
			thisMenu.top=my;
			thisMenu.left='0px';
			  if (mx>220){   
				thisMenu.left=mx-220;
		     }else{
		        thisMenu.left="0px"
		     }
		    if (thisMenu.visibility=="visible"){
			  thisMenu.visibility="hidden";
			  thisMenu.display="none";
			//  document.getElementById(flecha).src='./imagenes/abajo.gif';
			  }else{
			thisMenu.visibility="visible";
			thisMenu.display="inline";
		//	document.getElementById(flecha).src='./imagenes/arriba.gif';
			  }
			}
			
		
	}
	
			function borrarNoticiaCVC(CodNot){
			
            if(confirm("Va a borrar una sección\n¿desea continuar?")){
			window.location="portada.asp?BorrarNotCVC=Si&CodNot=" + CodNot
		    }
		}
	
	
	function ModMenu3(Nombre,url,foto,ap,cod,cod2,cod3){
		     var flecha=cod3
		     document.formulario.grabar1.value=0;
			 document.formulario.borrar1.value=0;
			 document.formulario.borrar2.value=0;
			 document.formulario.borrar3.value=0;
			 document.formulario.grabar3.value=0;
			 document.formulario.borrar3.value=0;
			 document.formulario.nombremenu3.value=Nombre;
			 document.formulario.enlacemenu3.value=url;
			 document.formulario.txtUrl3.value=foto
			 
			  if (ap==1){
		    		 document.formulario.central3.checked=true;
		       }else if (ap==3){
				  document.formulario.Radio3.checked=true;
		       }else if (ap==2){
				 document.formulario.Radio4.checked=true;;
		       }else{
				 document.formulario.central3.selectedIndex=0;
		       }
			 document.formulario.mod1.value=cod
			 document.formulario.mod2.value=cod2
			 document.formulario.mod3.value=cod3
			 
		       
			if(document.getElementById){
			
			thisMenu=document.getElementById('capa3').style
				thisMenu.top="0px";
			thisMenu.left="0px";
				b = 0
			    c = 0
			 
			
			if (b > 0) {
				my = my + b;
				}
				
				if (c > 0) {
				mx = mx + c;
				}	
			
			thisMenu.width="220";
			thisMenu.height="150";
			thisMenu.position="absolute";
			thisMenu.top=my;
			  if (mx>220){   
				thisMenu.left=mx-220;
		     }else{
		        thisMenu.left="0px"
		     }
			
		    if (thisMenu.visibility=="visible"){
			  thisMenu.visibility="hidden";
			  thisMenu.display="none";
			 // document.getElementById(flecha).src='./imagenes/abajo.gif';
			  }else{
			thisMenu.visibility="visible";
			thisMenu.display="inline";
			//document.getElementById(flecha).src='./imagenes/arriba.gif';
			  }
			}
		}
	
	
		function ocultarcapa(cap,capf){
		  var flecha;
			if(cap=='capa1')
			{
			  flecha=document.formulario.mod1.value;
			  document.formulario.nombre.value="";
			  document.formulario.enlace.value="";
			  document.formulario.color.value="";
			  document.formulario.mod1.value=0;
			}
			if(cap=='capa2')
			{
			  flecha=document.formulario.mod2.value;
			  document.formulario.nombremenu2.value="";
			  document.formulario.enlacemenu2.value="";
			  document.formulario.txtUrl.value="";
			  document.formulario.Radio5.checked=true;
			}
			if(cap=='capa3')
			{
			  flecha=document.formulario.mod3.value;
			  document.formulario.nombremenu3.value="";
			  document.formulario.enlacemenu3.value="";
			  document.formulario.txtUrl3.value="";
			  document.formulario.central3.checked=true;
			}
		  thisMenu=document.getElementById(cap).style
		  document.getElementById(capf).style
		  if (document.getElementById(capf).style.visibility=="visible"){
			  document.getElementById(capf).style.visibility="hidden";
			 
			}else{
			document.getElementById(capf).style.visibility="visible";
			  }
		  if (thisMenu.visibility=="visible"){
			  thisMenu.visibility="hidden";
			   
			  thisMenu.display="none";
			
			 if (cap!='capa1'){
		//	   document.getElementById(flecha).src='./imagenes/abajo.gif';
			   }
			}else{
			thisMenu.visibility="visible";
			thisMenu.display="inline";
			 if (cap!='capa1'){
		//	 document.getElementById(flecha).src='./imagenes/abajo.gif';
			 }
			  }
		}
		function borrarMenu(codigo1,codigo2,codigo3,b){
		    if(confirm("Va a borrar una sección\n¿desea continuar?")){
			 if (document.formulario.menu2.value>0)
			  {
			 	if (confirm("Va a borrar una sección que tiene subsecciones"));	
			 	{ document.formulario.borrar1.value=codigo1;
					document.formulario.borrar2.value=codigo2;
					document.formulario.borrar3.value=codigo3;
					document.formulario.grabar1.value=0;
					document.formulario.grabar2.value=0;
					alert("Sección borrada");
					//document.formulario.action=window.location;
					document.formulario.submit();
						}
			  
			     }else{
						document.formulario.borrar1.value=codigo1;
						document.formulario.borrar2.value=codigo2;
						document.formulario.borrar3.value=codigo3;
						document.formulario.grabar1.value=0;
						document.formulario.grabar2.value=0;
							alert("Sección borrada");
						//document.formulario.action=window.location;
						document.formulario.submit();
			  
			  }
			  
			  }
			}
		function grabarMenu(){
			if (document.formulario.mod1.value!=0){
			 document.formulario.grabar1.value=0;
			}else{
			 document.formulario.grabar1.value=1;
			}
			 document.formulario.borrar1.value=0;
			 document.formulario.borrar2.value=0;
			 document.formulario.borrar3.value=0;
			 document.formulario.grabar3.value=0;
			 document.formulario.borrar3.value=0;
		//	 document.formulario.action="portada.asp";
			 document.formulario.submit();
			}
		function grabarMenu2(){
		   //  document.formulario.grabar1.value=0;
		 	 if (document.formulario.mod2.value!=0){
			 document.formulario.grabar1.value=0;
			 document.formulario.grabar2.value=0;
			 document.formulario.grabar3.value=0;
			}
		     document.formulario.grabar3.value=0;
		     document.formulario.borrar1.value=0;
		   	 document.formulario.borrar1.value=0;
			 document.formulario.borrar2.value=0;
			 document.formulario.borrar3.value=0;
			// document.formulario.action="portada.asp";
			 document.formulario.submit();
			}
		
	function grabarMenu3(){
	        if ( document.formulario.mod3.value!=0){
			 document.formulario.grabar1.value=0;
			 document.formulario.grabar2.value=0;
			 document.formulario.grabar3.value=0;
			}
		     document.formulario.borrar1.value=0;
			 document.formulario.borrar2.value=0;
			 document.formulario.borrar3.value=0;
			// document.formulario.action="portada.asp";
			 document.formulario.submit();
			}
		function GrabarNotCVC(){
		
		     document.formulario.borrar1.value=0;
			 document.formulario.borrar2.value=0;
			 document.formulario.borrar3.value=0;
			 document.formulario.grabar3.value=0;
			 document.formulario.grabar2.value=0;
			 document.formulario.grabar1.value=0;
			 if (document.formulario.destacada.checked==false){
			 	  document.formulario.destac.value=0;
			  
			 }else
			 {
			  document.formulario.destac.value=1;
			  
			 }
			 document.formulario.grabarNotCVC.value=1;
			// document.formulario.action="portada.asp";
			 document.formulario.submit();
		   }

			
			
		//muestra las capa de edición del editor a la derecha
			function Vereditor(cod){
			
		 	var capa= cod
		 
		 	thisMenu=document.getElementById(capa).style
		   
		    if (thisMenu.display=="none"){
		        document.getElementById(capa).style.display="inline";
			    thisMenu.visibility="visible";
				
					
			  } else{
				document.getElementById(capa).style.display="none";
			    thisMenu.visibility="hidden";
			  }   
			}
			function Vereditorout(cod){
			
		 	var capa= cod
		 	
		 	thisMenu=document.getElementById(capa).style
		   
		    if (thisMenu.display!="none"){
		   
			      document.getElementById(capa).style.display="none";
		          thisMenu.visibility="hidden";
			
			
			  }    
			}
			function VereditorCVC(cod){
			
			var capa=cod
		 	
		 	
		 	thisMenu=document.getElementById(capa).style
			
		    if (thisMenu.display=="none"){
		        document.getElementById(capa).style.display="inline";
			    thisMenu.visibility="visible";
				
				 
			}else{
			  
			  if(document.getElementById('capa1').style.visibility!='visible'){
			      document.getElementById(capa).style.display="none";
			      thisMenu.visibility="hidden";
			  }
			
			 }    
			
			}
			
			
			function VereditorCVCOver(cod){
			
			
			var capa=cod
		 	
		 	thisMenu=document.getElementById(capa).style
			
		    
		        document.getElementById(capa).style.display="inline";
			    thisMenu.visibility="visible";
				
	    
			
			}
			
			function VereditorCVCOut(cod){
			
			
			var capa=cod
		 	
		 	thisMenu=document.getElementById(capa).style

			      document.getElementById(capa).style.display="none";
			      thisMenu.visibility="hidden";
				
	  
			
			}
			
			
			function VereditorCentrofuera(cod){
			var capa= cod
		 	//alert(capa)
		 	thisMenu=document.getElementById(capa).style
		  
		   // if (thisMenu.visibility=="hidden"){
		       // document.getElementById(capa).style.display="inline";
			 //   thisMenu.visibility="visible";
				
				 
			//}else{
			  			  	 
			      thisMenu.display="none";
			  //}
			
			     
			}	
			function VereditorCentro(cod){
			
			var capa= cod
		 	//alert(capa)
		 	thisMenu=document.getElementById(capa).style
		  
		   // if (thisMenu.visibility=="hidden"){
		       // document.getElementById(capa).style.display="inline";
			    thisMenu.display="inline";
				
				 
		//	}else{
			  			  	 
			//     thisMenu.visibility="hidden";
			 // }
			
			     
			}
			//asigna valor a la variable para que edite el menu
		 	function Asignarcodigo(){
			 
			  document.formulario.cvcmenu1.value=1
			}
			//asigna valor a la variable para qeu edite las noticias del cvc
			function AsignarcodigoNot(){
			 
			  document.formulario.ModCVC.value=1
			}
	function EditorCodMenusCVC(Url){
		
	   var parentObj = document.getElementById('capafoto7');
	   var content;
	   parentObj.innerHTML = ""
	   var editBox = document.createElement('DIV');
	    editBox.style.clear='both';
	    editBox.id = 'noticia';
	    editBox.style.display='inline';
	   
	      content ='<iframe src="./CentroGestion/'+ Url +'" align="left" frameborder="0" marginwidth="0" marginheight="0" width="400px" height="300px" scrolling="No"></iframe>' 
		
		
		
		editBox.innerHTML = content;
	    parentObj.appendChild(editBox);
        
        thisMenu=document.getElementById('capanot').style
			thisMenu.top="0px";
			thisMenu.left="0px";
				b = 0
			    c = 0
			 
			
			if (b > 0) {
				my = my + b;
				}
				
				if (c > 0) {
				mx = mx + c;
				}	
			
			thisMenu.width="300";
			thisMenu.height="200";
			 document.getElementById('capafoto7').style.width="300";
			 document.getElementById('capafoto7').style.height="200";
			
			thisMenu.position="absolute";
			thisMenu.top=my;
			thisMenu.left=mx-200;
		    if (thisMenu.visibility=="visible"){
			 document.getElementById('capafoto7').style.visibility="hidden";
			 document.getElementById('capafoto7').style.display="none";
			  thisMenu.visibility="hidden";
			  thisMenu.display="none";
			
			  }else{
			   document.getElementById('capafoto7').style.visibility="visible";
			 document.getElementById('capafoto7').style.display="inline";
			thisMenu.visibility="visible";
			thisMenu.display="inline";
			
			  }
    	
	}
	
		function verCapa(nm_capa)
	{
		var capa;
		var td_capa;
		
		capa = document.getElementById(nm_capa);
		td_capa = document.getElementById('td_' + nm_capa);
		
		//capa.style.height = td_capa.height;
		//alert(capa.valign);
		//capa.valign = 'middle';
		
		capa.style.background = '#FFFFFF';
		capa.style.display = 'inline';
	}
	
	function ocultarCapa(nm_capa)
	{
		var capa;
		
		capa = document.getElementById(nm_capa);
		capa.style.display = 'none';
	}


// NUEVA VENTANA con rel="popup-600-400-yes" (ejemplo)

function abridorjmgh(){
var relfinal = this.rel.split("-");
var url = this.href;
window.open(url , "popup" , "width="+relfinal[1]+",height="+relfinal[2]+",scrollbars="+relfinal[3]+",statusbar=yes")
return false;
}

// NUEVA VENTANA con rel="external"

 function cambiaenlaces(){
 			enlaces = document.getElementsByTagName("a");
			for (i = 0; i < enlaces.length; i++){
				var rel = enlaces[i].rel.split("-");
				var relfinal = rel[0];
			if (relfinal=='popup'){
				enlaces[i].title = enlaces[i].title+" (se abre en ventana nueva)";
				enlaces[i].onclick=abridorjmgh;
			} else if (relfinal=='external') {
			enlaces[i].target="_blank";
			enlaces[i].title = enlaces[i].title+" (se abre en ventana nueva)";
			}
		}
	 }


//window.onload = cambiaenlaces;

//NOVEDADES OPAC (BIBLIOTECAS)
var arrMonth = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
function endMonth(nMes, nAno)
{
   return arrMonth[nMes - 1] + (((nMes == 2) && (nAno % 4) == 0)? 1: 0);
}
function padNmb(nStr, nLen, sChr)
{
	var sRes = String(nStr);
    for (var i = 0; i < nLen - String(nStr).length; i++)
		sRes = sChr + sRes;
    return sRes;
}
function makeDateFormat(nDay, nMonth, nYear)
{
    return padNmb(nDay, 2, "0") + "/" + padNmb(nMonth, 2, "0") + "/" + padNmb(nYear, 4, "0");
}
function decDate(p_date)
{
   var nDia = parseInt(p_date.substr(0, 2), 10);
   var nMes = parseInt(p_date.substr(3, 2), 10);
   var nAno = parseInt(p_date.substr(6, 4), 10);
   nDia -= 1;
   if (nDia == 0)
   {
     nMes -= 1;
     if (nMes == 0)
     {
       nMes = 12;
       nAno -= 1;
     }
     nDia = endMonth(nMes, nAno);
   }
   return makeDateFormat(nDia, nMes, nAno);
}
function addToDate(p_date, sInc)
{
   var nInc = Math.abs(parseInt(sInc));
   var sRes = p_date;
   for(var i = 0; i < nInc; i++)
		sRes = decDate(sRes);
   return sRes;
}
function complet(sVal, nPos)
{
	var sRes = sVal;
	for (var i = sVal.length; i < nPos; i++)
		sRes = "0" + sRes;
	return sRes;
}
function formatDate(nDia, nMes, nAno)
{
	var sRes = complet(String(nDia), 2);
	sRes = sRes + "/" + complet(String(nMes), 2);
	sRes = sRes + "/" + complet(String(nAno), 4);
	return sRes;
}
 
 
function traeNovedadesMesUnica(biblioteca,mate,objeto)
{
	
	var today = new Date();
	var nDay = today.getDate();
	var nMonth = today.getMonth()+1;
	var nYear = today.getFullYear();
	var nDate = formatDate(nDay, nMonth, nYear);
 
	
	var selIndex = "31";
	if(selIndex>0)
		nDate = addToDate(nDate, -selIndex);
 
	var nDia = nDate.substr(0,2);
    var nMes = nDate.substr(3,2);
    var nAno = nDate.substr(6,4);
    var query = "@copi >= " + nAno + nMes + nDia
	var nomBiblioteca = biblioteca;
	
	/* Añadido */
	var enlaces = document.getElementById("novedades_opac").getElementsByTagName("a");
	for (var i = 0; i < enlaces.length; i++){
		if (enlaces[i] == objeto) {
			document.getElementById("novedades_opac").getElementsByTagName("a")[i].href = "http://absysnet.cervantes.es/abnetopac02/abnetcl.exe/?ACC=DOSEARCH&FORM=05&xsqf99=" + biblioteca + " adj3 " + query + " y " + mate;
			document.getElementById("novedades_opac").getElementsByTagName("a")[i].target = "_blank";
		}
	}
	/* Fin añadido */
	
	//document.location.href = "http://absysnet.cervantes.es/abnetopac02/abnetcl.exe/?ACC=DOSEARCH&FORM=05&xsqf99=" + biblioteca + " adj3 " + query + " y " + mate;
	
}


//IMPORTAR ARCHIVOS JQUERY PARA TOOLTIPS EN RSS

/*function include(file)
{
  var script  = document.createElement('script');
  script.src  = file;
  script.type = 'text/javascript';
  script.defer = true;

  document.getElementsByTagName('head').item(0).appendChild(script);
}*/
/* include any js files here *//*
include('http://www.cervantes.es/comunes/js/jquery.min.js');
include('http://www.cervantes.es/comunes/js/jquery.qtip.js');*/



/*MÁS ANTIGUO*/
/*if (typeof(km_scripts) == 'undefined') var km_scripts = new Object();
km_myclass_import('http://www.cervantes.es/comunes/js/jquery.min.js');

//if (typeof(km_scripts2) == 'undefined') var km_scripts2 = new Object();
km_myclass_import('http://www.cervantes.es/comunes/js/jquery.qtip.js');

function km_myclass_import(jsFile) {
if (km_scripts[jsFile] != null) return;
var scriptElt = document.createElement('script');
scriptElt.type = 'text/javascript';
scriptElt.src = jsFile;
document.getElementsByTagName('head')[0].appendChild(scriptElt);
km_scripts[jsFile] = jsFile; // or whatever value your prefer
}*/
