function AddOther(SelectBox)
{
	var OtherText;
	OtherText = prompt("Describe the OTHER option.","")
	if ((OtherText != "") && (OtherText != null))
	{
		SelectBox.options[SelectBox.options.length]=new Option(OtherText, OtherText);
		SelectBox.selectedIndex = SelectBox.options.length-1;
	}
	return true;
}
function hideSearches(elm, height)
{
	iX = event.clientX + document.body.scrollLeft;
	iY = event.clientY + document.body.scrollTop;

	if (iX<=250 || iX>=380 || iY<=125 || iY>=125 + height + 20)
	{
		elm.style.display='none';
	}
}
function showHelpWindow(URL)
{
	/*
		var agt			= navigator.userAgent.toLowerCase();
		var is_ie		= ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
		var is_major	= parseInt(navigator.appVersion);
		var is_minor	= parseFloat(navigator.appVersion);

		var is_ie		= ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
		var is_ie3		= (is_ie && (is_major < 4));
		var is_ie4		= (is_ie && (is_major == 4) && (agt.indexOf("msie 4")!=-1) );
		var is_ie4up	= (is_ie && (is_major >= 4));
		var is_ie5		= (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0") !=-1) );
		var is_ie5_5	= (is_ie && (is_major == 4) && (agt.indexOf("msie 5.5") !=-1));
		var is_ie5up	= (is_ie && !is_ie3 && !is_ie4);
		var is_ie5_5up	= (is_ie && !is_ie3 && !is_ie4 && !is_ie5);
		var is_ie6		= (is_ie && (is_major == 4) && (agt.indexOf("msie 6.")!=-1) );
		var is_ie6up	= (is_ie && !is_ie3 && !is_ie4 && !is_ie5 && !is_ie5_5);
	*/

	//if (is_ie6up)
	//{
	//	window.showModelessDialog(URL, "ReliableICHelp", "scroll: no; dialogHeight: 400px; dialogWidth: 260px; dialogTop: px; dialogLeft: px; edge: Sunken; center: Yes; help: No; resizable: No; status: No;");
	//}
	//else
	//{
		window.open(URL, "ReliableICHelp", "scrollbars=no,width=250,height=400,menubar=no,toolbar=no,titlebar=no,status=no");
	//}

}
function newWindow(URL, width, height)
{
	window.open(URL, "ReliableICSub1", "scrollbars=yes,width=" + width + ",height=" + height + ",menubar=no,toolbar=no,titlebar=no,status=no");
}
function newFullWindow(URL)
{
	window.open(URL, "ReliableICSub2");
}
function ValidateInventory()
{
	//Validate Artwork File
	var InventoryExt;
	InventoryExt = document.all.Inventory.value.substr(document.all.Inventory.value.lastIndexOf(".")).toLowerCase();
	if ((InventoryExt != ".csv"))
	{
		alert("You must provide a valid \"Inventory File\" format (.csv) before continuing.");
		document.all.Inventory.focus();
		return false;	
	}

	newWindow("/members/Uploading.asp?Field=Uploading",300,240);
	document.all.frmMain.submit();
}
function ColumnMatch()
{
	newWindow("/members/Uploading.asp?Field=ColumnMatching",300,240);
	document.all.frmMain.submit();
}
function import_list(sEntryPrefix, sSuffix, oSource, iLen)
{
	var sData;
	var aryLines;
	var i;
	var oPart;
	var oQty;
	
	sData						= oSource.value;

	if (sData != "")
	{
		aryLines				= sData.split("\n");
		
		for (i=0; i<aryLines.length; i++)
		{
			if (i < iLen)
			{
				oQty			= eval(sEntryPrefix + i.toString() + sSuffix);
				oQty.value		= aryLines[i];
			}
		}	
	}	
	
}
function setFieldValue(prefix, suffix, value)
{
	var obj;
	var tmpName;
	var i;
	for (i = 0; i < document.all.tags('input').length; i++)
	{
		obj = document.all.tags('input')[i];
		tmpName = obj.name;
		tmpName = tmpName.toLowerCase();
		
		if (suffix != "" && prefix != "")
		{
			if ((prefix.toLowerCase() == tmpName.substr(0, prefix.length)) && (suffix.toLowerCase() == tmpName.substr(tmpName.length - suffix.length)))
			{
				obj.value = value;
			}			
		}
		else if (suffix != "")
		{
			if (suffix.toLowerCase() == tmpName.substr(tmpName.length - suffix.length))
			{
				obj.value = value;
			}		
		}
		else if (prefix != "")
		{
			if (prefix.toLowerCase() == tmpName.substr(0, prefix.length))
			{
				obj.value = value;
			}		
		}

	}

}