//#####################################################################################
//# © Copyright 2006 Netfactors Internet (www.netfactors.co.uk). All rights reserved. #
//#                                                                                   #
//# The scripts in this file were written by Netfactors Internet for the sole purpose #
//# of being used in its clients' websites. This file, or any of the routines within  #
//# it, may be used and modified free of charge by anyone so long as this copyright   #
//# notice accompanies the file or any such routines and is kept intact. By using     #
//# this file and the routines within it, you agree to indemnify Netfactors Internet  #
//# from liability from any losses, whether direct or indirect, that might arise from #
//# their use. The resale and redistribution of this code without prior written       #
//# consent is expressly forbidden. For such consent, please contact Netfactors       #
//# Internet at info@netfactors.co.uk. This copyright and header must be kept intact  #
//# in all cases.                                                                     #
//#####################################################################################

var fullBannerText = new Array('<em><b>Software Companies:<\/b><br>Do you lack the resources<br>to create and run training<br>courses for your software?#<br>Find out how Hotkeys can<br>be your <a href="\/virtual-training-department.htm" title="Virtual Training Department">Virtual Training<br>Department<\/a>.<\/em>');
var currentBannerText = '';
var numBannerText = 0;

function startBannerText(numText) {
	numBannerText = numText;
	displayBannerText(fullBannerText[numBannerText]);
	var timeDelay = 2500 + Math.round(Math.random() * 2500);
	setTimeout('incrementBannerText()',timeDelay);
}

function incrementBannerText() {
	if (currentBannerText.length < fullBannerText[numBannerText].length) {
		currentBannerText += fullBannerText[numBannerText].substr(currentBannerText.length,1);
		while (currentBannerText.substr(currentBannerText.length - 1,1) == '<') {
			while ((currentBannerText.substr(currentBannerText.length - 1,1) != '>') && (currentBannerText.length < fullBannerText[numBannerText].length)) {
				currentBannerText += fullBannerText[numBannerText].substr(currentBannerText.length,1);
			}
			currentBannerText += fullBannerText[numBannerText].substr(currentBannerText.length,1);
		}
		displayBannerText(currentBannerText);
		if (currentBannerText.length < fullBannerText[numBannerText].length) {
			if (fullBannerText[numBannerText].substr(currentBannerText.length,1) == '#') {
				setTimeout('incrementBannerText()',1500);
			} else {
				setTimeout('incrementBannerText()',25);
			}
		}
	}
}

function displayBannerText(bannerText) {
	var tempBannerText = bannerText;
	tempBannerText = tempBannerText.replace('#','');
	if (tempBannerText.indexOf('<a') != -1) {
		tempBannerText += '<\/a>'
	}
	if (tempBannerText.indexOf('<b>') != -1) {
		tempBannerText += '<\/b>'
	}
	if (tempBannerText.indexOf('<em>') != -1) {
		tempBannerText += '<\/em>'
	}
	document.getElementById('bannertext').innerHTML = tempBannerText;
}