function addEvent( obj, type, fn ) {
	if (obj.addEventListener) {
		obj.addEventListener( type, fn, false );
		EventCache.add(obj, type, fn);
	}
	else if (obj.attachEvent) {
		obj["e"+type+fn] = fn;
		obj[type+fn] = function() { obj["e"+type+fn]( window.event ); }
		obj.attachEvent( "on"+type, obj[type+fn] );
		EventCache.add(obj, type, fn);
	}
	else {
		obj["on"+type] = obj["e"+type+fn];
	}
}

var EventCache = function(){
	var listEvents = [];
	return {
		listEvents : listEvents,
		add : function(node, sEventName, fHandler){
			listEvents.push(arguments);
		},
		flush : function(){
			var i, item;
			for(i = listEvents.length - 1; i >= 0; i = i - 1){
				item = listEvents[i];
				if(item[0].removeEventListener){
					item[0].removeEventListener(item[1], item[2], item[3]);
				};
				if(item[1].substring(0, 2) != "on"){
					item[1] = "on" + item[1];
				};
				if(item[0].detachEvent){
					item[0].detachEvent(item[1], item[2]);
				};
				item[0][item[1]] = null;
			};
		}
	};
}();
addEvent(window,'unload',EventCache.flush);

soundManager.url = 'soundmanager/'; // directory where SM2 .SWFs live
soundManager.debugMode = false;


soundManager.onload = function() {

}

function addListeners() {
  if (!document.getElementById) return;

// var setMotion = document.getElementById('extra-info');
// addEvent(setMotion, 'load', new pausescroller(pausecontent, "pscroller1", "someclass", 20000), true);

}

var pausecontent=new Array()
pausecontent[0]='<div>'
+ '<div class="mini-pic"><img src="images/angelus.jpg" alt="Our Lord, Our Lady and the Angels" width="72px" height="72px" /></div>'
+ '<div class="title">'
+' <h2>The Angelus</h2>'
+ '<h3>The Angel of the Lord declared unto Mary:<br />'
+ 'And she conceived by the power of the Holy Spirit.</h3>'
+ '<p>Hail Mary, full of grace, the Lord is with thee;</p>'
+ '<p>blessed art thou among women,</p>'
+ '<p>and blessed is the fruit of thy womb, Jesus.</p>'
+ '<p>Holy Mary, Mother of God, pray for us sinners,</p>' 
+ '<p>now and at the hour of our death. Amen.</p>'
+ '</div>'
+ '<div class="clearfloats">&nbsp;</div>'
+ '</div>';
pausecontent[1]='<div>'
+ '<div class="mini-pic"><img src="images/angelus.jpg" alt="Our Lord, Our Lady and the Angels" width="72px" height="72px" /></div>'
+ '<div class="title">'
+ '<h3>Behold the handmaid of the Lord:<br />'
+ 'Be it done unto me according to Thy word.</h3>'
+ '<p>Hail Mary, full of grace, the Lord is with thee;</p>'
+ '<p>blessed art thou among women,</p>'
+ '<p>and blessed is the fruit of thy womb, Jesus.</p>'
+ '<p>Holy Mary, Mother of God, pray for us sinners,</p>' 
+ '<p>now and at the hour of our death. Amen.</p>'
+ '</div>'
+ '<div class="clearfloats">&nbsp;</div>'
+ '</div>';
pausecontent[2]='<div>'
+ '<div class="mini-pic"><img src="images/angelus.jpg" alt="Our Lord, Our Lady and the Angels" width="72px" height="72px" /></div>'
+ '<div class="title">'
+ '<h3>And the Word was made Flesh:<br />'
+ 'And dwelt among us.</h3>'
+ '<p>Hail Mary, full of grace, the Lord is with thee;</p>'
+ '<p>blessed art thou among women,</p>'
+ '<p>and blessed is the fruit of thy womb, Jesus.</p>'
+ '<p>Holy Mary, Mother of God, pray for us sinners,</p>' 
+ '<p>now and at the hour of our death. Amen.</p>'
+ '</div>'
+ '<div class="clearfloats">&nbsp;</div>'
+ '</div>';
pausecontent[3]='<div>'
+ '<div class="mini-pic"><img src="images/angelus.jpg" alt="Our Lord, Our Lady and the Angels" width="72px" height="72px" /></div>'
+ '<div class="title">'
+ '<h3>Pray for us, O Holy Mother of God, <br />'
+ 'that we may be made worthy of the promises of Christ.<br />'
+ 'Let us pray:</h3>'
+ '<p>Pour forth, we beseech Thee, O Lord,</p>'
+ '<p>Thy grace into our hearts;</p>'
+ '<p>that we, to whom the incarnation of Christ, Thy Son,</p>'
+ '<p>was made known by the message of an angel,</p>' 
+ '<p>may by His Passion and Cross be brought to the glory of His Resurrection,</p>'
+ '<p>through the same Christ Our Lord. Amen.</p>'
+ '</div>'
+ '<div class="clearfloats">&nbsp;</div>'
+ '</div>';

