// Open window
function Start(page) {
	OpenWin = window.open(page, "CtrlWindow", "toolbar=no,menubar=no,location=no,status=no,scrollbars=yes,resizable=yes,width=700,height=700,left=10,top=10,alwaysRaised=yes");
}

function starthowto(page) {
	OpenWin = window.open(page, 'CtrlWindow', 'toolbar=no,menubar=no,location=no,status=no,scrollbars=yes,resizable=yes,width=1000,height=800,left=10,top=10,alwaysRaised=yes');
}

function classChange(element,newclass) {
	element.className = newclass;
}

function showhide(layer_ref, state){
	if(state == 'hide'){
		state = 'none';
	}else{
		state = 'inline';
	}
	if(document.all){ //IS IE 4 or 5 (or 6 beta)
		eval("document.all." + layer_ref + ".style.display = state");
	}
	if (document.layers) { //IS NETSCAPE 4 or below
		document.layers[layer_ref].display = state;
	}
	if (document.getElementById &&!document.all) {
		hza = document.getElementById(layer_ref);
		hza.style.display = state;
	}
} 

var xmlHttp
	
function getpostage(country,qty,weight,method) { 
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null) {
		alert ("Browser does not support HTTP Request")
	 	return
	}
	
	var url="/cart/get_postage.php"
	url=url+"?country="+country+"&qty=" + qty + "&weight=" + weight + "&method=" + method
	url=url+"&sid="+Math.random()
//	alert(url)
	xmlHttp.onreadystatechange=stateChanged 
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

function stateChanged() { 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { 
		document.getElementById("postagecost").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;
}
	