function domticker(content, divId, divClass, delay, fadeornot){
this.content=content
this.tickerid=divId //ID of master ticker div. Message is contained inside first child of ticker div
this.delay=delay //Delay between msg change, in miliseconds.
this.mouseoverBol=0 //Boolean to indicate whether mouse is currently over ticker (and pause it if it is)
this.pointer=1
this.opacitystring=(typeof fadeornot!="undefined")? "width: 100%; filter:progid:DXImageTransform.Microsoft.alpha(opacity=100); -moz-opacity: 1" : ""
if (this.opacitystring!="") this.delay+=500 //add 1/2 sec to account for fade effect, if enabled
this.opacitysetting=0.2 //Opacity value when reset. Internal use.
document.write('<div id="'+divId+'" class="'+divClass+'"><div style="'+this.opacitystring+'">'+content[0]+'</div></div>')
var instanceOfTicker=this
setTimeout(function(){instanceOfTicker.initialize()}, delay)
}

domticker.prototype.initialize=function(){
var instanceOfTicker=this
this.contentdiv=document.getElementById(this.tickerid).firstChild //div of inner content that holds the messages
document.getElementById(this.tickerid).onmouseover=function(){instanceOfTicker.mouseoverBol=1}
document.getElementById(this.tickerid).onmouseout=function(){instanceOfTicker.mouseoverBol=0}
this.rotatemsg()
}

domticker.prototype.rotatemsg=function(){
var instanceOfTicker=this
if (this.mouseoverBol==1) //if mouse is currently over ticker, do nothing (pause it)
setTimeout(function(){instanceOfTicker.rotatemsg()}, 100)
else{
this.fadetransition("reset") //FADE EFFECT- RESET OPACITY
this.contentdiv.innerHTML=this.content[this.pointer]
this.fadetimer1=setInterval(function(){instanceOfTicker.fadetransition('up', 'fadetimer1')}, 100) //FADE EFFECT- PLAY IT
this.pointer=(this.pointer<this.content.length-1)? this.pointer+1 : 0
setTimeout(function(){instanceOfTicker.rotatemsg()}, this.delay) //update container
}
}

domticker.prototype.fadetransition=function(fadetype, timerid){
var contentdiv=this.contentdiv
if (fadetype=="reset")
this.opacitysetting=0.2
if (contentdiv.filters && contentdiv.filters[0]){
if (typeof contentdiv.filters[0].opacity=="number") //IE6+
contentdiv.filters[0].opacity=this.opacitysetting*100
else //IE 5.5
contentdiv.style.filter="alpha(opacity="+this.opacitysetting*100+")"
}
else if (typeof contentdiv.style.MozOpacity!="undefined" && this.opacitystring!=""){
contentdiv.style.MozOpacity=this.opacitysetting
}
else
this.opacitysetting=1
if (fadetype=="up")
this.opacitysetting+=0.2
if (fadetype=="up" && this.opacitysetting>=1)
clearInterval(this[timerid])
}

ns6switch=1

var ns6=document.getElementById&&!document.all
mes=new Array();
mes[0]=-1;
mes[1]=-4;
mes[2]=-7;mes[3]=-10;
mes[4]=-7;
mes[5]=-4;
mes[6]=-1;
num1=0;
num2=0;
txt="";
function jump0(message){
if (ns6&&!ns6switch){
jump.innerHTML=message
return
}
for(i=0; i != message.length;i++){
txt=txt+"<span style='position:relative;' id='n"+i+"'>"+message.charAt(i)+"</span>"};
jump.innerHTML=txt;
txt="";
jump1a(message)
}

