

//Begin script to check signup forms

function signupvalidationrightcolumn()
{

	function echeck(str) {

			var at="@"
			var dot="."
			var lat=str.indexOf(at)
			var lstr=str.length
			var ldot=str.indexOf(dot)
			if (str.indexOf(at)==-1){
			   alert("Please enter a Valid Email Address")
			   return false
			}

			if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
			   alert("Please enter a Valid Email Address")
			   return false
			}

			if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
				alert("Please enter a Valid Email Address")
				return false
			}

			 if (str.indexOf(at,(lat+1))!=-1){
				alert("Please enter a Valid Email Address")
				return false
			 }

			 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
				alert("Please enter a Valid Email Address")
				return false
			 }

			 if (str.indexOf(dot,(lat+2))==-1){
				alert("Please enter a Valid Email Address")
				return false
			 }
			
			 if (str.indexOf(" ")!=-1){
				alert("Please enter a Valid Email Address")
				return false
			 }

			 return true					
		}
		
		
	
	if (document.rightcolumnsignup.suburb.value=='')
	{
		alert("Please Enter Your Suburb");
		document.rightcolumnsignup.suburb.focus();
		return false;
	}

	if (document.rightcolumnsignup.postcode.value=='')
	{
		alert("Please Enter Your Postcode");
		document.rightcolumnsignup.postcode.focus();
		return false;
	}
	
	if (document.rightcolumnsignup.name.value=='')
	{
		alert("Please Enter Your Name");
		document.rightcolumnsignup.name.focus();
		return false;
	}


	if (document.rightcolumnsignup.email.value=='')
	{
		alert("Please Enter Your Email Address");
		document.rightcolumnsignup.email.focus();
		return false;
	}

	if (echeck(document.rightcolumnsignup.email.value)==false)
	{
		document.rightcolumnsignup.email.focus(); 
		return false;
	}

	if (document.rightcolumnsignup.phone.value=='' && document.rightcolumnsignup.mobile.value=='')
	{
		alert("Please Enter Your Phone or Mobile number");
		document.rightcolumnsignup.phone.focus();
		return false;
	}
	
	if (document.rightcolumnsignup.home_length.value=='')
	{
		alert("Please Enter the Length of Your Home");
		document.rightcolumnsignup.home_length.focus();
		return false;
	}
	
	if (document.rightcolumnsignup.home_width.value=='')
	{
		alert("Please Enter the Width of Your Home");
		document.rightcolumnsignup.home_width.focus();
		return false;
	}




}

// End script
// -->

/****************************************************************************************************************/
/****************************************************************************************************************/
/****************************************************************************************************************/


function signupvalidationmiddleform()
{

	function echeck(str) {

			var at="@"
			var dot="."
			var lat=str.indexOf(at)
			var lstr=str.length
			var ldot=str.indexOf(dot)
			if (str.indexOf(at)==-1){
			   alert("Please enter a Valid Email Address")
			   return false
			}

			if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
			   alert("Please enter a Valid Email Address")
			   return false
			}

			if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
				alert("Please enter a Valid Email Address")
				return false
			}

			 if (str.indexOf(at,(lat+1))!=-1){
				alert("Please enter a Valid Email Address")
				return false
			 }

			 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
				alert("Please enter a Valid Email Address")
				return false
			 }

			 if (str.indexOf(dot,(lat+2))==-1){
				alert("Please enter a Valid Email Address")
				return false
			 }
			
			 if (str.indexOf(" ")!=-1){
				alert("Please enter a Valid Email Address")
				return false
			 }

			 return true					
		}
		
		
	
	if (document.middleform.suburb.value=='')
	{
		alert("Please Enter Your Suburb");
		document.middleform.suburb.focus();
		return false;
	}

	if (document.middleform.postcode.value=='')
	{
		alert("Please Enter Your Postcode");
		document.middleform.postcode.focus();
		return false;
	}
	
	if (document.middleform.name.value=='')
	{
		alert("Please Enter Your Name");
		document.middleform.name.focus();
		return false;
	}


	if (document.middleform.email.value=='')
	{
		alert("Please Enter Your Email Address");
		document.middleform.email.focus();
		return false;
	}

	if (echeck(document.middleform.email.value)==false)
	{
		document.middleform.email.focus(); 
		return false;
	}

	if (document.middleform.phone.value=='' && document.middleform.mobile.value=='')
	{
		alert("Please Enter Your Phone or Mobile number");
		document.middleform.phone.focus();
		return false;
	}
	
	if (document.middleform.home_length.value=='')
	{
		alert("Please Enter the Length of Your Home");
		document.middleform.home_length.focus();
		return false;
	}
	
	if (document.middleform.home_width.value=='')
	{
		alert("Please Enter the Width of Your Home");
		document.middleform.home_width.focus();
		return false;
	}




}

// End script
// -->

/****************************************************************************************************************/
/****************************************************************************************************************/
/****************************************************************************************************************/


