var contextHelpUrl = "defaultHelp";
var contextHelpAnchor = "";
function helpWindow(newHelpUrl, helpAnchor,referringPage) {
	if (arguments.length<1){ newHelpUrl = contextHelpUrl; }
	if (arguments.length<2){ helpAnchor = contextHelpAnchor; }
	if (arguments.length==2){ helpAnchor = "#"+helpAnchor; }
	if (arguments.length==3){
		referringPage="&"+referringPage;
	}
	helpWin = window.open("/wdeliver/servlet/JSPs/shop/help/"+newHelpUrl+".jsp?siteCode="+siteCode+referringPage+helpAnchor,"Help","toolbar=no,left=350,top=22,status=no,scrollbars=yes,resizable=yes,menubar=no,width=510,height=550");
	helpWin.focus();
}
function productFlagHelpWindow(theFlagType) {
	var flagType = "&flagType=" + theFlagType;
	helpWin = window.open("/wdeliver/servlet/JSPs/shop/help/products/product_flag.jsp?siteCode=WD"+flagType,"Help","toolbar=no,left=350,top=22,status=no,scrollbars=yes,resizable=yes,menubar=no,width=510,height=550");
	helpWin.focus();
}

function quickHelpWindow(newHelpUrl) {
	if (arguments.length<1){ newHelpUrl = "noHelp"; }
	var thisUrl = "/wdeliver/servlet/JSPs/shop/help/quickHelp/"+newHelpUrl+".jsp?siteCode="+siteCode;
	quickHelpWin = window.open(thisUrl,"Quick_Help","toolbar=no,left=350,top=100,status=no,scrollbars=yes,resizable=yes,menubar=no,width=350,height=250");
	quickHelpWin.focus();
}

function updateContextHelp(helpPage,helpAnchor){
	helpVarFound = false;
	if (top.frames[0]){
		if (top.frames[0].contextHelpUrl){
			top.frames[0].contextHelpUrl=helpPage;
			if(arguments.length==2){
				top.frames[0].contextHelpAnchor=helpAnchor;
			}
			helpVarFound = true;
		}
	}
	if (contextHelpUrl){
		contextHelpUrl=helpPage;
		if(arguments.length==2){
			contextHelpAnchor=helpAnchor;
		}else{
			contextHelpAnchor="";
		}
		helpVarFound = true;
	}
	if(!helpVarFound){
		alert("Contextual help not found");
	}
}
jsLoaded++;