/* ********************************************************
 * USER-AGENT (BROWSER) DETECTION CODE
 * ******************************************************** */

  var agt=navigator.userAgent.toLowerCase()

  this.major = parseInt(navigator.appVersion)
  this.minor = parseFloat(navigator.appVersion)

  
  //Netscape navigator www.netscape.com
  this.nav   = ((agt.indexOf('mozilla')!=-1) && ((agt.indexOf('spoofer')==-1)
             && (agt.indexOf('compatible') == -1)))
  this.nav2 = (this.nav && (this.major == 2))
  this.nav3 = (this.nav && (this.major == 3))
  this.nav4 = (this.nav && (this.major == 4))
  this.nav4up = this.nav && (this.major >= 4)
  this.navonly = (this.nav && (agt.indexOf(";nav") != -1))
  this.nav6 = this.nav && (agt.indexOf('netscape6/6') != -1)
  this.nav7 = this.nav && (agt.indexOf('netscape/7') != -1)

  //Microsoft Internet Explorer (MSIE) www.microsoft.com/ie
  this.ie   = (agt.indexOf("msie") != -1)
  this.ie3  = (this.ie && (this.major == 2))
  this.ie4  = (this.ie && (this.major == 4))
  this.ie4only  = this.ie  && (agt.indexOf('4.01')!=-1)
  this.ie4up  = this.ie  && (this.major >= 4)
  this.ie5  = this.ie  && (agt.indexOf('5.0')!=-1)
  this.ie501 = this.ie && (agt.indexOf('5.01')!=-1)
  this.ie5up  = this.ie  && (this.major >= 5)
  this.ie55 = this.ie  && (agt.indexOf('5.5')!=-1)
  this.ie6  = this.ie  && (agt.indexOf('6.0')!=-1)
  
  //Mac Extensions
  this.mac = (agt.indexOf('mac')!=-1)
  this.ie50mac =this.ie5 && this.mac
  this.ie513mac = this.ie && (agt.indexOf('5.13')!=-1) && this.mac

    
  
  // does not work, must either substring or regexp as version string has both 4.0 and 6.0
  // this.ie6up  = this.ie  && (this.major >= 6)

  //Opera www.operasoftware.com
  this.opera = (agt.indexOf("opera") != -1)
  
  //Mozilla www.mozilla.org
  this.mozillaCompatible = (agt.indexOf("mozilla") != -1)
  this.mozilla = (this.mozillaCompatible && (agt.indexOf('gecko')!=-1)) && !this.nav7 && !this.nav6
  




/* ********************************************************
 * CODE TO DISPLAY WEBSITE CONTACT INFO
 * This exists to provide a point and click way of mailing me,
 * but which excludes robots, crawlers and e-mail 'harvesters'
 * to protect me from spam.
 * 
 * Dependencies: popupText()
 * ******************************************************** */
 function doContact() {
	var mailString = new Array();
	var mailStringOut = new String();
	var htmlOut = new String();
	mailString[0] = 'webmonster';
	mailString[1] = '@get2dom.com';
	mailStringOut = (mailString[0] + mailString[1]);
	htmlOut = '<b><big>Contact me</big></b><br />';
	htmlOut = htmlOut + '<a onclick="self.close();" href="mailto:'+mailStringOut+'">'+mailStringOut+'</a><br />';
	popupText(htmlOut,200,50,'contact me');
 }






/* ********************************************************
 * CODE TO FIX RESIZE ISSUES IN NETSCAPE
 * Author: Macromedia (Dreamweaver)
 * ******************************************************** */
 function MM_reloadPage(init) {  //reloads the window if Nav4 resized
   if (init==true) with (navigator) {
     if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
       document.MM_pgW=innerWidth;
       document.MM_pgH=innerHeight;
       onresize=MM_reloadPage;
      }
   } else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
 }
 MM_reloadPage(true);






/* ******************************************************
 * SHOW AND HIDE DHTML LAYERS
 * Dependencies: User-agent detection code (this.browser)
 * Usage: use showLayer(); hideLayer(); hideLast();
 *            or showLayer2(); as appropriate
 * ****************************************************** */

// definitions outside functions
// This bit to do with the way I do cross-browser, (non-DOM browser) layer manipulation.
 if (this.nav && (this.mozilla==false)) {
   layerRef = '.layers';
   styleRef = '';
   vis_on = "show";
   vis_off = "hide";
 }

 if(this.ie){
   layerRef = '.all';
   styleRef = '.style';
   vis_on = "visible";
   vis_off = "hidden";
 }

 var last=0; // used to remember which layer was last made visible
 var menuLastChanged; // used to remember last mouseover for menu fx below




/*  Hide layer previously made visible (useful for menus)
 *  Use hideLast() to hide last layer made visible; 
 */
 function hideLast() { 
	if(last != 0) hideLayer(last);
 }



/*  Hide a specific layer by its ID 
 *  Use hideLayer(this.id), where this.id is the id of the layer to hide.
 */
 function hideLayer(layerName) { 
	if (document.getElementById) {
		document.getElementById(layerName).style.visibility = 'hidden';
	} else {
		eval( "document" + layerRef + "." + [layerName] + styleRef + ".visibility = vis_off");
	}
 }



/*  Show a specific layer by its ID 
 *  invoke hideLayer(this.id), where this.id is the id of the layer to hide.
 *  If you call this function with the stayVisible parameter set to 1
 *  then the layer will not get hidden again when the hideLast() function is called.
 */
 function showLayer(layerName,StayVisible) { 
	if (StayVisible!=1) {
		hideLast();
		last=layerName;
	}
	
	if (document.getElementById) {
		document.getElementById(layerName).style.visibility = 'visible';
		// Uncomment below to make layers go translucent in IE5.5 and up (very nice!)
		// doFilter(layerName,90);
	} else {
		eval( "document" + layerRef + "." + [layerName] + styleRef + ".visibility = vis_on");
	}
	
	// A specific bugfix, positioning in navigator 4.x. for www.get2dom.com only.
	if ((this.nav==true)&&(this.mozilla==false)) document.layers[layerName].top = 80;

 }

// -----------------------------------------------------------------------------------------------
