﻿if(!machine){
	var machine  = window.location.host;
	}
if(!busca){

/*	if (window.location.search){

		var busca   = window.location.search;

		} else { */

var busca = ""; 
	}
if(!protocolo){
	var protocolo = window.location.protocol;
}

var raiz_web ="";
var raiz_web_en = "web/en";
var raiz_web_es = "web";

var raiz_en = "en/paginas";
var raiz_es = "es/paginas";

var raiz_cv_web ="";
var raiz_cv_web_en="cv_web/en";
var raiz_cv_web_es="cv_web";

var raiz_info_web ="";
var raiz_info_web_en="info_web/en";
var raiz_info_web_es="info_web";

var raiz_sini_web ="";
var raiz_sini_web_en="sini_web/en";
var raiz_sini_web_es="sini_web";

var raiz_red_web ="";
var raiz_red_web_en="red_web/en";
var raiz_red_web_es="red_web";

var idioma_web;
var path_web_dir = window.location.pathname;
var path_web = path_web_dir.substring(1,7);

var path_cv_web = path_web_dir.substring(1,10); 
var path_info_web = path_web_dir.substring(1,12); 
var path_red_web = path_web_dir.substring(1,11);
var path_sini_web = path_web_dir.substring(1,12);

if (path_web=="web/en" || path_cv_web=="cv_web/en" || path_info_web=="info_web/en" || path_red_web=="red_web/en" || path_red_web=="sini_web/en") {
	raiz_web = raiz_web_en;
	raiz_cv_web = raiz_cv_web_en;
	raiz_info_web = raiz_info_web_en;	
	raiz_sini_web = raiz_sini_web_en;
	raiz_red_web = raiz_red_web_en;
	idioma_web = "en";
} else {
	raiz_web = raiz_web_es;
	raiz_cv_web = raiz_cv_web_es;
	raiz_info_web = raiz_info_web_es;
	raiz_sini_web = raiz_sini_web_es;	
	raiz_red_web = raiz_red_web_es;	
	idioma_web = "es";
}



//-------------------------------------------------------------------------
//Funcion: Tags de DNA
//Descripción: Código de seguimiento de DNA
//-------------------------------------------------------------------------
var refr=escape(document.referrer); /* get the http referer and encode it */
var dom=location.hostname; /* get the host domain */
var stURL="http://eu.link.decdna.net/n/15298/22049/www.ocaso.es/pykfvv;11;4;;6;;467rob;;;;;1;/i/c?0&1pixgif&referer=" + refr;
if ( (refr && refr.search(dom) == -1) && (location.href.toUpperCase().indexOf("247SEO=N") == -1) ) /* if the referrer is external preload the image request and does not contain 247SEO argument = "N" */
{
imageTR = new Image();
imageTR.src = stURL;
}

/****************************/
/*** Bloque para Imagenes ***/
/****************************/
function getUrl(entornoSeguro,restoUrl) {
	if (entornoSeguro) {
		if(machine) {
			return "https://"+machine+restoUrl;
		} else {
			return "https://"+window.location.host+restoUrl;
		}	
	} else {
		if(machine) {
			return "http://"+machine+restoUrl;
		} else {
			return "http://"+window.location.host+restoUrl;
		}	
	}
}

var imagenAlternativa
var nombreProducto
var nombreFamilia
var nombreImagen
var urlProducto
var numeroProducto

function cambiar(idImg,idImgNueva) {
	document.images[idImg].src = eval(idImgNueva+".src");
}

function menuP_on(a){
	imgIni = "menuP" + a;
	imgFin = "menuP" + a + "on";
	cambiar(imgIni,imgFin);
}

function menuP_off(a){
	imgIni = "menuP" + a;
	imgFin = "menuP" + a + "off";
	cambiar(imgIni,imgFin);
}



function cambiarIdioma(pag) {
	if (pag =="es") {
		pag = raiz_es;
	} else {
		pag = raiz_en;
	}
	restoUrl = "/" + pag + "/index.htm";
	url = getUrl(false,restoUrl);
	window.location.href = url;
}


/****************************/
/*** Bloque para Capas ***/
/****************************/
// Obtener version del navegador Internet Explorer....
var versionNavegador = navigator.appVersion;
if(versionNavegador + "" != "NaN")
{
 versionNavegador.match(/(MSIE)(\s*)([0-9].[0-9]+)/ig);
 versionNavegador = RegExp.$3;
}
versionNavegador = parseFloat(versionNavegador)
//alert(versionNavegador);
ie = (document.all)?true:false;
ns4 = (document.layers)?true:false;
ns6 = (document.getElementById && !(ie))?true:false;


function devolverObjeto(psElementName, poDocument) {
 //**********************************************************************
 //***Funcion devolverObjeto()
 //***Devuelve el objeto buscado
 //***Parámetros:psElementName - nombre del objeto a buscar
 //**********************************************************************
 var p,i,x;  
 if(!poDocument) poDocument=document; if((p=psElementName.indexOf("?"))>0&&parent.frames.length) {
 poDocument=parent.frames[psElementName.substring(p+1)].document; psElementName=psElementName.substring(0,p);}
 if(!(x=poDocument[psElementName])&&poDocument.all) x=poDocument.all[psElementName];
 else if (!document.layers)  if (!document.all) x=poDocument.getElementById(psElementName);
 for (i=0;!x&&i<poDocument.forms.length;i++) x=poDocument.forms[i][psElementName];
 for(i=0;!x&&poDocument.layers&&i<poDocument.layers.length;i++) x=devolverObjeto(psElementName,poDocument.layers[i].document); return x;
}
function obtenerPosicionLEFTDeLaCapa (nodo)
{
 // Si es Netscape 4.
 if (document.layers)
  return nodo.pageX
 else
 {
  // Si el Explorer es el 5.0, los elementos a obviar cambian...
  if (versionNavegador < 5.4)
  {
   // Si no hay ningun elemento padre, devolvemos 0
   if (nodo.parentNode == null)
    return 0;
   // Si es uno de estos elementos, no se cuenta ningun valor
   if (nodo.nodeName == "TR")
    valor = 0;
   else if( nodo.nodeName == "CENTER")
    valor = 0;
   else if( nodo.nodeName == "TBODY")
    valor = 0;
   else if( nodo.nodeName == "FORM")
    valor = 0;
   else
    valor = nodo.offsetLeft
  }
  else
  {
   // Si no hay ningun elemento padre, devolvemos 0
   if (nodo.parentNode == null)
    return 0;
   // Si es uno de estos elementos, no se cuenta ningun valor
   if (nodo.nodeName == "TD")
    valor = 0;
   else if( nodo.nodeName == "TR")
    valor = 0;
   else if( nodo.nodeName == "CENTER")
    valor = 0;
   else if( nodo.nodeName == "TABLE")
    valor = 0;
   else if( nodo.nodeName == "TBODY")
    valor = 0;
   else if( nodo.nodeName == "FORM")
    valor = 0;
   else
    valor = nodo.offsetLeft
  }
  // Si estamos dentro de otro elemento, sumamos la posicion LEFT de éste, 
  // y llamamos de nuevo para que sea recursiva y calcule la poscion de todoslos padres hasta llegar al final.
  return valor + obtenerPosicionLEFTDeLaCapa(nodo.parentNode);
 }
} 
 
function obtenerPosicionTOPDeLaCapa (nodo)
{
 // Si es Netscape 4.
 if (document.layers)
  return nodo.pageY
 else
 {
  // Si el Explorer es el 5.0, los elementos a obviar cambian...
  if (versionNavegador < 5.4)
  {
   // Si no hay ningun elemento padre, devolvemos 0
   if (nodo.parentNode == null)
    return 0;
   // Si es uno de estos elementos, no se cuenta ningun valor
   if (nodo.nodeName == "TR")
    valor = 0;
   else if( nodo.nodeName == "CENTER")
    valor = 0;
   else if( nodo.nodeName == "TBODY")
    valor = 0;
   else if( nodo.nodeName == "FORM")
    valor = 0;
   else
    valor = nodo.offsetTop
  }
  else
  {
   // Si no hay ningun elemento padre, devolvemos 0
   if (nodo.parentNode == null)
    return 0;
   // Si es uno de estos elementos, no se cuenta ningun valor
   if (nodo.nodeName == "TD")
    valor = 0;
   else if( nodo.nodeName == "TR")
    valor = 0;
   else if( nodo.nodeName == "CENTER")
    valor = 0;
   else if( nodo.nodeName == "TABLE")
    valor = 0;
   else if( nodo.nodeName == "TBODY")
    valor = 0;
   else if( nodo.nodeName == "FORM")
    valor = 0;
   else
    valor = nodo.offsetTop
  }
 
  // Si estamos dentro de otro elemento, sumamos la poscion TOP de éste, 
  // y llamamos de nuevo para que sea recursiva y calcule la posicion de todoslos padres hasta llegar al final.
  return valor + obtenerPosicionTOPDeLaCapa(nodo.parentNode);
 }
}


