/************************************************************************/
function initIt()
{
	if(NS4)
	{
		if(!document.elAll)
			return;
		elAll = document.elAll;
		
		elGif = elAll.document.elGif;
		
		imStr = "<img src='/fade.gif' height=" + boxHgt + " width=" + boxWid + " />"
		elGif.document.write(imStr);
		elGif.document.close();
	}
	else
	{
		if(typeof(elAll) != "undefined")
			elNews = elAll.document.elNews;
		if(typeof(elNews) != "undefined")
			elNews.style.filter = "blendTrans(duration=" + blendDur + ")";
	}

	newsCount = 0;
	
	if(finite)
		loopCount = 0;
		
	doIt();
	blendTimer = setInterval("doIt()", blendInt * 1000);
}


/************************************************************************/
function doIt()
{
	if (finite && (loopCount == maxLoops))
	{
		clearInterval(blendTimer);
		return;
	}
	
	if(NS4)
	{
		elGif.top = 0;
	}
		
	newsStr = "<a class='newslink' href='" + arNews[newsCount].url + "'>" + arNews[newsCount].image + "</a>";

	if(NS4)
	{
		elNews.document.write(newsStr);
		elNews.document.close();
	}
	else
	{
		if(typeof(elNews) != "undefined"){
			elNews.filters.blendTrans.Apply();
			elNews.innerHTML = newsStr;
			elNews.filters.blendTrans.Play();
		}
	}

	newsCount++;
	if (newsCount == arNews.length)
	{
		newsCount = 0;
		if (finite)
			loopCount++;
	}

	if(NS4)
	{
		slideIt();
	}
}


/************************************************************************/
function slideIt()
{
	elGif.top += slideInc;
	if (elGif.top >= boxHgt)
		return;
	setTimeout("slideIt()", slideInt);
}


/************************************************************************/
function StartTour()
{
	var newWin = '';
	var windowOptions = '';
	var windowWidth = screen.availWidth - 40;
	var windowHeight = screen.availHeight - 100;
	
	windowOptions = "width=" + windowWidth + ",height=" + windowHeight + ",top=20,left=20,screenX=20,screenY=20,scrollbars,resizable,dependent";
	
	newWin = openWin("/tour/index.cfm", "TourWindow", windowOptions);
	newWin.focus();
}


/************************************************************************/
function initPage(urlPrefix)
{
	// prefix = urlPrefix;
	prefix = '';
	boxWid = 200;
	boxHgt = 100;
	backCol = "000000";
	blendInt = 5;
	blendDur = .25;
	maxLoops = 0;
	txtDec = "none";
	txtAln = "left";
	fntCol = "ffffff";
	fntSiz = "9pt";
	fntWgh = "normal";
	fntSty = "normal";
	fntFam = "Geneva,Arial,sans-serif";
	linHgt = "12pt";
	slideInc = 2;
							
	arURL = new Array("http://www.keirsey.com", "/index.cfm", "/articles/index.cfm");
	arTXT = new Array("/images/ads/keirsey.gif", "/images/ads/2.gif", "/images/ads/st.gif");
	arNews = new Array();
	
	NS4 = (document.layers) ? 1 : 0;
	IE4 = (document.all) ? 1 : 0;
	
	semi = ";";
	sp = " ";
	
	finite = (maxLoops > 0) ? 1 : 0;
	slideInt = (blendDur / (boxHgt / slideInc)) * 1000;
	
	for (i=0; i<arURL.length; i++)
	{
		arNews[i] = new Array();
		arNews[i].url = prefix + arURL[i];
		arNews[i].image = '<img src="' + arTXT[i] + '" border="0" alt-""/>';
	}
	
	window.onload = initIt;
}