﻿// Función para mostrar el menu desplegable
var t;

function activar()
{
	clearTimeout(t);
}

/*function mostrar_equipo()
{
	var capa = document.getElementById('equipo');
    capa.style.visibility = "visible";
}*/

function mostrar_servicios()
{
	var capa = document.getElementById('servicios');
    capa.style.visibility = "visible";
}

function mostrar_productos()
{
	var capa = document.getElementById('productos');
    capa.style.visibility = "visible";
}

function mostrar_noticias()
{
	var capa = document.getElementById('noticias');
    capa.style.visibility = "visible";
}
function mostrar_faq()
{
	var capa = document.getElementById('faq');
    capa.style.visibility = "visible";
}

function ocultar_submenus()
{
	/*var capa1 = document.getElementById('equipo');
    capa1.style.visibility = "hidden";*/
	var capa2 = document.getElementById('servicios');
    capa2.style.visibility = "hidden";
	var capa3 = document.getElementById('productos');
    capa3.style.visibility = "hidden";
	var capa4 = document.getElementById('noticias');
    capa4.style.visibility = "hidden";
	var capa5 = document.getElementById('faq');
    capa5.style.visibility = "hidden";
}
function retardo()
{
	t=setTimeout('ocultar_submenus()',800);
}

// fin del menú desplegable

//popup's imagenes

function PopUp(img){
	foto1= new Image();
	foto1.src=(img);
	Control(img);
}

function Control(img){
	if((foto1.width!=0)&&(foto1.height!=0)){
		verFoto(img);
	}
	else{
		funcion="Control('"+img+"')";
		intervalo=setTimeout(funcion,20);
	}
}

function verFoto(img){
	ancho=foto1.width+20;
	alto=foto1.height+20;
	anchoPantalla=screen.width;
	altoPantalla=screen.height;
	cadena="width="+ancho+",height="+alto+",left="+(anchoPantalla-foto1.width)/2+",top="+(altoPantalla-foto1.height)/2;
	ventana=window.open(img,"",cadena);
	ventana.document.writeln ('<html>');
	ventana.document.writeln ('<head>'); 
    ventana.document.writeln ('<title></title>');
	ventana.document.writeln ('</head>');
	ventana.document.writeln ('<body>');
	ventana.document.writeln ('<img src="'+img+'" style="border:2px #e5e5e5 solid;";');
	ventana.document.writeln ('</body>');
	ventana.document.writeln ('</html>');
}

function AbreItem(id) {
 	window.open('verItem.asp?id='+id,'Info','width=400, height=300, scrollbars=yes');	
}

function zoom(elem,tipo,size,limit){
    var limit=!limit?(tipo=='+'?50:11):limit;
    var size=!size?1:size;
    var el=document.getElementById(elem);
   	var tam=isNaN(parseInt(el.style.fontSize))?11:parseInt(el.style.fontSize);
    tam=tipo=='+'?(tam+parseInt(size)>limit?limit:tam+parseInt(size)):tam-parseInt(size)<limit?limit:tam-parseInt(size);
    el.style.fontSize = tam+"px";
}

function PrintInfo(nombre) {
	var ficha = document.getElementById(nombre);
	var ventimp = window.open(' ', 'popimpr','width=600, height=500, scrollbars=yes');
	ventimp.document.write( ficha.innerHTML );
	ventimp.document.close();
	ventimp.print( );
	window.close();
	ventimp.close();
}
