// Left Hand Column email form validation
function checkEmail(){
	var myForm = document.form1;
	var myString=myForm.email.value;
	var foundAtPosition=0;
	var emailCount1=0;	
	
	// Checks for a valid email address
	if(myForm.email.value == "")
 	{
  		alert('Please enter your email address');
  		myForm.email.focus();
  		return false;
 	}
 	else
 	{
  		while(foundAtPosition != -1)
  		{
   			foundAtPosition=myString.indexOf("@",foundAtPosition);

   			if(foundAtPosition != -1)
   			{
				emailCount1++;
				foundAtPosition++;
   			}
  		}
 	}

 	if(emailCount1 == 0)
 	{
 	 alert('Please enter a valid email address');
 	 myForm.email.focus();
 	 myForm.email.select();
 	 return false;
  	}
}

// Contact page form validation
function checkEnquiry(){
	var myForm = document.form2;
	var myString=myForm.contactemail.value;
	var foundAtPosition=0;
	var emailCount1=0;	
	
	if(document.form2.company.value == ""){
			alert('Please enter a company name');
			document.form2.company.focus();
			document.form2.company.select();
			return false;
	}
	
	if(document.form2.firstname.value == ""){
			alert('Please enter a your name');
			document.form2.firstname.focus();
			document.form2.firstname.select();
			return false;
	}
	if(document.form2.mobile.value == ""){
			alert('Please enter your mobile number');
			document.form2.mobile.focus();
			document.form2.mobile.select();
			return false;
	}
	else{
		if(isNaN(document.form2.mobile.value) == true){
			alert('Please enter a valid mobile number');
			document.form2.mobile.focus();
			document.form2.mobile.select();
			return false;
			}
	}
	if(document.form2.contactemail.value == ""){
			alert('Please enter your email address');
			document.form2.contactemail.focus();
			document.form2.contactemail.select();
			return false;
	}else{
  		while(foundAtPosition != -1)
  		{
   			foundAtPosition=myString.indexOf("@",foundAtPosition);

   			if(foundAtPosition != -1)
   			{
				emailCount1++;
				foundAtPosition++;
   			}
  		}
 	}

 	if(emailCount1 == 0)
 	{
 	 alert('Please enter a valid email address');
 	 myForm.contactemail.focus();
 	 myForm.contactemail.select();
 	 return false;
  	}
	
	if(document.form2.requirement.value == "--- Select Your Requirement ---"){
			alert('Please select your requirement');
			return false;
	}
}

// Change header image
function changeDiv(){
 document.getElementById('propimages').innerHTML = "<img src='images/pc-wharehouse.jpg' width='368' height='133' />";
 window.setTimeout("changeDiv1()", 9000);
}

function changeDiv1(){
 document.getElementById('propimages').innerHTML = "<img src='images/pc-property1.jpg' width='368' height='133' />";
 window.setTimeout("changeDiv2()", 9000);
}

function changeDiv2(){
 document.getElementById('propimages').innerHTML = "<img src='images/pc-property2.jpg' width='368' height='133' />";
 window.setTimeout("changeDivBack()", 9000);
}

function changeDivBack(){
 document.getElementById('propimages').innerHTML = "<img src='images/pc-property3.jpg' width='368' height='133' />";
 window.setTimeout("changeDiv()", 9000);
}

//Close Window
function closeWin(){
	window.close();
	}


