﻿// 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 Abrir_ventana (pagina) {
var opciones="toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, width=460, height=460, top=85, left=140";
window.open(pagina,"",opciones);
}

//popup's imagenes con texto

function popup_texto(img,txt){
	foto1= new Image();
	foto1.src=(img);
	control_texto(img,txt);
}
 
function control_texto(img,txt){
	if((foto1.width!=0)&&(foto1.height!=0)){
	verfoto_texto(img,txt);
	}
	else{
	funcion="control_texto('"+img+"','"+txt+"')";
	intervalo=setTimeout(funcion,20);
	}
}

function verfoto_texto(img,txt){

	ancho=foto1.width+20;
	alto=foto1.height+20;
	anchoPantalla=screen.width; //añado esta línea
    altoPantalla=screen.height; //añado esta línea
	cadena="width="+ancho+",height="+alto+",left="+(anchoPantalla-foto1.width)/2+",top="+(altoPantalla-foto1.height)/2+",toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,copyhistory=0";
	ventana=window.open("","",cadena);

	salto=""
	if (txt!="") {
	  salto="<br><br>"
	}
	
	ventana.document.writeln("<html><head><title>"+txt+"</title>");
	ventana.document.writeln("<link href=includes/style.css rel=stylesheet title=style type=text/css>");
	ventana.document.writeln("</head><body>"); 
	ventana.document.writeln(txt); 
	ventana.document.writeln(""+salto+"<img src='"+img+"' border=0>"); 
	ventana.document.writeln("</body></html>"); 
}


function der()
	{
		var objeto = document.getElementById('marq');
		objeto.direction="right";
		objeto.start();
	}
	
function izq()
	{
			var objeto = document.getElementById('marq');
			objeto.direction="left";
			objeto.start();
	}
	
function parar()
	{
			var objeto = document.getElementById('marq');
			objeto.stop();
	}

function mostrar_imagen(foto, desc_foto)
{
	var objeto = document.getElementById('foto');
	objeto.src="media/gallerystandard/medium/"+foto;
	
	var objeto1 = document.getElementById('enlace_foto');
	objeto1.href="javascript:popup_texto('media/gallerystandard/big/"+foto+"','"+desc_foto+"');";		
}

	
