function go(what)
	{
		value = what.options[what.selectedIndex].value;
		if (value == "") return;
		window.location.href = value;
	}
/* add product form  */
function ptform(fn, ff, fv)
	{
		ff.value = fv;
		fn.submit();
	}
/* print current page */
function printItem()
	{
		window.print();
	}
/* shipping options */
function changePrice(freight, cartTot)
	{
		document.getElementById('ship_price').firstChild.nodeValue = freight;
		var payable = freight + cartTot;
		payable = Math.round(payable*100)/100;
		document.getElementById('payableupdate').firstChild.nodeValue = cartTot;

	}
/* proceed to checkout */
function ChkoutSubmit()
	{
	for(var i=0; i<document.forms['gWayForm'].length; i++) {
			if(document.forms['gWayForm'].elements[i].checked==true || document.forms['gWayForm'].elements[i].type!='radio') {
					var gWayInput = document.createElement("input");
					gWayInput.setAttribute("type","hidden");
					gWayInput.setAttribute("name",document.forms['gWayForm'].elements[i].name);
					gWayInput.setAttribute("value",document.forms['gWayForm'].elements[i].value);
					document.forms['details'].appendChild(gWayInput);
				}
		}
		document.forms['details'].submit();		
	}
function validateMail(form, errMsg)
    {
        var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
		if(!filter.test(form.email.value)) {
				alert(errMsg);
			} else {
                form.submit();
            }
    }
function chngColor(src, color)
	{
		src.style.backgroundColor = color;
	}
/* determine browser */
function browserElement(ChkStr)
	{
	IdChk = document.getElementById ? true : false;
		/* check for netscape 4+/IE 5+ */
		if(navigator.userAgent.indexOf("Gecko")>-1 && IdChk || navigator.userAgent.indexOf("MSIE")>-1 && IdChk || navigator.userAgent.indexOf("Opera")>-1 && IdChk) {
				return document.getElementById(ChkStr);
			}
		/* netscape 4 */
		if(document.layers && !IdChk) {
				return document.ChkStr.document;
			}
		/* IE 4 */
		if(document.all && !IdChk) {
				return document.all[ChkStr];
			}
	}
function FullDiv(StyleVar)
	{
	browserElement(StyleVar.id).className = 'vpTabS';
		liDiv = new Array('liFull', 'liSpec', 'liReviews', 'liImage');
		aDiv = new Array('FullDiv', 'SpecDiv', 'ReviewsDiv', 'ImageDiv');
			for(i=0; i<=(liDiv.length-1); i++) {
					if(StyleVar.id!=liDiv[i]) {
							if(UpdliDiv = browserElement(liDiv[i]))
								UpdliDiv.className = 'vpTab';

							if(UpdaDiv = browserElement(aDiv[i]))
								UpdaDiv.style.display = 'none';
						} else {
						 	UpdaDiv = browserElement(aDiv[i]);
							UpdaDiv.style.display = 'block';
						}
				}
	}

function LrgImgPop(ServPath, DispImg, wHeight, wWidth, InvProdId)
	{
		var WinUrl = ServPath + "task.php/lrg_img/" + InvProdId + "/" + DispImg;
		window.open(WinUrl, "MultImgPop", 'status=0,resizable=0,location=0,width=' + wWidth + ',height=' + wHeight + ',scrollbars=0');
	}