// JavaScript Document
<!--
// BEGIN --- Cookie's functions Quick List ---

function readCookie(name) {
	 var eq = name + "=";
	 var ca = document.cookie.split(';');
	 //alert(ca);
		if (!ca.length){ return null;}
		else{
		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 readCookie(nombre) {
	if(){}
   var a = document.cookie.substring(document.cookie.indexOf(nombre + '=') + nombre.length + 1,document.cookie.length);
   if(a.indexOf(';') != -1)a = a.substring(0,a.indexOf(';'))
   return a; 
}*/

function includeInCookie(property_id, edir_path, type) 
{
	alert ("This "+type+" was added to your favorites\n\nYou can view your favorites by clicking on the 'My Favorites' link.");
	xajax_guardarFavoritos(property_id,edir_path,type);
}
/*if (!isNaN(property_id)) {
	 var name = "bookmark"+type;
	 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"+type);
			 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 ("This "+type+" was added to your favorites\n\nYou can view your favorites by clicking on the 'My Favorites' link.");
	}*/
	//xajax_guardarFavoritos(property_id, edir_path, type);
/*function removeFromCookie( name, path, domain ) {
	var d = new Date(); 
	d.setTime(d.getTime() + (15*24*60*60*1000));

	if ( readCookie( name ) ) document.cookie = name + "=" +
			( ( path ) ? ";path=" + path : "") +
			( ( domain ) ? ";domain=" + domain : "" ) +
			";expires=10-Sept-2008 06:10:00 GMT";
}*/
function removeFromCookie(property_id, edir_path,type) {
		 /*var name = "bookmark"+type;
		 var d = new Date();
		 if (!edir_path) edir_path = "/";
		 d.setTime(d.getTime() + (15*24*60*60*1000));
		 var expires = '; expires=' + d.toGMTString();
		// alert (d);
		// alert (property_id);
		 if (isNaN(property_id)) {
				 if (property_id == "all") {
					 var bookmark = "";
					 document.cookie = name + '=' + escape(bookmark) + expires + '; path=' + edir_path;
				 }
		 } else {
				 var bookmark = readCookie("bookmark"+type);

				 if (bookmark.length > 0) {
					 if (bookmark.indexOf("'" + property_id + "'") > -1) {
						 var finalvar = bookmark.indexOf("'" + property_id + "'") + property_id.length + 3;
						 var aux = "";
						 aux = bookmark.substr(0, bookmark.indexOf("'" + property_id + "'"));
		 				//alert(aux);
						 aux += bookmark.substr(finalvar);
						 bookmark = aux;
					 }
				}
			 	len = bookmark.length;
				len--;

				if (bookmark.lastIndexOf(",") == len) {
					bookmark = bookmark.substr(0, len);

				}
			 //var erased=document.getElementById(property_id);
			 //erased.style.display='none';
				
			 document.cookie = name + '=' + escape(bookmark) + expires;
			 //alert(document.cookie);
			 alert ("This "+type+" was removed from your favorites");
	 }*/
   // window.location.href("index.php?PAGE=favoritos");s
   xajax_eliminarFavoritos(property_id, edir_path,type);
   alert ("This "+type+" was removed from your favorites");
}

// END --- Cookie's functions Quick List ---
//-->*/
	
	function Abrir_ventana (pagina) {
		var opciones="toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, width=515, height=540, top=85, left=140";
		window.open("plisting.php?idpromotion="+pagina,"",opciones);
	}
	function view_map (id) {
		var opciones="toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, width=380, height=380, top=85, left=140";
		window.open("functions/bgooglemap.php?idbusiness="+id,"",opciones);
	}
	function view_promotion (id) {
		var opciones="toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, width=515, height=540, top=85, left=140";
		window.open("plisting.php?idpromotion="+id,"",opciones);
		}
	function print_l (id, tipo, featured) {
		var opciones="toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, width=710, height=650, top=85, left=140";
		window.open("functions/print.php?id="+id+"&tipo="+tipo+"&level="+featured,"",opciones);
	}
	function send_mail(id, tipo) {
		var opciones="toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, width=640, height=550, top=85, left=140";
		window.open("functions/emailtofriend.php?id="+id+"&tipo="+tipo,"",opciones);
	}
	function send_mailbiz(id, tipo) {
		var opciones="toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, width=640, height=550, top=85, left=140";
		window.open("functions/emailtobiz.php?id="+id+"&tipo="+tipo,"",opciones);
	}