function reposicionaCapa(id,id2,desX,desY,cebo){
	//esta funcion reposiciona la capa id2 en funcion de  
	//donde esta la capa id. 
	//desX y desY son el desplazamiento de id2 respecto de id
	//alert("dexX --> " + desX + "\ndexY --> " + desY);
	if(ie){
		if (versionNavegador<5.4) {
			x = obtenerPosicionLEFTDeLaCapa(devolverObjeto(cebo));
			y = obtenerPosicionTOPDeLaCapa(devolverObjeto(cebo));
			/*alert(x);
			alert(y);
			return;
			eval("x = document.all." + id + ".offsetParent");
			eval("y = document.all." + id + ".offsetTop");*/
			//eval("x = document.all[" + id + "].position.left");
			//eval("y = document.all[" + id + "].position.top");
			eval("document.all." + id2 + ".style.left = x + desX");
			eval("document.all." + id2 + ".style.top  = y + desY");
		
		}
		else{
			eval("x = document.all." + id + ".offsetLeft");
			eval("y = document.all." + id + ".offsetTop");
			eval("document.all." + id2 + ".style.left = x + desX");
			eval("document.all." + id2 + ".style.top  = y + desY");
		}	
	}else if(ns4){
		eval("x = document.layers[\"" + id + "\"].pageX");
		eval("y = document.layers[\"" + id + "\"].pageY");
		eval("document.layers[\"" + id2 + "\"].left = x + desX");
		eval("document.layers[\"" + id2 + "\"].top  = y + desY");
	}else if(ns6){
		


		eval("x = document.getElementById(\"" + id + "\").offsetLeft");
		eval("y = document.getElementById(\"" + id + "\").offsetTop");
		
		
		
		eval("document.getElementById(\"" + id2 + "\").style.left = x + desX");
		eval("document.getElementById(\"" + id2 + "\").style.top  = y + desY");
	}
	//alert("X --> " + x + "\nY --> " + y);
}

function mostrarCapa(id){
	if(ie){
		eval(id + ".style.visibility = \"visible\"");
	}else if(ns4){
		eval("document.layers[\"" + id + "\"].visibility = \"show\"");
	}else if(ns6){
		eval("document.getElementById(\"" + id + "\").style.visibility = \"visible\"");
	}
}

function ocultarCapa(id){
	if(ie){
		eval(id + ".style.visibility = \"hidden\"");
	}else if(ns4){
		eval("document.layers[\"" + id + "\"].visibility = \"hide\"");
	}else if(ns6){
		eval("document.getElementById(\"" + id + "\").style.visibility = \"hidden\"");
	}
}

function estaVisible(id){
	if(ie){
		if (eval(id + ".style.visibility") == "hidden") { 
			return false 
		} else {
			return true
		}
	}else if(ns4){
		if (eval("document.layers[\"" + id + "\"].visibility") == "hide") { 
			return false
		} else {
			return true
		}
	}else if(ns6){
		if (eval("document.getElementById(\"" + id + "\").style.visibility") == "hidden") { 
			return false
		} else {
			return true
		}
	}
}

function desplegar(id){
	if (estaVisible(id)){
		ocultarCapa(id);
	}else{
		mostrarCapa(id);
	}
}



function accesoAreaPrivada() {
//	 var urlLogin = "http://svd01001.desa/GUsuarios/jsp/login.jsp";
	 var urlLogin = "https://mediadores.ocaso.es";
	 top.location.href = urlLogin;
}




