// JavaScript Document Maneeram
function validate_form(formname)
	{ 
		var missinginfo="";
		if(document.frmProp.type.value=="")
		{
			missinginfo += "\n - Select the Property Type";
		}
		if(document.frmProp.name.value=="")
		{
			missinginfo += "\n - Your Name";
		}
		if(document.frmProp.email.value=="" || document.frmProp.email.value.indexOf('@',1)== -1 || document.frmProp.email.value.indexOf('.',2)==-1)
		{
			missinginfo += "\n - Email address in correct form";
		}
		if(document.frmProp.address.value=="")
		{
			missinginfo += "\n - Your Address";
		}
		if(document.frmProp.city.value=="")
		{
			missinginfo += "\n - Your City Name";
		}
		if(document.frmProp.country.value=="")
		{
			missinginfo += "\n - Your Country";
		}
		if(document.frmProp.phone.value=="")
		{
			missinginfo += "\n - Your Contact Number";
		}
		if(IsNumeric(document.frmProp.phone.value) == false)
		{
			alert("Contact No. Should be Numeric.")	
			document.frmProp.phone.focus();
			return false;
		}
		if(document.frmProp.det_prop.value=="")
		{
			missinginfo += "\n - Your Property Detail";
		}
		if(document.frmProp.loc_prop.value=="")
		{
			missinginfo += "\n - Location of Property";
		}
		if(document.frmProp.area.value=="")
		{
			missinginfo += "\n - Area measurement of Property";
		}
		if(document.frmProp.price.value=="")
		{
			missinginfo += "\n - Price of Property";
		}
		if(IsNumeric(document.frmProp.price.value) == false)
		{
			alert("Price Should be Numeric.")	
			document.frmProp.price.focus();
			return false;
		}
		if(document.frmProp.img_val.value=="")
		{
			missinginfo += "\n - Text Shown in Image";
		}
		if(missinginfo != "")
		{
			missinginfo ="_____________________________\n" +
			"Please fill in the following fields :\n" +
			missinginfo + "\n_____________________________" ;
			alert(missinginfo);
			return false; 
		}
		else
		{
			return true;
		} 
	}
function IsNumeric(strString)
   //  check for valid numeric strings	
{
var strValidChars = "0123456789.-";
var strChar;
var blnResult = true;

//if (strString.length == 0) return false;

//  test strString consists of valid characters listed above
for (i = 0; i < strString.length && blnResult == true; i++)
  {
  strChar = strString.charAt(i);
  if (strValidChars.indexOf(strChar) == -1)
	 {
	 blnResult = false;
	 }
  }
return blnResult;
}

