function LoadDropBox(container,CurrPage,CatID,key,s,HTTP_HOST)
{var URL=HTTP_HOST+"load_dropdown.php";new Ajax.Updater(container,URL,{method:'post',parameters:{CurrPage:CurrPage,CatID:CatID,key:key,s:s}});}
function LoadCategory(container,HTTP_HOST){var URL=HTTP_HOST+"LoadCat.php";new Ajax.Updater(container,URL,{method:'post'});}
function optionPriceRange(CategoryID,MinPrice,MaxPrice,RoomNo,CarType,HTTP_HOST)
{var MinRange=parseInt(MinPrice);var MaxRange=parseInt(MaxPrice);$('searchInputButton').show();if(CategoryID==28||CategoryID==31||CategoryID==35||CategoryID==36)
{if((MaxPrice==0)||(MaxPrice==-1))
{$('searchInputButton').hide();$('searchInput').show();}}
if(HTTP_HOST=='http://www.busyuk.co.uk')
{$('LoadPriceRange').innerHTML="<img src='http://www.busyuk.co.uk/images/icons/loading_small.gif' alt='loading' />";}
else
{$('LoadPriceRange').innerHTML="<img src='http://busyuk.co.uk/images/icons/loading_small.gif' alt='loading' />";}
var URL=HTTP_HOST+"LoadPriceRange.php";new Ajax.Request(URL,{method:'post',parameters:{CategoryID:CategoryID,MinPrice:MinPrice,MaxPrice:MaxPrice,RoomNo:RoomNo,CarType:CarType},onSuccess:function(transport)
{var res=transport.responseText;if(res)
{$('LoadPriceRange').innerHTML=res;}
else
{$('LoadPriceRange').innerHTML="";}},onFailure:function()
{$('ShowMsg').innerHTML="Server Error !! Insertion Fail";}});}
function RangeCheck(categoryId)
{var MinRange=parseInt($('dbdMinPriceRange').value);var MaxRange=parseInt($('dbdMaxPriceRange').value);$('searchInputButton').show();$('searchInput').hide();if(categoryId==28||categoryId==31||categoryId==35||categoryId==36)
{if((MaxRange==-1||MaxRange==0))
{alert("Please Select The Price Range");$('dbdMinPriceRange').focus();$('searchInputButton').hide();$('searchInput').show();return false;}
else
{if(MaxRange>0)
{if(MinRange>MaxRange)
{alert("Max Price cannot be lower than Min");$('dbdMinPriceRange').focus();$('searchInputButton').hide();$('searchInput').show();return false;}
else
{$('searchInputButton').show();$('searchInput').hide();return true;}}}}
else
{if((MaxRange>0))
{if(MinRange>MaxRange)
{alert("Max Price cannot be lower than Min");$('dbdMinPriceRange').focus();$('searchInputButton').hide();$('searchInput').show();return false;}
else
{$('searchInputButton').show();$('searchInput').hide();return true;}}}}
function CheckOnButton()
{if($('dbdMinPriceRange').value=="0")
{alert('Please Select Your Price Range');}}
function GetLinks(CatID)
{if(!CatID)
{CategoryID=0;}
else
{CategoryID=CatID;}
$('LinkPagiShow').hide();var AjaxURL='LoadLink.php?CategoryID='+CategoryID;var AjaxParams='PageIndex=1&RecordPerPage=10';var ListingDiv='linkDisplay';var PagiShowDiv='LinkPagiShow';AjaxLinkPagging(AjaxURL,AjaxParams,ListingDiv,PagiShowDiv);}
function AjaxLinkPagging(AjaxURL,AjaxParams,ListingDiv,PagiShowDiv)
{if(getRef(PagiShowDiv).style.display=='none')
{showDiv(PagiShowDiv);}
var FirstPagiDiv=PagiShowDiv;$('LinkPagiShow').hide();$('linkDisplay').hide();$('loadImage').show();$('loadImage').innerHTML="<img src='images/icons/ajax-loader (1).gif' alt='loading' />";var URL=AjaxURL;var splitURL=AjaxURL.split("?");var URL=splitURL[0];var extraParam=splitURL[1];var Params=AjaxParams+"&"+extraParam;new Ajax.Request(URL,{method:'post',parameters:Params,onSuccess:function(transport)
{var res=transport.responseText;if(res)
{var splitRes=res.split("|");$(ListingDiv).show();$(FirstPagiDiv).show();$(FirstPagiDiv).innerHTML=splitRes[1];$(ListingDiv).innerHTML=splitRes[0];$('loadImage').hide();}
else
{$('linkDisplay').innerHTML="";}},onFailure:function()
{$('linkDisplay').innerHTML="Server Error !! ";}});}
function LoadRightNav(container,CatID,CityID,PageName,HTTP_HOST)
{var URL=HTTP_HOST+"LoadRightNav.php";new Ajax.PeriodicalUpdater(container,URL,{method:'post',parameters:{CatID:CatID,CityID:CityID,CurrentPageName:PageName},frequency:30,decay:1});}
function MySavedAdds(advID,CatID,checked,loadingObj,outputClt,doIt,HTTP_HOST)
{Ajax.Responders.register({onCreate:function()
{var agt=navigator.userAgent.toLowerCase();if(agt.indexOf('msie')!=-1&&document.all&&agt.indexOf('opera')==-1&&agt.indexOf('mac')==-1)
{eval('var c=(agt.indexOf("msie 5")!=-1)?"Microsoft.XMLHTTP":"Msxml2.XMLHTTP";try{new ActiveXObject(c);}catch(e){alert("ActiveX Sees To Be Disabled!");}');}},onUninitialized:function()
{loadingObj.innerHTML='YOUR REQUEST HAS NOT BEEN INITIALISED!';},onComplete:function(){}});if(HTTP_HOST=='http://www.busyuk.co.uk')
{loadingObj.innerHTML="<span style='padding:0px;color:#4C636E'><img src='http://www.busyuk.co.uk/images/icons/loading_small.gif' width='16' height='16' border='0'  align='absmiddle'>Loading Please Wait....</span>";}
else
{loadingObj.innerHTML="<span style='padding:0px;color:#4C636E'><img src='http://busyuk.co.uk/images/icons/loading_small.gif' width='16' height='16' border='0'  align='absmiddle'>Loading Please Wait....</span>";}
new Ajax.Request(HTTP_HOST+'ajaxserver/MySavedAdds.php',{method:'get',onSuccess:function(transport)
{outputClt.innerHTML=transport.responseText;loadingObj.innerHTML="";},parameters:{task:'insert',advID:advID,CatID:CatID,checked:checked,doIt:doIt},onFailure:function(transport)
{if(404==transport.status)
{loadingObj.innerHTML="Sorry, Resource Is Unavailable";}
else if(500==transport.status)
{loadingObj.innerHTML="Sorry, Internal Error. Please Contact Administrator.";}
else
{loadingObj.innerHTML="Sorry, Unexpected Response Status: "+transport.status;}}});}
function SetAjaxCookieForRightNav(advID,CatID,HTTP_HOST)
{getSetChkBoxForRightNav(advID);if(document.getElementById('MySavedAdvertsForRightNav'+advID).checked==true)
{MySavedAdds(advID,CatID,'1',$('AjaxMessage'+advID),$('AjaxShowOutPut'+advID),'0',HTTP_HOST);}
else
{MySavedAdds(advID,CatID,'0',$('AjaxMessage'+advID),$('AjaxShowOutPut'+advID),'0',HTTP_HOST);}}
function getSetChkBoxForRightNav(advID)
{if(document.getElementById('MySavedAdvertsForRightNav'+advID)!=null)
{if(document.getElementById('MySavedAdvertsForRightNav'+advID).checked==true)
{if(document.getElementById('MySavedAdvertsForIndex'+advID)!=null)
{document.getElementById('MySavedAdvertsForIndex'+advID).checked=true;}}
else
{if(document.getElementById('MySavedAdvertsForIndex'+advID)!=null)
{document.getElementById('MySavedAdvertsForIndex'+advID).checked=false;}}}}
function change()
{if(examp.style.overflow=="auto"){examp.style.overflow="hidden";knop.value="Set overflow to VISIBLE.";txt.innerText="Overflow is set to HIDDEN.";return true;}}
function getOptionValNew(opt,page,catID,key,s)
{if(catID==""){catID=1;}
if(s==""){s=1;}
window.location.href=page+"?CatID="+catID+"&CityID="+opt+"&key="+key+"&s="+s;}
function preventOpp(objID)
{if(navigator.appName.indexOf('Microsoft')!=-1)
{document.getElementById(objID).onkeypress=Filter4Characters;}
else
{document.getElementById(objID).addEventListener("keypress",Filter4Characters,true);}}
function Filter4Characters(evt)
{if(navigator.appName.indexOf('Microsoft')!=-1){if(event.keyCode<46||event.keyCode>57){event.returnValue=false;}}else{if(evt.charCode&&(evt.charCode<46||evt.charCode>57)){if(evt.preventDefault){evt.preventDefault();}}}}
function Set_Cookie_old(name,value,expires,path,domain,secure)
{alert(name);alert(value);alert(expires);var today=new Date();today.setTime(today.getTime());var expires_date=new Date(today.getTime()+(expires));document.cookie=alert(name+"="+escape(value)+((expires)?";expires="+expires_date.toGMTString():"")+((path)?";path="+path:"")+((domain)?";domain="+domain:"")+((secure)?";secure":""));}
function Set_Cookie(CategoryID)
{var CategoryID=parseInt(CategoryID);var URL="SetCookie.php";new Ajax.Request(URL,{method:'post',parameters:{CategoryID:CategoryID},onSuccess:function(transport)
{var res=transport.responseText;},onFailure:function()
{$('ShowMsg').innerHTML="Server Error !! Insertion Fail";}});}
function setCatId(categoryId,HTTP_HOST,cityId)
{if(HTTP_HOST=='http://www.busyuk.co.uk')
{$(categoryId).innerHTML="<img src='http://www.busyuk.co.uk/images/icons/loading_small.gif' alt='loading' />";}
else
{$(categoryId).innerHTML="<img src='http://busyuk.co.uk/images/icons/loading_small.gif' alt='loading' />";}
var URL=HTTP_HOST+"setCatId.php";new Ajax.Request(URL,{method:'post',parameters:{CategoryID:categoryId,CityID:cityId},onSuccess:function(transport)
{var res=transport.responseText;window.location.href=res;},onFailure:function()
{$('ShowMsg').innerHTML="Server Error !! Insertion Fail";}});}