function Hilite(name,over)
{
	if(window.document.images) 
	{
		if (over)
			window.document.images[name].src = "http://208.106.244.183/images/" + name + "_on.gif";
		else
			window.document.images[name].src =  "http://208.106.244.183/images/" + name + ".gif";
	}
}

function val_registeruser()
{
	if(document.register.username.value == "") {
	alert("Please enter your Email Address");
	document.register.username.focus()
	return;
	}
	if(document.register.password.value == "") {
	alert("Please enter a Password");
	document.register.password.focus()
	return;
	}
	if(document.register.password.value != document.register.confirmpassword.value) {
	alert("Your passwords do not match!");
	document.register.password.focus()
	return;
	}
	document.register.submit();
}
function val_loginuser(myform)
{
	var thisform = 'document.'+ myform;
	var thisusername = 'document.'+ myform + '.username';
	var thispassword = 'document.'+ myform + '.password';
	
	if(eval(thisusername).value == "") {
	alert("Please enter your Email Address");
	eval(thisusername).focus()
	return;
	}
	if(eval(thispassword).value == "") {
	alert("Please enter a Password");
	eval(thispassword).focus()
	return;
	}	
	eval(thisform).submit();
}
function val_createlisting(){
	//alert(document.listing.cat_forsale.checked);
	//alert(document.listing.Bathrooms.options[document.listing.Bathrooms.selectedIndex].value);
	//return;
	if(document.listing.cat_forsale.checked == 0 && document.listing.cat_rentlease.checked == 0 && document.listing.cat_rentown.checked == 0) {
	alert("Please select a category.");
	document.listing.cat_forsale.focus()
	return;
	}
	if(document.listing.contact.value == "") {
	alert("Please list a contact.");
	document.listing.contact.focus()
	return;
	}
	if(document.listing.adtitle.value == "") {
	alert("Please give your Ad a Title.");
	document.listing.adtitle.focus()
	return;
	}
	if(document.listing.description.value == "") {
	alert("Please give your Ad a description.");
	document.listing.description.focus()
	return;
	}
	if(document.listing.Bedrooms.selectedIndex == 0) {
	alert("Select number of bedrooms.");
	document.listing.Bedrooms.focus()
	return;
	}
	if(document.listing.Bathrooms.selectedIndex == 0) {
	alert("Select number of bathrooms.");
	document.listing.Bathrooms.focus()
	return;
	}
	if(document.listing.price.value == "") {
	alert("Price is a required field.");
	document.listing.price.focus()
	return;
	}
	if(document.listing.address.value == "") {
	alert("Address is a required field.");
	document.listing.address.focus()
	return;
	}
	if(document.listing.city.value == "") {
	alert("City is a required field.");
	document.listing.city.focus()
	return;
	}
	if(document.listing.state.value == "") {
	alert("State is a required field.");
	document.listing.state.focus()
	return;
	}
	if(document.listing.zip.value == "") {
	alert("Zip is a required field.");
	document.listing.zip.focus()
	return;
	}
	if(document.listing.phone.value == "") {
	alert("Phone is a required field.");
	document.listing.phone.focus()
	return;
	}
	if(document.listing.email.value == "") {
	alert("Email is a required field.");
	document.listing.email.focus()
	return;
	}
	
	listing.submit();
	
}
function hideprice(){
if(document.search.propertytype.selectedIndex == 1) {
	PriceRange.style.display  = 'none';
	PriceRange2.style.display  = '';
	}
	else {PriceRange.style.display  = '';PriceRange2.style.display  = 'none';}
}

function valcontactus() {
	if(document.ContactForm.Name.value == "") {
	alert("Name is a required field.");
	document.ContactForm.Name.focus()
	return;
	}
	if(document.ContactForm.EmailAddress.value == "") {
	alert("Email is a required field.");
	document.ContactForm.EmailAddress.focus()
	return;
	}
	if(document.ContactForm.Phone.value == "") {
	alert("Phone is a required field.");
	document.ContactForm.Phone.focus()
	return;
	}
	document.ContactForm.submit();
}
function valsellitnow() {
	if(document.SellItNow.Name.value == "") {
	alert("Name is a required field.");
	document.SellItNow.Name.focus()
	return;
	}
	if(document.SellItNow.EmailAddress.value == "") {
	alert("Email is a required field.");
	document.SellItNow.EmailAddress.focus()
	return;
	}
	if(document.SellItNow.Phone.value == "") {
	alert("Phone is a required field.");
	document.SellItNow.Phone.focus()
	return;
	}
	if(document.SellItNow.Address.value == "") {
	alert("Address is a required field.");
	document.SellItNow.Address.focus()
	return;
	}
	if(document.SellItNow.City.value == "") {
	alert("City is a required field.");
	document.SellItNow.City.focus()
	return;
	}
	if(document.SellItNow.State.value == "") {
	alert("State is a required field.");
	document.SellItNow.State.focus()
	return;
	}
	if(document.SellItNow.ZipCode.value == "") {
	alert("Zip Code is a required field.");
	document.SellItNow.ZipCode.focus()
	return;
	}
	if(document.SellItNow.Mortgage.value == "") {
	alert("Mortgage Amount is a required field.");
	document.SellItNow.Mortgage.focus()
	return;
	}
	if(document.SellItNow.Why.value == "") {
	alert("Why are you selling is a required field.");
	document.SellItNow.Why.focus()
	return;
	}
	if(document.SellItNow.County.selectedIndex == 0) {
	alert("County is a required field.");
	document.SellItNow.County.focus()
	return;
	}
	document.SellItNow.submit();
}					 
					 