function validateShipping() {
	return true;
}

function chooseNewCountry(countryCode, selId, inpId) {
	var ajaxQuery = null;
	if (window.XMLHttpRequest) { ajaxQuery = new XMLHttpRequest(); }
	else if (window.ActiveXObject) { ajaxQuery = new ActiveXObject("Microsoft.XMLHTTP"); }
	ajaxQuery.open('POST', "https://" + domain + "/v2/getStates.aspx", false);
    ajaxQuery.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	ajaxQuery.send("countryCode=" + countryCode);
	// receive result
	// populate newAddrState_sel or newAddrState
	var sel = document.getElementById(selId);
	var inp = document.getElementById(inpId);

	// empty both state containers
	while (sel.options.length > 1) {
		sel.removeChild(sel.options[sel.options.length-1]);
	}
	if (inp != null)
		inp.value = "";
	
	if (ajaxQuery.responseText == "") {
		sel.style.display = "none";
		if (inp != null)
			inp.style.display = "inline";
	}
	else {
		var opts = ajaxQuery.responseText.split('\n');
		for (var i=0; i<opts.length; i++) {
			if (opts[i] != "") {
				var parts = opts[i].split('|');
				opt = document.createElement("OPTION");
				opt.value = trim(parts[0]);
				opt.appendChild(document.createTextNode(trim(parts[1])));
				sel.appendChild(opt);
			}
		}
		sel.style.display = "inline";
		if (inp != null)
			inp.style.display = "none";
	}
}

function trim(str) {
	return str.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
}


