// The Rollover object is used for all style based rollovers on the entire site.
// With this Rollover object, a javascript DOM reference must be made to the item which
// is to have a rollover affect applied to it.
// The Rollover object's strength is in reducing redundancy. Any object that has a rollover effect
// that is used elsewhere can share the same object. So fewer objects can be made.

// NOTE: anytime something uses the fade(), fadeIn(), or fadeOut() methods but doesn't 
// pass "this" as the parameter and passes a childNode object instead that childNode 
// object is expected (by some browsers) to be on the same line as the object that makes the call. 

// rollover object
Rollover = function(stylePropStr, overColorStr, outColorStr){
	this._id;	//object id (yet undeclared)
	this._prop	= stylePropStr;	//css style property to fade
	this._over	= overColorStr;	//over color string
	this._out	= outColorStr;	//out color string
	this._toggle = false;		//interaction mode (true=on/false=off)
	this._fading = false;		//help stop the flicker that dumb browsers produce
}

// fading method
Rollover.prototype.fade = function(obj) {
	this._toggle = !this._toggle;
	this._toggle? obj.style[this._prop] = this._over : obj.style[this._prop] = this._out;
	this._fading = false;
}

// fadeOut and fadeIn are used for dropdown menus or one of the two interactive modules (reviews pages + entertainment pages)
// fadeOut and fadeIn methods used to account for an anomaly in the Safari event model
Rollover.prototype.fadeOut = function(obj) {
	obj.style[this._prop] = this._out;
}

Rollover.prototype.fadeIn = function(obj) {
	obj.style[this._prop] = this._over;
}

// attn: object rollovers for homepage

// rollover objects
// Music News - top/bottom text blocks
dailyMusicNews = new Rollover('backgroundColor', 'F5F5F5', 'FFFFFF');
thisDayInMusic = new Rollover('backgroundColor', 'F5F5F5', 'FFFFFF');
// Music News - top stories
latestHeadlines01 = new Rollover('backgroundColor', 'ECC20C', 'FFFFFF');
latestHeadlines02 = new Rollover('backgroundColor', 'ECC20C', 'FFF4C6');