<!--
function fScrollToItem(iItem)
{
	if (ie)
	{
		var objItemImage = document.all.item("imgItem" + iItem);
	}
	else
	{
		var objItemImage = document.getElementById("imgItem" + iItem);
	}
	objItemImage.scrollIntoView();
}

function fLoadBubbles()
{
	if (ie)
	{
		imgBubble.src = objBubble.src;
		imgBubble1.src = objBubble.src;
		imgBubble2.src = objBubble.src;
		imgBubble3.src = objBubble.src;
		imgBubble4.src = objBubble.src;
	}
	else
	{
		document.imgBubble.src = objBubble.src;
		document.imgBubble1.src = objBubble.src;
		document.imgBubble2.src = objBubble.src;
		document.imgBubble3.src = objBubble.src;
		document.imgBubble4.src = objBubble.src;
	}
}

function fPosBubbles(iIter)
{
	if (ie)
	{
		var objBubble = imBubble;
		var objBubble1 = imBubble1;
		var objBubble2 = imBubble2;
	}
	else
	{
		var objBubble = document.getElementById("imBubble");
		var objBubble1 = document.getElementById("imBubble1");
		var objBubble2 = document.getElementById("imBubble2");
	}

	if (iIter == 1 | iIter == 0)
	{
		fDispBubble(objBubble2, String(250), String(695));
		if (iIter > 0)
		{
			window.setTimeout("fPosBubbles(2)", iBubble);
			return;
		}
	}
	
	if (iIter == 2 | iIter == 0)
	{
		fDispBubble(objBubble1, String(105), String(715));
		if (iIter > 0)
		{
			window.setTimeout("fPosBubbles(3)", iBubble);
			return;
		}
	}
	
	fDispBubble(objBubble, String(65), String(670));
}

function fDispBubble(obj, sTop, sLeft)
{
	obj.style.display = "";
	if (ie)
	{
		obj.style.posTop = sTop;
		obj.style.posLeft = sLeft;
		obj.style.zIndex = 9999;
	}
	else
	{
		obj.style.top = sTop;
		obj.style.left = sLeft;
		obj.style.zIndex = 9999;
	}
}

function fResize()
{
	fPosBubbles(0);
}


function fShowImage(sItemId, sTitle)
{
	if (ie)
	{
		window.showModalDialog("imageview.asp?ITEM_ID=" + sItemId + "&TITLE=" + sTitle, window, "dialogWidth: 100px;dialogHeight: 100px;help:no;resizable:no;scroll:no;status:no");
	}
	else
	{
		window.open("imageview.asp?ITEM_ID=" + sItemId + "&TITLE=" + sTitle);
	}
}

function fShowGiftCert()
{
	if (ie)
	{
		var objBubble3 = imBubble3;
	}
	else
	{
		var objBubble3 = document.getElementById("imBubble3");
	}
	fDispBubble(objBubble3, document.body.scrollTop + 175, (document.body.scrollWidth/2) - 150);
}

function fCloseGiftCert()
{
	if (ie)
	{
		var objBubble3 = imBubble3;
	}
	else
	{
		var objBubble3 = document.getElementById("imBubble3");
	}
	objBubble3.style.display = "none";
	RestoreOriginals();
}

function fSortChange(objSel)
{
	if (!navigator.cookieEnabled)
	{
		window.alert("Sorry - cookies must be enabled to re-sort.");
	}
	else
	{
		var sSort = objSel.options[objSel.selectedIndex].text;
		if (sSort == "")
		{
			document.cookie = "SORT=;expires=Fri 31 Dec 1999 23:59:59";
		}
		else
		{
			document.cookie = "SORT=" + sSort;
		}
		document.location.replace(document.location.href);
	}
}

var oCurrentForm = null;

function fGetMonogram()
{
	if (ie)
	{
		var objBubble4 = imBubble4;
	}
	else
	{
		var objBubble4 = document.getElementById("imBubble4");
	}
	fDispBubble(objBubble4, document.body.scrollTop + 175, (document.body.scrollWidth/2) - 150);
}

function fCancelMonogram()
{
	if (ie)
	{
		var objBubble4 = imBubble4;
	}
	else
	{
		var objBubble4 = document.getElementById("imBubble4");
	}
	objBubble4.style.display = "none";
	RestoreOriginals();
}

function fSubmitMonogram()
{
	if (ie)
	{
		var oMonoStyle = selMONO_STYLE;
		var oMonoTx = selMONO_TX;
	}
	else
	{
		var oMonoStyle = document.getElementById("selMONO_STYLE");
		var oMonoTx = document.getElementById("selMONO_TX");
	}
	
	if (oMonoStyle.value == "")
	{
		window.alert("A style must be selected.");
		return;
	}
	
	var sTrimmed = String(oMonoTx.value).replace(/\s/g, "");
	if (sTrimmed == "")
	{
		window.alert("Your monogram text is blank!");
		return;
	}

	oCurrentForm.on0.value = oMonoStyle.value + " Monogram (adds $10)";
	oCurrentForm.os0.value = sTrimmed;
	
	oCurrentForm.amount.value = Number(oCurrentForm.amount.value) + 10;
	
	fSubmitForm();

	fCancelMonogram();
}

