// Fonction de stockage des scripts à charger
FuncOL = new Array();
function StkFunc(Obj) {
	FuncOL[FuncOL.length] = Obj;
}
	
// Execution des scripts au chargement de la page

function cumul_onload(){	
	for(i=0; i<FuncOL.length; i++)
		{FuncOL[i]();}
}

function OpenWin(URL,width,height,nom)
{
	window.open(URL, nom ,"toolbar=no,location=no,status=no,menubar=no,scrollbars=no,width=" + width + ",height=" + height + ",resizable=no");
}

function OpenWin2(URL,width,height,nom)
{
	window.open(URL, nom,"toolbar=no,location=no,status=no,menubar=yes,scrollbars=yes,width=" + width + ",height=" + height + ",resizable=yes");
}

function popup_page(page,largeur,hauteur,options){
	var top=(screen.height-hauteur)/2;
	var left=(screen.width-largeur)/2;
	window.open(page,"","top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options+ ",resizable=yes");
}


/***********************************************
* Ajax Includes script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

//To include a page, invoke ajaxinclude("afile.htm") in the BODY of page
//Included file MUST be from the same domain as the page displaying it.

var rootdomain="http://"+window.location.hostname

function ajaxinclude(url) {
var page_request = false
if (window.XMLHttpRequest) // if Mozilla, Safari etc
page_request = new XMLHttpRequest()
else if (window.ActiveXObject){ // if IE
try {
page_request = new ActiveXObject("Msxml2.XMLHTTP")
} 
catch (e){
try{
page_request = new ActiveXObject("Microsoft.XMLHTTP")
}
catch (e){}
}
}
else
return false
page_request.open('GET', url, false) //get page synchronously 
page_request.send(null)
writecontent(page_request)
}

function writecontent(page_request){
if (window.location.href.indexOf("http")==-1 || page_request.status==200)
document.write(page_request.responseText)
}


/*
SCRIPT EDITE SUR L'EDITEUR JAVASCRIPT
http://www.editeurjavascript.com
*/
function ChangeUrl_onweb(formulaire)
	{
	if (formulaire.ListeUrl_page.selectedIndex != 0)
		{
		location.href = formulaire.ListeUrl_page.options[formulaire.ListeUrl_page.selectedIndex].value;
	 	}
	else 
		{
		//alert('Veuillez choisir une page.');
		}
	}


/**
 * Checks/unchecks all tables
 *
 * @param   string   the form name
 * @param   boolean  whether to check or to uncheck the element
 *
 * @return  boolean  always true
 */
function setCheckboxes(the_form, the_name, do_check)
{
    var elts      = document.forms[the_form].elements[the_name];
    var elts_cnt  = (typeof(elts.length) != 'undefined')
                  ? elts.length
                  : 0;

    if (elts_cnt) {
        for (var i = 0; i < elts_cnt; i++) {
            elts[i].checked = do_check;
        } // end for
    } else {
        elts.checked        = do_check;
    } // end if... else

    return true;
} // end of the 'setCheckboxes()' function
