$(document).ready(function(){
							   
});

function deals_list()
{
	var deal = $("#deals").val();
	var sdeal = $("#subdeals_hid").val();
	 $.ajax({
	   type: "POST",
	   url: "coupons.php",
	   data: "mode=deal_list&deal="+deal+"&sdeal="+sdeal,
	   success: function(msg){
		   $("#list_state").html(msg);
		 //alert( "Data Saved: " + msg );
	   }
	 });
}

function country_list()
{
	var cou = $("#country").val();
	var stat = $("#state_hid").val();
	 $.ajax({
	   type: "POST",
	   url: "register.php",
	   data: "mode=statelist&country="+cou+"&state="+stat,
	   success: function(msg){
		   $("#list_state").html(msg);
		 //alert( "Data Saved: " + msg );
	   }
	 });
}
function submit_form(valID)
{
	//$("#"+valID).submit(function(){
	//check to empty fields or not
	
	
		$("#"+valID+" .required").each(function(){
			var temp ='';	
			if($(this).attr("type")=="checkbox")
			{
				if($(this).attr("checked"))
					temp = 'true';
				else
				  alert("Please select "+$(this).attr("value"));	
			}
			else
			{
				temp = $(this).val();
			}
				if(temp == "")
				 $(this).addClass("error");
				else
				 $(this).removeClass("error"); 
		});

		
	//check to digit or not
	
	 /* var reg = new RegExp("/^[\d]$/");

	  	$("#"+valID+" .digit").each(function(){
			var temp = $(this).val();
			if(temp.match(reg))
			 $(this).removeClass("error");
			else
			 $(this).addClass("error"); 
		});*/
	if($("#"+valID+" .error").length>0)
		return false;
	else
	    return true;
	//});
}

