function initArray() {
 this.length = initArray.arguments.length;
 for (i=0;i<this.length;i++)
  this[i] = initArray.arguments[i];
}
var msg = new initArray("Denver's News & Flight Info",
                        "Computer Training & Development",
				"Web Development & Hosting",
				"Plus much more!!!");

var start_automatically = false;
var marq_repeat = true;
var marq_length = 48;
var type_speed = 75;
var intermsg_delay = 2000;
var marq_default = "Click on the button for more info!!";

function toggle(par) {
 document.marq_form.marq.blur();
 if ((par != null) || (start_automatically)) {
  marq_status = !marq_status;
  if (verify()) {
   cur_msg = 0;
   cur_char = 0;
   type();
  }
 }
}
function verify() {
 var valid = true;
 for (j=0;j<msg.length;j++) {
  if (msg[j].length > marq_length) {
   alert("Message "+(j+1)+" is too long! "
    + "You must fix it for the script to run. "
    + "Either shorten the message or increase "
    + "marq_length so it fits.");
   valid = false;
  }
 }
 return valid;
}
function type() {
 if (cur_char >= msg[cur_msg].length) {
  cur_char = 0;
  cur_msg++;
 }
 if (cur_char == 0)
  document.marq_form.marq.value = "";
 if ((cur_msg >= msg.length) && (marq_repeat))
  cur_msg = 0;
 if ((cur_msg<msg.length) && (marq_status)) {
  document.marq_form.marq.value += msg[cur_msg].charAt(cur_char);
  cur_char++;
  if (cur_char >= msg[cur_msg].length)
   setTimeout("type()",intermsg_delay);
  else
   setTimeout("type()",type_speed);
 } else {
  document.marq_form.marq.value = marq_default;
  marq_status = false;
 }
}
var marq_status = false;
var cur_msg = 0;
var cur_char = 0;
