//if ( HttpManager.Request.QueryString("ListingType").length > 0 ) { document.isc.ListingType.value = HttpManager.Request.QueryString("ListingType") }
	if(document.isc){ 
	
//PropertySearch_ListingType_OnSelectionChange(document.isc.ListingType);

switch ( HttpManager.Document.Forms.getType("isc", "ListingType") ){
	case HttpManager.Document.Forms.elementTypes.htmlRadio:
		HttpManager.Document.Forms.HtmlRadio.SetValue("isc","ListingType", HttpManager.Request.QueryString("listingtype") );
		PropertySearch_ListingType_OnSelectionChange(HttpManager.Document.Forms.HtmlRadio.GetSelectedItem("isc","ListingType"));
		break;
	case HttpManager.Document.Forms.elementTypes.htmlInputHidden:
		var o = new Object();
		o.value = 5;
		PropertySearch_ListingType_OnSelectionChange( o );	
		break;
}


	
	
if ( typeof nDropdownManager != "undefined" ){
	olistingtype.selectItem( null, HttpManager.Request.QueryString("listingtype") );
}

//SiteSearchPanel_ListingType_OnClick();		

if ( typeof nDropdownManager != "undefined" ){
	nDropdownManager.selectItem( null, HttpManager.Request.QueryString("location") );
}
if ( typeof ominimumprice != "undefined" ){
	ominimumprice.selectItem( null, HttpManager.Request.QueryString("minprice") );
}
if ( typeof omaximumprice != "undefined" ){
	omaximumprice.selectItem( null, HttpManager.Request.QueryString("maxprice") );
}
if ( typeof obedrooms != "undefined" ){
	obedrooms.selectItem(null, HttpManager.Request.QueryString("bedrooms") );
}

if ( document.getElementById("newHomes")){
	 if(HttpManager.Request.QueryString("newhomes").length>0){
		document.getElementById("newHomes").checked = true;
	 }
}

var sPath = window.location.pathname;
var sPage = sPath.substring(sPath.lastIndexOf('/') + 1);
if (sPage == 'developments.aspx'){
		document.getElementById("newHomes").checked = true;
}
	
		
		aoffices=[]
		var soffices = HttpManager.Request.QueryString("location")
		
		aoffices = soffices.split(",");
		
		if (document.frmSearchCriteria){
			if (document.frmSearchCriteria.location){
				for ( var i = 0; i < document.frmSearchCriteria.location.length; i ++ ){
					for ( var x = 0; x < aoffices.length; x ++ ){
						if (document.frmSearchCriteria.location[i].value == aoffices[x]){
							document.frmSearchCriteria.location[i].checked = true;
						}
					}
				}
			}
		}
	}
	
	
	function hideSearchPanel(){
		if (HttpManager.Document.GetObject("pnlAdvContainer")){
			HttpManager.Document.GetObject("pnlAdvContainer").style.display = "none"
		}
		
		if (HttpManager.Document.GetObject("SiteSearchPanel_pnlAdvContainer")){
			HttpManager.Document.GetObject("SiteSearchPanel_pnlAdvContainer").style.display = "none"
		}
		
		
		
	}
	
	

function SiteSearchPanel_ListingType_OnClick(){
//try{
	var objListing = new Object();
	if (objListing.value = olistingtype.Value()){
		objListing.value = olistingtype.Value();
	}else{objListing.value=5}
	PropertySearch_ListingType_OnSelectionChange(objListing);
//	}
	
	//catch(e){alert("error");}

}