
// presets
var _timeout;
var display = false;
var xOffset = 10;
var yOffset = 10;
document.onmousemove = adjustSize;

// show the help pane with the given HTML text
function showHelp(help)
{
	var helpPane = document.getElementById("helpPane");
	
	var xPos = event.clientX + document.body.scrollLeft;
	var yPos = event.clientY + document.body.scrollTop;
	var testX = new Number(xPos.toString());	
	var winX = document.body.offsetWidth/2;
	
	if (testX>winX)
	{
		helpPane.style.left = xPos - xOffset;
		helpPane.style.top = yPos + yOffset;
	}
	else
	{
		helpPane.style.left = xPos - xOffset - helpPane.offsetWidth;
		helpPane.style.top = yPos + yOffset;
	}
	
	helpPane.innerHTML = help;
	
	helpPane.className = "helpPane_show";
	display = true;
}

// on move of the mouse you can re-poisiton the help pane
function adjustSize()
{
	if (!display) return;
	
	var helpPane = document.getElementById("helpPane");
	
	var xPos = event.clientX + document.body.scrollLeft;
	var yPos = event.clientY + document.body.scrollTop;
	var testX = new Number(xPos.toString());
	var winX = document.body.offsetWidth/2;	
	
	if (testX>winX)
	{
		helpPane.style.left = xPos - xOffset - helpPane.offsetWidth;
		helpPane.style.top = yPos + yOffset;
	}
	else
	{
		helpPane.style.left = xPos + xOffset;
		helpPane.style.top = yPos + yOffset;
	}
}

// hide help pane
function hideHelp()
{
	var helpPane = document.getElementById("helpPane");
	
	helpPane.className = "helpPane_hidden";
	helpPane.innerHTML = "";
	
	display = false;
}


// preset help strings for the admin console
function consoleHelp(category)
{
	switch ( category ) 
	{
		case "pages" :
			return "<u><b>Page Control</b></u><br>Gives you the ability to:<br>&gt; Add or delete pages.<br>&gt; Re-Order the menu<br>&gt; Hide/Show pages in the menu.<br><b><small>(NOTE: Only Power-Admins may access this page)</small></b>";
		case "media" :
			return "<u><b>Media Control</b></u><br>Gives you the ability to:<br>&gt; Maintain Media<br>&gt; Create Projects<br>&gt; Delete Media<br>&gt; Download Media for backup.";
		case "users" :
			return "<u><b>User Control</b></u><br>Gives you the ability to:<br>&gt; Maintain User Credentials<br>&gt; Restrict Users.<br><b><small>(NOTE: Only Power-Admins may access this page)</small></b>";
		case "logo" :
			return "<u><b>Logo Control</b></u><br>Gives you the ability to:<br>&gt; Upload a new Logo.";
		case "stats" :
			return "<u><b>Statistics</b></u><br>Gives you the ability to:<br>&gt; View graphs of who has visited your site.";
		case "style" :
			return "<u><b>Appearance</b></u><br>Gives you the ability to:<br>&gt; Change your site's style.";
		case "metatags" :
			return "<u><b>Search Engine Words</b></u><br>Gives you the ability to:<br>&gt; Alter data for a <br>search engine submission.";
	}
}