/* --- ie sniffer --- */
var agt      = navigator.userAgent.toLowerCase();
var appVer   = navigator.appVersion.toLowerCase();
var is_minor = parseFloat(appVer);
var is_major = parseInt(is_minor);

var iePos  = appVer.indexOf('msie');
if (iePos !=-1) {
   is_minor = parseFloat(appVer.substring(iePos+5,appVer.indexOf(';',iePos)))
   is_major = parseInt(is_minor);
}
var is_ie   = (iePos!=-1);
var is_ie5   = (is_ie && is_major == 5);

var is_win   = ( (agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1) );
var is_mac    = (agt.indexOf("mac")!=-1);
var is_ie5up = (is_ie && is_minor >= 5);

/* --- topnav ---*/
function setIEHoverState(id,tagname) {
 el		= document.getElementById(id);

 if(el) {
	 tn		= el.getElementsByTagName(tagname);
	 for(i=0;i<tn.length;i++){
	 	tn[i].onmouseover	= function(){
			this.className ? this.className	+= ' over' : this.className = 'over';
		}
		
		tn[i].onmouseout	= function(){
			this.className		= this.className.match(/ over/) ? this.className.replace(/ over/,'') : this.className.replace(/^over/,'');
		}
	 }
 }
}

window.onload = function() {
if ((is_ie) && (is_mac)){
alert('Support for Internet Explorer on the Mac ended on December 31st, 2005, please use Safari or FireFox');
}
	if(is_ie5up)	setIEHoverState('tnav','li');
	
	if(is_ie5up){
		el = document.getElementById('schedule');
		if(el){
			for(var i=0;i<el.childNodes.length;i++){
				if(el.childNodes[i].tagName == 'DL'){
					el.childNodes[i].lastChild.style.backgroundImage = 'none';
				}
			}
		}
	}
}

function fadebg() {
/*
if(document.getElementById('main').className == 'mainbright'){
 document.getElementById('main').className = 'maindull';
}
else {
 document.getElementById('main').className = 'mainbright';
}
*/
}

/* --- writting current year to footer --- */
function writeCurrentYr(){
	var now = new Date();
	document.write(now.getFullYear());
}