<!--
function conf(a){
	
if (a==1){	
	$("#mailinglist").attr("checked",true);
	$("#mailinglistx").val('1'); 
}else{
	
	$("#mailinglist").attr("checked",false);
	$("#mailinglistx").val('0'); 
}
}
 var options = {
     success: function(responseText) {
         alert(responseText);
		 clearForm();
     }
 };
 function clearForm(){
	$("input,textarea,select").val('');
 	
}
$(function(){ 
		   
	
	$(".req").each(function() {
							//	$(this).prev().append('<span  class="astr"> *</span>');
							});
	$(".aForm").each(function() {
					 
							$(this).submit(function(){
						 
				 		//   proccesForm();
						if (validateForm($(this))){
							 	return true;
						   
							}else{
							return false;
							}
							}).children(".submit").css("cursor","pointer").click(function(){
										$(this).parent(".aForm").submit();
									});
							});

		$("#mailinglist").click(function(){
										 if($(this).attr("checked")){
							tb_show('', '/validList.asp?keepThis=true&TB_iframe=true&height=150&width=300&modal=true');
										 }else{
											$("#mailinglistx").val('0'); 
										 }
										 })

	$("#email").blur(
					   function(){
						     if ($(this).val()){
						  if (IsEmail($(this).val())){
								$("#mailError").fadeOut('fast');	  
						  }else{
			       			 $("#mailError").fadeIn('fast');
						  }  }}).keyup(function(){
							  if (IsEmail($(this).val())){
											$("#mailError").fadeOut('fast');
		}});
	 			 
	});
function proccesForm(){
 
						if (validateForm()){
							 	return true;
						   
							}else{
							return false;
							}
					 
	
}
function formSent(){
	
	window.location=$("#thankYouPage").attr("value");
	
}
function IsEmail(email) {
            var regex = /^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
            if (regex.test(email)) return true;
            else return false;
        } 
function validateForm(aFo ){
 if(lng==1){
			msg='יש למלות את השדות הבאים:\n';		
	mailError=' - כתובת המייל אינה תקינה ';
 }else{
	 
	 		msg='Please fill the following fields:\n';		
	mailError=' -  Mail address is invalid';
	 
 }
	 rt=true; 
aFo.find(".req").each(function() {
							
							  if (!$(this).val()||($(this).attr("name")=="email"&&!IsEmail($(this).val()) ) ){
								 rt=false; 
							    fName=$(this).attr("title");
							 
								msg+=fName;
								 
								if ($(this).attr("name")=="email"&&!IsEmail($(this).val()) &&$(this).val() )  msg+=mailError;
								 
								msg+="\n";
							  }
					 })
	//if(!rt)	tb_show('', '/formError.asp?msg='+msg+'&keepThis=true&TB_iframe=true&height=220&width=300&modal=true');
	if(!rt) alert(msg);
	return rt;
}

   // -->
