// JavaScript Document
function doProgressOpen(o)
{
    window.open("progressNotifier.asp?id=<%=Session.SessionID%>", "_blank", "width=600,height=150,toolbar=0,location=0,directories=0,menubar=0,scrollbars=0,resizable=0");
    //if(!childWindow.opener) childWindow.opener = window;
}

function fieldValueBackup(o)
{
	if(o.originalValue || (o.originalValue && o.originalValue == ""))
	{
		//alert("fVB:"+o.value+":\nOriginalValue:"+o.originalValue+":");
		o.lastValue = o.value;
	}
	else
	{
		if(o.originalValue != "")
		{
		//alert("fVB2:"+o.value+":\nOriginalValue:"+o.originalValue+":");
		o.originalValue = o.value;
		}
		o.lastValue = o.value;
	}
}
function checkValueChanged(o)
{
	if(o.originalValue != o.value)
	{
		//alert("HERE");
		//alert("cVC:"+o.value+":\nOriginalValue:"+o.originalValue+":");
		valueChanged(o);
	}
	else
	{
		//alert("cVC2:"+o.value+":\nOriginalValue:"+o.originalValue+":");
		clearInputSignals(o);
	}
}

function valueChanged(o)
{
	//alert("VC:"+o.value+":\nOriginalValue:"+o.originalValue+":");
	getStyleObject(o).border="1px dashed #FFFF00";
}

function backupObject(o)
{
	if(!o.beenHere)
	{
		o.beenHere = true;
		o.oldStyle = o.style;
	}
}
function formatCurrency(num) {
num = num.toString().replace(/\$|\,/g,'');
if(isNaN(num))
num = "0";
sign = (num == (num = Math.abs(num)));
num = Math.floor(num*100+0.50000000001);
cents = num%100;
num = Math.floor(num/100).toString();
if(cents<10)
cents = "0" + cents;
for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
num = num.substring(0,num.length-(4*i+3))+','+
num.substring(num.length-(4*i+3));
return (((sign)?'':'-') + '$' + num + '.' + cents);
}

var images = new Array(3);
images[0] = new Image();
images[1] = new Image();
images[2] = new Image();

images[0].src = "images/minus.gif";
images[1].src = "images/plus.gif";
images[2].src = "images/dot.gif";

function hideUnhide(o)
{
	if(document.getElementById("control_1").checked == true)
	{
		document.getElementById( "node_container_2" ).style.display = "none";
		document.getElementById( "node_container_1" ).style.display = "";
	}
	else if(document.getElementById("control_2").checked == true)
	{
		document.getElementById( "node_container_2" ).style.display = "";
		document.getElementById( "node_container_1" ).style.display = "none";
	}
	//document.getElementById("node_container_1")	
}
function hideUnhide2(o)
{
	if(document.getElementById("perClickRadio").checked == true)
	{
		document.getElementById( "viewImpressions" ).style.display = "none";
		document.getElementById( "viewClick" ).style.display = "";
	}
	else if(document.getElementById("perImpressionRadio").checked == true)
	{
		document.getElementById( "viewImpressions" ).style.display = "";
		document.getElementById( "viewClick" ).style.display = "none";
	}
	//document.getElementById("node_container_1")	
}
function hideUnhide3(o)
{
	if(document.getElementById("perClickRadio2").checked == true)
	{
		document.getElementById( "viewImpressions2" ).style.display = "none";
		document.getElementById( "viewClick2" ).style.display = "";
	}
	else if(document.getElementById("perImpressionRadio2").checked == true)
	{
		document.getElementById( "viewImpressions2" ).style.display = "";
		document.getElementById( "viewClick2" ).style.display = "none";
	}
	//document.getElementById("node_container_1")	
}
function collapseExpand2(o)
{
	
	var num = o.id.replace("control_", "");
	var id = o.id;
	var node = getObject("node_container_"+num);
	var obj = getStyleObject(node);
	if(collapseExpand2.arguments.length > 1)
	{
		var forcedVal = collapseExpand2.arguments[1];
		if(obj)
		if(forcedVal == "none")
		{
			//imageSwap(id, 1);
			obj.display = "none";
			//window.status = forcedVal;
		}
		else
		{
			//imageSwap(id, 0);
			obj.display = ""; //"block";
		}
	}
	else
	{
		if(obj)
		if(obj.display == "none")
		{
			obj.display = ""; //"block";
			//imageSwap(id, 0);
		}
		else
		{
			obj.display = "none";
			//imageSwap(id, 1);
		}
	}
}

