
// Macromedia utilities

function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

function MM_findObj(n, d) { //v4.01
  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 && d.getElementById) x=d.getElementById(n); return x;
}

function MM_changeProp(objName,x,theProp,theValue) { //v6.0
  var obj = MM_findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
    if (theValue == true || theValue == false)
      eval("obj."+theProp+"="+theValue);
    else eval("obj."+theProp+"='"+theValue+"'");
  }
}

function MM_callJS(jsStr) { //v2.0
  return eval(jsStr)
}

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_nbGroup(event, grpName) { //v6.0
  var i,img,nbArr,args=MM_nbGroup.arguments;
  if (event == "init" && args.length > 2) {
    if ((img = MM_findObj(args[2])) != null && !img.MM_init) {
      img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src;
      if ((nbArr = document[grpName]) == null) nbArr = document[grpName] = new Array();
      nbArr[nbArr.length] = img;
      for (i=4; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
        if (!img.MM_up) img.MM_up = img.src;
        img.src = img.MM_dn = args[i+1];
        nbArr[nbArr.length] = img;
    } }
  } else if (event == "over") {
    document.MM_nbOver = nbArr = new Array();
    for (i=1; i < args.length-1; i+=3) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = (img.MM_dn && args[i+2]) ? args[i+2] : ((args[i+1])? args[i+1] : img.MM_up);
      nbArr[nbArr.length] = img;
    }
  } else if (event == "out" ) {
    for (i=0; i < document.MM_nbOver.length; i++) {
      img = document.MM_nbOver[i]; img.src = (img.MM_dn) ? img.MM_dn : img.MM_up; }
  } else if (event == "down") {
    nbArr = document[grpName];
    if (nbArr)
      for (i=0; i < nbArr.length; i++) { img=nbArr[i]; img.src = img.MM_up; img.MM_dn = 0; }
    document[grpName] = nbArr = new Array();
    for (i=2; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = img.MM_dn = (args[i+1])? args[i+1] : img.MM_up;
      nbArr[nbArr.length] = img;
  } }
}

// local utilities

// v 1.1
function showElement(whichElement)
{
	o = MM_findObj(whichElement);
	if (o) { /*alert('showing '+whichElement+' -> '+o.style.display);*/ o.style.display = "block"; } //else { alert('Trying to show non-existent object '+whichElement); }
}

function hideElement(whichElement) {
	o = MM_findObj(whichElement);
	if (o) { /*alert('hiding '+whichElement+' -> '+o.style.display); */o.style.display = "none"; } //else { alert('Trying to hide non-existent object '+whichElement); }
}



// v 1.0
var moving = undefined;

function moveto(url)
{
	if (url && (moving == undefined)) {
		moving = url;
		MM_goToURL('parent','file:///C|/WORK/proj/Sites/Site_FHF/htdocs/url');
	}

	return (false);
}



// v 1.1
function toggleElement(panel, openbtn, closebtn)
{
	if (MM_findObj(panel).style.display == "none") {
		expand(panel, openbtn, closebtn);
		return (true);
	} else {
		collapse(panel, openbtn, closebtn);
		return (false);
	}
}

function showHide(condition, panel)
{
	if (condition) { showElement(panel); } else { hideElement(panel); }
}

function expand(panel, openbtn, closebtn)
{
	showElement(panel);hideElement(openbtn);showElement(closebtn);
}

function collapse(panel, openbtn, closebtn)
{
	hideElement(panel);showElement(openbtn);hideElement(closebtn);
}

var overWho;


// v 1.0
function hilite_CellLine(whichObject)
{
	overWho = whichObject.className;
	whichObject.className = "FHFMouseOverTR";
}

function unhilite_CellLine(whichObject)
{
	whichObject.className = overWho;
}


// v 1.0
function synch_checkboxes(master, slave)
{
	if (MM_findObj(master).checked) {
		MM_changeProp(slave,'','checked',1);
		MM_changeProp(slave,'','disabled',1);
	} else {
		MM_changeProp(slave,'','disabled',0);
	}
}

// v 1.0
function get_innertext(ob_name)
{
	obj = MM_findObj(ob_name);
	if (obj.innerText) { return obj.innerText; }
	if (obj.textContent) { return obj.textContent; }
}

function set_innertext(ob_name, text)
{
	obj = MM_findObj(ob_name);
	if (obj) {
		if (obj.innerText != undefined) { obj.innerText = text; }
		if (obj.textContent != undefined) { obj.textContent = text; }
	} //else { alert('Trying to set text of non-existent object '+ob_name); }
}

