<!--
// variable dynamique mis en statique pour les besoins du test
// pour le clic de l'animation
var clickTAG = escape(linkURL);

// pour comptabiliser la fin de video
var finvideo=' '; //link to stats

var trans="transparent"; // transparent ou opaque
var largeur=416; // largeur du flash et du calque
var hauteur=450; // hauteur du flash et du calque
//var nom_objet_flash ="http://media.carpediem.fr/flash/newexpand/it/expand_03.swf"; // objet flash
var nom_objet_flash ="http://emile.dev.revolutionstudio.ro/expand/it/expand_03.swf"; // objet flash

// banniere
var transb="opaque"; // transparent ou opaque
var largeurb=468; // largeur du flash et du calque
var hauteurb=60; // hauteur du flash et du calque
//var nom_objet_flashb ="http://media.carpediem.fr/flash/newexpand/it/468x60-01.swf"; // objet flash
var nom_objet_flashb ="http://emile.dev.revolutionstudio.ro/expand/it/468x60-01.swf"; // objet flash

//trailer
var nom_objet_trailer = ''; // objet flash

// position 1 en haut a gauche - 2 en haut a droite - 3 en bas a gauche -4 en bas a droite - 5 au centre (par defaut)
//var position=5;
// pour le popup ou non
var no_ad=true;

var ie = navigator.appName.indexOf("Microsoft") != -1;
var centre=1;
var hautp=0; // position du calque a partir du haut et si position manuel
var gauchep=0; // position du calque a partir de la gauche et si position manuel
var tjs_delai=10; // temps entre chaque verification du calque
var tjs_max=100; // nombre de pixel de deplacement
var corh=0;
var corl=0;
var inf="";

if (typeof no_ad == "undefined") {var no_ad=true;}

// on determine le nom de l'iframe
var nom_iframe='';
if(window.frameElement!==null)
{
  var nom_fen1=window.frameElement.name;
	nom_iframe="frames['"+nom_fen1+"']";
  if(parent.window.frameElement!==null)	
	{
		var nom_fen2=parent.window.frameElement.name;
		nom_iframe="frames['"+nom_fen2+"'].frames['"+nom_fen1+"']";
    if(parent.parent.window.frameElement!==null)
		{
      	var nom_fen3=parent.parent.window.frameElement.name;
				nom_iframe="frames['"+nom_fen3+"'].frames['"+nom_fen2+"'].frames['"+nom_fen1+"']";
				if(parent.parent.parent.window.frameElement!==null)
				{
					no_ad=false;
				}
		}	
	}	
}

if (nom_iframe=="")
inf="no";

if (!ie)
{
	corh=10;
	corl=20;
}

// overlay + flash
var nom_calque = new String (Math.random()); 
 nom_calque = nom_calque.substring(2,8);

if (typeof position == "undefined") {var position=5;}
if (position==1) // en haut a gauche
{ var tjs_mode=0; // 0 - calque toujours en haut de page / 1 - calque en bas 
var tjs_mode_g=0; } // 0 - calque toujours a gauche / 1 - calque toujours a droite
if (position==2) // en haut a droite
{ var tjs_mode=0; var tjs_mode_g=1; }
if (position==3) // en bas a gauche
{ var tjs_mode=1; var tjs_mode_g=0; }
if (position==4) // en bas a droite
{ var tjs_mode=1; var tjs_mode_g=1; }
if (position==5) // au centre
{ var tjs_mode=1; var tjs_mode_g=1; centre=2; }

if (typeof nom_frame == "undefined") {var nom_frame="";}
if (nom_frame!="" && nom_frame!="0" && ie)
{
  var ste=top.frames[nom_frame].document;
  inf="yes";
}
else 
{
	var ste=top.document;
}

