

/*Example message arrays for the two demo scrollers*/

var pausecontent=new Array()
pausecontent[0]='<strong>3rd Annual Wellness Palooza</strong><br />Friday March 2nd 8pm- 12am<br /><a href="docs/WellnesspaloozaPoster2012.pdf" target="_blank">Click here for event details.</a>'
pausecontent[1]='<strong>7th Annual Fun Run</strong><br />Saturday April 14 9:00am<br /><a href="docs/FunRunFlyer2012.pdf" target="_blank">Click here for event details.</a>'
pausecontent[2]='<strong>Skip the chocolates and flowers this year and give the gift that<br />will give something back</strong><br />In February purchase a 3 month Membership or greater and receive a FREE Personal Training session.<br /><a href="docs/FebPTPromotionFlyer.pdf" target="_blank">Click here for more details.</a>'
pausecontent[3]='<strong>Now offering full access to kids 13-15 years old!</strong><br />Junior Fitness Certification Program<br /><a href="docs/JuniorFitnessCertProgramFlyer12.pdf" target="_blank">Click here for more details.</a>'
pausecontent[4]='<strong>Please Note</strong><br />The Shepherd University Wellness Center pool will be closed from 11:00AM- 12:15PM on Thursdays only for an Academic class beginning January 19, 2012.'
pausecontent[5]='<strong>"Just Keep Swimming"</strong><br />Group Swim Lessons and swim clinics<br /><a href="docs/GroupSwimmingFlyer-Dec12.pdf" target="_blank">Click here for program details.</a>'
pausecontent[6]='<strong>Are you interested in getting certified as a Group Exercise Instructor<br />or Personal Trainer?</strong><br />Below are upcoming events in our facility that can help you achieve your goals!<br /><br /><strong>Click on the link beside the workshop you are interested in for details and how to register!</strong><br /><br /><em>The ACSM Health Fitness Specialist&reg; (HFS) Workshop</em><br />February 24- 25 2012 Fri (1pm-9:30pm) and Sat (8am-6pm) <a href="http://members.acsm.org/source/Meetings/cMeetingFunctionDetail.cfm?section=Register&amp;product_major=F1202HSHWV&amp;functionstartdisplayrow=1" target="_blank">ACSM HFS</a><br /><br /><em>Aqua Fitness Continuing Education Workshop</em><br />March 3rd 9:00AM-5:00PM  <a href="http://www.afaa.com/302.afa?SID=0008450982071687536712517162159763797677480991320941904" target="_blank">AFAA AQUA*</a><br />Kick Boxing Certification Workshop- April TBA <a href="http://www.afaa.com/302.afa?SID=0001794204551282876785463328541880961480092381320941948" target="_blank">AFAA KICKBOX*</a><br /><br />* To view details click on the link, select the event, and enter zip code 25443.'
pausecontent[5]='<strong>Be Ready... Be Well...</strong><br />"Save the Date"<br /><br />&#8226; March 2, 2012; WELLNESS PALOOZA<br />&#8226; March 30th-31, 2012; RELAY FOR LIFE<br />&#8226; April 14th, 2012; FUN RUN'
pausecontent[6]='<em>Facility Resource</em><br /><strong>Wellness Wednesday</strong><br />Every last Wednesday of the month is free access to the community. Free access includes the use our indoor pool, basketball courts, racquetball courts, indoor walking track and much more. <a href="docs/JanuaryWellnessWed12.pdf" target="_blank">Click here for flyer.</a><br /><br />(Free Body Assessments from 8-10AM, 12-2PM and 5-7PM).'
pausecontent[7]='<strong>Massage Therapy</strong><br />Kate Walsh is the certified massage therapist at the Shepherd University Wellness Center. Services offered included ear candling, hot stone massage and<br />personalized gift certificates.  Give Kate a call at 757-435-4357 to discuss your needs or to schedule an appointment!!'



