/****
Fichero Javascript para diferentes pruebas y aspectos de la pantalla
*****/



function posicionaLayer() {
	if (screen.width<1024){

		document.getElementById("Layer0").style.left='94';
	}
}
function muestra_contador() {
		document.getElementById("Layer1").style.left='100';
}
function EnviarMail(){
	f=document.forms[0];
	
	//recogemos las variables del formulario
	
	Nombre = f.Nombre.value;
	Apellido = f.Apellido.value;
	Empresa = f.Empresa.value;
	Telefono = f.Telefono.value;
	Email = f.Email.value;
	Idioma = f.Idioma.value;
	TextoConsulta = f.TextoConsulta.value;

	
	ample=(screen.width/2)-150;
	llarg=(screen.height/2)-50;
	
	var opciones="width=300,height=100,scrollbars=no,status=no,resizable=yes,toolbar=no,location=0,menubar=no,left=" + ample + ",top=" + llarg;	
	
	//llamamos al método asp
	mensaje = "http://217.126.2.78/mailinfodracCorp.asp?Nombre=" + Nombre + "&Apellido=" + Apellido + "&Empresa=" + Empresa + "&Telefono=" + Telefono;
	mensaje += "&Email=" + Email + "&Idioma=" + Idioma + "&TextoConsulta=" + TextoConsulta;	
	
	informacion=window.open(mensaje,"info",opciones);	
}


function enviaLogon() {
	
	alert("valorRetorno");
	
	f=document.forms[0];

	Creador=f.Creador.value;	
	Semilla=f.Semilla.value;

	f.Creador.value="";
	f.Semilla.value="";
	
	alert(Creador);
	
	ample=(screen.width/2)-150;
	llarg=(screen.height/2)-50;

	var opciones="width=300,height=100,scrollbars=yes,status=yes,resizable=yes,toolbar=yes,location=0,menubar=yes,left=" + ample + ",top=" + llarg;	

	//valorRetorno="http://80.102.133.3/prueba.asp?Usuario=" + Creador + "&Password=" + Semilla;
	valorRetorno="http://80.102.160.125/zonaVIP.asp?Usuario=" + Creador + "&Password=" + Semilla;
	
	alert(valorRetorno);
	
	informacion=window.open(valorRetorno,"info",opciones);
}

function enviarMail() {
	f=document.forms[0];
	Departament=f.Departament[f.Departament.selectedIndex].value;
	Nombre=f.Nombre.value;	
	Apellido=f.Apellido.value;
	Empresa=f.Empresa.value;
	Telefono=f.Telefono.value;
	Email=f.Email.value;
	TextoConsulta=f.TextoConsulta.value;
	Idioma=f.Idioma.value;
	NumeroDepartament=f.Departament.selectedIndex;

	//A lo mejor necesitaremos estas variables mas adelante.

//	Persona=f.Persona.value;
//	Direccion=f.Direccion.value;
//	Provincia=f.Provincia.value;
	
	
	ample=(screen.width/2)-150;
	llarg=(screen.height/2)-50;

	var opciones="width=300,height=100,scrollbars=no,status=no,resizable=yes,toolbar=no,location=0,menubar=no,left=" + ample + ",top=" + llarg;	
	

	mensaje="mailinfodrac.php?Departament=" + Departament + "&Empresa=" + Empresa + "&Nombre=" + Nombre + "&Apellido=" + Apellido + "&Telefono=" + Telefono + "&Email=" + Email + "&TextoConsulta=" + TextoConsulta + "&Idioma=" + Idioma + "&NumeroDepartament=" + NumeroDepartament;
//	mensaje="mailinfodrac.php?Departament=" + Departament + "&Empresa=" + Empresa + "&Persona=" + Persona + "&Direccion=" + Direccion + "&Provincia=" + Provincia + "&Telefono=" + Telefono + "&Email=" + Email + "&TelADSL=" + TelADSL + "&TextoConsulta=" + TextoConsulta + "&Idioma=" + Idioma + "&NumeroDepartament=" + NumeroDepartament;

	informacion=window.open(mensaje,"info",opciones);
}
function cerrar() {
	window.close(); 
	return false;
}

