$(function() {   

	temp_cookieMapView = $.cookie("cookie_mapView");
	temp_cookieListView = $.cookie("cookie_listView"); 
	
	$("#wmap_go").bind("click", function() {
		try {
			
			propertyListingTitle 	= "Property Listing";	
			///////////Get Brand Value										   
			tempBrandVal = $("option:selected", "#wmap_brand").val();
			tempBrand = $("option:selected", "#wmap_brand").text();
			
			if(tempBrandVal != "") {
				var indexBrand = tempBrandVal.indexOf(" ");
				if(indexBrand > 0)
					tempBrandVal = tempBrandVal.substring(indexBrand, tempBrandVal);
			}
			$.cookie('cookie_BrandDDL', tempBrandVal);
			
			///////////Get Country Value
			tempCountryVal = $("option:selected", "#wmap_country").val();
			tempCountry = $("option:selected", "#wmap_country").text();
			$.cookie('cookie_CountryDDL', tempCountryVal);
			
			///////////Get City Value
			tempCityVal = $("option:selected", "#wmap_city").val();
			tempCity = $("option:selected", "#wmap_city").text();
			if(tempCityVal != "") {
				var indexCity = tempCityVal.indexOf("|");
				tempCityVal = tempCityVal.substr(0,indexCity);
			}
			$.cookie('cookie_CityDDL', tempCityVal);
			
			///////////Check If MapTab
			if($("#propertyList").css("display") == "none") {
				if(tempBrandVal == "" && tempCountryVal == "" && tempCityVal == "") {
					alert(Message1);
					$("#map").hide(); 
					$("#staticMap").show();
					$("#googleMapLengend").hide();					
				}
				else {
					$("#staticMap").hide();	
					$("#map").show();
					map.checkResize();
					$("#googleMapLengend").show();	
				}
			}

			if(tempBrandVal != "" || tempCountryVal != "" || tempCityVal != "") { 
				resetVal = 1;
				resetList();
				filterCountry();
				filterCity();
				filterBrand();
				resetVal = 0;
				trigger = 1;
			}
		}
		
		catch(e) { }

	});//end #wmap_go BIND	
	
	wmapFuncInit(); 
	
	/* 
	///////////CACHE DDL Values
	tempCookie_BrandDDL = $.cookie('cookie_BrandDDL');
	tempCookie_CountryDDL = $.cookie('cookie_CountryDDL');
	tempCookie_CityDDL = $.cookie('cookie_CityDDL');
	*/	
			
});