
function sonFlash(nm_swf,nm_son) {  
	var insert_balises = '<object type="application/x-shockwave-flash" ';
	insert_balises += 'data="moteur/flash/son/'+nm_swf+'?mp3=sons/'+nm_son+'&amp;autostart=1&amp;autoreplay=1&amp;bgcolor=FFFFFF" width="40" height="40">';
	insert_balises += '<param name="wmode" value="transparent" /><param name="scale" value="exactfit" /><param name="movie" ';
	insert_balises += 'value="moteur/flash/son/'+nm_swf+'?mp3=sons/'+nm_son+'&amp;autostart=1&amp;autoreplay=1&amp;bgcolor=FFFFFF" />';
	insert_balises += '</object>';
    document.write(insert_balises);   // intégrer le clip Flash
  }   

function testjs() {
	document.write('fonction test externe js ok 01');
}

function anim(chem_swf,largeur,hauteur,variables) {
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+largeur+'" height="'+hauteur+'" align="middle">');
    document.write('<param name="allowScriptAccess" value="sameDomain" />');
    document.write('<param name="movie" value="'+chem_swf+'" />');
   document.write('	<PARAM NAME=FlashVars VALUE="'+variables+'">');
    document.write('<param name="loop" value="false" />');
   document.write(' <param name="menu" value="false" />');
    document.write('<param name="quality" value="high" />');
   document.write(' <param name="wmode" value="transparent" />');
   document.write(' <param name="bgcolor" value="#ffffff" />');
   document.write(' <embed src="'+chem_swf+'" FlashVars="'+variables+'" loop="false" menu="false" quality="high" wmode="transparent" bgcolor="#ffffff" width="'+largeur+'" height="'+hauteur+'" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
  document.write('</object>');	
}

