// browser checking from CC
// 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();
		
		// DOM-enabled browser?
		if (!document.getElementById) {
			browserNew = false;
		} else {
			browserNew = true;
		}

		// browser name
		if (its.opera) {
			browserName = "Opera";
		} else if (its.ie) {
			browserName = "IE";
		} else {
			browserName = "NS";
		}

		// browser number
		browserNameLong = browserName + its.major;
	}
	

// PRELOADING THE MOUSEOVER IMAGES
// Works: IE4+, NS4+, Opera

	function createObject(imgName,imgSrc)
	{
		if (loadingFlag) {
			eval(imgName + ' = new Image()');
			eval(imgName + '.src = "' + imgSrc + '"');
			return imgName;
		}
	}


// MOUSEOVER IMAGE SWITCHING
// Works: IE4+, NS4+, Opera
// Notes: NS4 needs the DIV-name in there if image is in a DIV

	function changeImage(layer,imgName,imgObj)
	{
		if (preloadFlag) {
			if (browserNew) {
				document.getElementById(imgName).src = eval(imgObj+'.src');
			}
			if ((!browserNew) && (browserName == "NS") && (layer!=null)) {
				eval('document.'+layer+'.document.images["'+imgName+'"].src = '+imgObj+'.src');
			} else {
				document.images[imgName].src = eval(imgObj+'.src');
			}
		}
	}

	
// 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
			}
		}
	}


// GENERIC CLASS SWITCHER
// Works: IE4+, NS6+
	function cSwitcher(thisId,newClass)
	{
	    if (browserNew) {
			d = document.getElementById(thisId);
            d.className = newClass;
		} else {
			d = document.all[thisId];
			d.className = newClass;
		}
	}


// DOM / GET PROPERTY
// Works: IE5+, NS6+, Opera

	function getIdProperty(id,property)
	{
		var styleObject = document.getElementById( id );
		if (styleObject != null) {
			styleObject = styleObject.style;
				if (styleObject[property]) {
					return styleObject[ property ];
				}
			}
		return (styleObject != null) ?
		styleObject[property] :
		null;
	}


// DOM / SET PROPERTY
// Works: IE5+, NS6+, Opera

	function setIdProperty(id,property,value)
	{
		var styleObject = document.getElementById( id );
		if (styleObject != null) {
			styleObject = styleObject.style;
			styleObject[ property ] = value;
		}
	}

// HIDE AND SHOW LAYERS
// Works: IE4+, NS4+, Opera

	function hide(id)
	{
		if (browserNew) {
			setIdProperty(id,"visibility","hidden");
		} else {
			if (browserName == "NS") { document.layers[id].visibility = "hide"; }
			else { document.all[id].style.visibility = "hidden"; }
		}
	}

	function show(id)
	{
		if (browserNew) {
			setIdProperty(id,"visibility","visible");
		} else {
			if (browserName == "NS") { document.layers[id].visibility = "show"; }
			else { document.all[id].style.visibility = "visible"; }
		}
	}


// CHANGE DISPLAY VALUE FOR LAYERS
// Works: IE4+, NS4+, Opera

	function switchDisplay(id,value)
	{
		if (browserNew) {
			setIdProperty(id,"display",value);
		} else {
			if (browserName == "NS") {
				document.layers[id].display = value;
			} else {
				document.all[id].style.display = value;
			}
		}
	}
	
// LOAD IFRAME/LAYER
// Works: IE4+, NS4+, Opera
// Notes: In NS4 use layers instead of DIVs

	function load(targetWindow, page)
	{
		if ((!browserNew) && (browserName == "NS")) {
			document.layers[targetWindow].src = page;
		}
		else {
			eval('window.'+targetWindow+'.location.href = page');
		}
	}

	
// IFRAME HISTORY METHOD (FLASH BACK BUTTON)
// Works: IE5+, NS4+

    function updateURL(myString)
    {
        if(browserName != "IE")
        {
            window.frames["history"].location = 'timeline_history.html?'+myString;
        }else{
            document.all.history.src = 'timeline_history.html?'+myString;
        }
        
    }