var helplocation = "";
helploc();
// JavaScript Document
function helpcover() {
	document.getElementById('helpclose').src = helplocation+"help/close2.gif";	
}
function helpcdown() {
	document.getElementById('helpclose').src = helplocation+"help/close3.gif";
}
function helpcup() {
	document.getElementById('helpclose').src = helplocation+"help/close2.gif";
}
function helpcout() {
	document.getElementById('helpclose').src = helplocation+"help/close1.gif";
}
function helpcclick() {
	document.getElementById('hbg').style.visibility= "hidden";
	document.getElementById('helpimg').style.visibility= "hidden";
	document.getElementById('help').style.visibility= "hidden";
}
function help(url) {
	if (helploaded != 1) {
		document.getElementById('helpimg').innerHTML = '<div id="helpimg1"><img id="helpclose" src="'+helplocation+'help/close1.gif" width="62" height="23" onmouseover="helpcover();" onmousedown="helpcdown();" onmouseup="helpcup();" onmouseout="helpcout();" onclick="helpcclick();" /></div><div id="helpimg2"></div>';
		document.getElementById('help').innerHTML = '<div id="helpS"><iframe name="helps" id="helps" width="237" frameborder="0" src="'+helplocation+'help/s.php">Your browser does not support iframes.</iframe></div><div id="helpM"><iframe name="helpm" id="helpm" width="467" frameborder="0" src="'+helplocation+'help/home.php">Your browser does not support iframes. <a href="'+helplocation+'help/HelpManual.php?m=home">Click here</a> to see the help manual.</iframe></div>';
		document.getElementById("hbg").addEventListener("click", helpcclick, false);
	}
	var helploaded = 1;
	document.getElementById('hbg').style.visibility= "visible";
	document.getElementById('helpimg').style.visibility= "visible";
	document.getElementById('help').style.visibility= "visible";
	if (url == undefined) {url = "home";}
	document.getElementById('helpm').src=helplocation+"help/content/"+url+".php";
}
function helploc() {
	var helploc = document.location.pathname.toLowerCase().substr(0, 16)
	if (helploc == "/groovycart/dev/") {helploc = document.location.pathname.slice(16);}
	if (helploc == "/groovycart/live") {helploc = document.location.pathname.slice(17);}
	if (helploc == "/groovycart/test") {helploc = document.location.pathname.slice(17);}
	
	var helpcount = helploc.split("/").length-1;
	var helpcount1 = 0;

	while(helpcount1 < helpcount){
		helplocation += "../"; 
		helpcount1++;
	}
}