sfHover = function() {
	var nav = document.getElementById("nav");
	if(nav) {
		var sfEls = document.getElementById("nav").getElementsByTagName("LI");
		for (var i=0; i<sfEls.length; i++) {
			sfEls[i].onmouseover=function() {
				this.className+=" sfhover";
			}
			sfEls[i].onmouseout=function() {
				this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
			}
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

function addLoadEvent(func)
{
	var oldonload = window.onload;
	if (typeof window.onload != 'function')
	{
		window.onload = func;
	}
	else
	{
		window.onload = function()
		{
			oldonload();
			func();
		}
	}
}

function newWindow(link, w, h, scroll)
{
	leftPosition = (screen.width) ? (screen.width - w) / 2 : 0;
	topPosition = (screen.height) ? (screen.height - h) / 2 : 0;
	settings = 'height=' + h + ',width=' + w + ',top=' + topPosition + ',left=' + leftPosition + ',scrollbars=' + scroll + ',resizable';
	win = window.open(link, 'win', settings);
}

var win = null;
function newWindow(mypage,myname,w,h,scroll)
{
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable';
	win = window.open(mypage,myname,settings);
}

function setActiveCalEl(el_id){

	var links = document.getElementById('eventsCalendarList').childNodes;
		
	for (var i = 0; i < links.length; i++){
   		if(links[i].nodeType == 1){
   			links[i].className = '';
   		}
   	}
	
	document.getElementById(el_id).className='active';
	document.getElementById(el_id).blur();
	return false;
	
}