// JavaScript Document

	function list_state(country,street)
	{
		$.ajax({
			type	: "POST",
			url		: site_url+"ajaxforms/get-petshipper.php",
			data	: "country_id="+$("#"+country).val()+"&flag=getState&drp_name="+country,
			success	: function(msg)
				{	
					if(msg.indexOf("Failure")=="-1")
					{
						 arr_msg = msg.split("###");
						$("#state_div").html(arr_msg[0]); 
						$("#air_div").html(arr_msg[1]);
					}                                   
					$("#state_id").uniform();
					$("#airports").uniform();
        }                                     
		});           
	}
	function list_airports(state,air,catid)
	{
		$.ajax({
			type	: "POST",
			url		: site_url+"ajaxforms/get-petshipper.php",
			data	: "state_id="+$("#"+state).val()+"&flag=getAirports&drp_name="+state+"&catid="+catid,
			success	: function(msg)
				{	
					if(msg.indexOf("Failure")=="-1")
					{
						$("#air_div").html(msg);
					}
					$("#airports").uniform();

				}
		});
	}
	function senddata()
	{
		form_loading("action_msg");
		$.ajax({
			type: "POST",
			url		: site_url+"ajaxforms/get-petshipper.php",
			data: $("#pet").serialize()+"&flag=search",
			success: function(msg)
			{
				$("#action_msg").html(msg);	
				$.scrollTo($("#action_msg"), 800);
			}
		});		
	}
	
	function air_senddata()
	{
		form_loading("action_msg");
		$.ajax({
			type: "POST",
			url		: site_url+"ajaxforms/get-petshipper.php",
			data: $("#pet").serialize()+"&flag=air_search",
			success: function(msg)
			{
				$("#action_msg").html(msg);
				$.scrollTo($("#action_msg"), 800);
			}
		});		
	}
	
	
	
	function alphabet(char,flag)
	{
		form_loading("action_msg");
		var myurl = site_url+"ajaxforms/get-petshipper.php";
		$.ajax({
			type: "POST",
			url: myurl,
			data : "char="+char+"&flag=alphabet",
			success: function(msg)
			{
				$("#action_msg").html(msg);
				make_alphabet_active(char, 'active');
				$.scrollTo($("#action_msg"), 800);
			}
		});
	}
	

	
	function toggle_content(answer_id)
	{
	  	$("#"+answer_id).slideToggle("slow");
		
		$("#trid_"+answer_id).toggleClass("active");
	}
	
	function cancel(answer_id)
	{
		$("#"+answer_id).hide("slow");
	}
	
	
	function reset_action()
	{
		get_country_drop();
		$("#state_div").html("<select id='state_id' class='FormList'><option value=''>Select</option></select>");
		$("#air_div").html("<select id='airports' class='FormList'><option value=''>Select</option></select>");
		//$("#services_div").html("<select id='services_id' class='FormList'><option value=''>-ALL-</option></select>");
		//$("#species_div").html("<select id='species_id' class='FormList'><option value=''>-ALL-</option></select>");
		//$("#services_div").val("5");
		//$("#action_msg").hide("slow");
		
		$("#state_id").uniform();
    	$("#airports").uniform();
    	//$("#services_id").uniform();
    	//$("#species_id").uniform();
    	
    	
	}
	
	function print_content(id,char,flag)
	{
		if(flag=='search')
		{
			var myurl = site_url+"pet-shipper-print.php?search="+char+"&id="+id;
			window.location.href= myurl;
		}
		else
		{
			var myurl = site_url+"pet-shipper-print.php?char="+char+"&id="+id;
			window.location.href= myurl;
		}
	}
	
	function get_country_drop()
	{
		var myurl = site_url+"ajaxforms/get-petshipper.php";
		$.ajax({
			type: "POST",
			url: myurl,
			data : "country_drop=country",
			success: function(msg)
			{
				$("#country_div_box").html(msg);
				$("#country_id").uniform();
			}
		});	
	}
