function showCountry(st_country, st_state, st_postcode){
agent.call('ship_tax_order_total.php','show_country','location',st_country, st_state, st_postcode);
}

function showState(st_state, st_postcode) {
agent.call('ship_tax_order_total.php','show_state','location',st_state, st_postcode);
}

function selectState(obj) {
agent.call('ship_tax_order_total.php','get_state_by_country','state',obj.value);
}

function selectBillingState(obj,state) {
agent.call('ship_tax_order_total.php','get_state_by_country','billing_state',obj.value,'billing',state);
}

function selectShippingState(obj,state) {
agent.call('ship_tax_order_total.php','get_state_by_country','shipping_state',obj.value,'shipping',state);
}

function getShipTax() {
var country = document.cart_quantity.country.value;
var state = document.cart_quantity.state.value;
var postcode = document.cart_quantity.postcode.value;
if(!country) {
	alert('Please select a country');
	document.cart_quantity.country.focus();
	return false;
	}
if(!state) {
	alert('Please enter a state');
	document.cart_quantity.state.focus();
	return false;
	}
if(!postcode) {
	alert('Please enter postcode');
	document.cart_quantity.postcode.focus();
	return false;
	}

document.cart_quantity.submit();
}

function check_email(obj,form) {

if(obj.value){
	agent.call('ship_tax_order_total.php','check_email_address','show_email_address',form.elements['email_address'].value);
	}
}

function show_email_address(str) {
if(str) {
	document.checkout_payment.password.value='';
	alert(str);
	}
}