function escribirPromocion(i){
	txt = "";
	//alert("begin ->escribirPromocion(" + i+ ")")
	if (i==1){		
		txt += "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n";
		txt += "	<tr>\n";
		txt += "		<td><img src=\"/" + raiz_web + "/img/promocion1CarreraAgente.gif\" width=\"63\" height=\"31\" alt=\"Carrera de Agente\"></td>\n";
		txt += "		<td rowspan=\"3\"><img src=\"/" + raiz_web + "/img/promocion1Imagen.gif\" width=\"57\" height=\"51\" alt=\"Carrera de agente\"></td>\n";
		txt += "		<td rowspan=\"3\"><img src=\"/" + raiz_web + "/img/b.gif\" width=\"10\" height=\"1\"></td>\n";		
		txt += "	</tr>\n";
		txt += "	<tr>\n";
		txt += "		<td><img src=\"/" + raiz_web + "/img/b.gif\" width=\"1\" height=\"5\"></td>\n";
		txt += "	</tr>\n";
		txt += "	<tr>\n";
		txt += "		<td valign=\"top\" align=\"left\"><a href=\"JavaScript:this.location=getUrl(false,'/' + raiz_web + '/3_2_carreraAgente.html');\" class=\"ep\">Infórmese</a>&nbsp;<img src=\"/" + raiz_web + "/img/flechas.gif\" width=\"6\" height=\"5\"></td>\n";
		txt += "	</tr>\n";
		txt += "</table>\n";
	} else if (i==2){
		txt += "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
		txt += "	<tr>";
		txt += "		<td colspan=\"3\"><img src=\"/" + raiz_web + "/img/promocion2HablaNosotros.gif\" width=\"120\" height=\"29\" alt=\"Hable con nosotros, le informamos\"></td>";
		txt += "		<td rowspan=\"6\"><img src=\"/" + raiz_web + "/img/b.gif\" width=\"10\" height=\"1\"></td>\n";				
		txt += "	</tr>";
		txt += "	<tr>";
		txt += "		<td colspan=\"3\"><img src=\"/" + raiz_web + "/img/b.gif\" width=\"1\" height=\"5\"></td>";
		txt += "	</tr>";
		txt += "	<tr>";
		txt += "		<td valign=\"middle\"><img src=\"/" + raiz_web + "/img/flechaNaranja.gif\" width=\"6\" height=\"5\"></td>";		
		txt += "		<td rowspan=\"4\"><img src=\"/" + raiz_web + "/img/b.gif\" width=\"6\" height=\"1\"></td>";		
		txt += "		<td rowspan=\"2\" valign=\"middle\"><a href=\"JavaScript:this.location=getUrl(true,'/' + raiz_info_web + '/jsp/solicitarMasInformacionOcaso.jsp');\" class=\"ep\">personalmente en su domicilio</a></td>";
		txt += "	</tr>";
		txt += "	<tr>";
		txt += "		<td><img src=\"/" + raiz_web + "/img/b.gif\" width=\"1\" height=\"1\"></td>";
		txt += "	</tr>";
//		txt += "	<tr>";
//		txt += "		<td valign=\"baseline\"><img src=\"/" + raiz_web + "/img/flechaNaranja.gif\" width=\"6\" height=\"5\"></td>";
//		txt += "        <td valign=\"baseline\"><a href=\"/" + raiz_web + "/2_1_telefonoAtencion24h.html\" class=\"ep\">en el 901 25 65 65</a></td>";
//		txt += "	</tr>";
		txt += "	<tr>";
		txt += "		<td valign=\"baseline\"><img src=\"/" + raiz_web + "/img/flechaNaranja.gif\" width=\"6\" height=\"5\"></td>";
		txt += "        <td valign=\"baseline\"><a href=\"JavaScript:this.location=getUrl(false,'/' + raiz_red_web + '/jsp/redOficinasOcaso.jsp');\" class=\"ep\">en nuestras oficinas</a></td>";
		txt += "	</tr>";
		txt += "</table>";
	} else if (i==3){
		txt += "<a href=\"JavaScript:this.location=getUrl(false,'/' + raiz_red_web + '/jsp/redOficinasOcaso.jsp');\"><img src=\"/" + raiz_web + "/img/promocion3.gif\" alt=\"Consulte nuestra red de oficinas\" width=\"120\" height=\"82\" border=\"0\"></a><img src=\"/" + raiz_web + "/img/b.gif\" width=\"10\" height=\"1\" border=\"0\">\n"; 
	} else if (i==4){
		txt += "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
		txt += "	<tr>";
		txt += "		<td colspan=\"3\"><img src=\"/" + raiz_web + "/img/promocion2HablaNosotros.gif\" width=\"120\" height=\"29\" alt=\"Hable con nosotros, le informamos\"></td>";
		txt += "		<td rowspan=\"6\"><img src=\"/" + raiz_web + "/img/b.gif\" width=\"10\" height=\"1\"></td>\n";				
		txt += "	</tr>";
		txt += "	<tr>";
		txt += "		<td colspan=\"3\"><img src=\"/" + raiz_web + "/img/b.gif\" width=\"1\" height=\"5\"></td>";
		txt += "	</tr>";
		txt += "	<tr>";
		txt += "		<td valign=\"middle\"><img src=\"/" + raiz_web + "/img/flechaNaranja.gif\" width=\"6\" height=\"5\"></td>";		
		txt += "		<td rowspan=\"4\"><img src=\"/" + raiz_web + "/img/b.gif\" width=\"6\" height=\"1\"></td>";		
		txt += "		<td rowspan=\"2\" valign=\"middle\"><a href=\"Javascript:this.location=getUrl(true,'/' + raiz_cv_web + '/jsp/a5_trabajaConNosotrosOcaso.jsp');\" class=\"ep\">enviar Currículum</a></td>";
		txt += "	</tr>";
		txt += "	<tr>";
		txt += "		<td><img src=\"/" + raiz_web + "/img/b.gif\" width=\"1\" height=\"1\"></td>";
		txt += "	</tr>";
		txt += "	<tr>";
		txt += "		<td valign=\"baseline\"><img src=\"/" + raiz_web + "/img/flechaNaranja.gif\" width=\"6\" height=\"5\"></td>";
		txt += "        <td valign=\"baseline\"><a href=\"JavaScript:this.location=getUrl(false,'/' + raiz_red_web + '/jsp/redOficinasOcaso.jsp');\" class=\"ep\">en nuestras oficinas</a></td>";
		txt += "	</tr>";
		txt += "</table>";
	} else if (i==5){
		txt += "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
		txt += "	<tr>";
		txt += "		<td colspan=\"3\"><a href='/' + raiz_web + '/1_3_1a_ocasoHogarDescripcion.html' class='dh2'><img src=\"/" + raiz_web + "/img/banner_lateral.gif\"  alt=\"\" border='0'></a></td>";
		txt += "		<td rowspan=\"6\"><img src=\"/" + raiz_web + "/img/b.gif\" width=\"10\" height=\"1\"></td>\n";				
		txt += "	</tr>";
		txt += "	<tr>";
		txt += "		<td colspan=\"3\"><img src=\"/" + raiz_web + "/img/b.gif\" width=\"1\" height=\"5\"></td>";
		txt += "	</tr>";
		txt += "</table>";
	}
	/*else if (i==4){
		txt += "<a href=\"#\"><img src=\"/" + raiz_web + "/img/promocion4.gif\" width=\"120\" height=\"89\" border=\"0\"></a><br>\n"; 
	} else if (i==5){
		txt += "<a href=\"#\"><img src=\"/" + raiz_web + "/img/promocion5.gif\" width=\"120\" height=\"65\" border=\"0\"></a><br>\n"; 
	}*/	
	else if (i==6){		
		txt += "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n";		
		txt += "	<tr>\n";
		txt += "		<td><img src=\"/" + raiz_web + "/img/b.gif\" width=\"1\" height=\"5\"></td>\n";
		txt += "	</tr>\n";
		txt += "	<tr>\n";
		txt += "		<td valign=\"top\" align=\"left\">\n";
		txt += "			<OBJECT classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" WIDTH=\"130\" HEIGHT=\"165\" id=\"banner_130x165_00\" ALIGN=\"\">\n";
		txt += " 				<PARAM NAME=movie VALUE=\"/" + raiz_web + "/flash/banner_130x165_00.swf\">\n"; 
		txt += "				<PARAM NAME=quality VALUE=high>\n"; 
		txt += "				<PARAM NAME=bgcolor VALUE=#C6C3C6>\n"; 
		txt += "				<EMBED src=\"/" + raiz_web + "/flash/banner_130x165_00.swf\" quality=high bgcolor=#C6C3C6  WIDTH=\"130\" HEIGHT=\"165\" NAME=\"banner_130x165_00\" ALIGN=\"\" TYPE=\"application/x-shockwave-flash\" </EMBED>\n";
		txt += "			</OBJECT>\n";		
		txt += "		</td>\n";
		txt += "	</tr>\n";
		txt += "</table>\n";
	} 
	else if (i==7){		
		txt += "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n";		
		txt += "	<tr>\n";
		txt += "		<td><img src=\"/" + raiz_web + "/img/b.gif\" width=\"1\" height=\"5\"></td>\n";
		txt += "	</tr>\n";
		txt += "	<tr>\n";
		txt += "		<td valign=\"top\" align=\"left\">\n";
		txt += "			<OBJECT classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" id=\"banner_130x165_00\" ALIGN=\"\">\n";
		txt += " 				<PARAM NAME=movie VALUE=\"/" + raiz_web + "/flash/banner_wok_interior.swf\">\n"; 
		txt += "				<PARAM NAME=quality VALUE=high>\n"; 
		txt += "				<PARAM NAME=bgcolor VALUE=#C6C3C6>\n"; 
		txt += "				<EMBED src=\"/" + raiz_web + "/flash/banner_wok_interior.swf\" quality=high NAME=\"banner_130x165_00\" ALIGN=\"\" TYPE=\"application/x-shockwave-flash\" </EMBED>\n";
		txt += "			</OBJECT>\n";		
		txt += "		</td>\n";
		txt += "	</tr>\n";
		txt += "</table>\n";
	} 
	else if (i==8){		
		txt += "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n";		
		txt += "	<tr>\n";
		txt += "		<td><img src=\"/" + raiz_web + "/img/b.gif\" width=\"1\" height=\"5\"></td>\n";
		txt += "	</tr>\n";
		txt += "	<tr>\n";
		txt += "		<td valign=\"top\" align=\"left\">\n";
		txt += "			<OBJECT classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\"118\" height=\"150\" id=\"promoA\" ALIGN=\"\">\n";
		txt += " 				<PARAM NAME=movie VALUE=\"/" + raiz_web + "/flash/promoA.swf\">\n"; 
		txt += "				<PARAM NAME=quality VALUE=high>\n"; 
		txt += "				<PARAM NAME=bgcolor VALUE=#FFFFFF>\n"; 
		txt += "				<EMBED src=\"/" + raiz_web + "/flash/promoA.swf\" quality=high NAME=\"promoA\" width=\"118\" height=\"150\" ALIGN=\"\" TYPE=\"application/x-shockwave-flash\" </EMBED>\n";
		txt += "			</OBJECT>\n";		
		txt += "		</td>\n";
		txt += "	</tr>\n";
		txt += "</table>\n";
	} 
	else if (i==9){                 
		txt += "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n"; 
        txt += " <tr>\n"; 
        txt += "              <td><img src=\"/" + raiz_web + "/img/Promocion2Ferias.gif\" width=\"63\" height=\"31\" alt=\"Ferias y Congresos\"></td>\n"; 
        txt += "              <td rowspan=\"3\"><img src=\"/" + raiz_web + "/img/promocion2Imagen.gif\" width=\"57\" height=\"51\" alt=\"Ferias y Congresos\"></td>\n"; 
        txt += "              <td rowspan=\"3\"><img src=\"/" + raiz_web + "/b.gif\" width=\"10\" height=\"1\"></td>\n";                  
        txt += " </tr>\n"; 
        txt += " <tr>\n"; 
        txt += "              <td><img src=\"/" + raiz_web + "/b.gif\" width=\"1\" height=\"5\"></td>\n"; 
        txt += " </tr>\n"; 
        txt += " <tr>\n"; 
        txt += "              <td valign=\"top\" align=\"left\"><a style='cursor:hand' onclick=\"javascript:window.open('/' + raiz_web + '/feriasycongresos.html')\" class=\"ep\">Infórmate</a>&nbsp;<img src=\"/" + raiz_web + "/img/flechas.gif\" width=\"6\"   height=\"5\"></td>\n"; 
        txt += " </tr>\n"; 
        txt += "</table>\n"; 
	}
	// EMPIEZAN LOS CASOS PARA LA VERSIԎ INGLESA, ESTAN DUPLICADOS: 2 es ahora el 10; 1 es ahora el 11;14 es comun a todos
	 else if (i==10){
		txt += "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
		txt += "	<tr>";
		txt += "		<td colspan=\"3\"><img src=\"/" + raiz_web + "/img/promocion2HablaNosotros.gif\" width=\"120\" height=\"29\" alt=\"Contact us and we'll inform you further.\"></td>";
		txt += "		<td rowspan=\"6\"><img src=\"/" + raiz_web + "/img/b.gif\" width=\"10\" height=\"1\"></td>\n";				
		txt += "	</tr>";
		txt += "	<tr>";
		txt += "		<td colspan=\"3\"><img src=\"/" + raiz_web + "/img/b.gif\" width=\"1\" height=\"5\"></td>";
		txt += "	</tr>";
		txt += "	<tr>";
		txt += "		<td valign=\"middle\"><img src=\"/" + raiz_web + "/img/flechaNaranja.gif\" width=\"6\" height=\"5\"></td>";		
		txt += "		<td rowspan=\"4\"><img src=\"/" + raiz_web + "/img/b.gif\" width=\"6\" height=\"1\"></td>";		
		txt += "		<td rowspan=\"2\" valign=\"middle\"><a href=\"JavaScript:this.location=getUrl(true,'/' + raiz_info_web + '/jsp/solicitarMasInformacionOcaso.jsp');\" class=\"ep\">personally, at your home</a></td>";
		txt += "	</tr>";
		txt += "	<tr>";
		txt += "		<td><img src=\"/" + raiz_web + "/img/b.gif\" width=\"1\" height=\"1\"></td>";
		txt += "	</tr>";
//		txt += "	<tr>";
//		txt += "		<td valign=\"baseline\"><img src=\"/" + raiz_web + "/img/flechaNaranja.gif\" width=\"6\" height=\"5\"></td>";
//		txt += "        <td valign=\"baseline\"><a href=\"/" + raiz_web + "/2_1_telefonoAtencion24h.html\" class=\"ep\">en el 901 25 65 65</a></td>";
//		txt += "	</tr>";
		txt += "	<tr>";
		txt += "		<td valign=\"baseline\"><img src=\"/" + raiz_web + "/img/flechaNaranja.gif\" width=\"6\" height=\"5\"></td>";
		txt += "        <td valign=\"baseline\"><a href=\"JavaScript:this.location=getUrl(false,'/' + raiz_red_web + '/jsp/redOficinasOcaso.jsp');\" class=\"ep\">at our offices</a></td>";
		txt += "	</tr>";
		txt += "</table>";
	} else if (i==11){		
		txt += "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n";
		txt += "	<tr>\n";
		txt += "		<td><img src=\"/" + raiz_web + "/img/promocion1CarreraAgente.gif\" width=\"63\" height=\"31\" alt=\"Join us\"></td>\n";
		txt += "		<td rowspan=\"3\"><img src=\"/" + raiz_web + "/img/promocion1Imagen.gif\" width=\"57\" height=\"51\" alt=\"Join us\"></td>\n";
		txt += "		<td rowspan=\"3\"><img src=\"/" + raiz_web + "/img/b.gif\" width=\"10\" height=\"1\"></td>\n";		
		txt += "	</tr>\n";
		txt += "	<tr>\n";
		txt += "		<td><img src=\"/" + raiz_web + "/img/b.gif\" width=\"1\" height=\"5\"></td>\n";
		txt += "	</tr>\n";
		txt += "	<tr>\n";
		txt += "		<td valign=\"top\" align=\"left\"><a href=\"JavaScript:this.location=getUrl(false,'/' + raiz_web + '/3_2_carreraAgente.html');\" class=\"ep\">Find out more</a>&nbsp;<img src=\"/" + raiz_web + "/img/flechas.gif\" width=\"6\" height=\"5\"></td>\n";
		txt += "	</tr>\n";
		txt += "</table>\n";
	} else if (i==12){
		txt += "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
		txt += "	<tr>";
		txt += "		<td colspan=\"3\"><img src=\"/" + raiz_web + "/img/promocion2HablaNosotros.gif\" width=\"120\" height=\"29\" alt=\"Contact us and we'll inform you further\"></td>";
		txt += "		<td rowspan=\"6\"><img src=\"/" + raiz_web + "/img/b.gif\" width=\"10\" height=\"1\"></td>\n";				
		txt += "	</tr>";
		txt += "	<tr>";
		txt += "		<td colspan=\"3\"><img src=\"/" + raiz_web + "/img/b.gif\" width=\"1\" height=\"5\"></td>";
		txt += "	</tr>";
		txt += "	<tr>";
		txt += "		<td valign=\"middle\"><img src=\"/" + raiz_web + "/img/flechaNaranja.gif\" width=\"6\" height=\"5\"></td>";		
		txt += "		<td rowspan=\"4\"><img src=\"/" + raiz_web + "/img/b.gif\" width=\"6\" height=\"1\"></td>";		
		txt += "		<td rowspan=\"2\" valign=\"middle\"><a href=\"Javascript:this.location=getUrl(true,'/' + raiz_cv_web + '/jsp/a5_trabajaConNosotrosOcaso.jsp');\" class=\"ep\">send C.V.</a></td>";
		txt += "	</tr>";
		txt += "	<tr>";
		txt += "		<td><img src=\"/" + raiz_web + "/img/b.gif\" width=\"1\" height=\"1\"></td>";
		txt += "	</tr>";
		txt += "	<tr>";
		txt += "		<td valign=\"baseline\"><img src=\"/" + raiz_web + "/img/flechaNaranja.gif\" width=\"6\" height=\"5\"></td>";
		txt += "        <td valign=\"baseline\"><a href=\"JavaScript:this.location=getUrl(false,'/' + raiz_red_web + '/jsp/redOficinasOcaso.jsp');\" class=\"ep\">at our offices</a></td>";
		txt += "	</tr>";
		txt += "</table>";
	} else if (i==13){
		txt += "<a href=\"JavaScript:this.location=getUrl(false,'/' + raiz_red_web + '/jsp/redOficinasOcaso.jsp');\"><img src=\"/" + raiz_web + "/img/promocion3.gif\" alt=\"Branches and Offices\" width=\"120\" height=\"82\" border=\"0\"></a><img src=\"/" + raiz_web + "/img/b.gif\" width=\"10\" height=\"1\" border=\"0\">\n"; 
	} else if (i==14){
		txt += "<a href=\"JavaScript:this.location=getUrl(false,'/' + raiz_web + '/1_2_1c_asistenciaFamiliarAsesoramiento.html');\"><img src=\"/" + raiz_web + "/img/promocion6.jpg\" alt=\"Atenci䮠Mꥩca Telef䯩ca\" width=\"120\" height=\"82\" border=\"0\"></a><img src=\"/" + raiz_web + "/img/b.gif\" width=\"10\" height=\"1\" border=\"0\">\n"; 
	}
	//alert(txt)
	document.write(txt);
}



