﻿function traspasar_codigo() {
			document.getElementById('cuerpo_texto').innerHTML = window.frames['v1'].document.getElementsByTagName('body')[0].innerHTML;
}
function AbreVentana (URL){
   open(URL,"","width=800,height=600,resizable=yes,scrollbars=yes")
}
function AbreVentanaConTitulo (URL,titulo){
   open(URL,titulo,"width=800,height=600,resizable=yes,scrollbars=yes")
}

function imgout(imgname){
     imgname.src = IMG02
}
IMG1izq = "Imagenes/pestana_izq_hover.gif"  //image when mouse is over the link
IMG1der = "Imagenes/pestana_der_hover.gif"
IMG2izq = "Imagenes/pestana_izq.gif" //image when mouse isn't over the link
IMG2der = "Imagenes/pestana_der.gif" //image when mouse isn't over the link

function imgencima(imgizq,imgder,testo_pestana){
     imgizq.src = IMG1izq
     imgder.src = IMG1der
     testo_pestana.style.color="#ffffff"
     testo_pestana.style.background="#F56600"
}

function imgfuera(imgizq,imgder,testo_pestana){
     imgizq.src = IMG2izq
     imgder.src = IMG2der
     testo_pestana.style.color="#53504F"
     testo_pestana.style.background="#B7B6B6"
}

/*cambio de Mas y Menos En El arbol de opciones*/
/***********************************************/
MAS = "Imagenes/icon_plus.gif" 
MENOS = "Imagenes/icon_minus.gif" /*Image when mouse isn't over the link*/

function MuestraMasMenos(imgnombre){
			/*alert(imgnombre.src)*/
		if (imgnombre.src==MAS){
			imgnombre.src=MENOS
			}	
			else{
			imgnombre.src=MAS
			}
		}

/*precarga de Imagenes*/

function cargarimagenes(Imagenes){
		var i;
		var imagenes = new Array(Imagenes);
		var lista_imagenes = new Array();

   for(i in imagenes){
     lista_imagenes[i] = new Image();
     lista_imagenes[i].src = imagenes[i];
			}
	}



/*****************************************************************************
Pop-up ajustada a foto. 
http://javascript.tunait.com/
******************************************************************************/

var titulopordefecto = "Perico de los palotes"; //Si no se especifica un título al llamar a la función colocará el que se especifique aquí
var ventana;
var cont=0;

function afoto(cual,titulo)
{
if(cont==1){ventana.close();ventana=null}
if(titulo==null){titulo=titulopordefecto}
ventana=window.open('','ventana','resizable=yes,scrollbars=no')
ventana.document.write('<html><head><title>' + titulo + '</title></head><body style="overflow:hidden" marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" scroll="no" onUnload="opener.cont=0"><center><table height="100%"><tr valign="middle"> <td><center><img src="' + cual + '" onLoad="opener.redimensionar(this.width+20, this.height+43)"></td></tr></table>');
ventana.document.close();
cont++;
}
function redimensionar(ancho, alto)
{
ventana.resizeTo(ancho+12,alto+28);
ventana.moveTo((screen.width-ancho)/2,(screen.height-alto)/2); //centra la ventana. Eliminar si no se quiere centrar el popup
}

/*Oculta capa mientras la carga*/
		function muestraGranDiv(){
			document.getElementById('cargando').style.display = "none";
			document.getElementById('externa').style.visibility = "visible";
			document.getElementById('externa').style.display = "block";

			/*document.getElementById('cargando').style.visibility = "hidden";*/
			}
/*Oculta capa mientras la carga */
		function muestracargando(){
			dofade=false;
			document.getElementById('cuerpo_texto').innerHTML =str_cargando;

			}

/*muestra u oculta segun su Estado actual siendo la capa block*/
		function MuestraOcultaCapaBlock(capa){
		if (document.getElementById(capa).style.display == "none"){
			document.getElementById(capa).style.display = "block"
			}	
			else{
			document.getElementById(capa).style.display = "none"
			}
		}
/*muestra u oculta segun su Estado actual siendo la capa inline*/
		function MuestraOcultaCapaInline(capa){
		if (document.getElementById(capa).style.display == "none"){
			document.getElementById(capa).style.display = "inline"
			}	
			else{
			document.getElementById(capa).style.display = "none"
			}
		}
		
/*muestra capa siendo la capa block*/
		function MuestraCapaBlock(capa){
			document.getElementById(capa).style.display = "block"
		}
		
/*muestra capa siendo la capa inline*/
		function MuestraCapaInline(capa){
			document.getElementById(capa).style.display = "inline"
		}
		
/*muestra u oculta segun la funcion*/
		function MuestraCapa(capa){
			document.getElementById(capa).style.display = "inline"
			}	
		function OcultaCapa(capa){
			document.getElementById(capa).style.display = "none"
		}