function imageSwap(id, index)
{
	var obj = getObject(id, false);
	obj.src = images[index].src;
}


    function getQuantityTotal(changeType) {
	  totalAmt = 0;
      totalQty = 0;
	rowNum = document.getElementById("endTotal").value;
	rowNum = parseFloat(rowNum) - 1;
	//alert(rowNum);
		if (changeType == "add"){
			for (i = 1; i <= rowNum; i++) {
				//alert("here");
				//midNum = document.getElementById("middleRows_" + i).value;
				//for (z = 1; z < midNum; z++){
				   if (document.getElementById("addtoCart_" + i).checked) {
					   //alert("display this!");
						//validateNumericsOnly(document.getElementById("qty_" + i + "_" + z));
						//qty = document.getElementById("qty_" + i + "_" + z).value;
						
						//if (document.getElementById("indPrice_" + i) != ""){
							//validateNumericsOnly(document.getElementById("indPrice_" + i));
							var amt = parseFloat(document.getElementById("indPrice_" + i).value.replace("$", ""));
							//alert(amt);
		//				} else {
		//					valiedateNumericsOnly(document.getElementById("subAmtDiv_" + i).value);
		//					amt = document.getElementById("subAmtDiv_" + i).innerHTML;
		//				}
						//if (qty != ""){
							qty = 1;
							totalQty += qty * 1;
							totalAmt = totalAmt + (qty * amt);
							//subTotal = qty * amt;
							//document.getElementById("subAmtDiv_" + i + "_" + z).innerHTML = formatCurrency(subTotal);
						//}
					}
				//}
			}
		}
		else if (changeType == "remove"){
			for (i = 1; i <= rowNum; i++) {
				//alert("here");
				midNum = document.getElementById("middleRows_" + i).value;
				//alert("middleRows_" + i);
				//alert(document.getElementById("middleRows_" + i).value);
				for (z = 1; z <= midNum; z++){
					//alert(document.getElementById("removeFromCart_" + i + "_" + z).checked);
				   if (document.getElementById("removeFromCart_" + i + "_" + z).checked != true) {
						totalQty +=+1;
						totalAmt +=+100;
					}
				}
			}
		}

    	//qtyDisp = document.getElementById("totalQtyDiv");
    	if (totalQty != 0) {
    		//qtyDisp.innerHTML = totalQty;
			document.getElementById("totalQtyDivDownloads").innerHTML = totalQty;
       } else {
    		//qtyDisp.innerHTML = "0";
			document.getElementById("totalQtyDivDownloads").innerHTML = "0";
    	}
		if (totalAmt != 0) {
			totalPrice = formatCurrency(totalAmt);
			document.getElementById("totalAmtDivDownloads").innerHTML = totalPrice;	
		} else {
			totalPrice = formatCurrency("0");
			document.getElementById("totalAmtDivDownloads").innerHTML = totalPrice;
		}

    	//document.getElementById("totalQtyDiv").innerHTML = totalQty;
		//document.getElementById("totalAmtDiv").innerHTML = parseInt("totalQty") * parseInt("amount");
    }


    function getQuantityTotal2() {
	  totalAmt = 0;
      totalQty = 0;
	endRow = document.getElementById("totalRows").value;
	rowNum = document.getElementById("endTotal").value;
	//rowNum = rowNum + 1;
		//alert(endRow);
		//alert(rowNum);
		//if (changeType == "add"){
			for (i = rowNum; i < endRow; i++) {
				//alert(document.getElementById("totalRows").value);
				midNum = document.getElementById("middleRows_" + i).value;
				//alert("middleRows_" + i);
				//alert(document.getElementById("middleRows_" + i).value);
				for (z = 1; z < midNum; z++){
					//alert("second loop");
					//alert("lastRow_" + i + "_" + z);
					lastNum = document.getElementById("lastRow_" + i + "_" + z).value;
					//alert("lastRow_" + i + "_" + z);
					//alert(document.getElementById("lastRow_" + i + "_" + z).value);
					for (y = 1; y < lastNum; y++){
					   if (document.getElementById("qty_" + i + "_" + z + "_" + y)) {
						   //alert("display this!");
						   //alert(document.getElementById("qty_" + i + "_" + z + "_" + y));
							validateNumericsOnly(document.getElementById("qty_" + i + "_" + z + "_" + y));
							qty = document.getElementById("qty_" + i + "_" + z + "_" + y).value;
						
						//if (document.getElementById("indPrice_" + i) != ""){
							//validateNumericsOnly(document.getElementById("indPrice_" + i));
							var amt = parseFloat(document.getElementById("indPrice_" + i + "_" + z + "_" + y).value.replace("$", ""));
							//alert(amt);
		//				} else {
		//					valiedateNumericsOnly(document.getElementById("subAmtDiv_" + i).value);
		//					amt = document.getElementById("subAmtDiv_" + i).innerHTML;
		//				}
							if (qty != ""){
								//qty = 1;
								totalQty += qty * 1;
								//alert(totalQty);
								//totalAmt = totalAmt + (totalQty * amt);
								subTotal = qty * amt;
								totalAmt = totalAmt + subTotal
								//alert(totalAmt);
								document.getElementById("subAmtDivPrints_" + i + "_" + z + "_" + y).innerHTML = formatCurrency(subTotal);
							}
						}
					}
				}
			}
		//}

    	//qtyDisp = document.getElementById("totalQtyDiv");
    	if (totalQty != 0) {
    		//qtyDisp.innerHTML = totalQty;
			document.getElementById("totalQtyDivPrints").innerHTML = totalQty;
       } else {
    		//qtyDisp.innerHTML = "0";
			document.getElementById("totalQtyDivPrints").innerHTML = "0";
    	}
		if (totalAmt != 0) {
			totalPrice = formatCurrency(totalAmt);
			document.getElementById("totalAmtDivPrints").innerHTML = totalPrice;	
		} else {
			totalPrice = formatCurrency("0");
			document.getElementById("totalAmtDivPrints").innerHTML = totalPrice;
		}

    	//document.getElementById("totalQtyDiv").innerHTML = totalQty;
		//document.getElementById("totalAmtDiv").innerHTML = parseInt("totalQty") * parseInt("amount");
    }
    /*
    This function only allows numerics to be entered in field.
    Will also allow other special keys to be entered such as backspace and tab.
    */
	