function signupvalidationbottomform()
{

	function echeck(str) {

			var at="@"
			var dot="."
			var lat=str.indexOf(at)
			var lstr=str.length
			var ldot=str.indexOf(dot)
			if (str.indexOf(at)==-1){
			   alert("Please enter a Valid Email Address")
			   return false
			}

			if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
			   alert("Please enter a Valid Email Address")
			   return false
			}

			if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
				alert("Please enter a Valid Email Address")
				return false
			}

			 if (str.indexOf(at,(lat+1))!=-1){
				alert("Please enter a Valid Email Address")
				return false
			 }

			 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
				alert("Please enter a Valid Email Address")
				return false
			 }

			 if (str.indexOf(dot,(lat+2))==-1){
				alert("Please enter a Valid Email Address")
				return false
			 }
			
			 if (str.indexOf(" ")!=-1){
				alert("Please enter a Valid Email Address")
				return false
			 }

			 return true					
		}
		
		
	
	if (document.bottomform.suburb.value=='')
	{
		alert("Please Enter Your Suburb");
		document.bottomform.suburb.focus();
		return false;
	}

	if (document.bottomform.postcode.value=='')
	{
		alert("Please Enter Your Postcode");
		document.bottomform.postcode.focus();
		return false;
	}
	
	if (document.bottomform.name.value=='')
	{
		alert("Please Enter Your Name");
		document.bottomform.name.focus();
		return false;
	}


	if (document.bottomform.email.value=='')
	{
		alert("Please Enter Your Email Address");
		document.bottomform.email.focus();
		return false;
	}

	if (echeck(document.bottomform.email.value)==false)
	{
		document.bottomform.email.focus(); 
		return false;
	}

	if (document.bottomform.phone.value=='' && document.middleform.mobile.value=='')
	{
		alert("Please Enter Your Phone or Mobile number");
		document.bottomform.phone.focus();
		return false;
	}
	
	if (document.bottomform.home_length.value=='')
	{
		alert("Please Enter the Length of Your Home");
		document.bottomform.home_length.focus();
		return false;
	}
	
	if (document.bottomform.home_width.value=='')
	{
		alert("Please Enter the Width of Your Home");
		document.bottomform.home_width.focus();
		return false;
	}




}

// End script
// -->

/****************************************************************************************************************/
/****************************************************************************************************************/
/****************************************************************************************************************/


function signupvalidationpopup()
{

	function echeck(str) {

			var at="@"
			var dot="."
			var lat=str.indexOf(at)
			var lstr=str.length
			var ldot=str.indexOf(dot)
			if (str.indexOf(at)==-1){
			   alert("Please enter a Valid Email Address")
			   return false
			}

			if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
			   alert("Please enter a Valid Email Address")
			   return false
			}

			if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
				alert("Please enter a Valid Email Address")
				return false
			}

			 if (str.indexOf(at,(lat+1))!=-1){
				alert("Please enter a Valid Email Address")
				return false
			 }

			 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
				alert("Please enter a Valid Email Address")
				return false
			 }

			 if (str.indexOf(dot,(lat+2))==-1){
				alert("Please enter a Valid Email Address")
				return false
			 }
			
			 if (str.indexOf(" ")!=-1){
				alert("Please enter a Valid Email Address")
				return false
			 }

			 return true					
		}
		
		
	
	if (document.popup.suburb.value=='')
	{
		alert("Please Enter Your Suburb");
		document.popup.suburb.focus();
		return false;
	}

	if (document.popup.postcode.value=='')
	{
		alert("Please Enter Your Postcode");
		document.popup.postcode.focus();
		return false;
	}
	
	if (document.popup.name.value=='')
	{
		alert("Please Enter Your Name");
		document.popup.name.focus();
		return false;
	}


	if (document.popup.email.value=='')
	{
		alert("Please Enter Your Email Address");
		document.popup.email.focus();
		return false;
	}

	if (echeck(document.popup.email.value)==false)
	{
		document.popup.email.focus(); 
		return false;
	}

	if (document.popup.phone.value=='' && document.middleform.mobile.value=='')
	{
		alert("Please Enter Your Phone or Mobile number");
		document.popup.phone.focus();
		return false;
	}




}

// End script
// -->

/****************************************************************************************************************/
/****************************************************************************************************************/
/****************************************************************************************************************/






function contactvalidation()
{

	function echeck(str) {

			var at="@"
			var dot="."
			var lat=str.indexOf(at)
			var lstr=str.length
			var ldot=str.indexOf(dot)
			if (str.indexOf(at)==-1){
			   alert("Please enter a Valid Email Address")
			   return false
			}

			if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
			   alert("Please enter a Valid Email Address")
			   return false
			}

			if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
				alert("Please enter a Valid Email Address")
				return false
			}

			 if (str.indexOf(at,(lat+1))!=-1){
				alert("Please enter a Valid Email Address")
				return false
			 }

			 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
				alert("Please enter a Valid Email Address")
				return false
			 }

			 if (str.indexOf(dot,(lat+2))==-1){
				alert("Please enter a Valid Email Address")
				return false
			 }
			
			 if (str.indexOf(" ")!=-1){
				alert("Please enter a Valid Email Address")
				return false
			 }

			 return true					
		}
		
		
	
	if (document.contact.suburb.value=='')
	{
		alert("Please Enter Your Suburb");
		document.contact.suburb.focus();
		return false;
	}

	if (document.contact.postcode.value=='')
	{
		alert("Please Enter Your Postcode");
		document.contact.postcode.focus();
		return false;
	}
	
	if (document.contact.name.value=='')
	{
		alert("Please Enter Your Name");
		document.contact.name.focus();
		return false;
	}


	if (document.contact.email.value=='')
	{
		alert("Please Enter Your Email Address");
		document.contact.email.focus();
		return false;
	}

	if (echeck(document.contact.email.value)==false)
	{
		document.contact.email.focus(); 
		return false;
	}

	if (document.contact.phone.value=='' )
	{
		alert("Please Enter Your Phone number");
		document.contact.phone.focus();
		return false;
	}
	
	if (document.contact.message.value=='')
	{
		alert("Please Enter Your Message");
		document.contact.message.focus();
		return false;
	}




}

// End script
// -->

/****************************************************************************************************************/
/****************************************************************************************************************/
/****************************************************************************************************************/








