var count=0;
var ns6=document.getElementById&&!document.all
var ie4=document.all&&navigator.userAgent.indexOf("Opera")==-1

if (ie4||ns6){

document.write('<table border="0" width="100%" cellspacing="0" cellpadding="2"><form name="news_bar"><tr><td align="center">');
document.write('<input type="button" value="3" onclick="moveit(0)" class="scrollerstyle" style="width:22px; height:22px; border-right-width:0px;" name="prev" title="Nouvelle pr&eacute;c&eacute;dente" onmouseover="mouseon=1; this.style.color=mouseover_color_content; this.style.background=mouseover_color" onmouseout="mouseon=0; this.style.color=mouseout_color_content; this.style.background=mouseout_color">');
document.write('<input type="button" name="news_bar_but" onclick="goURL();" style="color:#000000;background:#FFFFFF; width:'+barwidth+'; height:22px; border-width:1; border-color:#007C00;" onmouseover="mouseon=1; testURL()" onmouseout="mouseon=0; this.style.color=mouseout_color_content; this.style.background=mouseout_color">');
document.write('<input type="button" value="4" onclick="moveit(1)" class="scrollerstyle" style="width:22px; height:22px; border-left-width:0px;" name="next" title="Nouvelle suivante" onmouseover="mouseon=1; this.style.color=mouseover_color_content; this.style.background=mouseover_color" onmouseout="mouseon=0; this.style.color=mouseout_color_content; this.style.background=mouseout_color">');
document.write('</td></tr></form></table>');
}
else{
document.write('<form name="news_bar"><input type="button" value="Previous" onclick="moveit(0)">')
if (navigator.userAgent.indexOf("Opera")!=-1)
document.write('<input type="button" name="news_bar_but" onclick="goURL();" style="width:'+barwidth+'" border="0">')
else
document.write('<input type="button" name="news_bar_but" onclick="goURL();" width="'+barwidth+'" border="0">')
document.write('<input type="button" value="Next" onclick="moveit(1)"></form>')
}

function init_news_bar(){
  document.news_bar.news_bar_but.value=msgs[count];
  bgcolorfade();
}
//moveit function by Dynamicdrive.com
function moveit(how){
if (how==1){ //cycle foward
if (count<msgs.length-1)
count++
else
count=0
}
else{ //cycle backward
if (count==0)
count=msgs.length-1
else
count--
}
bgcolorfade();
document.news_bar.news_bar_but.value=msgs[count];
}

setInterval("if (mouseon==0){moveit(1)}",setdelay)

function goURL(){
 if (msg_url[count]!="")
 location.href=msg_url[count]
}

function testURL(){
 if (msg_url[count]!="") {
 	document.news_bar.news_bar_but.style.cursor="hand";
	document.news_bar.news_bar_but.style.color=mouseover_color_content;
	document.news_bar.news_bar_but.style.background=mouseover_color;
 }
// else{
// 	document.news_bar.news_bar_but.style.cursor="default";
//	document.news_bar.news_bar_but.style.color=mouseout_color_content;
//	document.news_bar.news_bar_but.style.background=mouseout_color;
// }
}

function bgcolorfade() {	         	
// 20 frames fading process
if (mouseon==0){
	if(frame>0) {	
	hex=hex+1 // increase or decrease color value depd on fadescheme
	document.news_bar.prev.style.backgroundColor="rgb(255,255,"+hex+")"; // Set color value.
	document.news_bar.news_bar_but.style.backgroundColor="rgb(255,255,"+hex+")"; // Set color value.
	document.news_bar.next.style.backgroundColor="rgb(255,255,"+hex+")"; // Set color value.
	frame--;
	setTimeout("bgcolorfade()",100);	
	}
	else{
	document.news_bar.prev.style.backgroundColor=endcolor;
	document.news_bar.news_bar_but.style.backgroundColor=endcolor;
	document.news_bar.next.style.backgroundColor=endcolor;
	frame=20;
	hex=222;
	}
}
else {
	mouseout_color="rgb(255,255,"+hex+")";
}
}

init_news_bar();