function fSubmitForm()
{
	if (sClosedText != "")
	{
		if (!window.confirm(unescape(sClosedText)))
		{
			RestoreOriginals();
			return;
		}
	}
	try
	{
		oCurrentForm.target = "paypal";
		oCurrentForm.submit();
	}
	finally
	{
		RestoreOriginals();
	}
}

var OrigItemName;
var OrigValue;

function CaptureOriginals()
{
	OrigItemName = oCurrentForm.item_name.value;
	OrigValue = oCurrentForm.amount.value;
}

function RestoreOriginals()
{
	if (oCurrentForm != null)
	{
		oCurrentForm.item_name.value = OrigItemName;
		oCurrentForm.amount.value = OrigValue;
	}
}

function fDoSubmit(sFormId)
{
	if (ie)
	{
		oCurrentForm = document.all.item(sFormId);
	}
	else
	{
		oCurrentForm = document.getElementById(sFormId);
	}
	
	CaptureOriginals();

	if (bCoupon)
	{
		GetCoupon();
		return;
	}

	if (GetFormAttribute(oCurrentForm,"size_id") != null
		&& GetFormAttribute(oCurrentForm,"size_id").value != "null")
	{
		fGetSize();
		return;
	}
	
	if (GetFormAttribute(oCurrentForm,"mono_flag") != null 
		&& GetFormAttribute(oCurrentForm,"mono_flag").value == "true")
	{
		fGetMonogram();
	}
	else
	{
		fSubmitForm();
	}
}

function GetCoupon()
{
	var bubble = GetCouponBubble();
	
	fDispBubble(bubble, document.body.scrollTop + 175, (document.body.scrollWidth/2) - 150);
}

function GetCouponBubble()
{

	if (ie)
	{
		return document.all.item("imBubble5");
	}
	else
	{
		return document.getElementById("imBubble5");
	}
}

function fApplyCoupon()
{
	if (ValidateCoupon(document.getElementById("celCOUPON").value))
	{
		fContinueFromCoupon();
	}
	else
	{
		alert("That coupon code does not appear to be valid.");
	}
}

function ValidateCoupon(sCode)
{
	if (false)
	{
		fCalcCoupon(sCode);
		return true;
	}
	return false;	
}

function fCalcCoupon(sCode)
{
	oCurrentForm.amount.value = Math.round((Number(oCurrentForm.amount.value) * .80) * 100) / 100;
	oCurrentForm.item_name.value += " ( with 20% off coupon)";
}

function fContinueFromCoupon()
{
	var bubble = GetCouponBubble();
	bubble.style.display = "none";
	if (GetFormAttribute(oCurrentForm,"size_id") != null
		&& GetFormAttribute(oCurrentForm,"size_id").value != "null")
	{
		fGetSize();
		return;
	}
	
	if (GetFormAttribute(oCurrentForm,"mono_flag") != null 
		&& GetFormAttribute(oCurrentForm,"mono_flag").value == "true")
	{
		fGetMonogram();
	}
	else
	{
		fSubmitForm();
	}
}

function GetFormAttribute(oForm, sNodeName)
{
	return oForm.attributes.getNamedItem(sNodeName);	
}

function fGetSize()
{
	if (ie)
	{
		var oSizeBubble = document.all.item("imBubble_Size" + oCurrentForm.size_id);
	}
	else
	{
		var oSizeBubble = document.getElementById("imBubble_Size" + GetFormAttribute(oCurrentForm, "size_id").value);
	}
	fDispBubble(oSizeBubble, document.body.scrollTop + 175, (document.body.scrollWidth/2) - 150);
}

function fCancelSize()
{
	if (ie)
	{
		var oSizeBubble = document.all.item("imBubble_Size" + oCurrentForm.size_id);
	}
	else
	{
		var oSizeBubble = document.getElementById("imBubble_Size" + GetFormAttribute(oCurrentForm,"size_id").value);
	}
	oSizeBubble.style.display = "none";
	RestoreOriginals();
}

function fSubmitSize()
{
	if (ie)
	{
		var oSize = document.all.item("selSize" + oCurrentForm.size_id);
	}
	else
	{
		var oSize = document.getElementById("selSize" + GetFormAttribute(oCurrentForm,"size_id").value);
	}
	
	if (oSize.value == "")
	{
		window.alert("A size must be selected.");
		return;
	}

	if (GetFormAttribute(oCurrentForm,"mono_flag") != null
		&& GetFormAttribute(oCurrentForm,"mono_flag").value == "true")
	{
		oCurrentForm.on1.value = "Size";
		oCurrentForm.os1.value = unescape(oSize.value);
	}
	else
	{
		oCurrentForm.on0.value = "Size";
		oCurrentForm.os0.value = unescape(oSize.value);
	}
	
	fCancelSize();
	if (GetFormAttribute(oCurrentForm,"mono_flag") != null
		&& GetFormAttribute(oCurrentForm,"mono_flag").value == "true")
	{
		fGetMonogram();
	}
	else
	{
		fSubmitForm();
	}
}
//->
