//This script detects the following:
//Flash
//Windows Media Player
//Java
//Shockwave
//RealPlayer
//QuickTime
//Acrobat Reader
//SVG Viewer


var agt=navigator.userAgent.toLowerCase();
var ie  = (agt.indexOf("msie") != -1);
var ns  = (navigator.appName.indexOf("Netscape") != -1);
var win = ((agt.indexOf("win")!=-1) || (agt.indexOf("32bit")!=-1));
var mac = (agt.indexOf("mac")!=-1);

if (ie && win) {	pluginlist = detectIE("Adobe.SVGCtl","SVG Viewer") + detectIE("SWCtl.SWCtl.1","Shockwave Director") + detectIE("ShockwaveFlash.ShockwaveFlash.1","Shockwave Flash") + detectIE("rmocx.RealPlayer G2 Control.1","RealPlayer") + detectIE("QuickTimeCheckObject.QuickTimeCheck.1","QuickTime") + detectIE("MediaPlayer.MediaPlayer.1","Windows Media Player") + detectIE("PDF.PdfCtrl.5","Acrobat Reader"); }
if (ns || !win) {
		nse = ""; for (var i=0;i<navigator.mimeTypes.length;i++) nse += navigator.mimeTypes[i].type.toLowerCase();
		pluginlist = detectNS("image/svg-xml","SVG Viewer") + detectNS("application/x-director","Shockwave Director") + detectNS("application/x-shockwave-flash","Shockwave Flash") + detectNS("audio/x-pn-realaudio-plugin","RealPlayer") + detectNS("video/quicktime","QuickTime") + detectNS("application/x-mplayer2","Windows Media Player") + detectNS("application/pdf","Acrobat Reader");
}

function detectIE(ClassID,name) { result = false; document.write('<SCRIPT LANGUAGE=VBScript>\n on error resume next \n result = IsObject(CreateObject("' + ClassID + '"))</SCRIPT>\n'); if (result) return name+','; else return ''; }
function detectNS(ClassID,name) { n = ""; if (nse.indexOf(ClassID) != -1) if (navigator.mimeTypes[ClassID].enabledPlugin != null) n = name+","; return n; }

pluginlist += navigator.javaEnabled() ? "Java," : "";
if (pluginlist.length > 0) pluginlist = pluginlist.substring(0,pluginlist.length-1);

//SAMPLE USAGE- detect "Flash"
function ecritFlash(){
    if (pluginlist.indexOf("Flash")!=-1){
	document.write('<table width="750" height="181" border="0" cellpadding="0" cellspacing="0" align="center"><tr><td width=4><img src="images/espaceur.gif" width=4 height=1></td><td>' +
		'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="750" HEIGHT="181" ALIGN="center">' +
		'<param name=movie value="flash/LaunSnwfr-2008.swf"> <PARAM NAME=quality VALUE=high> <PARAM NAME=wmode VALUE=transparent> <PARAM NAME=salign VALUE=C> <PARAM NAME=bgcolor VALUE=#FFFFFF>' +
		'<embed src="flash/LaunSnwfr-2008.swf" wmode=transparent quality=high salign=R bgcolor=#FFFFFF  WIDTH="750" HEIGHT="181" NAME="retourmenu" ALIGN="right" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>' +
		'</object></td></tr></table>');
    }else{
	document.write('<table width="750" height="181" border="0" cellpadding="0" cellspacing="0">' +
		'<tr>' +
		'<td><img src="images/entete_01.jpg" width="140" height="141" alt=""></td>' +
		'<td><img src="images/entete_02.jpg" width="470" height="141" alt=""></td>' +
		'<td><img src="images/entete_03.jpg" width="140" height="141" alt=""></td>' +
		'</tr>' +
		'<tr>' +
		'<td><img src="images/entete_04.gif" width="140" height="40" alt=""></td>' +
		'<td><img src="images/entete_05.gif" width="470" height="40" alt=""></td>' +
		'<td><img src="images/entete_06.jpg" width="140" height="40" alt=""></td>' +
		'</tr>' +
		'</table>') ;
    }
}

function ouvrePrint(){
	var adresse = document.location.href.replace(".jsp","_print.jsp") ;
	var param = "scrollbars=1,left=10,top=10,width=680,height="+(screen.availHeight - 100) ;
	window.open(adresse,"pop",param) ;
}