/*muestra y oculta 2 capas*/
	function MuestraOculta(capa1,capa2){
		document.getElementById(capa1).style.display='inline';
		document.getElementById(capa2).style.display='none';
	}

/***********************************************
* Dynamic Ajax  Content- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/
/*bust potential caching of external pages after initial request? (1=yes, 0=no)*/
var bustcachevar=0 ;
var loadedobjects="";
var rootdomain="http://"+window.location.hostName;
var bustcacheparameter="";

function ajaxpage(url, containerid){
	var page_request = false
	/* if Mozilla, Safari etc*/
	if (window.XMLHttpRequest) 
		page_request = new XMLHttpRequest()
	/* if IE	*/
	else if (window.ActiveXObject){ 
		try {
			page_request = new ActiveXObject("Msxml2.XMLHTTP")
		} 
		catch (e){
			try{
				page_request = new ActiveXObject("Microsoft.XMLHTTP")
			}
			catch (e){}
		}
	}
	else
	return false
	page_request.onreadystatechange=function(){
		loadpage(page_request, containerid)
	}
	/*if bust caching of external page*/
	if (bustcachevar) 
		bustcacheparameter=(url.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime()
		page_request.open('GET', url+bustcacheparameter, true)
		page_request.send(null)
}

function loadpage(page_request, containerid){
	if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1))
		/*alert(page_request.responseText)*/
		document.getElementById(containerid).innerHTML=page_request.responseText
	/*else if (page_request.status != 200) {
		alert("page_request.status : " + page_request.status  + "\n " + "window.location.href.indexOf(http) : " + window.location.href.indexOf("http") + "\n " + "page_request.readyState : " + page_request.readyState);
	}*/
}

function loadobjs(){
	if (!document.getElementById)
		return
	for (i=0; i<arguments.length; i++){
		var file=arguments[i]
		var fileref=""
		/*Check to see if this object has not already been added to page before proceeding*/
		if (loadedobjects.indexOf(file)==-1){ 
			/*If object is a js file*/
			if (file.indexOf(".js")!=-1){ 
				fileref=document.createElement('script')
				fileref.setAttribute("type","text/javascript")
				fileref.setAttribute("src", file)
			}
			/*If object is a css file*/
			else if (file.indexOf(".css")!=-1){ 
				fileref=document.createElement("link")
				fileref.setAttribute("rel", "stylesheet")
				fileref.setAttribute("type", "text/css")
				fileref.setAttribute("href", file)
			}
		}
		if (fileref!=""){
			document.getElementsByTagName("head").item(0).appendChild(fileref)
			/*Remember this object as being already added to page*/
			loadedobjects+=file+" " 
		}
	}
}
/******************************************************************************************/
/*Transparente a visible*/
function incropacity(){
	if(dofade==true){
		if(ieop<=100){
			ieop+=7;
			if(IE4 || IE5)externa.style.filter="alpha(opacity="+ieop+")";
			if(NS6)externa.style.MozOpacity=ieop/100;
		op_id=setTimeout('incropacity()', 200);
		}
	}
}

/******************************************************************************************/
function colorboton(color,capa,arriba1,arriba2,arriba3,arriba4,abajo1,abajo2,abajo3,abajo4){
	document.getElementById(capa).style.background=color;
	document.getElementById(arriba1).style.background=color;
	document.getElementById(arriba2).style.background=color;
	document.getElementById(arriba3).style.background=color;
	document.getElementById(arriba4).style.background=color;
	document.getElementById(abajo1).style.background=color;
	document.getElementById(abajo2).style.background=color;
	document.getElementById(abajo3).style.background=color;
	document.getElementById(abajo4).style.background=color;
}

/***********************************************
* Gradual Highlight image script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/


function slowhigh(which2,baseopacity){
imgobj=which2
browserdetect=which2.filters? "ie" : typeof which2.style.MozOpacity=="string"? "mozilla" : ""
instantset(baseopacity)
highlighting=setInterval("gradualfade(imgobj)",50)
}

function slowlow(which2,baseopacity){
cleartimer()
instantset(baseopacity)
}

function instantset(degree){
if (browserdetect=="mozilla")
	imgobj.style.MozOpacity=degree/100
else if (browserdetect=="ie")
	imgobj.filters.alpha.opacity=degree
}

function cleartimer(){
if (window.highlighting) clearInterval(highlighting)
}

function gradualfade(cur2){
	if (browserdetect=="mozilla" && cur2.style.MozOpacity<1)
	cur2.style.MozOpacity=Math.min(parseFloat(cur2.style.MozOpacity)+0.1, 0.99)
else if (browserdetect=="ie" && cur2.filters.alpha.opacity<100)
	cur2.filters.alpha.opacity+=10
	else if (window.highlighting)
clearInterval(highlighting)
}