
var ns = (document.layers)? true:false;
var ie = (document.all)? true:false;
var GetElementByID = (document.getElementById)? true:false;


function GetElement(ID)
{
	if(GetElementByID)
		return document.getElementById(ID);
	else if(ie)
		return document.all[ID];
	else
		return document.layers[ID];	
}

function SetPopupDisplay(width, height, scrollbars)
{

	window.resizeTo(width, height); 
	if(!scrollbars)
		window.document.body.scroll = "no";

}

function LoadMainPage()
{
	SetHelpLink('distance');
	SetHelpLink('fulltime');
	SetHelpLink('parttime');
	SetHelpLink('summer');
	SetHelpLink('workplace');
	SetHelpLink('elearning');
	SetHelpLink('college');
	SetHelpLink('polytechnic');
	SetHelpLink('private');
	SetHelpLink('university');
	SetHelpLink('wananga');
	SetHelpLink('workplacet');
	SetHelpLink('adult');
	SetHelpLink('bridging');
	SetHelpLink('certificate');
	SetHelpLink('diploma');
	SetHelpLink('degree');
	SetHelpLink('staircasing');
	
}

function SetHelpLink(LinkID)
{
	Link = GetElement(LinkID);
	Link.href="javascript:ShowHelpPopup('" + Link.href + "');";
	//Link.onclick="javascript:ShowHelpPopup('" + Link.href + "');";
	Link.target="";
}

function ShowHelpPopup(Href)
	{	
		var popupwidth, popupheight;
		var popupleft, popuptop;
		var WindowOptions;
		var temp;

		if(Href.indexOf('?') > -1 )
			Href = Href.replace('?', '?js=1&');

		popupwidth = 400;
		popupheight = 360;

		popupleft = (window.screen.width - popupwidth) / 2;
		popuptop = (window.screen.height - popupheight) / 2;
		
		WindowOptions = "width=" + popupwidth + ",height=" + popupheight + "," + 
						"scrollbars=yes,top=" + popuptop + ",left=" + popupleft + "";
		
		var HelpWindow;				
		HelpWindow = window.open(Href, "Help", WindowOptions);
		HelpWindow.focus();
	}