function addTotals() {
	document.getElementById("totalQtyDiv").innerHTML = 	parseFloat(document.getElementById("totalQtyDivPrints").innerHTML) + parseFloat(document.getElementById("totalQtyDivDownloads").innerHTML);

var downloadsAmt = parseFloat(document.getElementById("totalAmtDivDownloads").innerHTML.replace("$", ""));
	var printsAmt = parseFloat(document.getElementById("totalAmtDivPrints").innerHTML.replace("$", ""));
	document.getElementById("totalAmtDiv").innerHTML = 	formatCurrency(downloadsAmt + printsAmt);
}


    function getQuantityTotal3() {
	  totalAmt = 0;
      totalQty = 0;
	endRow = document.getElementById("endTotal").value;
	rowNum = document.getElementById("totalRows").value;
	//alert(endRow);
	//alert(rowNum);
		//if (changeType == "add"){
			for (i = rowNum; i < endRow; i++) {
				//alert(document.getElementById("totalRows").value);
				midNum = document.getElementById("middleRows_" + i).value;
				//alert("middleRows_" + i);
				//alert(document.getElementById("middleRows_" + i).value);
				for (z = 1; z < midNum; z++){
					//alert("second loop");
					//lastNum = document.getElementById("lastRow_" + i + "_" + z).value;
					//alert("lastRow_" + i + "_" + z);
					//alert(document.getElementById("lastRow_" + i + "_" + z).value);
					//for (y = 1; y < lastNum; y++){
					   if (document.getElementById("qty_" + i + "_" + z)) {
						   //alert("display this!");
						   //alert(document.getElementById("qty_" + i + "_" + z + "_" + y));
							validateNumericsOnly(document.getElementById("qty_" + i + "_" + z));
							qty = document.getElementById("qty_" + i + "_" + z).value;
						
						//if (document.getElementById("indPrice_" + i) != ""){
							//validateNumericsOnly(document.getElementById("indPrice_" + i));
							var amt = parseFloat(document.getElementById("indPrice_" + i + "_" + z).value.replace("$", ""));
							//alert(amt);
		//				} else {
		//					valiedateNumericsOnly(document.getElementById("subAmtDiv_" + i).value);
		//					amt = document.getElementById("subAmtDiv_" + i).innerHTML;
		//				}
							if (qty != ""){
								//qty = 1;
								totalQty += qty * 1;
								//alert(totalQty);
								//totalAmt = totalAmt + (totalQty * amt);
								subTotal = qty * amt;
								totalAmt = totalAmt + subTotal
								//alert(totalAmt);
								document.getElementById("subAmtDivPrints_" + i + "_" + z).innerHTML = formatCurrency(subTotal);
							}
						}
					//}
				}
			}
		//}

    	//qtyDisp = document.getElementById("totalQtyDiv");
    	if (totalQty != 0) {
    		//qtyDisp.innerHTML = totalQty;
			document.getElementById("totalQtyDivPrints").innerHTML = totalQty;
       } else {
    		//qtyDisp.innerHTML = "0";
			document.getElementById("totalQtyDivPrints").innerHTML = "0";
    	}
		if (totalAmt != 0) {
			totalPrice = formatCurrency(totalAmt);
			document.getElementById("totalAmtDivPrints").innerHTML = totalPrice;	
		} else {
			totalPrice = formatCurrency("0");
			document.getElementById("totalAmtDivPrints").innerHTML = totalPrice;
		}

    	//document.getElementById("totalQtyDiv").innerHTML = totalQty;
		//document.getElementById("totalAmtDiv").innerHTML = parseInt("totalQty") * parseInt("amount");
	}


    function enterNumbersOnly(evt) {
    	evt = (evt) ? evt : ((window.event) ? window.event : "")

    	//For Backspace key press.
        if (evt.keyCode == 8)
    		return;

    	//For Tab key press.
    	if (evt.keyCode == 9)
    		return;

    	//For End key press.
    	if (evt.keyCode == 35)
    		return;

    	//For Home key press.
    	if (evt.keyCode == 36)
    		return;

    	//For Arrow Left key press.
    	if (evt.keyCode == 37)
    		return;

    	//For Arrow Right key press.
    	if (evt.keyCode == 39)
    		return;

    	//For Delete key press.
    	if (evt.keyCode == 46)
    		return;

    	//If not 0-9 key press.
    	if ((evt.keyCode < 48) || (evt.keyCode > 57 && evt.keyCode < 96) || evt.keyCode > 105) {
    		evt.returnValue=false;
    	}
    }

    function validateNumericsOnly(obj) {
    	value = obj.value;
    	if (value == "")
    		return;
    	if (isNaN(value) || (value.indexOf("-") >= 0) || (value.indexOf(".") >= 0)) {
    		obj.value = "";
    	} else {
    		obj.value = value * 1;
    	}
    }
	
