/***********************************************
* Pausing updown message scroller- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

//configure the below five variables to change the style of the scroller
var scrollerdelay='5000' //delay between msg scrolls. 3000=3 seconds.
var scrollerwidth='170px'
var scrollerheight='120px'
var scrollerheight_pres='100px'
var scrollerheight_edi='130px'
var scrollerheight_form='150px'
var scrollerbgcolor=''
//set below to '' if you don't wish to use a background image
var scrollerbackground=''

//configure the below variable to change the contents of the scroller
var messages=new Array()
var messages_pres=new Array()
var messages_edi=new Array()
var messages_form=new Array()
var num_msg=0
var num_msg_pres=0
var num_msg_edi=0
var num_msg_form=0

///////Do not edit pass this line///////////////////////

var ie		=	document.all
var dom		=	document.getElementById



function move(whichdiv)
{
	tdiv=eval(whichdiv)
	if (parseInt(tdiv.style.top)>0&&parseInt(tdiv.style.top)<=5){
		tdiv.style.top=0+"px"
		setTimeout("move(tdiv)",scrollerdelay)
		setTimeout("move2(second2_obj)",scrollerdelay)
		return
	}
	if (parseInt(tdiv.style.top)>=tdiv.offsetHeight*-1){
		tdiv.style.top=parseInt(tdiv.style.top)-5+"px"
		setTimeout("move(tdiv)",50)
	}
	else{
		tdiv.style.top=parseInt(scrollerheight)+"px"
		tdiv.innerHTML=messages[u]
		if (u==messages.length-1)
			u=0
		else
			u++
	}
}

function move2(whichdiv)
{
	tdiv2=eval(whichdiv)
	if (parseInt(tdiv2.style.top)>0&&parseInt(tdiv2.style.top)<=5){
		tdiv2.style.top=0+"px"
		setTimeout("move2(tdiv2)",scrollerdelay)
		setTimeout("move(first2_obj)",scrollerdelay)
		return
	}
	if (parseInt(tdiv2.style.top)>=tdiv2.offsetHeight*-1){
		tdiv2.style.top=parseInt(tdiv2.style.top)-5+"px"
		setTimeout("move2(second2_obj)",50)
	}
	else{
		tdiv2.style.top=parseInt(scrollerheight)+"px"
		tdiv2.innerHTML=messages[u]
		if (u==messages.length-1)
			u=0
		else
			u++
	}
}

function startscroll()
{
	if (messages.length>2) u=2; else u=0;
	first2_obj=ie? first2 : document.getElementById("first2")
	second2_obj=ie? second2 : document.getElementById("second2")
	move(first2_obj)
	second2_obj.style.top=scrollerheight
	second2_obj.style.visibility='visible'
}

function addMessage(txt)
{
	messages[num_msg]=txt;
	num_msg++;
}

function scrollingdiv_init()
{
	if (ie||dom){
		document.writeln('<div id="main2" style="margin:0px; position:relative;width:'+scrollerwidth+';height:'+scrollerheight+';overflow:hidden;background-color:'+scrollerbgcolor+' ;background-image:url('+scrollerbackground+';z-index:0;)">')
		document.writeln('<div style="position:absolute;width:'+scrollerwidth+';height:'+scrollerheight+';clip:rect(0 '+scrollerwidth+' '+scrollerheight+' 0);left:0px;top:0px;">')
		document.writeln('<div id="first2" style="position:absolute;width:'+scrollerwidth+';left:0px;top:1px;">')
		document.write(messages[0])
		document.writeln('</div>')
		document.writeln('<div id="second2" style="position:absolute;width:'+scrollerwidth+';left:0px;top:0px;visibility:hidden;">')
		document.write(messages[dyndetermine=(messages.length==1)? 0 : 1])
		document.writeln('</div>')
		document.writeln('</div>')
		document.writeln('</div>')
	}

	if(messages.length>1) {
		if (window.addEventListener)
			window.addEventListener("load", startscroll, false)
		else if (window.attachEvent)
			window.attachEvent("onload", startscroll)
		else if (ie||dom)
			window.onload=startscroll
	}
}



function move_pres(whichdiv_pres)
{
	tdiv_pres=eval(whichdiv_pres)
	if (parseInt(tdiv_pres.style.top)>0&&parseInt(tdiv_pres.style.top)<=5){
		tdiv_pres.style.top=0+"px"
		setTimeout("move_pres(tdiv_pres)",scrollerdelay)
		setTimeout("move2_pres(second2_obj_pres)",scrollerdelay)
		return
	}
	if (parseInt(tdiv_pres.style.top)>=tdiv_pres.offsetHeight*-1){
		tdiv_pres.style.top=parseInt(tdiv_pres.style.top)-5+"px"
		setTimeout("move_pres(tdiv_pres)",50)
	}
	else{
		tdiv_pres.style.top=parseInt(scrollerheight_pres)+"px"
		tdiv_pres.innerHTML=messages_pres[v]
		if (v==messages_pres.length-1)
			v=0
		else
			v++
	}
}

function move2_pres(whichdiv_pres)
{
	tdiv2_pres=eval(whichdiv_pres)
	if (parseInt(tdiv2_pres.style.top)>0&&parseInt(tdiv2_pres.style.top)<=5){
		tdiv2_pres.style.top=0+"px"
		setTimeout("move2_pres(tdiv2_pres)",scrollerdelay)
		setTimeout("move_pres(first2_obj_pres)",scrollerdelay)
		return
	}
	if (parseInt(tdiv2_pres.style.top)>=tdiv2_pres.offsetHeight*-1){
		tdiv2_pres.style.top=parseInt(tdiv2_pres.style.top)-5+"px"
		setTimeout("move2_pres(second2_obj_pres)",50)
	}
	else{
		tdiv2_pres.style.top=parseInt(scrollerheight_pres)+"px"
		tdiv2_pres.innerHTML=messages_pres[v]
		if (v==messages_pres.length-1)
			v=0
		else
			v++
	}
}
function startscroll_pres()
{
	if (messages_pres.length>2) v=2; else v=0;
	first2_obj_pres=ie? first2_pres : document.getElementById("first2_pres")
	second2_obj_pres=ie? second2_pres : document.getElementById("second2_pres")
	move_pres(first2_obj_pres)
	second2_obj_pres.style.top=scrollerheight_pres
	second2_obj_pres.style.visibility='visible'
}
function addMessage_pres(txt)
{
	messages_pres[num_msg_pres]=txt;
	num_msg_pres++;
}

function scrollingdiv_init_pres()
{
	if (ie||dom){
		document.writeln('<div id="main2_pres" style="margin:0px; position:relative;width:'+scrollerwidth+';height:'+scrollerheight_pres+';overflow:hidden;background-color:'+scrollerbgcolor+' ;background-image:url('+scrollerbackground+';z-index:0;)">')
		document.writeln('<div style="position:absolute;width:'+scrollerwidth+';height:'+scrollerheight_pres+';clip:rect(0 '+scrollerwidth+' '+scrollerheight_pres+' 0);left:0px;top:0px;">')
		document.writeln('<div id="first2_pres" style="position:absolute;width:'+scrollerwidth+';left:0px;top:1px;">')
		document.write(messages_pres[0])
		document.writeln('</div>')
		document.writeln('<div id="second2_pres" style="position:absolute;width:'+scrollerwidth+';left:0px;top:0px;visibility:hidden;">')
		document.write(messages_pres[dyndetermine=(messages_pres.length==1)? 0 : 1])
		document.writeln('</div>')
		document.writeln('</div>')
		document.writeln('</div>')
	}
	if(messages_pres.length>1) {
		if (window.addEventListener)
			window.addEventListener("load", startscroll_pres, false)
		else if (window.attachEvent)
			window.attachEvent("onload", startscroll_pres)
		else if (ie||dom)
			window.onload=startscroll_pres
	}
}


function move_edi(whichdiv_edi)
{
	tdiv_edi=eval(whichdiv_edi)
	if (parseInt(tdiv_edi.style.top)>0&&parseInt(tdiv_edi.style.top)<=5){
		tdiv_edi.style.top=0+"px"
		setTimeout("move_edi(tdiv_edi)",scrollerdelay)
		setTimeout("move2_edi(second2_obj_edi)",scrollerdelay)
		return
	}
	if (parseInt(tdiv_edi.style.top)>=tdiv_edi.offsetHeight*-1){
		tdiv_edi.style.top=parseInt(tdiv_edi.style.top)-5+"px"
		setTimeout("move_edi(tdiv_edi)",50)
	}
	else{
		tdiv_edi.style.top=parseInt(scrollerheight_edi)+"px"
		tdiv_edi.innerHTML=messages_edi[w]
		if (w==messages_edi.length-1)
			w=0
		else
			w++
	}
}

function move2_edi(whichdiv_edi)
{
	tdiv2_edi=eval(whichdiv_edi)
	if (parseInt(tdiv2_edi.style.top)>0&&parseInt(tdiv2_edi.style.top)<=5){
		tdiv2_edi.style.top=0+"px"
		setTimeout("move2_edi(tdiv2_edi)",scrollerdelay)
		setTimeout("move_edi(first2_obj_edi)",scrollerdelay)
		return
	}
	if (parseInt(tdiv2_edi.style.top)>=tdiv2_edi.offsetHeight*-1){
		tdiv2_edi.style.top=parseInt(tdiv2_edi.style.top)-5+"px"
		setTimeout("move2_edi(second2_obj_edi)",50)
	}
	else{
		tdiv2_edi.style.top=parseInt(scrollerheight_edi)+"px"
		tdiv2_edi.innerHTML=messages_edi[w]
		if (w==messages_edi.length-1)
			w=0
		else
			w++
	}
}
function startscroll_edi()
{
	if (messages_edi.length>2) w=2; else w=0;
	first2_obj_edi=ie? first2_edi : document.getElementById("first2_edi")
	second2_obj_edi=ie? second2_edi : document.getElementById("second2_edi")
	move_edi(first2_obj_edi)
	second2_obj_edi.style.top=scrollerheight_edi
	second2_obj_edi.style.visibility='visible'
}
function addMessage_edi(txt)
{
	messages_edi[num_msg_edi]=txt;
	num_msg_edi++;
}

function scrollingdiv_init_edi()
{
	if (ie||dom){
		document.writeln('<div id="main2_edi" style="margin:0px; position:relative;width:'+scrollerwidth+';height:'+scrollerheight_edi+';overflow:hidden;background-color:'+scrollerbgcolor+' ;background-image:url('+scrollerbackground+';z-index:0;)">')
		document.writeln('<div style="position:absolute;width:'+scrollerwidth+';height:'+scrollerheight_edi+';clip:rect(0 '+scrollerwidth+' '+scrollerheight_edi+' 0);left:0px;top:0px;">')
		document.writeln('<div id="first2_edi" style="position:absolute;width:'+scrollerwidth+';left:0px;top:1px;">')
		document.write(messages_edi[0])
		document.writeln('</div>')
		document.writeln('<div id="second2_edi" style="position:absolute;width:'+scrollerwidth+';left:0px;top:0px;visibility:hidden;">')
		document.write(messages_edi[dyndetermine=(messages_edi.length==1)? 0 : 1])
		document.writeln('</div>')
		document.writeln('</div>')
		document.writeln('</div>')
	}
	if(messages_edi.length>1) {
		if (window.addEventListener)
			window.addEventListener("load", startscroll_edi, false)
		else if (window.attachEvent)
			window.attachEvent("onload", startscroll_edi)
		else if (ie||dom)
			window.onload=startscroll_edi
	}
}



function move_form(whichdiv_form)
{
	tdiv_form=eval(whichdiv_form)
	if (parseInt(tdiv_form.style.top)>0&&parseInt(tdiv_form.style.top)<=5){
		tdiv_form.style.top=0+"px"
		setTimeout("move_form(tdiv_form)",scrollerdelay)
		setTimeout("move2_form(second2_obj_form)",scrollerdelay)
		return
	}
	if (parseInt(tdiv_form.style.top)>=tdiv_form.offsetHeight*-1){
		tdiv_form.style.top=parseInt(tdiv_form.style.top)-5+"px"
		setTimeout("move_form(tdiv_form)",50)
	}
	else{
		tdiv_form.style.top=parseInt(scrollerheight_form)+"px"
		tdiv_form.innerHTML=messages_form[ww]
		if (ww==messages_form.length-1)
			ww=0
		else
			ww++
	}
}

function move2_form(whichdiv_form)
{
	tdiv2_form=eval(whichdiv_form)
	if (parseInt(tdiv2_form.style.top)>0&&parseInt(tdiv2_form.style.top)<=5){
		tdiv2_form.style.top=0+"px"
		setTimeout("move2_form(tdiv2_form)",scrollerdelay)
		setTimeout("move_form(first2_obj_form)",scrollerdelay)
		return
	}
	if (parseInt(tdiv2_form.style.top)>=tdiv2_form.offsetHeight*-1){
		tdiv2_form.style.top=parseInt(tdiv2_form.style.top)-5+"px"
		setTimeout("move2_form(second2_obj_form)",50)
	}
	else{
		tdiv2_form.style.top=parseInt(scrollerheight_form)+"px"
		tdiv2_form.innerHTML=messages_form[ww]
		if (ww==messages_form.length-1)
			ww=0
		else
			ww++
	}
}
function startscroll_form()
{
	if (messages_form.length>2) ww=2; else ww=0;
	first2_obj_form=ie? first2_form : document.getElementById("first2_form")
	second2_obj_form=ie? second2_form : document.getElementById("second2_form")
	move_form(first2_obj_form)
	second2_obj_form.style.top=scrollerheight_form
	second2_obj_form.style.visibility='visible'
}
function addMessage_form(txt)
{
	messages_form[num_msg_form]=txt;
	num_msg_form++;
}

function scrollingdiv_init_form()
{
	if (ie||dom){
		document.writeln('<div id="main2_form" style="margin:0px; position:relative;width:'+scrollerwidth+';height:'+scrollerheight_form+';overflow:hidden;background-color:'+scrollerbgcolor+' ;background-image:url('+scrollerbackground+';z-index:0;)">')
		document.writeln('<div style="position:absolute;width:'+scrollerwidth+';height:'+scrollerheight_form+';clip:rect(0 '+scrollerwidth+' '+scrollerheight_form+' 0);left:0px;top:0px;">')
		document.writeln('<div id="first2_form" style="position:absolute;width:'+scrollerwidth+';left:0px;top:1px;">')
		document.write(messages_form[0])
		document.writeln('</div>')
		document.writeln('<div id="second2_form" style="position:absolute;width:'+scrollerwidth+';left:0px;top:0px;visibility:hidden;">')
		document.write(messages_form[dyndetermine=(messages_form.length==1)? 0 : 1])
		document.writeln('</div>')
		document.writeln('</div>')
		document.writeln('</div>')
	}
	if(messages_form.length>1) {
		if (window.addEventListener)
			window.addEventListener("load", startscroll_form, false)
		else if (window.attachEvent)
			window.attachEvent("onload", startscroll_form)
		else if (ie||dom)
			window.onload=startscroll_form
	}
}
