$(document).ready(function (){
			
			
			$("#registerFrm").submit(function ()
			{
			$(".error-msg").hide();	
			
			if($("#email").val()=='')
			{
				$("#spemail").text("Enter Email ID");
				$("#spemail").fadeIn();
				$("#email").focus();
				return false;
			}
			
			if((/^[a-zA-Z0-9._-]+@([a-zA-Z0-9.-]+\.)+[a-zA-Z.]{2,5}$/).exec($("#email").val())== null)
			{
				$("#spemail").text("Invalid email address");
				$("#spemail").fadeIn();
				$("#email").focus();
				return false;
			}
			if($("#password").val()=='')
			{
				$("#sppassword").text("Enter Password");
				$("#sppassword").fadeIn();
				$("#password").focus();
				return false;
			}
			if($("#cpassword").val()=='')
			{
				$("#spcpassword").text("Enter Confirm Password");
				$("#spcpassword").fadeIn();
				$("#cpassword").focus();
				return false;
			}
			
			if($("#password").val()!=$("#cpassword").val())
			{
				$("#spcpassword").text("Passwords doesn't match");
				$("#spcpassword").fadeIn();
				$("#cpassword").focus();
				return false;
			}
			if($("#fname").val()=='')
			{
				$("#spfname").text("Enter First Name");
				$("#spfname").fadeIn();
				$("#fname").focus();
				return false;
			}
			if($("#lname").val()=='')
			{
				$("#splname").text("Enter Last Name");
				$("#splname").fadeIn();
				$("#lname").focus();
				return false;
			}
			if($("#phone").val()=='')
			{
				$("#spphone").text("Enter Phone No.");
				$("#spphone").fadeIn();
				$("#phone").focus();
				return false;
			}
			if(isNaN($("#phone").val()))
			{
				$("#spphone").text("Phone No. must be Numeric");
				$("#spphone").fadeIn();
				$("#phone").focus();
				return false;
			}
			if($("#address").val()=='')
			{
				$("#spaddress").text("Enter Address");
				$("#spaddress").fadeIn();
				$("#address").focus();
				return false;
			}
			if($("#state").val()=='')
			{
				$("#spstate").text("Enter State");
				$("#spstate").fadeIn();
				$("#state").focus();
				return false;
			}
			if($("#city").val()=='')
			{
				$("#spcity").text("Enter City");
				$("#spcity").fadeIn();
				$("#city").focus();
				return false;
			}
			if($("#zip").val()=='')
			{
				$("#spzip").text("Enter Zip");
				$("#spzip").fadeIn();
				$("#zip").focus();
				return false;
			}
			if($("#country").val()=='')
			{
				$("#spcountry").text("Select Country");
				$("#spcountry").fadeIn();
				$("#country").focus();
				return false;
			}
			if(!$("#check").is(':checked'))
			{
				$("#spcheck").text("Mandatory");
				$("#spcheck").fadeIn();
				$("#check").focus();
				return false;
			}
										   
		});
			
		$("#cartFrm").submit(function ()
			{
				
				if($("#quantity").val()=='' || isNaN($("#quantity").val()) || $("#quantity").val()<= "0" )
				{
					
				$("#spquantity").text("Quantity must be Positive Numeric value");
				$("#spquantity").fadeIn();
				$("#quantity").focus();
				return false;
					
				}
			})
				
			});
