/*Example message arrays for the two demo scrollers*/
var pausecontent=new Array()
pausecontent[0]='SBS News - JUN/2010
Serenity Limousines and Sedans has teamed up with Enterprise GPS in all of our vehicles from Los Angeles to Santa Barbara and beyond. We are excited to launch this hot and new service and technology which will help us to service our client\'s needs. '
pausecontent[1]='SBS News - OCT/2010
The competence and professional manner of your staff made our tour extremely comforting and convenient, especially since we are out of town. - Mark '
pausecontent[2]='SBS News - NOV/2010
\"I would like to let you know our driver was so amazing. He did a great job in keeping us all relaxed. I\'m looking forward in seeing you guys again.\" - Jon '
pausecontent[3]='SBS News - NOV/2010
\"Wow! What can I say, Chris and Vivian all of your guys are all professional to the end. The services, the punctuality of the drivers... Thank you for such a great weekend.\" - Jessie '
pausecontent[4]='SBS News - DEC/2010
\"We love your services! We are going to send you some pictures from our special day.\" - Mark '
pausecontent[5]='SBS News - DEC/2010
\"Thank you for helping make our wedding day so special and will surely recommend your company to our friends and relatives.\"- Chris and Ann '
pausecontent[6]='SBS News - JAN/2011
Serenity Limousines was great. Professional and punctual Their fleet is also elegant and contemporary. I would highly recommend them to anyone! Erica Jackson '
pausecontent[7]='SBS News - JAN/2011
\"Thank you all for helping my friends birthday a huge success. The driver was gentleman very accommodating and polite. The limo was beautiful and will surely remember serenitylimo.com for all our future limo needs.\" - Evelyn '
pausecontent[8]='SBS News - FEB/2011
Chris Hecker and his staff were the back bone of and fundamental reason why my wife’s dream finally came true. The price was exceptional, the service was supportive, flexible, and in all points superb. They were on time, the ride was smooth, the amenities were above par and centered c '
pausecontent[9]='SBS News - FEB/2011
I am retiring and my last day is tomorrow. I just wanted you to know how much I appreciate all the help you have given me over the years and how wonderful it was to work with you. I truly appreciate all of the help you have given me and I cannot thank you enough. Thank you. '
pausecontent[10]='SBS News - FEB/2011
Great service Vivian is really easy to work with, the cars were new and clean and knew the area well. '
pausecontent[11]='SBS News - FEB/2011
T. Geist\"We used your service last Wednesday night to go up to a Lakers game. Our driver was James, and we wanted to let you know that he did an awesome job! He was very professional (& patient), and he provided great service! We were also very pleased with the limo... '
pausecontent[12]='SBS News - FEB/2011
This is the Best Limousine experience I have ever had.Thank you Chris and the staff at Serenity Limousines for being part of my Wedding celebration. The driver was polite and able to handle all of my loud friends. '
/***********************************************
* 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('
'+content[0]+'
'+content[1]+'
')
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
}