function PopUpSize(url, name, width, height, scroll) {
 var properties;

 if (isNaN(scroll)) scroll=0;

 properties="width="+width+",height="+height;
 properties+=",left=100,top=100,directories=0,hotkeys=1,location=0,menubar=0";
 properties+=",resizable=1,scrollbars=" + scroll + ",status=0,titlebar=0,toolbar=0";
 window.open(url, name, properties);
 return;
}


function selectHasChanged(selectObject, divObject) {
	if (selectObject.value == '999')
	{
		divObject.style.display = 'block';
	} else {
		divObject.style.display = 'none';
	}
}


function getLeft(MyObject)
{
if (MyObject.offsetParent)
return (MyObject.offsetLeft + getLeft(MyObject.offsetParent));
else
return (MyObject.offsetLeft);
}
function getTop(MyObject)
{
if (MyObject.offsetParent) {
	return (MyObject.offsetTop + getTop(MyObject.offsetParent));
} else {
	return (MyObject.offsetTop);
}
}
//Permet de mettre un site en favoris
function bookmarksite(title, url){
if (document.all)
window.external.AddFavorite(url, title);
else if (window.sidebar)
window.sidebar.addPanel(title, url, "")
}

/***
This is the menu creation code - place it right after you body tag
Feel free to add this to a stand-alone js file and link it to your page.
**/


function getPositionByBrowser(left, top) {
	var ie = false;
	var ns = false;
	if (navigator.appName == "Netscape") {
		ns = true;
	} else if (navigator.appName == "Microsoft Internet Explorer") {
		ie = true;
	}
	
	if (ie) {
	   top = top + 5;
	   left = left+6;
	} else if (ns) {
	   //top = top ;
	   left = left-10;
	}
	
	return [left, top];
}

function placeElements() {
	
	//Calcul de la diff?ence
	menuBar = document.getElementById('MenuBar');
	
	left = getLeft(menuBar);
	//top = getTop(menuBar);
	diffX = left - oCMenu.fromLeft;
	//diffY = top - oCMenu.fromTop;	
	
	
	if (navigator.appName == "Microsoft Internet Explorer") {
		diffX = diffX + 5;
	}
	
	oCMenu.m["top0"].b.moveIt(oCMenu.m["top0"].b.x + diffX ,oCMenu.m["top0"].b.y)
	oCMenu.m["top1"].b.moveIt(oCMenu.m["top1"].b.x + diffX ,oCMenu.m["top1"].b.y)
	oCMenu.m["top2"].b.moveIt(oCMenu.m["top2"].b.x + diffX ,oCMenu.m["top2"].b.y)
	oCMenu.m["top3"].b.moveIt(oCMenu.m["top3"].b.x + diffX ,oCMenu.m["top3"].b.y)
	oCMenu.m["top4"].b.moveIt(oCMenu.m["top4"].b.x + diffX ,oCMenu.m["top4"].b.y)
	oCMenu.m["top5"].b.moveIt(oCMenu.m["top5"].b.x + diffX ,oCMenu.m["top5"].b.y)
	if (oCMenu.m["top6"]) {
		oCMenu.m["top6"].b.moveIt(oCMenu.m["top6"].b.x + diffX ,oCMenu.m["top6"].b.y)
	}	
	if (oCMenu.m["top7"]) {
		oCMenu.m["top7"].b.moveIt(oCMenu.m["top7"].b.x + diffX ,oCMenu.m["top7"].b.y)
	}
	
	oCMenu.fromLeft = left;
	oCMenu.fromTop = oCMenu.fromTop;
	
}

// ============================================================
// BEGIN Enable multiple onload functions

// setup onload functions this way:
// aOnloadFunctions[aOnloadFunctions.length] = function_name; // without brackets!

if (!window.aOnloadFunctions) {
  var aOnloadFunctions = new Array();
}

window.onload = function() {
  if (window.aOnloadFunctions) {
    for (var _i=0; _i<aOnloadFunctions.length; _i++) {
      aOnloadFunctions[_i]();
    }
  }
}

// END Enable multiple onload functions
// ============================================================
