function popUpWindow(URLStr, left, top, width, height)
{
	popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}

function confirmation(action)
{
	input_box = confirm("Are you sure you want to " + action + " this item?");
	if (input_box == true) return true; 
	else return false;
}

function submitForm(form)
{
	form.submit();
}

function MM_jumpMenu(targ,selObj,restore)
{
	eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
	if (restore) selObj.selectedIndex = 0;
}

function visibilite(thingId)
{
	var targetElement;
	imgElement = document.getElementById('img'+thingId);
	divElement = document.getElementById('orgParent'+thingId) ;
	if (divElement.style.display == "none") divElement.style.display = "";
	else divElement.style.display = "none";
}

function selectAll(source)
{
	for(x=0; x < (source.length); x++) source.options[x].selected = "true";
	return true;
}

function getOffsetLeft (el)
{
	var ol = el.offsetLeft;
	while ((el = el.offsetParent) != null) ol += el.offsetLeft;
	return ol;
}

function getOffsetTop (el)
{
	var ot = el.offsetTop;
	while((el = el.offsetParent) != null) ot += el.offsetTop;
	return ot;
}

function open_calendar(item)
{
	var newWindow;
	var urlstring = 'pages/calendar/calendar.php?item=' + item;
	newWindow = window.open(urlstring,'newWin','height=200,width=280,toolbar=no,minimize=no,status=no,memubar=no,location=no,scrollbars=no');
	newWindow.parent = this;
	newWindow.focus();
}

/*function menu_bottom(etat)
{
	links_bottom = document.getElementById("bloc_links_bottom");
	if(etat == 1) links_bottom.style.display = "block";
	else links_bottom.style.display = "none";
}*/
/* menu javascript */
var timeout;
function menu_bottom(etat) {
	if(etat == 1)
		show_menu();
	else
		hide_with_delay();
}

function show_menu() {
	reset_hide_menu();
	document.getElementById("bloc_links_bottom").style.display = "block";
}

function hide_with_delay() {
	timeout = setTimeout('hide_menu()', 250);
}
function hide_menu() {
	document.getElementById("bloc_links_bottom").style.display = "none";
}

function reset_hide_menu() {
	clearTimeout(timeout);
}
