function insertSmiley(smiley)
{
	var box = document.kommentarForm.kommentarBoxInnehall;
				
	// Kod för IE och nya Opera
	if(document.selection)
	{
		//Hämtar markeringen
		var tagSelection = document.selection.createRange().text;
								
		//Om det inte finns någon markering sätts markeringen till tagtext
		if(!tagSelection) 
		{ 
			tagSelection = smiley;
		}
								
		box.focus();
									
		//Skriver ut strängen till textarean
		document.selection.createRange().text = tagSelection;
	}
							
	// Kod för Mozilla och Opera
	else if(document.getSelection)
	{
		//Lagrar markering
		var startPos = box.selectionStart;
		var endPos = box.selectionEnd;
		var tagSelection = (box.value).substring(startPos, endPos);
								
		//Om det inte finns någon markering
		if(!tagSelection) 
		{ 
			tagSelection = smiley;
		}
								
		//Skriver ut strängen och övrig text till textarean
		box.value = box.value.substring(0, startPos) + smiley + box.value.substring(endPos, box.value.length);
							
		box.focus();
	}
							
	if (box.createTextRange) 
	{
		box.caretPos = document.selection.createRange().duplicate();
	}
							
	return;
}

//Hjälpfunktion

function help(section)
{
	imgWindow = window.open('help.asp?section=' + section ,'Hjälpfönster','width=450,height=400,marginheight=0,scrollbars=yes,resizable=yes,status=yes')
}