// JavaScript Document
function check_from(){
	if(document.property_search.location.value==''){
	document.property_search.location.focus();
	return false;
	}	
	if(document.property_search.types2.value==''){
	document.property_search.types2.focus();
	return false;
	}	
	
}
function isEmailAddr(email)
{
	var result = false;
	var theStr = new String(email);
	var index = theStr.indexOf("@");
	if (index > 0)
	{
		var pindex = theStr.indexOf(".",index);
		if ((pindex > index+1) && (theStr.length > pindex+1))
		result = true;
	}
	return result;
}
function checkService(obj)
{
	if(obj.c_name.value==""){
		alert('Please enter your name.');
		obj.c_name.focus();
		return false;
	}
	if(obj.phone.value==""){
		alert('Please enter Phone number.');
		obj.phone.focus();
		return false;
	}
	if(obj.phone.value==""){
		alert('Please enter Phone number.');
		obj.phone.focus();
		return false;
	}
	
	if(obj.email.value !=""){
		if(isEmailAddr(obj.email.value) == false){
		alert('Please enter valid Email address.');
		obj.email.focus();
		return false;
		}
	}
	
	if(obj.ServiceRequested.value==""){
		alert('Please write any thing you need to ask about property.');
		obj.ServiceRequested.focus();
		return false;
	}
	if(obj.captcha.value==""){
		alert('Please enter Security Code');
		obj.captcha.focus();
		return false;
	}
	
}
