$(document).ready(function()
{
	
 /* This is contact form validation section  2009*/
			 
		$("#contact_form").submit(function()
		{
			
					//check the username exists or not from ajax
					$.post("contactact.php",{
						   Contact:$('#Contact').val(),
						   First_Name:$('#First_Name').val(),
						   Last_Name:$('#Last_Name').val(),
						   Your_Email:$('#Your_Email').val(),
						   Home_Phone_Number:$('#Home_Phone_Number').val(),
						   Cell_Phone_Number:$('#Cell_Phone_Number').val(),
						   office:$('#office').val(),
						   Event_Date:$('#Event_Date').val(),
						   Type_of_Event:$('#Type_of_Event').val(),
						   Were_you_referred:$('#Were_you_referred').val(),
						   Tell_us_about_your_event:$('#Tell_us_about_your_event').val()
						   
						   
					   },function(data)
					 {
						 
						 //alert(data);
					 
					 // $("#invoicenumber").removeClass('msgerror');
					 
					 
					 
					  if(data=='yes') //if correct login detail
					  {
							$("#msgbox").fadeTo(200,0.1,function()  //start fading the messagebox
							{ 
							  
							  //add message and change the class of the box and start fading
							  $(this).html('<div  style="color:green; font-style:italic; font-weight:bold;">Processing your request, please wait...</div>').addClass('messageboxok').fadeTo(900,1,function(){ 
								 //redirect to secure page
								 document.location='thank-you.php';
							   });
							  
							});
							
					  }else if(data=='no') {
						  
							$("#msgbox").fadeTo(200,0.1,function() //start fading the messagebox
							{ 
							  
							  //add message and change the class of the box and start fading
							  $(this).html('<div  style="color:red; font-style:italic; font-weight:bold;">Please make sure all the required fields have values.</div>').fadeTo(900,1);
							});	
					  
					  }else {
						  
							$("#msgbox").fadeTo(200,0.1,function() //start fading the messagebox
							{ 
							  
							  //add message and change the class of the box and start fading
							  $(this).html(data).fadeTo(900,1);
							});		
					  }
							
					});
					return false; //not to post the  form physically
	
		
		 }); // end of submit
			
	 
	  
	  
				
}); // end of ready