// JavaScript Document

// === INI - scripts/common.js ===
var isInternetExplorer = (navigator.appName.indexOf("Microsoft") != -1);

/*
future references:
var keycode = isInternetExplorer ? event.keyCode : event.which;
*/

function countSpaces(obj){
	var iLength = obj.value.length;
	var strSpaces = obj.value.match(new RegExp("( )", "g"));
	var countSpaces = strSpaces ? strSpaces.length : 0;
	return countSpaces;
}

function countLineBreaks(obj){
	var iLength = obj.value.length;
	var strLineBreaks = obj.value.match(new RegExp("(\\n)", "g"));
	var countLineBreaks = strLineBreaks ? strLineBreaks.length : 0;
	return countLineBreaks;
}

function textCounter(field, counter_field, maxlimit) {
	var lineBreaks = countLineBreaks(field);
	var adjust = isInternetExplorer ? 1 : 0;
	if (field.value.length - lineBreaks * adjust > maxlimit){
		field.value = field.value.substring(0, maxlimit + lineBreaks * adjust);
		field.focus();
	} else {
		counter_field.value = maxlimit - field.value.length + lineBreaks * adjust;
	}
}

function backToSection(backToURL, forceBackToURL){
	if(forceBackToURL == null) forceBackToURL = false;
	if(history.length > 1 && !forceBackToURL) history.back(); else window.location.href = backToURL;
}

function hideStatus(){
	window.defaultStatus='';
	window.status='';
	return true;
}

function searchReset() {
	tot = document.search_form.elements.length;
	for(i=0;i<tot;i++) {
		if (document.search_form.elements[i].type == 'text') {
			document.search_form.elements[i].value = "";
		} else if (document.search_form.elements[i].type == 'checkbox' || document.search_form.elements[i].type == 'radio') {
			document.search_form.elements[i].checked = false;
		} else if (document.search_form.elements[i].type == 'select-one') {
			document.search_form.elements[i].selectedIndex = 0;
		}
	}
}
// === FIN - scripts/common.js ===

// === INI - scripts/location.js ===
var obj;

function fillSelect(host, obj, fk_value, form){

   this.obj = obj;

   resetSelect(obj);

   // check if object exisits.
   if(typeof obj != 'object') return false;

   if (obj.name == "state_id") {
      resetSelect(form.region_id);
      url = host + '/location.php?country_id=' + fk_value + '&state_id=&region_id=';
      if (fk_value > 0) loadResult(url, '');
   }

   if (obj.name == "region_id") {
      url = host + '/location.php?country_id=&state_id=' + fk_value + '&region_id=';
      if (fk_value > 0) loadResult(url, '');
   }
}

function fillSelect_rm(host, obj, fk_value, form){
   this.obj = obj;

   //resetSelect(obj);

   // check if object exisits.
   if(typeof obj != 'object') return false;

   if (obj.name == "state_id") {
      resetSelect(document.getElementById("hoteles_state_id"));
      resetSelect(document.getElementById("autobuses_state_id"));

      resetSelect(document.getElementById("hoteles_region_id"));
      resetSelect(document.getElementById("autobuses_region_id"));

      //resetSelect(form.region_id);
      url = host + '/location.php?country_id=' + fk_value;
      if (fk_value > 0) loadResult(url, '');
   }

   if (obj.name == "region_id") {
      resetSelect(document.getElementById("hoteles_region_id"));
      resetSelect(document.getElementById("autobuses_region_id"));

      url = host + '/location.php?state_id=' + fk_value;
      if (fk_value > 0) loadResult(url, '');
   }
}

