// =====[ INITIALISATION ]======================================================
var width = Math.round(screen.width * 0.990);
var height = Math.round(screen.height * 0.964);

var Win; // stores any popup windows in this variable





// =====[ Core TIME Procedures ]================================================
function OpenGlossary(url) {
	gloss = window.open(url,"glosswin",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=440,height=340')
	if (gloss) {
			gloss.focus();
		}	 
}

function OpenDocuments(url) {
	docs = window.open(url,"docswin",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=440,height=340')
		if (docs) {
			docs.focus();
		}	
}

function OpenLinks(url) {
	lnks = window.open(url,"lnkwin",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=440,height=340')
		if (lnks) {
			lnks.focus();
		}	
}

function OpenHelp(url) {
	hlp = window.open(url,"helpwin",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=440,height=340')
		if (hlp) {
			hlp.focus();
		}	
}

function OpenContacts(url) {
	contactsWin = window.open(url,"contactsWin",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=440,height=340')
		if (contactsWin) {
			contactsWin.focus();
		}	
}

function OpenPolicy(url) {
	pol = window.open(url,"policywin",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=600,height=430')
		if (pol) {
			pol.focus();
		}	
}

function OpenTopMenuPopup(url) {
	topMenu = window.open(url,"topMenuWin",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=440,height=340')
	if (topMenu) {
			topMenu.focus();
		}	 
}


function openWindow(url) {
  Win = window.open(url,'openWindow','width=' + width +',height=' + height + ',left=0,top=0,resizable=0,scrollbars=1,toolbar=0,location=0,directories=0,status=0,menubar=0');
	if (Win) {
		Win.focus();
	}
}

function displayWindow2(url, winID, width, height) {
	Win = window.open(url,'displayWindow_','width=' + width +',height=' + height + ',left=' + ((screen.width - width) / 2) + ',top=' + ((screen.height - height) / 2) + ',resizable=0,scrollbars=1,toolbar=0,location=0,directories=0,status=0,menubar=0');
	if (Win) {
		Win.focus();
	}
}

function handleBeforeUnload() {
	if (Win) Win.close();
}
