// Définition du navigateur par tests d'accès au layers
var nava = (document.layers);
var dom = (document.getElementById);
var iex = (document.all);

function openWindow(theURL,winName,features) {
  if (features == '') features='scrollbars=yes,resizable=yes,width=500,height=450';
  window.open(theURL,winName,features);
};

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function mefThis(from, elt, mef_start, mef_end) {
	strSelection = document.selection.createRange().text
	if (strSelection == "") {
		elt.focus()
		if (from == 2) elt.select()
		strSelection = document.selection.createRange().text
		document.selection.createRange().text = strSelection + mef_start + mef_end;
	}	
	else document.selection.createRange().text = mef_start + strSelection + mef_end;
	return;
}

function showMenu (evt) { 
  if (document.all) { 
    document.all.contextMenu.style.pixelLeft = event.clientX; 
    document.all.contextMenu.style.pixelTop = event.clientY; 
    document.all.contextMenu.style.visibility = 'visible'; 
    return false; 
  } 
  else if (document.layers) { 
    if (evt.which == 3) { 
      document.contextMenu.left = evt.x; 
      document.contextMenu.top = evt.y; 
      document.contextMenu.onmouseout = 
        function (evt) { this.visibility = 'hide'; }; 
      document.contextMenu.visibility = 'show'; 
      return false; 
    } 
  } 
  return true; 
} 

var txtCligTab = new Array(10);
var txtCligNb = 1;

function txtCligWrite(txt, color) {
	var HTML = "";
	var idCalque = "calque" + txtCligNb;
	var temp = "";
	
	HTML += '<SPAN ID="' + idCalque + '" STYLE="font-size:11px;font-weight:bold;visibility:visible"><font color="#' + color + '"><b>';
	HTML += txt + '</b></font></SPAN>';
	
	document.write(HTML);
	
	if (nava) {
		temp = 'thecalque = document.' + idCalque;
 	} else if (dom) {
		temp = 'thecalque = document.getElementById("' + idCalque + '").style';
	} else if (iex) {
		temp = 'thecalque = ' + idCalque + '.style';
	}
	
	txtCligTab[txtCligNb++] = temp;

}

function clignote() {
	for (i=1 ; i < txtCligNb ; i++) {
		eval(txtCligTab[i]);
		if (thecalque.visibility == 'hidden') {
			thecalque.visibility = 'visible';
		} else {
			thecalque.visibility = 'hidden';
		};
	};
}
window.setInterval("if (txtCligNb > 1) clignote()", 500);

