
/*
 * REQUETES AJAX
 */

function createRequestObject()
{
    var http;
    if(window.XMLHttpRequest)
    { // Mozilla, Safari, ...
        http = new XMLHttpRequest();
    }
    else if(window.ActiveXObject)
    { // Internet Explorer
        http = new ActiveXObject("Microsoft.XMLHTTP");
    }
    return http;
}

/*
 * outils pour la navigation
 */


function del(ID) 
{
	document.frm.hdAction.value = 'delete';
	document.frm.ID.value = ID;
	document.frm.submit();
}

function update(ID) 
{
	document.frm.hdAction.value = 'update';
	document.frm.ID.value = ID;
	document.frm.submit();
}

function disableButtons()
{
	if (document.frm.bt == '[object]')
	{
		document.frm.bt.disabled=true;
	}
}


function Sort(cimp)
{
	if (cimp==document.frm.hdOrderBy.value)
	{
		if (document.frm.hdSense.value=='asc')
		{
			document.frm.hdSense.value='desc';
		}
		else
		{
			document.frm.hdSense.value='asc';
		}
	}
	else
	{
		document.frm.hdSense.value='asc';
	}
	document.frm.hdOrderBy.value=cimp;
	document.frm.hdRowStart.value=1;
	document.frm.hdAction.value='sort';
	document.frm.submit();
}

// déclaration des variables

var docObj = (document.all) ? "document.all." : "document."; 
var OldColor ;
var OldBorderColor ;

//On appelle ceci dans l'évènement OnMouseOver()

function chgColor(rowNum,Color) { 
thisRow = eval(docObj + rowNum) ;
OldColor = thisRow.bgColor ;
OldBorderColor = thisRow.borderColor ;
thisRow.bgColor = "#" + Color ;
thisRow.borderColor = "#000000" ;
} 

function RetColor(rowNum) { 
thisRow = eval(docObj + rowNum) ;
thisRow.bgColor = OldColor ;
thisRow.borderColor = OldBorderColor ;
}

function rowNumber(row_number) 
{
	document.frm.rowNumber.value = row_number;
	document.frm.hdRowStart.value = 1;
	document.frm.submit();
}

function fjsGoRow(rind)
{
	document.frm.hdRowStart.value=rind;
	document.frm.hdAction.value='navig';
	document.frm.submit();
}


