$(function(){
	$("input[type='text'],input[type='password'],textarea").css({"border":"1px solid #cccccc","padding":"2px"});
	$("input[type='text'],input[type='password'],textarea").focus(function(){
		$(this).css({"border":"1px solid #be0101"}); 
	});
	$("input[type='text'],input[type='password'],textarea").blur(function(){
		$(this).css({"border":"1px solid #cccccc"});
	});
	$("textarea").autogrow();
	$(".validateMe").validate();
	$("#email_signup").blur(function(){
		if( $("#email_signup").val() == "" ){
			$("#email_signup").css("background","url(images/youremail.gif) no-repeat #ebebeb");
		}
	});
	$("#email_signup").focus(function(){
		$("#email_signup").css("background","#ebebeb");
	});
	$("#bar_rotate").cycle({ 
		fx: "scrollLeft",
		easing: "backinout",
		timeout: 4500,
		random: 1
	});
	$("#email_form").validate({
		submitHandler: function(form) {
			emailSignup();
		}
	});
	/*$("#email_form").submit(function(){
			var dataString = $("#email_form").serialize();
			$.ajax({
			  type: "POST",
			  dataType: "json",
			  url: "/email.php",
			  data: dataString+"&json=true",
			  success: function(rt) {
				$("#email_register, #email_register_shadow").fadeIn("fast");
				setTimeout(function(){
					$("#email_register, #email_register_shadow").fadeOut("slow");
				}, 3000 ); 
				$("#email_signup").val("").blur();
			 }
			});
			return false;
	});*/
	$(".calendar_table tr:even td").css("background","#eeeeee");
	setTimeout(function(){
					$("#pwd_msg, #pwd_msg_shadow").fadeOut("slow");
				}, 3000 ); 
});
function emailSignup(){
	var dataString = $("#email_form").serialize();
	$.ajax({
	  type: "POST",
	  dataType: "json",
	  url: "/email.php",
	  data: dataString+"&json=true",
	  success: function(rt) {
		$("#email_register, #email_register_shadow").fadeIn("fast");
		setTimeout(function(){
			$("#email_register, #email_register_shadow").fadeOut("slow");
		}, 3000 ); 
		$("#email_signup").val("").blur();
	 }
	});
	return false;
}
