function help(popup_url) {
	var x = window.open(popup_url,"help","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,copyhistory=0,resizable=1,width=520,height=540,left=15,top=15");
	x.location=popup_url;
	if (!((navigator.appName=="Microsoft Internet Explorer") && (navigator.appVersion.substring(0,3)=="4.0"))) x.focus();
	x.opener.name = "origwindow";
}

var xmlHttp

function updateShipping(usrate, canadarate, foreignrate, subtotal, discount) {
	var country = document.getElementById('country');
	var shiptext = document.getElementById('shiptext');
	var wiresident = document.getElementById('wisconsin');
	var witext = document.getElementById('wisconsintext');
	var taxtext = document.getElementById('taxtext');
	var totaltext = document.getElementById('totaltext');
	var shiprate;
	var tax;
	var total;
	var cartdefault = 'us';
	
	if (country.value == 'other') {
		shiprate = foreignrate;
		witext.style.visibility = 'hidden';
		tax = 0.00;
		cartdefault = 'other';
	}
	else if (country.value == 'can') {
		shiprate = canadarate;
		witext.style.visibility = 'hidden';
		tax = 0.00;
		cartdefault = 'can';
	}
	else {
		shiprate = usrate;
		witext.style.visibility = 'visible';
		if (wiresident.checked) {
			tax = (subtotal - discount + shiprate) * .055;
			tax = Math.round(tax * 100)/100;
			cartdefault = 'wis';
		}
		else
			tax = 0.00;
	}
	
	total = subtotal - discount + shiprate + tax;
	shiptext.innerHTML = 'Shipping: $' + shiprate.toFixed(2);
	taxtext.innerHTML = 'Tax: $' + tax.toFixed(2);
	totaltext.innerHTML = 'Total: $' + total.toFixed(2);
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null) {
		alert ("Settings not saved: Your browser does not support AJAX!");
		return;
	} 
	var url = "ajaxship.aspx";
	url = url + "?cart=" + cartdefault;
	url = url + "&sid=" + Math.random();
	xmlHttp.onreadystatechange = stateChanged;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function stateChanged() { 
	//if (xmlHttp.readyState == 4)
		//var something = Math.random();
		//document.getElementById("txtHint").innerHTML=xmlHttp.responseText;
}	

function GetXmlHttpObject() {
	var xmlHttp=null;
	try { // Firefox, Opera 8.0+, Safari
		xmlHttp=new XMLHttpRequest();
	}
	catch (e) { // Internet Explorer
		try {
	    		xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
	    	}
	  	catch (e) {
	    		xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
	    	}
	}
	return xmlHttp;
}