/* 
-------------------------------------------------------------------------------------------
	Copyright (c) Intersel 2007 - Tous droits réservés 
-------------------------------------------------------------------------------------------
   	INTERSEL - SARL au capital de 12.000 € - RCS PARIS 488 379 660 - NAF 721Z 
	4 Cité d'Hauteville
	75010 PARIS  
-------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------
File : script_news.js
Abstract : Mini classe de News

Fonctions définies :
Author : Michael Petit
Modifications :
 - 03/03/08 Michael Petit -

//--------------------------------------------------------------------
// Class name : News
// Description : Permet la gestion d'un affichage successif de 2 phrases type
// Param txt1 : String comportant la 1er phrase à afficher
// Param txt2 : String comportant la 2eme phrase à afficher
// Param txtinit : String texte à afficher avant la news
// Param lettre : Int représentant la limite d'affichage d'un phrase à un instant donné (ce paramètre varie seul)
// Param phrase : Int représentant la phrase étant affichée
// Methode affichage : fonction gérant les affichages successifs des 2 phrases
//--------------------------------------------------------------------
*/
var News = {
	txt1 : "Charter Sales Department: +33 1 49 909 909",
	txt2 : "Flight Operations Control Center - 24/7 - Tel: +33.1.49.90.99.59 - Email: ops@flyblueline.com",
	txtInit : '',
	temps_entre_caractere : 50,
	temps_entre_phrase : 4000,
	lettre : 0,
	phrase : 1,
	
	affichage: function () {
		if (this.phrase === 1) {
			if (this.lettre++ < this.txt1.length) {
				document.getElementById ("News").innerHTML = this.txtInit+this.txt1.substring(0, this.lettre);
				setTimeout ("News.affichage()", this.temps_entre_caractere);
			}
			else {
				this.lettre = 0;
				this.phrase = 2;
				setTimeout ("News.affichage()", this.temps_entre_phrase);
			}
		} else {
			if (this.lettre++ < this.txt2.length) {
				document.getElementById ("News").innerHTML = this.txtInit+this.txt2.substring(0, this.lettre);
				setTimeout ("News.affichage()", this.temps_entre_caractere);
			}
			else {
				this.lettre = 0;
				this.phrase = 1;
				setTimeout ("News.affichage()", this.temps_entre_phrase);
			}
		}		
	}
}