function escribirMenuSecundario(){
	txt = "";
	txt += "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"170\">\n";
	txt += "<tr valign=\"top\"><td width=\"10\"><img src=\"/" + raiz_web + "/img/b.gif\" width=\"10\" height=\"200\" border=\"0\"></td><td>\n";
	txt += "	<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"155\">\n";
	txt += "	<tr><td colspan=\"3\" width=\"155\"><img src=\"/" + raiz_web + "/img/b.gif\" width=\"155\" height=\"12\" border=\"0\"></td></tr>\n";
		for (i=0;i<menuSecundario.length;i++){	
	txt += "	<tr>\n";
			if (estadoMenuSecundario==i) {
	txt += "			<td width=\"3\"><img src=\"/" + raiz_web + "/img/flecha_seleccionada.gif\" width=\"3\" height=\"5\" border=\"0\"></td>\n";
	txt += "			<td width=\"2\"><img src=\"/" + raiz_web + "/img/b.gif\" width=\"2\" height=\"1\" border=\"0\"></td>\n";
	txt += "			<td><a href=\"" + menuSecundario[i][1] + "\" class=\"n2ns\" >&nbsp;" + menuSecundario[i][0] + "</a></td>\n";
			}
			else {
	txt += "			<td width=\"3\"><img src=\"/" + raiz_web + "/img/flecha.gif\" name='flecha"+i+"' width=\"3\" height=\"5\" border=\"0\"></td>\n";
	txt += "			<td width=\"2\"><img src=\"/" + raiz_web + "/img/b.gif\"  width=\"2\" height=\"1\" border=\"0\"></td>\n";
	txt += "			<td><a href=\"" + menuSecundario[i][1] + "\" class=\"n2n\" onmouseover=\"cambiar('flecha"+i+"','menuSon')\" onmouseout=\"cambiar('flecha"+i+"','menuSoff')\">&nbsp;" + menuSecundario[i][0] + "</a></td>\n";
			}
	txt += "	</tr>\n";
	txt += "	<tr>\n";
	txt += "		<td colspan=\"2\"><img src=\"/" + raiz_web + "/img/b.gif\"  width=\"3\" height=\"1\" border=\"0\"></td>\n";
	txt += "		<td bgcolor=\"#DDDDDD\" width=\"155\"><img src=\"/" + raiz_web + "/img/b.gif\"  width=\"155\" height=\"1\" border=\"0\"></td>\n";
	txt += "	</tr>\n";
		}
	txt += "	</table>\n";
	txt += "</td></tr>\n";
	txt += "</table>\n";
	document.write(txt);

} 


