/////////////////////////////////////////////////////////////////////////////////////
// Clair et Net. (c) 2006
/////////////////////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////
//¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦  GESTION DU FSCOMMAND ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦//
/////////////////////////////////////////////////////////////////////

function redimFlash(args){

	//pour les navigateurs qui ne connaissent pas getElementById() :
	if (!document.getElementById) {
		if (document.all)
			document.getElementById=function() {
			if ( typeof(document.all[arguments[0]]) != "undefined")
				return document.all[arguments[0]];
			else
				return null;
			}
		else if (document.layers)
			document.getElementById=function() {
				if ( typeof(document[arguments[0]]) != "undefined")
					return document[arguments[0]];
				else
					return null;
		}
	}
	
	document.getElementById("flashDiv").style.height=args+"px";

	
}



var isInternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
	// Gérer tous les messages FSCommand d'une animation Flash.
	function animFlash_DoFSCommand(command, args) {
		var animFlashObj = isInternetExplorer ? document.all.animFlash : document.animFlash;
		//
		if (command == "redim") {			
			redimFlash(args);			
		 }
		 if (command == "changeURL") {
			//fonction à l'étude
			//afin de générer un historique en dur
			//dans le navigateur
			url=window.location.href;
			url=url.split("#");
			newUrl = url[0]+"#"+args;
			
			window.location.href=newUrl;	
			
			/*if(window.historyFrame){
				window.historyFrame.src = newUrl;
			}*/

		 }
		 /// pour les stats
		  if (command == "stats") {
			xt_flash('F',args)
			
			

		 }
		 
		 /*
		 //fonction gérée désormais dans le flash, afin de rester compatible MAC
		 if (command == "alertVersion") {
			 args=args.split(',');
			 var messageAlert = "ATTENTION !\n";
			 messageAlert += "Vous disposez actuellement de la version "+args[0]+" du plugin FlashPlayer.\n";
			 messageAlert += "Le site que vous tenter de visionner nécessite au minimum la version "+args[1]+".\n";
			 messageAlert += "Souhaitez-vous installer la mise à jour du plugin ?";
			if(confirm(messageAlert)){
				PopUp("http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash&Lang=French&P5_Language=French",600,600,"scrollbars=1,resizable=1");
			}
			
		 }*/
		//
	}
	// 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.write('<script language=\"VBScript\"\>\n');
		document.write('On Error Resume Next\n');
		document.write('Sub animFlash_FSCommand(ByVal command, ByVal args)\n');
		document.write('	Call animFlash_DoFSCommand(command, args)\n');
		document.write('End Sub\n');
		document.write('</script\>\n');
	}




/////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////
//¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦      GESTION DES FLASHS      ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦//
/////////////////////////////////////////////////////////////////////

//flash 
function genereFlash(src,width,height,variables){
	
	if(variables){
			src=src+"?"+variables;
		}

	html='	 <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="'+width+'" height="'+height+'" id="animFlash" name="animFlash">';
	html+='	  <param name="movie" value="'+src+'" />';
	html+='	   <param name="quality" value="high" />';
	html+='	  <embed src="'+src+'" quality="high"  pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="'+width+'" height="'+height+'" id="animFlash" name="animFlash" >';
	html+='	  </embed>';
	html+='	</object>';
	
	document.write(html);
		
}


/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/


function PopUp(url,largeur,hauteur,option) {
	alert("popup function called");
	
	/*
	if(!option){
		option="toolbar=0,location=0,directories=0,status=0,scrollbars=0,resizable=0,menubar=0";
	}
	
	t=(window.screen.height-hauteur)/2;
	l=(window.screen.width-largeur)/2;
	window.open(url, "SNPTV", "top="+t+",left="+l+",width="+largeur+",height="+hauteur+","+option);
	*/

}






/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

////////////////////////////////////////////////////////////////////////////
//¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦  correction du bug de flash pour IE ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦//
////////////////////////////////////////////////////////////////////////////
/*
//FS command ne fonctionne pas sous IE si ce code est activé...

window.onload=function(){
	theObjects = document.getElementsByTagName("object");
	//alert(theObjects.length);
	for (var i = 0; i < theObjects.length; i++) {
		theObjects[i].outerHTML = theObjects[i].outerHTML;
	}

}*/


/////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////


/////////////////////////////////////////////////////////////////////
//¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦  GESTION DES TAGS XITI POUR FLASH ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦//
/////////////////////////////////////////////////////////////////////

<!--
function xt_flash(typefl,page)
{
		
Xt_r = document.referrer;
Xt_h = new Date();
xt_img = new Image();
Xt_i = 'http://logi12.xiti.com/hit.xiti?s=261829';
Xt_i += '&p='+page+'&type='+typefl+'&hl=' + Xt_h.getHours() + 'x' + Xt_h.getMinutes() + 'x' + Xt_h.getSeconds();
if(parseFloat(navigator.appVersion)>=4)
{Xiti_s=screen;Xt_i += '&r=' + Xiti_s.width + 'x' + Xiti_s.height + 'x' + Xiti_s.pixelDepth + 'x' + Xiti_s.colorDepth;}
Xt_i += '&ref=' + Xt_r.replace(/[<>"]/g, '').replace(/&/g, '$');
xt_img.src = Xt_i;
return;
}
//-->