function fillSelect_rm2(host, obj, fk_value, form, id_obj_destino){

   this.obj = obj;

   resetSelect(obj);

   // check if object exisits.
   if(typeof obj != 'object') return false;

   if (obj.name == "state_id") {
      resetSelect(form.region_id);
      url = host + '/location.php?country_id=' + fk_value + '&state_id=&region_id=&obj=' + id_obj_destino ;
      if (fk_value > 0) loadResult(url, '');
   }

   if (obj.name == "region_id") {
      url = host + '/location.php?country_id=&state_id=' + fk_value + '&region_id=&obj=' + id_obj_destino ;
      if (fk_value > 0) loadResult(url, '');
   }
}

function fillSelectSearchPage(host, obj, fk_value, form){

   this.obj = obj;

   resetSelect(obj);

   // check if object exisits.
   if(typeof obj != 'object') return false;

   if (obj.name == "search_state") {
      resetSelect(form.search_region);
      url = host + '/location.php?country_id=' + fk_value + '&searchpage=1';
      if (fk_value > 0) loadResult(url, '');
   }

   if (obj.name == "search_region") {
      url = host + '/location.php?state_id=' + fk_value + '&searchpage=1';
      if (fk_value > 0) loadResult(url, '');
   }

}

function resetSelect(obj){
   while (obj.options.length>=1) {
      deleteIndex=obj.options.length-1;
      obj.options[deleteIndex]=null;
   }
}

function loadXMLDoc(url) {
   // branch for native XMLHttpRequest object
   if (window.XMLHttpRequest) {
      req = new XMLHttpRequest();
      req.onreadystatechange = processReqChange;
      req.open("GET", url, true);
      req.send(null);
   // branch for IE/Windows ActiveX version
   } else if (window.ActiveXObject) {
      req = new ActiveXObject("Microsoft.XMLHTTP");
      if (req) {
         req.onreadystatechange = processReqChange;
         req.open("GET", url, true);
         req.send();
      }
   }
}

function processReqChange() {
   // only if req shows "complete"
   if (req.readyState == 4) {
      // only if "OK"
      if (req.status == 200) {
         // ...processing statements go here
         response  = req.responseXML.documentElement;
         if(response) {
            var result = new Array();
            for(i=0; i < response.getElementsByTagName('id').length; i++){
               result[i] = {'id': response.getElementsByTagName('id')[i].firstChild.data, 'name': response.getElementsByTagName('name')[i].firstChild.data, 'obj_name': response.getElementsByTagName('obj_name')[i].firstChild.data };
            }
            loadResult('',result);
         }
      } else {
         alert("There was a problem retrieving the XML data:\n" + req.statusText);
      }
   }
}

function loadResult(url, result){
   if (result != ''){
      // Response mode
      for(i=0; i < result.length; i++){
         document.getElementById(result[i].obj_name).options[document.getElementById(result[i].obj_name).options.length]  = new Option(result[i].name,result[i].id);
      }
   } else if(url != '') {
      // Input mode
      return (loadXMLDoc(url));
   }
   copiar_localizacion();
}

