var etat_patientez=-1;
var bouger_boite_dialogue=0;
var bouger_info_bulle=0;
var decalage_x_boite_dialogue=0;
var decalage_y_boite_dialogue=0;
var document_charge=0;
var largeur_info_bulle=200;
var bouger_calque=0;
var nom_navigateur;
var version_navigateur;
var calques_plus_ouverts=new Array();
var hauteur_bandeau;
var affich_calque_fenetre=0;
var fin_scrolling='';
var mode_strict=0;

var etat_clignotement=0;

var plug_in_fichier=new Array();

//plugsin
	var is_plugin_acrobat,is_plugin_beatnik ,is_plugin_cosmo ,is_plugin_flash ,is_plugin_mediaplayer ,is_plugin_quicktime ,is_plugin_real ,is_plugin_svg,is_plugin_aurigma;

	//détection plugins
	document.write("<script language=\"VBScript\">\n<!-- 'IE---detection \nOn error resume next \n//is_plugin_acrobat = NOT IsNull(CreateObject(\"AcroExch.Document\")) \nis_plugin_beatnik = NOT IsNull(CreateObject(\"Beatnik.Beatnik\")) \nis_plugin_cosmo = NOT IsNull(CreateObject(\"Cosmo.Cosmo\")) \nis_plugin_flash =  NOT IsNull(CreateObject(\"ShockwaveFlash.ShockwaveFlash\"))  \nis_plugin_mediaplayer = NOT IsNull(CreateObject(\"Mediaplayer.Mediaplayer\")) \nis_plugin_quicktime = NOT IsNull(CreateObject(\"QuickTimeCheckObject.QuickTimeCheck.1\")) \nis_plugin_real = NOT IsNull(CreateObject(\"rmocx.RealPlayer G2 Control\")) \nis_plugin_svg = NOT IsNull(CreateObject(\"Adobe.SVGCtl\")) \nis_plugin_aurigma = NOT IsNull(CreateObject(\"Aurigma.ImageUploader3\")) \n-->\n<\/script>");



function detection_plugin() {
	//détection flash
	
	
	//detection quicktime
	
	
	//detection windows media player
	
	
	//detection real
	
	//detection Acrobat reader
	
	//detection adobe
	
	
}

function setCookie(name, value, expires, path, domain, secure)
{
    document.cookie= name + "=" + escape(value) +
        ((expires) ? "; expires=" + expires.toGMTString() : "") +
        ((path) ? "; path=" + path : "") +
        ((domain) ? "; domain=" + domain : "") +
        ((secure) ? "; secure" : "");
}


function getCookie(name)
{
    var dc = document.cookie;
    var prefix = name + "=";
    var begin = dc.indexOf("; " + prefix);
    if (begin == -1)
    {
        begin = dc.indexOf(prefix);
        if (begin != 0) return null;
    }
    else
    {
        begin += 2;
    }
    var end = document.cookie.indexOf(";", begin);
    if (end == -1)
    {
        end = dc.length;
    }
    return unescape(dc.substring(begin + prefix.length, end));
}


function deleteCookie(name, path, domain)
{
    if (getCookie(name))
    {
        document.cookie = name + "=" + 
            ((path) ? "; path=" + path : "") +
            ((domain) ? "; domain=" + domain : "") +
            "; expires=Thu, 01-Jan-70 00:00:01 GMT";
    }
}

function detection_navigateur() {
	
		
	
}

function clignot (id_calque) {
	if (etat_clignotement!=-1) {
		if (etat_clignotement==1) {
			calque(id_calque).style.visibility='visible';
		}
		else {
			calque(id_calque).style.visibility='hidden';
		}
		etat_clignotement=1-(etat_clignotement);
		setTimeout("clignot('"+id_calque+"')",600);
	}
}

function calque(nom,obj) {
	if (!obj) obj=document;
	var calq;
	if (document.getElementById) {
		eval("calq=obj.getElementById('"+nom+"');");
		
	}
	else if (document.all) {
		eval("calq=obj.all."+nom+";");
	}
	else if (document.layers) {
		
	}
	if (calq) return calq;
	else {
		
		return false;
	}
}

function ouvrir_plus(calq,action_calque,message_ouvert,message_ferme,img_ouvert,img_ferme) {
		
	/*if (couleur) {
		calques_plus_ouverts[calques_plus_ouverts.length]=calq;
		for (o=0;o<calques_plus_ouverts.length;o++) {
			if (calques_plus_ouverts[o]!=calq) calque(calques_plus_ouverts[o]).style.backgroundColor='';
		}
	}
	*/
	
	if (!message_ouvert) message_ouvert="Fermer...";
	if (!message_ferme) message_ferme="Détails...";
	if (!img_ouvert) img_ouvert="imgs/pictos/voir_moins.gif";
	if (!img_ferme) img_ferme="imgs/pictos/voir_plus.gif";
	
	
	qsd=calque(calq);
	//var img_calque=calque('picto_'+calq);
	if (!action_calque) action_calque=(qsd.style.overflow=='hidden')? 'ouvrir' : 'fermer';
	
	
	if (qsd) {
		
		
		
		if (action_calque=='ouvrir') {
			qsd.style.visibility='visible';
			qsd.style.overflow='visible';
			qsd.style.height='';
			
			//img_calque.alt=message_ouvert;
			//img_calque.src=img_ouvert;
			
			
			
			//if (couleur) qsd.style.backgroundColor='#eeeeee';
			
			
					
		}
		else if (action_calque=='fermer') {
			
			qsd.style.visibility='hidden';	
			qsd.style.overflow='hidden';
			qsd.style.height='1';
			//img_calque.alt=message_ferme;
			//img_calque.src=img_ferme;			
		}
			
		
	}	
}