function flash(chem_swf,largeur,hauteur,variables) {
	 document.write('\n <!-- appel flash --> \n');	 
	 document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0"');
	document.write(' width="'+largeur+'" height="'+hauteur+'" align="middle">');
    document.write(' <param name="allowScriptAccess" value="sameDomain" />');
    document.write(' <param name="movie" value="'+chem_swf+'" />');
   document.write('	<param name=FlashVars VALUE="'+variables+'">');
    document.write(' <param name="loop" value="false" />');
   document.write(' <param name="menu" value="false" />');
    document.write(' <param name="quality" value="high" />');
   document.write(' <param name="wmode" value="transparent" />');
   document.write(' <param name="bgcolor" value="#ffffff" />');
   document.write(' <param name="Scale" VALUE="ExactFit" />');
   document.write(' <param name="allowFullScreen" value="true" />');
   document.write(' <embed src="'+chem_swf+'" FlashVars="'+variables+'" loop="false" menu="false" quality="high" wmode="transparent" bgcolor="#ffffff" width="'+largeur+'" height="'+hauteur+'" scale="exactfit" allowFullScreen="true" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
  document.write('</object>');	
  document.write('\n <!-- fin appel flash --> \n');
}

//vr_quick(chem_fichier,"100%","99%","true");
function vr_quick(chem_fichier,largeur,hauteur,control) {
	document.write('<object codebase=http://www.apple.com/qtactivex/qtplugin.cab height="'+hauteur+'" width="'+largeur+'" classid=clsid:clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B>');
	document.write('<param name="scale" value="tofit">');
	document.write('<param name="controller" value="'+control+'">');
	document.write('<param name="cache" value="true">');
	document.write('<param name="fov" value="60">');
	document.write('<param name="pan" value="0">');
	document.write('<param name="src" value="'+chem_fichier+'">');	
	document.write('<embed src="'+chem_fichier+'" width="'+largeur+'" height="'+hauteur+'" type="video/quicktime" controller="true" cache="true" pan="0" fov="60" scale="tofit" pluginspage="http://www.apple.com/quicktime/download/">');
	document.write('</embed>');
	document.write('</object>');	
}

// Fonction pour afficher une animation flash avec l'image dans pop up qui se redimensionne automatiquement
function popImage(chemin)
   {
	var pos_slash_fin = chemin.lastIndexOf("/"); 
	var nom = chemin.substring(pos_slash_fin+1,chemin.length);	
	var pos_slash_fin2 = chemin.lastIndexOf("/",pos_slash_fin-2); 
	var largeur = chemin.substring(pos_slash_fin2+1,pos_slash_fin);	
	var hauteur = 200;	
	var rep = "rep="+j_url+chemin.substring(1,pos_slash_fin+1);
	
	var chem_swf = j_url+"moteur/flash/anim/alpha00.swf";	
	var variables = "largeur="+largeur+"&amp;";
	variables += rep+"&amp;nb=1&amp;element0="+nom; 


   	html3 = '<html>';
	html3 += '<head>';
	html3 += '<title>Pop Image</title>';
		
	//html3 += '</head>';
	//html3 += '<body TOPMARGIN="0" LEFTMARGIN="0" onBlur="top.close()">';
	
	html3 += '<script language="javascript">';
	html3 += "function aff_anim(h){";
	//html3 += "document.write('</div>');";
	//html3 += 'var h=document.images["idimage"].height;';	
	html3 += "document.write('";
	//html3 = '<html>';
	html3 += '<head>';
	html3 += '<title>Pop Image</title>';	
	html3 += '</head>';
	//html3 += '<body TOPMARGIN="0" LEFTMARGIN="0">';
	html3 += '<body TOPMARGIN="0" LEFTMARGIN="0" onBlur="window.close()">';
	html3 += '<div onmousedown="window.close();">';
	html3 += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+largeur+'" height="';
	html3 += "'+h+'";
	html3 += '" align="middle">';
	html3 += '<param name="allowScriptAccess" value="sameDomain" />';
	html3 += '<param name="movie" value="'+chem_swf+'" />';
	html3 += '<PARAM NAME="FlashVars" VALUE="hauteur=';
	html3 += "'+h+'";
	html3 += '&amp;'+variables+'">';
	html3 += '<param name="loop" value="false" />';
	html3 += '<param name="menu" value="false" />';
	html3 += '<param name="quality" value="high" />';
	html3 += '<param name="wmode" value="transparent" />';
	html3 += '<param name="bgcolor" value="#ffffff" />';
	html3 += '<PARAM NAME="Scale" VALUE="ExactFit" />';
	html3 += '<embed src="'+chem_swf+'" FlashVars="hauteur=';
	html3 += "'+h+'";
	html3 += '&amp;'+variables+'" loop="false" menu="false" quality="high" wmode="transparent" bgcolor="#ffffff" width="'+largeur+'" height="';
	html3 += "'+h+'";
	html3 += '" scale="exactfit" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
	html3 += '</object>';
	html3 += '</div>';
	
	html3 += "</body></html>');";
	//html3 += 'document.getElementById( "divimg" ).style.visibility ="hidden";document.getElementById( "divimg" ).style.display ="none";';
	html3 += '}';
	html3 += '</script>';	
	
	
	html3 += '</head>';
	html3 += '<body TOPMARGIN="0" LEFTMARGIN="0">';
		 
	html3 += '<div id="divimg" style="visibility:hidden">';
	html3 += '<IMG src="'+chemin+'" BORDER=0 NAME=ImageMax id="idimage" onLoad="window.resizeTo(document.ImageMax.width, document.ImageMax.height+50);aff_anim(document.ImageMax.height)">';
	html3 += '</div>';
	html3 += '</body>';
	html3 += '</html>';
	
 
   popupImage2 = window.open('','_blank','toolbar=0, location=0, directories=0, menuBar=0, scrollbars=0, resizable=no');
   popupImage2.document.open();
   popupImage2.document.write(html3);
   popupImage2.document.close()
};


/*
Utilisez pour blink : 
<span id="a">
Bonjour
<script type="text/javascript">
blinker('a','#ff0000','#0000ff');
</script>
</span>
*/
function blinker(id,c1,c2)
{
        elm = document.getElementById(id);
        setTimeout(function() {setInterval(function () {elm.style.color=c1;},1000);},500);
        setInterval(function () {elm.style.color=c2;},1000);
}

