var browser = navigator.appName;
var version = parseInt(navigator.appVersion);
var NS4 = (browser == "Netscape" && version >= 4);
var IE4 = (browser == "Microsoft Internet Explorer" && version >= 4);
var NS3 = (browser == "Netscape" && (3 <= version < 4));
var NS2 = (browser == "Netscape" && version < 3);
var IE3 = (browser == "Microsoft Internet Explorer" && version < 4);

// *** PLATFORM ***
var agt=navigator.userAgent.toLowerCase()
if (agt.indexOf("mac") != -1) {
  if (IE4) {
	IE4 = false;
    IE3 = true;
  }
}

if (NS4 || IE4) {
	//Currently not used
	bBit = "";
	if (navigator.appName == "Netscape") {
		//building the string: "document.layers['LayerName'].whatever..."
		layerRef="document.layers";
		layerStyleRef="layer.";
		styleSwitch="";
	} else {
		//building the string: "document.all['LayerName'].style.whatever..."
		layerRef="document.all";
		layerStyleRef="layer.style.";
		styleSwitch=".style";
	}
} else {
	bBit = "0";
}

function Fix() {
  if (document.EComp.Fix.initWindowWidth != window.innerWidth || document.EComp.Fix.initWindowHeight != window.innerHeight) {
    document.location = document.location;
  }
}

function FixCheckIn() {
  if (NS4) {
    document.EComp = new Object;
    document.EComp.Fix = new Object;
    document.EComp.Fix.initWindowWidth = window.innerWidth;
    document.EComp.Fix.initWindowHeight = window.innerHeight;
    window.onresize = Fix;
  }
}

FixCheckIn();

function setCookieNow(name,value) {
  document.cookie = name + "=" + escape(value) + "; path=/";
}
