
function smile_cek(forumadi,metin)
{
	var textarea = document.getElementById(forumadi).mesaj;

	if (document.getElementById(forumadi).selection)
	{
		textarea.focus();
		konum = document.getElementById(forumadi).selection.createRange();
		konum.text = ' ' + metin + ' '; 
	}

	else if (typeof(textarea.selectionStart) == 'number') 
	{
		var secili = (textarea.value).substring(textarea.selectionStart,textarea.selectionEnd);
		var bas = (textarea.value).substring(0,textarea.selectionStart);
		var son = (textarea.value).substring(textarea.selectionEnd,textarea.value.length);
		textarea.value = bas + ' ' + metin + ' ' + secili + son;
		textarea.selectionStart = (bas.length + metin.length + 2);
		textarea.selectionEnd = (bas.length + metin.length + 2);
	}
	
	else
	{
		metin = ' ' + metin + ' ';
		textarea.value += metin;
	}
	textarea.focus();
	return;
}





function BbCode(forumadi,BbAc, BbKapat, bilgi)
{
	if (document.getElementById(forumadi).mesaj_islem.checked == false)
		document.getElementById(forumadi).mesaj_islem.checked = true;
	
	var textarea = document.getElementById(forumadi).mesaj;

	if (document.selection)	// ie için
	{
		var metin = document.selection.createRange().text;

		if (metin)
		{
				document.selection.createRange().text = BbAc + metin + BbKapat;
		}

		else
		{
		
			textarea.value += bilgi;
		}
	}


	else if (typeof(textarea.selectionStart) == 'number') //	Mozilla için 
	{
		var metin = (textarea.value).substring(textarea.selectionStart,textarea.selectionEnd);
		if (metin)
		{
			var bas = (textarea.value).substring(0,textarea.selectionStart);
			var son = (textarea.value).substring(textarea.selectionEnd);
				textarea.value = bas + BbAc + metin + BbKapat + son;
		}

		else
		{
				textarea.value += bilgi;
		}
	}

	else
		textarea.value += bilgi;

	textarea.focus();
	return;

}



function boyutuzat(kb) {
tt = document.getElementById("yazialan");
if (kb < 0)
{ var satir = -5; }
else
{ var satir = 5; }
if (typeof tt.eskisatir == 'undefined')
{ tt.eskisatir = tt.rows; }
var yenisatir = tt.rows + satir;
if (yenisatir >= tt.eskisatir)
{ tt.rows = yenisatir; }
return false; }




