	
// FUNCIONES COMUNES A TODO EL SITE
function entornoSeguro(url)
{
	var burl=url;
	var new_url = "";
	var servidor = document.location.href;
	var cpos = servidor.lastIndexOf("/");
	servidor = servidor.substring(0,cpos);

	if (servidor.indexOf("/verFichaProducto.do") != -1)
	{
		var cpos = servidor.lastIndexOf("/verFichaProducto.do");
		servidor = servidor.substring(0,cpos);
	}
	
	servidor = servidor.replace("http://","https://");
	new_url = servidor+"/"+burl;

	//document.location.href = new_url;
	window.location = new_url;
	return;
}
function entornoNoSeguro(url)
{
	var burl=url;
	var new_url = "";
	//alert(url);
	var servidor = document.location.href;
	//alert(servidor);
	var cpos = servidor.lastIndexOf("/");
	//alert(cpos);
	servidor = servidor.substring(0,cpos);
	
	if (servidor.indexOf("/verFichaProducto.do") != -1)
	{
		var cpos = servidor.lastIndexOf("/verFichaProducto.do");
		servidor = servidor.substring(0,cpos);
	}
	servidor = servidor.replace("https://","http://");
	new_url = servidor+"/"+burl;
	//alert(new_url);
	//document.location.href ="";
	//document.location.href = new_url;
	window.location = new_url;
	return;
		
		
	/*var burl=url;
	var new_url = "";
	//alert(url);
	var servidor = document.location.href;
	var cposS = servidor.indexOf("/multicentroExterno");

	//alert("Posicion: "+cposS);	
	//alert ("11: "+servidor.substring(0, cposS));
	//alert ("22: "+servidor.substring(cposS, servidor.length));

	var servidor2 = servidor.substring(0, cposS)+":80";
	servidor2 = servidor2+servidor.substring(cposS, servidor.length);
	//alert("SERVIDOR 2: "+servidor2);
	//alert(servidor);
	var cpos = servidor2.lastIndexOf("/");
	//alert(cpos);
	servidor = servidor2.substring(0,cpos);
	
	if (servidor2.indexOf("/verFichaProducto.do") != -1)
	{
		var cpos = servidor2.lastIndexOf("/verFichaProducto.do");
		servidor2 = servidor2.substring(0,cpos);
	}
	servidor2 = servidor2.replace("https://","http://");
	new_url = servidor2+"/"+burl;
	alert(new_url);
	document.location.href = "http//www.mapfre.com/multicentroExterno/es/multicentro/comprar.htm";
	document.location.href = new_url;
	return;*/
	
}


function entornoSeguro1()
{
	var url="peticion.do?tipo=gen";
	entornoSeguro(url);
}

function entornoSeguro2()
{
	var url="../peticion.do?tipo=gen";
	entornoSeguro(url);
}

function entornoSeguroFicha(url)
{
	//top.location.href="javascript:entornoSeguro('/multicentroExterno/es/multicentro/peticion.do?+param;
	var servidor = top.location.href;
	//alert(servidor);
	var cpos = servidor.lastIndexOf("/multicentroExterno");
	//alert("cpos1: "+cpos);
	if (cpos == -1)
	{
		cpos = servidor.lastIndexOf("/wmulticentro")
	}
	//alert("cpos2: "+cpos);
	servidor = servidor.substring(0,cpos);
	//alert(servidor)
	servidor = servidor.replace("http://","https://");
	new_url = servidor+url;
	//alert(new_url);
	top.location.href = new_url;
	return;
}


function verSite()
{
	var urlsite = document.forms['otrosSites'].sitesmapfre.value;
	if (urlsite!="")
	{
		eval("window.open('http://www."+urlsite+".com')");
	}
}

function abrirVentana(url,sizeH,sizeV,name)
{
	eval("window.open('"+url+"', '"+name+"', 'toolbar=no, directories=no, location=no, status=no, menubar=no, resizable=no, scrollbars=no, width="+sizeH+", height="+sizeV+"')");
}

function abrirVentanaResizableScroll(url,sizeH,sizeV,name)
{
	eval("window.open('"+url+"', '"+name+"', 'toolbar=no, directories=no, location=no, status=no, menubar=no, resizable=yes, scrollbars=yes, width="+sizeH+", height="+sizeV+"')");
}

function abrirVentanaScroll(url,sizeH,sizeV,name)
{
	eval("window.open('"+url+"', '"+name+"', 'toolbar=no, directories=no, location=no, status=no, menubar=no, resizable=no, scrollbars=yes, width="+sizeH+", height="+sizeV+"')");
}

function abrirNavegador(url)
{
	window.open(url);
}

var activoTH = "";
function ordenarImg(nombre,num)
{
alert("ordenarImg...");
	if (activoTH!="") 
	{
	alert("dentro del if: "+nombre+" "+activoTH);
		eval("document.getElementById('"+activoTH+"').src = 'img/"+activoTH+".gif'");
	}
	alert("fuera del if: "+nombre+ " "+num);
	//eval("document.getElementById('"+nombre+"').src = 'img/"+nombre+"_"+num+".gif'");
	eval("document.getElementById('"+nombre+"').src = 'img/thSegmento_1.gif'");
	alert("  "+document.getElementById('thSegmento').src);
	activoTH = nombre;
}


