var ie5 = (document.getElementById && document.all); 
var ns6 = (document.getElementById && !document.all);
var ns=document.layers
var ie=document.all

var fade = "blendTrans(Duration=5)";
var myEffect = fade;

function showFilter(capa, visibility, color) {
	var obj;
	
	obj=document.getElementById(capa)
	
	if(ie5){
		obj.style.filter = myEffect; // set your effect from one of the top 25 differents effects
		obj.style.backgroundColor=color;
		obj.filters[0].Apply();
		obj.style.visibility = visibility;
		obj.filters[0].Play();
	}
	//else if(ns6){
	//	obj.style.visibility = visibility;
	//}
}
function cargarPagina(url,frame){
	if(parent.frames[frame]!=void(0)){
		parent.frames[frame].location=url
	}
}
function ponerDescripcion(descripcion){
	var desc;
	
	desc=document.getElementById('descripcion')	
	desc.innerHTML=descripcion;
	
	desc.style.left=event.clientX-(desc.offsetWidth/2)	
}
function quitarDescripcion(){
	var desc;
	
	desc=parent.frames['principal'].document.getElementById('descripcion')
	
	desc.innerHTML=""
}
function cargarFondo(color){
	frames.parent.frames['sup'].document.getElementById('cuadro_inf').style.backgroundColor=color
	//frames.parent.frames['principal'].document.getElementsByTagName('body')[0].style.backgroundColor=color
	
	//frames.parent.frames['sup'].document.getElementById('cuadro_sup').style.backgroundColor=color
	//frames.parent.frames['inf'].document.getElementsByTagName('body')[0].style.backgroundColor=color	
}
function cargarLogo(logo){
	var l;
	var infe;
	var lg;
	
	if(parent.frames['sup'].document.getElementById('logo')!=void(0)){
		l=parent.frames['sup'].document.getElementById('logo')
	}
	if(parent.frames['inf'].document.getElementById('logo_inf')!=void(0)){
		infe=parent.frames['inf'].document.getElementById('logo_inf')
	}
	
	//nombre de archivo de l
	if(l.src.slice(l.src.lastIndexOf("/")+1)) l.src=logo;
	
	switch(logo){
		case 'logoazul.jpg':
			lg="../imagenes/logoInformacio.jpg"
		break;
		
		case 'logoamarillo.jpg':
			lg="../imagenes/logoCultural.jpg"
		break;
		
		case 'logonaranja.jpg':
			lg="../imagenes/logoAcollidor.jpg"
		break;
		
		case 'logoverde.jpg':
			lg="../imagenes/logoNatural.jpg"
		break;
		
		case 'logorojo.jpg':
			lg="../imagenes/logoPoble.jpg"
		break;
	}
	
	if(infe!=void(0)){	
		if(infe.src!=lg) infe.src=lg;
	}
}

function abrirVentana(img){
	var izq;
	var vert;
	
	izq=(screen.width/2)-(img.width/2);
	vert=(screen.height/2)-(img.height/2);
	
	if(izq<0) izq=0;
	if(vert<0) vert=0;
	
	win=window.open('','','width='+img.width+',height='+img.height+',"toolbar=0 location=0 directories=0 status=0 scrollbars=0 menubar=0 resizable=0 left='+izq+' top='+vert+'');
	win.document.write ('<html>\n');
	win.document.write (' <head>\n');
	win.document.write ('  <title></title>\n');
	win.document.write (' </head>\n');
	win.document.write (' <body style="margin-top:0px;margin-left:0px">\n');
	win.document.write ('  <img src="' + img.src + '" style="width:'+img.width+';height:'+img.height+'">\n');
	win.document.write (' </body>\n');
	win.document.write ('</html>\n');
}

function esconde(){
  if (ie) precarga.style.visibility="hidden";
  if(ns) document.pregarga.visibility="hide";
}
function imprimirPagina(frame){
	if (window.print){
		if(parent[frame]!=void(0)){
			parent[frame].focus();
			parent[frame].print();
		}else{
			window.print()
		}
	}else{
		alert("Lo siento, pero a tu navegador no se le puede ordenar imprimir" + " desde la web. Actualizate o hazlo desde los menús");
	}
}