function fermer_intro(type) {
	//avant,plein,dans
	if (!type) type='dans';
	
	if (type=='dans') {
		if (calque('intro_calque')) calque('intro_calque').outerHTML='';		
	}
	if (type=='plein') {
		window.close();		
	}
	if (type=='avant') {
		location='-index-2.html';
	}
}

function modal(lien,largeur,hauteur,arguments,ajout_propriete) {
	var retour=window.showModalDialog(lien,arguments,"dialogHeight: "+hauteur+"px; dialogWidth: "+largeur+"px; edge: Raised; center: Yes; help: No; resizable: Yes; status: No; "+ajout_propriete);
	return retour;
}
function aide(page) {
	fullscreen('-aide-'+page);
}

function patientez () {
	if (etat_patientez!=-1) {
		if (etat_patientez==1) {
			calque('cpatientez').style.visibility='visible';
		}
		else {
			calque('cpatientez').style.visibility='hidden';
		}
		etat_patientez=1-(etat_patientez);
		setTimeout('patientez()',800);
	}
}



function boite_dialogue(titre,contenu,largeur,hauteur,descript,message_copie_interdite,id_image_precedente,id_image_suivante) {
	
	if (!largeur) largeur=300;
	if (!hauteur) hauteur=200;
	
	
	var tmp;
	var tmp_bas='';
		
	
	tmp="<table cellpadding=0 cellspacing=0 width="+largeur+" height="+hauteur+" border=0><tr><td UNSELECTABLE=on>";
		tmp+="<table cellpadding=0 cellspacing=0 width=100% border=0><tr heigth=34 ><td align=center width=6><img src='imgs/keeoweb/fenetre_gauche.gif' width=6 height=34></td>";
		if (calque(id_image_precedente)) {
			tmp+="<td style='background-color:#b0b0b0;background:url(imgs/keeoweb/fenetre_haut_fond.gif);cursor:hand;' onclick=\"calque('"+id_image_precedente+"').click()\" align=center width=20 title='Image précédente'><img src='imgs/pictos/image_precedente.gif' width=10 height=10></td>";
			tmp_bas+="<td style='cursor:hand;' onclick=\"calque('"+id_image_precedente+"').click()\" align=left width=20 title='Image précédente'><img src='imgs/pictos/image_precedente.gif' width=10 height=10></td>";
		}
		
		tmp+="<td onmousedown='bouger_boite_dialogue=1;init_pos()' onmouseup='bouger_boite_dialogue=0;' ondrag='return false;'style='background-color:#b0b0b0;background:url(imgs/keeoweb/fenetre_haut_fond.gif);cursor:move;color:#ffffff;font-weight:bold' align=center UNSELECTABLE=on id=contenu_boite_dialogue>"+titre+"</td>";
		
		if (descript) tmp_bas+="<td>"+descript+"</td>";
		
		if (calque(id_image_suivante)) {
			tmp+="<td style='background-color:#b0b0b0;background:url(imgs/keeoweb/fenetre_haut_fond.gif);cursor:hand' onclick=\"calque('"+id_image_suivante+"').click()\" align=center width=20 title='Image suivante'><img src='imgs/pictos/image_suivante.gif' width=10 height=10></td>";
			tmp_bas+="<td style='cursor:hand' onclick=\"calque('"+id_image_suivante+"').click()\" align=right width=20 title='Image suivante'><img src='imgs/pictos/image_suivante.gif' width=10 height=10></td>";
		}
		tmp+="<td width=19 title='Fermer' onclick=\"fermer_boite_dialogue();\" valign=middle style='font-family:arial;font-weight:bold;cursor:pointer;background:url(imgs/keeoweb/fenetre_haut_fond.gif);'><img src='imgs/keeoweb/croix.gif' with=19 height=19 onmouseover=\"this.src='imgs/keeoweb/croix_ligth.gif'\" onmouseout=\"this.src='imgs/keeoweb/croix.gif'\" title='Fermer'></td>";
		tmp+="<td align=center width=6><img src='imgs/keeoweb/fenetre_droite.gif' width=6 height=34></td></tr></table>";
	tmp+="</td></tr>";
	
	if (tmp_bas) tmp_bas="<table style='width:100%;background-color:#b0b0b0;color:#ffffff;padding:3'><tr>"+tmp_bas+"</tr></table>";
	
	tmp+="<tr><td UNSELECTABLE=on height=100%>";
		tmp+="<table cellpadding=0 cellspacing=0 width=100% height=100% border=0 UNSELECTABLE=on><tr><td width=4 style='background:url(imgs/keeoweb/fenetre_contour_gauche.gif)'><img src='imgs/pictos/largeur_4.gif' width=4 height=1></td><td bgcolor=#ffffff align=center";
		if (message_copie_interdite) tmp+=" galleryImg=no oncontextmenu=\"alert('"+message_copie_interdite+"');return false;\"";
		tmp+=" UNSELECTABLE=on><table cellpadding=0 cellspacing=0><tr><td onclick=\"fermer_boite_dialogue();\">"+contenu+"</td></tr><tr><td>"+tmp_bas+"</td></tr></table></td><td width=4 style='background:url(imgs/keeoweb/fenetre_contour_droite.gif)'><img src='imgs/pictos/largeur_4.gif' width=4 height=1></td></tr></table>";
	tmp+="</td></tr>";
	
	tmp+="<tr><td colspan=3 height=4 style='background:url(imgs/keeoweb/fenetre_contour_bas.gif)'></td></tr>";
	tmp+="</table>";
	
	
	calque('cboite_dialogue').innerHTML=tmp;

	
	//Si calque n'est pas dans la fenetre, on la place au milieu
		
		//var c_off_top = calque('cboite_dialogue').offsetTop;
		//var c_off_height = calque('cboite_dialogue').offsetHeight;		
		//var c_body_height = document.body.clientHeight;		
		
		//alert(c_off_top+" "+c_off_height+" "+c_scroll_top+" "+c_body_height);
		
		
		if (document.documentElement.scrollTop) {
			var c_scroll_top = document.documentElement.scrollTop;			
		}
		else var c_scroll_top=document.body.scrollTop;
			
		calque('cboite_dialogue').style.top=(c_scroll_top+ 50) +'px';	
		
			
		//var c_off_left = calque('cboite_dialogue').offsetLeft;
		var c_off_width = calque('cboite_dialogue').offsetWidth;	
	
		if (document.documentElement.scrollTop) var d_scroll_left = document.documentElement.scrollLeft;
		else var d_scroll_left = document.body.scrollLeft;
			
		var d_body_width = document.body.clientWidth;
				
		calque('cboite_dialogue').style.left = (d_scroll_left+(d_body_width-c_off_width)/2)+"px";
				
		if (hauteur_bandeau && c_off_top <= hauteur_bandeau) 
			calque('cboite_dialogue').style.top=hauteur_bandeau+'px';
		
	
	calque('cboite_dialogue').style.visibility='visible';
}

