/*
(c) 2007-2008 Jean Luc Biellmann
*/

function banner () {
	me = this;
	this.speed = 60 // vitesse d'exécution (plus le nbre est petit, plus c'est rapide !)
	this.pause = 1000 // pause entre les différents messages
	this.timerID = null
	this.bannerRunning = false
	this.ar = new Array(10)
	this.ar[0] = "GroupeRessources.com"
	this.ar[1] = "La clé de vos succès"
	this.ar[2] = "Consultance et développement"
	this.ar[3] = "Pour votre..."
	this.ar[4] = "Stratégie"
	this.ar[5] = "Organisation"
	this.ar[6] = "Développement commercial"
	this.ar[7] = "Ressources Humaines..."
	this.ar[8] = "N'attendez plus !"
	this.ar[9] = "Entrez dans le triangle Européen des Affaires !"
	this.currentMessage = 0
	this.offset = 0
}
banner.prototype = {
	stopBanner : function () {
		if (me.bannerRunning)
			clearTimeout(me.timerID)
		me.bannerRunning = false
	},
	startBanner : function () {
		me.stopBanner()
		me.showBanner()
	},
	showBanner : function () {
		var text = me.ar[me.currentMessage]
		if (me.offset < text.length) {
			if (text.charAt(me.offset) == " ")
				me.offset++ 
			var partialMessage = text.substring(0, me.offset + 1) 
			window.status = partialMessage
			me.offset++
			me.timerID = setTimeout("me.showBanner()", me.speed)
			me.bannerRunning = true
		} else {
			me.offset = 0
			me.currentMessage++
			if (me.currentMessage == me.ar.length)
				me.currentMessage = 0
			me.timerID = setTimeout("me.showBanner()", me.pause)
			me.bannerRunning = true
		}
	}
}

var gr_banner = new banner();
gr_banner.startBanner();
