function getCookieVal(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=");
  if (c_start!=-1)
    {
    c_start=c_start + c_name.length+1;
    c_end=document.cookie.indexOf(";",c_start);
    if (c_end==-1) c_end=document.cookie.length;
    return unescape(document.cookie.substring(c_start,c_end));
    }
  }
return "";
}

function retrieve(Loc, Lat, Lon)
{

if (!Loc == ''){
document.getElementById("Loading").innerHTML="<p class='InnerText' align='center'><img src='LocalListings/loader.gif'><br>Finding Listings In " + Location + "<br>Please Wait....<br><br></p>";

}else if (!(getCookieVal('visitorlocation') == ''))
{
document.getElementById("Loading").innerHTML="<p class='InnerText' align='center'><img src='LocalListings/loader.gif'><br>Finding Listings Near " + getCookieVal('visitorlocation').toUpperCase() + "<br>Please Wait....<br><br></p>";
} 
else if (google.loader.ClientLocation)
{
document.getElementById("Loading").innerHTML="<p class='InnerText' align='center'><img src='LocalListings/loader.gif'><br>Finding Listings In " + google.loader.ClientLocation.address.city + ", " + google.loader.ClientLocation.address.region + "<br>Please Wait....<br><br></p>";
}else{
return false;
}

var urllink;

if (!Loc == ''){
urllink = "LocalListings/RetrieveListingsArea.asp";
}else{
urllink = "LocalListings/RetrieveListings.asp";
}

var HTTP_Hall=false;
var HTTP_DJ=false;
var HTTP_Artist=false;
var HTTP_Limo=false;
var HTTP_Taxi=false;
var HTTP_Service=false;

var count = 0;

 try  /*ID=1*/
 {   
 HTTP_Hall = new ActiveXObject("Msxml2.XMLHTTP"); /* for IE < 5 */ 
 HTTP_DJ = new ActiveXObject("Msxml2.XMLHTTP");
 HTTP_Artist = new ActiveXObject("Msxml2.XMLHTTP");
 HTTP_Limo = new ActiveXObject("Msxml2.XMLHTTP");
 HTTP_Taxi = new ActiveXObject("Msxml2.XMLHTTP");
 HTTP_Service = new ActiveXObject("Msxml2.XMLHTTP");
  }  
 
 catch (e)  

 {    
 
 try     /*ID=2*/
 {    
 HTTP_Hall = new ActiveXObject("Microsoft.XMLHTTP"); 
 HTTP_DJ = new ActiveXObject("Microsoft.XMLHTTP");    
 HTTP_Artist  = new ActiveXObject("Microsoft.XMLHTTP"); 
 HTTP_Limo = new ActiveXObject("Microsoft.XMLHTTP"); 
 HTTP_Taxi = new ActiveXObject("Microsoft.XMLHTTP"); 
 HTTP_Service = new ActiveXObject("Microsoft.XMLHTTP"); 
 }    
 catch (E)     
 {    
 HTTP_Hall = false;    
 HTTP_DJ = false;   
 HTTP_Artist = false;   
 HTTP_Limo = false;   
 HTTP_Taxi = false;   
 HTTP_Service = false;   
 
 } /*END TRY ID 2*/
 
 
 } /*END TRY ID 1*/
 
 /* mozilla & opera */ 
 if (!HTTP_Hall && typeof XMLHttpRequest!='undefined')  {   HTTP_Hall = new XMLHttpRequest(); }
 if (!HTTP_DJ && typeof XMLHttpRequest!='undefined')  {   HTTP_DJ = new XMLHttpRequest(); }
 if (!HTTP_Artist && typeof XMLHttpRequest!='undefined')  {   HTTP_Artist = new XMLHttpRequest(); }
 if (!HTTP_Limo && typeof XMLHttpRequest!='undefined')  {   HTTP_Limo = new XMLHttpRequest(); }
 if (!HTTP_Taxi && typeof XMLHttpRequest!='undefined')  {   HTTP_Taxi = new XMLHttpRequest(); }
 if (!HTTP_Service && typeof XMLHttpRequest!='undefined')  {   HTTP_Service = new XMLHttpRequest(); }

var Params;
Params='';
if (!Loc == ''){
Params = 'fnd=1&manuallocation=0&countrycode=UK&countryname=UK&city=' + escape(Loc) + '&lat=' + Lat + '&lon=' + Lon;
}else{
if (getCookieVal('visitorlocation') == ''){
if(google.loader.ClientLocation)
{
Params = 'fnd=1&manuallocation=0&countrycode=' + escape(google.loader.ClientLocation.address.country_code) + '&countryname=' + escape(google.loader.ClientLocation.address.country) + '&city=' + escape(google.loader.ClientLocation.address.city) + '&theregionname=' + escape(google.loader.ClientLocation.address.region) + '&lat=' + escape(google.loader.ClientLocation.latitude) + '&lon=' + escape(google.loader.ClientLocation.longitude);
}
}else{
Params = 'fnd=1&manuallocation=1&PostCode=' + escape(getCookieVal('visitorlocation'));
}
}

HTTP_Hall.open("POST", urllink,true); 
HTTP_Hall.setRequestHeader("Content-type", "application/x-www-form-urlencoded");

HTTP_Hall.onreadystatechange= function()
{
if (HTTP_Hall.readyState == 4 && (HTTP_Hall.status==200 || window.location.href.indexOf("http")==-1)) {
document.getElementById("Listings").innerHTML= document.getElementById("Listings").innerHTML + HTTP_Hall.responseText;
count = count + 1;
if (count >= 6){ document.getElementById("Loading").innerHTML=''; }
}
}




HTTP_DJ.open("POST", urllink,true); 
HTTP_DJ.setRequestHeader("Content-type", "application/x-www-form-urlencoded");

HTTP_DJ.onreadystatechange= function()
{
if (HTTP_DJ.readyState == 4 && (HTTP_DJ.status==200 || window.location.href.indexOf("http")==-1)) {
document.getElementById("Listings").innerHTML= document.getElementById("Listings").innerHTML + HTTP_DJ.responseText
count = count + 1;
if (count >= 6){ document.getElementById("Loading").innerHTML=''; }
}
}






HTTP_Artist.open("POST", urllink,true); 
HTTP_Artist.setRequestHeader("Content-type", "application/x-www-form-urlencoded");

HTTP_Artist.onreadystatechange= function()
{
if (HTTP_Artist.readyState == 4 && (HTTP_Artist.status==200 || window.location.href.indexOf("http")==-1)) {
document.getElementById("Listings").innerHTML= document.getElementById("Listings").innerHTML + HTTP_Artist.responseText
count = count + 1;
if (count >= 6){ document.getElementById("Loading").innerHTML=''; }
}
}



HTTP_Limo.open("POST", urllink,true); 
HTTP_Limo.setRequestHeader("Content-type", "application/x-www-form-urlencoded");

HTTP_Limo.onreadystatechange= function()
{
if (HTTP_Limo.readyState == 4 && (HTTP_Limo.status==200 || window.location.href.indexOf("http")==-1)) {
document.getElementById("Listings").innerHTML= document.getElementById("Listings").innerHTML + HTTP_Limo.responseText
count = count + 1;
if (count >= 6){ document.getElementById("Loading").innerHTML=''; }
}
}


HTTP_Taxi.open("POST", urllink,true); 
HTTP_Taxi.setRequestHeader("Content-type", "application/x-www-form-urlencoded");

HTTP_Taxi.onreadystatechange= function()
{
if (HTTP_Taxi.readyState == 4 && (HTTP_Taxi.status==200 || window.location.href.indexOf("http")==-1)) {
document.getElementById("Listings").innerHTML= document.getElementById("Listings").innerHTML + HTTP_Taxi.responseText
count = count + 1;
if (count >= 6){ document.getElementById("Loading").innerHTML=''; }
}
}



HTTP_Service.open("POST", urllink,true); 
HTTP_Service.setRequestHeader("Content-type", "application/x-www-form-urlencoded");

HTTP_Service.onreadystatechange= function()
{
if (HTTP_Service.readyState == 4 && (HTTP_Service.status==200 || window.location.href.indexOf("http")==-1)) {
document.getElementById("Listings").innerHTML= document.getElementById("Listings").innerHTML + HTTP_Service.responseText;
count = count + 1;
if (count >= 6){ document.getElementById("Loading").innerHTML=''; }
}
}

try{
HTTP_Hall.send(Params + "&ID=H&Limit=15&hidePromo=1");
HTTP_DJ.send(Params + "&ID=D&Limit=15&hidePromo=1");
HTTP_Artist.send(Params + "&ID=A&Limit=15&hidePromo=1");
HTTP_Limo.send(Params + "&ID=L&Limit=15&hidePromo=1");
HTTP_Taxi.send(Params + "&ID=T&Limit=15&hidePromo=1");
HTTP_Service.send(Params + "&ID=E&Limit=15&hidePromo=1");
}
catch(err)
{
}

}

 