function fermer_boite_dialogue() {
	calque('cboite_dialogue').style.visibility='hidden';
	calque('cboite_dialogue').innerHTML='';
}
	

function init_pos() {
	decalage_x_boite_dialogue=parseInt(event.x)+parseInt(document.body.scrollLeft)-parseInt(calque('cboite_dialogue').offsetLeft);
	decalage_y_boite_dialogue=parseInt(event.y)+parseInt(document.body.scrollTop)-parseInt(calque('cboite_dialogue').offsetTop);
	
}



function pos_souris2 () {
		
	if (bouger_calque) {
		document.selection.clear();
		move_calque();
				
	}		
		
	if (bouger_boite_dialogue || bouger_info_bulle) {
		//document.selection.clear();
		var pos_sc_x=parseInt(window.event.clientX);
		var pos_sc_y=parseInt(window.event.clientY);
		pos_x=pos_sc_x+parseInt(document.body.scrollLeft);
		pos_y=pos_sc_y+parseInt(document.body.scrollTop);
		
	}	
		
	if (bouger_boite_dialogue) {
		
		
		calque('cboite_dialogue').style.left=pos_x-decalage_x_boite_dialogue;
		calque('cboite_dialogue').style.top=pos_y-decalage_y_boite_dialogue;
	}
	
	if (bouger_info_bulle) {		
		
		var diff_largeur=parseInt(document.body.clientWidth)-pos_sc_x-calque('cinfo_bulle').offsetWidth;
		
		if (diff_largeur<20) pos_x=pos_x-calque('cinfo_bulle').offsetWidth-30;
		
		calque('cinfo_bulle').style.left=pos_x+15;
		
		var diff_hauteur=parseInt(document.body.clientHeight)-pos_sc_y-calque('cinfo_bulle').offsetHeight-10;
		if (diff_hauteur<0) pos_y+=diff_hauteur;
		
		
		calque('cinfo_bulle').style.top=pos_y;
		
		//calque('cinfo_bulle').innerText=pos_y;
	}		
}



function pos_souris () {
		
	if (bouger_calque) {
		document.selection.clear();
		move_calque();				
	}		
		
	if (bouger_boite_dialogue || bouger_info_bulle) {
		//document.selection.clear();
		var pos_sc_x=parseInt(window.event.clientX);
		var pos_sc_y=parseInt(window.event.clientY);
		
		if (document.documentElement.scrollTop) pos_y=pos_sc_y+parseInt(document.documentElement.scrollTop);
		else pos_y=pos_sc_y+parseInt(document.body.scrollTop);
		
		if (document.documentElement.scrollTop) pos_x=pos_sc_x+parseInt(document.documentElement.scrollLeft);
		else pos_x=pos_sc_x+parseInt(document.body.scrollLeft);
		
		
		
		var largeur_ecran = document.body.clientWidth;
		var hauteur_ecran = document.body.clientHeight;
		
		
	}	
		
	if (bouger_boite_dialogue) {		
		
		calque('cboite_dialogue').style.left=pos_x-decalage_x_boite_dialogue;
		calque('cboite_dialogue').style.top=pos_y-decalage_y_boite_dialogue;
	}
	
	if (bouger_info_bulle) 
	{	
		
		var diff_largeur=parseInt(largeur_ecran)-pos_sc_x-calque('cinfo_bulle').offsetWidth;	
		if (diff_largeur<20) pos_x=pos_x-calque('cinfo_bulle').offsetWidth-30;		
		calque('cinfo_bulle').style.left=pos_x+15+'px';
		
		var diff_hauteur=parseInt(hauteur_ecran)-pos_sc_y-calque('cinfo_bulle').offsetHeight-10;
		if (diff_hauteur<0) pos_y+=diff_hauteur;		
		calque('cinfo_bulle').style.top=pos_y+'px';		
		
	}		
}




