
function submitSearch()
{
	var strDelimiter = "|";
	
	/* GETTING COUNTRIES, REGIONS AND TOWN/CITY */
	var continent = document.getElementById("ddlContinent"); 
	var country = document.getElementById("ddlCountry"); 
	var region = document.getElementById("ddlRegion"); 
	var townCity = document.getElementById("ddlTownCity"); 
	
	var strContinent = "";
	if (continent.length != 0 && continent.options[continent.selectedIndex].value != "Please Choose")
	{
		strContinent = "ContinentId=" + continent.options[continent.selectedIndex].value + "&";
	}
	
	
	var strCountry = "";
	if (country.length != 0 && country.options[country.selectedIndex].value != "Please Choose")
	{
		strCountry = "Country=" + country.options[country.selectedIndex].value + "&";
	}
	
	var strRegion = "";
	if (region.length != 0 && region.options[region.selectedIndex].value != "Please Choose")
	{
		strRegion = "Region=" + region.options[region.selectedIndex].value + "&";
	}
	
	var strTownCity = "";
	if (townCity.length != 0 && townCity.options[townCity.selectedIndex].value != "Please Choose")
	{
		strTownCity = "TownCity=" + townCity.options[townCity.selectedIndex].value + "&";
	}

	/* GETTING MINPRICE AND MAX PRICES.*/
	var minPrice = document.getElementById("ddlMinPrice"); 
	var maxPrice = document.getElementById("ddlMaxPrice"); 
	
	var strMinPrice = "minprice=" + minPrice.options[minPrice.selectedIndex].value + "&";
	var strMaxPrice = "maxprice=" + maxPrice.options[maxPrice.selectedIndex].value + "&";
		
	/* GETTING PROPERTY TYPES BASED ON SELECTION*/
	oSelect = document.getElementById("ddlPropertyTypes"); 
	var PropertyType = oSelect.options[oSelect.selectedIndex].value
	var strPropertyType = "";
	
	if (PropertyType == "All")
	{
		for(var i = 0; i < oSelect.length ; i++)
		{
			if (oSelect.options[i].value != "All")
				strPropertyType = strPropertyType + oSelect.options[i].value + strDelimiter
		}
		strPropertyType = "Type=" + strPropertyType.substr(0, strPropertyType.length -1);
	}
	else
	{
		strPropertyType = "Type=" + PropertyType;
	}

	var strRedirect = "PropertySearch.aspx?" + strContinent + strCountry + strRegion + strTownCity + strMinPrice + strMaxPrice + strPropertyType;
	window.location.href = strRedirect;
	
}