/*
Highligher Scroller script- By JavaScript Kit
For this and over 400+ free scripts, visit http://www.javascriptkit.com/
This notice must stay intact
*/

var tickercontents=new Array()
tickercontents[0]='30London Street | <b>Dunedin</b> | <b>tel:</b> 03 474 1825 | <b>fax:</b> 03 479 2311 | <a href="mailto:parkerwarburton@teamarchitects.co.nz?subject=Web Site Enquiry">email</a>'
tickercontents[1]='3Fredrick Street | <b>Wanaka</b> | <b>tel:</b> 03 443 1825 | <b>fax:</b> 03 443 1405 | <a href="mailto:parkerwarburton@teamarchitects.co.nz?subject=Web Site Enquiry">email</a>'
tickercontents[2]='Members of Team Architects with eight practices throughout New Zealand'

var tickdelay=4000 //delay btw messages
var highlightspeed=15 //10 pixels at a time.

////Do not edit pass this line////////////////

var currentmessage=0
var clipwidth=0

function changetickercontent(){
crosstick.style.clip="rect(0px 0px auto 0px)"
crosstick.innerHTML=tickercontents[currentmessage]
highlightmsg()
}

function highlightmsg(){
var msgwidth=crosstick.offsetWidth
if (clipwidth<msgwidth){
clipwidth+=highlightspeed
crosstick.style.clip="rect(0px "+clipwidth+"px auto 0px)"
beginclip=setTimeout("highlightmsg()",20)
}
else{
clipwidth=0
clearTimeout(beginclip)
if (currentmessage==tickercontents.length-1) currentmessage=0
else currentmessage++
setTimeout("changetickercontent()",tickdelay)
}
}

function scroller(){
crosstick=document.getElementById? document.getElementById("scroll") : document.all.highlighter
crosstickParent=crosstick.parentNode? crosstick.parentNode : crosstick.parentElement
if (parseInt(crosstick.offsetHeight)>0)
crosstickParent.style.height=crosstick.offsetHeight+'px'
else
setTimeout("crosstickParent.style.height=crosstick.offsetHeight+'px'",100) //delay for Mozilla's sake
changetickercontent()
}
