// JavaScript Document


/*
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]='<a href="http://www.flickr.com/photos/loretogrammar/sets/72157624585512630/"><b>...Centenary Open Day pictures are now available on Flickr...CLick to view...Centenary Open Day pictures are now available on Flickr...</b></a>'

tickercontents[0]='<a href="../loreto_springboard.php"><b>...Year 7 Springboard - Materials for parents - click here for downloads...Year 7 Springboard - Materials for parents - click here...</b></a>'
*/
/*
tickercontents[0]='<b>---- Welcome to Loreto Grammar online ---- Welcome to Loreto Grammar online ---- Welcome to Loreto Grammar online ----</b>'

tickercontents[0]='<b>--------Welcome to Loreto Grammar School---A specialist school in science and maths---Welcome to Loreto Grammar School--------</b>'
*/
tickercontents[0]='------------------------------ Please be advised that the new, general school email address  is <b>info@loretogrammar.co.uk</b> ------------------------------'
/*
tickercontents[1]='<a href="../loreto_artist_in_residence.php">------Emily Bland, Loreto Artist in Residence, is to hold an exhibition of paintings at the school from 16th - 20th January. Click here for more details------'
*/

var tickdelay=7000 //delay btw messages
var highlightspeed=20 //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 start_ticking(){
crosstick=document.getElementById? document.getElementById("highlighter") : 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()
}

if (document.all || document.getElementById)
window.onload=start_ticking

