var undefined;
var browser;
var version;
var OS;

var hide  = true;
var Yoffset = 1;	// y-axis offset for sub-menu.
var Xoffset = 0;	// x-axis offset for sub-menu.
var abort = false;	// Auto-shut off abort switch.
var TimerSet;		// Timer switch.
var Delay = 500; 	// Auto-shut off time delay in milliseconds.

	var detect = navigator.userAgent.toLowerCase();
	var OS,browser,version,total,thestring;
	
	if (checkIt('konqueror'))
		{
	    browser = "Konqueror";
        OS = "Linux";
		}
	else if (checkIt('safari')) browser = "Safari";
	else if (checkIt('omniweb')) browser = "OmniWeb";
	else if (checkIt('opera')) browser = "Opera";
	else if (checkIt('webtv')) browser = "WebTV";
	else if (checkIt('icab')) browser = "iCab";
	else if (checkIt('msie')) browser = "Internet Explorer";
	else if (!checkIt('compatible'))
		{
        browser = "Netscape Navigator";
        version = detect.charAt(8);
		}
	else browser = "An unknown browser";

	if (!version) version = detect.charAt(place + thestring.length);

	if (!OS)
		{
        if (checkIt('linux')) OS = "Linux";
        else if (checkIt('x11')) OS = "Unix";
        else if (checkIt('mac')) OS = "Mac";
        else if (checkIt('win')) OS = "Windows";
        else OS = "an unknown operating system";
		}

if (browser=="Safari") 
	{
	Xoffset = Xoffset + 8;
	Yoffset = Yoffset + 8;
	}
if (OS=="Mac" && browser=="Internet Explorer")
	{
	Xoffset = Xoffset + 9;
	Yoffset = Yoffset + 12;
	}
// This function resets the location of the specified layer.

function setLyr(obj,lyr, XX, YY)
{
	var newX = findPosX(obj);
	var newY = findPosY(obj);
	if (lyr == 'testP') newY -= 50;
	var x = new getObj(lyr);
	if (YY=="" || YY==undefined) YY=0;
	if (XX=="" || XX==undefined) XX=0;
	Y = Yoffset + YY;
	X = Xoffset + XX;
	x.style.top = newY + Y +'px';
	x.style.left = newX + X + 'px';
}


// This function returns the x-coordinate of a specified page element.

function findPosX(obj)
{
	var curleft = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}
	}
	else if (obj.x)
		curleft += obj.x;
	return curleft;
}

//This functiono returns the y-coordinate of a specified page element.

function findPosY(obj)
{
	var curtop = 0;
	var printstring = '';
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			printstring += ' element ' + obj.tagName + ' has ' + obj.offsetTop;
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	}
	else if (obj.y)
		curtop += obj.y;
	//window.status = printstring;
	return curtop;
}

// This layer finds the sub-menu layer to be moved.

function getObj(name)
{
 if (document.getElementById)
 {
	   this.obj = document.getElementById(name);
	   this.style = document.getElementById(name).style;
 }
 else if (document.all)
 {
	   this.obj = document.all[name];
	   this.style = document.all[name].style;
 }
 else if (document.layers)
 {
	   if (document.layers[name])
	   {
	   	this.obj = document.layers[name];
	   	this.style = document.layers[name];
	   }
	   else
	   {
	    this.obj = document.layers.testP.layers[name];
	    this.style = document.layers.testP.layers[name];
	   }
 }
}

// This function sets the timer for hiding the sub-menu.

function setTimer()
	{
	abort = false;
	if (TimerSet) TimerSet = clearTimeout(TimerSet);	
	if (!TimerSet) TimerSet = setTimeout('AutoOff()',Delay);
	}
	
// This function hides the sub-menu.
	
function AutoOff(obj)
	{
	if (!abort) MM_showHideLayers('HowToMenu','','hide','ResourcesMenu','','hide','FutureMenu','','hide','ContactMenu','','hide');
	TimerSet = false;
	}

// The following 2 functions are Dreamweaver functions for finding objects and showing/hiding layers.

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}


function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

	
function checkIt(string)
{
        place = detect.indexOf(string) + 1;
        thestring = string;
        return place;
}

function HREF(myURL)
	{
	window.open(myURL,'_self');
	}

function Rollover(obj, new_style) {
	obj.className = new_style;
}