function abreVentana(idioma,producto) {
	ample=(screen.width/2)-250;
	llarg=(screen.height/2)-250;

	var opciones="width=590,height=550,scrollbars=yes,status=no,resizable=no,toolbar=no,location=0,menubar=no,left=" + ample + ",top=" + llarg;	
	var opciones2="width=850,height=580,scrollbars=yes,status=no,resizable=no,toolbar=no,location=0,menubar=no,left=" + ample + ",top=" + llarg;	

	if (producto==1){	
		if (idioma==1){
			window.open("./trabajos/gestionHotelCat.htm","infodracHotel",opciones); 
		} else {
			window.open("./trabajos/gestionHotelCast.htm","infodracHotel",opciones); 
		}
	}
	if (producto==2){	
		if (idioma==1){
			window.open("./trabajos/gestionFacturaCat.htm","infodracFactura",opciones); 
		} else {
			window.open("./trabajos/gestionFacturaCast.htm","infodracFactura",opciones); 
		}
	}
	if (producto==3){	
		window.open("./portada/tpvVirtual.htm","infodrac_TPV_Virtual",opciones);	
	}
	if (producto==4){	
		
		if (idioma==1){
			window.open("./terminalServerCat.htm","infodrac_TeleWorking",opciones); 
		} else {
			window.open("./terminalServerCast.htm","infodrac_TeleWorking",opciones); 
		}			
	}
	if (producto==5){	
		
		if (idioma==1){
			window.open("./portada/terminalServerCat.htm","infodrac_TeleWorking",opciones); 
		} else {
			window.open("./portada/terminalServer.htm","infodrac_TeleWorking",opciones); 
		}			
	}
	if (producto==6){	
		if (idioma==1){
			window.open("software/trabajos/gestionHotelCat.htm","infodracHotel",opciones); 
		} else {
			window.open("software/trabajos/gestionHotelCast.htm","infodracHotel",opciones); 
		}
	}
	if (producto==7){	
		if (idioma==1){
			window.open("software/softwareVentasCat2.htm","infodracFactura",opciones); 
		} else {
			window.open("software/softwareVentasCast2.htm","infodracFactura",opciones); 
		}
	}
	if (producto==8){	
		if (idioma==1){
			window.open("../../portada/condicionesUso.htm","infodrac_Condiciones_Uso",opciones); 
		} else {
			window.open("./portada/condicionesUso.htm","infodrac_Condiciones_Uso",opciones); 
		}
	}
	
	if (producto==9){	
		if (idioma==1){
			window.open("./trabajos/descIDGesFac.htm","infodrac_Gestion_Facturas_Demo",opciones2); 
		} else {
			window.open("./trabajos/descIDGesFac.htm","infodrac_Gestion_Facturas_Demo",opciones2); 
		}
	}
	if (producto==10){	
		if (idioma==1){
			window.open("../legal/contratoCLU.htm","infodrac_Contrato_CLU",opciones); 
		} else {
			window.open("../legal/contratoCLU.htm","infodrac_Contrato_CLU",opciones); 
		}
	}	
	if (producto==11){	
		if (idioma==1){
			window.open("./trabajos/gestionClinicaCat.htm","infodrac_Gestion_Clinca_Dental",opciones); 
		} else {
			window.open("./trabajos/gestionClinicaCast.htm","infodrac_Gestio_Clinica_Dental",opciones); 
		}
	}	
	if (producto==12){	
		if (idioma==1){
			window.open("./trabajos/gestionPeluqueriaCat.htm","infodrac_Gestion_Peluquerias",opciones); 
		} else {
			window.open("./trabajos/gestionPeluqueriaCast.htm","infodrac_Gestio_Peluquerias",opciones); 
		}
	}							
}


function ConstruirPie()
{
	document.write("<table width=\"100%\" height=\"100%\" border=0 cellpadding=\"0\" cellspacing=\"0\" align=\"center\"><tr><td valign=\"top\" class=\"LineaGris\"><img  src=\"../imatges/pixel.gif\" width=\"1%\" height=\"1%\"></td></tr><tr><td valign=\"top\" align=\"center\"><font color=\"silver\">Powered by Infodrac -- Infodrac 2003 -- <a class=\"Coletilla\" href=\"http://www.infodrac.com\" target=\"_blank\">www.infodrac.com</a><font></td></tr></table>");
}