// Gérer tous les messages FSCommand d'une animation Flash.
function ab_DoFSCommand(command, args) {
	var abObj = ie ? document.all.ab : document.ab;
if (command == "ouvrir_advertstream")
	{ 	ouvrir_advertstream(); }
if (command == "fermer_advertstream")
	{ 	
	fermer_advertstream();
	fermer_advertstream;
	}	
}
// Hook pour Internet Explorer
if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
	document.writeln('<script language=\"VBScript\"\>');
	document.writeln('On Error Resume Next\n');
	document.writeln('Sub ab_FSCommand(ByVal command, ByVal args)');
	document.writeln('Call ab_DoFSCommand(command, args)');
	document.writeln('End Sub');
	document.writeln('</script\>');
}
var Str;
function creationc() // fonction qui cree le calque et lui insere un objet (flash, image, texte...)
{ 
	Str="<DIV ID="+nom_calque+" STYLE='position:absolute;top:" + hautp + "px;left:" + gauchep + "px;visibility:visible;width:"+largeur+"px;height:"+hauteur+"px;z-index:10000;'></DIV>";
	if (ie)	ste.body.insertAdjacentHTML("afterBegin",Str);
	else 
		{
			var r = parent.parent.parent.document.body.ownerDocument.createRange();
  		r.setStartBefore(parent.parent.parent.document.body);
  		var parsedHTML = r.createContextualFragment(Str);
  		parent.parent.parent.document.body.insertBefore(parsedHTML,parent.parent.parent.document.body.firstChild);
		}
}

var a;
function Start() { // fonction qui permet de lancer tout les tjs_delai milliseconde le replacement du calque
	bcalque(GetTop(nom_calque),GetLeft(nom_calque));
	a = setTimeout("Start()",tjs_delai);
}

function bcalque(haut,gauche) { // repositionement du calque
	ste.getElementById(nom_calque).style.top=haut+'px';
	ste.getElementById(nom_calque).style.left=gauche+'px';
}

function GetTop(nom) {
	// Partie 1 : Récupération de la position du calque et de la page
		var pos;
		if (ie)
			pos=parseInt(ste.getElementById(nom).style.top);
		else
			pos=parseInt(top.document.getElementById(nom).offsetTop);

		var wintop;
    if (self.pageYOffset) // all except Explorer
    	wintop = top.window.pageYOffset;
    else if (ste.documentElement && ste.documentElement.scrollTop)// Explorer 6 Strict Mode
    	wintop = ste.documentElement.scrollTop;
    else if (ste.body) // all other Explorers
    	wintop = ste.body.scrollTop;

		var avail;
    if (self.innerHeight) // all except Explorer
    	avail = top.window.innerHeight;
    else if (ste.documentElement && ste.documentElement.clientHeight)// Explorer 6 Strict Mode
    	avail = ste.documentElement.clientHeight;
    else if (ste.body) // other Explorers
    	avail = ste.body.clientHeight;
			
	// Partie 2 : Traitement de la position
	if (tjs_mode==0) { // toujours en haut
		var delta=Math.ceil((pos-wintop)/3);
		if (delta>20) {delta=20;}
		if (delta<-20) {delta=-20;}
		var haut=pos-delta;
	}
	if (tjs_mode==1) { // toujours en bas
		var delta=Math.ceil((pos-(wintop+(avail/centre)-(hauteur/centre))));
		if (delta>tjs_max) {delta=tjs_max;}
		if (delta<-1*tjs_max) {delta=-1*tjs_max;}
		var haut=pos-delta-corh;
	}
	return haut;
}