var pausecontent2=new Array()
pausecontent2[0]='<div>'
+ '<div class="mini-pic"><img src="images/angelus.jpg" alt="Our Lord, Our Lady and the Angels" width="72px" height="72px" /></div>'
+ '<div class="title">'
+' <h3>St. Ignatius the Martyr</h3>'
+ '<p>"One who is always full of zeal and devotion for the Virgin Mother of God will never come to a bad end. It is impossible, O Virgin, for a sinner to be saved except through your help and protection"</p>'
+ '</div>'
+ '<div class="clearfloats">&nbsp;</div>'
+ '</div>';
pausecontent2[1]='<div>'
+ '<div class="mini-pic"><img src="images/angelus.jpg" alt="Our Lord, Our Lady and the Angels" width="72px" height="72px" /></div>'
+ '<div class="title">'
+' <h3>St. Maximilian Kolbe</h3>'
+ '<p>"Introduce the Immaculate Mother into all hearts so that, once she enters within them, she may take possession of them, bring sweet Jesus there, and make Him grow to the perfect age"</p>'
+ '</div>'
+ '<div class="clearfloats">&nbsp;</div>'
+ '</div>';
pausecontent2[2]='<div>'
+ '<div class="mini-pic"><img src="images/angelus.jpg" alt="Our Lord, Our Lady and the Angels" width="72px" height="72px" /></div>'
+ '<div class="title">'
+' <h3>St. Pio of Pietrelcina</h3>'
+ '<p>"Love Our Lady and make her loved", "Would that I had a very powerful voice, to invite sinners all over the world to love Our Lady"</p>'
+ '</div>'
+ '<div class="clearfloats">&nbsp;</div>'
+ '</div>';


var pausecontent3=new Array()
pausecontent3[0]='<div>'
+ '<div class="mini-pic"><img src="images/angelus.jpg" alt="Our Lord, Our Lady and the Angels" width="72px" height="72px" /></div>'
+ '<div class="title">'
+' <h3>Prayer of St. Gertrude the Great dictated by our Lord to release souls from Purgatory each time it is said</h3>'
+ '<p>"Eternal Father, I offer Thee the Most Precious Blood of Thy Divine Son, Jesus, in union with the Masses said throughout the world today, for all the holy Souls in Purgatory, for sinners everywhere, for sinner in the Universal Church, those in my own home and within my family. Amen."</p>'
+ '</div>'
+ '<div class="clearfloats">&nbsp;</div>'
+ '</div>';
pausecontent3[1]='<div>'
+ '<div class="mini-pic"><img src="images/maximilian-kolbe.jpg" alt="St Maximilian Kolbe" width="72px" height="72px" /></div>'
+ '<div class="title">'
+' <h3>St. Maximilian Kolbe</h3>'
+ '<p>"O Mary conceived without sin, pray for us who have recourse to you and for all those who do not have recourse to you, especially for the enemies of the Holy Church and for those recommended to you."</p>'
+ '</div>'
+ '<div class="clearfloats">&nbsp;</div>'
+ '</div>';