function abrirventana(url,name)
  { 
    ventana=window.open(url,"name","location=no,toolbar=no,menubar=no,personalbar=no,resizable=yes,scrollbars=yes,hotkeys=no,top=0,left=0,width=650,height=400");
    ventana.focus();
  }
function abrirVentanaAyuda(url,name)
  { 
    ventana=window.open(url,"name","location=no,toolbar=no,menubar=no,personalbar=no,resizable=yes,scrollbars=yes,hotkeys=no,top=0,left=0,width=450,height=200");
    ventana.focus();
  }
  function abrirVentanaGenerica(url,name, ancho, alto)
  { 
    ventana=window.open(url,"name","location=no,toolbar=no,menubar=no,personalbar=no,resizable=yes,scrollbars=yes,hotkeys=no,top=0,left=0,width=" + ancho + ",height=" + alto);
    ventana.focus();
  }
  function abrirVentanaGenerica2(url,name, ancho, alto)
  { 
    ventana=window.open(url,"name","location=yes,toolbar=yes,menubar=yes,personalbar=no,resizable=yes,scrollbars=yes,hotkeys=no,top=0,left=0,width=" + ancho + ",height=" + alto);
    ventana.focus();
  }
/*
function abrepdf(pagina)
 {
   var ventana=window.open(pagina,"ocaso","location=no,resizable=yes,scrollbars=no,hotkeys=no,width=780,height=420,top=0,left=0");
   ventana.focus();
 }
*/
// La funcion abrirDocumentacion se encuentra duplicada en la Intranet, cualquier cambio ha de hacerse alli tambien
function abrirDocumentacion(prod,name,w,h,l,t){
	if (w==null) w=280;
	if (h==null) h=330;
	
	anchoPantalla = screen.width;
	altoPantalla  = screen.height;
	posX = (anchoPantalla - w)/2;
	posY = (altoPantalla  - h)/2;

	if (l>-1) posX = l;
	if (t>-1) posY = t;
                
                url ="/" + raiz_web + "/documentacion/"+prod+"/"+name;

	Documentacion=window.open(url,'Documentacion','toolbar=no,resizable=no,status=no,scrollbars=no,location=no,menubar=no,width='+w+',height='+h+',left='+posX+',top='+posY);
}

function initPage() {
	//if (ns6){
	//	if (window.innerWidth - document.body.offsetWidth > 0) {
			//Comentaro area Privada
			//reposicionaCapa('capaAreaPrivada','capaAreaPrivadaOn',0,22,'cebo');
			//Comentaro area Privada
	//	}
	//}
	//Comentaro area Privada
	//redimension();
	//Comentaro area Privada
}

function redimension(){
	reposicionaCapa('capaAreaPrivada','capaAreaPrivadaOn',0,22,'cebo');
	aa = setTimeout("redimension()",50);
}

function validarPass(){
	alert("Usuario/contraseña errónea");
}

function submitCampos(producto){
	nombreImagen  = menuSecundarioProductos[estadoMenuSecundario][2];
	vNombreImagen = nombreImagen.split("/");
	nombreImagen  = vNombreImagen[vNombreImagen.length-1];
	vNombreImagen = nombreImagen.split(".");
	nombreImagen  = vNombreImagen[0] + "-s.jpg";
	
	document.formulario.nombreProducto.value = producto;
	document.formulario.nombreFamilia.value  = menuSecundarioProductos[estadoMenuSecundario][0];
	document.formulario.nombreImagen.value   = nombreImagen;
	document.formulario.action = getUrl(true,"/" + raiz_info_web + "/jsp/solicitarMasInformacionOcaso.jsp");
//	document.formulario.action = "/" + raiz_info_web + "/jsp/solicitarMasInformacionOcaso.jsp";
	document.formulario.submit();
}

function submitCamposIngles(producto){
	
	nombreImagen  = menuSecundarioProductos[estadoMenuSecundario][2];
	vNombreImagen = nombreImagen.split("/");
	nombreImagen  = vNombreImagen[vNombreImagen.length-1];
	vNombreImagen = nombreImagen.split(".");
	nombreImagen  = vNombreImagen[0] + "-s.jpg";
	
	document.formulario.nombreProducto.value = producto;
	document.formulario.nombreFamilia.value  = menuSecundarioProductos[estadoMenuSecundario][0];
//	document.formulario.nombreImagen.value   = nombreImagen;
	document.formulario.nombreImagen.value   = "contact.jpg";
	
	//document.formulario.action = "/" + raiz_web + "/jsp/moreInformation.jsp";
	document.formulario.action = getUrl(true,"/" + raiz_web + "/jsp/moreInformation.jsp");
	document.formulario.submit();
}

function submitCamposParametros(producto){
	nombreImagen  = menuSecundarioProductos[estadoMenuSecundario][2];
	vNombreImagen = nombreImagen.split("/");
	nombreImagen  = vNombreImagen[vNombreImagen.length-1];
	vNombreImagen = nombreImagen.split(".");
	nombreImagen  = vNombreImagen[0] + "-s.jpg";
	
	document.formulario.nombreProducto.value = producto;
	document.formulario.nombreFamilia.value  = menuSecundarioProductos[estadoMenuSecundario][0];
	document.formulario.nombreImagen.value   = nombreImagen;
	
	document.formulario.action = getUrl(true,"/" + raiz_info_web + "/jsp/solicitarMasInformacionOcaso.jsp?Origen=Microsite_Ocaso&Evento=Promocion_sept2005");
//	document.formulario.action = "/" + raiz_info_web + "/jsp/solicitarMasInformacionOcaso.jsp";
	document.formulario.submit();
}

function irA(menu){
	window.location.href = menu.options[menu.selectedIndex].value;
}  

function irA2(menu){
	if (menu.options[menu.selectedIndex].value == "1")
		window.location.href = "/" + raiz_web + "/jsp/Tarificar.jsp?xmlProd=AhorroActivoPP.xml&xslProd=ahorroActivoPPCalcularPrecio.xsl&inicio=S";
	else
		window.location.href = "/" + raiz_web + "/jsp/Tarificar.jsp?xmlProd=AhorroActivoPU.xml&xslProd=ahorroActivoPUCalcularPrecio.xsl&inicio=S";
}  