function Propuesta(Numero,idioma){
	window.focus();
	if (idioma==1){
		var imatge1sel="imatges/prop1sel.gif";
		var imatge2sel="imatges/prop2sel.gif";
		var imatge1="imatges/prop1.gif";
		var imatge2="imatges/prop2.gif";
	}
	if (idioma==2){
		var imatge1sel="imatges/prop1selCast.gif";
		var imatge2sel="imatges/prop2selCast.gif";
		var imatge1="imatges/prop1Cast.gif";
		var imatge2="imatges/prop2Cast.gif";
	}	
	
	document.getElementById("Layer0").style.position='absolute';		
	document.getElementById("Layer1").style.position='absolute';
	
	document.getElementById("Layer0").style.visibility='hidden';
	document.getElementById("Layer1").style.visibility='hidden';
		

			
	if (Numero==1) {
		document.images["propuesta1"].src=imatge1sel;
		document.images["propuesta2"].src=imatge2;
		document.getElementById("Layer0").style.visibility='visible';
		document.getElementById("Layer0").style.position='relative';	
	
	}	
	if (Numero==2) {
		document.images["propuesta1"].src=imatge1;
		document.images["propuesta2"].src=imatge2sel;
		document.getElementById("Layer1").style.visibility='visible';
		document.getElementById("Layer1").style.position='relative';
	}
	
}

function controlTamany(){
	f=document.forms[0];
	if (screen.width==800){
		f.TextoConsulta.rows="13";
		f.TextoConsulta.cols="35";
	}
}
	
function contacta(){
	f=document.forms[0];

		document.getElementById("Layer0").style.visibility='hidden';
		document.getElementById("Layer1").style.visibility='hidden';
		document.getElementById("Layer2").style.visibility='hidden';
		document.getElementById("Layer3").style.visibility='hidden';
				
		document.getElementById("Layer0").style.position='absolute';		
		document.getElementById("Layer1").style.position='absolute';
		document.getElementById("Layer2").style.position='absolute';
		document.getElementById("Layer3").style.position='absolute';
	
	if (f.Departament.selectedIndex==0){
		document.getElementById("Layer0").style.visibility='visible';
		document.getElementById("Layer0").style.position='relative';
		document.images["foto"].src="imatges/home.jpg";
		f.action="mailto:infodrac@infodrac.com"	
		
	}
	if (f.Departament.selectedIndex==1){
		document.getElementById("Layer1").style.visibility='visible';
		document.getElementById("Layer1").style.position='relative';
		document.images["foto"].src="imatges/jose.jpg";
		f.action="mailto:jose@infodrac.com"
		
	}
	if (f.Departament.selectedIndex==2){
		document.getElementById("Layer2").style.visibility='visible';
		document.getElementById("Layer2").style.position='relative';
		document.images["foto"].src="imatges/omar.jpg";			
		f.action="mailto:omar@infodrac.com"
	}
	if (f.Departament.selectedIndex==3){
		document.getElementById("Layer3").style.visibility='visible';
		document.getElementById("Layer3").style.position='relative';
		document.images["foto"].src="imatges/alex.jpg";				
		f.action="mailto:u1027847@correu.udg.es"
	}
}

function volver() {
	document.write("<a href=\"\" onclick=\"parent.history.back();return false;\"><img src=\"../imatges/boton_volver.gif\" border=\"0\" width=\"73\" height=\"11\"></a>");
}

