
/* to refresh the page when the browser is resized */
var origWidth, origHeight;
origWidth = window.innerWidth; 
origHeight = window.innerHeight;
window.onresize = function() { if (window.innerWidth != origWidth || window.innerHeight != origHeight) history.go(0); init(); }	

function dom_browser() {
	this.myNav = this.navigator;
	this.version = this.navigator.appVersion;
	this.name = this.navigator.appName;
	this.ns4 = (document.layers) ? true : false;
	this.ns6 = (this.navigator.userAgent.indexOf("Netscape6") != -1) ? true : false;
	this.dom = (document.getElementById) ? true : false;
	this.ie4 = (document.all) ? true : false;
	this.mac = (this.version.indexOf("Mac") != -1) ? true : false;
	this.ie = (this.version.indexOf("MSIE") != -1) ? true : false;
	this.windows = (this.version.indexOf("Windows") != -1) ? true : false;
	this.hasPlugins = (this.navigator.plugins) ? true : false;
}

dom_browser();

/* resize bug fix for mac ie */
function globalResize() {
	if (document.body.clientWidth < 775) {
		document.getElementById("home").style.width = "774px";
	} else {
		document.getElementById("home").style.width = "100%";
	}
}	

function init() {
	if (ie && mac) {
		globalResize();
	}
}

/* copy of the function in nav.js - modifications made by Helen --> helen@massmedia.com.au on 09/02/2005 */
function newWindow(mypage,myname,w,h,features) {
	var settings = "";
	if(w == "" && h == "") { // if-statement added to allow pages to open in a new window without a specified width and height
		//do nothing i.e. do not set a height and width for the new window
	}
	else {	
		if (screen.width) {
			var winl = (screen.width-w)/2;
			var wint = (screen.height-h)/2;
		} else {
	  		winl = 0;
			wint = 0;
		}
		if (winl < 0)
			winl = 0;
	 	if (wint < 0)
			wint = 0;
		settings = 'height=' + h + ',';
		settings += 'width=' + w + ',';
		settings += 'top=' + wint + ',';
		settings += 'left=' + winl + ',';
	}
	settings += features;
	win = window.open(mypage,myname,settings);
	win.window.focus();
}	

function openHelp(myPage) {
	var myUrl;
	switch (myPage) {
		// register page
		case "getting_started":
			myUrl="/help/Getting_started.htm";
			break;
		// default
		default:
			myUrl="/help/Getting_started.htm";
			break;
	}
	helpWindowRef = window.open(myUrl, 'helpWindowRef', 'width=450,height=500,menubar=no,statusbar=no,resizable=yes,scrollbars=yes');
}			