function irA2Flexible(menu){
	if (menu.options[menu.selectedIndex].value == "1")
		window.location.href = "Tarificar.jsp?xmlProd=PlanPersonalFlexiblePP.xml&xslProd=planPersonalFlexiblePPCalcularPrecio.xsl&inicio=S";
	else
		window.location.href = "Tarificar.jsp?xmlProd=PlanPersonalFlexiblePU.xml&xslProd=planPersonalFlexiblePUCalcularPrecio.xsl&inicio=S";
}

function irA2Prevision(menu){
	if (menu.options[menu.selectedIndex].value == "1")
		window.location.href = "Tarificar.jsp?xmlProd=PrevisionAseguradaPP.xml&xslProd=previsionAseguradaPPCalcularPrecio.xsl&inicio=S";
	else
		window.location.href = "Tarificar.jsp?xmlProd=PrevisionAseguradaPU.xml&xslProd=previsionAseguradaPUCalcularPrecio.xsl&inicio=S";
}

function irA2Multivida(menu){
	if (menu.options[menu.selectedIndex].value == "1")
		window.location.href = "Tarificar.jsp?xmlProd=MultividaConstante.xml&xslProd=multividaConstanteCalcularPrecio.xsl&inicio=S";
	else
		window.location.href = "Tarificar.jsp?xmlProd=MultividaRenovable.xml&xslProd=multividaRenovableCalcularPrecio.xsl&inicio=S";
}

function abrirVentanaInfo(url,w,h,l,t){
	/*if (w==null) w=280;
	if (h==null) h=330;
	
	anchoPantalla = screen.width;
	altoPantalla  = screen.height;
	posX = (anchoPantalla - w)/2;
	posY = (altoPantalla  - h)/2;

	if (l>-1) posX = l;
	if (t>-1) posY = t; */

                                                                            
	ventanita=window.open(url,'ventanita','location=no,toolbar=no,menubar=no,personalbar=no,resizable=yes,scrollbars=yes,hotkeys=no,top=0,left=0,width=450,height=200');
}

function info(producto,idioma,idAyuda){   
	//var help ="/" + raiz_web + "/jsp/ayudaweb.jsp?producto="+producto+"&idioma="+idioma+"&idAyuda="+idAyuda;
	var help ="/web_app/jsp/ayudaweb.jsp?producto="+producto+"&idioma="+idioma+"&idAyuda="+idAyuda;
	abrirVentanaInfo(help);
}

//Convierte un float en una cadena representativa de un número decimal

//Convierte una cadena representativa de un número decimal (separador de decimales = coma) en un float
function toDouble(numero) {
	if (numero == "")
		numero = "0";
	numero = parseFloat(numero.replace(",","."));
	return numero;
}
function toDoubleComma(numero) 
{
	numero = String(numero).replace(".",",");
	if (numero.indexOf(",") == -1 && numero != "")
	numero = numero + ",00";
	return String(numero);
}	
//Funcion para calcular el valor del campo contenido en funcion de los contenidos parciales de la pestaña de valoracion valoración
function calcularContenido() {
	document.formulario.R_G1_contenido.value = toDoubleComma(toDouble(document.formulario.R_G1_mobiliario.value));
	document.formulario.R_G1_contenido.value = toDoubleComma(toDouble(document.formulario.R_G1_jCaja.value) + toDouble(document.formulario.R_G1_contenido.value));
	document.formulario.R_G1_contenido.value = toDoubleComma(toDouble(document.formulario.R_G1_jMueble.value) + toDouble(document.formulario.R_G1_contenido.value));
	document.formulario.R_G1_contenido.value = toDoubleComma(toDouble(document.formulario.R_G1_coleccionesC.value) + toDouble(document.formulario.R_G1_contenido.value));
	document.formulario.R_G1_contenido.value = toDoubleComma(toDouble(document.formulario.R_G1_coleccionesFC.value) + toDouble(document.formulario.R_G1_contenido.value));
	document.formulario.R_G1_contenido.value = toDoubleComma(toDouble(document.formulario.R_G1_objArte.value) + toDouble(document.formulario.R_G1_contenido.value));
	document.formulario.R_G1_contenido.value = toDoubleComma(toDouble(document.formulario.R_G1_prendas.value) + toDouble(document.formulario.R_G1_contenido.value));
	document.formulario.R_G1_contenido.value = toDoubleComma(toDouble(document.formulario.R_G1_plata.value) + toDouble(document.formulario.R_G1_contenido.value));
	document.formulario.R_G1_contenido.value = toDoubleComma(toDouble(document.formulario.R_G1_trnsFacil.value) + toDouble(document.formulario.R_G1_contenido.value));  
}

//Función para calcular el valor del campo total joyas y objetos de arte en fc. de los valores parciales
function calcularJoyasObj() {
	document.formulario.R_G1_joyasObj.value = toDoubleComma(toDouble(document.formulario.R_G1_jMueble.value));
	document.formulario.R_G1_joyasObj.value = toDoubleComma(toDouble(document.formulario.R_G1_jCaja.value) + toDouble(document.formulario.R_G1_joyasObj.value));
	document.formulario.R_G1_joyasObj.value = toDoubleComma(toDouble(document.formulario.R_G1_coleccionesC.value) + toDouble(document.formulario.R_G1_joyasObj.value));		
	document.formulario.R_G1_joyasObj.value = toDoubleComma(toDouble(document.formulario.R_G1_coleccionesFC.value) + toDouble(document.formulario.R_G1_joyasObj.value));		
	document.formulario.R_G1_joyasObj.value = toDoubleComma(toDouble(document.formulario.R_G1_objArte.value) + toDouble(document.formulario.R_G1_joyasObj.value));
	document.formulario.R_G1_joyasObj.value = toDoubleComma(toDouble(document.formulario.R_G1_prendas.value) + toDouble(document.formulario.R_G1_joyasObj.value));
	document.formulario.R_G1_joyasObj.value = toDoubleComma(toDouble(document.formulario.R_G1_plata.value) + toDouble(document.formulario.R_G1_joyasObj.value));
	document.formulario.R_G1_joyasObj.value = toDoubleComma(toDouble(document.formulario.R_G1_trnsFacil.value) + toDouble(document.formulario.R_G1_joyasObj.value));
}

//Función para calcular el valor del campo total objetos de arte en fc. de los valores parciales
function calcularObj() {
	document.formulario.R_G1_obj.value = toDoubleComma(toDouble(document.formulario.R_G1_coleccionesC.value));
	document.formulario.R_G1_obj.value = toDoubleComma(toDouble(document.formulario.R_G1_coleccionesFC.value) + toDouble(document.formulario.R_G1_obj.value));
	document.formulario.R_G1_obj.value = toDoubleComma(toDouble(document.formulario.R_G1_objArte.value) + toDouble(document.formulario.R_G1_obj.value));
	document.formulario.R_G1_obj.value = toDoubleComma(toDouble(document.formulario.R_G1_prendas.value) + toDouble(document.formulario.R_G1_obj.value));
	document.formulario.R_G1_obj.value = toDoubleComma(toDouble(document.formulario.R_G1_plata.value) + toDouble(document.formulario.R_G1_obj.value));
	document.formulario.R_G1_obj.value = toDoubleComma(toDouble(document.formulario.R_G1_trnsFacil.value) + toDouble(document.formulario.R_G1_obj.value));
}

