");
}
this._FindCallBack = function(response)
{
var _strHtml="";
var _intCounter=0;
//Test for an error
if (response.length==1 && typeof(response[0].error_number) != 'undefined')
{
//Show the error message
if (response[0].error_number=="7" || response[0].error_number=="11")
{
this._SetControlHtml("
Sorry, we were unable to understand that location. Please click on cancel and check your spelling.
");
}
else
{
this._SetControlHtml("
" + response[0].message + "
");
}
}
else
{
//Check if there were any items found
if (response.length==0)
{
this._SetControlHtml("
";
this._SetControlHtml(_strHtml);
}
}
}
this._StoredNearestCallBack = function(response)
{
var _strHtml="";
var _intCounter=0;
var _objMarker;
//Test for an error
if (response.length==1 && typeof(response[0].error_number) != 'undefined')
{
//Show the error message
if (response[0].error_number=="7" || response[0].error_number=="11")
{
this._SetControlHtml("
Sorry, we were unable to find your address. Please click on cancel and enter your address manually.
");
}
else
{
this._SetControlHtml("
" + response[0].message + "
");
}
}
else
{
//Check if there were any items found
if (response.length==0)
{
this._SetControlHtml("
Sorry, no matching items found.
");
}
else
{
//Store the results for later
this.m_objResults = response;
if (!this.HideMap)
{
//Add the pins onto the Google Map
if (this.UseGoogleMaps)
{
//Add the pins onto the Google Map
this.Map.clearOverlays();
this.m_objPins.length = response.length;
for (_intCounter=0; _intCounter
Click for more information...
";
for (_intCounter=0; _intCounter";
_strHtml += "
";
this._SetControlHtml(_strHtml);
//Centre the map on the store
if (!this.HideMaps)
{
if (this.UseGoogleMaps)
{
this.GoogleMap.panTo(new GLatLng(this.m_objResults[what].wgs84_latitude, this.m_objResults[what].wgs84_longitude))
}
else
{
this.Map.CentreAndZoom(this.m_objResults[what].grid_east_m*1, this.m_objResults[what].grid_north_m*1, 2);
}
}
//Call the callback
//this.CallBack(this.m_objResults[what]);
}
this._IsSecure = function()
{
return (window.location.protocol=="https:");
}
this._IsVisible = function()
{
return (this.m_pnlControl.style.display=="");
}
this._LogoImage = function()
{
var _intVersion=0;
var _blnAddLogo=true;
if (navigator.userAgent.indexOf("MSIE")!=-1)
{
_intVersion = parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("MSIE")+5));
if (_intVersion>6)
_blnAddLogo = false;
}
else if (navigator.userAgent.indexOf("Firefox")!=-1)
{
_blnAddLogo = false;
}
if (!this.ShowLogo)
_blnAddLogo = false;
if (_blnAddLogo)
{
if (this._IsSecure())
{
return 'https://services.postcodeanywhere.co.uk/popups/flat_logo.png';
}
else
{
return 'http://services.postcodeanywhere.co.uk/popups/flat_logo.png';
}
}
else
{
if (this._IsSecure())
{
return 'https://services.postcodeanywhere.co.uk/popups/spacer.gif';
}
else
{
return 'http://services.postcodeanywhere.co.uk/popups/spacer.gif';
}
}
}
this._BackgroundImage = function()
{
if (this._IsSecure())
{
if (this.ShowLogo)
return 'https://services.postcodeanywhere.co.uk/popups/popup_store_background.png'
else
return 'https://services.postcodeanywhere.co.uk/popups/popup_store_background_nologo.png';
}
else
{
if (this.ShowLogo)
return 'http://services.postcodeanywhere.co.uk/popups/popup_store_background.png'
else
return 'http://services.postcodeanywhere.co.uk/popups/popup_store_background_nologo.png';
}
}
this._ImageBase = function()
{
if (this._IsSecure())
{
return 'https://services.postcodeanywhere.co.uk/popups/';
}
else
{
return 'http://services.postcodeanywhere.co.uk/popups/';
}
}
this._PcaMap = function(e, n)
{
if (this._IsSecure())
this.m_pnlMap.innerHTML=""
else
this.m_pnlMap.innerHTML="";
}
this._BackgroundStyles = function()
{
var _intVersion=0;
var _blnColourBackground=true;
if (navigator.userAgent.indexOf("MSIE")!=-1)
{
_intVersion = parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("MSIE")+5));
if (_intVersion>6)
_blnColourBackground = false;
}
else if (navigator.userAgent.indexOf("Firefox")!=-1)
{
_blnColourBackground = false;
}
if (_blnColourBackground)
return ";background-color:#e4e4b7;border:solid 1px black;"
else
return ";background-image:url(" + this._BackgroundImage() + ");";
}
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//Constructor
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//The interior control
this.m_pnlControl = document.createElement("DIV");
this.m_pnlControl.style.zIndex=1000;
this.m_pnlControl.style.position="absolute";
this.m_pnlControl.style.top="0px";
this.m_pnlControl.style.left="0px";
this.m_pnlControl.style.width="740px";
this.m_pnlControl.style.height="402px";
this.m_pnlControl.style.display="none";
this.m_pnlControl.style.padding="0";
this.m_pnlControl.style.margin="0";
//Bind to the control list
this.m_intUid = _PostcodeAnywhereControlList.length
_PostcodeAnywhereControlList[this.m_intUid] = this;
_PostcodeAnywhereControlList.length += 1;
//Build the HTML
var _strHtml="";
if (navigator.userAgent.indexOf("MSIE")!=-1)
{
//_strMapWidth = "402px";
//_strButtonWidth = "404px";
_strMapWidth = "372px";
_strButtonWidth = "374px";
}
else
{
_strMapWidth = "372px";
_strButtonWidth = "374px";
}
if (this.HideMap)
{
_strHtml+="
"
_strHtml+=" "
_strHtml+="
";
_strHtml+="
";
_strHtml+="
";
_strHtml+="
";
_strHtml+="
"
_strHtml+=" "
_strHtml+="
"
_strHtml+="
";
_strHtml+="
"
_strHtml+="
";
_strHtml+="
";
_strHtml+=" "
_strHtml+="
";
_strHtml+="
"
_strHtml+="
"
_strHtml+=" "
_strHtml+="
"
}
else
{
_strHtml+="
"
_strHtml+=" "
_strHtml+="
";
_strHtml+="
";
_strHtml+="
";
_strHtml+="
";
_strHtml+="
"
_strHtml+=" "
_strHtml+="
"
_strHtml+="
"
_strHtml+=" "
_strHtml+="
"
_strHtml+="
";
_strHtml+="
"
_strHtml+="
";
_strHtml+="
";
_strHtml+=" "
_strHtml+="
";
_strHtml+="
"
_strHtml+="
"
_strHtml+=" "
_strHtml+="
"
}
this.m_pnlControl.innerHTML=_strHtml;
//Bind into the document
document.body.appendChild (this.m_pnlControl);
this.m_pnlLocations = document.getElementById("pcaLocations_" + this.m_intUid);
this.m_pnlMap = document.getElementById("pcaMap_" + this.m_intUid);
this.m_pnlButtonBar = document.getElementById("pcaButtonBar_" + this.m_intUid);
//Check if GM is available
if (this.UseGoogleMaps && typeof(GMap2) =='undefined')
{
alert("Can't find the Google Maps API on this page - please make sure it's present and declared before Postcode Anywhere")
}
}
if (self.location.protocol=='https:')
{
var pcaBaseUrlYE44 = 'https://services.postcodeanywhere.co.uk/popups';
}
else
{
var pcaBaseUrlYE44 = 'http://services.postcodeanywhere.co.uk/popups';
}
var pcaLicenseKeyYE44 = 'YE44-XG96-ZR32-EY98';
var pcaAccountCodeYE44 = 'DEMOC11112';
var pcaMachineIdYE44 = '';
var pcaSetupServiceYE44 = pcaBaseUrlYE44 + '/setup.aspx';
var pcaReturnUrlYE44 = self.location;
var pcaTokenYE44 = 'YE44';
var objControlYE44=null;
function pcaSetupYE44()
{
var objWindow;
var strOptions;
var strUrl;
if (document.forms.length == 0)
alert("Your must have at least one HTML FORM tag on your page before you can set up Postcode Anywhere.")
else
{
strUrl = pcaSetupServiceYE44+'?account_code='+escape(pcaAccountCodeYE44)+'&license_key='+escape(pcaLicenseKeyYE44)+'&token='+escape(pcaTokenYE44)+'&machineId='+escape(pcaMachineIdYE44)+pcaFormFieldsYE44()+'&return_to='+escape(pcaReturnUrlYE44);
objWindow='PCA';
strOptions='toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=0,resizable=1,width=580,height=550';
window.open(strUrl, objWindow, strOptions);
}
};
function pcaGetFieldYE44(what)
{
var intFieldCounter=0;
for (intFormCounter=0; intFormCounter <= document.forms.length-1 ; intFormCounter++)
{
for (elementCounter=0; elementCounter <= document.forms[intFormCounter].length-1 ; elementCounter++)
{
if (document.forms[intFormCounter].elements[elementCounter].name==what)
{
return document.forms[intFormCounter].elements[elementCounter].value;
};
};
};
};
function pcaFormFieldsYE44()
{
var strFieldList = "";
var intFieldCounter=0;
for (intFormCounter=0; intFormCounter <= document.forms.length-1 ; intFormCounter++)
{
for (elementCounter=0; elementCounter <= document.forms[intFormCounter].length-1 ; elementCounter++)
{
strFieldList = strFieldList + "&field" + intFieldCounter + "=" + escape(document.forms[intFormCounter].elements[elementCounter].name);
intFieldCounter++;
};
};
return (strFieldList);
}
function pcaStartYE44()
{
//Create the control if necessary
if (!objControlYE44)
{
objControlYE44 = new PostcodeAnywhereStoreLocaterYE44();
};
//Start the search
objControlYE44.Find(pcaGetFieldYE44("postcode"));
};
document.write(" ");
document.write("");