
/*Example message arrays for the two demo scrollers*/

var pausecontent=new Array()
pausecontent[0]='<span style="line-height:2.2">Clear Channel Interspace Airports<br>Pruett & Co., Inc.<br>Border Embroidery<br>Sunwest Behavioral<br><a href="http://www.ascendeg.com" target="_blank">Ascend Entrepeneurial Growth</a><br><a href="http://www.advanced-mailing.com" target="_blank">Advanced Mailing Solutions</a><br<a href="http://www.msaincorp.com" target="_blank">Man-Machine Systems Assessment (MSA) Inc.</a><br><a href="http://www.epmarryme.com" target="_blank">El Paso Wedding Ceremonies</a><br><a href="http://www.pastrychefcafe.com" target="_blank">Pastry Chef Cafe</a></span>'
pausecontent[1]='<span style="line-height:2.2"><a href="http://www.publicgrounds.com" target="_blank">Public Grounds Coffee House</a><br><a href="http://www.theupsstorelocal.com/0497" target="_blank">The UPS Store</a><br><a href="http://www.printeksupplies.com" target="_blank">Printek Supplies, Inc.<br><a href="http://www.actioncoach.com/rickobrien" target="_blank">ActionCOACH - West Texas</a><br><a href="http://www.centralpaymentcorp.com" target="_blank">Central Payment Corporation</a><br><a href="http://www.chasesuitehotels.com" target="_blank">Chase Suites Hotel</a><br>Chavez Drywall & Paint LLC.<br>De Lara Estates - Bill Rose<br><a href="http://www.elpasorecycling.net" target="_blank">El Paso C&D Recycling/ El Paso Green Services</a></span>'
pausecontent[2]='<span style="line-height:2.2">Mesa West Medical P.A.<br><a href="http://www.pueblohomehealth.com" target="_blank">Pueblo De Salud Home Health Services</a><br><a href="http://www.shamrockfoods.com" target="_blank">Shamrock Foods</a><br>Success Realty - Rosalinda Medina<br>The Lube Doctor Express LLC<br><a href="http://www.uiw.edu/online.com" target="_blank">University of the Incarnate Word</a><br><a href="http://www.whataburger.com" target="_blank">Whataburger, LP</a><br>X Tream Security Solutions<br>S & S Mechanical & Fabrication<br></span>'
pausecontent[2]='<span style="line-height:2.2"><a href="http://www.carolcaudillo.com" target="_blank">Century 21 ADP - Carol Caudillo</a><br><a href="http://www.deliciousgiftsep.com" target="http://www.deliciousgiftsep.com">Delicious Gifts</a><br>JACE Contracting<br><a href="http://www.mexicosalsacompany.com" target="blank">Mexico Salsa Company, LLC.</a><br><a href="http://www.vendforacure.com" target="_blank">Brytson Awareness Vending, LLC</a><br><a href="http://www.glasheenlaw.com" target="_blank">Glasheen, Valles, Inderman & De Hoyos, LLP</a><br><a href="http://www.goldenrealestateep.com" target="_blank">Golden Real Estate - Elizabeth Golden</a><br><a href="http://www.latinlatteelp.com" target="_blank">Latin Latte</a><br></span>'
pausecontent[2]='<span style="line-height:2.2"><a href="Http://www.MAwebcenters.com/khb" target="_blank">MA WebCenters</a><br><a href="http://www.marketamerica.com/khb" target="_blank">Market America</a><br><a href="http://www.suncitymedical.com" target="_blank">Sun City Family Medical Practice</a><br>Longhorn Lighting<br><a href="http://www.jimdavis.com" target="_blank">Jim Davis Inc.</a><br><a href="http://www.mitel.com" target="_blank">Mitel</a><br><a href="http://www.desertagavebuilders.com" target="blank">Desert Agave Builders, LLC.</a><br><a href="http://www.optionsrealtyelp.com" target="_blank">Options Realty</a><br><a href="http://www.sceniclive.com" target="_blank">Scenic Live</a><br><a href="http://doubletree1.hilton.com" target="_blank">DoubleTree Hilton Hotel</a></span>'
pausecontent[2]='<span style="line-height:2.2"><a href="http://www.myjafra.comaarizpe" target="_blank">Jafra</a><br><a href="http://www.dekoracorp.com" target="_blank">Dekora Accessories & Furniture</a><br><a href="http://www.coldwellbankerep.com" target="_blank">Coldwell Banker - Laura Lynch</a><br><a href="http://www.bestinsuranceinelpaso.com" target="_blank">State Farm - James Cuilty</a><br><a href="http://www.cmrlscreen.com" target="_blank">Commercial Screenprinting, Inc.</a><br><a href="http://www.cmrlscreen.com" target="_blank">CSI - Ft. Bliss PX</a>Essco International, Inc.<br>Lia Sophia Jewelry<br><a href="_blank">Mighty Clean</a><br>Palms West</span>'
pausecontent[2]='<span style="line-height:2.2"><a href="http://www.pfoutdoors.com" target="_blank">Print Factory</a><br><a href="http://www.riobravotitle.com" target="_blank">Rio Bravo Title</a><br>Southwest G.C. EP, Inc.<br>Essco Environmental Inc.<br>Coconuts<br><href="http://www.monarcrealestate.com" target="_blank>Monarc Real Estate<br>Border Security Consultants<br>Skyline Construction Inc.<br><a href="http://www.radisson.com/elpasotx" target="_blank">Radisson Suites</a><br><a href="http://www.chelles.printroom.com" target="_blank">Chelles</a><br>Kwik Kopy Printing 147</span>'

/***********************************************
* 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
}
