// JavaScript Document
//initialize variables
//configure variables below for menu position on page
var menuwidth = 157;
var offsetleft = 10;
var offsettop = 100;

offsetleft = 749 - menuwidth;
var isID = 0;
var isAll = 0;
var isLayers = 0;

//detect the browser DOM
if (document.getElementByID) //if W3C ID (IE >=5, NN >=5, and Moz)
	{
		isID = 1;
	}
else
	{
		if (document.all) //if Internet Explorer 4
		{
			isAll = 1;
		}
		else //browser is Netscape 4
		{
			browserVersion = parseInt(navigator.appVersion);
			if ((navigator.appName.indexOf('Netscape') != -1) &&
				(browserVersion == 4))
				{
					isLayers = 1;
				}
		
			else //browser is Netscape 5 or above
			{
				browserVersion = parseInt(navigator.appVersion);
				if ((navigator.appName.indexOf('Netscape') != -1) &&
					(browserVersion == 5))
					{
						isID = 1;
					}
			}
		}
	}

function getInternetExplorerVersion()
// Returns the version of Internet Explorer or a -1
{
  var rv = -1; // Return value assumes failure

  if (navigator.appName == 'Microsoft Internet Explorer')
  {
    var ua = navigator.userAgent;
    var re  = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
    if (re.exec(ua) != null)
      rv = parseFloat( RegExp.$1 );
  }
  return rv;
}
function checkVersion()
{
  var ver = getInternetExplorerVersion();

  if ( ver > -1 )
  {
    if ( ver == 7.0 ) 
      isIE7 = 1;
   // else
      //msg = "Not IE7";
  }
}

checkVersion();

//this is what makes the menu slide
function makeStatic() {
if (isAll) {pageMenu.style.pixelTop=document.body.scrollTop+offsettop;pageMenu.style.pixelRight=document.body.scrollRight-offsetleft;}
if (isID) {document.getElementById('pageMenu').style.top = window.pageYOffset + offsettop + "px";}
if (isLayers) {eval(document.pageMenu.top=eval(window.pageYOffset+offsettop+70));}
setTimeout('makeStatic()', 30);
}

//create function to handle error logic if needed
function menu()
{
	if (isID||isAll||isLayers)
	makeStatic();
	if (isIE7)
	//Fixed positioning works in IE7, so we don't have to do all the scrollTop shtuff
	{
		document.getElementById('pageMenu').style.position = "fixed";
		document.getElementById('pageMenu').style.top = 100 + "px";
		document.getElementById('pageMenu').style.left = 50 + "%";
		document.getElementById('pageMenu').style.marginLeft = -320 + "px";
	}
}
//call the function to make the side nav slide
menu();