/*
 *
 * this module defines a AdPreview class, which represents dynamic window showing advert details
 * it uses AdInfoText.aspx service of mpmads application
 *
 */

function EnhancedBlinker(delay, colors) {
	/* CONSTRUCTOR AND PRIVATE MEMBER DEFINITIONS */

	var _delay = delay;
/*	var _element_id = elementCssID;
	var _element = window.document.getElementById(elementCssID);	*/

	var _colorChangeTimer = self.setInterval(nextColor, _delay);
	var _suppressExceptions = true;

	var _colors = colors;

	var _currentColor = 0;

/*	if (_element == null) {
		throw new Error ("Element with specified ID (" + elementCssID + ") does not exists in the document.");
	}*/

	/* PRIVATE METHOD DEFINITIONS */

	function nextColor()
	{
		var blinks = document.getElementsByTagName('blink');
		for(i=0; i < blinks.length; i++) {
			element = blinks[i];
			element.style.color = _colors[_currentColor];
		}		
		_currentColor = _currentColor + 1;
		if(_currentColor >= _colors.length) _currentColor = 0;
	}

	/* PUBLIC METHOD DEFINITIONS */
}