function copiar_localizacion(){
 //Detectar la pestaña seleccionada para copiar la localizacion seleccionada al resto de las pestañas
 if(document.getElementById('tabs_form_busqueda')){
   switch($("#tabs_form_busqueda").tabs('option', 'selected')){
      case 1:
        //Copiar select de aerolineas al resto de los selects
         document.search_form_hoteles.country_id.selectedIndex = document.search_form_aerolineas.country_id.selectedIndex;
         document.search_form_autobuses.country_id.selectedIndex = document.search_form_aerolineas.country_id.selectedIndex;
         document.search_form_autos.country_id.selectedIndex = document.search_form_aerolineas.country_id.selectedIndex;
         document.search_form_viajes_tours.country_id.selectedIndex = document.search_form_aerolineas.country_id.selectedIndex;
         document.search_form_actividades.country_id.selectedIndex = document.search_form_aerolineas.country_id.selectedIndex;
         if(document.search_form_aerolineas.country_id[1]){
            document.search_form_hoteles.country_id[1].selectedIndex = document.search_form_aerolineas.country_id[1].selectedIndex;
            document.search_form_autobuses.country_id[1].selectedIndex = document.search_form_aerolineas.country_id[1].selectedIndex;
            document.search_form_autos.country_id[1].selectedIndex = document.search_form_aerolineas.country_id[1].selectedIndex;
            document.search_form_viajes_tours.country_id[1].selectedIndex = document.search_form_aerolineas.country_id[1].selectedIndex;
            document.search_form_actividades.country_id[1].selectedIndex = document.search_form_aerolineas.country_id[1].selectedIndex;
         }
         copiar_select("aerolineas_state_id"  ,"hoteles_state_id");
         copiar_select("aerolineas_state_id"  ,"autobuses_state_id");
         copiar_select("aerolineas_state_id"  ,"autos_state_id");
         copiar_select("aerolineas_state_id"  ,"viajes_tours_state_id");
         copiar_select("aerolineas_state_id"  ,"actividades_state_id");
         copiar_select("aerolineas_region_id" ,"hoteles_region_id");
         copiar_select("aerolineas_region_id" ,"autobuses_region_id");
         copiar_select("aerolineas_region_id" ,"autos_region_id");
         copiar_select("aerolineas_region_id" ,"viajes_tours_region_id");
         copiar_select("aerolineas_region_id" ,"actividades_region_id");
         break;
      case 2:
        //Copiar select de autobuses al resto de los selects
        document.search_form_hoteles.country_id.selectedIndex = document.search_form_autobuses.country_id.selectedIndex;
        document.search_form_aerolineas.country_id.selectedIndex = document.search_form_autobuses.country_id.selectedIndex;
        document.search_form_autos.country_id.selectedIndex = document.search_form_autobuses.country_id.selectedIndex;
        document.search_form_viajes_tours.country_id.selectedIndex = document.search_form_autobuses.country_id.selectedIndex;
        document.search_form_actividades.country_id.selectedIndex = document.search_form_autobuses.country_id.selectedIndex;
        if(document.search_form_autobuses.country_id[1]){
           document.search_form_hoteles.country_id[1].selectedIndex = document.search_form_autobuses.country_id[1].selectedIndex;
           document.search_form_aerolineas.country_id[1].selectedIndex = document.search_form_autobuses.country_id[1].selectedIndex;
           document.search_form_autos.country_id[1].selectedIndex = document.search_form_autobuses.country_id[1].selectedIndex;
           document.search_form_viajes_tours.country_id[1].selectedIndex = document.search_form_autobuses.country_id[1].selectedIndex;
           document.search_form_actividades.country_id[1].selectedIndex = document.search_form_autobuses.country_id[1].selectedIndex;
        }
        copiar_select("autobuses_state_id"  ,"hoteles_state_id");
        copiar_select("autobuses_state_id"  ,"aerolineas_state_id");
        copiar_select("autobuses_state_id"  ,"autos_state_id");
        copiar_select("autobuses_state_id"  ,"viajes_tours_state_id");
        copiar_select("autobuses_state_id"  ,"actividades_state_id");
        copiar_select("autobuses_region_id" ,"aerolineas_region_id");
        copiar_select("autobuses_region_id" ,"hoteles_region_id");
        copiar_select("autobuses_region_id" ,"autos_region_id");
        copiar_select("autobuses_region_id" ,"viajes_tours_region_id");
        copiar_select("autobuses_region_id" ,"actividades_region_id");
        break;
      case 3:
        //Copiar select de autos al resto de los selects
        document.search_form_hoteles.country_id.selectedIndex = document.search_form_autos.country_id.selectedIndex;
        document.search_form_aerolineas.country_id.selectedIndex = document.search_form_autos.country_id.selectedIndex;
        document.search_form_autobuses.country_id.selectedIndex = document.search_form_autos.country_id.selectedIndex;
        document.search_form_viajes_tours.country_id.selectedIndex = document.search_form_autos.country_id.selectedIndex;
        document.search_form_actividades.country_id.selectedIndex = document.search_form_autos.country_id.selectedIndex;
        if(document.search_form_autos.country_id[1]){
           document.search_form_hoteles.country_id[1].selectedIndex = document.search_form_autos.country_id[1].selectedIndex;
           document.search_form_aerolineas.country_id[1].selectedIndex = document.search_form_autos.country_id[1].selectedIndex;
           document.search_form_autobuses.country_id[1].selectedIndex = document.search_form_autos.country_id[1].selectedIndex;
           document.search_form_viajes_tours.country_id[1].selectedIndex = document.search_form_autos.country_id[1].selectedIndex;
           document.search_form_actividades.country_id[1].selectedIndex = document.search_form_autos.country_id[1].selectedIndex;
        }
        copiar_select("autos_state_id"  ,"hoteles_state_id");
        copiar_select("autos_state_id"  ,"aerolineas_state_id");
        copiar_select("autos_state_id"  ,"autobuses_state_id");
        copiar_select("autos_state_id"  ,"viajes_tours_state_id");
        copiar_select("autos_state_id"  ,"actividades_state_id");
        copiar_select("autos_region_id" ,"hoteles_region_id");
        copiar_select("autos_region_id" ,"aerolineas_region_id");
        copiar_select("autos_region_id" ,"autobuses_region_id");
        copiar_select("autos_region_id" ,"viajes_tours_region_id");
        copiar_select("autos_region_id" ,"actividades_region_id");
        break;
      case 4:
         //Copiar select de viajes y tours al resto de los selects
        document.search_form_hoteles.country_id.selectedIndex = document.search_form_viajes_tours.country_id.selectedIndex;
        document.search_form_aerolineas.country_id.selectedIndex = document.search_form_viajes_tours.country_id.selectedIndex;
        document.search_form_autobuses.country_id.selectedIndex = document.search_form_viajes_tours.country_id.selectedIndex;
        document.search_form_autos.country_id.selectedIndex = document.search_form_viajes_tours.country_id.selectedIndex;
        document.search_form_actividades.country_id.selectedIndex = document.search_form_viajes_tours.country_id.selectedIndex;
        if(document.search_form_viajes_tours.country_id[1]){
           document.search_form_hoteles.country_id[1].selectedIndex = document.search_form_viajes_tours.country_id[1].selectedIndex;
           document.search_form_aerolineas.country_id[1].selectedIndex = document.search_form_viajes_tours.country_id[1].selectedIndex;
           document.search_form_autobuses.country_id[1].selectedIndex = document.search_form_viajes_tours.country_id[1].selectedIndex;
           document.search_form_autos.country_id[1].selectedIndex = document.search_form_viajes_tours.country_id[1].selectedIndex;
           document.search_form_actividades.country_id[1].selectedIndex = document.search_form_viajes_tours.country_id[1].selectedIndex;
        }
        copiar_select("viajes_tours_state_id"  ,"hoteles_state_id");
        copiar_select("viajes_tours_state_id"  ,"aerolineas_state_id");
        copiar_select("viajes_tours_state_id"  ,"autobuses_state_id");
        copiar_select("viajes_tours_state_id"  ,"autos_state_id");
        copiar_select("viajes_tours_state_id"  ,"actividades_state_id");
        copiar_select("viajes_tours_region_id" ,"hoteles_region_id");
        copiar_select("viajes_tours_region_id" ,"aerolineas_region_id");
        copiar_select("viajes_tours_region_id" ,"autobuses_region_id");
        copiar_select("viajes_tours_region_id" ,"autos_region_id");
        copiar_select("viajes_tours_region_id" ,"actividades_region_id");
        break;
      case 5:
         //Copiar select de actividades al resto de los selects
        document.search_form_hoteles.country_id.selectedIndex = document.search_form_actividades.country_id.selectedIndex;
        document.search_form_aerolineas.country_id.selectedIndex = document.search_form_actividades.country_id.selectedIndex;
        document.search_form_autobuses.country_id.selectedIndex = document.search_form_actividades.country_id.selectedIndex;
        document.search_form_autos.country_id.selectedIndex = document.search_form_actividades.country_id.selectedIndex;
        document.search_form_viajes_tours.country_id.selectedIndex = document.search_form_actividades.country_id.selectedIndex;
        if(document.search_form_actividades.country_id[1]){
           document.search_form_hoteles.country_id[1].selectedIndex = document.search_form_actividades.country_id[1].selectedIndex;
           document.search_form_aerolineas.country_id[1].selectedIndex = document.search_form_actividades.country_id[1].selectedIndex;
           document.search_form_autobuses.country_id[1].selectedIndex = document.search_form_actividades.country_id[1].selectedIndex;
           document.search_form_autos.country_id[1].selectedIndex = document.search_form_actividades.country_id[1].selectedIndex;
           document.search_form_viajes_tours.country_id[1].selectedIndex = document.search_form_actividades.country_id[1].selectedIndex;
        }
        copiar_select("actividades_state_id"  ,"hoteles_state_id");
        copiar_select("actividades_state_id"  ,"aerolineas_state_id");
        copiar_select("actividades_state_id"  ,"autobuses_state_id");
        copiar_select("actividades_state_id"  ,"autos_state_id");
        copiar_select("actividades_state_id"  ,"viajes_tours_state_id");
        copiar_select("actividades_region_id" ,"hoteles_region_id");
        copiar_select("actividades_region_id" ,"aerolineas_region_id");
        copiar_select("actividades_region_id" ,"autobuses_region_id");
        copiar_select("actividades_region_id" ,"autos_region_id");
        copiar_select("actividades_region_id" ,"viajes_tours_region_id");
        break;
      default:
         //Copiar select de hoteles al resto de los selects
         document.search_form_aerolineas.country_id.selectedIndex = document.search_form_hoteles.country_id.selectedIndex;
         document.search_form_autobuses.country_id.selectedIndex = document.search_form_hoteles.country_id.selectedIndex;
         document.search_form_autos.country_id.selectedIndex = document.search_form_hoteles.country_id.selectedIndex;
         document.search_form_viajes_tours.country_id.selectedIndex = document.search_form_hoteles.country_id.selectedIndex;
         document.search_form_actividades.country_id.selectedIndex = document.search_form_hoteles.country_id.selectedIndex;
         if(document.search_form_hoteles.country_id[1]){
            document.search_form_aerolineas.country_id[1].selectedIndex = document.search_form_hoteles.country_id[1].selectedIndex;
            document.search_form_autobuses.country_id[1].selectedIndex = document.search_form_hoteles.country_id[1].selectedIndex;
            document.search_form_autos.country_id[1].selectedIndex = document.search_form_hoteles.country_id[1].selectedIndex;
            document.search_form_viajes_tours.country_id[1].selectedIndex = document.search_form_hoteles.country_id[1].selectedIndex;
            document.search_form_actividades.country_id[1].selectedIndex = document.search_form_hoteles.country_id[1].selectedIndex;
         }
         copiar_select("hoteles_state_id"  ,"aerolineas_state_id");
         copiar_select("hoteles_state_id"  ,"autobuses_state_id");
         copiar_select("hoteles_state_id"  ,"autos_state_id");
         copiar_select("hoteles_state_id"  ,"viajes_tours_state_id");
         copiar_select("hoteles_state_id"  ,"actividades_state_id");
         copiar_select("hoteles_region_id" ,"aerolineas_region_id");
         copiar_select("hoteles_region_id" ,"autobuses_region_id");
         copiar_select("hoteles_region_id" ,"autos_region_id");
         copiar_select("hoteles_region_id" ,"viajes_tours_region_id");
         copiar_select("hoteles_region_id" ,"actividades_region_id");
         break;
   }
 }
 return;
}
function copiar_select(id_origen,id_destino1){
   //Checar si existe el select para el pais en el idioma inglés
   var origen = document.getElementById(id_origen);
   var destino1 = document.getElementById(id_destino1);

   resetSelect(destino1);
   for(i=0; i < origen.options.length; i++){
      destino1.options[i]  = new Option(origen.options[i].text,origen.options[i].value);
   }

   //Copiar las opciones seleccionadas
   destino1.selectedIndex = origen.selectedIndex;
}
// === FIN - scripts/location.js ===

