
/*
This source code is released to the public domain with the provision that
the copyright information remains in the source code.
Copyright (c) by: Robert N Bovara All Rights Reserved.
*/
var outMsg = "I'm not tweeting for 140secs of #Twilence. Thinking #Copenhagen. The calm before #TheWave ~ http://bit.ly/twilence ";
var i = 0;
var lineNo = 1;
var timerDM=null;
var msg = " ";
function araVob() {
}
var ScreenLine = new araVob();
ScreenLine[1]  = "Shhhhh... ";
/*
To change or add messages, just replace values of or add to ScreenLine[n]
above.   Each ScreenLine[n] is a separate line.  To change the "page" before
the defined page length is reached, insert a \f character at the end of the
line where you want the break.    Use \" for quotes and \t for tabs in the
message text.
*/
var msgNum = 1;          // set to first message to display
var msgCnt = 1;         // set to number of last message "page" to display.
var typeSpeed = 200;      // the typing rate, in milliseconds. (Higher number is slower)
var pageLen = 1;         // set to page size, usually number of ROWS in TEXTAREA
var delay=typeSpeed;
var r = 0;
var cr="\r\n"
if ("3" <=navigator.appVersion.charAt(0)) {
 var cr="\n"
}
for (x = 1; x<=(msgCnt); x++) {
  ScreenLine[x] = ScreenLine[x];
}
msg = ScreenLine[1];

function DisplayMsg() {
  if (msg.length <= i || msg.charAt(i) == "\f") {
    r=i;
    i=0;
    ChangeMsg();
  }
outMsg = outMsg + msg.charAt(i);
  i++;
document.getElementById('charcounter').innerHTML=140-(i+114);

  if (msg.charAt(i) == "\f" || (lineNo == pageLen && i==msg.length)) {
return; 
   }
  else {
  if (msg.charAt(i) == cr && msg != " "+cr) {
return; 
    }
  else {
    delay = typeSpeed; }
  }

delay=typeSpeed;
//if (i == 44){delay=800;}
//if (i == 66){delay=450;}
//if (i == 93){delay=600;}
//if (i > 93  && i < 102){delay=100;}
//if (i == 102){delay=600;}
  self.document.forms[0].status.value=outMsg;
  timerDM = setTimeout("DisplayMsg()",delay);
}

function ChangeMsg() {
 msgNum++;
 if (msgCnt < msgNum) {
   msgNum = 1;
 }
 lineNo++;
 if (pageLen < lineNo || msg.charAt(r) == "") {
  outMsg=ScreenLine[msgNum].charAt(i);
  i++;
  lineNo = 1;
 }
  msg = ScreenLine[msgNum];

}

function quitDisplay() {
//  self.document.forms[0].status.value = "Sshh! I'm not tweeting for 140secs - my #Twilence is for a #Copenhagen deal. It's the calm before #TheWave march: http://bit.ly/twilence";
return;
}

