// JavaScript Document
var timeStart = new Boolean(false);
var timeOutID;
var timeConstant = 2000;


function switchDiv(id,classID) {
	document.getElementById(id).className = classID;
	document.getElementById(id).style.cursor = "pointer";
}

function showNav(id) {
	if (timeStart == true) {
		clearInterval(timeOutID);
		timeStart = false;
	}
	document.getElementById(id).style.display = "block";
	document.getElementById(id).style.cursor = "pointer";
	timeOutID = setInterval('clearMenu()',timeConstant);
	timeStart = true;
}

function hideNav(id) {
	stopTimer();
	document.getElementById(id).style.display = "none";
}

function clearMenu() {
	clearInterval(timeOutID);
	timeStart = false;
}

function stopTimer() {
	clearInterval(timeOutID);
	timeStart = false;
}

function startTimer() {
	if (timeStart == true) {
		clearInterval(timeOutID);
		timeStart = false;
	}
	timeOutID = setInterval('clearMenu()',timeConstant);
	timeStart = true;
}

function printPage() {
	window.print();
}

function mailPage() {
	mail_str = "mailto:?subject= " + document.title;
	mail_str += "&body= I recommend you read this -- " + document.title;
	mail_str += ". You should check this out at, " + location.href; 
	location.href = mail_str;
}

function addFav() {
	window.external.AddFavorite(location.href, document.title);
}

function fontChange(fnt) {
	document.getElementById('main').style.fontSize = fnt;
}

function closeWin() {
	window.close();
}

function navhilite(id,classID) {
	document.getElementById(id).className = classID;
}

function openNote(url) {
	window.open(url,'','scrollbars=yes,resizable=yes,toolbars=no,menu=no,width=550,height=400'); //width=550,height=400
}

function openWin(url) {
	window.open(url,'','scrollbars=yes,resizable=yes,toolbars=no,menu=no,width=500,height=400');
}

function fontChange(fnt) {
	document.getElementById('mainContent').style.fontSize = fnt;
}