//Función para calcular el valor del campo total joyas en fc. de los valores parciales
function calcularJoyas() {
	document.formulario.R_G1_joyas.value = toDoubleComma(toDouble(document.formulario.R_G1_jCaja.value)) ;
	document.formulario.R_G1_joyas.value = toDoubleComma(toDouble(document.formulario.R_G1_jMueble.value) + toDouble(document.formulario.R_G1_joyas.value));
}
function deshabilitarDanosAgua()
{
	if (document.formulario.R_G1_continente.value == "0" || document.formulario.R_G1_continente.value == "")
	{
		document.formulario.R_G1_aguaEstetica.disabled = false;
	}
	else
	{
		document.formulario.R_G1_aguaEstetica.disabled = true;
	}
}
function deshabilitarRoturaCristales()
{
	if (document.formulario.R_G1_mobiliario.value == "0" || document.formulario.R_G1_mobiliario.value == "")
	{
		for (i=0;i<document.formulario.R_G1_roturaCristales.length;i++)
			document.formulario.R_G1_roturaCristales[i].disabled = false;
	}
	else
	{
		for (i=0;i<document.formulario.R_G1_roturaCristales.length;i++)
			document.formulario.R_G1_roturaCristales[i].disabled = true;
	}
	
}
//Función para controlar la aparici䮠de la garantde capital de muerte
function muestraCMuerte() {
	var valor;
	for(i=0;i<document.formulario.R_G1_acc.length;i++)
		if (document.formulario.R_G1_acc[i].checked)
			valor = document.formulario.R_G1_acc[i].value;
	if (valor == 'S')
	{
		document.formulario.R_G1_nPersonas.disabled = false;
		document.formulario.R_G1_cMuerte.disabled = false;
	} else {
		document.formulario.R_G1_nPersonas.disabled = true;
		document.formulario.R_G1_cMuerte.disabled = true;
		//Limpiamos
		document.formulario.R_G1_nPersonas.options[0].selected = true;
		document.formulario.R_G1_cMuerte.value = "";
	}
}
//Función para calcular el valor del campo continente en fc. de la calidad, superficie, y tipo de la vivienda
function calcularContinente() {
	document.formulario.R_G1_continente.value = Number(0);
	if ((document.formulario.R_C1_tipoViv.value=="VV") || (document.formulario.R_C1_tipoViv.value=="A")) {
		if (document.formulario.R_C1_calidad.value=="M")
			if (!isNaN(document.formulario.R_C1_superficie.value))
				document.formulario.R_G1_continente.value = Number(document.formulario.R_C1_superficie.value) * 660.00;
			
	}
	deshabilitarDanosAgua();
}

// Funcion para llamar al motor de busqueda y realizar la carga de los modelos de vehiculos para una marca.
// Se pasa como parametro el elemento del formulario sobre el que se genera el evento onChange().
// Revisada. 04/12/2003.
//
function cargaModelosAutos(objeto){
	// La consulta debe llevar el parametro cod_marca que tiene que ser un alfanumerico de 3 posiciones
	// y un segundo parametro que es el codigo de modelo de vehiculo, que puede ir vacio.
	cod_marca = "";
	for (i=0; i<objeto.options.length; i++) {
		if (objeto.options[i].selected) {
			if (objeto.options[i].value == "*") {
				objeto.focus();
				return;
			} else {
				cod_marca = objeto.options[i].value;
			}
		}
	}
	// Se deshabilita el combo donde se van a cargar los resultados
	document.formulario.modVeh.disabled = true;
	// Si se cambia la seleccion del combo de marcas hay que limpiar el de los modelos
	longitudCombo = document.formulario.modVeh.options.length - 1;

	for (i=longitudCombo; i>0; i--) {
		document.formulario.modVeh.options[i] = null;
	}

	// Se indica la jsp de busqueda y el iFrame donde se va a ejecutar
	varGET = "getDatosModelosAutos.jsp?cod_marca=" + cod_marca + "&consulta=N";
	varTarget = "iModelosAutos";
	
	document.formulario.target = varTarget;
	document.formulario.action = varGET;
	document.formulario.submit();	
}

// Esta Función es llamada desde el combo de seleccionar modelo. El value de cada uno de los options
// tiene concatenado una serie de valores separados por '|'. Se recogen esos valores y se guardan en
// los campos hidden.
// Revisada. 04/12/2003.
//
function cargaCaractModelo(objeto){
	var valores = objeto.value;
	valores = valores.substring((valores.indexOf("|")+1), valores.length);
	var categoria = valores.substring(0, valores.indexOf("|"));
	valores = valores.substring((valores.indexOf("|")+1), valores.length);
	var valorVehiculo = valores.substring(0, valores.indexOf("|"));
	valores = valores.substring((valores.indexOf("|")+1), valores.length);
	var numeroPlazas = valores;
	document.formulario.R_C1_catVeh.value = categoria;
	document.formulario.R_C1_valVeh.value = valorVehiculo;
	document.formulario.R_C1_numPlazas.value = numeroPlazas;
	document.formulario.R_C1_modVeh.value = valores;
}
function buscaLocalidades(cProv, objeto, persona, numPersona, numDomicilio) 
{			

	if (typeof numDomicilio == "undefined") 
		numDomicilio="1";
	if (typeof numPersona == "undefined") 
		numPersona="1";
	
	if (objeto.disabled==true)
		return false;

	if (cProv=="" || objeto.value.length < 4 )	
		alert("Debe facilitarnos el codigo de provincia y un literal a buscar (minimo cuatro caracteres)");	
	else      
	{		
		window.open("buscaLocalidades_2.jsp?cProv="+cProv+"&lite="+objeto.value+"&numPersona="+numPersona+"&numDomicilio="+numDomicilio+"&persona=" + persona , "", "width=450px,height=400px,top=20px,left=20px,resizable=yes,scrollbars=yes,status=no");
	}
}
//Funci䮠para obtener la provincia correspondiente a un codigo postal
function getProvincia(objeto,tipo) {
	codprov = eval(objeto).value.substring(0,2);
	
	var ctrlProv;
	var ctrlLoc;	
	var accion;
	
	if (tipo == "TP"){ //TomadorPostal
		ctrlProv = document.formulario.R_T1_D1_prov
		ctrlLoc  = document.formulario.R_T1_D1_loc
		accion   = "getProvincia.jsp?param=" + codprov + "&xsl=provinciaTP.xsl";
	} else if (tipo == "TF"){ //TomadorFiscal	
		ctrlProv = document.formulario.R_T1_D2_prov
		ctrlLoc  = document.formulario.R_T1_D2_loc
		accion   = "getProvincia.jsp?param=" + codprov + "&xsl=provinciaTF.xsl";	
	} else if (tipo == "AP"){ //AseguradoPostal			
		ctrlProv = document.formulario.R_A1_D1_prov
		ctrlLoc  = document.formulario.R_A1_D1_loc
		accion   = "getProvincia.jsp?param=" + codprov + "&xsl=provinciaAP.xsl";
	} else if (tipo == "BP"){ //BeneficiarioPostal
		ctrlProv = document.formulario.R_Bf1_D1_prov
		ctrlLoc  = document.formulario.R_Bf1_D1_loc
		accion   = "getProvincia.jsp?param=" + codprov + "&xsl=provinciaBP.xsl";
	} else if (tipo == "R"){ //Riesgo
		ctrlProv = document.formulario.R_C1_prov
		ctrlLoc  = document.formulario.R_C1_loc
		accion   = "getProvincia.jsp?param=" + codprov + "&xsl=provinciaR.xsl";
	} else {					
		ctrlProv = document.formulario.R_S1_D1_prov
		ctrlLoc  = document.formulario.R_S1_D1_loc
		accion   = "getProvincia.jsp?param=" + codprov;
	}
	
	document.formulario.target="iProvincia";
	document.formulario.action= accion;
	document.formulario.submit();
	
	ctrlProv.value = "Cargando...";
	ctrlProv.disabled = true;
	ctrlLoc .value="";
	formulario.R_T1_D1_cProv.value = codprov;
	
	document.formulario.target="";
	document.formulario.action= "/" + raiz_web + "/SvlTarificadorWeb";
}      


function anadirReglada()	{
	var mostrada = false;
	for (i=2;i<6 && !mostrada;i++){
		var linea = document.getElementById('lineaArriba'+i).style.display;
		if (linea != 'block'){
			document.getElementById("lineaArriba"+i).style.display = 'block'; 
			document.getElementById("nivelEstudios"+i).style.display = 'block'; 
			document.getElementById("titulacion"+i).style.display = 'block'; 
			document.getElementById("estudios"+i).style.display = 'block'; 
			document.getElementById("cursos"+i).style.display = 'block'; 
			mostrada = true;
		}
	}
}

