function getLocations(){
		var location = $F('change_location');
		if(location.length>3 && isNaN(location) && registeredLoc != location){
				registeredLoc = location;
				var myAjax = new Ajax.Updater('location-recs', 'citylookup.php', {
  					method: 'get',
  					parameters: { citycountry : location }
  				});
		}
		if(location.length<3){
			$('location-recs').innerHTML = "";
		}
		t = setTimeout("getLocations()",500);
}
function getLocationsReport(){
		var location = $F('report_location');
		if(location.length>3 && isNaN(location) && registeredLoc != location){
				registeredLoc = location;
				var myAjax = new Ajax.Updater('location-recs-newsletter', 'citylookup.php', {
  					method: 'get',
  					parameters: { citycountry : location, report : 1 }
  				});
		}
		if(location.length<3){
			$('location-recs-newsletter').innerHTML = "";
		}
		t = setTimeout("getLocationsReport()",500);
		document.onclick = function(e){ 
		       	if (!e && event) e = event;
	   		if ( !e.target && e.srcElement ) {
				e.target = e.srcElement;
		    	}
		       	if(e.target.id.indexOf("recs")==-1){
		          	$('location-recs-newsletter').innerHTML = "";
		        }
		}
}
function getLocationsSearchPage(){
		var location = $F('change_location');
		if(location.length>3 && isNaN(location) && registeredLoc != location){
				registeredLoc = location;
				var myAjax = new Ajax.Updater('location-recs', 'citylookup.php', {
  					method: 'get',
  					parameters: { citycountry : location, search :1 }
  				});
		}
		if(location.length<3){
			$('location-recs').innerHTML = "";
		}
		t = setTimeout("getLocationsSearchPage()",500);
}
function getLocationsDecodePage(){
		var location = $F('change_location');
		if(location.length>3 && isNaN(location) && registeredLoc != location){
				registeredLoc = location;
				var myAjax = new Ajax.Updater('location-recs', 'citylookup.php', {
  					method: 'get',
  					parameters: { citycountry : location, decode :1 }
  				});
		}
		if(location.length<3){
			$('location-recs').innerHTML = "";
		}
		t = setTimeout("getLocationsDecodePage()",500);
}
function getLocationsProduct(){
		var location = $F('change_location');
		if(location.length>3 && isNaN(location) && registeredLoc != location){
				registeredLoc = location;
				var myAjax = new Ajax.Updater('location-recs', 'citylookup.php', {
  					method: 'get',
  					parameters: { citycountry : location, product : product_id }
  				});
		}
		if(location.length<3){
			$('location-recs').innerHTML = "";
		}
		t = setTimeout("getLocationsProduct()",500);
}
