var announcement;

function Announcement(text,style,url,speed,blink)
{
	this._speed = speed;
	this._blink = blink;
	this._style = style;
	this._url = url;
	this._text=text;
}

Announcement.prototype._speed;
Announcement.prototype._blink;
Announcement.prototype._style;
Announcement.prototype._url;
Announcement.prototype._text;

Announcement.prototype.build = function ()
{
	var div = document.getElementById("announcement");
	if (div)
	{
		html = "<span style=' " + this._style + " '>";
		if (this.url != "")
		{
			html += "<a style='text-decoration:none; " + this._style + " ' href='" + this._url + "' target='_blank'>" + this._text+ "</a>";
		}
		else
		{
			html += this._text;
		}
		html += "</span>";
		
		div.innerHTML = html;

		if (this._blink)
		{
			this.hide();
		}
	}
}

Announcement.prototype.show = function ()
{
		var div = document.getElementById('announcement');
		
		if (div)
		{
			div.style.visibility="visible";
			if (this._blink)
			{
				setTimeout('announcement.hide()',this._speed);
			}
		}
}
Announcement.prototype.hide = function()
{
		var div = document.getElementById('announcement');
		if (div)
		{
			div.style.visibility="hidden";
			if (this._blink)
			{
				setTimeout('announcement.show()',this._speed);
			}
		}
}
