/***************************************************/
/** Funcion ubicarPie			  **/
/** 						  **/
/** ubica el pie en su posición correcta   **/
/** 						  **/
/***************************************************/
function ubicarPie(){
	var altoPie = (document.getElementById('tablaSeparador').style.height).split('px');
	e=new Number(altoPie[0]);
	document.getElementById('pie').style.top = (e+4)+ 'px';
}
function ubicarPieMapaWeb(){
	var altoPie = (document.getElementById('tablaSeparador').style.height).split('px');
	e=new Number(altoPie[0]);
	document.getElementById('pie').style.top = (e+119)+ 'px';
}
function ubicarPieMapaWeb1(){
	var altoPie = (document.getElementById('tablaSeparador').style.height).split('px');
	e=new Number(altoPie[0]);
	document.getElementById('pie').style.top = (e+130)+ 'px';
}
function ubicarPieMapaWeb2(){
	var altoPie = (document.getElementById('tablaSeparador').style.height).split('px');
	e=new Number(altoPie[0]);
	document.getElementById('pie').style.top = (e+130)+ 'px';
}
function ubicarPieTrabaje(){
	var altoPie = (document.getElementById('tablaSeparador').style.height).split('px');
	e=new Number(altoPie[0]);
	document.getElementById('pie').style.top = (e+175)+ 'px';
}
function ubicarPieTrabaje1(){
	var altoPie = (document.getElementById('tablaSeparador').style.height).split('px');
	e=new Number(altoPie[0]);
	document.getElementById('pie').style.top = (e+187)+ 'px';
}
function ubicarPieIber(){
	var altoPie = (document.getElementById('tablaSeparador').style.height).split('px');
	e=new Number(altoPie[0]);
	document.getElementById('pie').style.top = (e+177)+ 'px';
}
function ubicarPieIber1(){
	var altoPie = (document.getElementById('tablaSeparador').style.height).split('px');
	e=new Number(altoPie[0]);
	document.getElementById('pie').style.top = (e+188)+ 'px';
}
function ubicarPieHome(){
	var altoPie = document.getElementById('tablaSeparador').offsetHeight;
	e=new Number(altoPie);
	if(e<=522)
	{	
		e=422;	
		document.getElementById('pie').style.top = (e+350)+ 'px';
		document.getElementById('tablaSeparador1').style.height = (e+62)+ 'px';
		document.getElementById('tablaSeparador2').style.height = (e+62)+ 'px';
	}	
	else
	{
		document.getElementById('pie').style.top = (e+350)+ 'px';
		document.getElementById('tablaSeparador1').style.height = (e+62)+ 'px';
		document.getElementById('tablaSeparador2').style.height = (e+62)+ 'px';
	}	
}
function ubicarPieHome1(){
	var altoPie = document.getElementById('tablaSeparador').offsetHeight;
	e=new Number(altoPie);
	if(e<=522)
	{	
		e=422;	
		document.getElementById('pie').style.top = (e+363)+ 'px';
		document.getElementById('tablaSeparador1').style.height = (e+65)+ 'px';
		document.getElementById('tablaSeparador2').style.height = (e+65)+ 'px';
	}	
	else
	{
		document.getElementById('pie').style.top = (e+363)+ 'px';
		document.getElementById('tablaSeparador1').style.height = (e+62)+ 'px';
		document.getElementById('tablaSeparador2').style.height = (e+62)+ 'px';
	}	
}
function ubicarPieHomePt(){
	var altoPie = document.getElementById('tablaSeparador').offsetHeight;
	e=new Number(altoPie);
	if(e<=475)
	{		
		e=400;
		document.getElementById('pie').style.top = (e+180)+ 'px';
		document.getElementById('tablaSeparador1').style.height = (e+62)+ 'px';
		document.getElementById('tablaSeparador2').style.height = (e+62)+ 'px';
	}	
	else
	{
		document.getElementById('pie').style.top = (e+180)+ 'px';
		document.getElementById('tablaSeparador1').style.height = (e+62)+ 'px';
		document.getElementById('tablaSeparador2').style.height = (e+62)+ 'px';
	}	
}
function ubicarPieHomePt1(){
	var altoPie = document.getElementById('tablaSeparador').offsetHeight;
	e=new Number(altoPie);
	if(e<=475)
	{		
		e=400;
		document.getElementById('pie').style.top = (e+190)+ 'px';
		document.getElementById('tablaSeparador1').style.height = (e+62)+ 'px';
		document.getElementById('tablaSeparador2').style.height = (e+62)+ 'px';
	}	
	else
	{
		document.getElementById('pie').style.top = (e+190)+ 'px';
		document.getElementById('tablaSeparador1').style.height = (e+62)+ 'px';
		document.getElementById('tablaSeparador2').style.height = (e+62)+ 'px';
	}	
}


