
//function StartIt()
//{
//	InitOptions("Black#Red#Orange#Yellow,Pink#Blue#White,Red#White#Blue","Small#Medium#Large,Small#Medium,Large#Medium");	
//}
//strDisplay - a string of display options
//strValue - a similiar string of value options
//aDisplayOpt - display array
//aValueOpt = value array
function pageinit()
{
	InitList(strDisp, strVal, aDOpt, aVOpt);
	MM_preloadImages('/images/nav/header.nav.pc.over.gif','/images/nav/header.nav.ac.over.gif','/images/nav/header.nav.info.over.gif','/images/nav/header.maillist.over.gif','/images/gosearch.over.gif','/images/footer.over.gif');
}

function InitList(strDisplay, strValue, aDisplayOpt, aValueOpt)
{

	var aValue = strValue.split(",");
	var aDisplay = strDisplay.split(",");
	var iCtr;
	var iRow;
	var aDitem;
	var aVitem;

	if (strDisplay.length != 0)
	{
		for(iCtr in aDisplay)
		{
			aDisplayOpt[iCtr] = new Array();
			//two dimensional array for the current item
			if (aDisplay[iCtr].indexOf("#") == -1)
			{
				aDisplayOpt[iCtr][0] = aDisplay[iCtr];
			}
			else
			{
				aDitem = aDisplay[iCtr].split("#");
				for (iRow in aDitem)
				{
					aDisplayOpt[iCtr][iRow] = aDitem[iRow];
				}
			}
		}
	}
	
	if (strValue.length != 0)
	{
		for(iCtr in aValue)
		{
			aValueOpt[iCtr] = new Array();
			//two dimensional array for the current item
			if (aValue[iCtr].indexOf("#") == -1)
			{
				aValueOpt[iCtr][0] = aValue[iCtr];
			}
			else
			{
				aVitem = aValue[iCtr].split("#");
				for (iRow in aVitem)
				{
					aValueOpt[iCtr][iRow] = aVitem[iRow];
				}
			}
		}
	}
}

function InitOptions(strColor, strSize, aColorOpt, aSizeOpt)
{

	var aSize = strSize.split(",");
	var aColor = strColor.split(",");
	var iCtr;
	var iRow;
	var aDitem;

	if (strColor.length != 0)
	{
		for(iCtr in aColor)
		{
			aColorOpt[iCtr] = new Array();
			//two dimensional array for the current item
			if (aColor[iCtr].indexOf("#") == -1)
			{
				aColorOpt[iCtr][0] = aColor[iCtr];
			}
			else
			{
				aDitem = aColor[iCtr].split("#");
				for (iRow in aDitem)
				{
					aColorOpt[iCtr][iRow] = aDitem[iRow];
				}
			}
		}
	}

	if (strSize.length != 0)
	{
		for(iCtr in aSize)
		{
			aSizeOpt[iCtr] = new Array();
			//two dimensional array for the current item
			if (aSize[iCtr].indexOf("#") == -1)
			{
				aSizeOpt[iCtr][0] = aSize[iCtr];
			}
			else
			{
				aDitem = aSize[iCtr].split("#");
				for (iRow in aDitem)
				{
					aSizeOpt[iCtr][iRow] = aDitem[iRow];
				}
			}
		}
	}

}

function fn_loadList(lstOne, lstName, aData, aVal)
{

	if (lstOne.selectedIndex > 0)
	{
		var indx = lstOne.selectedIndex - 1;
		
		fn_clearList(lstName); //clear previous data
		
		var lstTwo = document.getElementById(lstName);

		for(var i=0; i < aData[indx].length; i++)
		{
			lstTwo.options[lstTwo.length] = new Option(aData[indx][i], aVal[indx][i]);
			lstTwo.options[lstTwo.length - 1].text = aData[indx][i];
//			lstTwo.options[lstTwo.length - 1].value = aVal[indx][i];
		}
	}
}

function fn_clearList(lstName)
{
	var lstData = document.getElementById(lstName);
	var iLength = lstData.options.length;
	if(iLength > 0)
	{
		for(i=0; i<iLength; i++)
		{
			lstData.remove(lstData.options[i]);
		}
	}
	else
	{
		return;
	}
}

function GetLargeImage(strImage)
{
	window.open ("popup.aspx?image=" + strImage, "_blank","status=no,titlebar=no,toolbar=no,menubar=no,location=no,scrollbars=no,height=538,width=503"); 
}

function GetDetail(id)
{
	detailsubmit();
}

function AddToCart()
{
	detailsubmit();
}

function detailsubmit() 
{
	document.forms[0].submit();
}

function SetLowRight(id)
{
	switch(id)
	{
	case 9:
		document.getElementById("lowright_b").style.display = "block";
		break;
	case 18:
		document.getElementById("lowright_c").style.display = "block";
		break;
	case 19:
		document.getElementById("lowright_c").style.display = "block";
		break;
	case 20:
		document.getElementById("lowright_b").style.display = "block";
		break;
	default:
//		document.getElementById("lowright_a").style.display = "block";
		initTip();
		break;
	}
}

