browserName = navigator.appName;
browserVer = parseInt(navigator.appVersion);
if (browserName == "Netscape" && browserVer >= 3) version = "net3";
else if (browserName == "Microsoft Internet Explorer" && browserVer >= 2) version = "net3";
else version = "net2";

function openWin(url, widthVal, heightVal) {
	if (widthVal == "") {
		widthVal = 590;
	}
	if (heightVal == "") {
		heightVal = 550;
	}
	if ((parseInt(navigator.appVersion)) >= 3) {
		msgWindow=open(url,"displayWindow","directories=no,height="+heightVal+",width="+widthVal+",location=no,menubar=no,resizable=no,scrollbars=yes,status=no,toolbar=no");
 	} else {
		alert("You must have Internet Explorer or Netscape version 3.0 or higher.");
	}
}

function openWinResize(url, widthVal, heightVal) {
	if (widthVal == "") {
		widthVal = 590;
	}
	if (heightVal == "") {
		heightVal = 550;
	}
	if ((parseInt(navigator.appVersion)) >= 3) {
		msgWindow=open(url,"displayWindow","directories=no,height="+heightVal+",width="+widthVal+",location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no");
 	} else {
		alert("You must have Internet Explorer or Netscape version 3.0 or higher.");
	}
}

function download_disclaim() {
	open("/popups/acrobatdisclaimer.html", "Preview", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,scrollbar=yes,resizable=yes,copyhistory=0,width=400,height=350");
}

function download_flash_disclaim() {
	open("/popups/flashdisclaimer.html", "Preview", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,scrollbar=yes,resizable=yes,copyhistory=0,width=400,height=350");
}

function openAsxLogin() {
	if ((parseInt(navigator.appVersion)) >= 3) {
		msgWindow=open("https://www.bnz.co.nz/static_files/asxlogin.html","displayWindow","width=477,height=509,menubar=yes,directories=yes,location=yes,resizable=yes,scrollbars=yes,status=yes,toolbar=yes");
 	} else {
		alert("You must have Internet Explorer or Netscape version 3.0 or higher.");
	}
}

function openNZSELogin() {
	if ((parseInt(navigator.appVersion)) >= 3) {
		nzseWindow=open("https://www.bnzist.co.nz/client/login.php","nzseWindow");
	} else {
		alert("You must have Internet Explorer or Netscape version 3.0 or higher.");
	}
}

function openWindow(url) {
	var winWidth = 700;
	var winHeight = 500;
	var options = "width=" + winWidth + ",height=" + winHeight + ",";
	options += "resizable=yes,scrollbars=yes,status=yes,";
	options += "menubar=yes,toolbar=yes,location=no,directories=yes,channelmode=no";
	var newWin = window.open(url, 'newWin', options);
	newWin.focus();
}

var aMenu = new Array()


	var agt = navigator.userAgent.toLowerCase();
	var is_major = parseInt(navigator.appVersion);
	var is_ie = (agt.indexOf('msie') != -1);
	var is_ie4up = (is_ie && (is_major >= 4));


function InsertBookmarkingLink() {
		if (is_ie4up)
			document.write('<a href="Javascript:' + "window.external.AddFavorite('http://cytomax.com.au','Elite Sports Direct Limited')" + '">Bookmark this page now</a>');
		else
			document.write('Bookmark this page now');
	}

var dhtml = 0;
 if ((document.all)||(document.layers)) dhtml=1;

var Total_Images = 18;
var images_cached = 0;
var initial = 0;

var jsLoaded=0;
function sendHandler(num1, num2) {
  if (jsLoaded == 1) {
    layerHandler(num1, num2);
  }
}

function putImage(imgDocID,imgObjName) {
	// 	 manages mouseOver animations
	//   imgDocID - the name or number of the document image to be replaced
	//   imgObjName - the name of the image object to be swapped in
	window.document.images[imgDocID].src = eval(imgObjName + ".src");
}

var menu = new Array(20);
function StartApplet() {
	if (browserName == "Netscape") ribWindowLocation = '/static_files/nn_login.html';
	else ribWindowLocation = '/static_files/ie_login.html';
	window.location.reload(false);
	ribWindow=window.open(ribWindowLocation,"RegularBanking","status,scrollbars,width=797,height=550");
	ribWindow.moveTo(screen.avaiLeft,screen.availTop);
	ribWindow.focus();
}

var layerList = new Array();
var layerTop = 105;
var layerLeft = 160;
var count = -1;
function createLayer(name, left, top, width, height, visible, background, content) {
	var z = layerList.length;
	var layer;
	layerTop = layerTop + 26;
	layerList[z] = name;
	count++;
	var label;
	label = (eval("menu" + count))

	if (label.length > 16) {
		layerTop = layerTop + 19;
	}
  if (document.layers) {
    if (background == 'NULL') {
      document.writeln('<layer name="' + name + '" left=' + left + ' top=' + top + ' width=' + width + ' height=' + height +  ' visibility=' + (visible ? '"show"' : '"hide"') + ' z-index=' + z + '>');
      document.writeln(content);
      document.writeln('</layer>');
    } else {
      document.writeln('<layer name="' + name + '" left=' + left + ' top=' + top + ' width=' + width + ' height=' + height +  ' visibility=' + (visible ? '"show"' : '"hide"') + ' background=' + background + ' z-index=' + z + '></layer>');
    }
      layer = getLayer(name);
      layer.width = width;
      layer.height = height;
  }

  if (document.all) {
    top+=8;
    document.writeln('<div id="' + name + '" style="position:absolute; overflow:none; left:' + left + 'px; top:' + top + 'px; width:' + width + 'px; height:' + height + 'px;' + ' visibility:' + (visible ? 'visible;' : 'hidden;') + ' z-index:' + z + '">');
    document.writeln(content);
    document.writeln('</div>');
  }

  clipLayer(name, 0, 0, width, height);
}

function hideLayer(name)
{
  var layer = getLayer(name);
  if (document.layers)
    layer.visibility = "hide";
  if (document.all)
    layer.visibility = "hidden";
}

function showLayer(name)
{
  var layer = getLayer(name);
	if (document.layers)
	{
		layer.visibility = "show";
	}
	if (document.all)
	{
		layer.visibility = "visible";
	}
}

function clipLayer(name, clipleft, cliptop, clipright, clipbottom) {

  var layer = getLayer(name);

  if (document.layers) {
    layer.clip.left   = clipleft;
    layer.clip.top    = cliptop;
    layer.clip.right  = clipright;
    layer.clip.bottom = clipbottom;
  }
  if (document.all)
    layer.clip = 'rect(' + cliptop + ' ' +  clipright + ' ' + clipbottom + ' ' + clipleft +')';
}

function getLayer(name) {
	if (document.layers) {
		return(document.layers[name]);
	}
	if (document.all) {
		layer = eval("document.all." + name + ".style");
		return(layer);
	} else {
		return(null);
	}
}

var spacer = "/images/buffer.gif";

var TimerID;
var itemCount = 0;
