/* TICKER DE NEWS CLIQUABLE AVEC URL */

current=1;

/*Augmente la vitesse et le pas sous MAC*/
if (navigator.appVersion.indexOf('Mac') != -1) tickerspeed/=2;

memtickermove=tickermove;

/*Initialisation*/
function initticker(){
	objlay=objacces(1);
	objlay.left=tickerwidth;
	moveleft(current);
}

/*Accède au style du layer*/
function objacces(lay){
	objlay = eval ("(document.all)?document.all.laytick"+lay+".style:(document.layers)?document.laymain.document.laytick"+lay+":document.getElementById(\"laytick"+lay+"\").style");
	return objlay;
}

/*renvoie la largeur du layer*/
function objwidth(lay){
	widthlay = eval ("(document.layers) ? document.laymain.document.laytick"+lay+".document.width: (document.all)?document.all.laytick"+lay+".offsetWidth:document.getElementById(\"laytick"+lay+"\").offsetWidth;");
	return widthlay;
}

/*Déplace vers la gauche*/
function moveleft(lay){
	objlay=objacces(lay);
	objlay.left= parseInt(objlay.left)-tickermove;
	if (parseInt(objlay.left)>-objwidth(lay)) setTimeout('moveleft('+lay+')',tickerspeed);
	else {
		objlay=objacces(current);
		objlay.left=tickerwidth;
		setTimeout('moveleft('+current+')',tickerspeed);	
	}
}

/*Arrète le défilement*/
function stopit(){ if (tickerstop)	tickermove=0;}

/*Reprend le défilement*/
function letgo(){if ( tickerstop) tickermove=memtickermove;}

/*Ecrit les layers et les feuilles de style*/
function createlay(){
	laytowrite="";
	laytowrite+="<STYLE TYPE=\"text/css\">\n";
	//laytowrite+=".txtticker{font-size:10px;font-family:Arial;color:"+tickertxtcolor+";text-decoration:none;}";
	laytowrite+="#laymain {position:absolute; left:"+tickerposleft+"; top:"+tickerpostop+"; height:14px;z-index:0;clip:rect(0,"+(tickerwidth)+",14,0);overflow:hidden;visibility:visible;}\n";
	laytowrite+="#laytick1 {POSITION:absolute;TOP:-3px;LEFT:"+tickerwidth+"px;z-index:1;}\n";	
	laytowrite+="</STYLE>\n";
	laytowrite+="<DIV ID=\"laymain\"><DIV ID=\"laytick1\"><NOBR>";
	for(i=0; i<Tcontent.length; i++){
		if (Tcontent[i+1]!="")
		laytowrite+="<A HREF=\""+Tcontent[i+1]+"\" CLASS=\"txtticker2\" ONMOUSEOVER=\"stopit()\" ONMOUSEOUT=\"letgo()\" TARGET=\""+tickertarget+"\">"+Tcontent[i]+"</A>&nbsp;&nbsp;&nbsp;&nbsp;";
		else
		laytowrite+="<A HREF=\"#\" CLASS=\"txtticker2\" ONMOUSEOVER=\"stopit()\" ONMOUSEOUT=\"letgo()\" >"+Tcontent[i]+"</A><IMG SRC=vide.gif WIDTH=20 HEIGHT=1 BORDER=0>";
		i++;
	}
	laytowrite+="</NOBR></DIV><TABLE WIDTH=\""+tickerwidth+"\" CELLSPACING=\"0\" CELLPADDING=\"0\" BORDER=\"0\" HEIGHT=\"14\"><TR><TD BGCOLOR=\""+tickerbgcolor+"\" CLASS=\"txtticker\" HEIGHT=\"14\"><IMG SRC=\"vide.gif\" WIDTH=\"1\" HEIGHT=\"14\" BORDER=\"0\"></TD></TR></TABLE></DIV>";
	//alert(laytowrite);
	document.write(laytowrite);
	setTimeout('initticker()',1500);
}

// fixe un bug netscape
	if (document.layers)
   window.onresize =
     function (e) { history.go(0); };

