//-----------------------------------------------------------------------------
// Start NetBank Script
//
//	Last Update:
//		30/04/2001    Brad    CR1400    Conditions Splash Page
//-----------------------------------------------------------------------------

function MinimumReq() {
  var oldVer = '/NetBank/Start/splash_start2.htm';
  var isNav = (navigator.appName == 'Netscape');
  var fVer = isNav ? parseFloat(navigator.appVersion) : parseFloat(navigator.appVersion.substring(navigator.appVersion.lastIndexOf('MSIE ') + 5));
  var sOS = navigator.platform;

	if(isNav && fVer < 4.06){
		location.href = oldVer;
		return false;
	} else if(!isNav && fVer < 4.01){
		location.href = oldVer;
		return false;
	} else if(sOS == 'MacPPC' && !isNav && fVer < 4.6){
		location.href = oldVer;
		return false;
	} else if(sOS == 'Win16' || sOS == 'Mac68K') {
		location.href = oldVer;
		return false;
	} else {
		return true;
	}
}

  var resize = "";
  var titlebar = "";
  var wvalue = screen.width - 7;
  var hvalue = screen.height - 75;

function newNetBankWindow() {
  var cou = "couApr2002";	// Conditions of Use
  //var cs = "csApr2002";	// Coming Soon
  //var cs = "nfnetMay2002";	// New Features
  var cs = "MISASep2002";	// MISA Redraw
  var couURL = "/login/conditions_splash.asp"; // Conditions of Use URL
  //var csURL = "/netbank/comingsoon_splash.asp"; // Coming Soon URL
  //var csURL = "/netbank/herenow_cookie_splash.asp"; // New Features URL
  var csURL = "/netbank/MISA_Splash/Default.html"; // MISA Redraw URL
  var probURL = "/netbank/problem_splash.asp"; // Problems URL
  var netbankCookie = "";
  var cookieExist = "";
  var expireDate = new Date

	if (navigator.appName == "Netscape") {
		if (screen.height >= 600) {
			wvalue = 798;
			hvalue = 572;
		} else {
			hvalue = hvalue - 2;
		}
		titlebar = ",titlebar=0";
	} else {
		resize = ",resizable";
	}

	expireDate.setMonth(expireDate.getMonth()+6)
	netbankCookie = document.cookie;  

	// Update old cookie to new format - remove on next conditions of use update.
	//if(netbankCookie.indexOf("newConditionsSplash=true") != -1){
	//	if(netbankCookie.indexOf(cs) == -1){
	//		document.cookie = "netBank=" + cou + ";domain=" + document.domain + ";path=;" + ";expires=" + expireDate.toGMTString() + ";";
	//	} else {
	//		document.cookie = "netBank=" + cou + cs + ";domain=" + document.domain + ";path=;" + ";expires=" + expireDate.toGMTString() + ";";
	//	}
	//	netbankCookie = document.cookie;
	//}
	
	//alert(netbankCookie);
	
	// Check for "Conditions of Use"
	if(netbankCookie == null || netbankCookie.indexOf(cou) == -1){
		if(netbankCookie.indexOf(cs) == -1){
			document.cookie = "netBank=" + cou + ";domain=" + document.domain + ";path=;" + ";expires=" + expireDate.toGMTString() + ";";
		} else {
			document.cookie = "netBank=" + cou + cs + ";domain=" + document.domain + ";path=;" + ";expires=" + expireDate.toGMTString() + ";";
		}
		setTimeout("location.href = \"" + couURL + "\"", 1);
	
	// Check for "Coming Soon"
	//} else if(netbankCookie.indexOf(cs) == -1){
	//	document.cookie = "netBank=" + cou + cs + ";domain=" + document.domain + ";path=;" + ";expires=" + expireDate.toGMTString() + ";";
	//	setTimeout("location.href = \"" + csURL + "\"", 1);

	// Start NetBank
	} else {
	
	// Display Problem Splash
//		setTimeout("location.href = \"" + probURL + "\"", 1);
		window.open('http://www.netbank.commbank.com.au/netbank/','NetBank', 'top=0,left=0,scrollbars=yes,status=yes,width=' + wvalue + ',height=' + hvalue + resize + titlebar + ',hotkeys=0');
	}
}