isLoaded = 1;

// Generic browser checking code	
function checkBrowser(){
	this.ver=navigator.appVersion
	this.dom=document.getElementById?1:0
	this.mac=(navigator.appVersion.indexOf('Mac') != -1)?1:0	
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom)?1:0;
	this.ie4=(document.all && !this.dom)?1:0;
	this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5);
	this.safari=(this.ver.indexOf("Safari/8")>-1)?1:0;
	return this;
}


function reDo(){ window.location.reload() }

if (document.layers) {
	origWidth=innerWidth;
	origHeight=innerHeight;
	onresize=function() { if(innerWidth!=origWidth||innerHeight!=origHeight)location.reload() }
} else {
    window.onresize = reDo;
}

// Once page is loaded, set variable to allow DHTML menus to be activated
function pageLoaded() {
	isLoaded = 1; 
}

// Check that page is loaded, otherwise do nothing
function homeActivateLayers(div,act) {
	if (isLoaded == 1) {
		homeShowHideLayers(div,act)
	}
}

// DHTML Menu Functions
function homeSetHideTimeout() {
  if (this.hideTimer) { clearTimeout(this.hideTimer); }
  this.hideTimer = setTimeout('homeHideAllLayers()', 1000);
}

function homeClearHideTimeout() {
  if (this.hideTimer) clearTimeout(this.hideTimer);
}

function homeHideAllLayers() {
	if (document.getElementById) {
		if (document.getElementById('bdworldwide')) document.getElementById('bdworldwide').style.visibility="hidden";
	} else if (navigator.appName == 'Netscape' && document.layers != null) {
		if (document.layers['bdworldwide']) document.layers['bdworldwide'].visibility = 'hide';
    } else if (document.all != null) {
		if (document.all['bdworldwide']) document.all['bdworldwide'].style.visibility = 'hidden';
	}
}

function homeShowHideLayers() {
  homeClearHideTimeout();
  var i, visStr, args, theObj;
  args = homeShowHideLayers.arguments;
  for (i=0; i<(args.length-1); i+=2) {
    visStr   = args[i+1];
	if (document.getElementById) {
       if (visStr == 'show') visStr = 'visible';
       if (visStr == 'hide') visStr = 'hidden';
 	   document.getElementById(args[i]).style.visibility=visStr;
    } else if (navigator.appName == 'Netscape' && document.layers != null) {
       document.layers[args[i]].visibility = visStr;
    } else if (document.all != null) {
       if (visStr == 'show') visStr = 'visible';
       if (visStr == 'hide') visStr = 'hidden';
       document.all[args[i]].style.visibility = visStr;
  	}
  }
}

var objBrowser=new checkBrowser();