function shippingComplete(first, last, address, address2, city, state, zip, phone) {
	if (document.getElementById("onFile").checked){
		document.getElementById("shipName").value = first + " " + last;
		document.getElementById("shipAddress").value = address;
		document.getElementById("shipAddress2").value = address2;
		document.getElementById("shipCity").value = city;
		document.getElementById("shipState").value = state;
		document.getElementById("shipZip").value = zip;
		document.getElementById("shipPhone").value = phone;
	} else {
		document.getElementById("shipName").value = "";
		document.getElementById("shipAddress").value = "";
		document.getElementById("shipAddress2").value = "";
		document.getElementById("shipCity").value = "";
		document.getElementById("shipState").value = "";
		document.getElementById("shipZip").value = "";
		document.getElementById("shipPhone").value = "";
	}
}

function billingComplete(first, middle, last, suffix, address, address2, city, state, zip, phone) {
	if (document.getElementById("onFile").checked){
//		if ((middle != "") && (suffix != "")){
//			document.getElementById("shipName").value = first + " " + middle + " " + last + " " +suffix;
//		}
//		else if ((middle != "") && (suffix == "")){
//			document.getElementById("shipName").value = first + " " + middle + " " + last;
//		}
//		else if ((middle == "") && (suffix != "")){
//			document.getElementById("shipName").value = first + " " + last + " " + suffix;
//		}
//		else if ((middle == "") && (suffix == "")){
//			document.getElementById("shipName").value = first + " " + last;
//		}
		document.getElementById("shipFirst").value = first;
		document.getElementById("shipMiddle").value = middle;
		document.getElementById("shipLast").value = last;
		document.getElementById("shipSuffix").value = suffix;
		document.getElementById("shipAddress").value = address;
		document.getElementById("shipAddress2").value = address2;
		document.getElementById("shipCity").value = city;
		document.getElementById("shipState").value = state;
		document.getElementById("shipZip").value = zip;
		document.getElementById("shipPhone").value = phone;
	} else {
		document.getElementById("shipFirst").value = "";
		document.getElementById("shipMiddle").value = "";
		document.getElementById("shipLast").value = "";
		document.getElementById("shipSuffix").value = "";
		document.getElementById("shipAddress").value = "";
		document.getElementById("shipAddress2").value = "";
		document.getElementById("shipCity").value = "";
		document.getElementById("shipState").value = "";
		document.getElementById("shipZip").value = "";
		document.getElementById("shipPhone").value = "";
	}
}

function statusPage(val, val2) {
	window.open('admin_updateOrder.asp?orderStatus=' + val + '&orderID=' + val2, '_self');	
}

