	function SubmitForm(frm)
	{
			var rdPropertyTypeSelectedIndex = -1;
			for (i=0;i<document.frmTopMarketerWidget.rdPropertyType.length; i++)
			 {
					if (document.frmTopMarketerWidget.rdPropertyType[i].checked)
					 {
					rdPropertyTypeSelectedIndex = document.frmTopMarketerWidget.rdPropertyType[i].value;
					break;
					 }
			 }
		document.frmTopMarketerWidget.hidPropertyType.value = rdPropertyTypeSelectedIndex;

		if (frm.Address.value == "" || frm.Address.value==' - Street Address - ')
		{
			alert('Please enter Street Address');
			if (frm.Address.value == "" )
			{
				  frm.Address.value="";
			}
			frm.Address.focus();
			return false;
		}

		if ((validateUSZip(frm.ZipCode.value) == false) || (frm.ZipCode.value == ' - Zip Code - '))
		{
			alert('Please enter a valid Zip Code');
			frm.ZipCode.focus();
			return false;
		}
		return true;
	}

	function checkForm(frm) {

		var retVal = true
		var minPriceValue = frm.mnprice.options[frm.mnprice.selectedIndex].value
		var maxPriceValue = frm.mxprice.options[frm.mxprice.selectedIndex].value
		if ((frm.zp.value == ' - Zip/Postal Code - ') || (frm.zp.value == ''))
		{
			if (frm.ct.value == '' || frm.ct.value == ' - Enter a City - ') {
				alert("Please Enter A City and State/Province or a valid ZIP/Postal Code");
				frm.ct.focus();
				return false;
			}
			if (frm.st.selectedIndex == '') {
				alert("Please Select a State/Province or enter a valid ZIP/Postal Code");
				frm.st.focus();
				return false;
			}
		}

		if(minPriceValue != '' && maxPriceValue != '') {
			var minPrice = parseInt(minPriceValue)
			var maxPrice = parseInt(maxPriceValue)
			if(minPrice > maxPrice  &&  maxPrice > 0) {
				alert('You have selected a minimum price ($' + minPrice + ') greater than your maximum price ($' + maxPrice + ').\n\nMaximum price should be greater than minimum price in order to find listings.\nSee "Price Range" on this page.\n\nPlease correct this before continuing.');
				frm.mnprice.focus();
				retVal = false;
			}
			else {
				if(minPrice == maxPrice  &&  maxPrice > 0) {
					retVal = confirm('You have selected a minimum price that is equal to your maximum price ($' + maxPrice + ').\nThis will cause your search to find ONLY listings with a current list price of EXACTLY $' + maxPrice + '.\n\nIs this okay?');
				}
			}
		}

		if (frm.zp.value != ' - Zip/Postal Code - ')
		{
			if (frm.ct.value == ' - Enter a City - ' || frm.st.options[frm.st.selectedIndex].value == 'State/Province')
			{
				if (frm.zp.value.length < 5 || (frm.zp.value.length == 5 && isNaN(frm.zp.value)))
				{
					alert('Please enter a valid ZIP/Postal Code before submitting.');
					frm.zp.focus();
					return false;
				}
				frm.frm.value = 'byzip';
			}
			else {
				frm.frm.value    = 'bymap';
				frm.target.value = frm.action;
				frm.action       = 'http://www.realtor.com/FindHome/RedirAreaID.asp';
			}
		}
		else {
			frm.frm.value    = 'bymap';
			frm.target.value = frm.action;
			frm.action       = 'http://www.realtor.com/FindHome/RedirAreaID.asp';
		}
		if (frm.zp.value == ' - Zip/Postal Code - ') {
			frm.zp.value = '';
		}
		if (frm.ct.value == ' - Enter a City - ') {
			frm.ct.value = '';
		}
		if (frm.st.options[frm.st.selectedIndex].value == "State/Province") {
			frm.st.options[frm.st.selectedIndex].value = '';
		}
		if (frm.st.selectedIndex == '1') {
			frm.st.value = '';
		}
		if(retVal  &&  navigator.userAgent.indexOf('AOL') == -1  &&  navigator.userAgent.indexOf('MSIE 3') == -1)
			frm.js.value = 'on';
		return retVal;
	}

	function altSubmit() {
	    if (document.frmSearch.ct.value == " - Enter a City - ")
	    {
	        document.frmSearch.ct.value = '';
	    }
	    if (document.frmSearch.zp.value == " - Zip/Postal Code - ")
	    {
	        document.frmSearch.zp.value = '';
	    }

		if (document.frmSearch.zp.value != '')
		{
			document.frmSearch.frm.value = 'byzip';
		}
		document.frmSearch.js.value = 'on';
		document.frmSearch.lnksrc.value = 'RDC-NAV-0016';
		document.frmSearch.action = 'http://www.realtor.com/FindHome/SearchOptions.asp';
		document.frmSearch.submit();
	}

	function validateUSZip( strValue ) {
		/************************************************
		DESCRIPTION: Validates that a string a United
		  States Zip Code in 5 digit format

		PARAMETERS:
		   strValue - String to be tested for validity

		RETURNS:
		   True if valid, otherwise false.

		*************************************************/
		var objRegExp  = /(^\d{5}$)/;
		//check for valid US Zipcode
		return objRegExp.test(strValue);
	}