function openImage(imageURL, width, height, caption) { //v3.0
	if (width ==null)
		var width = 575;
	if (height ==null)
		var height = 700;
	if (caption == null)
		var caption = "";
  	open("http://www.vat19.com/openPage.cfm?pageType=image&caption="+caption+"&imageURL=" + imageURL, "bigImage", "width="+width+", height="+height);
}

function openPage(pageURL, width, height) {
	if (width == null)
		var width = 760;
	if (height ==null)
		var height = 650;
  open("http://www.vat19.com/openPage.cfm?pageType=text&pageURL=" + pageURL, "text", "width="+width+", height="+height+", scrollbars=yes");
}

function openPageSmall(pageURL, width, height) {
	if (width ==null)
		var width = 500;
	if (height ==null)
		var height = 400;
	open("http://www.vat19.com/openPage.cfm?pageType=text&pageURL=" + pageURL, "text", "width="+width+", height="+height);
}

function openShipCalc(pageURL, qs) {
open("http://www.vat19.com/dvds/shipquote-final.cfm?" + qs, "text", "width=620, height=430, scrollbars=yes");
}

function openReview(pageURL, qs) {
open("http://www.vat19.com/openPage.cfm?pageType=text&pageURL=" + pageURL + "&"+qs, "text", "width=760, height=650, scrollbars=yes");
}

function openPageQS(pageURL, qs, width, height) {
	if (width == null)
		var width = 760;
	if (height ==null)
		var height = 650;
  open("http://www.vat19.com/openPage.cfm?pageType=text&pageURL=" + pageURL + "&productID="+qs, "text", "width="+width+", height="+height);
  
}

function openPromoPage(pageURL, promoID) {
	open("http://www.vat19.com/openPage.cfm?pageType=text&pageURL=" + pageURL + "&promoID=" + promoID, "text", "width=760, height=500");
}

function swapImage(i,x) {
	if (document.getElementById) {
		document.getElementById("productImage").src = "../webimages/covers/large/" + i;
		if (document.getElementById("subp"+x) != null) {
			document.getElementById("subp"+x).selected = true;
		}
		return false;
	} else {
		return true;
	}
}

function checkSubProductAddForm(x) {
	var returnValue = true;
	var emptyP = true;
	if (document.getElementById) {
		
		var elem = x.elements;
		for(var i = 0; i < elem.length; i++) {
			if (elem[i].type == "text") {
				if (isNaN(elem[i].value)) returnValue = false;
				if (elem[i].value.length != 0) emptyP = false;
			}
		}

	}
	
	if (returnValue && emptyP) returnValue = false;
	
	if (!returnValue) alert("Please enter a quantity for the item you want and then click 'Add to Cart')");
	return returnValue;
}