function showUpdate(request)
{	
	showBoxUpdate(request.responseText);
}

function showBoxUpdate(sMessage, iElementId)
{
	if (iElementId != '')
	{
		var oOffset = Position.cumulativeOffset($(iElementId));
		$('boxInfosUpdate').style.left = (oOffset[0] - 160) + 'px';
		$('boxInfosUpdate').style.top = (oOffset[1] - 60) + 'px';
	}
	else
	{
		$('boxInfosUpdate').style.top = (100 + document.body.scrollTop) + 'px';
	}

	$('boxInfosUpdate').innerHTML = sMessage;
	Effect.Appear('boxInfosUpdate');
	new PeriodicalExecuter( function(pe) { Effect.Fade('boxInfosUpdate'); pe.stop(); }, 2);	
}

function hideBoxError()
{
	$('boxInfosError').hide();
}

function showBoxError(sMessage, sFormName)
{
	var boxError = $('boxInfosError');

	if (sFormName != '')
	{
		var oOffset = Position.cumulativeOffset($(sFormName));
		boxError.style.left = (oOffset[0] - 300) + 'px';
		boxError.style.top = (oOffset[1] - 300) + 'px';
	}

	boxError.innerHTML = sMessage;
	Effect.Appear('boxInfosError');
	new PeriodicalExecuter( function(pe) { Effect.Fade('boxInfosError'); pe.stop(); }, 5);	
}

function isNumeric(sText)
{
	if (sText == '' || sText == null)
	{
		return false;
	}
	
	var ValidChars = "0123456789.";
	var IsNumber=true;
	var Char;
 
	for (i = 0; i < sText.length && IsNumber == true; i++) 
	{ 
		Char = sText.charAt(i); 
		
		if (ValidChars.indexOf(Char) == -1) 
		{
			IsNumber = false;
       	}
	}
	
	return IsNumber;
}

function openPopup(pageUrl, popupName, popupWidth, popupHeight, showScrollbar) 
{
	var iWidth = popupWidth+30;
	var iHeight = popupHeight+70;
	var leftVal = (screen.width-iWidth)/2;
	var topVal = (screen.height-iHeight)/2;
	
	if (showScrollbar == true) 
	{
		newWindow = window.open(pageUrl, popupName, 'width='+iWidth+',height='+iHeight+',left='+leftVal+',top='+topVal+',scrollbars=yes');
	}
	else
	{
		newWindow = window.open(pageUrl, popupName, 'width='+iWidth+',height='+iHeight+',left='+leftVal+',top='+topVal+',scrollbars=no');
	}
	
	if (parseInt(navigator.appVersion) >= 4) 
	{ 
		newWindow.window.focus(); 
	}

	return false;
}

function startInProgress(sElementName)
{
	if (sElementName != '')
	{
		var oOffset = Position.cumulativeOffset($(sElementName));
		$('progress').style.left = (oOffset[0] - 100) + 'px';
		$('progress').style.top = (oOffset[1] - 100) + 'px';
	}

	$('progress').show();
}

function stopInProgress()
{
	$('progress').hide();
}

function activateFlashElements()
{
	theObjects = document.getElementsByTagName("object");
	
	for (var i = 0; i < theObjects.length; i++)
	{
		theObjects[i].outerHTML = theObjects[i].outerHTML;
	}
}