var inPlaceOpt = { externalControlOnly:true, okControl: 'img', okText: '/ico/silk/accept.png',
					cancelControl: 'img', cancelText: '/ico/silk/cross.png',
					 onComplete:inPlaceSuccess, onFailure:inPlaceFailure };

function setInPlace(host_, object_, id_, field_) {
	inPlaceOpt.externalControl = 'edit-'+object_+'-'+id_+'-'+field_;
	new Ajax.InPlaceEditor($(object_+'-'+id_+'-'+field_), host_+'/tajax/InPlaceEdit', inPlaceOpt);
}
function inPlaceSuccess() {
    echo("Les donn&eacute;es ont &eacute;t&eacute; correctement modifi&eacute;es.");
}
function inPlaceFailure() {
    $('echoBox').style.color = 'red';
    echo("Une erreur est survenue pendant l'enregistrement ; veuillez essayer &agrave; nouveau.");
}
function echo(msg_) {
	new Effect.Opacity('echoBox', { to:1, duration: 0.1 });
	$('echoBox').style.top = -65;
	$('echoBox').style.left = 0;
	$('echoBox').innerHTML = msg_;
	new Effect.Move('echoBox', { x: 0, y: 0, mode: 'absolute' });
	setTimeout(function() { $('echoBox').fade(); new Effect.Move('echoBox', { x: 0, y: -65, mode: 'absolute' }); }, 3000);
	$('echoBox').appear({ duration: 0.1 });
}

function sendMail(obj_) {
	window.location = 'mailto:'+$(obj_).innerHTML;
}