function GetLeft(nom) {
	// Partie 1 : Récupération de la position du calque et de la page
		var pos;
		if (ie)
			pos=parseInt(ste.getElementById(nom).style.left);
		else
			pos=parseInt(top.document.getElementById(nom).offsetLeft);

		var wintop;
    if (self.pageYOffset) // all except Explorer
    	wintop = top.window.pageXOffset;
    else if (ste.documentElement && ste.documentElement.scrollLeft)// Explorer 6 Strict Mode
    	wintop = ste.documentElement.scrollLeft;
    else if (ste.body) // all other Explorers
    	wintop = ste.body.scrollLeft;

		var avail;
    if (self.innerWidth) // all except Explorer
    	avail = top.window.innerWidth;
    else if (ste.documentElement && ste.documentElement.clientWidth)// Explorer 6 Strict Mode
    	avail = ste.documentElement.clientWidth;
    else if (ste.body) // other Explorers
    	avail = ste.body.clientWidth;
			
	// Partie 2 : Traitement de la position
	if (tjs_mode_g==0) { // toujours a gauche
		var delta=Math.ceil((pos-wintop)/3);
		if (delta>20) {delta=20;}
		if (delta<-20) {delta=-20;}
		var gauche=pos-delta;
	}
	if (tjs_mode_g==1) { // toujours a droite
		var delta=Math.ceil((pos-(wintop+(avail/centre)-(largeur/centre))));
		if (delta>tjs_max) {delta=tjs_max;}
		if (delta<-1*tjs_max) {delta=-1*tjs_max;}
		var gauche=pos-delta-corl;
	}

	return gauche;
}

function fermer_advertstream() 
{
	ste.getElementById(nom_calque).innerHTML='';
	ste.getElementById(nom_calque).style.visibility="hidden";
	ste.getElementById(nom_calque).innerHTML=' ';
	
}

function ouvrir_advertstream() 
{
	ste.getElementById(nom_calque).innerHTML='';
	ste.getElementById(nom_calque).style.visibility="visible";
	ste.getElementById(nom_calque).innerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="' + largeur + 'px" height="' + hauteur + 'px"><param name="movie" value="' + nom_objet_flash + '"><param name=FlashVars value="movie_url='+nom_objet_trailer+'&player_url='+nom_objet_flash+'&nom_iframe=' + nom_iframe + '&clickTAG=' + clickTAG + '&finvideo=' + finvideo + '&inf=' + inf + '&ad_ban=1&ad_local=ad_1"><param name=allowScriptAccess value=always><param name=quality value=high><PARAM NAME=wmode VALUE='+trans+'><embed src="'+ nom_objet_flash+'?movie_url='+nom_objet_trailer+'&player_url='+nom_objet_flash+'&nom_iframe='  + nom_iframe + '&clickTAG=' + clickTAG + '&finvideo=' + finvideo + '&inf=' + inf + '&ad_ban=1&ad_local=ad_1" swLiveConnect=true quality="high" id="ab" name="ab" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + largeur + 'px" height="' + hauteur + 'px" wmode='+trans+'  allowScriptAccess="always" ></embed></object>';
	
}

if (no_ad==true)
{
  creationc(); // creer le calque
  setTimeout("Start()",tjs_delai);  // commence le repositionnement 
}
document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" id="ab" width="' + largeurb + 'px" height="' + hauteurb + 'px" align="middle">');
document.write('<param name="movie" value="'+nom_objet_flashb+'?movie_url='+nom_objet_trailer+'&player_url='+nom_objet_flash+'&nom_iframe=' + nom_iframe + '&clickTAG=' + clickTAG + '&finvideo=' + finvideo + '&inf=' + inf + '&ad_local=ad_1&no_ad='+no_ad+'" />');
document.write('<param name="quality" value="high" />');
document.write('<param name="allowScriptAccess" value="always" />');
document.write('<PARAM NAME=wmode VALUE='+transb+' />');
document.write('<embed src="'+nom_objet_flashb+'?movie_url='+nom_objet_trailer+'&player_url='+nom_objet_flash+'&nom_iframe=' + nom_iframe + '&clickTAG=' + clickTAG + '&finvideo=' + finvideo + '&inf=' + inf + '&ad_local=ad_1&no_ad='+no_ad+'" quality="high" bgcolor="#ffffff" width="' + largeurb + 'px" height="' + hauteurb + 'px" swLiveConnect=true id="ab" allowScriptAccess="always" name="ab"  align="middle" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
document.write('</object>');
//-->
