function shipping_gstpst()
{
	country = $('#country').val();
	state = $('#state').val();
	country1 = $('#country1').val();
	if((country1 == undefined) || (country1 == ''))
	{
		country1='';
	}
	state1 = $('#state1').val();
	if((state1 == undefined) || (state1 == ''))
	{
		state1='';
	}

	shipping_id = $('#shipping_id').val();
	if((shipping_id == undefined) || (shipping_id == ''))
	{
		shipping_id='';
	}

	total_amount_ajaxuse = $('#total_amount_ajaxuse').val();
	senddata = 'country='+country+'&state='+state+'&country1='+country1+'&state1='+state1+'&shipping_id='+shipping_id+'&total_amount='+total_amount_ajaxuse+'&action=submitStateCountry';
	$.getJSON('gstpst_process.php', senddata, function(data) {
		if(data.pst_display == 'Y')
		{
		$('#pst_price_row').show();
		}
		else
		{
		$('#pst_price_row').hide();
		}

	if(data.gst_display == 'Y')
	{
		$('#gst_price_row').show();
	}
	else
	{
		$('#gst_price_row').hide();
	}
	if(data.shipping_display == 'Y')
	{
				$('#shipping_price_row').show();
				$('.shipping_day_div').show();
	}
	else
	{
				$('#shipping_price_row').hide();
				$('.shipping_day_div').hide();
	}
	
		$('#gst_price').html(data.gst_string);
		$('#pst_price').html(data.pst_string);
		$('#shipping_price').html(data.shipping_string);
		$('#shipping_day_id').html(data.shipping_days_string);
		$('#grand_total_price').html(data.grand_total_price_string);
	});
}

function state_droplist()
{
	country = $('#country').val();
//	if(country == '38')
//	{
	senddata = 'country='+country+'&action=submitCountry';
	$.getJSON('gstpst_process.php', senddata, function(data)
		{
			
	if(data.state_exist == 'Y')
	{
			$('#state_input_shipping').html(data.list)
	}
	else
	{
		$('#state_input_shipping').html('<input class="txtfld" name="state" id="state" maxlength="80" value="" type="text" onchange="shipping_gstpst();" />');
	}
	
		});
//	}
//	else
//	{
//		$('#state_input_shipping').html('<input class="txtfld" name="state" id="state" maxlength="80" value="" type="text" onchange="shipping_gstpst();" />');
//	}
}
function state_droplist1()
{
	country = $('#country1').val();
	shipping_charge();
//	if(country == '38')
//	{
	senddata = 'country='+country+'&action=submitCountryShip';
	$.getJSON('gstpst_process.php', senddata, function(data)
		{
			
	if(data.state_exist == 'Y')
	{
			$('#state_input_shipping1').html(data.list)
	}
	else
	{
		$('#state_input_shipping1').html('<input class="txtfld" name="state1" id="state1" maxlength="80" value="" type="text" onchange="shipping_gstpst();" />');
	}
//			$('#state_input_shipping1').html(data.list)
		});
//	}
//	else
//	{
//		$('#state_input_shipping1').html('<input class="txtfld" name="state" id="state" maxlength="80" value="" type="text" onchange="shipping_gstpst();" />');
//	}
}
function shipping_charge()
{
	country = $('#country1').val();
	state = $('#state1').val();
	shipping_id = $('#shipping_id').val();
	senddata = 'country='+country+'&state='+state+'&shipping_id='+shipping_id+'&action=submitShippingCharge';
	$.getJSON('gstpst_process.php', senddata, function(data)
		{
			$('#state_input_shipping').html(data.list)
		});
}
