function getHTTPObject() {
	if (window.ActiveXObject)
		return new ActiveXObject("Microsoft.XMLHTTP");
	else if (window.XMLHttpRequest)
		return new XMLHttpRequest();
	else {
		alert("Your browser does not support AJAX.");
		return null;
	}
}

function productToCart(url, pid, field) {
	httpObject = getHTTPObject();
	if (httpObject != null) {
		httpObject.open("GET", url + "?pid=" + pid + "&amount=" + field.value,
				true);
		httpObject.send(null);
		httpObject.onreadystatechange = setOutput;
	}
}

function setOutput() {
	// alert("success");
}

function test() {
	alert('test');
}

function popitup() {
	var newwindow = window.document.open('', 'Page_printing', 'height=900,width=1000');
	var divmainlr = document.getElementById("main-left-right");
	newdocument = newwindow.document;
	newdocument.write(divmainlr.innerHTML);
	var arrayOfDivs = newdocument.getElementsByTagName('img');
	var howMany = arrayOfDivs.length - 1;

	for ( var i = 0; i < howMany; i++) {
		var thisDiv = arrayOfDivs[i];
		var styleClassName = thisDiv.className.value;
		thisDiv.style.visibility = 'hidden';
		thisDiv.style.display = 'none';
	}
	var subbut = newdocument.getElementById("btn_submit");
	rem(subbut);
	var backbut = newdocument.getElementById("backbut");
	rem(backbut);
	
	var printbutt = newdocument.getElementById("printerbutton");
	printbutt.value = "Print this page";
	printbutt.setAttribute("onclick", "print()");
	newdocument.close();
	return true;
}
function rem(obj) {
	obj.parentNode.removeChild(obj);
}
