// JavaScript Document

// Highlighter Scroller II script- By JavaScript Kit (http://www.javascriptkit.com)
// For this and over 400+ free scripts, visit http://www.javascriptkit.com/
// This notice must stay intact

//CONFIGURE MESSAGES AND VARIABLES
var tickercontents=new Array()
tickercontents[0]='Recycled aluminum saves 95% energy than virgin aluminum. Recycling a can saves enough energy to run a TV for 3 hours.'
tickercontents[1]='If we recycle every plastic bottle we use, we can take away 2 billion plastic away from landfills.'
tickercontents[2]='Production of recycled paper uses 65% less energy and produces 95% less air pollution than virgin paper production.'
tickercontents[3]='Energy-saving lightbulbs last around ten times longer than ordinary lightbulbs- over 10,000 hours.'
tickercontents[4]='A ton of recycled paper equals or saves 17 trees in paper production.'
tickercontents[5]='Avoiding just 10 miles of driving every week would eliminate about 500 pounds of carbon dioxide emissions a year!'
tickercontents[6]='A laptop is more environment friendly than a desktop. It consumes five times less electricity.'

var tickerwidth="155px"
var tickerheight="75px"
//var fontcss="font: bold 14px Verdana; color:black"
var tickdelay=3000 //delay btw messages
var highlightspeed=2 //2 pixels at a time.
//var highlightcolor="lightyellow"
var backdroptextcolor="#E1E1E1"

////Do not edit pass this line////////////////

document.write('<style>#highlighterbg </style>')
document.write('<div style="position:relative;left:0px;top:0px; width:'+tickerwidth+'; height:'+tickerheight+';'+'">')
document.write('<span id="highlighterbg" style="position:absolute;left:0;top:0;color:'+backdroptextcolor+'; width:'+tickerwidth+'; height:'+tickerheight+';padding: 4px"></span><span id="highlighter" style="position:absolute;left:0;top:0;clip:rect(auto auto auto 0px); width:'+tickerwidth+';height:'+tickerheight+';padding: 4px"></span>')
document.write('</div>')

var currentmessage=0
var clipbottom=1

function changetickercontent(){
msgheight=clipbottom=crosstick.offsetHeight
crosstick.style.clip="rect("+msgheight+"px auto auto 0px)"
crosstickbg.innerHTML=tickercontents[currentmessage]
crosstick.innerHTML=tickercontents[currentmessage]
highlightmsg()
}

function highlightmsg(){
//var msgheight=crosstick.offsetHeight
if (clipbottom>0){
clipbottom-=highlightspeed
crosstick.style.clip="rect("+clipbottom+"px auto auto 0px)"
beginclip=setTimeout("highlightmsg()",20)
}
else{
clipbottom=msgheight
clearTimeout(beginclip)
if (currentmessage==tickercontents.length-1) currentmessage=0
else currentmessage++
setTimeout("changetickercontent()",tickdelay)
}
}

function start_ticking(){
crosstickbg=document.getElementById? document.getElementById("highlighterbg") : document.all.highlighterbg
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