function mouseup() {
	if (bouger_calque) moveup(type_calque);
	if(bouger_boite_dialogue) bouger_boite_dialogue=0;	
}

function pop(text,largeur){		
		
	bouger_info_bulle=1;
	if (!largeur) {
		largeur=150;
	}
	largeur_info_bulle=largeur;
	pos_souris();
	calque('cinfo_bulle').innerHTML=text;
	calque('cinfo_bulle').style.width=largeur+'px';
	calque('cinfo_bulle').style.visibility='visible';
	
	/*	
	pos_souris();
	calque('cinfo_bulle').innerHTML=text;
	calque('cinfo_bulle').style.width=largeur;
	calque('cinfo_bulle').style.visibility='visible';
	*/	
}


function finpop() {
	
	bouger_info_bulle=0;
	calque('cinfo_bulle').style.visibility='hidden';
}
	


function pop_size(adresse,opts,largeur,hauteur,fenetre) {
	var etat_scroll=1;
	var status_=1;
	
	//largeur peut aussi recevoir une liste d'options
	var pos_top,pos_left;
	pos_left=Math.floor((screen.width/2)-(largeur/2))-25;
	pos_top=Math.floor((screen.height/2)-(hauteur/2))-55;
	
	var tab_opts=opts.split('-');
	for (var i=0;i<tab_opts.length;i++) {
		if (tab_opts[i]=='full-no_scroll') etat_scroll=0;
		if (tab_opts[i]=='full' || tab_opts[i]=='fullscreen') {
			largeur=screen.width-40;
			hauteur=screen.height-100;
			pos_left=0;
			pos_top=0;
			etat_scroll=1;
			
		}
		if (tab_opts[i]=='status') status_=1;
	}
	
	
	
	if (!fenetre) fenetre="pop";	
	var qsd=window.open(adresse,fenetre,"toolbar=0,status="+status_+",location=0,directories=0,menuBar=0,scrollbars="+etat_scroll+",resizable=1,width="+(largeur+25)+",height="+(hauteur+25)+",left="+pos_left+",top="+pos_top);
	
	qsd.focus();
	//centrer fenetre	
	return qsd;
}

function fullscreen(adresse) {
	var res=window.open(adresse,"full","fullscreen=1");
	res.focus();
	return res;
}


//Formulaires
function only_num(lettre) {
	
	if ((lettre>95 && lettre<106) || (lettre>32 && lettre<58) || lettre<32 || lettre==190 || lettre==110) {
		return true;
	}
	else {
		return false;
	}
}

function anti_entree(lettre,message) {
	if (lettre==13) {
		alert(message);
		return false;
	}
	else {	
		return true;
	}
}



function copie_interdite(message) {
	alert(message);
	return false;
}

	
function verif_drag() {
	
	return false;	
	
	
}
	
	


//Divers

