// Pausing updown message scroller- © Dynamic Drive DHTML code library (www.dynamicdrive.com) Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code

var scrollerdelay='2500' //delay between msg scrolls. 3000=3 seconds.
var scrollerwidth='162px'
var scrollerheight='30px'
var scrollerbgcolor='white'
var scrollerbackground=''

//configure the below variable to change the contents of the scroller
var messages=new Array()

//messages[0]="<span class=text>Valdosta State Summer Registration is open!</span>"
messages[0]="<img src=forum/forum_images/poll_icon.gif align=absmiddle>&nbsp;<a href='http://vsunotes.com/forum/forum_posts.asp?TID=18&PN=1'>Vote in Newest Poll</a>"
messages[1]="<img src=images/bullet_red_dot.gif align=absmiddle><a href='forum/calendar.asp'>View your Calendar</a>"
messages[2]="<img src=images/bullet_red_dot.gif align=absmiddle><a href='searchEvaluations.asp'>Search the Evaluations</a>"
messages[3]="<img src=images/bullet_red_dot.gif align=absmiddle><a href='forum/forum_topics.asp?FID=6'>Roommate Area</a>"
messages[4]="<span class=text>Add your own events to the VSU Calendar!</span>"
//messages[6]="<a href=\"JavaScript:window.open('forum/calendar_event.asp?ID=29','calendar_event','toolbar=0,location=0,status=0,menubar=0,scrollbars=1,resizable=1,width=400,height=400'); void('');\">Welcome back from Spring Break</a>"
// messages[5]="<img src=images/bullet_red_dot.gif align=absmiddle><a href='forum/default.asp'>New Message Boards</a>"

var ie=document.all
var dom=document.getElementById

if (messages.length>2)
i=2
else
i=0

function move1(whichlayer){
tlayer=eval(whichlayer)
if (tlayer.top>0&&tlayer.top<=5){
	tlayer.top=0
	setTimeout("move1(tlayer)",scrollerdelay)
	setTimeout("move2(document.main.document.second)",scrollerdelay)
	return
}
if (tlayer.top>=tlayer.document.height*-1){
	tlayer.top-=5
	setTimeout("move1(tlayer)",50)
}
else{
	tlayer.top=parseInt(scrollerheight)
	tlayer.document.write(messages[i])
	tlayer.document.close()
	if (i==messages.length-1)
		i=0
	else
		i++
	}
}

function move2(whichlayer){
	tlayer2=eval(whichlayer)
	if (tlayer2.top>0&&tlayer2.top<=5){
		tlayer2.top=0
		setTimeout("move2(tlayer2)",scrollerdelay)
		setTimeout("move1(document.main.document.first)",scrollerdelay)
		return
	}
	if (tlayer2.top>=tlayer2.document.height*-1){
		tlayer2.top-=5
		setTimeout("move2(tlayer2)",50)
	}
	else{
		tlayer2.top=parseInt(scrollerheight)
		tlayer2.document.write(messages[i])
		tlayer2.document.close()
		if (i==messages.length-1)
			i=0
		else
			i++
	}
} // End of function move2

function move3(whichdiv){
	tdiv=eval(whichdiv)
	if (parseInt(tdiv.style.top)>0&&parseInt(tdiv.style.top)<=5){
		tdiv.style.top=0+"px"
		setTimeout("move3(tdiv)",scrollerdelay)
		setTimeout("move4(second2_obj)",scrollerdelay)
		return
	}
	if (parseInt(tdiv.style.top)>=tdiv.offsetHeight*-1){
		tdiv.style.top=parseInt(tdiv.style.top)-5+"px"
		setTimeout("move3(tdiv)",50)
	}
	else{
		tdiv.style.top=parseInt(scrollerheight)
		tdiv.innerHTML=messages[i]
		if (i==messages.length-1)
			i=0
		else
			i++
	}
} // End of function move3

function move4(whichdiv){
	tdiv2=eval(whichdiv)
	if (parseInt(tdiv2.style.top)>0&&parseInt(tdiv2.style.top)<=5){
		tdiv2.style.top=0+"px"
		setTimeout("move4(tdiv2)",scrollerdelay)
		setTimeout("move3(first2_obj)",scrollerdelay)
		return
	}
	if (parseInt(tdiv2.style.top)>=tdiv2.offsetHeight*-1){
		tdiv2.style.top=parseInt(tdiv2.style.top)-5+"px"
		setTimeout("move4(second2_obj)",50)
	}
	else{
		tdiv2.style.top=parseInt(scrollerheight)
		tdiv2.innerHTML=messages[i]
		if (i==messages.length-1)
			i=0
		else
			i++	
	}
} // End of function move4


function startscroll(){
	if (ie||dom){
		first2_obj=ie? first2 : document.getElementById("first2")
		second2_obj=ie? second2 : document.getElementById("second2")
		move3(first2_obj)
		second2_obj.style.top=scrollerheight
		second2_obj.style.visibility='visible'
	}
	else if (document.layers){
		document.main.visibility='show'
		move1(document.main.document.first)
		document.main.document.second.top=parseInt(scrollerheight)+5
		document.main.document.second.visibility='show'
	}
} // startscroll

window.onload=startscroll

function suycDateDiff() {
    var iOut = 0;    
    var d = new Date();
    var todaysDate;
    todaysDate = d.getMonth() + '/' + d.getDate() + '/' + d.getFullYear();
    
//    if (todaysDate == '02/14/2005'){
//    	return "Today!";
//    }
    var bufferA = Date.parse(todaysDate);
    var bufferB = Date.parse('02/26/2005');  
    	
    var number = bufferB-bufferA ;
    
    // what kind of add to do? 
    iOut = parseInt(number / 86400000) ;
    
    return iOut ;
}

function getDateStr(){
    var today = new Date();
    var year = today.getFullYear();
    var month = today.getMonth() + 1;
    var day = today.getDate();
    
	todayStr = day + '/' + month + '/' + year;
}