var text = 0;

var message=new Array();

/*
message[0] = "Welcome to the JavaScript Source!"
message[1] = "Tons of scripts for your Web pages"
message[2] = "Why not share your scripts with others?"
message[3] = "Be sure to come back again ..."

function changeText() {
  if (message.length > 0) {
    document.change.descript.value=message[text];
    text++;
  }
  if (text == 4) {text = 0; }  // change the # 4 at the left to the maximum # of message lines you want included
    window.setTimeout("changeText()", 3500); }  // change the # on the left to adjust the speed of the
                                               // scroll. The smaller the # the faster the speed
*/

var quote_count = 6;
var this_quote = 1;


function changeText()
{

	if (this_quote > 0)
	{
		// if there is a prev quote set
		// hide it
		var prev_quote = 0;
		if( this_quote == 1 )
		{
			prev_quote = quote_count;
		}
		else
		{
			prev_quote = this_quote - 1;
		}


		toggleElementVisibility("quote_"+prev_quote);


		toggleElementVisibility("quote_"+this_quote);


		this_quote++;
	}

	if (this_quote > quote_count)
	{
		this_quote = 1;
	}

	window.setTimeout("changeText()", 5000);
	// change the # on the left to adjust the speed of the
	 // scroll. The smaller the # the faster the speed

}


function toggleElementVisibility(element)
{



	if (document.getElementById)
	{
	// this is the way the standards work
	   if(document.getElementById(element).style.display == 'none')
	   {
		document.getElementById(element).style.display = 'block';
	   }else{
		document.getElementById(element).style.display = 'none';
	   }
	}
	else if (document.all)
	{
	// this is the way old msie versions work
	   if(document.all[element].style.display=='none')
	   {
		document.all[element].style.display='block';
	   }else{
		document.all[element].style.display='none';
	   }
	}
	else if (document.layers)
	{
	// this is the way nn4 works
	   if(document.all[element].style.display=='none')
	   {
		document.all[element].style.display='block';
	   } else {
		document.all[element].style.display='none';
	   }
	}
}

// Multiple onload function
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}



addLoadEvent(function() {
  changeText();
});

toggleElementVisibility( "quote_" + quote_count );


