jQuery(document).ready(function() {
 
	$("#login_form").validate(); 
		 			
	$("#check").click(function() {
	 // alert("Valid: " + $("#login_form").valid());
		if($("#login_form").valid())
		{
			$("#login_form").bind("submit", function() {			
				//alert( $("#login_form").valid())	;
		  
				/*if ($("#size1").val().length < 1 || $("#daten1").val().length < 1 || 
					$("#time1").val().length < 1 || $("#fullname").val().length < 1 || 
					$("#email").val().length < 1 || $("#comment").val().length < 1) {
					$("#login_error").show();
					$.fancybox.resize();
					return false;
				}*/
				
				$.fancybox.showActivity();

				$.ajax({
					type	: "POST",
					cache	: false,
					url		: "thankx.php",
					data	: $(this).serializeArray(),
					success: function(data) {
						$.fancybox(data);
					}
				});

				return false;
			});
		}
		else
		{
			return false;
		}
	});
	
	$("#reservation").validate();
	$("#chk").click(function() {
	
		if($("#reservation").valid())
		{
			$("#tip5").fancybox({
				'scrolling' : 'no',
				'titleShow'	: false,
				'onClosed'	: function() {
					$("#login_error").hide();
				}
			});
		}
		else
		{
			var txt = $("#size");
			var dat = $("#daten");
			var tim = $("#time");
			var msg = "";
			 if(txt.val()=="Party Size" || txt.val()=="" ||  txt.val()>'9' || txt.val()<'0' )
			 {
				msg +="please enter the Party size(Numeric Value)\n";
			 }
			 if(dat.val()=="Date" || dat.val()=="" )
			 {
				msg +="please enter the Date \n";
			 }
			 if(tim.val()=="Time" || tim.val()=="")
			 {
				msg +="please enter the Time \n";
			 }
			 
			 if(msg!="")
			 {
				alert(msg);
			 }
		}
    });
});