function ubicarPie1(){
	var altoPie1 = (document.getElementById('tablaSeparador').style.height).split('px');
	var altoPie2 = (document.getElementById('tablaSeparador1').style.height).split('px');
	e=new Number(altoPie1[0]);
	document.getElementById('pie').style.top = (e+94)+ 'px';
	document.getElementById('tablaSeparador').style.height = (e+90)+ 'px';
	e=new Number(altoPie2[0]);
	document.getElementById('tablaSeparador1').style.height = (e+90)+ 'px';
}
function ubicarPie2(){
	var altoPie1 = (document.getElementById('tablaSeparador').style.height).split('px');
	var altoPie2 = (document.getElementById('tablaSeparador1').style.height).split('px');
	e=new Number(altoPie1[0]);
	document.getElementById('pie').style.top = (e-86)+ 'px';
	document.getElementById('tablaSeparador').style.height = (e-90)+ 'px';
	e=new Number(altoPie2[0]);
	document.getElementById('tablaSeparador1').style.height = (e-90)+ 'px';
}
function ubicarPie3(){
	var altoPie = document.getElementById('tablaSeparador').offsetHeight;
	e=new Number(altoPie);
	if(e<=475)
	{		
		e=400;
		document.getElementById('pie').style.top = (e+90)+ 'px';
		if(document.getElementById('tablaSeparador1')){
			document.getElementById('tablaSeparador1').style.height = (e+62)+ 'px';
			document.getElementById('tablaSeparador2').style.height = (e+62)+ 'px';
		}else{
				document.getElementById('tablaSeparador').style.height = (e+74)+ 'px';
		}
	}	
	else
	{
		document.getElementById('pie').style.top = (e+16)+ 'px';
		if(document.getElementById('tablaSeparador1')){
			document.getElementById('tablaSeparador1').style.height = (e+62)+ 'px';
			document.getElementById('tablaSeparador2').style.height = (e+62)+ 'px';
		}else {
			document.getElementById('tablaSeparador').style.height = (e)+ 'px';
		}
	}	
}
function ubicarPieDetalleNoticia(){
	var altoPie = document.getElementById("tablaContenidoNoticia").offsetHeight;
	e=new Number(altoPie);
	if(e<500){
		e=500;
	}
	document.getElementById('pie').style.top = (e+100)+ 'px';
	document.getElementById('tablaSeparador').style.height = (e+96)+ 'px';
	document.getElementById('tablaSeparador1').style.height = (e+155)+ 'px';
}
function ubicarPieDetalleNoticia1(){
	var altoPie = document.getElementById("tablaContenidoNoticia").offsetHeight;
	e=new Number(altoPie);
	if(e<500){
		e=500;
	}
	document.getElementById('pie').style.top = (e+110)+ 'px';
	document.getElementById('tablaSeparador').style.height = (e+96)+ 'px';
	document.getElementById('tablaSeparador1').style.height = (e+155)+ 'px';
}
function ubicarPieCyCNews(){
	var altoPie = document.getElementById("tablaCyCNews").offsetHeight;
	e=new Number(altoPie);
	if(e<500){
		e=500;
	}
	document.getElementById('pie').style.top = (e+100)+ 'px';
	document.getElementById('tablaSeparador').style.height = (e+96)+ 'px';
	document.getElementById('tablaSeparador1').style.height = (e+155)+ 'px';
}
function ubicarPieCyCNews1(){
	var altoPie = document.getElementById("tablaCyCNews").offsetHeight;
	e=new Number(altoPie);
	if(e<500){
		e=500;
		document.getElementById('pie').style.top = (e+111)+ 'px';
	}else{
		document.getElementById('pie').style.top = (e+110)+ 'px';
	}
	
	document.getElementById('tablaSeparador').style.height = (e+96)+ 'px';
	document.getElementById('tablaSeparador1').style.height = (e+155)+ 'px';
}
function ubicarPieRSS(){
	var altoPie = (document.getElementById('tablaSeparador').style.height).split('px');
	e=new Number(altoPie[0]);
	document.getElementById('pie').style.top = (e+130)+ 'px';
	document.getElementById('tablaSeparador').style.height = (e+116)+ 'px';
}
function mostrarServicios(){
	document.getElementById("masServicios").style.display = 'block';
	document.getElementById("botonMasServ").style.visibility = 'hidden';
//	document.getElementById("botonMasServ").style.display = 'none';
	//document.getElementById("botonMenosServ").style.display = 'block';
	document.getElementById("serviciosVisibles").style.display = '';
}
function ocultarServicios(){
	document.getElementById("masServicios").style.display = 'none';
	document.getElementById("botonMasServ").style.visibility = 'visible';
//	document.getElementById("botonMasServ").style.display = 'block';
	//document.getElementById("botonMenosServ").style.display = 'none';
	document.getElementById("serviciosVisibles").style.display = 'none';
}
function NewWindow3(mypage,myname,w,h,scroll,idioma){
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2.3 : 0;
	settings =
	'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
	if(idioma == 'pt')
	{
		win = window.open('/flashws/altibajos_pt.jsp',myname,settings)
	}
	else
	{
		win = window.open('/flashws/altibajos.jsp',myname,settings)
	}
}
function NewWindow(mypage,myname,w,h,scroll){
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2.3 : 0;
	settings =
	'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
	win = window.open('/flash/hot_site.htmv',myname,settings)
}
function NewWindow4(mypage,myname,w,h,scroll){
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2.3 : 0;
	settings =
	'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
	win = window.open('/flashws/taza_final.jsp',myname,settings)
	}
