var arrTicker	= new Array();
var arrTick		= new Array();
var iTickerIDX	= 0;
var iTickIDX	= 0;

function tickerWrite(pText)
{
	var sLink	= arrTicker[iTickerIDX][1];
	sLink		= sLink.replace('{q}','?');
	sLink		= sLink.replace('{a}','&');

	document.getElementById('tickerLink').href = sLink;
	document.getElementById('tickerSpace').innerHTML = (document.getElementById('tickerSpace').innerHTML + pText + '  ');
}

function tickerDisplay()
{
	tickerWrite(arrTick[iTickIDX]);

	if(iTickIDX < (arrTick.length - 1))
	{
		iTickIDX ++;
		window.setTimeout('tickerDisplay()',100);
	}
	else
	{
		iTickIDX = 0;
	}
}

function tickerLoop()
{
	try
	{
		document.getElementById('tickerSpace').innerHTML = '';
		arrTick		= arrTicker[iTickerIDX][0].split(' ');

		tickerDisplay();

		if(iTickerIDX < (arrTicker.length - 1))
		{
			window.setTimeout('iTickerIDX ++;tickerLoop()',6000);
		}
		else
		{
			window.setTimeout('iTickerIDX = 0;iTickIDX = 0;tickerLoop()',6000);
		}
	}
	catch(app)
	{
	}
}

function externalLinks()
{
	if(!document.getElementsByTagName) return;

	var anchors = document.getElementsByTagName("a");

	for(var ii = 0;ii < anchors.length;ii++)
	{
		var anchor = anchors[ii];

		if(anchor.getAttribute("href") && anchor.getAttribute("rel") == "external")
		{
			anchor.target = "_blank";
		}
	}
}

//window.onload = externalLinks;

function OutputFileUpload(pCount)
{
	var sHTML = '';

	for(var ii = 1;ii <= pCount;ii++)
	{
		sHTML += '<input class="file" type="file" name="File' + ii + '" /><br />';
	}

	document.getElementById('OutputFileUploadHTML').innerHTML = sHTML;
}

function winPop(pageToLoad, winName, width, height, center, scroll, control)
{
    xposition=0; yposition=0;
    if ((parseInt(navigator.appVersion) >= 4 ) && (center))
    {
        xposition = (screen.width - width) / 2;
        yposition = (screen.height - height) / 2;
    }
    args = "width=" + width + ","
    + "height=" + height + ","
    + "location=0,"
    + "menubar=0,"
    + "resizable=" + control + ","
    + "scrollbars="+scroll+", "
    + "status=1,"
    + "titlebar=0,"
    + "toolbar=0,"
    + "hotkeys=0,"
    + "screenx=" + xposition + ","  //NN Only
    + "screeny=" + yposition + ","  //NN Only
    + "left=" + xposition + ","     //IE Only
    + "top=" + yposition;           //IE Only

    window.open(pageToLoad,winName,args );
}