function jump1a(message){
nfinal=(document.getElementById)? document.getElementById("n0") : document.all.n0
nfinal.style.left=-num2;
if(num2 != 9){
num2=num2+3;
message=message.replace(/'/g,"\\'");
setTimeout("jump1a('" + message + "')",100)
}
else{
jump1b(message)
}
}

function jump1b(message){
nfinal.style.left=-num2;
if(num2 != 0){num2=num2-3;
message=message.replace(/'/g,"\\'");
setTimeout("jump1b('" + message + "')",100)
}
else{
jump2(message)
}
}

function jump2(message){
txt="";
for(i=0;i != message.length;i++){
if(i+num1 > -1 && i+num1 < 7){
txt=txt+"<span style='position:relative;top:"+mes[i+num1]+"'>"+message.charAt(i)+"</span>"
}
else{txt=txt+"<span>"+message.charAt(i)+"</span>"}
}
jump.innerHTML=txt;
txt="";
if(num1 != (-message.length)){
num1--;
message=message.replace(/'/g,"\\'");
setTimeout("jump2('" + message + "')",100)}
else{
num1=0;
}
}

function vague(message){
if (document.all||document.getElementById){
jump=(document.getElementById)? document.getElementById("titreenondes") : document.all.titreenondes
jump0(message)
}
else
{
document.write(message)
}
}

function listenlive(){
myRef = window.open('ecouteendirect.php','ecouteendirect',
'left=100,top=100,width=400,height=280,toolbar=0,resizable=0');
myRef.focus()
}

function opencontacts(){
myRef = window.open('contacts.php','Contacts',
'left=100,top=100,width=450,height=280,toolbar=0,resizable=0,scrollbars=1');
myRef.focus()
}

function openpicture(photo,album,width,height){
var chemin="pages/photos/voir.php?album="+album+"&photo="+photo;
var props="left=100,top=100,width="+width+",height="+height+",toolbar=0,resizable=0";

myRef = window.open(chemin, 'photo', props);
myRef.resizeTo(width,height);
myRef.focus();
}

function showhideemission(id) {
       var e = document.getElementById(id);
       if(e.style.display == 'block')
          e.style.display = 'none';
       else
          e.style.display = 'block';
    }
	
function showpagesdivers() {
       var e = document.getElementById("menudivers");
       if(e.style.display == 'block')
          e.style.display = 'none';
       else
          e.style.display = 'block';
    }
	
function redirdivers(){
	var page = document.getElementById("pagesdiverses").value;
	if (page!=0)
	{
	document.location.href="index.php?page=divers&id="+page;
	}
	}
	
var tickspeed=4000 //ticker speed in miliseconds (2000=2 seconds)
var enablesubject=1 //enable scroller subject? Set to 0 to hide

if (document.getElementById){
document.write('<style type="text/css">\n')
document.write('.dropcontent{display:none;}\n')
document.write('</style>\n')
}

var selectedDiv=0
var totalDivs=0

function contractall(){
var inc=0
while (document.getElementById("dropmsg"+inc)){
document.getElementById("dropmsg"+inc).style.display="none"
inc++
}
}

function pauseconcours(){
clearTimeout(the_timeout);
}

function resumeconcours(){
	the_timeout=setTimeout("expandone()",tickspeed)
}

function expandone(){
var selectedDivObj=document.getElementById("dropmsg"+selectedDiv)
contractall()
document.getElementById("titreconcoursaccueil").innerHTML=selectedDivObj.getAttribute("subject")
selectedDivObj.style.display="block"
selectedDiv=(selectedDiv<totalDivs-1)? selectedDiv+1 : 0
the_timeout=setTimeout("expandone()",tickspeed)
}

function startscroller(){
while (document.getElementById("dropmsg"+totalDivs)!=null)
totalDivs++
expandone()
if (!enablesubject)
document.getElementById("titreconcoursaccueil").style.display="none"
}

if (window.addEventListener)
window.addEventListener("load", startscroller, false)
else if (window.attachEvent)
window.attachEvent("onload", startscroller)

function opencroisiere(){
myRef = window.open('croisiere.php','croisiere',
'left=100,top=100,width=500,height=610,toolbar=no,resizable=no,scrollbars=no');
myRef.focus()
}