// JavaScript Document
var DEFAULT = "/deliverables/Scholasticstore/Redesign06b/help/index.asp?viewParam=help/default.html";
var HELP_SHIPPING_CHARGES = "/deliverables/Scholasticstore/Redesign06b/help/index.asp?viewParam=help/OrderStatus-Shipping.html#shipping-charges";
var SHOPPINGCART_SHIPPINGINFO = "/deliverables/Scholasticstore/Redesign06b/help/index.asp?viewParam=help/OrderStatus-Shipping.html";
var CREDITCARD_HELP = "/deliverables/Scholasticstore/Redesign06b/help/index.asp?viewParam=help/Ordering.html";
var GIFTCERTIFICATE_HELP = "/deliverables/Scholasticstore/Redesign06b/help/index.asp?viewParam=help/Ordering.html#giftCertificates";
var GIFTWRAPPING_HELP = "";
var CHECKOUT_HELP = "";
// Use onclick="openHelpSection(GIFTCERTIFICATE_HELP); return false;" 

function openHelpSection(loc)
{
	var catID = getParameter("catalogId");
	var storeID = getParameter("storeId");
	if(loc=="")
	{
		loc = DEFAULT;	
	}
	loc = loc+"?storeId="+storeID+"&catalogId="+catID;

	window.location.href=loc;	
}

function returnBack()
{
	var refURL = getParameter("refURL");
	if(refURL=="")
	{
		history.back(-1);
	}
	else
	{
		window.location.href=unescape(refURL);
	}
}

// Use onclick="openNewWindowHelpSection(SHOPPINGCART_SHIPPINGINFO); return false;" 
function openNewWindowHelpSection(loc)
{
	if(loc=="")
	{
		loc = DEFAULT;	
	}
	var replaceString = getParameter("viewParam");
	var curUrl = new String(loc);
	var newUrl = curUrl.replace("viewParam="+replaceString,"popup=1&viewParam="+replaceString);
	var newWindow = window.open(newUrl,"SSOHelpWindow","width=1100,height=800,scrollbars=yes");	
	newWindow.focus();
}
								  

function openHelp()
{
	openHelpSection(DEFAULT);
}

function openHelpTopicNav(navLink)
{
	var helpTopics = new Array();
	helpTopics[1] = "help/SearchingBrowsing.html";
	helpTopics[2] = "help/Ordering.html";
	helpTopics[3] = "help/Registration.html";
	helpTopics[4] = "help/MyAccount.html";
	helpTopics[5] = "help/OrderStatus-Shipping.html";
	helpTopics[6] = "help/ReturningOrder.html";
	helpTopics[7] = "help/FAQ.html";
	helpTopics[8] = "help/DigitalDownloads.html";
	helpTopics[9] = "help/ContactUs.html";		
	//window.location.href=helpTopics[navLink];
	
	var replaceString = getParameter("viewParam");
	var curUrl = new String(window.location.href);
	var newUrl = curUrl.replace(replaceString,helpTopics[navLink]);
	window.location.href=newUrl;	
}

