	function isEmailValid(email){
		var e = new RegExp(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i);
		return e.test(email);
	}
	function sendForm(){
		
		
		jQuery("#imessageOK, #imessageERROR").hide();
		jQuery(".required").removeClass("required");
		if(jQuery("#YourName").val()==""){jQuery("#YourName").addClass("required");window.scroll(0,0);return false;}if(jQuery("#YorTelephone").val()==""){jQuery("#YorTelephone").addClass("required");window.scroll(0,0);return false;}if(jQuery("#YourEmail").val()==""){jQuery("#YourEmail").addClass("required");window.scroll(0,0);return false;}if(!isEmailValid(jQuery("#YourEmail").val())){jQuery("#YourEmail").addClass("required");window.scroll(0,0);return false;}if(jQuery("#YourFeedback").val()==""){jQuery("#YourFeedback").addClass("required");window.scroll(0,0);return false;}jQuery("#SendaMessage").val("Please wait ...");		var AddDetails; AddDetails+="&YourName="+encodeURIComponent(jQuery("#YourName").val());AddDetails+="&YorTelephone="+encodeURIComponent(jQuery("#YorTelephone").val());AddDetails+="&YourEmail="+encodeURIComponent(jQuery("#YourEmail").val());AddDetails+="&YourFeedback="+encodeURIComponent(jQuery("#YourFeedback").val());
		
		jQuery.ajax({
		 type: "POST",
		 url: "emailcsFeedback.php",
		 data: AddDetails,
		 success: function(data){//alert(data);return false;
				  if(data == "OK"){
					  jQuery("#imessageERROR").hide();
					  jQuery("#emailcsFeedback .iform ul").fadeOut(function(){jQuery("#imessageOK").fadeIn(function(){setTimeout('jQuery("#imessageOK").fadeOut(function(){$("#emailcsFeedbackBg").fadeOut();$("#emailcsFeedback").animate({left: "-404px"}, 100 );});',2000);});});
					  
					/*  jQuery("#emailcsFeedback .iform ul").fadeOut(function(){jQuery("#imessageOK").fadeIn(function(){setTimeout('jQuery("#imessageOK").fadeOut(function(){jQuery("#emailcsFeedback .iform ul").fadeIn();jQuery("#SendaMessage").val("Send Another Message")});',5000);});});*/
				  
				  } else {
					  jQuery("#imessageOK").hide();jQuery("#SendaMessage").val("Try again: Send a Message")
					  jQuery("#imessageERROR").fadeIn(function(){setTimeout('jQuery("#imessageERROR").fadeOut()',5000);});
				  }
			}
		});
	}
		
	$(function(){
			   
		$("#emailcsFeedbackStart").css({'cursor':'pointer'}).click(function(){
				
				if($(this).offset().left>20){
					// hide
					$("#emailcsFeedbackBg").fadeOut();
					$("#emailcsFeedback").animate({ 
        				left: "-404px"
      				}, 500 );
					
				} else {
					// show
					$("#emailcsFeedbackBg").fadeIn();
					$("#emailcsFeedback").animate({ 
        				left: "-10px"
      				}, 500 );
					
				}
			
		});
		
		$("#emailcsfeedbackbanner1click").css({'cursor':'pointer'}).click(function(){
				//alert($(this).offset().left);return false;
				if($(this).offset().left>707){
					// hide
					$("#emailcsFeedbackBg").fadeOut();
					$("#emailcsFeedback").animate({ 
        				left: "-404px"
      				}, 500 );
					
				} else {
					// show
					$("#emailcsFeedbackBg").fadeIn();
					$("#emailcsFeedback").animate({ 
        				left: "-10px"
      				}, 500 );
					
				}
			
		});
		
		$("#emailcsfeedbackbanner2click").css({'cursor':'pointer'}).click(function(){
				
				if($(this).offset().left>783){
					// hide
					$("#emailcsFeedbackBg").fadeOut();
					$("#emailcsFeedback").animate({ 
        				left: "-404px"
      				}, 500 );
					
				} else {
					// show
					$("#emailcsFeedbackBg").fadeIn();
					$("#emailcsFeedback").animate({ 
        				left: "-10px"
      				}, 500 );
					
				}
			
		});
		
		$("#emailcsFeedbackBg").click(function(){$("#emailcsFeedbackStart").trigger('click')});
		$(".emailcsFeedbackTab1").click(function(){
			$("#emailcsHelp").slideUp(function(){$(".iform").slideDown();});
			$("#emailcsFeedbackTab a").removeClass('emailcsFeedbackActiveTab');
			$(this).addClass('emailcsFeedbackActiveTab');
		});
		$(".emailcsFeedbackTab2").click(function(){
			$(".iform").slideUp(function(){$("#emailcsHelp").slideDown();});
			$("#emailcsFeedbackTab a").removeClass('emailcsFeedbackActiveTab');
			$("#emailcsFeedbackTab a.emailcsFeedbackTab2").addClass('emailcsFeedbackActiveTab');
			
		});
		
});