function init()
	{
	if (document.getElementById("Newsfeed"))
		{oTicker = new NewsTicker("Newsfeed");}
	}


function NewsTicker(sID)
	{
	this.nYInc = -1;
	this.sID = sID;
	if (typeof document.aNewsTickers == "undefined")
		{document.aNewsTickers = [];}

	document.aNewsTickers[this.sID] = this;
	this.nW = parseInt(document.getElementById(this.sID).offsetWidth)- 30;
	this.oCont = new oDhtml(this.sID, "", 1);
	this.sHTML = this.oCont.html;
	this.oCont.write("");
	this.oText1 = new oDhtml(this.sID + "Text1", this.sID);
	this.oText1.write(this.sHTML);
	this.oText1.setProperties(0, 0, this.nW, "", "visible");
	this.oText2 = new oDhtml(this.sID + "Text2", this.sID);
	this.oText2.write(this.sHTML);
	this.oText2.setProperties(0, document.getElementById(this.oText1.id).offsetHeight + 5, this.nW, "", "visible");
	this.oCont.css.overflow = "hidden";
	this.oCont.attachEvent("onmouseover", 'document.aNewsTickers["'+this.sID+'"].__stop()');
	this.oCont.attachEvent("onmouseout", 'document.aNewsTickers["'+this.sID+'"].scroll()');
	var aParas = this.oCont.obj.getElementsByTagName("P");
	var aLink;
	for (var i=0; i<aParas.length; i++)
		{
		if (aParas[i].previousSibling.tagName == "H2")
			{
			aLink = document.createElement("A");
			aLink.href = aParas[i].previousSibling.firstChild.href;
			aLink.title = "View: " + aParas[i].previousSibling.firstChild.innerHTML;
			aLink.innerHTML = aParas[i].innerHTML;
			aParas[i].innerHTML = "";
			aParas[i].appendChild(aLink)
			}
		}
	this.oTimer = window.setTimeout('document.aNewsTickers["'+this.sID+'"].scroll()', 1000);
	}

NewsTicker.prototype.scroll = function()
	{
	if (document.getElementById(this.oText1.id).offsetHeight + this.oText1.y < 0)
		{this.oText1.y = this.oText2.y + document.getElementById(this.oText2.id).offsetHeight + 5;}

	if (document.getElementById(this.oText2.id).offsetHeight + this.oText2.y < 0)
		{this.oText2.y = this.oText1.y + document.getElementById(this.oText1.id).offsetHeight + 5;}

	clearTimeout(this.oTimer);
	this.oText1.moveBy(0, this.nYInc);
	this.oText2.moveBy(0, this.nYInc);
	this.oTimer = window.setTimeout('document.aNewsTickers["'+this.sID+'"].scroll()', 60);
	}

NewsTicker.prototype.__stop = function()
	{
	clearTimeout(this.oTimer);
	}

/************************************************************/
var oTimer;
function loadData(sID, bStaging)
	{
	clearInterval(oTimer);
	var aPeople = document.getElementById("people").getElementsByTagName("A");
	for (var i=0; i<aPeople.length; i++)
		{aPeople[i].className = "";}

	if (!document.all) document.getElementById("peopleText").style.overflow = "hidden";
	window.nHeight = parseInt(document.getElementById("peopleDetail").offsetHeight);
	var xmlHttp = XMLHTTP.create();
	oTimer = setInterval("closeInfo()", 10);
	xmlHttp.open("GET", "_people_loader.asp?sID=" + sID + "&bStaging=" + bStaging, true);
	document.getElementById("person" + sID).className = "active";
	xmlHttp.onreadystatechange = function()
		{
		if (xmlHttp.readyState == 4)
			{loadedData(escape(xmlHttp.responseText));}
		}
	xmlHttp.send(null);
	return false;
	}

function loadedData(sReturn)
	{
	if (!window.bInfoClosed)
		{
		setTimeout("loadedData('" + sReturn + "')", 40);
		return;
		}
	clearInterval(oTimer);
	document.getElementById("peopleDetail").innerHTML = unescape(sReturn);
	oTimer = setInterval("openInfo()", 20);
	}

function closeInfo()
	{
	if (nHeight > 20)
		{
		nHeight -= 20;
		document.getElementById("peopleDetail").style.height = nHeight + "px";
		}
	else
		{
		document.getElementById("peopleDetail").style.height = "2px";
		window.bInfoClosed = true;
		clearInterval(oTimer);
		}
	}

function openInfo()
	{
	if (nHeight < 260)
		{
		if(!document.all) document.getElementById("peopleText").style.overflow = "hidden";
		nHeight += 20;
		document.getElementById("peopleDetail").style.height = nHeight + "px";
		}
	else
		{
//		if(!document.all) document.getElementById("peopleText").style.overflow = "auto";
		document.getElementById("peopleDetail").style.height = "260px";
		window.bInfoClosed = false;
		clearInterval(oTimer);
		}
	}

function XMLHTTP()
	{
	}

XMLHTTP.create = function()
	{
	try
		{
		if (window.XMLHttpRequest)
			{
			var req = new XMLHttpRequest();
			return req;
			}
		if (window.ActiveXObject)
			{
			return new ActiveXObject("Microsoft.XMLHTTP");
			}
		}
	catch(e)
		{}
	throw new Error("Fatal error: xmlHTTP incompatible");
	}

if (window.createPopup && document.compatMode && document.compatMode=="CSS1Compat")
	{
	document.onselectstart = onresize = function fixIE6AbsPos()
		{
		if(!document.body) return;
		if(document.body.style.margin != "0px") document.body.style.margin = 0;
		onresize = null;
		document.body.style.height = 0;
		setTimeout(function(){document.body.style.height = document.documentElement.scrollHeight+'px'; }, 1);
		setTimeout(function(){onresize = fixIE6AbsPos; }, 100);
		}
	}

onload=init;