<!--
var listRemain;

function shoeValidate() {
	if (document.addToCart.shoeSize.options[document.addToCart.shoeSize.selectedIndex].value == "select") {
		alert("Please Select a Size & Width");
		document.addToCart.shoeSize.focus();
		return (false);
		}
	if (document.addToCart.shoeSize.options[document.addToCart.shoeSize.selectedIndex].value == "") {
		alert("Please Select a Size & Width");
		document.addToCart.shoeSize.focus();
		return (false);
		}
	}
	
function apparelValidate() {
	if (document.addToCart.appParam1.options)
	{
		if (document.addToCart.appParam1.options[document.addToCart.appParam1.selectedIndex].value == "select") {
			alert("Please Select a Size");
			document.addToCart.appParam1.focus();
			return (false);
			}
		}
	}
	
function display_qty_warning() {
	var curSelect, curCharCount, strParsed, strCompare, listRemainCopy;

	/*The format of listRemain is: SIZE-WIDTH:QtyRemaining*/
	listRemainCopy = listRemain;
	/*Make sure this combo box exists before proceeding*/
	if (document.addToCart.shoeSize)
	{
		/*Don't bother if the word SELECT is chosen in the combo box  */
		if (document.addToCart.shoeSize.options[document.addToCart.shoeSize.selectedIndex].value != "select") {
			curSelect = document.addToCart.shoeSize.options[document.addToCart.shoeSize.selectedIndex].value;
			
			while(listRemain.length > 0)
			{
				curCharCount = listRemain.indexOf(',');
				if(curCharCount > 0){
					strParsed = listRemain.substring(0,curCharCount);
					numRemain = strParsed.substring(strParsed.indexOf(':') + 1, curCharCount);
					strCompare = strParsed.split(':', 1);
					listRemain = listRemain.substring(curCharCount + 1, listRemain.length);
					
					if(curSelect == strCompare) //The selected value is found in the string
					{
						//Call function to decide if the low qty message should be visible
						showWarning(numRemain);
						populateQtyDropDown(numRemain);
						listRemain = listRemainCopy;
						return;	
					}
				}
			}
			listRemain = listRemainCopy;	
			return (false);
		}	
	}
	else /*See if apparel is chosen*/
	{
		if (document.addToCart.appParam1) /*Make sure appParam1 exists before proceeding*/
		{
			if (document.addToCart.appParam1.value == "OSFA")
			{
				/*This is apparel without a size option*/
				numRemain = listRemain.substring(listRemain.indexOf(':') + 1, listRemain.length-1);
				showWarning(numRemain);
				populateQtyDropDown(numRemain);
			}
			else 
			{
				/*This is apparel where the user must select a size*/
				curSelect = document.addToCart.appParam1.options[document.addToCart.appParam1.selectedIndex].value;
		
				while(listRemain.length > 0)
				{
					curCharCount = listRemain.indexOf(',');
					if(curCharCount > 0)
					{
						strParsed = listRemain.substring(0,curCharCount);
						numRemain = strParsed.substring(strParsed.indexOf(':') + 1, curCharCount);
						strCompare = strParsed.split(':', 1);
						listRemain = listRemain.substring(curCharCount + 1, listRemain.length);
						if(curSelect == strCompare) //The selected value is found in the string
						{
							//Call function to decide if the low qty message should be visible
							showWarning(numRemain);
							populateQtyDropDown(numRemain);
							listRemain = listRemainCopy;
							return;
						}
					}
				}
				listRemain = listRemainCopy;	
				return (false);
			}
		}
	}
}


function showWarning(numRemain) {
	
	var warningLevel, ct;
	ct = document.getElementById('divJSlowQty');
	warningLevel = 5;
			
	//If Qty Remaining is less than a certain number, display the warning message
	if (numRemain < warningLevel)
	{
		ct.innerHTML = '<table style="width:100%; border:1; padding:1px; background:#FFFFFF;">' +
			'<tr><td style="background:#CE0000; color:white; font-weight: bold; text-align: center;">' +
			'Hurry! Only ' + numRemain + ' remaining!' +
			'</td></tr>' +
			'</table><br>';
	}
	else //There is sufficient quantity left - message should not be displayed
	{
		ct.innerHTML = '<img src="/images/spacer.gif" width="1" height="1" border="0" alt="">';
	}
	return;
}

function populateQtyDropDown(numRemain)
{
	var i, j, maxQty;
	maxQty = 5;
	
	if(document.addToCart.qty)
	{
		//Remove the numbers from the qty drop down box
		for(j = document.addToCart.qty.options.length; j > 0; j--)
			document.addToCart.qty.options[0] = null;
		
		//Populate the qty box, but don't add numbers > than the qty remaining
		document.addToCart.qty.options[0] = new Option('Quantity: 1', '1');
		for(i = 1; i < numRemain && i < maxQty; i++)
			document.addToCart.qty.options[i] = new Option(i+1, i+1);
	}
}

function largerWindow(argStyle) {
popupWin = window.open('larger_view.asp?style=' + argStyle, 'remote' + argStyle, 'width=600, height=575, resizable, scrollbars, left=0, top=0')
}

function friendWindow(argStyle) {
popupWin = window.open('tell_a_friend.asp?style=' + argStyle, 'remote', 'width=480, height=575, resizable, left=20, top=20')
}

function priceMatchWindow(argStyle) {
popupWin = window.open('price_match.asp?style=' + argStyle, 'remote', 'width=480, height=575, resizable, left=20, top=20')
}

function rotateWindow(argStyle) {
popupwin = window.open('360_view.asp?style=' + argStyle, '360' + argStyle, 'left=0,top=0,resizable,width=430,height=400')
}

function specWindow(argStyle) {
popupwin = window.open('tech_sheet.asp?style=' + argStyle, 'Tech' + argStyle, 'left=0,top=0,resizable,width=600,height=620')
}

function flashWindow(argStyle) {
popupwin = window.open('/tech_flash.asp?style=' + argStyle, 'Tech' + argStyle, 'left=0,top=0,resizable,width=600,height=500')
}
function DunhamPop() {
popupwin = window.open('/dunham_popup.asp', 'DunhamPop', 'left=50,top=50,resizable,scrollbars,width=500,height=400')
}
function PerfOuterwearPop() {
popupwin = window.open('/customer_serv/performance_outerwear_sizing.asp', 'PerfOuterwear', 'left=50,top=50,resizable,scrollbars,width=580,height=470')
}
function AravonPop() {
popupwin = window.open('/aravon_popup.asp', 'AravonPop', 'left=50,top=50,resizable,scrollbars,width=450,height=350')
}


//-->
