///////////////////////////////////////////////////////
//::-  Common JavaScript For WolveleyCamp.org.uk  -:://
//::-      © Copyright DiGi-Masters.com 2003      -:://
///////////////////////////////////////////////////////

//# Sets The Windows Statusbar Text #//
function SetStatus(toStr) 
{
	if(toStr == "defStr") {  
		toStr = "... Welcome To WolverleyCamp.org.uk ...";
	}
	window.status = toStr;
}

//# Displays Requested Page In 'mainFrame' #//
function ShowPage(pgeID)
{
	switch(String(pgeID).toUpperCase()) {
	case "HOME":		mainFrame.location.href = "home.htm";			break;
	case "NEWS":		mainFrame.location.href = "news.php";			break;
	case "HISTORY":		mainFrame.location.href = "history.htm"; 		break;
	case "FORUM":		mainFrame.location.href = "forum/";			break;
	case "COMMUNITY":	mainFrame.location.href = "community.htm";		break;
	case "PROFILES":	mainFrame.location.href = "profiles/index.htm";	break;
	case "CONTACT":		mainFrame.location.href = "contact.htm";		break;
	case "SPONSORS":	mainFrame.location.href = "sponsors.htm";		break;
	case "GALLERY":		mainFrame.location.href = "gallery.htm";		break;
	default:			
		alert("Unidentified Page!");
		ShowPage("HOME");
	}
}

//# Shows PopUp Help Page #//
function ShowHelp(hlpKey, hlpID)
{
	var  hlpFileUrl = new String("help/" + hlpKey + hlpID + ".htm");
	var  iHlpID 	= new Number(hlpID);
	
	var  iWid = screen.width * 0.5;
	var  iHei = screen.height * 0.7;
	var  iLeft = (iWid / 2), iTop = 60;
	
	window.open(hlpFileUrl, "wcmpHelp", "width=" + iWid + ",height=" + iHei + ",left=" + iLeft + ",top=" + iTop +
				",scrollbars,statusbar,resizable,toolbar,menubar");
	
}

//# Parses Data Passed With The URL #//
function ParsePassedData() 
{
	if(window.location.search.substring(1) != "") {
		var i, argSplt = new Array();
		var inArgs = new Array();
		inArgs = window.location.search.substring(1).split("&");

		for(i = 0; i < inArgs.length; i++) {
			argSplt = inArgs[i].split("=");
			ProcessArg(argSplt[0], argSplt[1]);
		}
	}
}

//# Called By ParsePassedData() To Check Individual Arguments #//
function ProcessArg(argName, argVal) 
{
	switch(argName)
	{
	case "pge":
		ShowPage(argVal);
		break;

	}
}
