function checkformlogin(form)
{
cango=true;
var errDesc = "Formulaire incomplet";

    if (form.username.value.length==0){
   		cango = false;
    	errDesc += "\nVotre identifiant n'est pas renseigné";
    }
    if (form.password.value.length==0){
   		cango = false;
    	errDesc += "\nVotre mot de passe n'est pas renseigné";
    }
if (cango == false)
	alert( errDesc );
else ShowDiv();
return cango ;
}

function ShowDiv()
	{
    if (document.layers) 
		{
	 	document.pageLoadDiv.visibility='visible';
		}
    else 
		{
		document.all.pageLoadDiv.style.visibility='visible';
		}
     }

ss_marquee_width = "979px";
ss_marquee_height = "18px";
ss_marquee_speed = 1;
ss_marquee_pause_onhover = 1;

ss_marquee_speed = (document.all) ? ss_marquee_speed : Math.max(1, ss_marquee_speed-1);
var copyspeed = ss_marquee_speed;
var pausespeed = (ss_marquee_pause_onhover == 0) ? copyspeed : 0;
var actualwidth='';
var cross_marquee, ns_marquee;
var iedom = document.all || document.getElementById;
if (iedom) { document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100px;left:-29000px">'+marqueecontent+'<\/span>');}

var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth-14;}
    else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
  }
  size= myWidth;
  if (size<990) {margegche=0;
     }
  else {margegche=(size-980)/2-1;
     }


function populate() 
{
  if (iedom) {
    cross_marquee = document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee;
    cross_marquee.style.left = parseInt(ss_marquee_width)+8+"px";
    cross_marquee.innerHTML = marqueecontent;
    actualwidth = document.all ? temp.offsetWidth : document.getElementById("temp").offsetWidth;
  } else if (document.layers) {
    ns_marquee=document.ns_marquee.document.ns_marquee2;
    ns_marquee.left=parseInt(ss_marquee_width)+8;
    ns_marquee.document.write(marqueecontent);
    ns_marquee.document.close();
    actualwidth=ns_marquee.document.width;
  }
  lefttime = setInterval("scrollmarquee()",20);
}


function scrollmarquee()
{
  if (iedom) 
    {
    if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))      
      cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed+"px"
    else
	cross_marquee.style.left=parseInt(ss_marquee_width)+8+"px"
    }
  else if (document.layers)
    {
    if (ns_marquee.left>(actualwidth*(-1)+8))
	ns_marquee.left-=copyspeed
    else
	ns_marquee.left=parseInt(ss_marquee_width)+8
    }
}




if (iedom||document.layers)
{
with (document)
  {
  document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
  if (iedom)
	{
	write('<div style="position:absolute;left:'+margegche+'px;top:95px;width:'+ss_marquee_width+';height:'+ss_marquee_height+';overflow:hidden">')
	write('<div class="fond_agfi_clair" style="position:absolute;width:'+ss_marquee_width+';height:'+ss_marquee_height+';border:0px solid #0000ff;padding:3px;" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=ss_marquee_speed">')
//FF6300=couleurfond 
	write('<div id="iemarquee" style="position:absolute;left:'+margegche+'px;top:0px"><\/div>')
	write('<\/div></\div>')
	}
  else if (document.layers)
	{
	write('<ilayer width='+ss_marquee_width+' height='+ss_marquee_height+' name="ns_marquee" bgColor='+ss_marquee_color_bg+'>')
	write('<layer name="ns_marquee2" left=230 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=ss_marquee_speed"><\/layer>')
	write('<\/ilayer>')
	}
  document.write('<\/td><\/table>')
  }
}

function heure()
{
	var today = new Date()
	var today2 = new Date()
	today2.setTime(today-21600000);

	jour = new Array();
	jour[0]='Dimanche';jour[1]='Lundi';jour[2]='Mardi';jour[3]='Mercredi';jour[4]='Jeudi';jour[5]='Vendredi';jour[6]='Samedi';
	mois = new Array();
	mois[0]='Janvier';mois[1]='Février';mois[2]='Mars';mois[3]='Avril';mois[4]='Mai';mois[5]='Juin';mois[6]='Juillet';mois[7]='Août';mois[8]='Septembre';mois[9]='Octobre';mois[10]='Novembre';mois[11]='Décembre';
	var my_date= new Date();

	var year=my_date.getYear();
	var month=my_date.getMonth();
	var day=my_date.getDay();
	var date=my_date.getDate();

	var heure = today.getHours();
	var heure2=today2.getHours();
	if(heure<10)
	  heure="0"+heure
	if(heure2<10)
	  heure2="0"+heure2
	var minute = today.getMinutes()
	if(minute<10)
	  minute="0"+minute
	var seconde = today.getSeconds()
	if(seconde<10)
	  seconde="0"+seconde

	if (navigator.appName=="Netscape")
		{
		year%=100;
		if (year<10) {var show= jour[day]+" "+date+" "+mois[month]+" 200"+year; var show2= heure+":"+minute+":"+seconde; var show3= heure2+":"+minute+":"+seconde;}
		else 	{var show= jour[day]+" "+date+" "+mois[month]+" 20"+year; var show2= heure+":"+minute+":"+seconde; var show3= heure2+":"+minute+":"+seconde;}
		}
	else
		{
		var show= jour[day]+" "+date+" "+mois[month]+" "+year;
		var show2=heure+":"+minute+":"+seconde;
		var show3=heure2+":"+minute+":"+seconde;
		}
	document.date.date.value=show
	document.date.heure_Paris.value=show2;
	document.date.heure_Montreal.value=show3
	window.setTimeout("heure()",1000)
}


