function isBlank(p)
		 {
			var len = p.length;
			var i;
			for(i = 0; i < len ; ++i)
				{
					if (p.charAt(i) != ' ')
					return false;
				}
			return true;
		}
function Email(str)
		{
			var supported = 0;
			if (window.RegExp)
			{
			var tStr = "a";
			var tReg = new RegExp(tStr);
			if (tReg.test(tStr)) supported = 1;
			}
			if (!supported)
			return (str.indexOf(".") <= 4) || (str.indexOf("@") < 0);
			var r1 = new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)");
			var r2 = new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$");
			return (r1.test(str) || !r2.test(str));
		}


function CheckNumeric()
{
   // Get ASCII value of key pressed
   var key = window.event.keyCode;

   // Was key that was pressed a numeric character (0-9 and .)?
   if ( key >45 && key <58)
      //document.write(key);
	  return; // if so, do nothing
   else 
   //document.write(key);
     window.event.returnValue = null; // otherwise, 
	                               // discard character
	
}

//////////////////////////////////////////// change  password  /////////////////////////////
function checkpass()
{
					if (document.frm_chpass.oldpass.value==0)
					{
					alert("Please enter old password");
					document.frm_chpass.oldpass.focus();
					document.frm_chpass.oldpass.select();
					return false;
					}
					if (document.frm_chpass.newpass.value==0)
					{
					alert("Please enter new password");
					document.frm_chpass.newpass.focus();
					document.frm_chpass.newpass.select();
					return false;
					}
					if (document.frm_chpass.confirmpass.value==0)
					{
					alert("Please confirm your password");
					document.frm_chpass.confirmpass.focus();
					document.frm_chpass.confirmpass.select();
					return false;
					}
					if ((document.frm_chpass.confirmpass.value) != (document.frm_chpass.newpass.value))
					{
					alert("Password mismatch Retype password");
					document.frm_chpass.confirmpass.focus();
					document.frm_chpass.confirmpass.select();
					return false;
					}
					document.frm_chpass.submit();
}


////------------------- search property + after enquiry---------------------/////
function enquiryform()
{
			if (document.frm_enquiry.name.value==0)
			{
			alert("Please Enter your Full Name");
			document.frm_enquiry.name.focus();
			document.frm_enquiry.name.select();
			return false;
			}
			if (Email(document.frm_enquiry.email.value))
			{
			alert("Please Enter your Email Id");
			document.frm_enquiry.email.focus();
			document.frm_enquiry.email.select();
			return false;
			}	
			if (document.frm_enquiry.phone.value==0)
			{
			alert("Please Enter your Contact No.");
			document.frm_enquiry.phone.focus();
			document.frm_enquiry.phone.select();
			return false;
			}
			if (document.frm_enquiry.comments.value==0)
			{
			alert("Please Descripe your requirement/comments");
			document.frm_enquiry.comments.focus();
			document.frm_enquiry.comments.select();
			return false;
			}								
	document.frm_enquiry.submit();
}
////------------------- search property + after enquiry---------------------/////

////------------------- Post property page validation---------------------/////
function postyourproperty()
{
			if (document.frm_properties.name.value==0)
			{
			alert("Please Enter your Full Name");
			document.frm_properties.name.focus();
			document.frm_properties.name.select();
			return false;
			}
			if (document.frm_properties.contactno.value==0)
			{
			alert("Please Enter your Contact No.");
			document.frm_properties.contactno.focus();
			document.frm_properties.contactno.select();
			return false;
			}
			if (Email(document.frm_properties.email.value))
			{
			alert("Please Enter your Email Id");
			document.frm_properties.email.focus();
			document.frm_properties.email.select();
			return false;
			}
			if (document.frm_properties.address.value==0)
			{
			alert("Please Enter your Address");
			document.frm_properties.address.focus();
			document.frm_properties.address.select();
			return false;
			}
			if (document.frm_properties.property_address.value==0)
			{
			alert("Please Enter your Property Address");
			document.frm_properties.property_address.focus();
			document.frm_properties.property_address.select();
			return false;
			}
			if (document.frm_properties.property_category.value==0)
			{
			alert("Please Enter your Property Category");
			document.frm_properties.property_category.focus();
			document.frm_properties.property_category.select();
			return false;
			}			
			if (document.frm_properties.property_type.value==0)
			{
			alert("Please Enter your Property Type");
			document.frm_properties.property_type.focus();
			document.frm_properties.property_type.select();
			return false;
			}
			if (document.frm_properties.property_description.value==0)
			{
			alert("Please Enter your Property Description");
			document.frm_properties.property_description.focus();
			document.frm_properties.property_description.select();
			return false;
			}
			if (document.frm_properties.land_area.value==0)
			{
			alert("Please Enter your Land Area");
			document.frm_properties.land_area.focus();
			document.frm_properties.land_area.select();
			return false;
			}
			if (document.frm_properties.buildup_area.value==0)
			{
			alert("Please Enter your Buildup Area");
			document.frm_properties.buildup_area.focus();
			document.frm_properties.buildup_area.select();
			return false;
			}
			if (document.frm_properties.furnishing.value==0)
			{
			alert("Please Select Furnishing Type");
			document.frm_properties.furnishing.focus();
			document.frm_properties.furnishing.select();
			return false;
			}
			if (document.frm_properties.rental.value==0)
			{
			alert("Please Specify your rental");
			document.frm_properties.rental.focus();
			document.frm_properties.rental.select();
			return false;
			}
			if (document.frm_properties.aboutus.value==0)
			{
			alert("Please Specify About Me");
			document.frm_properties.aboutus.focus();
			document.frm_properties.aboutus.select();
			return false;
			}																					

			
	document.frm_properties.submit();
}
////------------------- Post property page validation---------------------/////
