//   +++++++++++++++++++++++++++++++++++++++++++++++++
//   (c) 2003 hagateatern all rights reserved
//   +++++++++++++++++++++++++++++++++++++++++++++++++
//   www.hagateatern.se
//   +++++++++++++++++++++++++++++++++++++++++++++++++
//   designed by :monc (www.monc.se)
//   +++++++++++++++++++++++++++++++++++++++++++++++++

//   Some scripts are borrowed from k10k (www.k10k.net)





// CHECK CLIENT BROWSER & PLATFORM
// Works: IE4+, NS4+, Opera

	var its;
	var browserName = '';
	var browserNameLong = '';
	var browserNew = '';
	var preloadFlag = false;
	var Macintosh = navigator.userAgent.indexOf('Mac')>0;

	function its() {
		var n = navigator;
		var ua = ' ' + n.userAgent.toLowerCase();
		var pl = n.platform.toLowerCase();
		var an = n.appName.toLowerCase();

		// browser version
		this.version = n.appVersion;
		this.nn = ua.indexOf('mozilla') > 0;

		// 'compatible' versions of mozilla aren't navigator
		if(ua.indexOf('compatible') > 0) {
			this.nn = false;
		}
		
		this.opera = ua.indexOf('opera') > 0;
		this.ie = ua.indexOf('msie') > 0;
		this.major = parseInt( this.version );
		this.minor = parseFloat( this.version );

		// platform
		this.mac = ua.indexOf('mac') > 0;
		this.win = ua.indexOf('win') > 0;

		// workaround for IE5 which reports itself as version 4.0
		if(this.ie) {
			if(ua.indexOf("msie 5") > 1) {
				var msieIndex = navigator.appVersion.indexOf("MSIE") + 5;
				this.major = parseFloat(navigator.appVersion.substr(msieIndex,3));
			}
		}

		return this;
	}

	function browserNaming() {
		its = new its();
		
		// is it a DOM-enabled browser?
		if (!document.getElementById) {
			browserNew = false;
		}
		else {
			browserNew = true;
		}

		// need the name, too
		if (its.opera) {
			browserName = "Opera";
		}
		else if (its.ie) {
			browserName = "IE";
		}
		else {
			browserName = "NS";
		}

		// and the number
		browserNameLong = browserName + its.major;
	}


// REMOVES THE LINK BORDER IN IE4+, NS6
// Works: IE4+, NS6+
// Notes: In NS6 the select tags are not blurred

	function unblur() {
		this.blur();
	}

	function getLinksToBlur() {
		if ((browserNew) || (browserName == "IE")) {
			if (browserNew) {
				links = document.getElementsByTagName("a");
			}
			else {
				links = document.all.tags("a");
			}
			for(i=0; i<links.length; i++) {
				links[i].onfocus = unblur
			}
		}
	}
	

// POPUP WINDOW
// Works: IE4+, NS4+, Opera
// Notes: IE4/IE4.5 for the mac spawns windows 17px too short

	function openWin(desktopURL,windowName,width,height) {
		if ((Macintosh) && ((browserNameLong == "IE4") || (browserNameLong == "IE4.5"))) {
 			var newheight = parseInt(height + 17);
		}
		else {
			var newheight = height;
		}
		window.open(desktopURL,windowName,'toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=0,width='+width+',height='+newheight+',resizable=0,top=30,left=30');
	}


// STATUS

	function stat(txt) {
		window.status = txt;
	}
	

// ROLLOVERS

	function rollover(id,param,text) {
		if (browserNew) {
			d = document.getElementById(id);
			if (param == "off") {
				d.style.backgroundColor='#FF8000';
			}
			else {
				d.style.backgroundColor='#000000';
			}
		}
		else {
			d = document.all[id];
			d.className = 'btn'+param;
		}
		if (param == "off") {
			stat('');
		}
		else {
			stat(text);
		}
	}


// RESIZE BUG IN NS4

	function WM_netscapeCssFix() {
		if (document.WM.WM_netscapeCssFix.initWindowWidth != window.innerWidth || document.WM.WM_netscapeCssFix.initWindowHeight != window.innerHeight) {
			document.location = document.location;
		}
	}

	function WM_netscapeCssFixCheckIn() {
		if ((navigator.appName == 'Netscape') && (parseInt(navigator.appVersion) == 4)) {
			if (typeof document.WM == 'undefined'){
				document.WM = new Object;
			}
			if (typeof document.WM.WM_scaleFont == 'undefined') {
				document.WM.WM_netscapeCssFix = new Object;
				document.WM.WM_netscapeCssFix.initWindowWidth = window.innerWidth;
				document.WM.WM_netscapeCssFix.initWindowHeight = window.innerHeight;
			}
			window.onresize = WM_netscapeCssFix;
		}
	}

	WM_netscapeCssFixCheckIn();


// CATCH ALL ERRORS...

	function stopError() {return true;}
	window.onerror=stopError;


//   +++++++++++++++++++++++++++++++++++++++++++++++++
//   END OF PAGE