   // resaturate core.js
   // www.resaturate.com
   // ____________________________________________________________________________________________________________
   
   
   // Client Browser and Platform Check
   // Original code from http://developer.apple.com/internet/_javascript/
   // I took it from there and Kaliber10000 - http://www.k10k.net
  
  
   var its;
	var browserName;
	var browserNameLong;
	var browserVersionNo;
	var browserVersionNoLong;
	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;
		
		// and just the version number
		browserVersionNo = its.major;
		
		// and just the full version number i.e. 4.72
		browserVersionNoLong = (its.major+its.minor)-its.major;
	
	}
  
	// Remove the link border in IE5/NS6

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

	function getLinksToBlur() {
		if (!document.getElementById) return
		links = document.getElementsByTagName("a");
		for(i=0; i<links.length; i++) {
			links[i].onfocus = unblur
		}
	}
	
  	
  // Netscape 4 resize issue
  // Code reloads the current page in Netscape when the window resizes (which would normaly cause CSS positional problems).
  // Also makes sure a resize event doesn't cause the page to reload when scrollbars appear.
  // This should prevent early Netscapes from infinitely reloading a page after the reload event occurs once.
  // Source: Webmonkey Code Library - http://www.hotwired.com/webmonkey/javascript/code_library/
  // Rejigged by Mark Russell

  function runResizeFix() {
    if ((browserName=="NS"&&browserVersionNo<=4)&&(document.solveResize.runResizeFix.initWindowWidth != window.innerWidth || document.solveResize.runResizeFix.initWindowHeight != window.innerHeight)) {
    document.location=document.location;
    }
  }

  function setResizeFix() {
    if (browserName=="NS"&&browserVersionNo<=4) {
      if (typeof document.solveResize == 'undefined'){
        document.solveResize = new Object;
      }
      if (typeof document.solveResize.scaleFont == 'undefined') {
        document.solveResize.runResizeFix = new Object;
        document.solveResize.runResizeFix.initWindowWidth = window.innerWidth;
        document.solveResize.runResizeFix.initWindowHeight = window.innerHeight;
      }
    window.onresize = runResizeFix;
    }
  }
