var DHTML=0,DOM=0,MS=0,NS=0,OP=0;
var Vshow="visible",Vhide="hidden";
var nav="",navver="",OS="",flNav="type='application/x-shockwave-flash'";
function DHTML_init(){
 if(window.opera)OP=1;
 if(document.getElementById){DHTML=1;DOM=1}
 if(document.all&&!OP){DHTML=1;MS=1}
 if(document.layers&&!OP){DHTML=1;NS=1}
}

function getObj(name){
	if(document.getElementById){
		this.obj=document.getElementById(name);
		if(this.obj==null)
  			return this.obj=false;
		this.style=this.obj.style
	}else if(document.all){
		this.obj=document.all[name];
		this.style=document.all[name].style
	}else if(document.layers){
		Vshow="show";
		Vhide="hide";
		this.obj=getObjNN4(document,name);
		this.style=this.obj
	}
}

function getObjNN4(obj,name){
	var x=obj.layers;
	var foundLayer;
	for(var i=0;i<x.length;i++){
		if (x[i].id==name)
		 	foundLayer=x[i];
		else if(x[i].layers.length)
			var tmp=getObjNN4(x[i],name);
		if(tmp)foundLayer=tmp;
	}
	return foundLayer;
}

function invi(divID,flag){
	if (!DHTML)return;
	var x=new getObj(divID);
	if(x.obj){
		x.style.visibility=(flag)?Vhide:Vshow;
		return true;
	}
}

function invito(divID,flag,to){
	setTimeout("invi(divID,flag)",to)
}

function disp(divID,flag){
	if(!DHTML)return;
	var x=new getObj(divID);
	if(x.obj){
		x.style.display=(flag)?"none":"block";
		return true;
	}
}
function getAbsoluteLeft(objectId){
	var x=(new getObj(objectId)).obj;
	if(!x)return false;
	if(NS)return(x['pageX'])
	var xLeft=x.offsetLeft;
	while(x.offsetParent!=null){
		var xParent=x.offsetParent;
		xLeft+=xParent.offsetLeft;
		x=xParent;
	}
	return xLeft;
}

function getAbsoluteTop(objectId){
	var x=(new getObj(objectId)).obj;
	if(!x)return false;
	if(NS)return(x['pageY']);
	var xTop=x.offsetTop;
	while(x.offsetParent!=null){
		var xParent=x.offsetParent;
		xTop+=xParent.offsetTop;
		x=xParent;
	}
	return xTop;
}

function getWidth(objectId){
	var x=(new getObj(objectId)).obj;
	if(!x||NS)return 0;
	return x.offsetWidth;
}

function getHeight(objectId){
	var x=(new getObj(objectId)).obj;
	if(!x||NS)return 0;
	return x.offsetHeight;
}

function getEnv(){
	OS=navigator.platform.substr(0,3);
	nav=navigator.appName;
	var nver;
	switch(nav){
	case "Microsoft Internet Explorer":
		var reg=new RegExp("MSIE ([0-9]\.[0-9])");
		nver=navigator.userAgent.match(reg);
		nav="MSIE";
		if(OS=="Win")flNav="classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'";
		break;
	case "Netscape":
		nav="Mozilla";
		var reg=new RegExp("^Mozilla/.*rv:([0-9]\.[0-9])");
		nver=navigator.userAgent.match(reg)
		if(!nver){
			reg=new RegExp("Safari/([0-9.]+)$");
			nver=navigator.userAgent.match(reg)
			if(nver){nav="Safari"}
		}
		break;
	}
	navver=nver?nver[1]:'unknown';
}

function affichFlash(swf,width,height,noflash,null_1,null_2,id){
	if(id) {
		var flashvars = {};
		var params = {wmode:'transparent', allowscriptaccess:'always', quality:'high'};
		var attributes = {};
		swfobject.embedSWF(swf, id, width, height, "9.0.0", "/swf/expressInstall.swf", flashvars, params, attributes);
	} else {
		noflash=(noflash)?"<div class='flashplayer' style='width:"+width+"px;height:"+height+"px;'>La dernière version du plugin <b>Macromedia&reg; Flash<\/b> n'est pas installée.<br><br>Merci de télécharger et d'installer la dernière version disponible <a href='http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash&amp;Lang=French&amp;P5_Language=French' target='_blank'><b>ici<\/b><\/a><\/div>":"&nbsp;";
		document.write("<object "+flNav+" width='"+width+"' height='"+height+"' data='"+swf+"'>"+
		"<param name='quality' value='high'><param name='wmode' value='transparent'>"+
		"<param name='allowScriptAccess' value='always'><param name='movie' value='"+swf+"'>"+
		noflash+"</object>");
	}
}

getEnv();
DHTML_init();