// this was the stuff in javascript/news_scroller.js
 

/*Example message arrays for the two demo scrollers*/

var pausecontent=new Array()
//pausecontent[0]='<strong>SCHOLARSHIP DEADLINE EXTENDED ...</strong> We\'ve extended the deadline for the A Nurse I Am Scholarship application and essay -- to Jan. 31, 2007! All you have to do is watch a short movie and write an essay on what it meant to you. In the balance are 10 scholarships each of $2,000! <a href="http://www.anurseiam.com" target="_blank"><strong>Learn More</strong></a>'
//pausecontent[1]='<strong>INSPIRATIONAL 2007 CALENDAR AVAILABLE!  </strong>   Get your free Cherokee 2007 Calendar, featuring the winners of the 2006 Cherokee Inspired Comfort Award, from healthcare employers, nursing schools and nursing associations! The perfect way to start 2007! <a href="http://www.inspiredcomfort.com/ica_calendar.php" target="_blank" ><strong> Learn More </strong></a>   '
//pausecontent[2]='<strong>CHEROKEE AWARD WINNER PENS PART IN NEW BOOK   </strong>Susan Fleming RN, a 2004 Cherokee Inspired Comfort Award winner, writes what it’s like to be disabled and working as a nurse in the inspiring book <em>Leave No Nurse Behind: Nurses Working With Disabilities</em>. <a href="http://www.amazon.com/Leave-No-Nurse-Behind-disAbilities/dp/0595396496/sr=8-1/qid=1164152372/ref=pd_bbs_sr_1/104-4998343-5698332?ie=UTF8&s=books" target="_blank" ><strong> Learn More </strong></a>'
//pausecontent[3]='<strong>CHEROKEE AWARD WINNER RECEIVES LOCAL AWARD…  </strong> Voncea Brusha, RN, a national winner of the 2005 Cherokee Inspired Comfort Award, is a 2007 honoree of the Ebony Appreciation Awards for improving lives in the Gainesville, Fla., area through volunteering and community education. '
//pausecontent[4]='<strong>INSPIRE NURSING STUDENTS…</strong>   The A Nurse I Am film – about nurses and for nurses – will spark an educational discussion of nursing and practice issues for nursing students and those considering the vocation! Comes with a classroom discussion guide and student handouts.   <a href="http://www.anurseiam" target="_blank" ><strong> Learn More </strong></a>   '
//pausecontent[5]='<strong>READ STORIES, POST COMMENTS…</strong>You can post comments now when you read stories and features on the Cherokee Inspired Comfort Award website. Let us know what you think!   <a href="http://www.inspiredcomfort.com" target="_blank" ><strong> Learn More </strong></a>'

var d = new Date();
var curr_year = d.getFullYear();
var last_year = curr_year - 1;

/*
This is the old scrolling messages, no one ever updated them so I'm putting in two pretty generic ones that will never go out of date
pausecontent[0]='<a href="http://www.anurseiam.com" target="_blank" title="More Information"><strong>IS YOUR NURSING SCHOOL</strong> showing the inspirational and educational film <strong>A Nurse I Am</strong>? If not, ask your <br />instructor to visit www.ANurseIAm.com for more details and a free copy of the film available on DVD.</a>';
pausecontent[1]=' <a href="http://www.inspiredcomfort.com" target="_blank" title="More Information"><strong>ANNOUNCING THE WINNERS OF THE '+curr_year+' CHEROKEE INSPIRED COMFORT AWARD...</strong> <br /> Read the remarkable stories and nominations of the exceptional 10 recipients of the 2007 Cherokee Inspired Comfort Award! </a>';
pausecontent[1]=' <a href="http://www.anurseiam.com" target="_blank" title="More Information"><strong>MEET THE SCHOLARSHIP WINNERS OF THE '+last_year+' A NURSE I AM SCHOLARSHIP PROGRAM... </strong> <br />10 nursing school students each won $2,000 scholarships by watching and writing about the acclaimed film A Nurse I Am! Read their winning essays!</a>';
pausecontent[2]='<a href="http://www.inspiredcomfort.com/calendars.html" target="_blank" title="More Information"><strong>FREE '+curr_year+' CALENDARS! </strong>These beautiful calendars feature the remarkable stories of each recipient of the '+last_year+' Cherokee Inspired Comfort Award, along with inspirational quotes and designated national healthcare professional recognition days. </a>';
pausecontent[3]='<a href="http://www.inspiredcomfort.com/contact.html" target="_blank" title="More Information"><strong>HAVE OUR SCRUBS MADE A DIFFERENCE? </strong>Tell us a true story about when a Cherokee scrub made a difference in your dealing with patients or their families. If we like it, we may include it on our websites – and you’ll get 3 Cherokee scrub tops of your choice!</a> ';
*/

pausecontent[0]='<a href="http://www.anurseiam.com" target="_blank" title="More Information"><strong>IS YOUR NURSING SCHOOL</strong> showing the inspirational and educational film <strong>A Nurse I Am</strong>? If not, ask your <br />instructor to visit www.ANurseIAm.com for more details and a free copy of the film available on DVD.</a>';
pausecontent[1]='<a href="http://www.inspiredcomfort.com/contact.html" target="_blank" title="More Information"><strong>HAVE OUR SCRUBS MADE A DIFFERENCE? </strong>Tell us a true story about when a Cherokee scrub made a difference in your dealing with patients or their families. If we like it, we may include it on our websites – and you’ll get 3 Cherokee scrub tops of your choice!</a> ';


/***********************************************
* 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()}, 400)
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
}