function slashes(txt) {

	txt=txt.replace(/\'/,"\\'");	
	return (txt);
	
}

//detection_navigateur();


function annuler_erreur() {
	//return true;	
}

function ligne_calque(icone,contenu,commande,_select,actif,description,rep_icones) {
	if (!rep_icones) rep_icones="imgs/icones_rte";

	if (actif==undefined) actif=1;

	//temp_onmouseover="if (bb["+iii+"].actif) {sav_bouton_style["+iii+"]=this.style.cssText;this.style.backgroundColor='#FFE79D';this.style.border='1 solid orange'}";
	//temp_onmouseout="if (bb["+iii+"].actif) this.style.cssText=sav_bouton_style["+iii+"];";
	var couleur_fond_icone,couleur_fond_txt,couleur_bordure_icone,couleur_bordure_txt,color;	
	
	if (!_select) {		
		couleur_fond_icone='#EFEDDE';
		couleur_fond_txt='#FFFFFF';
		couleur_bordure_icone='#EFEDDE';
		couleur_bordure_txt='#FFFFFF';
	}
	else {
		couleur_fond_icone='#E1E6E8';
		couleur_fond_txt='#E1E6E8';
		couleur_bordure_icone='#316AC5';
		couleur_bordure_txt='#316AC5';
	}

	var retour;


	retour="<tr height=20 onfocus='return false;' onmousedown=\"if (this.children(0).children(0)) this.children(0).children(0).style.margin='1 0 0 1';"+commande+"\" ";
	if (description) retour+="title=\""+description+"\" ";
	if (!actif) {
		icone='';
		color="#999999";
	}
	else {
		color="#000000";
		retour+="onmouseup=\"if (this.children(0).children.length) this.children(0).children(0).style.margin='0 0 0 0';\" ";
		retour+="onmouseover=\"this.children(0).style.borderColor='orange';this.children(1).style.borderColor='orange';this.children(0).style.backgroundColor='#FFE79D';this.children(1).style.backgroundColor='#FFE79D';if (this.children(0).children.length) this.children(0).children(0).style.margin='-1 0 0 -1';\" ";
		retour+="onmouseout=\"this.children(0).style.backgroundColor='"+couleur_fond_icone+"';this.children(1).style.backgroundColor='"+couleur_fond_txt+"';this.children(0).style.borderColor='"+couleur_bordure_icone+"';this.children(1).style.borderColor='"+couleur_bordure_txt+"';if (this.children(0).children(0)) this.children(0).children(0).style.margin='0 0 0 0';\"";
	}

	retour+="><td unselectable=on style='text-align:center;vertical-align:center;width:24;background-color:"+couleur_fond_icone+";border-width=1 0 1 1;border-color:"+couleur_bordure_icone+";border-style:solid;cursor:default;'>";
	if (icone) icone="<img unselectable=on src='"+rep_icones+"/"+icone+"' width=16 height=16 onmousedown='this.style.marginLeft=1;this.style.marginTop=2;' onmouseup='this.style.marginLeft=0;this.style.marginTop=0;'>";

	retour+=(icone)? icone : "&nbsp;";

	retour+="</td><td unselectable=on style='padding:4;background-color:"+couleur_fond_txt+";border-width=1 1 1 0;border-color:"+couleur_bordure_txt+";border-style:solid;cursor:default;color:"+color+"'>"+contenu+"</td></tr>";

	return retour;
}
function ligne_separation() {
	var couleur_fond_icone='#EFEDDE';

	return "<tr><td unselectable=on style='background-color:"+couleur_fond_icone+";height:5;'></td><td unselectable=on style='cursor:default;height:5;font-size:5;text-align:right'>   -------------------------------------------------</td></tr>";

}
function generer_calque_proprietes(txt,titre,padding) {
	if (txt); {
		var txt_titre='';
		if (!padding) padding=0;
		if (titre) txt_titre="<tr><td colspan=2 style='background-color:#888888;color:#ffffff;font-weight:bold;padding:4'><img onmousedown='fermer_calque()' src='imgs/icones_rte/fermer.gif' width=13 height=13 title='Fermer' align=right>"+titre+"</td></tr>";
		return "<table id=tbl_calque cellpadding="+padding+" cellspacing=0 style='background-color:#ffffff'>"+txt_titre+txt+"</table>";
	}
}

function affich_calque(txt,titre,posx,posy) {
	//alert('x :'+posx+' --- y'+posy);
	var decalage_x=-30;
	var decalage_y=12;
		
	if (affich_calque_fenetre) {
		contenu_calque_propriete=txt;
		titre_calque_propriete=titre;
		modal_rte('calque_proprietes_modal',500,400,window);
	}
	else {
		//tab_calque_propriete[num_calque]=1;
		var ref_calque=calque("propriete_calque_");
		if (ref_calque) {		
			
			if (!posx) posx=parseInt(document.body.scrollLeft)+parseInt(event.x)+decalage_x;
			if (!posy) posy=parseInt(document.body.scrollTop)+parseInt(event.y)+decalage_y;
			
			
			if (posx) ref_calque.style.left=posx;
			if (posy) ref_calque.style.top=posy;
			ref_calque.style.visibility='visible';
			ref_calque.innerHTML=txt;

			if (calque("propriete_calque_").offsetTop+calque("propriete_calque_").offsetHeight>document.body.offsetHeight+parseInt(document.body.scrollTop)) calque("propriete_calque_").style.top=document.body.offsetHeight-calque("propriete_calque_").offsetHeight-10+parseInt(document.body.scrollTop);
			
			if (calque("propriete_calque_").offsetLeft+calque("propriete_calque_").offsetWidth>document.body.offsetWidth) calque("propriete_calque_").style.left=document.body.offsetWidth-calque("propriete_calque_").offsetWidth-10;
		}
	}
}


function creation_calque_proprietes () {

	var ac=document.createElement("DIV");
	ac.style.cssText='position:absolute;visibility:hidden;z-index:8;border:3 outset';
	ac.id="propriete_calque_";
	//ac.innerHTML="<table style='background-color:#ffffff;border-style:outset;border-width:3;font-size:13;font-family:tahoma' cellpadding=3 cellspacing=0'><tr><td style='text-align:center;font-weight:bold;color:#ffffff;background-color:#aaaaaa'><img onclick='fermer_calque()' src='imgs/icones_rte/fermer.gif' width=13 height=13 title='Fermer' align=right>"+titre+"</td></tr>"+txt+"</table></div>";

	document.body.insertBefore(ac);

}

function fermer_calque() {

	calque("propriete_calque_").style.visibility='hidden';

	/*
	for (var i=0;i<bb.length;i++) {
		if (tab_calque_propriete[i]) {

			tab_calque_propriete[i]=0;
			var bn=calque("propriete_calque_"+i);
			if (bn) bn.style.visibility='hidden';
		}

	}
	*/
	//tab_menu_ouvert=-1;
}

function fichier_inclus_commande(id_,commande) {
	var tf=plug_in_fichier[id_];
	
	
	if (commande=='play') {		
		if (tf=='quicktime') calque('fichier_inclus_'+id_).Play();
		else if (tf=='real') calque('fichier_inclus_'+id_).DoPlay();
		else if (tf=='mediaplayer') calque('fichier_inclus_'+id_).controls.play();		
	}
	else if (commande='stop') {
		if (tf=='quicktime') calque('fichier_inclus_'+id_).stop();
		else if (tf=='real') calque('fichier_inclus_'+id_).DoStop();
		else if (tf=='mediaplayer') calque('fichier_inclus_'+id_).controls.stop();
	}
	else if (commande='volume_plus') {
		
		if (tf=='quicktime') calque('fichier_inclus_'+id_).SetVolume();
		else if (tf=='real') calque('fichier_inclus_'+id_).SetVolume(80);
		else if (tf=='mediaplayer') calque('fichier_inclus_'+id_).controls.stop();
	}
	else if (commande='volume_moins') {
		if (tf=='quicktime') calque('fichier_inclus_'+id_).stop();
		else if (tf=='real') calque('fichier_inclus_'+id_).SetVolume(80);
		else if (tf=='mediaplayer') calque('fichier_inclus_'+id_).controls.stop();
	}
}


function inserer_date(champ,annee,mois,jour) {	
	if (!annee) {
		var now=new Date();
		
		jour = now.getDate();
		mois = now.getMonth();
		annee = now.getFullYear();
	}
	mois++;
	if (mois<10) mois='0'+mois;
	if (jour<10) jour='0'+jour;
	eval("var obj_champ=document.p."+champ);
	obj_champ.value=jour+'/'+mois+'/'+annee;
	
	//fermer calque fenetre
	calque('calque_'+champ).innerHTML='';
}

function calendar(champ,chaine,year,month,day) {
	//If no parameter is passed use the current date.
	
	var now;
	if (chaine) {
		
		var ss;
		var model=/([0-9]+)[\-\/]([0-9]+)[\-\/]([0-9]+)/;	
		if (ss=model.exec(chaine)) {
				
			year=ss[3];
			month=(ss[2]-1);
			day=ss[1];
		}
		
	}
	
	if (!year || !day) now = new Date();
	else now = new Date(year,month,day);
	
	day = now.getDate();
	month = now.getMonth();
	year = now.getFullYear();
	
	months = new Array('Janvier',
	   'Février',
	   'Mars',
	   'Avril',
	   'Mai',
	   'Juin',
	   'Juillet',
	   'Aout',
	   'Septembre',
	   'Octobre',
	   'Novembre',
	   'Décembre');
	
	this_month = new Date(year, month, 1);
	next_month = new Date(year, month + 1, 1);
	
	//Find out when this month starts and ends.         
	first_week_day = this_month.getDay();
	days_in_this_month = Math.round((next_month.getTime() - this_month.getTime()) / (1000 * 60 * 60 * 24));
	
	calendar_html = '<table class="background_clair2" style="font-size:11px;font-family:verdana;cursor:default;border:solid 1px black;">';
	
	calendar_html += "<tr class='gras couleur_fond background_fonce'><td title='Mois précédent' style='cursor:hand' onclick=\"calendar('"+champ+"',0,"+year+", "+(month-1)+", "+day+")\">&lt;</td><td colspan='5' align='center'>" + 
	months[month] + " " + year + "</td><td align=right title='Mois suivant' style='cursor:hand' onclick=\"calendar('"+champ+"',0,"+year+", "+(month+1)+", "+day+")\">&gt;</td></tr>";
	
	calendar_html += "<tr style='border-bottom:solid 1px;text-align:center;'><td>L</td><td>M</td><td>M</td><td>J</td><td>V</td><td>S</td><td>D</td></tr><tr style='text-align:center'>";
	
	
	//Fill the first week of the month with the appropriate number of blanks.       
	for(week_day = 0; week_day < first_week_day; week_day++){
		calendar_html += '<td style="cursor:default;" class="couleur_texte background_ombre"> </td>';   
	}
	
	week_day = first_week_day;
	for(day_counter = 1; day_counter <= days_in_this_month; day_counter++)	{
		week_day %= 7;
	
		if(week_day == 0) calendar_html += "</tr><tr style='text-align:center'>";
		
		//Do something different for the current day.
		if(day == day_counter)   calendar_html += '<td align="center" class="couleur_flash"><b>' + day_counter + '</b></td>';
		
		else	calendar_html += "<td align='center' onmouseover=\"this.style.color='#ff0000'\" onmouseout=\"this.style.color='#000000'\" style='width:16px;height:16px;background-color:#dddddd; color:#000000;cursor:hand' onclick=\"inserer_date('"+champ+"',"+year+", "+month+", "+day_counter+")\"> "+day_counter + "</td>";
		
		week_day++;
	}
	
	calendar_html += '</tr>';
	calendar_html += "<tr><td colspan=7 align=center><a title='Insérer la date du jour' href=\"javascript:voird(inserer_date('"+champ+"'))\">Aujourd'hui</a></tr>";
	calendar_html += '</table>';
	
	//Display the calendar.     
	calque('calque_'+champ).innerHTML=calendar_html;
}

function scrolling_calque(id,pas,monter) {
	
	if (fin_scrolling==id) return;
	
	if (!pas) pas=1;
	if (!monter) monter=0;
	
	var st=calque(id).scrollTop;
		
	if (monter) {
		st = st - pas;
		if (st > -1) {
			calque(id).scrollTop=st;
			setTimeout("scrolling_calque('"+id+"',"+pas+","+monter+")", 25);			
		}
		else	calque(id).scrollTop = 0;
	}
	else {
		st = st + pas;
		var haut=parseInt(calque(id).scrollHeight);
		
		
		if (st < haut) {
			calque(id).scrollTop=st;
			if (calque(id).scrollTop==st) setTimeout("scrolling_calque('"+id+"',"+pas+","+monter+")", 15);
		}
		else	{			
			calque(id).scrollTop = haut;
		}
	}	
	
}

/**
 * SWFObject v1.4.4: Flash Player detection and embed - http://blog.deconcept.com/swfobject/ 
 */
if(typeof deconcept == "undefined") var deconcept = new Object();
if(typeof deconcept.util == "undefined") deconcept.util = new Object();
if(typeof deconcept.SWFObjectUtil == "undefined") deconcept.SWFObjectUtil = new Object();
deconcept.SWFObject = function(swf, id, w, h, ver, c, useExpressInstall, quality, xiRedirectUrl, redirectUrl, detectKey){
	if (!document.getElementById) { return; }
	this.DETECT_KEY = detectKey ? detectKey : 'detectflash';
	this.skipDetect = deconcept.util.getRequestParameter(this.DETECT_KEY);
	this.params = new Object();
	this.variables = new Object();
	this.attributes = new Array();
	if(swf) { this.setAttribute('swf', swf); }
	if(id) { this.setAttribute('id', id); }
	if(w) { this.setAttribute('width', w); }
	if(h) { this.setAttribute('height', h); }
	if(ver) { this.setAttribute('version', new deconcept.PlayerVersion(ver.toString().split("."))); }
	this.installedVer = deconcept.SWFObjectUtil.getPlayerVersion();
	if(c) { this.addParam('bgcolor', c); }
	var q = quality ? quality : 'high';
	this.addParam('quality', q);
	this.setAttribute('useExpressInstall', useExpressInstall);
	this.setAttribute('doExpressInstall', false);
	var xir = (xiRedirectUrl) ? xiRedirectUrl : window.location;
	this.setAttribute('xiRedirectUrl', xir);
	this.setAttribute('redirectUrl', '');
	if(redirectUrl) { this.setAttribute('redirectUrl', redirectUrl); }
}
deconcept.SWFObject.prototype = {
	setAttribute: function(name, value){
		this.attributes[name] = value;
	},
	getAttribute: function(name){
		return this.attributes[name];
	},
	addParam: function(name, value){
		this.params[name] = value;
	},
	getParams: function(){
		return this.params;
	},
	addVariable: function(name, value){
		this.variables[name] = value;
	},
	getVariable: function(name){
		return this.variables[name];
	},
	getVariables: function(){
		return this.variables;
	},
	getVariablePairs: function(){
		var variablePairs = new Array();
		var key;
		var variables = this.getVariables();
		for(key in variables){
			variablePairs.push(key +"="+ variables[key]);
		}
		return variablePairs;
	},
	getSWFHTML: function() {
		var swfNode = "";
			
		if (navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length) { // netscape plugin architecture
			if (this.getAttribute("doExpressInstall")) { this.addVariable("MMplayerType", "PlugIn"); }
			
			swfNode = '<embed type="application/x-shockwave-flash" src="'+ this.getAttribute('swf') +'" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'"';
			swfNode += ' id="'+ this.getAttribute('id') +'" name="'+ this.getAttribute('id') +'" ';
			var params = this.getParams();
			 for(var key in params){ swfNode += [key] +'="'+ params[key] +'" '; }
			var pairs = this.getVariablePairs().join("&");
			
			 if (pairs.length > 0){ swfNode += 'flashvars="'+ pairs +'"'; }
			swfNode += '/>';
			
			
			
		} else { // PC IE
			if (this.getAttribute("doExpressInstall")) { this.addVariable("MMplayerType", "ActiveX"); }
			swfNode = '<object id="'+ this.getAttribute('id') +'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'">';
			swfNode += '<param name="movie" value="'+ this.getAttribute('swf') +'" />';
			var params = this.getParams();
			for(var key in params) {
			 swfNode += '<param name="'+ key +'" value="'+ params[key] +'" />';
			}
			var pairs = this.getVariablePairs().join("&");
			if(pairs.length > 0) {swfNode += '<param name="flashvars" value="'+ pairs +'" />';}
			swfNode += "</object>";
		}
		return swfNode;
	},
	write: function(elementId){
		if(this.getAttribute('useExpressInstall')) {
			// check to see if we need to do an express install
			var expressInstallReqVer = new deconcept.PlayerVersion([6,0,65]);
			if (this.installedVer.versionIsValid(expressInstallReqVer) && !this.installedVer.versionIsValid(this.getAttribute('version'))) {
				this.setAttribute('doExpressInstall', true);
				this.addVariable("MMredirectURL", escape(this.getAttribute('xiRedirectUrl')));
				document.title = document.title.slice(0, 47) + " - Flash Player Installation";
				this.addVariable("MMdoctitle", document.title);
			}
		}
		if(this.skipDetect || this.getAttribute('doExpressInstall') || this.installedVer.versionIsValid(this.getAttribute('version'))){
			var n = (typeof elementId == 'string') ? document.getElementById(elementId) : elementId;
			n.innerHTML = this.getSWFHTML();
			return true;
		}else{
			if(this.getAttribute('redirectUrl') != "") {
				document.location.replace(this.getAttribute('redirectUrl'));
			}
		}
		return false;
	}
}

/* ---- detection functions ---- */
deconcept.SWFObjectUtil.getPlayerVersion = function(){
	var PlayerVersion = new deconcept.PlayerVersion([0,0,0]);
	if(navigator.plugins && navigator.mimeTypes.length){
		var x = navigator.plugins["Shockwave Flash"];
		if(x && x.description) {
			PlayerVersion = new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/, "").replace(/(\s+r|\s+b[0-9]+)/, ".").split("."));
		}
	}else{
		// do minor version lookup in IE, but avoid fp6 crashing issues
		// see http://blog.deconcept.com/2006/01/11/getvariable-setvariable-crash-internet-explorer-flash-6/
		try{
			var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
		}catch(e){
			try {
				var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
				PlayerVersion = new deconcept.PlayerVersion([6,0,21]);
				axo.AllowScriptAccess = "always"; // throws if player version < 6.0.47 (thanks to Michael Williams @ Adobe for this code)
			} catch(e) {
				if (PlayerVersion.major == 6) {
					return PlayerVersion;
				}
			}
			try {
				axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
			} catch(e) {}
		}
		if (axo != null) {
			PlayerVersion = new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));
		}
	}
	return PlayerVersion;
}
deconcept.PlayerVersion = function(arrVersion){
	this.major = arrVersion[0] != null ? parseInt(arrVersion[0]) : 0;
	this.minor = arrVersion[1] != null ? parseInt(arrVersion[1]) : 0;
	this.rev = arrVersion[2] != null ? parseInt(arrVersion[2]) : 0;
}
deconcept.PlayerVersion.prototype.versionIsValid = function(fv){
	if(this.major < fv.major) return false;
	if(this.major > fv.major) return true;
	if(this.minor < fv.minor) return false;
	if(this.minor > fv.minor) return true;
	if(this.rev < fv.rev) return false;
	return true;
}
/* ---- get value of query string param ---- */
deconcept.util = {
	getRequestParameter: function(param) {
		var q = document.location.search || document.location.hash;
		if(q) {
			var pairs = q.substring(1).split("&");
			for (var i=0; i < pairs.length; i++) {
				if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) {
					return pairs[i].substring((pairs[i].indexOf("=")+1));
				}
			}
		}
		return "";
	}
}
/* fix for video streaming bug */
deconcept.SWFObjectUtil.cleanupSWFs = function() {
	if (window.opera || !document.all) return;
	var objects = document.getElementsByTagName("OBJECT");
	for (var i=0; i < objects.length; i++) {
		objects[i].style.display = 'none';
		for (var x in objects[i]) {
			if (typeof objects[i][x] == 'function') {
				objects[i][x] = function(){};
			}
		}
	}
}
// fixes bug in fp9 see http://blog.deconcept.com/2006/07/28/swfobject-143-released/
deconcept.SWFObjectUtil.prepUnload = function() {
	__flash_unloadHandler = function(){};
	__flash_savedUnloadHandler = function(){};
	if (typeof window.onunload == 'function') {
		var oldUnload = window.onunload;
		window.onunload = function() {
			deconcept.SWFObjectUtil.cleanupSWFs();
			oldUnload();
		}
	} else {
		window.onunload = deconcept.SWFObjectUtil.cleanupSWFs;
	}
}
if (typeof window.onbeforeunload == 'function') {
	var oldBeforeUnload = window.onbeforeunload;
	window.onbeforeunload = function() {
		deconcept.SWFObjectUtil.prepUnload();
		oldBeforeUnload();
	}
} else {
	window.onbeforeunload = deconcept.SWFObjectUtil.prepUnload;
}
/* add Array.push if needed (ie5) */
if (Array.prototype.push == null) { Array.prototype.push = function(item) { this[this.length] = item; return this.length; }}

/* add some aliases for ease of use/backwards compatibility */
var getQueryParamValue = deconcept.util.getRequestParameter;
var FlashObject = deconcept.SWFObject; // for legacy support
var SWFObject = deconcept.SWFObject;


function position_embed(id_obj,position) {
	var obj=calque(id_obj);	
	if (obj) {
		obj.DoStop();			
		obj.DoPlay();
		obj.SetPosition(position);	
	}	
}


window.onerror=annuler_erreur;

document.onmousemove = pos_souris;
document.onmouseup = mouseup;
document.ondrag= verif_drag;
document.write("<div id='cboite_dialogue' style='visibility:hidden;position:absolute;left:-800;top:40pw;z-index:15;'></div>");
document.write("<div id='cinfo_bulle' class='padding background_fond bordure_couleur_fonce bordure_simple' style='visibility:hidden;position:absolute;left:-800px;top:0;z-index:11'></div>");
document.write("<div id='propriete_calque_' style='position:absolute;visibility:hidden;z-index:8;border:3pw outset'></div>");