var tP = ''
function vP(PC) {
	alert('View Product - Not implemented.')
}
function wlDA() { var winWLDA = window.open('dlgShopWishlistDeliveryAddress.asp', '_blank', 'width=400,height=400,scrollbars=1') }
function dL(w) { w.location.href = 'Login.asp?TargetURL=' + w.tP }
function tC(id) {
	var doIt = false
	if(document.all) { var dToggle = document.all('tbl_' + id); doIt = true }
	else if (document.getElementById) { var dToggle = document.getElementById('tbl_' + id); doIt = true	}
	if(doIt) { switch (dToggle.className) { case 'Hidden' : dToggle.className = 'Visible'; document.images['img_' + id].src = 'images/minus.gif'; break; case 'Visible' : dToggle.className = 'Hidden'; document.images['img_' + id].src = 'images/plus.gif'; break; } }
	else { alert('Your browser is too old to use this function.') }
}
function vI(pC, pT) { window.open('dlgShopImage.asp?PC=' + escape(pC) + '&PT=' + encodeURIComponent(pT), '_blank', 'resizable=1,scrollbars=1') }
function eC(c) { if(sC.length) { var aC = sC.split('|'); for (var i = aC.length -1 ; i > -1; i--) { if(document.images['img_' + aC[i]]) { tC(aC[i]) } } } }
function gIPrep(f, pC, hSz, hCol) {
	var sz = '', col = ''
	if(hSz) { sz = f.cboSize.value }
	if(hCol) { col = f.cboColour.value }
	gI(pC, 1, sz, col)
}
function gI(pC, q, sz, col) { // optional 4 = Username
	var un = ''
	if(arguments[4]) { un = arguments[4] }
	var winGI = window.open('dlgShopGiftIt.asp?PC=' + escape(pC) + '&Q=' + q + '&SZ=' + escape(sz) + '&COL=' + escape(col) + '&UN=' + escape(un), '_blank', 'width=450,height=320,scrollbars=1')
}
function aTWPrep(f, pC, hSz, hCol) {
	var sz = '', col = ''
	if(hSz) { sz = f.cboSize.value }
	if(hCol) { col = f.cboColour.value }
	aTW(pC, 1, sz, col)
}
function aTW(pC, q, sz, col) { 
	var winATW = window.open('dlgShopAddToWishlist.asp?PC=' + escape(pC) + '&Q=' + q + '&SZ=' + escape(sz) + '&COL=' + escape(col), '_blank', 'width=400,height=300,scrollbars=1')
}
function aTWLB(u, pC) { 
	window.open('dlgShopAddToWishlistBasket.asp?U=' + u + '&PC=' + escape(pC), '_blank', 'width=550,height=300,scrollbars=1')
}
function aTBPrep(f, pC, hSz, hCol) {
	var sz = '', col = ''
	if(hSz) { sz = f.cboSize.value }
	if(hCol) { col = f.cboColour.value }
	aTB(pC, 1, sz, col)
}
function aTB(pC, q, sz, col) {
	if(aTBAjax(pC, q, sz, col)) { 
		if(confirm('Item added to basket successfully.\n\nIf you would like to view your basket now, click \'OK\'.')) { self.location.href = 'ShopBasket.asp' }
	}
	else {
		self.location.href = 'ShopBasket.asp?CommandID=1&PC=' + escape(pC) + '&Q=' + q + '&SZ=' + escape(sz) + '&COL=' + escape(col) + '&TargetURL=' + tP
	}
}
function aTBAjax(pC, q, sz, col) {
	var shown = false, url = 'XMLDataSources/ShopAddToBasket.asp?PC=' + escape(pC) + '&Q=' + q + '&SZ=' + escape(sz) + '&COL=' + escape(col), req = g_getHTTPObject()
	if (req) { req.open("GET", url, false); req.send(null) } 
	else { return false }
	if (req.status == 200) {
		var values = req.responseXML.getElementsByTagName("VALUE"); 
		if(values.length > 0) { shown = parseInt(values.item(0).childNodes[0].nodeValue, 10) == 1 }
	}
	return shown
}
function vC(c) { self.location.href = 'Shop.asp?CategoryID=' + c }
