// JavaScript Document

function focus()
{
document.contact_form.contact_name.focus();
}

function validate_form ( )
{
	valid = true;
	
			if ( document.contact_form.address.value == "" )
        {
                alert ( "Please Enter The Property Address" );
                valid = false;
	   document.contact_form.address.focus();return(false) 
        }
		
				
		if ( document.contact_form.city.value == "" )
        {
                alert ( "Please Enter Area/City of Property" );
                valid = false;
	   document.contact_form.city.focus();return(false) 
        }
		
		if ( document.contact_form.postcode.value == "" )
        {
                alert ( "Please Enter Post Code of Property" );
                valid = false;
	   document.contact_form.postcode.focus();return(false) 
        }			
		
		
		if ( document.contact_form.propertytype.value == "" )
        {
                alert ( "Please Enter Type of Property" );
                valid = false;
	   document.contact_form.propertytype.focus();return(false) 
        }
		
	
		if ( document.contact_form.bedroom.value == "" )
        {
                alert ( "Please Enter The Number of Room" );
                valid = false;
	   document.contact_form.bedroom.focus();return(false) 
        }
		

        if ( document.contact_form.subject.value == "" )
        {
                alert ( "Please fill in the request" );
                valid = false;
	   document.contact_form.subject.focus();return(false) 
        }
		
		      if ( document.contact_form.title.selectedIndex == 0 )
        {
                alert ( "Please select a Title" );
                valid = false;
	            return(false);
        }
		
		 if ( document.contact_form.name.value == "" )
        {
                alert ( "Please Enter Your Full Name" );
                valid = false;
	   document.contact_form.name.focus();return(false) 
        }
		
		if(document.contact_form.email.value == "")
	{
		alert('Please enter your email');
		valid = false;
		document.contact_form.email.focus();return(false)
		
	}
				if ( document.contact_form.hphone.value == "" )
        {
                alert ( "Please Enter Your Home Phone Number" );
                valid = false;
	   document.contact_form.hphone.focus();return(false) 
        }
		
		if ( document.contact_form.mobile.value == "" )
        {
                alert ( "Please Enter Your Mobile Number" );
                valid = false;
	   document.contact_form.mobile.focus();return(false) 
        }
	
	
		if ( document.contact_form.message.value == "" )
        {
                alert ( "Please Enter Messages.." );
                valid = false;
	   document.contact_form.message.focus();return(false) 
        }	
		
        return valid;
}
function MM_validateForm() { //v4.0
  if (document.getElementById){
    var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
    for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=document.getElementById(args[i]);
      if (val) { nm=val.name; if ((val=val.value)!="") {
        if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
          if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
        } else if (test!='R') { num = parseFloat(val);
          if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
          if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
            min=test.substring(8,p); max=test.substring(p+1);
            if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
      } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
    } if (errors) alert('The following error(s) occurred:\n'+errors);
    document.MM_returnValue = (errors == '');
} }