// JavaScript Document
function EmailDisplay()
{
	if(email.style.display=="none"){
		email.style.display="block";
		Viewpoint.style.display="none";	
	}
	else
	{
		email.style.display="none";	
	}

}
function ViewpointDisplay()
{
	if(Viewpoint.style.display=="none"){
		Viewpoint.style.display="block";
		email.style.display="none";	
	}
	else
	{
		Viewpoint.style.display="none";	
	}

}
function StartScrolling(){
    // Make sure the clock is stopped
    StopTheClock()

    // Pick the first message at random
    PickRandomMessage()

    // Off we go...
    DoTheScroll()
}

function StopTheClock(){
    if(timerRunning)
        clearTimeout(timerID)
    timerRunning = false
}

function DoTheScroll(){
    if (pos <= msg.length)
        self.status = msg.substring(pos, msg.length);
    else{
        PickRandomMessage()
        pos=-1
    }
    ++pos
    timerRunning = true
    timerID = self.setTimeout("DoTheScroll()", delay)
}

function PickRandomMessage(){
    // Use the time (i.e., seconds) to get a random number
    var d = new Date()
    var secs = d.getSeconds()
    var rnd = (secs % messages.length) + 1
    msg = messages[rnd]

    // Pad the message with spaces to get the "start" position
    for (var i = 0; i < startPos; i++) msg = " " + msg
}

function BuildArray(size){
    this.length = size
    for (var i = 1; i <= size; i++){
        this[i] = null}
    return this
}
