function calendario1(campo_destino,ano_inicio,ano_fin,limite_inferior,limite_superior,idioma){	var midX=((screen.availWidth/2)-(90))-5; 
	if (midX <= 0) {
		midX=0;	
	}
	var midY=((screen.availHeight/2)-(100))-15;
	if(midY <= 0) {
		midY=0;
	}	if (idioma == "E") {		idioma = "ESP";	} else if (idioma == "FR") {		idioma = "FRA";	} else if (idioma == "IT") {		idioma = "ITA";	} else if (idioma == "PO") {		idioma = "POR";	} 	strDestino = calcularJuntion()+urlServlet+"?destino="+campo_destino+"&accion=CAL&idioma="+idioma;

	if(ano_inicio) {
		strDestino+="&ano_inicio="+ano_inicio;
	}
	if(ano_fin) {
		strDestino+="&ano_fin="+ano_fin;
	}
	if(limite_inferior) {
		strDestino+="&limite_inferior="+limite_inferior;
	}
	if(limite_superior) {
		strDestino+="&limite_superior="+limite_superior;
	}
	//cerrarUtilidad();
	utilidad=window.open(strDestino,'vPopCal','top='+midY+', left='+midX+', width='+200+', height='+200+', resizable=true,')
	
}
function calcularJuntion() {// *** Anlizamos la junction para poder utilizar la redirección Mod_Rewrite	var pos_fin = document.location.href.indexOf("/hoteles-");		if (pos_fin == -1)			var pos_fin = document.location.href.indexOf("/apartamentos-");		if (pos_fin == -1)			var pos_fin = document.location.href.indexOf("/vacaciones-");			if (pos_fin == -1)		var pos_fin = document.location.href.indexOf("/mapaweb/servlet");			var dominio_juntion = document.location.href.substr(0, pos_fin);	var pos_ini = dominio_juntion.lastIndexOf("/");	var juntion = dominio_juntion.substring(pos_ini, pos_fin);	return juntion;}
function cal_desde(campoDesde,campoHasta,idioma){
	campoDesde.value = "";	if ( (idioma == "ESP") || (idioma == "CHI") || (idioma == "ARG") || (idioma == "MEX") ) {		idioma = "E";	} else if ( (idioma == "FRA") || (idioma == "BEL") ) {		idioma = "FR";	} else if (idioma == "ITA") {		idioma = "IT";	} else if (idioma == "POR") {		idioma = "PO";	}
	calendario1(campoDesde.name,campoDesde.value.substring(6,10),null,null,365,idioma);
	
}
	
function cal_hasta(campoDesde,campoHasta,idioma){
	//var smensaje = oHoteles.selectSingleNode("//BLOQUE/TEXTO[@COD='CAL01']/@DES").text;	if ( (idioma == "ESP") || (idioma == "CHI") || (idioma == "ARG") || (idioma == "MEX") ) {		idioma = "E";	} else if ( (idioma == "FRA") || (idioma == "BEL") ) {		idioma = "FR";	} else if (idioma == "ITA") {		idioma = "IT";	} else if (idioma == "POR") {		idioma = "PO";	}
	var limiteInferior = "";
	if (campoDesde != null && campoDesde.value != "") {
		limiteInferior = campoHasta.value;
	}
	
	calendario1(campoHasta.name,campoDesde.value.substring(6,10),null,limiteInferior,3600,idioma);
	
}

function cerrarUtilidad(){
	try{
		utilidad.close();
	}catch(e){}	
}
