//<!--
function newWindowWithScrolling(wUrl, wWidth, wHeight) {
	aWindow = window.open(wUrl, "aWin", "width=" + wWidth + ",height=" + wHeight + ",scrollbars=yes");
	aWindow.focus();
}
	
function newWindow(wUrl, wWidth, wHeight) {
	aWindow = window.open(wUrl, "aWin", "width=" + wWidth + ",height=" + wHeight + ",scrollbars=yes")
	aWindow.focus()
}

function outOfStockMessage()
{
	alert('This product is currently out of stock');
	return false;
}

function getFieldValue(frm, name)
{
	if (frm[name].options)
	{
		return frm[name].options[frm[name].selectedIndex].value;
	}
	else
	{
		return frm[name].value;
	}
}

function styleOutOfStockMessage(itemEdp, frmName, levelCount)
{
	var frm = document.forms[frmName];
	var entry1 = '', entry2 ='', entry3 = '';
	var l1descFldName = 'l1desc';
	var l2descFldName = 'l2desc';
	var l3descFldName = 'l3desc';

	entry1 = getFieldValue(frm, l1descFldName);

	if (levelCount >= 2) entry2 = getFieldValue(frm, l2descFldName);
	if (levelCount == 3) entry3 = getFieldValue(frm, l3descFldName);

	for(i = 0; i < styleProducts[itemEdp].length; i++)
	{
		if (styleProducts[itemEdp][i][0] == entry1 && styleProducts[itemEdp][i][1] == entry2 && styleProducts[itemEdp][i][2] == entry3)
		{
			if (styleProducts[itemEdp][i][4] <= 0)
			{
				alert('Selected product is currently out of stock');
				return false;
			}
			
			return true;
		}
	}
	
	return true;
}

//-->

