<!--ENTER SUR TEXTAREA-->
function ifEnter(field,event)
{
	var theCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
    if (theCode == 13)
    {
		document.forms[0].submit();
        return false;
    }
	else
		return true;
}
<!--ENTER SUR TEXTAREA-->


function setFocus(formName) { 
		/* Setting focus to the first 'focusable' element which is one with tabindex = 1 or the first in the form loaded. */
		focusableElementsListe = findFocusableElements(formName);
		
		if(focusableElementsListe.length > 0) {
			var firstEl = focusableElementsListe.find(function (el){
				return el.tabIndex == 1;
			}) || focusableElementsListe.first();
			currFocused = focusableElementsListe.toArray().indexOf(firstEl);
			firstEl.focus(); // Focus on first focusable element except close button
		} 
	}
	
function findFocusableElements(formName){ // Collect form elements or links from MB content
		$(formName).select('input:not([type~=hidden]), select, textarea, button, a[href]').invoke('addClassName', 'focusable');
		return $(formName).select('.focusable');
	}