function popup(strURL, lngWidth, lngHeight)
{
	if (strURL)
	{
		var newWin = window.open(strURL, "newWin", "width=" + lngWidth + ",height=" + lngHeight + ",resizable=yes,scrollbars=yes,toolbar=no");
	}
}

function toggle()
{
	if (document.all)
	{
		var d = window.event.srcElement.parentElement;
		if (window.event.srcElement.tagName == "A")
			{return false;}

		if (d.children.item(2).style.display=="inline")
			{
				d.title="Click here to hide this items description.";
				d.children.item(0).src="/images/arrow_dn.gif";
				d.children.item(1).innerText="";
				d.children.item(2).style.display="none";
				d.children.item(3).style.display="inline";
			}
		else
			{
				d.title="Click here to show this items description.";
				d.children.item(0).src="/images/arrow_rt.gif";
				d.children.item(1).innerText=""
				d.children.item(2).style.display="inline";
				d.children.item(3).style.display="none";
			}
	}
}

function checkQuantity(item, sku,  max)
{
	if (item)
	{
		if (isNaN(item.value))
		{
			item.value = 1;
		}
		else
		{
			if (parseInt(item.value) > parseInt(max))
			{
				alert("There is not enough of " + sku + " in stock to fulfill your request.  The quantity has been adjusted accordingly.");
				item.value = max;
			}
		}
	}
}
function popup1(strURL, lngWidth, lngHeight, strTarget)
{
	if (strURL)
	{
		var newWin = window.open(strURL, strTarget, "width=" + lngWidth + ",height=" + lngHeight + ",resizable=yes,scrollbars=yes,toolbar=no");
	}
}
function HelpPopUp(intHelpID)
{
	if ((intHelpID == 6) || (intHelpID == 7))
	{
		var newWin = window.open("searchhelp.asp", "HelpWin", "width=400,height=200,resizable=no,scrollbars=yes,toolbar=no");
	}
	else
	{
		var newWin = window.open("htmlhelp.asp?HelpID="+intHelpID, "HelpWin", "width=400,height=200,resizable=no,scrollbars=yes,toolbar=no");
	}
}
function ChngThis(Pict)
{
	Pict.src = "/images/gl/stgl_carticon_check.gif";
}
function ClearanceNote()
{
	alert("WARNING! Due to extremely limited quantities, this product may no longer be available at check out.");
}
function NotFound()
{
	alert("There are no results for your search. Please check and reenter your keyword or part number.");
}
function OutOfStock(dteAvailable)
{
	alert("This part is temporarily out of stock, but you can order it now. Tentative ship date: " + dteAvailable + ", if your order is placed today.");
}
function NotAvailable()
{
	alert("The part you requested is no longer available from Atech Motorsports. Call us Monday through Friday, 8:00 am - 8:00 pm EST at 1-800-517-1040 or 1-330-630-0888 for information on alternative parts.");
}
function TempNotAvailable()
{
	alert("We are currently experiencing technical difficulties. For part pricing and availability, please call us Monday through Friday, 8:00 am - 8:00 pm EST at 1-800-517-1040 or 1-330-630-0888.");
}
function WebNotAvailable()
{
	alert("The part you requested requires special handling procedures and must be ordered by phone. Call us Monday through Friday, 8:00 am - 8:00 pm EST at 1-800-517-1040 or 1-330-630-0888 to order.");

}

/* Custom Ship Parts Not Allowed */
function CustomDenied() {
	alert("This is a custom order part. You can order this part by calling us Monday through Friday, 8:00 am - 8:00 pm EST at 1-800-517-1040 or 1-330-630-0888.");
}

/* Custom AND Drop Ship Parts Not Allowed */
function CustomDropShipDenied() {
	alert("This is a custom order part. You can order this part by calling us Monday through Friday, 8:00 am - 8:00 pm EST at 1-800-517-1040 or 1-330-630-0888.");
}

/* Drop Ship Parts Not Allowed */
function DropShipDenied() {
	alert("This part is a drop ship part. You can order this part by calling us Monday through Friday, 8:00 am - 8:00 pm EST at 1-800-517-1040 or 1-330-630-0888.");
}
/* Backorder PopUp message for left_menu.asp */
function BackOrderNotice(lngRequested, lngAvailable, strShipDate) {
	var lngOrdered = lngAvailable - lngRequested;
	var strMessage = '';
	if ( lngOrdered < 0 ) {
		lngOrdered = lngOrdered * -1;
	};

	strMessage = "There are currently " + lngAvailable + " in stock and " + (lngRequested - lngAvailable) + " that will be backordered for you. Tentative ship date: " + strShipDate + " if your order is placed today."
	alert( strMessage );
}

/* GC Incorrect Quantity */
function GCQuantity() {
	alert("The quantity you have entered is less than 1 or is not a number.");
}
/* GC Invalid Price */
function GCInvalidPrice() {
	alert("The price you have entered is less than $25.00 or is not a number.");
}
/* GC Incorrect Price */
function GCPrice() {
	alert("The price you entered for this gift certificate is invalid.\rThe dollar amount must be between $25.00 and $500.00.");
}

function Notify( strMessage ) {
	alert( strMessage );
}

function ForgotPasswordPopUp(PasswordRequested)
{
	var newWin = window.open("ForgotPassword.asp?PasswordRequested="+PasswordRequested, "ForgotPasswordWin", "width=500,height=600,resizable=no,scrollbars=yes,toolbar=no");
}
function CustomizableNotice (c) {
	alert(c);
}
function PartSubNotice(p) {
	alert(p);
}
function PartRenameNotice(r) {
	alert(r);
}
function InstantRebateNotice () {
	alert("This part qualifies for an Instant Rebate! Add it to your cart to see your new low price!");
}
