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=yes,scrollbars=yes,toolbar=no");
	}
	else
	{
		var newWin = window.open("http://classicstore.summitracing.com/htmlhelp.asp?HelpID="+intHelpID, "HelpWin", "width=400,height=200,resizable=yes,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 OnSaleNote()
{
	alert("Warning! Hurry sale prices won't last long so take advantage of these Summit Racing values now!");
}
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 Summit Racing. Call us anytime at 1-800-230-3030 or 1-330-630-3030 for information on alternative parts.");
}
function TempNotAvailable()
{
	alert("We are currently experiencing technical difficulties. For part pricing and availability, please call 1-800-230-3030 or 1-330-630-3030.");
}
function WebNotAvailable()
{
	alert("The part you requested requires special handling procedures and must be ordered by phone. Call 1-800-230-3030 or 1-330-630-3030 to order.");

}

/* Custom Ship Parts Not Allowed */
function CustomDenied() {
	alert("This is a custom order part. You can order this part by calling 1-800-230-3030 or 1-330-630-3030, 24 hours a day, 7 days a week.");
}

/* Custom AND Drop Ship Parts Not Allowed */
function CustomDropShipDenied() {
	alert("This is a custom order part. You can order this part by calling 1-800-230-3030 or 1-330-630-3030, 24 hours a day, 7 days a week.");
}

/* Drop Ship Parts Not Allowed */
function DropShipDenied() {
	alert("This part is a drop ship part. You can order this part by calling 1-800-230-3030 or 1-330-630-3030, 24 hours a day, 7 days a week.");
}

/* 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) + " backordered. Tentative ship date: " + strShipDate + " if order is placed today."
	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 KnowledgePopUp(strID)
{
	var newWin = window.open("http://classicstore.summitracing.com/knowledgebase.asp?"+strID, "KnowledgeWin", "width=500,height=400,resizable=yes,scrollbars=yes,toolbar=no");
	//var newWin = window.open("http://support.summitracing.com/knowledgebase.asp?"+strID, "KnowledgeWin", "width=500,height=400,resizable=yes,scrollbars=yes,toolbar=no");
}
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!");
}
function SummitBucksNotice (strAmount) {
	alert("This part qualifies for $" + strAmount + " Summit Bucks that can be used on future purchases! Summit Bucks are redeemable via phone, mail, online or by presenting them at a retail location.");
}
function ManufacturerRebateNotice (strManufacturerRebateDescription) {
	alert(strManufacturerRebateDescription);
}
function checkFrames() {
	var objReloadLink;
	var strDestination;

	strDestination = "/default.asp?target=" + document.location.pathname.replace(/\//, "") + "&" + document.location.search.replace(/\?/, "")

 
 /* /default.asp?target=<%=g_strScriptName%>&amp;<%=Replace(g_strQueryString, "&", "&amp;")%> */

	if (document.getElementById) {
		objReloadLink = document.getElementById("loadnav");
		
		if (objReloadLink) {
			if (! top.frames.length) {
				objReloadLink.style.display = 'inline';
				objReloadLink.style.visibility = 'visible';
				top.location = strDestination;
			} else {
				objReloadLink.style.display = 'none';
				objReloadLink.style.visibility = 'hidden';
			};
		};


	} else if (document.all) {
		objReloadLink = document.all.loadnav;
		if (objReloadLink) {
			if (! top.frames.length) {
				objReloadLink.style.display = 'inline';
				objReloadLink.style.visibility = 'visible';
				top.location = strDestination;
			} else {
				objReloadLink.style.display = 'none';
				objReloadLink.style.visibility = 'hidden';
			};
		};

	} else if (document.layers) {
		objReloadLink = document.layers.loadnav;

		if (objReloadLink) {
			if (! top.frames.length) {
				objReloadLink.visibility = 'show';
				top.location = strDestination;
			};
		};
	};
};