function mostrarIdiomas(){
	document.getElementById("idiomaTotal").style.display= 'none';
	document.getElementById("idiomaES").style.display= 'block';
	document.getElementById("idiomaEN").style.display= 'block';
	document.getElementById("idiomaPT").style.display= 'block';
	document.getElementById("idiomaBR").style.display= 'block';
	document.getElementById("comboIdioma").style.top= '23px';
	document.getElementById("comboIdioma").style.zIndex = 20;
}
function ocultarIdiomas(){
	document.getElementById("comboIdioma").style.top= '24px';
	document.getElementById("idiomaTotal").style.display= 'block';
	document.getElementById("idiomaES").style.display= 'none';
	document.getElementById("idiomaEN").style.display= 'none';
	document.getElementById("idiomaPT").style.display= 'none';
	document.getElementById("idiomaBR").style.display= 'none';
	
}
/**
Se deja de utilizar este método para enlazar los idiomas sin javascript
*/
/*function seleccionaIdioma(idiomaSel){
	var idioma = null;
	document.getElementById("idiomaTotal").style.display= 'block';
	document.getElementById("idiomaES").style.display= 'none';
	document.getElementById("idiomaEN").style.display= 'none';
	document.getElementById("idiomaPT").style.display= 'none';
	document.getElementById("idiomaBR").style.display= 'none';
	
	if ((idiomaSel == "Inglês") || (idiomaSel =="Inglés") || (idiomaSel == "English")){
		hiloIdioma1 = idiomaSel;
		idioma = "en";
	}
	else if ((idiomaSel == "Español") || (idiomaSel =="Espanhol") || (idiomaSel == "Spanish")){
		hiloIdioma1 = idiomaSel;
		idioma = "es";
	}
	else if ((idiomaSel == "Portugués") || (idiomaSel == "Portuguese") || (idiomaSel == "Português") || (idiomaSel == "Português-PT")){
		hiloIdioma1 = idiomaSel;
		idioma = "pt";
	}
	else if ((idiomaSel == "Brasil") || (idiomaSel == "Brasileiro") || (idiomaSel =="Brazilian") || (idiomaSel == "Português-BR")){
		hiloIdioma1 = idiomaSel;
		idioma = "br";
	}
	document.location.href = "/"+idioma+"/home/home.html";

}*/
//Función que despliega el menú de la cabecera, basado en jquery
 $(document).ready(function(){
	$(' #nav li', this).mouseenter(function(){
		$(this).find('ul:first:hidden').slideDown();
		$(this).find('ul:first:hidden').css({visibility: "visible"});
	});$(' #nav li', this).mouseleave(function(){
		$(this).find('ul:first').css({visibility: "hidden",display: "none"});
	});
});

