//Set up some global variables
var uBrowser;
var uResWidth;
var uResHeight;

//Determine the browser information
//This function is called when the page loads
function getstats()
{
	//Find the browser
	uBrowser=navigator.appName;

	//Find the screen resolution
	if (document.all){
		uResWidth=document.body.clientWidth;
		uResHeight=document.body.clientHeight;
	}
	else{
		uResWidth=window.innerWidth;
		uResHeight=window.innerHeight;
	}
}

//This function is the basis of the drop down border menu
function overmenu(cell)
{
	var toExpand=cell.name;
	var objToExpand;

	cell.className="sidemenuOn";

	toExpand=toExpand+"Exp";
	objToExpand=eval("document.all."+toExpand+".style");
	objToExpand.display="block";
}

function collapse(cell)
{
	var toCollapse=cell.name;
	var objToCollapse;

	toCollapse=toCollapse+"Exp";
	objtoCollapse=eval("document.all."+toCollapse+".style");
	objtoCollapse.display="none";

}

//This function is also connected to the pull out menu
function offmenu(cell)
{
	cell.className="sidemenu";
	collapse(cell);
}

//Highlights top menu options on mouseover
function ontoplink(here)
{
	here.style.backgroundColor="#FFFFC0";
}

//Returns top menu options when mouse moved out
function offtoplink(here)
{
	here.style.backgroundColor="#FF99FF";
}

//Returns Search Help options when mouse moved out
function offsearchhelplink(here)
{
	here.style.backgroundColor="#CC33CC";
}

//This function is a basic date producer, and also
//writes to screen at the point it is called.
function writedate()
{
// Store the date in a variable
d = new Date();
dateText = "";

// Get the current day and convert it to the name of the day
dayValue = d.getDay();
if (dayValue == 0)
    dateText += "Sunday";
else if (dayValue == 1)
    dateText += "Monday";
else if (dayValue == 2)
    dateText += "Tuesday";
else if (dayValue == 3)
    dateText += "Wednesday";
else if (dayValue == 4)
    dateText += "Thursday";
else if (dayValue == 5)
    dateText += "Friday";
else if (dayValue == 6)
    dateText += "Saturday";

// Get the current month and convert it to the name of the month
monthValue = d.getMonth();
dateText += " ";
if (monthValue == 0)
    dateText += "January";
if (monthValue == 1)
    dateText += "February";
if (monthValue == 2)
    dateText += "March";
if (monthValue == 3)
    dateText += "April";
if (monthValue == 4)
    dateText += "May";
if (monthValue == 5)
    dateText += "June";
if (monthValue == 6)
    dateText += "July";
if (monthValue == 7)
    dateText += "August";
if (monthValue == 8)
    dateText += "September";
if (monthValue == 9)
    dateText += "October";
if (monthValue == 10)
    dateText += "November";
if (monthValue == 11)
    dateText += "December";

// Get the current year; if it's before 2000, add 1900
if (d.getYear() < 2000) 
    dateText += " " + d.getDate() + ", " + (1900 + d.getYear());
else 
    dateText += " " + d.getDate() + ", " + (d.getYear());

// Write to the page
document.write("<span class='date'>"+dateText+"</span>");
}
