/***********************************************
* Memory Scroller script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

var memorywidth="100%" //scroller width
var memoryheight="20px" //scroller height
var memorybgcolor="#FFFFFF" //scroller background
var memorypadding="0px" //padding applied to the scroller. 0 for non.
var borderCSS="border: 0px solid black;" //Border CSS, applied to scroller to give border.

var memoryspeed=1 //Scroller speed (larger is faster 1-10)
var pauseit=1 //Pause scroller onMousever (0=no. 1=yes)?

var persistlastviewedmsg=1 //should scroller's position persist after users navigate away (1=yes, 0=no)?
var persistmsgbehavior="onload" //set to "onload" or "onclick".

//Specify the scroller's content (don't delete <nobr> tag)
//Keep all content on ONE line, and backslash any single quotations (ie: that\'s great):

// space between each news items in ticker
var bigspace = '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'
var memorycontent='<nobr><strong>MUSICFEST NEWS UPDATES ' + bigspace; // don't delete

// JB: easier to read and edit now - July 2007
// copy the next line for an additional news item and remember to removed the comment slashes at the start of the line
// memorycontent+='news item text here' + bigspace

memorycontent+='<a target="_blank" class="show" href="http://www.westjetfestivals.com/festivals/peterborough-little-lake-music-festival">Vote for this festival</a> for a chance to win great prizes!' + bigspace
memorycontent+='Start time of the shows has <a class="show" href="news.asp#july-1-2010">changed to 8:30 p.m.</a>' + bigspace
memorycontent+='<a target="_blank" class="show" href="http://www.surveymonkey.com/s/TDPVYC5">Please fill out our survey</a> and help keep the Musicfest FREE.' + bigspace
memorycontent+='<a class="show" href="news.asp#may-6-2010">Donate to the NEW Fireworks Fund</a>.' + bigspace
memorycontent+='Peterborough\'s popular <a class="show" href="news.asp#june-8-2010">Top Talent Search is back</a> for a second year.' + bigspace
memorycontent+='Become a <a target="_blank" href="http://www.facebook.com/pages/Peterborough-Little-Lake-Musicfest/109339259102544" class="show">Fan on Facebook</a>.' + bigspace
memorycontent+='Follow us on <a target="_blank" href="http://twitter.com/PtboMusicfest" class="show">Twitter</a>.' + bigspace;


memorycontent+='</strong></nobr>'; // don't delete

// retired news items
// memorycontent+='<a href="sponsors.asp" class="show">Our Marketing Partners</a> and <a href="sponsors2.asp" class="show">Business Musicfest Friends</a> pages have been updated.' + bigspace;
// memorycontent+='Little Lake Musicfest <a href="news.asp#nov-10-2009" class="show">Annual Fundraiser</a>.' + bigspace




////NO NEED TO EDIT BELOW THIS LINE////////////
var combinedcssTable="width:"+memorywidth+";background-color:"+memorybgcolor+";padding:"+memorypadding+";"+borderCSS+";"
var combinedcss="width:"+memorywidth+";height:"+memoryheight+";"

var divonclick=(persistlastviewedmsg && persistmsgbehavior=="onclick")? 'onClick="savelastmsg()" ' : ''
memoryspeed=(document.all)? memoryspeed : Math.max(1, memoryspeed-1) //slow speed down by 1 for NS
var copyspeed=memoryspeed
var pausespeed=(pauseit==0)? copyspeed: 0
var iedom=document.all||document.getElementById
if (iedom)
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100px;left:-10000px">'+memorycontent+'</span>')
var actualwidth=''
var memoryscroller

if (window.addEventListener)
window.addEventListener("load", populatescroller, false)
else if (window.attachEvent)
window.attachEvent("onload", populatescroller)
else if (document.all || document.getElementById)
window.onload=populatescroller

function populatescroller(){
memoryscroller=document.getElementById? document.getElementById("memoryscroller") : document.all.memoryscroller
memoryscroller.style.left=parseInt(memorywidth)+8+"px"
if (persistlastviewedmsg && get_cookie("lastscrollerpos")!="")
revivelastmsg()
memoryscroller.innerHTML=memorycontent
actualwidth=document.all? temp.offsetWidth : document.getElementById("temp").offsetWidth
lefttime=setInterval("scrollmarquee()",20)
}

function get_cookie(Name) {
var search = Name + "="
var returnvalue = ""
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) {
offset += search.length
end = document.cookie.indexOf(";", offset)
if (end == -1)
end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}

function savelastmsg(){
document.cookie="lastscrollerpos="+memoryscroller.style.left
}

function revivelastmsg(){
lastscrollerpos=parseInt(get_cookie("lastscrollerpos"))
memoryscroller.style.left=parseInt(lastscrollerpos)+"px"
}

if (persistlastviewedmsg && persistmsgbehavior=="onload")
window.onunload=savelastmsg

function scrollmarquee(){
if (parseInt(memoryscroller.style.left)>(actualwidth*(-1)+8))
memoryscroller.style.left=parseInt(memoryscroller.style.left)-copyspeed+"px"
else
memoryscroller.style.left=parseInt(memorywidth)+8+"px"
}

if (iedom){
with (document){
document.write('<table border="0" cellspacing="0" cellpadding="0" style="'+combinedcssTable+'"><td>')
write('<div style="position:relative;overflow:hidden;'+combinedcss+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=memoryspeed">')
write('<div id="memoryscroller" style="position:absolute;left:0px;top:0px;" '+divonclick+'></div>')
write('</div>')
document.write('</td></table>')
}
}


function popWindow(URL) {
window.open(URL, 'popwin', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=450,height=450,left=426,top=232');
}
