// POPUP STANDARD open a promo window - opens at top left of screen
// to use: <a href="http://www.suncorp.com.au" target="_blank" onclick="open_window(this.href);return false;">Suncorp</a>
function open_window(url) {
	w = window.open(url, "_blank", "width=640,height=450,toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,screenX=0,screenY=0,left=0,top=0");
	w.opener = this;
	w.focus();
}
// SANDSTONE STANDARD open a promo window - opens small launch window
// to use: <a href="http://www.suncorp.com.au" target="_blank" onclick="open_app(this.href);return false;">Suncorp</a>
function open_app(url) {
	w = window.open(url, "_blank", "width=540,height=330,toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=no");
	w.opener = this;
	w.focus();
}
// EXTERNAL STANDARD open an external window at 640 x 450 - opens at top left of screen
// to use: <a href="http://www.suncorp.com.au" target="_blank" onclick="open_external(this.href);return false;">Suncorp</a>
function open_external(url) {
	w = window.open(url, "_blank", "width=640,height=450,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,screenX=0,screenY=0,left=0,top=0");
	w.opener = this;
	w.focus();
}
// Used by any link which is redirecting to a suncorp site.
function open_suncorp(url, name){
	w = window.open("/gio/suncorp_link.html?" + escape(url), "_blank", "width=640,height=450,toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,screenX=0,screenY=0,left=0,top=0");
	w.opener = this;
	w.focus();
}
// to close any window neatly
// to use: <a href="javascript:close_window();">Suncorp</a>
function close_window() {
	if (window.opener) {
		window.opener.focus();
	}
	window.close();
}
// Used by any link which is redirecting to a suncorp site.
// to use: <a href="http://www.suncorp.com.au" target="_blank" onclick="open_window(this.href);return false;">Suncorp</a>
//function open_window(url) {
//	w = window.open("/gio/suncorp_link.html?" + escape(url), "_blank", "width=640,height=450,toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,screenX=0,screenY=0,left=0,top=0");
//	w.opener = this;
//	w.focus();
//}
// check font size & fix if too small
function emsTweak() {
	if ((document.createElement) && (document.createTextNode)) {
		document.writeln('<div id="emsTest" style="position:absolute; visibility:hidden; font-family:arial,helvetica,sans-serif">&nbsp;<br />&nbsp;<br />&nbsp;<br />&nbsp;<br />&nbsp;<br /></div>');
		var scaling=100;
		if ((navigator.platform=="Win32") && (navigator.appName=="Microsoft Internet Explorer")) scaling=105;
		var h=999;
		if (document.getElementById('emsTest').clientHeight) h=parseInt(document.getElementById('emsTest').clientHeight);
		else if (document.getElementById('emsTest').offsetHeight) h=parseInt(document.getElementById('emsTest').offsetHeight);
		if (h<85) document.body.style.fontSize=Math.round(scaling*85/h)+"%";
	}
}

// PI Internet function - added 1st Sept
function open_fullscreen(theURL,winName, unusedfeatures) 
{ //new version from Bailee
	var sw=screen.availWidth - 12;
	var sh=screen.availHeight - 53;
	w = window.open(theURL, winName, "scrollbars=yes,resizable=yes,width=" + sw + ",height=" + sh + ",toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,screenX=0,screenY=0,left=0,top=0");
	w.opener = this;
	w.focus();
}