function GnooNews(name,x,y,w,h,speed,css,bgcolor,link,vis,menu,bgimg)
 {
/* proprietes */	 
	this.alphabet = new Array(" ","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z");	
	this.name = new String(name);
	this.css = new String(css);
	this.link = new String(link);
	this.strToWrite = new String("");
	this.str = new String(""); 
	this.src = new String("");         
	this.width = new Number(w);
	this.height = new Number(h);
	this.top = new Number(x);
	this.left = new Number(y);     
	this.speed = new Number(speed);
	this.count = new Number(0);
	this.pos = new Number(0);
	this.div = null;
        this.divBg = null;
	this.menu = menu;
	this.divName = null;
/* methodes */	
	this.Show = ShowNews;
	this.run = TextWriter;
	this.init = BuildNews;
	this.update = UpdateNews;
	
	if(document.layers)		/* Netscape */
	 {
		this.vis = (vis==true) ? "show" : "hide" ;
		this.tag = '<LAYER ID="Zone'+this.name+'" position=absolute top='+this.top+' left='+this.left+' width='+this.width+' height='+this.height+' z-index=9 visibility='+this.vis+'></LAYER>';
		self.onresize = new Function("","self.history.go(0);");
	 }
	else				   /* DOM & Internet Explorer */
	 {
	 	this.vis = (vis==true) ? "visible" : "hidden" ;
		this.tag = '<DIV ID="Zone'+this.name+'" STYLE="position: absolute; top: '+this.top+'px; left: '+this.left+'px; width: '+this.width+'px; height: '+this.height+'px; z-index: 9; visibility:'+this.vis+';"><TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 ID=infoTable><TR><TD class="'+this.css+'"></TD></TR></TABLE></DIV>';
                if(!document.all)
                        this.tag += '<DIV ID="Zone'+this.name+'Bg" STYLE="position: absolute; top: '+this.top+'px; left: '+this.left+'px; width: '+this.width+'px; height: '+this.height+'px; z-index: 8; visibility:'+this.vis+';"></DIV>';                        
	 }
	return this;
 }	

/******************************************
*		METHODES
******************************************/
function ShowNews()
 {
	if(document.layers)
		this.div.visibility = "show";
	else
        {                
		this.div.style.visibility = "visible"; 
                if(!document.all)
                        this.divBg.style.visibility = "visible"; 
        }
 }

/* ecriture du calque pour l'initialiser */
function BuildNews()
 {
	with(document)
	 {
		open("text/html");
		write(this.tag);
		close();
	 }
	if(document.layers)				  /* Netscape */
		this.div = eval("document.layers['Zone"+this.name+"']");
	if(document.all)			  /* Internet Explorer */
		this.div = eval("document.all['Zone"+this.name+"']");
	if(document.getElementById)  /* DOM */
        {
		this.div = eval("document.getElementById('Zone"+this.name+"')");
                this.divBg = eval("document.getElementById('Zone"+this.name+"Bg')");
        }                
	this.divName = "Zone"+this.name;
	return true;
 }	

/* operation sur le dernier charactere */ 
function TextWriter(str,pos,count,link)
 {
        var tmpC = new String("");
	this.str = unescape(str);	
	this.count = count;
	this.pos = pos;
	this.strToWrite = this.str.substring(0,this.pos);
        this.charToTest = this.str.charAt(this.pos);
        this.charFromList = this.alphabet[this.count];
        this.charTested = checkChar(this.charToTest);        

        if(pos==0 && count==0)
                this.src = this.str;
        
        if(this.charTested != this.charToTest)
        {
		this.str = this.strToWrite+this.charTested+this.str.substring(this.pos+1,this.str.length);
		this.pos+=this.charTested.length;
		this.count=0;
                this.update(this.strToWrite+this.charFromList,this.charFromList);
                setTimeout(this.name+".run('"+escape(this.str)+"',"+this.pos+","+this.count+")", this.speed);
                return;
        }
	this.update(this.strToWrite+this.charFromList);	
	if( this.charFromList == this.charToTest.toLowerCase() || this.count == (this.alphabet.length-1))
	 {
		this.pos++;
		this.count=0;
                tmpC = this.strToWrite+this.charFromList;
                if(!document.all && !document.layers)
                        setTimeout(this.name+'.divBg.innerHTML = "<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0><TR><TD class="+'+this.name+'.css+">'+tmpC+'</TD></TR></TABLE>"',50);
	 }
	else
		this.count++;
	if(this.pos<this.str.length)
		setTimeout(this.name+".run('"+escape(this.str)+"',"+this.pos+","+this.count+")", this.speed);
	else
        {
		this.update(unescape(this.str));	
                if(!document.all && !document.layers)
                        this.divBg.innerHTML = "";
		setTimeout(this.name+".run('"+escape(this.src)+"',0,0)", 3000);
        }
	return;
 }
 
function checkChar(c)
{
        var nc = c;
        var bc = new Array( "é","'","<",">","\n");
        var gc = new Array("&eacute;","&#39;","&lt;","&gt;","<BR>");
        for(var i=0;i<bc.length;i++)
                if(nc == bc[i])
                        return gc[i];
        return nc;
} 

/* reecriture du calque */ 
function UpdateNews(txt,preformat)
 {
 	var start = "<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 ID=infoTable><TR><TD class='"+this.css+"'>"
	var end	= "</TD></TR></TABLE>";
	if(document.layers)
		with(this.div)
		 {
		 	document.open("text/html");
			document.write(start+txt+end);
			document.close();
		 }
	else	         
        {
                if(document.all && navigator.userAgent.indexOf("Mac")>=0)
                 {
                         start = "<TBODY>"+start;
                         end = end+"</TBODY>";
                 }   
                if(document.all)
                        this.div.innerHTML = start+txt+end;        
                else
                        document.getElementById("infoTable").rows[0].cells[0].innerHTML = txt;
        }
 } 
 
/************/
function getObjProp(obj)
{
       var str = new String("");
       for (prop in obj)
               if(typeof(obj[prop]) == "function")
                       str +=  prop + " = " + obj[prop] + "\n";
        return str;
} 
 