function shippingRates(ship, subPrice, totalPrice) {
	var newShip = 0;
	var newTotal = 0;
	var newSub = 0;
	var returnPrice = 0;
	
	newShip = ship;
	newTotal = totalPrice;
	newSub = subPrice;
	
	if (totalPrice <= 25 && ship == 1) {
		//alert(newTotal + ", " + newShip + ", " + newSub);
		document.getElementById("shipRate").innerHTML = formatCurrency("5.95");
		returnPrice = parseFloat(newTotal) + 5.95;
		document.getElementById("totalRate").innerHTML = formatCurrency(returnPrice);
		document.shipRateForm.shipRateAmt.value = formatCurrency("5.95");
	} else if (totalPrice <= 40 && ship == 1) {
		document.getElementById("shipRate").innerHTML = formatCurrency("6.95");
		returnPrice = parseFloat(newTotal) + 6.95;
		document.getElementById("totalRate").innerHTML = formatCurrency(returnPrice);
		document.shipRateForm.shipRateAmt.value = formatCurrency("6.95");
	} else if (totalPrice <= 50 && ship == 1) {
		document.getElementById("shipRate").innerHTML = formatCurrency("8.95");
		returnPrice = parseFloat(newTotal) + 8.95;
		document.getElementById("totalRate").innerHTML = formatCurrency(returnPrice);
		document.shipRateForm.shipRateAmt.value = formatCurrency("8.95");
	} else if (totalPrice <= 75 && ship == 1) {
		document.getElementById("shipRate").innerHTML = formatCurrency("10.95");
		returnPrice = parseFloat(newTotal) + 10.95;
		document.getElementById("totalRate").innerHTML = formatCurrency(returnPrice);
		document.shipRateForm.shipRateAmt.value = formatCurrency("10.95");
	} else if (totalPrice <= 100 && ship == 1) {
		document.getElementById("shipRate").innerHTML = formatCurrency("13.95");
		returnPrice = parseFloat(newTotal) + 13.95;
		document.getElementById("totalRate").innerHTML = formatCurrency(returnPrice);
		document.shipRateForm.shipRateAmt.value = formatCurrency("13.95");
	} else if (totalPrice <= 125 && ship == 1) {
		document.getElementById("shipRate").innerHTML = formatCurrency("15.95");
		returnPrice = parseFloat(newTotal) + 15.95;
		document.getElementById("totalRate").innerHTML = formatCurrency(returnPrice);
		document.shipRateForm.shipRateAmt.value = formatCurrency("15.95");
	} else if (totalPrice <= 150 && ship == 1) {
		document.getElementById("shipRate").innerHTML = formatCurrency("17.95");
		returnPrice = parseFloat(newTotal) + 17.95;
		document.getElementById("totalRate").innerHTML = formatCurrency(returnPrice);
		document.shipRateForm.shipRateAmt.value = formatCurrency("17.95");
	} else if (totalPrice <= 200 && ship == 1) {
		document.getElementById("shipRate").innerHTML = formatCurrency("18.95");
		returnPrice = parseFloat(newTotal) + 18.95;
		document.getElementById("totalRate").innerHTML = formatCurrency(returnPrice);
		document.shipRateForm.shipRateAmt.value = formatCurrency("18.95");
	} else if (totalPrice < 300 && ship == 1) {
		document.getElementById("shipRate").innerHTML = formatCurrency("19.95");
		returnPrice = parseFloat(newTotal) + 19.95;
		document.getElementById("totalRate").innerHTML = formatCurrency(returnPrice);
		document.shipRateForm.shipRateAmt.value = formatCurrency("19.95");
	} else if (totalPrice <= 25 && ship == 2) {
		//alert(newTotal + ", " + newShip + ", " + newSub);
		document.getElementById("shipRate").innerHTML = formatCurrency("15.95");
		returnPrice = parseFloat(newTotal) + 15.95;
		document.getElementById("totalRate").innerHTML = formatCurrency(returnPrice);
		document.shipRateForm.shipRateAmt.value = formatCurrency("15.95");
	} else if (totalPrice <= 40 && ship == 2) {
		document.getElementById("shipRate").innerHTML = formatCurrency("16.95");
		returnPrice = parseFloat(newTotal) + 16.95;
		document.getElementById("totalRate").innerHTML = formatCurrency(returnPrice);
		document.shipRateForm.shipRateAmt.value = formatCurrency("16.95");
	} else if (totalPrice <= 50 && ship == 2) {
		document.getElementById("shipRate").innerHTML = formatCurrency("18.95");
		returnPrice = parseFloat(newTotal) + 18.95;
		document.getElementById("totalRate").innerHTML = formatCurrency(returnPrice);
		document.shipRateForm.shipRateAmt.value = formatCurrency("18.95");
	} else if (totalPrice <= 75 && ship == 2) {
		document.getElementById("shipRate").innerHTML = formatCurrency("20.95");
		returnPrice = parseFloat(newTotal) + 20.95;
		document.getElementById("totalRate").innerHTML = formatCurrency(returnPrice);
		document.shipRateForm.shipRateAmt.value = formatCurrency("20.95");
	} else if (totalPrice <= 100 && ship == 2) {
		document.getElementById("shipRate").innerHTML = formatCurrency("23.95");
		returnPrice = parseFloat(newTotal) + 23.95;
		document.getElementById("totalRate").innerHTML = formatCurrency(returnPrice);
		document.shipRateForm.shipRateAmt.value = formatCurrency("23.95");
	} else if (totalPrice <= 125 && ship == 2) {
		document.getElementById("shipRate").innerHTML = formatCurrency("25.95");
		returnPrice = parseFloat(newTotal) + 25.95;
		document.getElementById("totalRate").innerHTML = formatCurrency(returnPrice);
		document.shipRateForm.shipRateAmt.value = formatCurrency("25.95");
	} else if (totalPrice <= 150 && ship == 2) {
		document.getElementById("shipRate").innerHTML = formatCurrency("27.95");
		returnPrice = parseFloat(newTotal) + 27.95;
		document.getElementById("totalRate").innerHTML = formatCurrency(returnPrice);
		document.shipRateForm.shipRateAmt.value = formatCurrency("27.95");
	} else if (totalPrice <= 200 && ship == 2) {
		document.getElementById("shipRate").innerHTML = formatCurrency("28.95");
		returnPrice = parseFloat(newTotal) + 28.95;
		document.getElementById("totalRate").innerHTML = formatCurrency(returnPrice);
		document.shipRateForm.shipRateAmt.value = formatCurrency("28.95");
	} else if (totalPrice < 300 && ship == 2) {
		document.getElementById("shipRate").innerHTML = formatCurrency("29.95");
		returnPrice = parseFloat(newTotal) + 29.95;
		document.getElementById("totalRate").innerHTML = formatCurrency(returnPrice);
		document.shipRateForm.shipRateAmt.value = formatCurrency("29.95");
	} else if (totalPrice > 300 && ship == 2) {
		document.getElementById("shipRate").innerHTML = formatCurrency("10.00");
		returnPrice = parseFloat(newTotal) + 10.00;
		document.getElementById("totalRate").innerHTML = formatCurrency(returnPrice);
		document.shipRateForm.shipRateAmt.value = formatCurrency("10.00");
	} else if (totalPrice <= 25 && ship == 3) {
		//alert(newTotal + ", " + newShip + ", " + newSub);
		document.getElementById("shipRate").innerHTML = formatCurrency("5.95");
		returnPrice = parseFloat(newTotal) + 5.95;
		document.getElementById("totalRate").innerHTML = formatCurrency(returnPrice);
		document.shipRateForm.shipRateAmt.value = formatCurrency("5.95");
	} else if (totalPrice <= 40 && ship == 3) {
		document.getElementById("shipRate").innerHTML = formatCurrency("6.95");
		returnPrice = parseFloat(newTotal) + 6.95;
		document.getElementById("totalRate").innerHTML = formatCurrency(returnPrice);
		document.shipRateForm.shipRateAmt.value = formatCurrency("6.95");
	} else if (totalPrice <= 50 && ship == 3) {
		document.getElementById("shipRate").innerHTML = formatCurrency("8.95");
		returnPrice = parseFloat(newTotal) + 8.95;
		document.getElementById("totalRate").innerHTML = formatCurrency(returnPrice);
		document.shipRateForm.shipRateAmt.value = formatCurrency("8.95");
	} else if (totalPrice <= 75 && ship == 3) {
		document.getElementById("shipRate").innerHTML = formatCurrency("10.95");
		returnPrice = parseFloat(newTotal) + 10.95;
		document.getElementById("totalRate").innerHTML = formatCurrency(returnPrice);
		document.shipRateForm.shipRateAmt.value = formatCurrency("10.95");
	} else if (totalPrice <= 100 && ship == 3) {
		document.getElementById("shipRate").innerHTML = formatCurrency("13.95");
		returnPrice = parseFloat(newTotal) + 13.95;
		document.getElementById("totalRate").innerHTML = formatCurrency(returnPrice);
		document.shipRateForm.shipRateAmt.value = formatCurrency("13.95");
	} else if (totalPrice <= 125 && ship == 3) {
		document.getElementById("shipRate").innerHTML = formatCurrency("15.95");
		returnPrice = parseFloat(newTotal) + 15.95;
		document.getElementById("totalRate").innerHTML = formatCurrency(returnPrice);
		document.shipRateForm.shipRateAmt.value = formatCurrency("15.95");
	} else if (totalPrice <= 150 && ship == 3) {
		document.getElementById("shipRate").innerHTML = formatCurrency("17.95");
		returnPrice = parseFloat(newTotal) + 17.95;
		document.getElementById("totalRate").innerHTML = formatCurrency(returnPrice);
		document.shipRateForm.shipRateAmt.value = formatCurrency("17.95");
	} else if (totalPrice <= 200 && ship == 3) {
		document.getElementById("shipRate").innerHTML = formatCurrency("18.95");
		returnPrice = parseFloat(newTotal) + 18.95;
		document.getElementById("totalRate").innerHTML = formatCurrency(returnPrice);
		document.shipRateForm.shipRateAmt.value = formatCurrency("18.95");
	} else if (totalPrice < 300 && ship == 3) {
		document.getElementById("shipRate").innerHTML = formatCurrency("19.95");
		returnPrice = parseFloat(newTotal) + 19.95;
		document.getElementById("totalRate").innerHTML = formatCurrency(returnPrice);
		document.shipRateForm.shipRateAmt.value = formatCurrency("19.95");
	} else if (totalPrice <= 25 && ship == 4) {
		//alert(newTotal + ", " + newShip + ", " + newSub);
		document.getElementById("shipRate").innerHTML = formatCurrency("15.95");
		returnPrice = parseFloat(newTotal) + 15.95;
		document.getElementById("totalRate").innerHTML = formatCurrency(returnPrice);
		document.shipRateForm.shipRateAmt.value = formatCurrency("15.95");
	} else if (totalPrice <= 40 && ship == 4) {
		document.getElementById("shipRate").innerHTML = formatCurrency("16.95");
		returnPrice = parseFloat(newTotal) + 16.95;
		document.getElementById("totalRate").innerHTML = formatCurrency(returnPrice);
		document.shipRateForm.shipRateAmt.value = formatCurrency("16.95");
	} else if (totalPrice <= 50 && ship == 4) {
		document.getElementById("shipRate").innerHTML = formatCurrency("18.95");
		returnPrice = parseFloat(newTotal) + 18.95;
		document.getElementById("totalRate").innerHTML = formatCurrency(returnPrice);
		document.shipRateForm.shipRateAmt.value = formatCurrency("18.95");
	} else if (totalPrice <= 75 && ship == 4) {
		document.getElementById("shipRate").innerHTML = formatCurrency("20.95");
		returnPrice = parseFloat(newTotal) + 20.95;
		document.getElementById("totalRate").innerHTML = formatCurrency(returnPrice);
		document.shipRateForm.shipRateAmt.value = formatCurrency("20.95");
	} else if (totalPrice <= 100 && ship == 4) {
		document.getElementById("shipRate").innerHTML = formatCurrency("23.95");
		returnPrice = parseFloat(newTotal) + 23.95;
		document.getElementById("totalRate").innerHTML = formatCurrency(returnPrice);
		document.shipRateForm.shipRateAmt.value = formatCurrency("23.95");
	} else if (totalPrice <= 125 && ship == 4) {
		document.getElementById("shipRate").innerHTML = formatCurrency("25.95");
		returnPrice = parseFloat(newTotal) + 25.95;
		document.getElementById("totalRate").innerHTML = formatCurrency(returnPrice);
		document.shipRateForm.shipRateAmt.value = formatCurrency("25.95");
	} else if (totalPrice <= 150 && ship == 4) {
		document.getElementById("shipRate").innerHTML = formatCurrency("27.95");
		returnPrice = parseFloat(newTotal) + 27.95;
		document.getElementById("totalRate").innerHTML = formatCurrency(returnPrice);
		document.shipRateForm.shipRateAmt.value = formatCurrency("27.95");
	} else if (totalPrice <= 200 && ship == 4) {
		document.getElementById("shipRate").innerHTML = formatCurrency("28.95");
		returnPrice = parseFloat(newTotal) + 28.95;
		document.getElementById("totalRate").innerHTML = formatCurrency(returnPrice);
		document.shipRateForm.shipRateAmt.value = formatCurrency("28.95");
	} else if (totalPrice < 300 && ship == 4) {
		document.getElementById("shipRate").innerHTML = formatCurrency("29.95");
		returnPrice = parseFloat(newTotal) + 29.95;
		document.getElementById("totalRate").innerHTML = formatCurrency(returnPrice);
		document.shipRateForm.shipRateAmt.value = formatCurrency("29.95");
	} else if (totalPrice > 300 && ship == 4) {
		document.getElementById("shipRate").innerHTML = formatCurrency("10.00");
		returnPrice = parseFloat(newTotal) + 10.00;
		document.getElementById("totalRate").innerHTML = formatCurrency(returnPrice);
		document.shipRateForm.shipRateAmt.value = formatCurrency("10.00");
	} else if (totalPrice <= 25 && ship == 5) {
		//alert(newTotal + ", " + newShip + ", " + newSub);
		document.getElementById("shipRate").innerHTML = formatCurrency("20.95");
		returnPrice = parseFloat(newTotal) + 20.95;
		document.getElementById("totalRate").innerHTML = formatCurrency(returnPrice);
		document.shipRateForm.shipRateAmt.value = formatCurrency("20.95");
	} else if (totalPrice <= 40 && ship == 5) {
		document.getElementById("shipRate").innerHTML = formatCurrency("21.95");
		returnPrice = parseFloat(newTotal) + 21.95;
		document.getElementById("totalRate").innerHTML = formatCurrency(returnPrice);
		document.shipRateForm.shipRateAmt.value = formatCurrency("21.95");
	} else if (totalPrice <= 50 && ship == 5) {
		document.getElementById("shipRate").innerHTML = formatCurrency("23.95");
		returnPrice = parseFloat(newTotal) + 23.95;
		document.getElementById("totalRate").innerHTML = formatCurrency(returnPrice);
		document.shipRateForm.shipRateAmt.value = formatCurrency("23.95");
	} else if (totalPrice <= 75 && ship == 5) {
		document.getElementById("shipRate").innerHTML = formatCurrency("25.95");
		returnPrice = parseFloat(newTotal) + 25.95;
		document.getElementById("totalRate").innerHTML = formatCurrency(returnPrice);
		document.shipRateForm.shipRateAmt.value = formatCurrency("25.95");
	} else if (totalPrice <= 100 && ship == 5) {
		document.getElementById("shipRate").innerHTML = formatCurrency("28.95");
		returnPrice = parseFloat(newTotal) + 28.95;
		document.getElementById("totalRate").innerHTML = formatCurrency(returnPrice);
		document.shipRateForm.shipRateAmt.value = formatCurrency("28.95");
	} else if (totalPrice <= 125 && ship == 5) {
		document.getElementById("shipRate").innerHTML = formatCurrency("30.95");
		returnPrice = parseFloat(newTotal) + 30.95;
		document.getElementById("totalRate").innerHTML = formatCurrency(returnPrice);
		document.shipRateForm.shipRateAmt.value = formatCurrency("30.95");
	} else if (totalPrice <= 150 && ship == 5) {
		document.getElementById("shipRate").innerHTML = formatCurrency("32.95");
		returnPrice = parseFloat(newTotal) + 32.95;
		document.getElementById("totalRate").innerHTML = formatCurrency(returnPrice);
		document.shipRateForm.shipRateAmt.value = formatCurrency("32.95");
	} else if (totalPrice <= 200 && ship == 5) {
		document.getElementById("shipRate").innerHTML = formatCurrency("33.95");
		returnPrice = parseFloat(newTotal) + 33.95;
		document.getElementById("totalRate").innerHTML = formatCurrency(returnPrice);
		document.shipRateForm.shipRateAmt.value = formatCurrency("33.95");
	} else if (totalPrice < 300 && ship == 5) {
		document.getElementById("shipRate").innerHTML = formatCurrency("34.95");
		returnPrice = parseFloat(newTotal) + 34.95;
		document.getElementById("totalRate").innerHTML = formatCurrency(returnPrice);
		document.shipRateForm.shipRateAmt.value = formatCurrency("34.95");
	} else if (totalPrice > 300 && ship == 5) {
		document.getElementById("shipRate").innerHTML = formatCurrency("15.00");
		returnPrice = parseFloat(newTotal) + 15.00;
		document.getElementById("totalRate").innerHTML = formatCurrency(returnPrice);
		document.shipRateForm.shipRateAmt.value = formatCurrency("15.00");
	}
}

