

//Typing Text (DHTML) v1 (Sunday, April 15th, 2001)
//Programmed by: Haitham M. Al-Beik
//Email: albeik26@hotmail.com
//Visit http://javascriptkit.com for this script

var newsText = new Array();
//Added blank text to array 0 as this shows once then does NOT repeat on loop
newsText[0] = "";
newsText[1] = "June 2010: CabSite complete major contracts with the MOD at RAF St.Athan, South Wales and Gibralter Barracks, Surrey";
newsText[2] = "June 2010: Completed installation of new office facilities for the Heli Center (helicopter training facility) at Leicester Airport";
newsText[3] = "February 2010: CabSite win another contract for installation of living accomodation for the MOD...";
newsText[4] = "January 2010: CabSite Ltd. employ two new welder/fabricators and an additional Install Team member with over 20 years experience";
newsText[5] = "December 2009: CabSite's in-house electrician qualifies to 17th Edition Electrical Installation & Testing";
newsText[6] = "4th November 2009: CabSite Ltd. complete dismantling and loading of 9 on 9 double storey complex for Taylor Woodrow at Canary Wharf. The client commented on sign off sheet 'Works carried out to a high standard with no problems.' - Alan Sirrel, Logistics Manager - Taylor Woodrow";
newsText[7] = "October 2009: CabSite Ltd. awarded new contract for MOD installation works....";
newsText[8] = "October 2009: Two more operatives successfully complete IPAF and CPCS training...";
newsText[9] = "CabSite Ltd.: Specialists in siting, linking, relocation, refurbishment and alteration of all portable and modular buildings"

var ttloop = 1;    // Repeat forever? (1 = True; 0 = False)
var tspeed = 100;   // Typing speed in milliseconds (larger number = slower)
var tdelay = 1500; // Time delay between newsTexts in milliseconds

// ------------- NO EDITING AFTER THIS LINE ------------- \\
var dwAText, cnews=0, eline=0, cchar=0, mxText;

function doNews() {
  mxText = newsText.length - 1;
  dwAText = newsText[cnews];
  setTimeout("addChar()",1000)
}
function addNews() {
  cnews += 1;
  if (cnews <= mxText) {
    dwAText = newsText[cnews];
    if (dwAText.length != 0) {
      document.news.news2.value = "";
      eline = 0;
      setTimeout("addChar()",tspeed)
    }
  }
}
function addChar() {
  if (eline!=1) {
    if (cchar != dwAText.length) {
      nmttxt = ""; for (var k=0; k<=cchar;k++) nmttxt += dwAText.charAt(k);
      document.news.news2.value = nmttxt;
      cchar += 1;
      if (cchar != dwAText.length) document.news.news2.value += "_";
    } else {
      cchar = 0;
      eline = 1;
    }
    if (mxText==cnews && eline!=0 && ttloop!=0) {
      cnews = 0; setTimeout("addNews()",tdelay);
    } else setTimeout("addChar()",tspeed);
  } else {
    setTimeout("addNews()",tdelay)
  }
}


