<!-- when the page loads...->

jQuery.fn.autotab=function(){jQuery(this).keyup(function(e){switch(e.keyCode){case 9:return false;case 16:return false;case 20:return false;default:var maxlength=jQuery(this).attr('maxlength');var inputlength=jQuery(this).val().length;if(inputlength>=maxlength){jQuery(this).next('input[type="text"]').focus();}}});}

$(document).ready(function(){

	jQuery('input.autotab').autotab();
	$('input[type="text"]').addClass("idleField");
	//if the input gets focus remove the class and add our focused style
	$('input[type="text"]').focus(function() {
		$(this).removeClass("idleField").addClass("focusField");       
    });
	//if we lose focus, then do the opposite
    $('input[type="text"]').blur(function() {								  
    	$(this).removeClass("focusField").addClass("idleField");
    });

	$("#cancel-submit-btn").click(function(){
		var email		= $("input#email").val();	
		var re = /^[^\s()<>@,;:\/]+@\w[\w\.-]+\.[a-z]{2,}$/i;  		
  		if (email == "" || !(re.test(email))) 
		{
			alert('Invalid Email ');
			$("input#email").css('background-color', '#d7e3ba');
			$("input#email").css('border', '1px solid #8dab4a');
        	$("input#email").focus();
       		return false;
        }
	});
	

	
});