<!--


var bIsMac = (navigator.appVersion.indexOf ("Macintosh")) != -1;
var TickerWidth=1300;
var TickerHeight=30;
var TickerBorder=3;

if (bIsMac && document.all) var StartTickerMoveDistance = 6;
else var StartTickerMoveDistance = 2;

var IsPlaying = false;
var tempIsPlaying = false;
var Start, Tide, Tide2;
var layContener="";
var layNews="";
var layTitleBar="";
var layBtnOpen = "";
var TickerMoveDistance=StartTickerMoveDistance;
var StartLayNewsWidth=10;
var TickerTexte='';

function initTicker() {
		win = new RastaMartWindow();
		layNews = new RastaMartLay(MM_findObj('LayNouvelle'));
		layContener = new RastaMartLay(MM_findObj('TickerContener'));
		
		if (document.all) layContener.css.overflow="hidden";
		TickerMoveDistance = StartTickerMoveDistance;
		layNews.setCont('<table height="19" border="0" cellspacing="0" cellpadding="0"><tr>' + TickerTexte + '</tr></table> ');
		IsPlaying = true;
		tempIsPlaying = true;
		startTicker(true);
		layContener.openIt();
}

function startTicker(FT) {
	if (FT) {
		layNews.setX(10);
		moveTicker();
	} else {
		if (TickerMoveDistance>0)
			layNews.setX(eval(layContener.getX()+"+"+layContener.getWidth()+"+"+10));
		else
			layNews.setX(eval(layContener.getX+"-"+(layNews.getWidth()+"+"+10)));
	}
}
function moveTicker() {
	if (IsPlaying && tempIsPlaying) {
		if (layNews.getX() >= eval(layContener.getX()+"-"+layNews.getWidth()+"-"+10) && layNews.getX() <= eval(layContener.getX()+"+"+layContener.getWidth()+"+"+10))
			layNews.setX(layNews.getX()-TickerMoveDistance);
		else			
			startTicker(false);
	}
	Tide2 = setTimeout("moveTicker()",100);
}
function tempStopTicker() {
	tempIsPlaying = false;
}
function tempPlayTicker() {
	tempIsPlaying = true;
} 


function getHtml(H, lien, titre, Cat, isCall) {
	var cont = '';
	
	if (isCall) cont += '<td height="24" valign="middle" class="call" nowrap>';
	else cont += '<td height="21" valign="middle" class="TickerNews" nowrap>'; 
	
	cont += '&nbsp;&nbsp;&nbsp;&nbsp;<b>';
	if (H != "") cont += H + '</b>&nbsp;(HAA)&nbsp;:&nbsp;';
	cont += '</td>';
	if (isCall) cont += '<td height="24" valign="middle" class="call" nowrap>&nbsp;';
	else cont += '<td height="24 valign="middle" class="TickerNews" nowrap>&nbsp;';
	if (lien != "") cont += '<a href="http://www.radio-canada.ca/util/urljs.html?' + lien + '" target="_top" onMouseOver="tempStopTicker();" onMouseOut="tempPlayTicker();">';
	cont += titre;
	if (lien != "") cont += '</a>';
	cont += '&nbsp;&nbsp;&nbsp;';
	cont += '</td>';

	return cont;
}
function writeHtmlDiv() {
	document.write('<div id="TickerContener">');
	if (document.layers) {
		document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0" height="21"><tr>');
		document.write('<td><spacer type="block" width="10" height="21"></td>');
		document.write('</tr></table> ');
	}
	document.write('<div id="LayNouvelle"> </div> ');
	document.write('</div>');
}

writeHtmlDiv();


function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}
//				CLASS RASTAMART
//=============================================================
//	----------	Layer		----------
//=============================================================

function RastaMartLay(objLay) {	
	this.layer = objLay;
	this.css = this.layer.style;
	return this;
}

//	----------	Show-Hide	----------
RastaMartLay.prototype.openIt = function () { if (document.layers) this.layer.visibility="show"; else this.css.visibility="visible"; }
RastaMartLay.prototype.closeIt = function () { if (document.layers) this.layer.visibility="hidden"; else this.css.visibility="hidden"; }

//	----------	X	 		----------
RastaMartLay.prototype.getX = function () { if (document.layers) return this.layer.left; else return this.css.left.replace(/px/, "").replace(/pt/, ""); }
RastaMartLay.prototype.setX = function (X) { if (document.layers) this.layer.left = X; else this.css.left = X+"px"; }
RastaMartLay.prototype.centerIt = function () { 
	if (document.all) bwW=window.document.body.clientWidth; else bwW=window.innerWidth;
	if (bwW>this.getWidth()) this.setX((bwW/2)-(this.getWidth()/2)); else this.setX(0);
}
//	----------	WIDTH		----------

RastaMartLay.prototype.getWidth = function () { if (document.layers) return this.layer.document.width; else return this.layer.offsetWidth; }
RastaMartLay.prototype.setWidth = function (Width) { if (document.layers) this.layer.document.width = Width; else this.css.width = Width; }

//	----------	Content		----------
RastaMartLay.prototype.setCont = function (cont){
	if (!document.layers){this.layer.innerHTML = cont;}else{this.layer.document.open("text/html"); this.layer.document.write(cont); this.layer.document.close();}
}

//=============================================================
//	----------	Window		----------
//=============================================================
function RastaMartWindow() {
	this.win = window;
	return this
}
RastaMartWindow.prototype.getWidth = function () { if (window.document.all) return window.document.body.clientWidth; else return window.innerWidth; }

// -->