function anadirRegladaEN()	{
	var mostrada = false;
	for (i=2;i<6 && !mostrada;i++){
		var linea = eval('lineaArriba'+i).style.display;
		if (linea != 'block'){
			eval("lineaArriba"+i).style.display = 'block'; 
			eval("nivelEstudios"+i).style.display = 'block'; 
			// eval("titulacion"+i).style.display = 'block'; Eliminar esta funcion y dejar la anterior cuando se habilite el campo de los titulos de estudio. Cambiar el nombre de la funcion por al anterior en el jsp.
			eval("estudios"+i).style.display = 'block'; 
			eval("cursos"+i).style.display = 'block'; 
			eval("lineaAbajo"+i).style.display = 'block'; 
			eval("puntos"+i).style.display = 'block'; 
			mostrada = true;
		}
	}
}

function anadirCurso()	{
	var mostrada = false;
	for (j=2;j<6 && !mostrada;j++)	{
		var linea = document.getElementById('lineaCursoArriba'+j).style.display;
		if (linea != 'block')	{
			document.getElementById("lineaCursoArriba"+j).style.display = 'block'; 
			document.getElementById("descripcionCurso"+j).style.display = 'block'; 
			document.getElementById("centro"+j).style.display = 'block'; 
			mostrada = true;
		}
	}
}

function anadirExperiencia(){
	var mostrada = false;
	for (j=2;j<6 && !mostrada;j++)	{
		var linea = document.getElementById('lineaExperienciaArriba'+j).style.display;
		if (linea != 'block'){
			document.getElementById("lineaExperienciaArriba"+j).style.display = 'block'; 
			document.getElementById("lineaSector"+j).style.display = 'block'; 
			document.getElementById("lineaEmpresa"+j).style.display = 'block'; 
			document.getElementById("lineaPInicial"+j).style.display = 'block'; 
			document.getElementById("lineaRInicial"+j).style.display = 'block'; 
			document.getElementById("lineaPFinal"+j).style.display = 'block'; 
			document.getElementById("lineaRFinal"+j).style.display = 'block'; 
			mostrada = true;
		}
	}
}

function anadirIdioma()	{
	var mostrada = false;
	for (j=2;j<6 && !mostrada;j++)	{
		var linea = document.getElementById('lineaIdiomasArriba'+j).style.display;
		if (linea != 'block')	{
			document.getElementById("lineaIdiomasArriba"+j).style.display = 'block'; 
			document.getElementById("lineaIdioma"+j).style.display = 'block'; 
			document.getElementById("lineaNivel"+j).style.display = 'block'; 
			mostrada = true;
		}
	}
}

//-------------------------------------------------------------------------
//Funcion: vaciarCombo
//Descripción vaciamos el COMBO
//Parámetros: combo (el combo a vaciar)
//Retorno: 
//--------------------------------------------------------------------------- 
function vaciarCombo(Cbo, bDisabled) {
	if (typeof bDisabled == "undefined")
		bDisabled = true;

	if (document.layers) {	
		Cbo.length = 0;
		Cbo.options.length = 0;
	}
	else {
		Cbo.innerHTML = "";
	}

	Cbo.disabled = bDisabled;
}

//-------------------------------------------------------------------------
//Funcion: Tags de Realmedia
//Descripción Código de seguimiento de Realmedia
//-------------------------------------------------------------------------

var refr=escape(document.referrer); /* get the http referer and encode it */
var dom=location.hostname; /* get the host domain */
var stURL="http://eu.link.decdna.net/n/15298/22049/www.ocaso.es/7538695c0025030000000006000000000f09dddb0000000000000000000000000000000100/i/c?0&1pixgif&referer="
+ refr;
if ( (refr && refr.search(dom) == -1) && (location.href.toUpperCase().indexOf("247SEO=N") == -1) ) /* if the referrer is external preload the image request and does not contain 247SEO argument = "N" */
{
imageTR = new Image();
imageTR.src = stURL;
}

function insertaCambioIdioma(idioma){
	var elForm = document.createElement('form');
		elForm.setAttribute('name','cambioidioma');
	var elFieldset = document.createElement('fieldset');
	var elLabel = document.createElement('label');
		elLabel.setAttribute('for','selIdioma');
	var elSpan = document.createElement('span');
		elSpan.className='oculto';
		if(idioma){
			elSpan.appendChild(document.createTextNode('Select language'));
		}else{
			elSpan.appendChild(document.createTextNode('Seleccione idioma'));
		}
	var elSelect = document.createElement('select');
		elSelect.setAttribute('name','selIdioma');
		elSelect.setAttribute('id','selIdioma');
	var elOption01 = document.createElement('option');
	if(idioma){
		elOption01.appendChild(document.createTextNode('Change language...'));
	}else{
		elOption01.appendChild(document.createTextNode('Cambiar idioma...'));
	}
	elOption01.setAttribute('value','');
	var elOption02 = document.createElement('option');
	if(idioma){
		elOption02.appendChild(document.createTextNode('Spanish'));
	}else{
		elOption02.appendChild(document.createTextNode('español'));
	}
	elOption02.setAttribute('value','es');
	var elOption03 = document.createElement('option');
	if(idioma){
		elOption03.appendChild(document.createTextNode('English'));
	}else{
		elOption03.appendChild(document.createTextNode('inglés'));
	}
	elOption03.setAttribute('value','en');
		
		elSelect.appendChild(elOption01);
		elSelect.appendChild(elOption02);
		elSelect.appendChild(elOption03);
		
		elLabel.appendChild(elSpan);
		elLabel.appendChild(elSelect);
		
		elFieldset.appendChild(elLabel);
		elForm.appendChild(elFieldset);
		
		
		if(elSelect.addEventListener){
			elSelect.addEventListener('change',function funcion(){cambiarIdioma(this.value);},false);
		}
		else{
			elSelect.onchange=function funcion(){cambiarIdioma(this.value);};
		}
		document.getElementById('alojaidioma').appendChild(elForm);
}

function lanzaTarificador(laListaOrigen,nombreSelect,idioma){
var elSelect = document.createElement('select');
	elSelect.setAttribute('name',nombreSelect);
	elSelect.setAttribute('id',nombreSelect);
		var elOption01 = document.createElement('option');
			if(idioma){
				elOption01.appendChild(document.createTextNode('- Select an option -'));
			}else{
				elOption01.appendChild(document.createTextNode('- Seleccione una opción -'));
			}
		elOption01.setAttribute('value','');	
	elSelect.appendChild(elOption01);
		
	for(i=0;i<document.getElementById(laListaOrigen).getElementsByTagName('li').length;i++){
		var elOption02 = document.createElement('option');
			elOption02.appendChild(document.createTextNode(document.getElementById(laListaOrigen).getElementsByTagName('a')[i].innerHTML));
			elOption02.setAttribute('value',document.getElementById(laListaOrigen).getElementsByTagName('a')[i].getAttribute('href'));
		elSelect.appendChild(elOption02);
	}	
	if(elSelect.addEventListener){
		elSelect.addEventListener('change',function funcion(){irA(this);},false);
	}
	else{
		elSelect.onchange=function funcion(){irA(this);};
	}
	document.getElementById('alojaselect').appendChild(elSelect);
	document.getElementById(laListaOrigen).style.display='none';
}

function muestrafoto(surl){
		var objAjax = false;
		// Si es IE
		if (window.ActiveXObject){
		try {
			objAjax = new ActiveXObject('Msxml2.XMLHTTP.5.0');
		}
		// en caso que sea una versión antigua
		catch (e){
		try{
			objAjax = new ActiveXObject('Microsoft.XMLHTTP');
		}
			catch (e){return false;}
		}
		// Si es Mozilla, Safari, IE7 etc
		}else if (window.XMLHttpRequest) {
			objAjax = new XMLHttpRequest();
		} else{return false;}
			// función de respuesta
			objAjax.onreadystatechange=function(){
			cargaContenido(objAjax);
		}
		// asignamos los métodos open y send
		objAjax.open('GET', surl, true);
		objAjax.send(null);	
}

function cargaContenido(objAjax){
  var miObjCont = null;
	if (objAjax.readyState==1) {
		document.getElementById('cargando').style.display='block';
     }
  if (objAjax.readyState == 4 && (objAjax.status==200 || window.location.href.indexOf('http')==-1)){
	document.getElementById('cargando').style.display='none';
	document.getElementById('muestrafoto').innerHTML = objAjax.responseText;
  }
}