jQuery.noConflict();
jQuery(document).ready(function(){
	    var emailok = false;
	    var boxes = jQuery(".input_s1_normal");
	    var myForm = jQuery("#ChronoContact_Proceedings"), email = jQuery("#webtolead_email1"), emailInfo = jQuery("#emailInfo");
	 
	    /*//give some effect on focus
	    boxes.focus(function(){
	        $(this).addClass("input_s1_focus");
	    });
	    //reset on blur
	    boxes.blur(function(){
	        $(this).removeClass("input_s1_focus");
	    });*/
	 
	    //Form Validation
	    myForm.submit(function(){
	        if(email.attr("value") == "")
	        {
	            email.focus();
	            return false;
	        }
	        if(!emailok)
	        {
	            email.attr("value","");
	            email.focus();
	            return false;
	        }
	    });
	 
	    //send ajax request to check email
	    email.blur(function(){		
	        jQuery.ajax({	
	            type: "POST",
	            data: "email="+jQuery(this).attr("value"),
	            url: "http://www.opensourcecfd.com/conference2009/check.php",
	            beforeSend: function(){						
					emailInfo.html("Checking Email...");
	            },
	            success: function(data){
	                if(data == "invalid")
	                {
	                    emailok = false;
						emailInfo.html("");
	                    //emailInfo.html("Inavlid Email");
	                }
	                else if(data != "0")
	                {
	                    emailok = false;
	                    emailInfo.html("This e-mail is already registered. If you forgot your password, click on the <b>Forgot your password</b> link and a new password will be sent to you.");
	                }
	                else
	                {
	                    emailok = true;
	                    emailInfo.html(" ");
	                }
	            }
	        });
	    });
	});