// === INI - menusearch.js ===
function moveUpDown(status,obj) {
if (status =="SHOW")
	{ document.getElementById(obj).className="isShown";	}
if (status =="HIDE")
	{ document.getElementById(obj).className="isHidden"; }
}

function moveDownAll(){
	for(i=1; i<=4; i++){
	var str;
	str="tab"+i;
	if (document.getElementById(str)) document.getElementById(str).className="isHidden";
	}
}

function hideTabs(){
	var str;
	for (i=1; i<5;i++){
	str = "li-" + i;
	if (document.getElementById(str)) document.getElementById(str).className="tab-inactive";
	}
}

function tabToActive(obj){
	hideTabs();
	document.getElementById(obj).className="tab-active";
}
// === FIN - menusearch.js ===

// === INI - contactclick.js ===
function showPhone(listingid) {
	try {
		xmlhttp = new XMLHttpRequest();
	} catch (exc) {
		try {
			xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (ex) {
			try {
				xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {
				xmlhttp = false;
			}
		}
	}
	if (xmlhttp) {
		xmlhttp.open("GET", './countphoneclick.php?listing_id='+listingid, true);
		xmlhttp.send(null);
	}
	document.getElementById("phoneLink"+listingid).className = "controlPhoneHide";
	document.getElementById("phoneNumber"+listingid).className = "controlPhoneShow";
}

function showFax(listingid) {
	try {
		xmlhttp = new XMLHttpRequest();
	} catch (exc) {
		try {
			xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (ex) {
			try {
				xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {
				xmlhttp = false;
			}
		}
	}
	if (xmlhttp) {
		xmlhttp.open("GET", './countfaxclick.php?listing_id='+listingid, true);
		xmlhttp.send(null);
	}
	document.getElementById("faxLink"+listingid).className = "controlFaxHide";
	document.getElementById("faxNumber"+listingid).className = "controlFaxShow";
}
// === FIN - contactclick.js ===

// === INI - cookies.js ===
<!--
// BEGIN --- Cookie's functions Quick List ---

function readCookie(name) {
	var eq = name + "=";
	var ca = document.cookie.split(';');
	if (!ca.length) return null;
	for (var i=0;i<ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(eq) == 0) return unescape(c.substring(eq.length,c.length));
	}
	return null;
}

function includeInCookie(property_id, edir_path) {
	var edir_path="/lcms";
	if (!isNaN(property_id)) {
		var name = "bookmark";
		var d = new Date();
		if (!edir_path) edir_path = "/";
		d.setTime(d.getTime() + (15*24*60*60*1000));
		var expires = '; expires=' + d.toGMTString();
		var bookmark = readCookie("bookmark");
		if (!bookmark) bookmark = "'" + property_id + "'";
		else {
			if (bookmark.indexOf("'" + property_id + "'") == -1) {
				bookmark = bookmark + "," + "'" + property_id + "'";
			}
		}
		document.cookie = name + '=' + escape(bookmark) + expires + '; path=' + edir_path;
		alert ("El hotel fue añadido a su lista de favoritos\n\nUsted puede ver su Lista de Favoritos haciendo clic en el link de 'Ver Lista de Favoritos'.");
	}
}

function removeFromCookie(property_id, edir_path) {
	var edir_path="/lcms";
	var name = "bookmark";
	var d = new Date();
	if (!edir_path) edir_path = "/";
	d.setTime(d.getTime() + (15*24*60*60*1000));
	var expires = '; expires=' + d.toGMTString();
	if (isNaN(property_id)) {
		if (property_id == "all") {
			var bookmark = "";
			document.cookie = name + '=' + escape(bookmark) + expires + '; path=' + edir_path;
		}
	} else {
		var bookmark = readCookie("bookmark");
		if (bookmark.length > 0) {
			if (bookmark.indexOf("'" + property_id + "'") > -1) {
				finalvar = bookmark.indexOf("'" + property_id + "'") + property_id.length + 3;
				var aux = "";
				aux = bookmark.substr(0, bookmark.indexOf("'" + property_id + "'"));
				aux += bookmark.substr(finalvar);
				bookmark = aux;
			}
		}
		len = bookmark.length;
		len--;
		if (bookmark.lastIndexOf(",") == len) {
			bookmark = bookmark.substr(0, len);
		}
		document.cookie = name + '=' + escape(bookmark) + expires + '; path=' + edir_path;
		alert ("El hotel fue retirado de su Lista de Favoritos");
	}
	window.location.reload();
}

function includeClassifiedInCookie(property_id, edir_path) {
	var edir_path="/ophoteles.com/lcms";
	if (!isNaN(property_id)) {
		var name = "classifiedbookmark";
		var d = new Date();
		if (!edir_path) edir_path = "/";
		d.setTime(d.getTime() + (15*24*60*60*1000));
		var expires = '; expires=' + d.toGMTString();
		var classifiedbookmark = readCookie("classifiedbookmark");
		if (!classifiedbookmark) classifiedbookmark = "'" + property_id + "'";
		else {
			if (classifiedbookmark.indexOf("'" + property_id + "'") == -1) {
				classifiedbookmark = classifiedbookmark + "," + "'" + property_id + "'";
			}
		}
		document.cookie = name + '=' + escape(classifiedbookmark) + expires + '; path=' + edir_path;
		alert ("La agencia fue añadida a su lista de favoritos\n\nUsted puede ver su Lista de Favoritos haciendo clic en el link de 'Ver Lista de Favoritos'.");
	}
}

function removeClassifiedFromCookie(property_id, edir_path) {
	var edir_path="/ophoteles.com/lcms";
	var name = "classifiedbookmark";
	var d = new Date();
	if (!edir_path) edir_path = "/";
	d.setTime(d.getTime() + (15*24*60*60*1000));
	var expires = '; expires=' + d.toGMTString();
	if (isNaN(property_id)) {
		if (property_id == "all") {
			var classifiedbookmark = "";
			document.cookie = name + '=' + escape(classifiedbookmark) + expires + '; path=' + edir_path;
		}
	} else {
		var classifiedbookmark = readCookie("classifiedbookmark");
		if (classifiedbookmark.length > 0) {
			if (classifiedbookmark.indexOf("'" + property_id + "'") > -1) {
				finalvar = classifiedbookmark.indexOf("'" + property_id + "'") + property_id.length + 3;
				var aux = "";
				aux = classifiedbookmark.substr(0, classifiedbookmark.indexOf("'" + property_id + "'"));
				aux += classifiedbookmark.substr(finalvar);
				classifiedbookmark = aux;
			}
		}
		len = classifiedbookmark.length;
		len--;
		if (classifiedbookmark.lastIndexOf(",") == len) {
			classifiedbookmark = classifiedbookmark.substr(0, len);
		}
		document.cookie = name + '=' + escape(classifiedbookmark) + expires + '; path=' + edir_path;
		alert ("La agencia fue retirada de su Lista de Favoritos");
	}
	window.location.reload();
}

// END --- Cookie's functions Quick List ---
//-->
// === FIN - cookies.js ===
