/* top */

function setStartPersonal() {
        //alert("set start page as personal");
	setStartPage(window.location.href);
	openWindow('setstart','/masterkeyWeb/execute/static/setstart_personal.html',400,270,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no',window,'left','top',0,0,''); 
}

function login() {
//    eraseCookie("JSESSIONID");
//    top.location.href = '/masterkeyWeb/execute/InvHome';
	var url = window.location.href;
	var isStaging = url.indexOf('mkbau');
	//alert(isStaging);
	if (isStaging == -1) {
	 top.location.href = 'https://www.mlc.com.au/masterkeyWeb/execute/InvHome';
	} else {
	 top.location.href = 'https://mkbau.mlc.com.au/masterkeyWeb/execute/InvHome';
	} 
}
function pageLoc(uri) {

	var url = window.location.href;

	//alert(isStaging);
	if (url.indexOf('stagingweb') == -1) {
	 top.location.href = "http://www.mlc.com.au" + uri;
	} else {
	 top.location.href = "http://stagingweb.mlc.com.au" + uri;
	} 
}

//This function is converting http to https. Used in homepage 'New User' AA 5/4/06
function setHttps(uri){

	var url = window.location.href;
	var temp = new Array();
	var newUrl = '';
	temp = url.split('/cms/dynamic');
	temp2= temp[0].split('//');
	newUrl = 'https://' +temp2[1]+uri;
	top.location.href = newUrl;
}

var winParms;
winParms = winParms + 'toolbar=no,menubar=no,resizable=yes,scrollbars=yes,status=yes,dependent=no';
winParms = winParms + ',outerwidth=' + String(screen.availWidth*.95) + ',outerheight=' + String(screen.availHeight*.90);
winParms = winParms + ',screenX=' + String(screen.availWidth - screen.availWidth*.95) + ',screenY=' + String(screen.availHeight - screen.availHeight*.95)


//======================================
//Extracted from 1_20_30_20.html
//======================================

//var isNav, isIE, isIE55
//var coll = ""
//var styleObj = ""

//if (parseInt(navigator.appVersion) >= 4) {
//	if (navigator.appName == "Netscape") {
//		isNav = true;
//	} else {
//		isIE = true;
//		coll = "all.";
//		if(navigator.appVersion.indexOf("5.5")!=-1) isIE55 = true;
//	}
//}

function handleResize(){
	location.reload();
	return false;
}
//if (isNav) {
//	window.captureEvents(Event.RESIZE);
//	window.onresize = handleResize;
//}
function popUp(loc) {
	opener.location.href = loc;
}


// written by Simon Abela to redirect to execute/generalhome if bookmark set and is set to advisor or business
function checkBookmark() {
   var advPage = '0.html';
   var busPage = '3.html';
   var bookmark = GetCookie('MLC_Bookmarked_Start_Page'); //MLC_Bookmarked_Start_Page
   //alert('bookmark is ' + bookmark);
   if( bookmark != null ) {
   	if( (bookmark.substring(bookmark.length-6,bookmark.length) == advPage) ||  (bookmark.substring(bookmark.length-6,bookmark.length) == busPage)) {
	   top.location.href='http://www.mlc.com.au/masterkeyWeb/execute/generalhome';
   	} 
   }
}

function printerFriendlyPage(pageAddr) {
    //var pageAddr = '/masterkeyWeb/execute/printerfriendly';

    var winFee = window.open(pageAddr, 'Printer', winParms);
    winFee.focus();
}
    
function dynPagePrint() {
	indow.print();
}
