function placeBalises(balise1, balise2, champ, texteDefaut)
{
	// Can a text range be created?
	if (typeof(champ.caretPos) != "undefined" && champ.createTextRange)
	{
		var caretPos = champ.caretPos, temp_length = caretPos.text.length;

		caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? balise1 + caretPos.text + balise2 + ' ' : balise1 + caretPos.text + balise2;

		if (temp_length == 0)
		{
			caretPos.moveStart("character", -balise2.length);
			caretPos.moveEnd("character", -balise2.length);
			caretPos.select();
		}
		else
			champ.focus(caretPos);
	}
	// Mozilla text range wrap.
	else if (typeof(champ.selectionStart) != "undefined")
	{
		var begin = champ.value.substr(0, champ.selectionStart);
		var selection = champ.value.substr(champ.selectionStart, champ.selectionEnd - champ.selectionStart);
		var end = champ.value.substr(champ.selectionEnd);
		var newCursorPos = champ.selectionStart;
		var scrollPos = champ.scrollTop;

		

		if (champ.setSelectionRange)
		{
			if (selection.length == 0)
			{
				champ.setSelectionRange(newCursorPos + balise1.length, newCursorPos + balise1.length);
				selection += texteDefaut;
			}
			else
				champ.setSelectionRange(newCursorPos, newCursorPos + balise1.length + selection.length + balise2.length);
			champ.focus();
		}
		
		champ.value = begin + balise1 + selection + balise2 + end;
		
		champ.scrollTop = scrollPos;
	}
	// Just put them on the end, then.
	else
	{
		champ.value += balise1 + balise2;
		champ.focus(champ.value.length - 1);
	}
}

