
var messages=new Array();
var scrollerwidth = '100%';
var scrollerheight='50';
var scrollerdelay=0;
var scrollerspeed=50
var scrollerbackground='';
var steps = 1;
var messageIndex = 0;
var tickerI = 0;

function _dir(){
	steps *= -1
}

function addMessage(msg)
{
	//alert(msg)
	messages[messageIndex]= "<div class='siteText' >" + msg + "</div>"
	messageIndex++;
	
}

var index=0

function addMessage1(arr,arr2)
{
	messages[0] = arr
	messages[1] = arr2
}


function direction(_steps){
	steps = _steps
	scrollerspeed = 10
}

function slow()
{scrollerspeed = 50 }

function sT()
{
	tickero.innerHTML = '<div class="quicklink" id="main2" style="right:0;position:relative;width:100%;height:'+scrollerheight+';overflow:hidden "> \
								<div id="myDiv" style="right:0;position:absolute;width:'+scrollerwidth+';height:'+scrollerheight+';clip:rect(0 '+scrollerwidth+' '+scrollerheight+' 0);left:0;top:0"> \
									<span onmouseover="steps=0;" onmouseout="steps=1;" id="first2" style="right:0;position:absolute;height:'+ scrollerheight +';width:'+scrollerwidth+';left:0;top:0;">' + messages[0] +'</span> \
									<span onmouseover="steps=0" onmouseout="steps=1"  id="second2" style="right:0;position:absolute;height:'+ scrollerheight +';width:'+scrollerwidth+';left:0;top:0;visibility:hidden;">'+messages[1] +'</span> \
								</div> \
							</div>' 
	
	if (messages.length>1) //ok
		tickerI=0
	else
		tickerI=0
		
	if (messageIndex >1)
	{
		setTimeout("second2.style.top = document.all.first2.offsetHeight-1;startMove()",1)
	}
	
}


function startMove(){
	scrollerheight = (second2.style.top.replace("px","") * 1) - 1 
	second2.style.pixelTop = scrollerheight
	
	moveDiv_I('first2')
	second2.style.visibility='visible'

}

function moveDiv_I(whichdiv,whichdivII){
	if (whichdivII == null)
	{	
		divII = "second2"
		divII=eval("second2")
		divII.style.pixelTop = scrollerheight
		
	}	
	else
		divII=eval(whichdivII)
	tdiv=eval(whichdiv)
	tdiv.style.pixelTop -= steps
	divII.style.pixelTop -= steps	
	moveTo(tdiv,divII,steps)
	setTimeout("moveDiv_I(tdiv,divII)",scrollerspeed)
}

function swichDiv(div,location)
{
	div.innerHTML=messages[tickerI]	
	if (tickerI == messages.length-1)
		tickerI=0
	else
		tickerI++
	div.style.pixelTop = location
	
}

function moveTo(divTo,onTop,step){
	
	if (step < 0){

		if (onTop.style.pixelTop == 1)
			swichDiv(divTo,scrollerheight * (-1))
		if (divTo.style.pixelTop == 1)	 
			swichDiv(onTop, scrollerheight * (-1))
	}
		
	else{
			
			if (onTop.style.pixelTop == 1)
				swichDiv(divTo,scrollerheight + 3 )
			if (divTo.style.pixelTop == 1)	 
				swichDiv(onTop, scrollerheight + 3 )
		
	}	
		
	
}