var pausecontent4=new Array()
pausecontent4[0]='<div>'
+ '<div class="mini-pic"><img src="images/divine-mercy.jpg" alt="The Divine Mercy Image" width="72px" height="72px" /></div>'
+ '<div class="title">'
+' <h2>The Chaplet of Divine Mercy</h2>'
+ '<h3>For private recitation on ordinary rosary beads</h3>'
+ '<p>Our Father... Hail Mary... The Apostleâ€™s Creed...</p>'
+ '</div>'
+ '<div class="clearfloats">&nbsp;</div>'
+ '</div>';
pausecontent4[1]='<div>'
+ '<div class="mini-pic"><img src="images/divine-mercy.jpg" alt="The Divine Mercy Image" width="72px" height="72px" /></div>'
+ '<div class="title">'
+' <h2>The Chaplet of Divine Mercy</h2>'
+ '<h3>Then on the Our Father Beads, you will say the following words:</h3>'
+ '<p>Eternal Father, I offer You the Body and the Blood, Soul and Divinity of Your dearly beloved Son, Our Lord Jesus Christ, in atonement for our sins and those of the whole world.</p>'
+ '</div>'
+ '<div class="clearfloats">&nbsp;</div>'
+ '</div>';
pausecontent4[2]='<div>'
+ '<div class="mini-pic"><img src="images/divine-mercy.jpg" alt="The Divine Mercy Image" width="72px" height="72px" /></div>'
+ '<div class="title">'
+' <h2>The Chaplet of Divine Mercy</h2>'
+ '<h3>On the Hail Mary beads you will say the following words:</h3>'
+ '<p>For the sake of His sorrowful passion have mercy on us and on the whole world.</p>'
+ '</div>'
+ '<div class="clearfloats">&nbsp;</div>'
+ '</div>';
pausecontent4[3]='<div>'
+ '<div class="mini-pic"><img src="images/divine-mercy.jpg" alt="The Divine Mercy Image" width="72px" height="72px" /></div>'
+ '<div class="title">'
+' <h2>The Chaplet of Divine Mercy</h2>'
+ '<h3>In conclusion you will recite these words three times:</h3>'
+ '<p>Holy God, Holy Mighty One, Holy Immortal One, have mercy on us and on the whole world.</p>'
+ '</div>'
+ '<div class="clearfloats">&nbsp;</div>'
+ '</div>';
pausecontent4[4]='<div>'
+ '<div class="mini-pic"><img src="images/divine-mercy.jpg" alt="The Divine Mercy Image" width="72px" height="72px" /></div>'
+ '<div class="title">'
+' <h2>The Chaplet of Divine Mercy</h2>'
+ '<h3>At 3 o\'clock in the afternoon say:</h3>'
+ '<p>You expired Jesus but the source of life gushed forth for souls and the ocean of Mercy opened up for the whole world. O Fount of Life, unfathomable Divine Mercy, envelop the whole world and empty Yourself out upon us.</p>'
+ '<p>O Blood and Water which gushed forth from the Heart of Jesus as a Fount of Mercy for us, I trust in You.</p>'
+ '</div>'
+ '<div class="clearfloats">&nbsp;</div>'
+ '</div>';

/***********************************************
* 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.divClass = divClass;
var dest = document.getElementById('extra-info');
dest.innerHTML= '<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)
if (this.divClass =="makechimes" && soundManager.isIE != "null") { setTimeout(function() { soundManager.createSound('playchimes','sounds/_mp3/chimes.mp3');
soundManager.play('playchimes'); }, 2000) }
else if (this.divClass =="makechimes") { soundManager.createSound('playchimes','sounds/_mp3/chimes.mp3'); soundManager.play('playchimes'); }
}


// -------------------------------------------------------------------
// 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)
if (this.divClass =="makechimes") {soundManager.createSound('playchimes','sounds/_mp3/chimes.mp3');
soundManager.play('playchimes'); }
}
}

// -------------------------------------------------------------------
// 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
}

addEvent(window, 'load', addListeners, false);