function checkForm(obj){
	if(obj.purchase_select.value== -1 ){
		alert("Please select the option");
		obj.purchase_select.focus();
		return false;
	}
	else if(obj.other_select.value== -1 ){
		alert("Please select the option");
		obj.other_select.focus();
		return false;
	}
	else if(obj.other_select.value== -1 ){
		alert("Please select the option");
		obj.other_select.focus();
		return false;
	}
	else if(obj.min_price.value=='' ){
		alert("Please enter the minimum price");
		obj.min_price.focus();
		return false;
	}
	else if(obj.max_price.value=='' ){
		alert("Please enter the maximum price");
		obj.max_price.focus();
		return false;
	}
	else if(obj.min_size.value=='' ){
		alert("Please enter the minimum size");
		obj.min_size.focus();
		return false;
	}
	else if(obj.max_size.value=='' ){
		alert("Please enter the maximum size");
		obj.max_size.focus();
		return false;
	}
	else if(obj.min_bedroom.value==-1 ){
		alert("Please select the option");
		obj.min_bedroom.focus();
		return false;
	}
	else if(obj.min_bathroom.value==-1 ){
		alert("Please select the option");
		obj.min_bathroom.focus();
		return false;
	}
	else if(obj.first_name.value=='' ){
		alert("Please enter the first name");
		obj.first_name.focus();
		return false;
	}
	else if(obj.last_name.value=='' ){
		alert("Please enter the last name");
		obj.last_name.focus();
		return false;
	}
	else if(obj.address.value=='' ){
		alert("Please enter the address");
		obj.address.focus();
		return false;
	}
	else if(obj.post_code.value=='' ){
		alert("Please enter the postal code");
		obj.post_code.focus();
		return false;
	}
	else if(obj.city.value=='' ){
		alert("Please enter the city");
		obj.city.focus();
		return false;
	}
	else if(obj.country.value=='' ){
		alert("Please enter the country");
		obj.country.focus();
		return false;
	}
	else if(obj.phone.value=='' ){
		alert("Please enter the phone number");
		obj.phone.focus();
		return false;
	}
	else if(obj.email.value=='' ){
		alert("Please enter the email id ");
		obj.email.focus();
		return false;
	}
	else if(!isEmail(obj.email.value)){
		alert("Please enter the valid email id ");
		obj.email.focus();
		return false;
	}

	else{
		return true;
	}
}


function isEmail(mailstr)
{
	a = mailstr.indexOf(".");
	b = mailstr.indexOf("@");
	c = mailstr.indexOf(" ");
	d = mailstr.lastIndexOf(".");
	e = mailstr.length;
	if( (a == -1) || (b == -1) || (c != -1) || (d < b) || ( d == e - 1) || (b+1 == a) )
		return false;
	else
		return true;
}
