
function mySearch()
{
	var strCustomFieldIDs = [];
	var strSearchValues = [];	//var strSearchValues = "";
	//var strCustomFieldIDs = "";
	var isSelected = "false";
	var isTo = "false";
	var elSuburb = document.getElementById("dnn_ctr37935_SearchSmall_180");
	if(elSuburb != null)
	{
	for (var i=0; i < elSuburb.length; i++) {
		if(elSuburb.options[i].selected == true)
		{
			if(elSuburb.options[i].value != "-1")
			{
				strCustomFieldIDs.push("180");
				strSearchValues.push(elSuburb.options[i].value + ",");
			}
		}
	}
	}
	
	elSuburb = document.getElementById("dnn_ctr37935_SearchSmall_From182");
	if(elSuburb != null)
	{
	for (var i=0; i < elSuburb.length; i++) {
		if(elSuburb.options[i].selected == true)
		{
			if(elSuburb.options[i].value != "-1")
			{
				strCustomFieldIDs.push("182");
				strSearchValues.push(elSuburb.options[i].value + "%7c");
				isTo = "true";
			}
		}
	}
	}
	
	elSuburb2 = document.getElementById("dnn_ctr37935_SearchSmall_To182");
	if(elSuburb2 != null)
	{
	for (var i=0; i < elSuburb2.length; i++) {
		if(elSuburb2.options[i].selected == true)
		{
			if(elSuburb2.options[i].value != "-1") {
				if(isTo == "true") {
					strSearchValues.push(elSuburb2.options[i].value);
				}
				else {
					strCustomFieldIDs.push("182");
					strSearchValues.push("%7c" + elSuburb2.options[i].value);
				}
			}
		}
	}
	}
	
	elSuburb = document.getElementById("ddl1");
	if(elSuburb != null)
	{
	for (var i=0; i < elSuburb.length; i++) {
		if(elSuburb.options[i].selected == true) {
		    if (elSuburb.options[i].value == "1") {
		        strCustomFieldIDs.push("183");
		        strSearchValues.push("1");
		    }
		    else if (elSuburb.options[i].value == "1+") {
		        strCustomFieldIDs.push("183");
		        strSearchValues.push("1%7c1%2b%7c2%7c2%2b%7c3%7c3%2b%7c4%7c4%2b%7c5%7c5%2b");
		    }
		    else if (elSuburb.options[i].value == "2") {
		        strCustomFieldIDs.push("183");
		        strSearchValues.push("2");
		    }
		    else if (elSuburb.options[i].value == "2+") {
		        strCustomFieldIDs.push("183");
		        strSearchValues.push("2%7c2%2b%7c3%7c3%2b%7c4%7c4%2b%7c5%7c5%2b");
		    }
		    else if (elSuburb.options[i].value == "3") {
		        strCustomFieldIDs.push("183");
		        strSearchValues.push("3");
		    }
		    else if (elSuburb.options[i].value == "3+") {
		        strCustomFieldIDs.push("183");
		        strSearchValues.push("3%7c3%2b%7c4%7c4%2b%7c5%7c5%2b");
		    }
		    else if (elSuburb.options[i].value == "4") {
		        strCustomFieldIDs.push("183");
		        strSearchValues.push("4");
		    }
		    else if (elSuburb.options[i].value == "4+") {
		        strCustomFieldIDs.push("183");
		        strSearchValues.push("4%7c4%2b%7c5%7c5%2b");
		    }
		    else if (elSuburb.options[i].value == "5") {
		        strCustomFieldIDs.push("183");
		        strSearchValues.push("5");
		    }
		    else if (elSuburb.options[i].value == "5+") {
		        strCustomFieldIDs.push("183");
		        strSearchValues.push("5%7c5%2b");
		    }
		}
	}
	}
		
		elSuburb = document.getElementById("ddl2");
		if(elSuburb != null)
		{
		for (var i=0; i < elSuburb.length; i++) {
		if(elSuburb.options[i].selected == true)
		{
		    if (elSuburb.options[i].value == "1") {
		        strCustomFieldIDs.push("184");
		        strSearchValues.push(",1");
		    }
		    else if (elSuburb.options[i].value == "1+") {
		        strCustomFieldIDs.push("184");
		        strSearchValues.push(",1%7c1%2b%7c2%7c2%2b%7c3%7c3%2b%7c4%7c4%2b%7c5%7c5%2b");
		    }
		    else if (elSuburb.options[i].value == "2") {
		        strCustomFieldIDs.push("184");
		        strSearchValues.push(",2");
		    }
		    else if (elSuburb.options[i].value == "2+") {
		        strCustomFieldIDs.push("184");
		        strSearchValues.push(",2%7c2%2b%7c3%7c3%2b%7c4%7c4%2b%7c5%7c5%2b");
		    }
		    else if (elSuburb.options[i].value == "3") {
		        strCustomFieldIDs.push("184");
		        strSearchValues.push(",3");
		    }
		    else if (elSuburb.options[i].value == "3+") {
		        strCustomFieldIDs.push("184");
		        strSearchValues.push(",3%7c3%2b%7c4%7c4%2b%7c5%7c5%2b");
		    }
		    else if (elSuburb.options[i].value == "4") {
		        strCustomFieldIDs.push("184");
		        strSearchValues.push(",4");
		    }
		    else if (elSuburb.options[i].value == "4+") {
		        strCustomFieldIDs.push("184");
		        strSearchValues.push(",4%7c4%2b%7c5%7c5%2b");
		    }
		    else if (elSuburb.options[i].value == "5") {
		        strCustomFieldIDs.push("184");
		        strSearchValues.push(",5");
		    }
		    else if (elSuburb.options[i].value == "5%2b") {
		        strCustomFieldIDs.push("184");
		        strSearchValues.push(",5%7c5%2b");
		    }
		}
	}
		}
		
		elSuburb = document.getElementById("ddl3");
		if(elSuburb != null)
		{
	for (var i=0; i < elSuburb.length; i++) {
		if(elSuburb.options[i].selected == true)
		{
		    if (elSuburb.options[i].value == "1") {
		        strCustomFieldIDs.push("185");
		        strSearchValues.push(",1");
		    }
		    else if (elSuburb.options[i].value == "1+") {
		        strCustomFieldIDs.push("185");
		        strSearchValues.push(",1%7c1%2b%7c2%7c2%2b%7c3%7c3%2b%7c4%7c4%2b%7c5%7c5%2b");
		    }
		    else if (elSuburb.options[i].value == "2") {
		        strCustomFieldIDs.push("185");
		        strSearchValues.push(",2");
		    }
		    else if (elSuburb.options[i].value == "2+") {
		        strCustomFieldIDs.push("185");
		        strSearchValues.push(",2%7c2%2b%7c3%7c3%2b%7c4%7c4%2b%7c5%7c5%2b");
		    }
		    else if (elSuburb.options[i].value == "3") {
		        strCustomFieldIDs.push("185");
		        strSearchValues.push(",3");
		    }
		    else if (elSuburb.options[i].value == "3+") {
		        strCustomFieldIDs.push("185");
		        strSearchValues.push(",3%7c3%2b%7c4%7c4%2b%7c5%7c5%2b");
		    }
		    else if (elSuburb.options[i].value == "4") {
		        strCustomFieldIDs.push("185");
		        strSearchValues.push(",4");
		    }
		    else if (elSuburb.options[i].value == "4+") {
		        strCustomFieldIDs.push("185");
		        strSearchValues.push(",4%7c4%2b%7c5%7c5%2b");
		    }
		    else if (elSuburb.options[i].value == "5") {
		        strCustomFieldIDs.push("185");
		        strSearchValues.push(",5");
		    }
		    else if (elSuburb.options[i].value == "5%2b") {
		        strCustomFieldIDs.push("185");
		        strSearchValues.push(",5%7c5%2b");
		    }
		}
	}
		}
	var s = "";
	if(strCustomFieldIDs.length > 0)
	{
		s = "?CustomFieldIDs=";
		for (var i=0; i <strCustomFieldIDs.length-1; i++)
		{
			s = s + strCustomFieldIDs[i] + ",";
		}
		s =s + strCustomFieldIDs[strCustomFieldIDs.length-1];
	}
	
	if(strSearchValues.length > 0)
	{
		s = s + "&SearchValues=";
		for (var i=0; i <strSearchValues.length-1; i++)
		{
			s = s + strSearchValues[i];
		}
		s =s + strSearchValues[strSearchValues.length-1];
	}
	
	window.location="http://www.bronwynkay.com/NewBuying/tabid/25312/agentType/ViewSearch/Default.aspx" + s;
}
function mySearchLN() {
    var elSuburb = document.getElementById("dl20");
    if (elSuburb.value.length > 0) {
        window.location = "http://www.bronwynkay.com/NewBuying/tabid/25312/agentType/ViewSearch/CustomFieldIDs/196/SearchValues/" + elSuburb.value + "/Default.aspx";
    } else {
        window.location = "http://www.bronwynkay.com/NewBuying/tabid/25312/agentType/ViewSearch/Default.aspx"
    }
}