function set_innerhtml(ob_name, text)
{
	obj = MM_findObj(ob_name);
	if (obj) {
		if (obj.innerHTML != undefined) { obj.innerHTML = text; }
		//if (obj.textContent != undefined) { obj.textContent = text; }
	} //else { alert('Trying to set text of non-existent object '+ob_name); }
}


// v 1.0
function getradiovalue(control)
{
	value = '';
	for(i = (control.length) - 1 ;i >= 0;i--) {
		el = control[i];
		if ((typeof(el) == 'object') && el.checked) { value = parseInt(i) + 1; }
	}
	return value;
}

function changeProp(objName,x,theProp,theValue) { 
  var obj = MM_findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
    if (theValue == '') {
		eval("obj."+theProp+"=''");
	} else if (theValue == true || theValue == false)
      eval("obj."+theProp+"="+theValue);
    else eval("obj."+theProp+"='"+theValue+"'");
  }
}

<!-- DEBUT DU SCRIPT -->

/*
SCRIPT EDITE SUR L'EDITEUR JAVACSRIPT
http://www.editeurjavascript.com
*/

function loadlink()
{
	domok = document.getElementById;
	if (domok)
		{
		skn = document.getElementById("topdecklink").style;
		if(navigator.appName.substring(0,3) == "Net")
			document.captureEvents(Event.MOUSEMOVE);
		document.onmousemove = get_mouse;
		}
}

function poplink(msg)
{
	if (msg) {
var content ="<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 BGCOLOR=#000000><TR><TD><TABLE WIDTH=100% BORDER=0 CELLPADDING=5 CELLSPACING=1><TR><TD BGCOLOR=#33CC00><FONT COLOR=White SIZE=2 face='Verdana'><CENTER>"+msg+"</CENTER></TD></TR></TABLE></TD></TR></TABLE>";

	if (domok)
		{
	  	document.getElementById("topdecklink").innerHTML = content;
	  	skn.visibility = "visible";
  		}
	}
}

function get_mouse(e)
{
	if (skn.visibility == "visible") {
		var x = (navigator.appName.substring(0,3) == "Net") ? e.pageX : event.x+document.body.scrollLeft;
		var y = (navigator.appName.substring(0,3) == "Net") ? e.pageY : event.y+document.body.scrollTop;
		if (x < 80) { x = 80; }
		skn.left = x - 60;
		skn.top = y + 20;
	}
}

function killlink()
	{
	if (domok)
  		skn.visibility = "hidden";
	}

<!-- FIN DU SCRIPT -->


function checkhour(s_field, t_field, value)
{
	var digits = new RegExp("[0-9]");
	var result = '';
	var input = s_field.value;
	var len = input.length;
	var h = '';
	
	for(x = 0; x < len; x++) {
		if (digits.test(input.charAt(x))) { result = result + input.charAt(x); }
	}
	
	len = result.length;
	
	if (len == 0) { h = '-'; }
	if (len == 1) { h = '0' + result + 'h 00 m'; }
	else if (len == 2) { 
		if (parseInt(result) > 12) { 
			m = result.substring(1);
			if (parseInt(m) < 6) {
				h = '0' + result.substring(0, 1) + 'h ' + m + '0 m';
			}
		}
		else { h = result + 'h 00 m'; }
	}
	else if (len == 3) { 
		if (parseInt(result.substring(0, 2)) > 12) {
			m = result.substring(1);
			if (parseInt(m) < 60) {
				h = '0' + result.substring(0, 1) + 'h ' + m + ' m';
			}
		}
	}
	else if (len == 4) {
			t = parseInt(result.substring(0, 2));
			m = parseInt(result.substring(2));
			if ((t < 24) && (m < 60)) { h = t + 'h ' + m + ' m'; }
	}
	
	if (h) {
		value = result;
		set_innertext(t_field, h);
	}
	s_field.value = value;
	
	return value;
}

function SetValue(objname, val)
{
		obj = MM_findObj(objname);
		if (obj) { obj.value = val; }
}

function switchImage(imgName, imgSrc) 
{
	img = MM_findObj(imgName);
	if (img) { img.src = '/images/' + imgSrc; }
}

// Example:
// simplePreload( '01.gif', '02.gif' ); 
function simplePreload()
{ 
  var args = simplePreload.arguments;
  document.imageArray = new Array(args.length);
  for(var i=0; i<args.length; i++)
  {
    document.imageArray[i] = new Image;
    document.imageArray[i].src = args[i];
  }
}