function imageShadow(changeID, changeType){
	if (changeType == "add"){
		if (document.getElementById("addtoCart_" + changeID).checked){
			document.getElementById("imageHolder_" + changeID).style.borderColor = "#D46808";
			document.getElementById("imageHolder_" + changeID).style.backgroundColor = "#f1a059";
		}
		else{
			document.getElementById("imageHolder_" + changeID).style.borderColor = "#999999";
			document.getElementById("imageHolder_" + changeID).style.backgroundColor = "#CCCCCC";
		}
	}
	else if (changeType == "remove"){
		if (document.getElementById("removeFromCart_" + changeID).checked){
			document.getElementById("imageHolder_" + changeID).style.borderColor = "#D46808";
			document.getElementById("imageHolder_" + changeID).style.backgroundColor = "#f1a059";
		}
		else{
			document.getElementById("imageHolder_" + changeID).style.borderColor = "#999999";
			document.getElementById("imageHolder_" + changeID).style.backgroundColor = "#CCCCCC";
		}
	}
}

// Detect if the browser is IE or not.
// If it is not IE, we assume that the browser is NS.
//var IE = document.all?true:false

// If NS -- that is, !IE -- then set up for mouse capture
//if (!IE) document.captureEvents(Event.MOUSEMOVE)

// Set-up to use getMouseXY function onMouseMove
//document.onmousemove = getMouseXY;