function popup(f,nom, w, h) {
   var top=0;
   var left=0;
   if (self.screen)
      left=(screen.width-(w+((screen.width*1)/100)));
   myWin = window.open(f, nom, 'resizable,screenX=0,screenY=0,scrollbars=no,menubar=no,top='+top+',left='+left +',width=' + w + ',height=' + h );
   myWin.focus();
}

function openpage(url) {
        window.open(url, 'Aide', 'width=550, height=700, toolbar=0, menubar=0, statusbar=0, resizable=1, scrollbars=1');
}

/**
 * This array is used to remember mark status of rows in browse mode
 */
var marked_row = new Array;


/**
 * Sets/unsets the pointer and marker in browse mode
 *
 * @param   object    the table row
 * @param   integer  the row number
 * @param   string    the action calling this script (over, out or click)
 * @param   string    the default background color
 * @param   string    the color to use for mouseover
 * @param   string    the color to use for marking a row
 *
 * @return  boolean  whether pointer is set or not
 */
function setPointer(theRow, theRowNum, theAction, theDefaultColor, thePointerColor, theMarkColor)
{
    var theCells = null;

    // 1. Pointer and mark feature are disabled or the browser can't get the
    //    row -> exits
    if ((thePointerColor == '' && theMarkColor == '')
        || typeof(theRow.style) == 'undefined') {
        return false;
    }

    // 1.1 Sets the mouse pointer to pointer on mouseover and back to normal otherwise.
    if (theAction == "over" || theAction == "click") {
        theRow.style.cursor='pointer';
    } else {
        theRow.style.cursor='normal';
    }

    // 2. Gets the current row and exits if the browser can't get it
    if (typeof(document.getElementsByTagName) != 'undefined') {
        theCells = theRow.getElementsByTagName('td');
    }
    else if (typeof(theRow.cells) != 'undefined') {
        theCells = theRow.cells;
    }
    else {
        return false;
    }

    // 3. Gets the current color...
    var rowCellsCnt  = theCells.length;
    var domDetect    = null;
    var currentColor = null;
    var newColor     = null;
    // 3.1 ... with DOM compatible browsers except Opera that does not return
    //         valid values with "getAttribute"
    if (typeof(window.opera) == 'undefined'
        && typeof(theCells[0].getAttribute) != 'undefined') {
        currentColor = theCells[0].getAttribute('bgcolor');
        domDetect    = true;
    }
    // 3.2 ... with other browsers
    else {
        currentColor = theCells[0].style.backgroundColor;
        domDetect    = false;
    } // end 3

    // 3.3 ... Opera changes colors set via HTML to rgb(r,g,b) format so fix it
    if (currentColor.indexOf("rgb") >= 0)
    {
        var rgbStr = currentColor.slice(currentColor.indexOf('(') + 1,
                                     currentColor.indexOf(')'));
        var rgbValues = rgbStr.split(",");
        currentColor = "#";
        var hexChars = "0123456789ABCDEF";
        for (var i = 0; i < 3; i++)
        {
            var v = rgbValues[i].valueOf();
            currentColor += hexChars.charAt(v/16) + hexChars.charAt(v%16);
        }
    }

    // 4. Defines the new color
    // 4.1 Current color is the default one
    if (currentColor == ''
        || currentColor.toLowerCase() == theDefaultColor.toLowerCase()) {
        if (theAction == 'over' && thePointerColor != '') {
            newColor              = thePointerColor;
        }
        else if (theAction == 'click' && theMarkColor != '') {
            newColor              = theMarkColor;
            marked_row[theRowNum] = true;
            // Garvin: deactivated onclick marking of the checkbox because it's also executed
            // when an action (like edit/delete) on a single item is performed. Then the checkbox
            // would get deactived, even though we need it activated. Maybe there is a way
            // to detect if the row was clicked, and not an item therein...
            // document.getElementById('id_rows_to_delete' + theRowNum).checked = true;
        }
    }
    // 4.1.2 Current color is the pointer one
    else if (currentColor.toLowerCase() == thePointerColor.toLowerCase()
             && (typeof(marked_row[theRowNum]) == 'undefined' || !marked_row[theRowNum])) {
        if (theAction == 'out') {
            newColor              = theDefaultColor;
        }
        else if (theAction == 'click' && theMarkColor != '') {
            newColor              = theMarkColor;
            marked_row[theRowNum] = true;
            // document.getElementById('id_rows_to_delete' + theRowNum).checked = true;
        }
    }
    // 4.1.3 Current color is the marker one
    else if (currentColor.toLowerCase() == theMarkColor.toLowerCase()) {
        if (theAction == 'click') {
            newColor              = (thePointerColor != '')
                                  ? thePointerColor
                                  : theDefaultColor;
            marked_row[theRowNum] = (typeof(marked_row[theRowNum]) == 'undefined' || !marked_row[theRowNum])
                                  ? true
                                  : null;
            // document.getElementById('id_rows_to_delete' + theRowNum).checked = false;
        }
    } // end 4

    // 5. Sets the new color...
    if (newColor) {
        var c = null;
        // 5.1 ... with DOM compatible browsers except Opera
        if (domDetect) {
            for (c = 0; c < rowCellsCnt; c++) {
                theCells[c].setAttribute('bgcolor', newColor, 0);
            } // end for
        }
        // 5.2 ... with other browsers
        else {
            for (c = 0; c < rowCellsCnt; c++) {
                theCells[c].style.backgroundColor = newColor;
            }
        }
    } // end 5

    return true;
} // end of the 'setPointer()' function