function irA(opcion){	
		var accion = opcion.substring( opcion.indexOf('ACCION=') + 7);
		if(accion.indexOf('&') != -1) {
			accion = accion.substring(0, accion.indexOf('&'));
		}
		var proceso = opcion.substring( opcion.indexOf('PROCESO=') + 8);
		if(proceso.indexOf('&') != -1) {
			proceso = proceso.substring(0, proceso.indexOf('&'));
		}
		var nuevo = opcion.substring( opcion.indexOf('NUEVO=') + 6);
		if(nuevo.indexOf('&') != -1) {
			nuevo = nuevo.substring(0, nuevo.indexOf('&'));
		}
		document.formulario.PROCESO.value=proceso;
		document.formulario.ACCION.value=accion;
		document.formulario.NUEVO.value=nuevo;
		document.formulario.submit();
	}
function verPreguntas(opcion){
		document.getElementById('preguntasRespuestas1').style.display = 'none';
		document.getElementById('preguntasRespuestas2').style.display = 'none';
		document.getElementById('preguntasRespuestas3').style.display = 'none';
		document.getElementById(opcion).style.display = '';
	}
function mostrarRespuesta(opcion, opcion1){
		document.getElementById(opcion).style.display = '';
		document.getElementById(opcion1).style.display = 'none';
		ubicarPie1();
		
}
function ocultarRespuesta(opcion, opcion1){
		document.getElementById(opcion).style.display = '';
		document.getElementById(opcion1).style.display = 'none';
		ubicarPie2();
}

		function controlaNombreEmpresa(fm){	
			if (fm.nombreEmpresa != null && fm.nombreEmpresa.value.length == 0) {
				alert("Por favor,introduzca el nombre de su empresa");
				return true;
			}	
		}	

		function comprobarnumero(cadena)
		{
		    var correcto = true;
			var n=cadena.length;
			for(i=0;i<n;i++){
				if(isNaN(cadena.charAt(i)) || cadena.charAt(i)==' ')
				{
					correcto=false;
				}
			}
			return correcto;
		}

		function comprobardni(cadena)
		{
			var longitud=(cadena.length);
			if(longitud!=9)
			{
				return false;
			}	
			else return true;
		}

		function controlaCif(fm){				
			if(fm.cif == null) return false;
			if (fm.cif.value.length != 0) {
				correcto=comprobardni(fm.cif.value);
				if(correcto==false){
					alert("El CIF introducido no es correcto.");
					return true;
				}	
			}else {
				alert("Por favor, introduzca el CIF");
				return true;
			}
		}
	
		function controlaNombreContacto(fm){				
			if (fm.nombreContacto != null && fm.nombreContacto.value.length == 0) {
				alert("Por favor, introduzca el nombre de la persona de contacto");
				return true;
			}
		}	
	
		function controlaApellidosContacto(fm){	
			if (fm.apellidosContacto != null && fm.apellidosContacto.value.length == 0) {
				alert("Por favor, introduzca los apellidos de la persona de contacto");
				return true;
			}	
		}		
		
		function controlaDireccionEmpresa(fm){	
			if (fm.direccionEmpresa != null && fm.direccionEmpresa.value.length==0)
	 		{
		      alert("Por favor,introduzca la direccion");	
			  return true;	  
     		}
		}	
			
		function controlaCodPostal(fm){
			if(fm.codPostal == null) return false;
			if (fm.codPostal.value.length==0)
	 	 	{
     	 		alert("Por favor,introduzca el Código Postal ");
	    		return true;	  
     		}
	 		else{
	 	 		longitud=fm.codPostal.value;
		 		longitud2=longitud.length;
		 
		 		if(longitud2 != 5)
		 		{				
					alert("El Código Postal  debe de tener 5 dígitos");				
					return true;
				}
		 		else{
					correcto=comprobarnumero(fm.codPostal.value);
					if(correcto==false){
						alert("El campo Código Postal  ha de ser numérico");				
						return true;
					}
				}
			} 		
		}	
		
		function controlaCodPostalPT(fm){
			if(fm.codPostal == null) return false;
			if (fm.codPostal.value.length==0)
	 	 	{
     	 		alert("Por favor,introduzca el Código Postal ");
	    		return true;	  
     		}
	 		
		}			
	
		function controlaTfno1(fm){	
			if(fm.tfno1 == null) return false;
			if (fm.tfno1.value.length == 0){
				alert("Por favor,introduzca el teléfono ");
	    		return true;	  	
			}
	
			if(fm.tfno1.value.length==9 && comprobarnumero(fm.tfno1.value)){
				return false;
		 	}else{
		 		alert("El teléfono ha de tener únicamente 9 dígitos sin espacios");
				return true;
		 	}	 
		}	
		
		function controlaTfno2(fm){	
			if(fm.tfno2 == null) return false;
			if (fm.tfno2.value.length !=0){
	
				if(fm.tfno2.value.length==9 && comprobarnumero(fm.tfno2.value)){
					return false;
			 	}else{
			 		alert("El teléfono ha de tener únicamente 9 dígitos sin espacios");
					return true;
			 	}
			}
		}	
	
	
		function controlaMail(fm){	
			if(fm.mail == null) return false;
			if (fm.mail.value==""){
				alert("Por favor,introduzca el mail ");
	    		return true;	  
			}
	
			if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(fm.mail.value)){
				// alert("La dirección de email " + fm.mail.value + "es correcta.")
				return false;
			} else {
				alert("La dirección de email es incorrecta.");
				return true;
			}
		}	
		

	
		function controlaMedio(fm){
			if (fm.medio != null && fm.medio.value.length == 0) {
				alert("Por favor, introduzca el medio de comunicación");
				return true;
			}	
		}	
	
		function controlaDireccion(fm){
			if (fm.direccion != null && fm.direccion.value.length == 0) {
				alert("Por favor, introduzca la dirección de la empresa");
				return true;
			}	
		}					

		function controlaPoblacion(fm){
			if (fm.poblacion != null && fm.poblacion.value.length == 0) {
				alert("Por favor, introduzca la población");
				return true;
			}	
		}						
		
		function controlaTfno(fm){
			if(fm.telefono == null) return;
			
			if (fm.telefono.value.length == 0){
				alert("Por favor,introduzca el teléfono ");
	    		return true;	  
			}
	
			if(fm.telefono.value.length==9 && comprobarnumero(fm.telefono.value)){
				return false;
		 	}else{
		 		alert("El teléfono ha de tener únicamente 9 dígitos sin espacios");
				return true;
		 	}	
		}	
	
		function controlaInformacion(fm){
			if(fm.estudios == null || fm.financiera == null) return;
			if ((!fm.estudios.checked) && (!fm.financiera.checked)){
	 			alert("Debe seleccionar al menos un tipo de información");	
		 		return true;
			}
		}	

		function controlaNombre(fm){
			if (fm.nombre != null && fm.nombre.value.length == 0) {
				alert("Por favor, introduzca el nombre de la persona de contacto");
				return true;
			}
		}	
	
		function controlaApellidos(fm){	
			if (fm.apellidos != null && fm.apellidos.value.length == 0) {
				alert("Por favor, introduzca los apellidos de la persona de contacto");
				return true;
			}	
		}	
	
			
		
	function validarDatos(fm){
		var retorno = true;
			
		/*validación campos*/
		
		if (controlaNombreEmpresa(fm)){
				fm.nombreEmpresa.focus();
				retorno=false;
		}else if (controlaCif(fm)){
				fm.cif.focus();
				retorno=false;
		}else if (controlaNombre(fm)){
				fm.nombre.focus();
				retorno=false;
		}else if (controlaApellidos(fm)){
				fm.apellidos.focus();
				retorno=false;
		}else if (controlaNombreContacto(fm)){
				fm.nombreContacto.focus();
				retorno=false;
		}else if (controlaApellidosContacto(fm)){
				fm.apellidosContacto.focus();
				retorno=false;
		}else if (controlaMedio(fm)){
				fm.medio.focus();
				retorno=false;	
		}else if (controlaDireccion(fm)){
				fm.direccion.focus();
				retorno=false;										
		} else	if (controlaCodPostal(fm)){
				fm.codPostal.focus();
				retorno=false;
		} else	if (controlaPoblacion(fm)){
				fm.poblacion.focus();
				retorno=false;									
		 } else	if (controlaTfno1(fm)){
				fm.tfno1.focus();
				retorno=false;
		 }else 	if (controlaTfno2(fm) ){
				fm.tfno2.focus();
				retorno=false;
		} else	if (controlaTfno(fm)){
				fm.telefono.focus();
				retorno=false;		
		 }else	if (controlaMail(fm)){
		 		fm.mail.focus();
				retorno=false;								
		 } else	if (controlaInformacion(fm)){
				fm.estudios.focus();
				retorno=false;		 						
		}else if (controlaDireccionEmpresa(fm)){
				fm.direccionEmpresa.focus();
				retorno=false;
		 }
		
		if (retorno){
				enviarDatos(document.f);
		}else{
				return ;
		}
	
	}
	
	function validarDatosPT(fm){
		var retorno = true;
			
		/*validación campos*/
		
		if (controlaNombreEmpresa(fm)){
				fm.nombreEmpresa.focus();
				retorno=false;
		}else if (controlaCif(fm)){
				fm.cif.focus();
				retorno=false;
		}else if (controlaNombre(fm)){
				fm.nombre.focus();
				retorno=false;
		}else if (controlaApellidos(fm)){
				fm.apellidos.focus();
				retorno=false;
		}else if (controlaNombreContacto(fm)){
				fm.nombreContacto.focus();
				retorno=false;
		}else if (controlaApellidosContacto(fm)){
				fm.apellidosContacto.focus();
				retorno=false;
		}else if (controlaMedio(fm)){
				fm.medio.focus();
				retorno=false;	
		}else if (controlaDireccion(fm)){
				fm.direccion.focus();
				retorno=false;										
		} else	if (controlaCodPostalPT(fm)){
				fm.codPostal.focus();
				retorno=false;
		} else	if (controlaPoblacion(fm)){
				fm.poblacion.focus();
				retorno=false;									
		 } else	if (controlaTfno1(fm)){
				fm.tfno1.focus();
				retorno=false;
		 }else 	if (controlaTfno2(fm) ){
				fm.tfno2.focus();
				retorno=false;
		} else	if (controlaTfno(fm)){
				fm.telefono.focus();
				retorno=false;		
		 }else	if (controlaMail(fm)){
		 		fm.mail.focus();
				retorno=false;								
		 } else	if (controlaInformacion(fm)){
				fm.estudios.focus();
				retorno=false;		 						
		}else if (controlaDireccionEmpresa(fm)){
				fm.direccionEmpresa.focus();
				retorno=false;
		 }
		
		if (retorno){
				enviarDatos(document.f);
		}else{
				return ;
		}
	
	}
	
	
	function enviarDatos(fm){
		if(fm.NombreEmpresaFormulario != null) fm.NombreEmpresaFormulario.value = document.getElementById("nombreEmpresa").value;
		if(fm.NombreContactoFormulario != null) fm.NombreContactoFormulario.value = document.getElementById("nombreContacto").value;
		if(fm.ApellidosContactoFormulario != null) fm.ApellidosContactoFormulario.value = document.getElementById("apellidosContacto").value;
		if(fm.CargoFormulario != null) fm.CargoFormulario.value = document.getElementById("cargo").value;
		if(fm.DireccionEmpresaFormulario != null) fm.DireccionEmpresaFormulario.value = document.getElementById("direccionEmpresa").value;
		if(fm.CodPostalFormulario != null) fm.CodPostalFormulario.value = document.getElementById("codPostal").value;
		if(fm.ProvinciaFormulario != null) fm.ProvinciaFormulario.value = document.getElementById("provincia").options[document.getElementById("provincia").selectedIndex].text;
		if(fm.ProvinciaFormulario != null) fm.ProvinciaValor.value = document.getElementById("provincia").value;
		if(fm.Tfno1Formulario != null) fm.Tfno1Formulario.value = document.getElementById("tfno1").value;
		if(fm.Tfno2Formulario != null) fm.Tfno2Formulario.value = document.getElementById("tfno2").value;
		if(fm.MailFormulario != null) fm.MailFormulario.value = document.getElementById("mail").value;
		if(fm.SectorFormulario != null) fm.SectorFormulario.value = document.getElementById("sector").options[document.getElementById("sector").selectedIndex].text;
		if(fm.SectorFormulario != null) fm.SectorValor.value = document.getElementById("sector").value;
		if(fm.VolumenFormulario != null) fm.VolumenFormulario.value =document.getElementById("volumen").options[document.getElementById("volumen").selectedIndex].text;
		if(fm.VolumenFormulario != null) fm.VolumenValor.value =document.getElementById("volumen").value;
		if(fm.ExportaFormulario != null) fm.ExportaFormulario.value = document.getElementById("exporta").value;
		if(fm.InfProductosFormulario != null) fm.InfProductosFormulario.value = document.getElementById("infProductos").value;
		if(fm.ObservacionesFormulario != null) fm.ObservacionesFormulario.value = document.getElementById("observaciones").value;
		if(fm.cifFormulario != null) fm.cifFormulario.value = document.getElementById("cif").value;
		if(fm.NombreFormulario != null) fm.NombreFormulario.value = document.getElementById("nombre").value;
		if(fm.ApellidosFormulario != null) fm.ApellidosFormulario.value = document.getElementById("apellidos").value;
		if(fm.MedioFormulario != null) fm.MedioFormulario.value = document.getElementById("medio").value;
		if(fm.DireccionFormulario != null) fm.DireccionFormulario.value = document.getElementById("direccion").value;
		if(fm.PoblacionFormulario != null) fm.PoblacionFormulario.value = document.getElementById("poblacion").value;
		if(fm.TelefonoFormulario != null) fm.TelefonoFormulario.value = document.getElementById("telefono").value;
		if(fm.EstudiosFormulario != null) fm.EstudiosFormulario.value = document.getElementById("estudios").checked;
		if(fm.FinancieraFormulario != null) fm.FinancieraFormulario.value = document.getElementById("financiera").checked;
		
		
		fm.submit();
	}
	
	function enviarDatosModalidad(){
		var checkedGroup1;
		var checkedGroup2;
			for(i=0; i <document.f.group1.length; i++){
				if(document.f.group1[i].checked){
					document.f.resultado1.value = document.f.group1[i].value;
					checkedGroup1 = "si";
				}
	 		}
	 		for(i=0; i <document.f.group2.length; i++){
				if(document.f.group2[i].checked){
	 				document.f.resultado2.value = document.f.group2[i].value;
	 				checkedGroup2 = "si";
				}
	 		}
	 		if(document.f.group3 != null) {
		 		for(i=0; i <document.f.group3.length; i++){
					if(document.f.group3[i].checked){
	 					document.f.resultado3.value = document.f.group3[i].value;
					}
		 		}
		 	}
	 		if(checkedGroup1 == "si" && checkedGroup2 == "si"){
				document.f.PROCESO.value='WCC_ProcElSeguroDeCredito';
				document.f.ACCION.value='ProdElSeguroDeCredito';
				document.f.NUEVO.value = 'true';
				document.f.submit();
			}else{
				alert("Debe rellenar al menos los dos primeros campos del test, por favor revise las respuestas.")
			}
	}
	//funcion para un resultado en elegir modalidad en idioma español
	function mostrarResultado(mR, hilo){
		document.getElementById('resultadoModalidad0').style.display = 'none';
		document.getElementById('resultadoModalidad1').style.display = 'none';
		document.getElementById(mR).style.display = '';
		document.getElementById('eleccionModalidad1').innerHTML = "<td id=\"eleccionModalidad1\" ><a style=\"text-decoration: none;border:0px;\" href=\"/es/productos/seguro-credito/elegir-modalidad.html\"><img src=\"/images/repetirCuestionario.gif\" style=\"margin-right:25px; border:0px\"></td>";
	}
	//funcion para dos resultados en elegir modalidad en idioma español
	function mostrarResultado1(mR, hilo){
		document.getElementById('resultadoModalidad0').style.display = 'none';
		document.getElementById('resultadoModalidad1').style.display = 'none';
		document.getElementById('resultadoModalidad2').style.display = 'none';
		document.getElementById(mR).style.display = '';
		document.getElementById('eleccionModalidad1').innerHTML = "<td id=\"eleccionModalidad1\" ><a style=\"text-decoration: none;border:0px;\" href=\"/es/productos/seguro-credito/elegir-modalidad.html\"><img src=\"/images/repetirCuestionario.gif\" style=\"margin-right:25px; border:0px\"></td>";
	}
	//funcion para un resultado en elegir modalidad en idioma portugués
	function mostrarResultado2(mR, hilo){
		document.getElementById('resultadoModalidad0').style.display = 'none';
		document.getElementById('resultadoModalidad1').style.display = 'none';
		document.getElementById(mR).style.display = '';
		document.getElementById('eleccionModalidad1').innerHTML = "<td id=\"eleccionModalidad1\" ><a style=\"text-decoration: none;border:0px;\" href=\"/pt/produtos/seguro-credito/escolher-modalidade.html\"><img src=\"/images/repetirCuestionario_pt.png\" style=\"margin-right:25px; border:0px\"></td>";
	}
	//funcion para dos resultados en elegir modalidad en idioma inglés
	function mostrarResultado3(mR, hilo){
		document.getElementById('resultadoModalidad0').style.display = 'none';
		document.getElementById('resultadoModalidad1').style.display = 'none';
		document.getElementById('resultadoModalidad2').style.display = 'none';
		document.getElementById(mR).style.display = '';
		document.getElementById('eleccionModalidad1').innerHTML = "<td id=\"eleccionModalidad1\" ><a style=\"text-decoration: none;border:0px;\" href=\"/en/products/credit-insurance/choose-type.html\"><img src=\"/images/repetirCuestionario_en.png\" style=\"margin-right:25px; border:0px\"></td>";
	}
	//funcion para un resultado en elegir modalidad en idioma inglés
	function mostrarResultado4(mR, hilo){
		document.getElementById('resultadoModalidad0').style.display = 'none';
		document.getElementById('resultadoModalidad1').style.display = 'none';
		document.getElementById(mR).style.display = '';
		document.getElementById('eleccionModalidad1').innerHTML = "<td id=\"eleccionModalidad1\" ><a style=\"text-decoration: none;border:0px;\" href=\"/en/products/credit-insurance/choose-type.html\"><img src=\"/images/repetirCuestionario_en.png\" style=\"margin-right:25px; border:0px\"></td>";
	}
	//funcion para un resultado en elegir modalidad en idioma brasileño
	function mostrarResultado5(mR, hilo){
		document.getElementById('resultadoModalidad0').style.display = 'none';
		document.getElementById('resultadoModalidad1').style.display = 'none';
		document.getElementById(mR).style.display = '';
		document.getElementById('eleccionModalidad1').innerHTML = "<td id=\"eleccionModalidad1\" ><a style=\"text-decoration: none;border:0px;\" href=\"/br/produtos/seguro-credito/eleger-modalidade.html\"><img src=\"/images/repetirCuestionario_pt.png\" style=\"margin-right:25px; border:0px\"></td>";
	}
	function evaluaTecla(i){
		var codigoTecla = event.keyCode;
		//2 = global, 1 = local
		if(codigoTecla==13 && ((i == 2 && document.buscar.hilo.value =="") || (i== 1 && document.getElementById("hilolocal").value == "")) ){
			alert("Debe introducir una cadena para buscar");
			return false;
		}else if(codigoTecla==13){
			buscar(i);
		}		
	}

	function buscar(i){
		if ( (i == 2 && document.fbuscar.hilo.value =="") || (i== 1 && document.getElementById("hilolocal").value == ""))
		{
			alert("Debe introducir una cadena para buscar");
			return false;		
		}
		else
		{		
			if(i == 1) document.fbuscar.hilo.value = document.getElementById("hilolocal").value;
			document.fbuscar.submit();
		}
	}
	function entsub(campo,boton) {
	if ((window.event && window.event.keyCode == 13) || boton) {
	switch (campo.name) {
		case 'buscarDenominacion' : 
				var deno = document.f.buscarDenominacion.value;
				if(deno==''){
					alert('Introduzca un t\u00E9rmino de b\u00FAsqueda');				
				}else{
				document.f.buscarDenominacion.value=deno;
				document.f.buscarNIFCIF.value="";
				document.f.submit();
				}
			break;
		case 'buscarNIFCIF' : 
				var nif = document.f.buscarNIFCIF.value;
				nif = nif.toUpperCase();
					if(nif==''){
					alert('Introduzca un CIF/NIF');
				}else{				
					document.f.buscarDenominacion.value="";
					document.f.buscarNIFCIF.value=nif;
					document.f.submit();
				}				
			break;
					default : break;	
		}		
	}
}	
function historiaImagenes(historia) {
		if(historia == "publicidad"){
			var pagina = "historiaImagenes/publicidad3.html";		
			window.open(pagina, '_blank', 'width=1024,height=768'); 	
		}else if(historia == "sedesSociales"){
			var pagina = "historiaImagenes/sedesSociales.html";		
			window.open(pagina, '_blank', 'width=700,height=550'); 	
		}else if(historia == "imagenCorporativa"){
			var pagina = "historiaImagenes/imagenCorporativa.html";		
			window.open(pagina, '_blank', 'width=800,height=600'); 	
		}
}
function changeImages() {
	if (document.images ) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}