// Temporary variables to hold mouse x-y pos.s
//var tempX = 0
//var tempY = 0

// Main function to retrieve mouse x-y pos.s

//function getMouseXY(e) {
//  if (IE) { // grab the x-y pos.s if browser is IE
//    tempX = event.clientX + document.body.scrollLeft
//    tempY = event.clientY + document.body.scrollTop
//  } else {  // grab the x-y pos.s if browser is NS
//    tempX = e.pageX
//    tempY = e.pageY
//  }  
//  // catch possible negative values in NS4
//  if (tempX < 0){tempX = 0}
//  if (tempY < 0){tempY = 0}  
//  // show the position values in the form named Show
//  // in the text fields named MouseX and MouseY
//  //document.Show.MouseX.value = tempX
//  //document.Show.MouseY.value = tempY
//  return true
//}
//
//
//var imgMouse;
//function appendImageAtMouse(o, groupID, singleName)
//{
//	imgMouse = getObject("fullImage.asp?id=" + groupID + "&pName=" + singleName).cloneNode(true);//getObject("full_image_" + bigImag);//o.cloneNode(true);
//	var imgStyle = getStyleObject(imgMouse);
//	imgStyle.display = "";
//	imgStyle.position = "absolute";
//	imgStyle.width = "300px";
//	imgStyle.border = "10px solid #222222";
//	
//	document.body.appendChild(imgMouse);
//	imgStyle.top = ((tempY) - (imgMouse.height) - 10) + "px";
//	imgStyle.left = ((tempX) + 80) + "px";
//}
//
//function removeImageAtMouse()
//{
//	if(imgMouse)
//		document.body.removeChild(imgMouse);
//	imgMouse = null;
//}


