/*Example message arrays for the two demo scrollers*/

var pausecontent=new Array()
pausecontent[0]="<h1><a href='http://video.google.com/videoplay?docid=-5196356296066729535' target='_blank'>Watch the video on 15 years of ILP</a></h1>"
pausecontent[1]="If You Can Read This, <br>Help those who can not.<br><br>Support India Literacy Project"
pausecontent[2]="Education is the best provision for old age.<br>~ Aristotle"
pausecontent[3]="It takes a whole village to raise a child.<br>~ Ashanti proverb"
pausecontent[4]="Genius without education is like silver in the mine. <br>~ Ben Franklin"
pausecontent[5]="The greatest good you can do for another is not just to share your riches but to reveal to him his own. <br>~ Benjamin Disraeli"
pausecontent[6]="Literacy is not a luxury, it is a right and a responsibility.<br>~ Bill Clinton"
pausecontent[7]="Education is the ability to think clearly, act well in the world of work and to appreciate life.<br>~ Brigham Young"
pausecontent[8]="The foundation of every state is the education of its youth.<br>~ Diogenes Laertius"
pausecontent[9]="There are two ways of spreading light: to be the candle or the mirror that reflects it.<br>~ Edith Wharton"
pausecontent[10]="If you want to work on the core problem, it's early school literacy.”<br>~ James Barksdale"
pausecontent[11]="The main hope of a nation lies in the proper education of its youth.<br>~ Erasmus"
pausecontent[12]="Education is helping the child realize his potentialities.<br>~ Erich Fromm"
pausecontent[13]="You cannot teach a man anything; you can only help him find it within himself.<br>~ Galileo"
pausecontent[14]="Education makes a people easy to lead, but difficult to drive; easy to govern, but impossible to enslave.<br>~ Gen. Omar N. Bradley"
pausecontent[15]="Education: a debt due from present to future generations.<br>~ George Peabody"
pausecontent[16]="Universal literacy is an obligation of the entire society not the priviledge of individuals<br>~ Amlan Dutta"
pausecontent[17]="The highest result of education is tolerance.<br>~ Helen Keller"
pausecontent[18]="There are many little ways to enlarge your child's world. Love of books is the best of all.<br>~ Jacqueline Kennedy Onassis"
pausecontent[19]="Next in importance to freedom and justice is popular education, without which neither freedom nor justice can be permanently maintained.<br>~ James A. Garfield "
pausecontent[20]="Education is not preparation for life; education is life itself.<br>~ John Dewey"
pausecontent[21]="What sculpture is to a block of marble, education is to an human soul.<br>~ Joseph Addison"
pausecontent[22]="The job of an educator is to teach students to see the vitality in themselves. <br>~ Joseph Campbell"
pausecontent[23]="Literacy unlocks the door to learning throughout life, is essential to development and health, and opens the way for democratic participation and active citizenship.<br>~ Kofi Annan "
pausecontent[24]="Education should be the process of helping everyone to discover his uniqueness to teach him how to develop that uniqueness. <br>~ Leo Buscaglia"
pausecontent[25]="Education makes a people easy to lead, but difficult to drive; easy to govern, but impossible to enslave.<br>~ Lord Brougham"
pausecontent[26]="If we are to reach real peace in this world ... we shall have to begin with the children.<br>~ Mahatma Gandhi"
pausecontent[27]="Live as if your were to die tomorrow. Learn as if you were to live forever.<br>~ Mahatma Gandhi"
pausecontent[28]="Education is for improving the lives of others and for leaving your community and world better than you found it.<br>~ Marian Wright Edelman"
pausecontent[29]="Education is the most powerful weapon which you can use to change the world.<br>~ Nelson Mandela"
pausecontent[30]="But if you ask what is the good of education in general, the answer is easy: that education makes good men, and that good men act nobly.<br>~ Plato"
pausecontent[31]="He then learns that in going down into the secrets of his own mind he has descended into the secrets of all minds.<br>~ Ralph Waldo Emerson"
pausecontent[32]="Learning makes a man fit company for himself. <br>~ Thomas Fuller"
pausecontent[33]="A king is worshipped in his kingdom, a scholar is worshipped everywhere.<br>~ Upanishad"
pausecontent[34]="Education is the transmission of civilization.<br>~ Will Durant"
pausecontent[35]="Education is not the filling of a pail, but the lighting of a fire.<br>~ William Butler Yeats"
pausecontent[36]="Universal democracy is meaningless without universal literacy."
pausecontent[37]="The mind is not a vessel to be filled, but a fire to be kindled. Let education provide that fire."
pausecontent[38]="If you are planning for a year, sow rice; if you are planning for a decade, plant trees; if you are planning for a lifetime, educate people.~ Chinese Proverb"

/***********************************************
* 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()}, 50)
	else{
		var i=this.hiddendivpointer
		var ceiling=this.content.length
		//this.hiddendivpointer=(i+1>ceiling-1)? 0 : i+1
		this.hiddendivpointer=Math.floor(Math.random()*ceiling)
		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
}