//NAVIGATION
sfHover = function() {
	chromeAddMouseEvents("nbaChromeContent");
	chromeAddMouseEvents("nbaHeaderNavContain");
}
if (window.attachEvent) {
	window.attachEvent("onload", sfHover);
}

function chromeAddMouseEvents(divID) {
	var containerDiv = document.getElementById(divID);
	if (containerDiv) {
		var sfEls = containerDiv.getElementsByTagName('LI');
		for (var i=sfEls.length; i--; ) {
			sfEls[i].onmouseover = chromeMouseOver;
			sfEls[i].onmouseout = chromeMouseOut;
		}
	}
}

function chromeMouseOver() {
	this.className+=' sfhover';
}
function chromeMouseOut() {
	this.className=this.className.replace(new RegExp(' sfhover\\b'), '');
}

//DATE OBJECT EXTENDED FUNCTIONALITY
Date.prototype.addMonths = function(o) {
	if (this.getDate() > this.getMonthDays(o)) {
		if (!this.origDate) {
			this.origDate = this.getDate();
		}
		this.setFullYear(this.getFullYear(),(this.getMonth() + o),this.getMonthDays(o));
	} else if (this.origDate) {
		this.setFullYear(this.getFullYear(),(this.getMonth() + o),this.origDate);
	} else {
		this.setMonth((this.getMonth() + o));
	}
	return true;
};

Date.prototype.addWeeks = function(o) {
	this.setTime(this.getTime() + (o * 604800000));
	return true;
};

Date.prototype.getCurrMonthDays = function() {
	return this.getMonthDays();
};

Date.prototype.getMonthDays = function(o) {
	o = (o) ? o : 0;
	var tempDate = new Date(this.getFullYear(), ((this.getMonth()+1)+o), 1);
	tempDate.setDate(tempDate.getDate()-1);
	return tempDate.getDate();
};

Date.prototype.getNextMonthDays = function() {
	return this.getMonthDays(1);
};

Date.prototype.getPrevMonthDays = function() {
	return this.getMonthDays(-1);
};

Date.prototype.getWeek = function() {
	var janFirst = new Date(this.getFullYear(),0,1);
	return Math.ceil((((this - janFirst) / 86400000) + janFirst.getDay()+1)/7);
};
//GENERAL USE FUNCTIONS
 function nba_openPopup( url, name, widgets, openerUrl )
{
        var host = location.hostname;
        if (window == top) { window.top.name = "opener"; }
        var popupWin = window.open( url, name, widgets );
        if(popupWin) {nbaHasOpenPopup = 1;}
        if ( popupWin && popupWin.opener ) {
                if ( openerUrl )
                {
                        popupWin.opener.location = openerUrl;
                }
        }
        if ( popupWin) {
                popupWin.focus();
        }
}


