/*
   $Revision: 1.7 $
   http://javascript.about.com/library/bltick2.htm
   Christian n'aime pas ce code... :)
*/

var Ticker			= new Object();

Ticker.tWidth		= '220px';                  // width (in pixels)
Ticker.tHeight		= '15px';                  // height (in pixels)
Ticker.tcolour		= '#D7D6D3';           // background colour:
Ticker.moStop		= false;                     // pause on mouseover (true or false)
Ticker.fontfamily	= 'arial,sans-serif';   // font for content
Ticker.tSpeed		= 2;                        // scroll speed (1 = slow, 5 = fast)
Ticker.cps			= Ticker.tSpeed;
Ticker.aw			= null;
Ticker.mq			= null;
Ticker.content		= null;
Ticker.lefttime		= null;
Ticker.fsz			= parseInt(Ticker.tHeight) - 4;

Ticker.start = function() {

	Ticker.content = document.getElementById('ticker').innerHTML;

	var tick =
		'<div style="position:relative;width:' +
		Ticker.tWidth +
		';height:' +
		Ticker.tHeight +
		';overflow:hidden;background-color:' +
		Ticker.tcolour +
		'"';

	if (Ticker.moStop) {
		tick += ' onmouseover="Ticker.cps=0" onmouseout="Ticker.cps=Ticker.tSpeed"';
	}

	tick += '><div id="mq" style="position:absolute;left:0px;top:0px;font-family:' +
		Ticker.fontfamily +
		';font-size:' +
		Ticker.fsz +
		'px;white-space:nowrap;"><\/div><\/div>';

	document.getElementById('ticker').innerHTML = tick;

	Ticker.mq = document.getElementById("mq");
	Ticker.mq.style.left = (parseInt(Ticker.tWidth)+10) + "px";
	Ticker.mq.innerHTML = 
		'<span id="tx">' +
		Ticker.content +
		'<\/span>';

	Ticker.aw = document.getElementById("tx").offsetWidth;

	Ticker.lefttime = window.setInterval(Ticker.scroll, 50);

};

Ticker.scroll = function() {

    Ticker.mq.style.left = (parseInt(Ticker.mq.style.left) > (-10 - Ticker.aw))
		? parseInt(Ticker.mq.style.left) - Ticker.cps + "px"
		: parseInt(Ticker.tWidth) + 10 + "px";

};

jQuery(document).ready(function(){
	if (document.getElementById('ticker')) {
		Ticker.start();
	}
});







































/*
var tWidth='309px';                  // width (in pixels)
var tHeight='15px';                  // height (in pixels)
var tcolour='transparent';           // background colour:
var moStop=true;                     // pause on mouseover (true or false)
var fontfamily = 'arial,sans-serif'; // font for content
var tSpeed= 2;                       // scroll speed (1 = slow, 5 = fast)

// enter your ticker content here (use \/ and \' in place of / and ' respectively)
// var content='allo toi'; // fonctionne
var content = document.getElementById('ticker').innerHTML;

// Simple Marquee / Ticker Script
// copyright 3rd January 2006, Stephen Chapman
// permission to use this Javascript on your web page is granted
// provided that all of the below code in this script (including this
// comment) is used without any alteration

var cps=tSpeed;
var aw, mq;
var fsz = parseInt(tHeight) - 4;

    if (document.getElementById) {
        var tick = '<div style="position:relative;width:'+tWidth+';height:'+tHeight+';overflow:hidden;background-color:'+tcolour+'"';
        if (moStop) tick += ' "'; tick +='><div id="mq" style="position:absolute;left:0px;top:0px;font-family:'+fontfamily+';font-size:'+fsz+'px;white-space:nowrap;"><\/div><\/div>'; document.getElementById('ticker').innerHTML = tick; mq = document.getElementById("mq"); mq.style.left=(parseInt(tWidth)+10)+"px"; mq.innerHTML='<span id="tx">'+ content +'<\/span>'; aw = document.getElementById("tx").offsetWidth; lefttime=setInterval("scrollticker()",50);
        //if (moStop) tick += ' onmouseover="cps=0" onmouseout="cps=tSpeed"'; tick +='><div id="mq" style="position:absolute;left:0px;top:0px;font-family:'+fontfamily+';font-size:'+fsz+'px;white-space:nowrap;"><\/div><\/div>'; document.getElementById('ticker').innerHTML = tick; mq = document.getElementById("mq"); mq.style.left=(parseInt(tWidth)+10)+"px"; mq.innerHTML='<span id="tx">'+ content +'<\/span>'; aw = document.getElementById("tx").offsetWidth; lefttime=setInterval("scrollticker()",50);
    }



function startticker() {
    if (document.getElementById) {
        var tick = '<div style="position:relative;width:'+tWidth+';height:'+tHeight+';overflow:hidden;background-color:'+tcolour+'"';
        if (moStop) tick += ' "'; tick +='><div id="mq" style="position:absolute;left:0px;top:0px;font-family:'+fontfamily+';font-size:'+fsz+'px;white-space:nowrap;"><\/div><\/div>'; document.getElementById('ticker').innerHTML = tick; mq = document.getElementById("mq"); mq.style.left=(parseInt(tWidth)+10)+"px"; mq.innerHTML='<span id="tx">'+ content +'<\/span>'; aw = document.getElementById("tx").offsetWidth; lefttime=setInterval("scrollticker()",50);
        //if (moStop) tick += ' onmouseover="cps=0" onmouseout="cps=tSpeed"'; tick +='><div id="mq" style="position:absolute;left:0px;top:0px;font-family:'+fontfamily+';font-size:'+fsz+'px;white-space:nowrap;"><\/div><\/div>'; document.getElementById('ticker').innerHTML = tick; mq = document.getElementById("mq"); mq.style.left=(parseInt(tWidth)+10)+"px"; mq.innerHTML='<span id="tx">'+ content +'<\/span>'; aw = document.getElementById("tx").offsetWidth; lefttime=setInterval("scrollticker()",50);
    }
}

function scrollticker(){
    mq.style.left = (parseInt(mq.style.left)>(-10 - aw)) ?parseInt(mq.style.left)-cps+"px" : parseInt(tWidth)+10+"px";
}

window.onload=startticker;

*/



// vim:nowrap:
