<!--
/*******************************************************************************************
** Function		: scanKeypress(e) 
** Parameters	: not required
*******************************************************************************************/

var nav4 = window.Event ? true : false;
if (document.layers) document.captureEvents(Event.KEYPRESS);

if (nav4 && document.layers)
	document.onkeypress = scanKeypress;

function scanKeypress(e) {
	if (nav4) // Navigator 4.0x
	var whichCode = e.which	
	else // Internet Explorer 4.0x	
	if (e.type == "keypress") // the user entered a character
		var whichCode = e.keyCode
	else
		var whichCode = e.button;
	
	if (whichCode == 13 && document.searchForm.query.value.length < 1)
		CheckValueQty();  
}

/*******************************************************************************************
** Function		: CheckValueQty()
** Parameters	: not required
*******************************************************************************************/
function CheckValueQty(){
	var msg="";
	if (   (document.ValueQty.Quantity0.options[document.ValueQty.Quantity0.selectedIndex].value == 0)
		&& (document.ValueQty.Quantity1.options[document.ValueQty.Quantity1.selectedIndex].value == 0)
		&& (document.ValueQty.Quantity2.options[document.ValueQty.Quantity2.selectedIndex].value == 0)
		&& (document.ValueQty.Quantity3.options[document.ValueQty.Quantity3.selectedIndex].value == 0)
		&& (document.ValueQty.Quantity4.options[document.ValueQty.Quantity4.selectedIndex].value == 0)
		&& (document.ValueQty.Quantity5.options[document.ValueQty.Quantity5.selectedIndex].value == 0)
		&& (document.ValueQty.Quantity6.options[document.ValueQty.Quantity6.selectedIndex].value == 0)
		&& (document.ValueQty.Quantity7.options[document.ValueQty.Quantity7.selectedIndex].value == 0)
		&& (document.ValueQty.Quantity8.options[document.ValueQty.Quantity8.selectedIndex].value == 0)
		&& (document.ValueQty.Quantity9.options[document.ValueQty.Quantity9.selectedIndex].value == 0))
	{
		msg += "Please select a Gift Card.<br>";
		msg = msg.replace(/<br>/gi,"\n");
		alert(msg);
		return false;
	}
	else 
	{
		return true;
	}
}
function CheckValueQtyE(){
	var msg="";
	if (   (document.ValueQty.Quantity0.options[document.ValueQty.Quantity0.selectedIndex].value == 0)
		&& (document.ValueQty.Quantity1.options[document.ValueQty.Quantity1.selectedIndex].value == 0)
		&& (document.ValueQty.Quantity2.options[document.ValueQty.Quantity2.selectedIndex].value == 0)
		&& (document.ValueQty.Quantity3.options[document.ValueQty.Quantity3.selectedIndex].value == 0)
		&& (document.ValueQty.Quantity4.options[document.ValueQty.Quantity4.selectedIndex].value == 0))
	{
		msg += "Please select a Gift Card.<br>";
		msg = msg.replace(/<br>/gi,"\n");
		alert(msg);
		return false;
	}
	else 
	{
		return true;
	}
}

function BalInqPopup()
{
	var LeftPosition = (screen.width) ? (screen.width-340)/2 : 0;
	var TopPosition = (screen.height) ? (screen.height-222)/2 : 0;
	var balanceurl = 'gc_balance_inquiry_popup.jsp';
	var balPopup = window.open(balanceurl,"balance_pop",'toolbar=0,top='+TopPosition+',left='+LeftPosition+',location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=340,height=275');
	if(navigator.appName.substring(0,8)=="Netscape")
	{
		balPopup.location = balanceurl;
		balPopup.opener = self;
	}
	balPopup.focus();
}

function getQuantity()
{
	var Qty1 = document.ValueQty.Quantity0.value;
	var Qty2 = document.ValueQty.Quantity1.value;
	var Qty3 = document.ValueQty.Quantity2.value;
	var Qty4 = document.ValueQty.Quantity3.value;
	var Qty5 = document.ValueQty.Quantity4.value;
	var Qty6 = document.ValueQty.Quantity5.value;
	var Qty7 = document.ValueQty.Quantity6.value;
	var Qty8 = document.ValueQty.Quantity7.value;
	
	document.AddToWishList.Quantity1.value = Qty1;
	document.AddToWishList.Quantity2.value = Qty2;
	document.AddToWishList.Quantity3.value = Qty3;
	document.AddToWishList.Quantity4.value = Qty4;
	document.AddToWishList.Quantity5.value = Qty5;
	document.AddToWishList.Quantity6.value = Qty6;
	document.AddToWishList.Quantity7.value = Qty7;
	document.AddToWishList.Quantity8.value = Qty8;
	
	if ((Qty1 == 0) && (Qty2 == 0) && (Qty3 == 0) && (Qty4 == 0) && (Qty5 == 0) && (Qty6 == 0) && (Qty7 == 0) && (Qty8 == 0)) {
		alert("Please select a Gift Card.");
		return false;
	}
	else {		
		document.AddToWishList.submit();
		return true;
	}
}
//-->