function enableOther(selectedValue)
{
	if (selectedValue == 0 && selectedValue != '')
	{
		document.getElementById("otherDetails").disabled = false;
		//document.getElementById("otherDetails").style.borderColor = "#FF0000";
		document.getElementById("otherDetails").style.backgroundColor = "#FFCCCC";
	}else if (selectedValue > 0)
	{
		document.getElementById("otherDetails").disabled = true;
		//document.getElementById("otherDetails").style.borderColor = "#FFFFFF";
		document.getElementById("otherDetails").style.backgroundColor = "#FFFFFF";
	}
}


var glbInc, glbDec;

function decreaseSizeImage(imgSize) // will get back to its normal default size
{
var imgSizeID = imgSize;

if(glbInc != null) {clearTimeout(glbInc); glbInc = null;};
if (document.getElementById("imgSizeID").height > 100)
{
document.getElementById("imgSizeID").height -= 30;
document.getElementById("imgSizeID").width -= 40;
glbDec = setTimeout("decreaseSizeImage()", 32);
};
}

function increaseSizeImage(imgSize)
{
var imgSizeID = imgSize;
	
if(glbDec != null) {clearTimeout(glbDec); glbDec = null;};
if (document.getElementById("imgSizeID").height < 216)
{
document.getElementById("imgSizeID").height += 30;
document.getElementById("imgSizeID").width += 40;
glbInc = setTimeout("increaseSizeImage()", 32);
};
}