/***********************************************
* Pausing up-down scroller- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/

function pausescroller(content, divId, divClass, delay){
this.content=content //message array content
this.tickerid=divId //ID of ticker div to display information
this.delay=delay //Delay between msg change, in miliseconds.
this.mouseoverBol=0 //Boolean to indicate whether mouse is currently over scroller (and pause it if it is)
this.hiddendivpointer=1 //index of message array for hidden div
document.write('<div id="'+divId+'" class="'+divClass+'" style="position: relative; overflow: hidden"><div class="innerDiv" style="position: absolute; width: 100%" id="'+divId+'1">'+content[0]+'</div><div class="innerDiv" style="position: absolute; width: 100%; visibility: hidden" id="'+divId+'2">'+content[1]+'</div></div>')
var scrollerinstance=this
if (window.addEventListener) //run onload in DOM2 browsers
window.addEventListener("load", function(){scrollerinstance.initialize()}, false)
else if (window.attachEvent) //run onload in IE5.5+
window.attachEvent("onload", function(){scrollerinstance.initialize()})
else if (document.getElementById) //if legacy DOM browsers, just start scroller after 0.5 sec
setTimeout(function(){scrollerinstance.initialize()}, 500)
}

// -------------------------------------------------------------------
// initialize()- Initialize scroller method.
// -Get div objects, set initial positions, start up down animation
// -------------------------------------------------------------------

pausescroller.prototype.initialize=function(){
this.tickerdiv=document.getElementById(this.tickerid)
this.visiblediv=document.getElementById(this.tickerid+"1")
this.hiddendiv=document.getElementById(this.tickerid+"2")
this.visibledivtop=parseInt(pausescroller.getCSSpadding(this.tickerdiv))
//set width of inner DIVs to outer DIV's width minus padding (padding assumed to be top padding x 2)
this.visiblediv.style.width=this.hiddendiv.style.width=this.tickerdiv.offsetWidth-(this.visibledivtop*2)+"px"
this.getinline(this.visiblediv, this.hiddendiv)
this.hiddendiv.style.visibility="visible"
var scrollerinstance=this
document.getElementById(this.tickerid).onmouseover=function(){scrollerinstance.mouseoverBol=1}
document.getElementById(this.tickerid).onmouseout=function(){scrollerinstance.mouseoverBol=0}
if (window.attachEvent) //Clean up loose references in IE
window.attachEvent("onunload", function(){scrollerinstance.tickerdiv.onmouseover=scrollerinstance.tickerdiv.onmouseout=null})
setTimeout(function(){scrollerinstance.animateup()}, this.delay)
}


// -------------------------------------------------------------------
// animateup()- Move the two inner divs of the scroller up and in sync
// -------------------------------------------------------------------

pausescroller.prototype.animateup=function(){
var scrollerinstance=this
if (parseInt(this.hiddendiv.style.top)>(this.visibledivtop+5)){
this.visiblediv.style.top=parseInt(this.visiblediv.style.top)-5+"px"
this.hiddendiv.style.top=parseInt(this.hiddendiv.style.top)-5+"px"
setTimeout(function(){scrollerinstance.animateup()}, 50)
}
else{
this.getinline(this.hiddendiv, this.visiblediv)
this.swapdivs()
setTimeout(function(){scrollerinstance.setmessage()}, this.delay)
}
}

// -------------------------------------------------------------------
// swapdivs()- Swap between which is the visible and which is the hidden div
// -------------------------------------------------------------------

pausescroller.prototype.swapdivs=function(){
var tempcontainer=this.visiblediv
this.visiblediv=this.hiddendiv
this.hiddendiv=tempcontainer
}

pausescroller.prototype.getinline=function(div1, div2){
div1.style.top=this.visibledivtop+"px"
div2.style.top=Math.max(div1.parentNode.offsetHeight, div1.offsetHeight)+"px"
}

// -------------------------------------------------------------------
// setmessage()- Populate the hidden div with the next message before it's visible
// -------------------------------------------------------------------

pausescroller.prototype.setmessage=function(){
var scrollerinstance=this
if (this.mouseoverBol==1) //if mouse is currently over scoller, do nothing (pause it)
setTimeout(function(){scrollerinstance.setmessage()}, 100)
else{
var i=this.hiddendivpointer
var ceiling=this.content.length
this.hiddendivpointer=(i+1>ceiling-1)? 0 : i+1
this.hiddendiv.innerHTML=this.content[this.hiddendivpointer]
this.animateup()
}
}

pausescroller.getCSSpadding=function(tickerobj){ //get CSS padding value, if any
if (tickerobj.currentStyle)
return tickerobj.currentStyle["paddingTop"]
else if (window.getComputedStyle) //if DOM2
return window.getComputedStyle(tickerobj, "").getPropertyValue("padding-top")
else
return 0
}