function ConstruirMenu(Lnivel,Idioma)
{
	if (Lnivel==1)
		nivel="../";
	if (Lnivel==2)
		nivel="../../";
	
B1=new Image;
B2=new Image;
B3=new Image;
B4=new Image;
B5=new Image;
B6=new Image;
B1b=new Image;
B2b=new Image;
B3b=new Image;
B4b=new Image;
B5b=new Image;
B6b=new Image;
	
	if (Idioma==1){
		hrefBoto1="empresa/empresaCat.htm";
		hrefBoto2="hardware/hardwareCat.htm";
		hrefBoto3="software/softwareCat.htm";
		hrefBoto4="web/webCat.htm";
		hrefBoto5="vip/vipCat.htm";
		hrefBoto6="contacto/contactoCat.htm";
		
		B1.src= nivel + "menu/empresagris.jpg";
		B2.src= nivel + "menu/hardwaregris.jpg";
		B3.src= nivel + "menu/softwaregris.jpg";
		B4.src= nivel + "menu/webgriscat.jpg";
		B5.src= nivel + "menu/vipgris.jpg";
		B6.src= nivel + "menu/contactegris.jpg";
		
		B1b.src= nivel + "menu/empresagris2.jpg";
		B2b.src= nivel + "menu/hardwaregris2.jpg";
		B3b.src= nivel + "menu/softwaregris2.jpg";
		B4b.src= nivel + "menu/webgriscat2.jpg";
		B5b.src= nivel + "menu/vipgris2.jpg";
		B6b.src= nivel + "menu/contactegris2.jpg";		
	}
	if (Idioma==2){
		hrefBoto1="empresa/empresaCast.htm";
		hrefBoto2="hardware/hardwareCast.htm";
		hrefBoto3="software/softwareCast.htm";
		hrefBoto4="web/webCast.htm";
		hrefBoto5="vip/vipCast.htm";
		hrefBoto6="contacto/contactoCast.htm";
		
		B1.src= nivel + "menu/empresagris.gif";
		B2.src= nivel + "menu/hardwaregris.gif";
		B3.src= nivel + "menu/softwaregris.gif";
		B4.src= nivel + "menu/webgris.gif";
		B5.src= nivel + "menu/vipgris.gif";
		B6.src= nivel + "menu/contactogris.gif";
		
		B1b.src= nivel + "menu/empresagris2.gif";
		B2b.src= nivel + "menu/hardwaregris2.gif";
		B3b.src= nivel + "menu/softwaregris2.gif";
		B4b.src= nivel + "menu/webgris2.gif";
		B5b.src= nivel + "menu/vipgris2.gif";
		B6b.src= nivel + "menu/contactogris2.gif";		
	}	
	
	var boto1="<tr><td><a href=\"" + nivel + hrefBoto1 + "\" onMouseOver=\"document.iB1.src=B1b.src\" onMouseOut=\"document.iB1.src=B1.src\"><img src=\""  + B1.src + "\" border=\"0\" width=\"115\" height=\"29\" name=\"iB1\")\"></a></td></tr>";
	var boto2="<tr><td><a href=\"" + nivel + hrefBoto2 + "\" onMouseOver=\"document.iB2.src=B2b.src\" onMouseOut=\"document.iB2.src=B2.src\"><img src=\""  + B2.src + "\" border=\"0\" width=\"115\" height=\"29\" name=\"iB2\")\"></a></td></tr>";
	var boto3="<tr><td><a href=\"" + nivel + hrefBoto3 + "\" onMouseOver=\"document.iB3.src=B3b.src\" onMouseOut=\"document.iB3.src=B3.src\"><img src=\""  + B3.src + "\" border=\"0\" width=\"115\" height=\"29\" name=\"iB3\")\"></a></td></tr>";
	var boto4="<tr><td><a href=\"" + nivel + hrefBoto4 + "\" onMouseOver=\"document.iB4.src=B4b.src\" onMouseOut=\"document.iB4.src=B4.src\"><img src=\""  + B4.src + "\" border=\"0\" width=\"115\" height=\"29\" name=\"iB4\")\"></a></td></tr>";
	var boto5="<tr><td><a href=\"" + nivel + hrefBoto5 + "\" onMouseOver=\"document.iB5.src=B5b.src\" onMouseOut=\"document.iB5.src=B5.src\"><img src=\""  + B5.src + "\" border=\"0\" width=\"115\" height=\"29\" name=\"iB5\")\"></a></td></tr>";
	var boto6="<tr><td><a href=\"" + nivel + hrefBoto6 + "\" onMouseOver=\"document.iB6.src=B6b.src\" onMouseOut=\"document.iB6.src=B6.src\"><img src=\""  + B6.src + "\" border=\"0\" width=\"115\" height=\"29\" name=\"iB6\")\"></a></td></tr>";

	
	document.write("<table valing=\"top\" cellpadding=\"3\" cellspacing=\"0\" border=\"0\">" + boto1 + boto2 + boto3 + boto4 + boto5 + boto6 + "</table>");

}

