
// functions/code to run at document load
$(document).ready(function(){
	
	
	//cleaningup();
	handclean();		
	

	
});






function checkquote(){
	
$("#quoteerror").hide();	
	
	var title = $("select#title").val();
	var forename = $("input#forename").val();
	var surname = $("input#surname").val();
	var reason = $("select#reason").val();
	var sector = $("select#sector").val();
	var contactnumber = $("input#contactnumber").val();
	var emailaddress = $("input#emailaddress").val();

	
	if(title == "")
	{
		$("#quoteerror").text("Please select your Title");
		$("select#title").focus();
		$("#quoteerror").show();
		return false;
		
	}
	
	
	if(forename == "")
	{
		$("#quoteerror").text("Please enter your Forename");
		$("input#forename").focus();
		$("#quoteerror").show();
		return false;
		
	}
	
	
	
	if(surname == "")
	{
		$("#quoteerror").text("Please enter your Surname");
		$("input#surname").focus();
		$("#quoteerror").show();
		return false;
		
	}
	
	
	if(reason == "")
	{
		$("#quoteerror").text("Please select how we can help you");
		$("select#reason").focus();
		$("#quoteerror").show();
		return false;
		
	}
	
	
	if(sector == "")
	{
		$("#quoteerror").text("Please select your employment sector");
		$("select#sector").focus();
		$("#quoteerror").show();
		return false;
		
	}
	
	
	if(contactnumber == "")
	{
		$("#quoteerror").text("Please enter a contact number");
		$("input#contactnumber").focus();
		$("#quoteerror").show();
		return false;
		
	}
	
	
	
	var regemail = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;     
	
	if (regemail.test(emailaddress) == false)
	{     
	$("#quoteerror").text("Please enter a valid email address");
	$("input#emailaddress").focus(); 
	$("#quoteerror").show(); 
	return false;  
	}
		 
		 
	
	
	
	
	
}




















function cleaningup(){
	
var topposition = $("#cleaningarm").css("top"); // -150px

if(topposition=="-150px")
{

$("#cleaningarm").animate({top: '-110px'},{duration: 500, specialEasing: 'swing', complete: cleaningdown});
	
}
	
}


function cleaningdown(){
	
	var topposition = $("#cleaningarm").css("top");  // -110px
	
	if(topposition=="-110px")
{
	$("#cleaningarm").animate({top: '-150px'},{duration: 500, specialEasing: 'swing', complete: cleaningup});
}


}



function handclean(){

	
	
	
		
	$("#tophalfpage").mousemove(
						   
								function(e) 
								  {
								  
								  	
								  var calcnotesstart = 9;
								  var calcnotesend = 239;
								  
								  var teacupstart = 620;
								  var teacupend = 991;
								  
								  var handwidth = 0; //168; //398;
								  
								  var x = (e.pageX - handwidth);
																						
								  $("#cleaningarm").css('left',x+'px');
								
									if(x >= calcnotesstart && x <= calcnotesend)
									{ 
									
									 } 
									else 
									{ 
									
									 }
									
									if(x >= teacupstart && x <= teacupend)
									{ 
									
									 } 
									else 
									{ 
									
									 } 
									 
									 
									 // $(".copyright").html(x);
								  								  
								}
								  						  
		  
	);
	
	
	
	
	
	
	

}
