<!--
// Startup variables
var imageTag = false;
var theSelection = false;

// Check for Browser & Platform for PC & IE specific bits
// More details from: http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html
var clientPC = navigator.userAgent.toLowerCase(); // Get client info
var clientVer = parseInt(navigator.appVersion); // Get browser version

var is_ie = ((clientPC.indexOf("msie") != -1) && (clientPC.indexOf("opera") == -1));
var is_nav = ((clientPC.indexOf('mozilla')!=-1) && (clientPC.indexOf('spoofer')==-1)
                && (clientPC.indexOf('compatible') == -1) && (clientPC.indexOf('opera')==-1)
                && (clientPC.indexOf('webtv')==-1) && (clientPC.indexOf('hotjava')==-1));
var is_moz = 0;

var is_win = ((clientPC.indexOf("win")!=-1) || (clientPC.indexOf("16bit") != -1));
var is_mac = (clientPC.indexOf("mac")!=-1);

// Helpline messages
b_help = "Kalın yazı: [b]metin[/b]  (alt+b)";
i_help = "Italic yazı: [i]metin[/i]  (alt+i)";
u_help = "Altçizgili yazı: [u]metin[/u]  (alt+u)";
q_help = "Alıntı: [quote]metin[/quote]  (alt+q)";
p_help = "Resim koy: [img]http://adres[/img]  (alt+p)";
w_help = "URL koy: [url]http://url[/url] ya da [url=http://url]metin[/url]  (alt+w)";
a_help = "Açık tüm BBCode komutlarını sonlandırır.";
s_help = "Font rengi: [color=red]metin[/color]  Tiyo: color=#FF0000 diye de kullanılabilir";
f_help = "Font boyutu: [size=x-small]küçük font[/size]";
v_help = "Video Koy [embed]http://url[/embed]";

// Define the bbCode tags
bbcode = new Array();
bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[img]','[/img]', '[embed]', '[/embed]', '[url]','[/url]');
imageTag = false;

// Shows the help messages in the helpline window
function helpline(help) {
	document.post.helpbox.value = eval(help + "_help");
}


// Replacement for arrayname.length property
function getarraysize(thearray) {
	for (i = 0; i < thearray.length; i++) {
		if ((thearray[i] == "undefined") || (thearray[i] == "") || (thearray[i] == null))
			return i;
		}
	return thearray.length;
}

// Replacement for arrayname.push(value) not implemented in IE until version 5.5
// Appends element to the array
function arraypush(thearray,value) {
	thearray[ getarraysize(thearray) ] = value;
}

// Replacement for arrayname.pop() not implemented in IE until version 5.5
// Removes and returns the last element of an array
function arraypop(thearray) {
	thearraysize = getarraysize(thearray);
	retval = thearray[thearraysize - 1];
	delete thearray[thearraysize - 1];
	return retval;
}


function checkForm() {

	formErrors = false;

	if (document.post.username.value.length < 3) {
		formErrors = "Kullanıcı adı yazmalısınız";
	} else
	if (document.post.message.value.length < 2) {
		formErrors = "Boş bir mesaj gönderemezsiniz";
	}

	if (formErrors) {
		alert(formErrors);
		return false;
	} else {
		bbstyle(-1);
		//formObj.preview.disabled = true;
		//formObj.submit.disabled = true;
		return true;
	}
}


function checkFrmForm() {

	formErrors = false;

	if (document.post.message.value.length < 2) {
		formErrors = "Boş bir mesaj gönderemezsiniz";
	}

	if (formErrors) {
		alert(formErrors);
		return false;
	} else {
		bbstyle(-1);
		//formObj.preview.disabled = true;
		//formObj.submit.disabled = true;
		return true;
	}
}

function checkComment() {

	formErrors = false;
	if (document.post.message.value.length < 3) {	
		formErrors = "Bos bir yorum gönderemezsiniz";
	}

	if (formErrors) {
		alert(formErrors);
		return false;
	} else {
		bbstyle(-1);
		//formObj.preview.disabled = true;
		//formObj.submit.disabled = true;
		return true;
	}
}

function checkFrmSubjectForm() {
	formErrors = false;
	if (document.post.subject.value.length < 3) {
		formErrors = "Konu Girmeden Gönderemezsiniz";
	} else
	if (document.post.message.value.length < 2) {
		formErrors = "Boş bir mesaj gönderemezsiniz";
	} else
	if (document.post.poll_title.value.length > 0) {
		t = 0;
		if (document.post.hdnRowCount.value > 0 ) {
			for (i = 0 ; i < hdnRowCount.value; i++){
				var InputRow = document.getElementById('txt_' + i);
				if (InputRow.value.length > 0) {
					++t;
				}
				if (t == 3){
					break;
				}
			}
			if (t < 2) {
				formErrors = "En Az 2 Sik Girmelisiniz";
			}

	} else  formErrors = "Sik Girmelisiniz";
		
	} 
	if (formErrors) {
		alert(formErrors);
		return false;
	} else {
		bbstyle(-1);
		//formObj.preview.disabled = true;
		//formObj.submit.disabled = true;
		return true;
	}
}

/*
function emoticon(text) {
	var txtarea = document.post.message;
	text = ' ' + text + ' ';
	if (txtarea.createTextRange && txtarea.caretPos) {
		var caretPos = txtarea.caretPos;
		caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? caretPos.text + text + ' ' : caretPos.text + text;
		txtarea.focus();
	} else {
		txtarea.value  += text;
		txtarea.focus();
	}
}

*/

function bbfontstyle(bbopen, bbclose) {
	var txtarea = document.post.message;

	if ((clientVer >= 4) && is_ie && is_win) {
		theSelection = document.selection.createRange().text;
		if (!theSelection) {
			txtarea.value += bbopen + bbclose;
			txtarea.focus();
			return;
		}
		document.selection.createRange().text = bbopen + theSelection + bbclose;
		txtarea.focus();
		return;
	}
	else if (txtarea.selectionEnd && (txtarea.selectionEnd - txtarea.selectionStart > 0))
	{
		mozWrap(txtarea, bbopen, bbclose);
		return;
	}
	else
	{
		txtarea.value += bbopen + bbclose;
		txtarea.focus();
	}
	storeCaret(txtarea);
}


function bbstyle(bbnumber) {
	var txtarea = document.post.message;

	txtarea.focus();
	donotinsert = false;
	theSelection = false;
	bblast = 0;

	if (bbnumber == -1) { // Close all open tags & default button names
		while (bbcode[0]) {
			butnumber = arraypop(bbcode) - 1;
			txtarea.value += bbtags[butnumber + 1];
			buttext = eval('document.post.addbbcode' + butnumber + '.value');
			eval('document.post.addbbcode' + butnumber + '.value ="' + buttext.substr(0,(buttext.length - 1)) + '"');
		}
		imageTag = false; // All tags are closed including image tags :D
		txtarea.focus();
		return;
	}

	if ((clientVer >= 4) && is_ie && is_win)
	{
		theSelection = document.selection.createRange().text; // Get text selection
		if (theSelection) {
			// Add tags around selection
			document.selection.createRange().text = bbtags[bbnumber] + theSelection + bbtags[bbnumber+1];
			txtarea.focus();
			theSelection = '';
			return;
		}
	}
	else if (txtarea.selectionEnd && (txtarea.selectionEnd - txtarea.selectionStart > 0))
	{
		mozWrap(txtarea, bbtags[bbnumber], bbtags[bbnumber+1]);
		return;
	}

	// Find last occurance of an open tag the same as the one just clicked
	for (i = 0; i < bbcode.length; i++) {
		if (bbcode[i] == bbnumber+1) {
			bblast = i;
			donotinsert = true;
		}
	}

	if (donotinsert) {		// Close all open tags up to the one just clicked & default button names
		while (bbcode[bblast]) {
				butnumber = arraypop(bbcode) - 1;
				txtarea.value += bbtags[butnumber + 1];
				buttext = eval('document.post.addbbcode' + butnumber + '.value');
				eval('document.post.addbbcode' + butnumber + '.value ="' + buttext.substr(0,(buttext.length - 1)) + '"');
				imageTag = false;
			}
			txtarea.focus();
			return;
	} else { // Open tags

		if (imageTag && (bbnumber != 14)) {		// Close image tag before adding another
			txtarea.value += bbtags[15];
			lastValue = arraypop(bbcode) - 1;	// Remove the close image tag from the list
			document.post.addbbcode14.value = "Img";	// Return button back to normal state
			imageTag = false;
		}

		// Open tag
		txtarea.value += bbtags[bbnumber];
		if ((bbnumber == 14) && (imageTag == false)) imageTag = 1; // Check to stop additional tags after an unclosed image tag
		arraypush(bbcode,bbnumber+1);
		eval('document.post.addbbcode'+bbnumber+'.value += "*"');
		txtarea.focus();
		return;
	}
	storeCaret(txtarea);
}

// From http://www.massless.org/mozedit/
function mozWrap(txtarea, open, close)
{
	var selLength = txtarea.textLength;
	var selStart = txtarea.selectionStart;
	var selEnd = txtarea.selectionEnd;
	if (selEnd == 1 || selEnd == 2)
		selEnd = selLength;

	var s1 = (txtarea.value).substring(0,selStart);
	var s2 = (txtarea.value).substring(selStart, selEnd)
	var s3 = (txtarea.value).substring(selEnd, selLength);
	txtarea.value = s1 + open + s2 + close + s3;
	return;
}

// Insert at Claret position. Code from
// http://www.faqts.com/knowledge_base/view.phtml/aid/1052/fid/130
function storeCaret(textEl) {
	if (textEl.createTextRange) textEl.caretPos = document.selection.createRange().duplicate();
}

//-->
//huso
function checkBilgi(msg)
{
	
	if (msg == 'arkadas'){
		Boxy.alert("Hiç Arkadaşınız Yok !!!", function() { }, {title: "Uyarı"});
	}else if (msg == 'talep'){
		Boxy.alert("Hiç Talebiniz Yok !!!", function() { }, {title: "Uyarı"});
	}else if (msg == 'hoslanan'){
		Boxy.alert("Hoşlandım Listeniz Yok !!!", function() { }, {title: "Uyarı"});
	}else if (msg == 'visit'){
		Boxy.alert("Hiç Profilinizi Gezen Yok !!!", function() { }, {title: "Uyarı"});
	}else if (msg == 'prohibit'){
		Boxy.alert("Yasakli Listeniz Bos !!!", function() { }, {title: "Uyarı"});
	}else if (msg == 'yorumlar'){
		Boxy.alert("Yorumlar Listeniz Bos !!!", function() { }, {title: "Uyarı"});
	}else if (msg == 'profilkayit'){
		Boxy.alert("Profiliniz kaydedilmiştir !!!", function() { }, {title: "Uyarı"});		
	}else if (msg == 'sifredegisti'){
		Boxy.alert("Sifrenizin degisikligi tamamlandi !!!", function() { }, {title: "Uyarı"});		
	}else if (msg == 'resimbuyuk'){
		Boxy.alert("SSadece *.JPG formatında ve büyüklüğü 1 MB\'ı geçmeyen fotoğraf yükleyebilirsiniz !!!", function() { }, {title: "Uyarı"});		
	}else if (msg == 'resimkapasitesi'){
		Boxy.alert("Kapasiteniz dolu !!!", function() { }, {title: "Uyarı"});	
	}else if (msg == 'resimTipiUygunDegil'){
		Boxy.alert("Yüklemek istediginiz resmin formati uygun degil !!!", function() { }, {title: "Uyarı"});
	}
}

function checkCategory(){
	if (document.moveTasi.category.value > -1)
		return true;
	else {
		alert('Lütfen bir category seçin')
		return false;
	}
}

function checkSilinen(msg){
	alert(msg + ' adet kayıt silindi');
}

function new_light_row(the_element) {
	if (the_element.checked == true)
		the_element.parentNode.parentNode.className = 'rowNew'
	else
		the_element.parentNode.parentNode.className = 'rowOld'
}

function checkKaydedilen(msg){
	alert(msg + ' adet kayıt kaydedildi');
}

function rowKilit(){
var onay
	onay = confirm('Kilitleme Islemi Gerçeklessinmi!');
	if (onay == true)
		return true;
	else
		return false;
}

function rowKilitAc(){
var onay
	onay = confirm('Kilitli Kayit Kilidi Kaldirilsinmi!');
	if (onay == true)
		return true;
	else
		return false;
}

function rowTopikSil(){
var onay
	onay = confirm('Silme Islemi Gerçeklessinmi!');
	if (onay == true)
		return true;
	else
		return false;
}

function SilmeIslemi(kayitid){
var onay
	onay = confirm(kayitid + ' nolu Kayit Silinsinmi !');
	if (onay == true) 
		return true;
	else
		return false;
}

function select_switch(status)
{
	for (i = 0; i < document.checkcontrol.length; i++)
	{
		document.checkcontrol.elements[i].checked = status;
		if (status == true)
			document.checkcontrol.elements[i].parentNode.parentNode.className = 'rowNew'
		else
		if (status == false)
			document.checkcontrol.elements[i].parentNode.parentNode.className = 'rowOld'
	}
}


function ViewOnlineMenu()
{
	/*
	var StrArray = new Array();
	StrArray[0] = "TDOnlineMenu";
	StrArray[1] = "TDOnlineMenuBar";
	*/

	//	document.getElementById(StrArray[0]).style.display = 'none';
	//	document.getElementById(StrArray[1]).style.display = '';
	if (document.getElementById("TDOnlineMenu")) 
	{
		document.getElementById("TDOnlineMenu").innerHTML = "<img src='image/LEflatun.gif' border='0'>";
		MakeAjaxRequestGCG("online_menu_refresh.php", "SetOnline");
	}
}

/*
function SetOnline(sValue, sParams)
{
	if (sValue != "0")
	{		
		document.getElementById(sParams[1]).style.display = 'none';
		document.getElementById(sParams[0]).style.display = '';
		document.getElementById(sParams[0]).innerHTML = sValue;

	}
	else
		window.location="/login";
}
*/

function SetOnline(sValue)
{
	//	var StrArray = sParams.split(",");
	if (sValue != "0")
	{
		//	document.getElementById(StrArray[1]).style.display = 'none';
		//	document.getElementById(StrArray[0]).style.display = '';
		//	document.getElementById(StrArray[0]).innerHTML = sValue;
		document.getElementById("TDOnlineMenu").innerHTML = sValue;
	}
	else
		window.location="/login";
}


function IlKontrol(ThisValue)
{
	if (ThisValue == "0")
		document.getElementById("country").disabled=false;
	else 
	{		
		document.getElementById("country").selectedIndex = 1; 
		document.getElementById("country").disabled=true;	
	}
}

function EncodeUTF8(sString) 
{
    sString = sString.replace(/\r\n/g,"\n");
    var sUTFString = "";

    for (var i = 0; i < sString.length; i++) 
    {  
        var c = sString.charCodeAt(i);  
        if (c < 128) 
            sUTFString += String.fromCharCode(c);
        else if((c > 127) && (c < 2048)) 
        {  
            sUTFString += String.fromCharCode((c >> 6) | 192);  
            sUTFString += String.fromCharCode((c & 63) | 128);  
        }  
        else 
        {  
            sUTFString += String.fromCharCode((c >> 12) | 224);  
            sUTFString += String.fromCharCode(((c >> 6) & 63) | 128);  
            sUTFString += String.fromCharCode((c & 63) | 128);  
        }  
    }
    return escape(sUTFString);  
}

function DecodeUTF8(sUTFString) 
{
    sUTFString = unescape(sUTFString);
    
    var sString = "";  
    var i = 0;  
    var c = c1 = c2 = 0;  

    while ( i < sUTFString.length ) 
    {  
        c = sUTFString.charCodeAt(i);  
        if (c < 128) 
        {  
            sString += String.fromCharCode(c);  
            i++;  
        }  
        else if((c > 191) && (c < 224)) 
        {  
            c2 = sUTFString.charCodeAt(i+1);  
            sString += String.fromCharCode(((c & 31) << 6) | (c2 & 63));  
            i += 2;  
        }  
        else 
        {  
            c2 = sUTFString.charCodeAt(i+1);  
            c3 = sUTFString.charCodeAt(i+2);  
            sString += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));  
            i += 3;  
        }  
    }  
    return sString;
}

function str_replace(search, replace, subject) {
    // http://kevin.vanzonneveld.net
    // +   original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +   improved by: Gabriel Paderni
    // +   improved by: Philip Peterson
    // +   improved by: Simon Willison (http://simonwillison.net)
    // +    revised by: Jonas Raoni Soares Silva (http://www.jsfromhell.com)
    // +   bugfixed by: Anton Ongson
    // +      input by: Onno Marsman
    // +   improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +    tweaked by: Onno Marsman
    // *     example 1: str_replace(' ', '.', 'Kevin van Zonneveld');
    // *     returns 1: 'Kevin.van.Zonneveld'
    // *     example 2: str_replace(['{name}', 'l'], ['hello', 'm'], '{name}, lars');
    // *     returns 2: 'hemmo, mars'
 
    var f = search, r = replace, s = subject;
    var ra = r instanceof Array, sa = s instanceof Array, f = [].concat(f), r = [].concat(r), i = (s = [].concat(s)).length;
 
    while (j = 0, i--) {
        if (s[i]) {
            while (s[i] = s[i].split(f[j]).join(ra ? r[j] || "" : r[0]), ++j in f){};
        }
    };
 
    return sa ? s : s[0];
}

function nl2br (str, is_xhtml) {
 
    breakTag = '<br />';
    if (typeof is_xhtml != 'undefined' && !is_xhtml) {
        breakTag = '<br>';
    }
 
    return (str + '').replace(/([^>]?)\n/g, '$1'+ breakTag +'\n');
//	return (str + '').replace(/([^>]?)\n/g, '$1\n');
}

function ReplaceSatir(str)
{

	var ReplaceStr = str;
	var k=1;	


	for(var i = 0; i < k; ++i)
	{
		var count = strpos(ReplaceStr, '<br />');
		if (count > 0)
		{
			ReplaceStr = ReplaceStr.replace('<br />','');	
			++k;
		}
	}


	for(var i = 0; i < k; ++i)
	{	
		var countn = strpos(ReplaceStr, '\\n');
		if (countn > 0)
		{
			ReplaceStr = ReplaceStr.replace('\\n', '\n');
			++k;
		}
	}



	return ReplaceStr;	
}

function CreateSatir(str)
{

	var ReplaceStr = str;
	var k=1;	

	for(var i = 0; i < k; ++i)
	{
		var count = strpos(ReplaceStr, "\\n");
		if (count > 0)
		{
			
			ReplaceStr = ReplaceStr.replace("\\n", '<br />');	
			++k;
		}

	}
	return ReplaceStr;	
}


function substr_count( haystack, needle, offset, length ) {
    // http://kevin.vanzonneveld.net
    // +   original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +   bugfixed by: Onno Marsman
    // *     example 1: substr_count('Kevin van Zonneveld', 'e');
    // *     returns 1: 3
    // *     example 2: substr_count('Kevin van Zonneveld', 'K', 1);
    // *     returns 2: 0
    // *     example 3: substr_count('Kevin van Zonneveld', 'Z', 0, 10);
    // *     returns 3: false
 
    var pos = 0, cnt = 0;
 
    haystack += '';
    needle += '';
    if(isNaN(offset)) offset = 0;
    if(isNaN(length)) length = 0;
    offset--;
 
    while( (offset = haystack.indexOf(needle, offset+1)) != -1 ){
        if(length > 0 && (offset+needle.length) > length){
            return false;
        } else{
            cnt++;
        }
    }
 
    return cnt;
}

function CountTxt(str)
{
	var vStr = str;
	var ToplamCount = 0;
	
	vStr = CreateSatir(vStr);
	
	ToplamCount = substr_count(vStr, '<br />');
		 
	return ToplamCount;
	
}

function ReplaceBBCode(str)
{
	var Text = str;
	search = new Array(
			  /\[quote\]/,
			  /\[\/quote\]/,		  
			  /\[color=(.*?)\](.*?)\[\/color\]/,
			  /\[url\](http:\/\/.*?)\[\/url\]/,
			  /\[url\](.*?)\[\/url\]/,
			  /\[img\](.*?)\[\/img\]/,
			  /\[b](.*?)\[\/b\]/,
			  /\[i](.*?)\[\/i\]/,
			  /\[u](.*?)\[\/u\]/,
			  /\[s](.*?)\[\/s\]/,
  			  /\[size=(.*?)\](.*?)\[\/size\]/,
			  //Smiley Start
			  /\:no:/,
			  /\:kiss:/,
			  /\:beatdown:/,
			  /\:shh:/,
			  /\:smoke:/,
			  /\:xp:/,
			  /\:yes:/,
			  /\:execution:/,
			  /\:quote:/,
			  /\:think:/,
			  /\:suspicious:/,
			  /\:zzz:/, 
			  /\:bravo:/,
			  /\:coool:/,
			  /\:hehe:/,
			  /\:oley:/,
			  /\:lol:/,
			  /\:wink:/,
			  /\:=\(/,
			  /\;\)/,
			  /\:has:/,
			  /\:b\)/,
			  /\:oops:/,
			  /\:cry:/,
			  /\:evil:/,
			  /\:twisted:/,
			  /\:roll:/,
			  /\:\)/,
			  /\:D/,
			  /\:d/,
			  /\:\(/,
			  /\:o/,
			  /\:shock:/,
			  /\:s/,
			  /\:S/,
			  /\:8/,
			  /\:loli:/,
			  /\:x/,
			  /\:X/,
			  /\:p/,
			  /\:P/,
			  //yasaklar
			  /\sikeyim/,
			  /\siktir/,
			  /\orospu/,
			  /\yarrak/,
			  /\amcık/,
			  /\götüne/,
			  /\domalt/,
			  /\pezevenk/,
			  /\piç/,
			  /\\n/,
			  /\[embed\](.*?)\[\/embed\]/);

	replace = new Array(
			  "<blockquote style='background-color:#FFFFFF'><smallfont><b>Alıntı:</b><br>",
			  "<br></font></blockquote>",
			  "<font color=\"$1\">$2</font>",
			  "<a href=\"$1\" target=\"blank\">$1</a>",
			  "<a href=\"http:\/\/$1\" target=\"blank\">$1</a>",
			  "<img src=\"$1\" border=0>",
			  "<b>$1</b>",
			  "<i>$1</i>",
			  "<u>$1</u>",
  			  "<s>$1</s>",
			  "<span style=\"font-size:$1\">$2</span>",
  			  //Smiley Start
			  "<img src=\'image/smiles/icon_no.gif\'>",
			  "<img src=\'image/smiles/kiss.gif\'>",
			  "<img src=\'image/smiles/beatdown.gif\'>",
			  "<img src=\'image/smiles/shh.gif\'>",
			  "<img src=\'image/smiles/smoke.gif\'>",
			  "<img src=\'image/smiles/icon_xp.gif\'>",
			  "<img src=\'image/smiles/icon_yes.gif\'>",
			  "<img src=\'image/smiles/icon_execution.gif\'>",
			  "<img src=\'image/smiles/icon_quote.gif\'>",
			  "<img src=\'image/smiles/icon_think.gif\'>",
			  "<img src=\'image/smiles/icon_suspicious.gif\'>",
			  "<img src=\'image/smiles/icon_snooze.gif\'>",
			  "<img src=\'image/smiles/bravo.gif\'>",
			  "<img src=\'image/smiles/cool.gif\'>",
			  "<img src=\'image/smiles/feci.gif\'>",
			  "<img src=\'image/smiles/hop.gif\'>",
			  "<img src=\'image/smiles/icon_lol_new.gif\'>",
			  "<img src=\'image/smiles/icon_wink.gif\'>",
			  "<img src=\'image/smiles/iiih.gif\'>",
			  "<img src=\'image/smiles/wink.gif\'>",
			  "<img src=\'image/smiles/2c.gif\'>",
			  "<img src=\'image/smiles/clb.gif\'>",
			  "<img src=\'image/smiles/icon_redface.gif\'>",
			  "<img src=\'image/smiles/icon_cry.gif\'>",
			  "<img src=\'image/smiles/icon_evil.gif\'>",
			  "<img src=\'image/smiles/icon_twisted.gif\'>",
			  "<img src=\'image/smiles/icon_rolleyes.gif\'>",
			  "<img src=\'image/smiles/icon_smile.gif\'>",
			  "<img src=\'image/smiles/icon_biggrin.gif\'>",
			  "<img src=\'image/smiles/icon_biggrin.gif\'>",
			  "<img src=\'image/smiles/icon_sad.gif\'>",
			  "<img src=\'image/smiles/icon_surprised.gif\'>",
			  "<img src=\'image/smiles/icon_eek.gif\'>",
			  "<img src=\'image/smiles/icon_confused.gif\'>",
			  "<img src=\'image/smiles/icon_confused.gif\'>",
			  "<img src=\'image/smiles/icon_cool.gif\'>",
			  "<img src=\'image/smiles/icon_lol.gif\'>",
			  "<img src=\'image/smiles/icon_mad.gif\'>",
			  "<img src=\'image/smiles/icon_mad.gif\'>",
			  "<img src=\'image/smiles/icon_razz.gif\'>",
			  "<img src=\'image/smiles/icon_razz.gif\">",
			  //yasaklar
			  "s****",
			  "s****",
			  "o****",
			  "y****",
			  "a****",
			  "g****",
			  "d****",
			  "p****",
			  "p****",
			  "<br />",
  			  "<embed src=\"$1\" wmode=\"transparent\" bgcolor=\"#000000\" allowfullscreen=\"true\" scale=\"noScale\" width=\"400\" height=\"345\" type=\"application/x-shockwave-flash\"></embed>");	  		  

	var TxtCount = CountTxt(Text);

	for(var i = 0; i <= TxtCount; i++) {
		for (var k = 0; k < search.length; k++)
			 Text = Text.replace(search[k],replace[k]);
	}
	return Text;
}


function strpos ( f_haystack, f_needle, f_offset ){
    // http://kevin.vanzonneveld.net
    // +     original by: Martijn Wieringa
    // *         example 1: stripos('ABC', 'a');
    // *         returns 1: 0
 
    var haystack = f_haystack.toLowerCase();
    var needle = f_needle.toLowerCase();
    var index = 0;
 
    if(f_offset == undefined) {
        f_offset = 0;
    }
 
    if((index = haystack.indexOf(needle, f_offset)) > -1) {
        return index;
    }
 
    return false;
}

function substr( f_string, f_start, f_length ) {
    // http://kevin.vanzonneveld.net
    // +     original by: Martijn Wieringa
    // *         example 1: substr('abcdef', 0, -1);
    // *         returns 1: 'abcde'
 
    if(f_start < 0) {
        f_start += f_string.length;
    }
 
    if(f_length == undefined) {
        f_length = f_string.length;
    } else if(f_length < 0){
        f_length += f_string.length;
    } else {
        f_length += f_start;
    }
 
    if(f_length < f_start) {
        f_length = f_start;
    }
 
    return f_string.substring(f_start, f_length);
}

function trim( str, charlist ) {
    // http://kevin.vanzonneveld.net
    // +   original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +   improved by: mdsjack (http://www.mdsjack.bo.it)
    // +   improved by: Alexander Ermolaev (http://snippets.dzone.com/user/AlexanderErmolaev)
    // +      input by: Erkekjetter
    // +   improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +      input by: DxGx
    // +   improved by: Steven Levithan (http://blog.stevenlevithan.com)
    // +   improved by: Jack
    // *     example 1: trim('    Kevin van Zonneveld    ');
    // *     returns 1: 'Kevin van Zonneveld'
    // *     example 2: trim('Hello World', 'Hdle');
    // *     returns 2: 'o Wor'
 
    var whitespace, l = 0;
    
    if (!charlist) {
        whitespace = ' \n\r\t\f\x0b\xa0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000';
    } else {
        whitespace = charlist.replace(/([\[\]\(\)\.\?\/\*\{\}\+\$\^\:])/g, '\$1');
    }
    
    l = str.length;
    for (var i = 0; i < l; i++) {
        if (whitespace.indexOf(str.charAt(i)) === -1) {
            str = str.substring(i);
            break;
        }
    }
    
    l = str.length;
    for (i = l - 1; i >= 0; i--) {
        if (whitespace.indexOf(str.charAt(i)) === -1) {
            str = str.substring(0, i + 1);
            break;
        }
    }
    
    return whitespace.indexOf(str.charAt(0)) === -1 ? str : '';
}

function QuoteReplace(message)
{
//Husonet 14.10.2008
	
	var pos = strpos(message, '[/quote]');
	
	var messageStr = substr(message ,pos + 8, strlen(message)); 
	pos = strpos(message, '[/quote]');
	if (pos>0){
		message = substr(message ,pos + 8, strlen(message)); 
	}

	
	return message;
	 
}

function strlen (string) {
    // http://kevin.vanzonneveld.net
    // +   original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +   improved by: Sakimori
    // +      input by: Kirk Strobeck
    // +   improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +   bugfixed by: Onno Marsman
    // *     example 1: strlen('Kevin van Zonneveld');
    // *     returns 1: 19
 
    return (string+'').length;
}

function FrmResize(Alan)
{
	// Find the innerWidth and innerHeight of the window //
	if(parseInt(navigator.appVersion)>3)
	{
	 var winW = window.innerWidth - 17;
	 var winH = eval(document.body.scrollHeight);// - 1251;//496;
	 
	// var winH = 1450; // window.innerHeight - 17;
	 if (navigator.appName.indexOf("Microsoft")!=-1)
	 {
	  winW = document.body.offsetWidth - 21;
	  winH =  document.body.scrollHeight;
	  }
	 }
	 
	///////////////////////////////////////////////////////
	
	// Set the width and height of div_1 to match the windows innerWidth and innerHeight //
	document.getElementById(Alan).style.width = winW + "px";
	document.getElementById(Alan).style.height = winH + "px";
	
	///////////////////////////////////////////////////////////////////////////////////////
	
	// Find the width of div_2 and center it in the window //
	//var w = document.getElementById("dvFullScreenForum").style.width.length - 2;
	//document.getElementById("dvFullScreenForum").style.left = (winW - document.getElementById("dvFullScreenForum").style.width.substr(0,w))/2 + "px";
	////////////////////////////////////////////////////////	
}

function emoticon(text)
{

	if ((document.getElementById("txtMessage")) && (Boxy.get(document.getElementById("txtMessage")).isVisible()==true))
		var txtarea = document.getElementById("txtMessage");
	else
	if ((document.getElementById("txtMessageForum")) && (Boxy.get(document.getElementById("txtMessageForum")).isVisible()==true))
		var txtarea = document.getElementById("txtMessageForum")
	else
	if ((document.getElementById("txtMessageNews")) && (Boxy.get(document.getElementById("txtMessageNews")).isVisible()==true))
		var txtarea = document.getElementById("txtMessageNews")
	else
	if ((document.getElementById("txtMessageBugWish")) && (Boxy.get(document.getElementById("txtMessageBugWish")).isVisible()==true))
		var txtarea = document.getElementById("txtMessageBugWish")
	else
	if ((document.getElementById("txtMessageCommentUser")) && (Boxy.get(document.getElementById("txtMessageCommentUser")).isVisible()==true))
		var txtarea = document.getElementById("txtMessageCommentUser");	


	text = ' ' + text + ' ';
	if (txtarea.createTextRange && txtarea.caretPos) 
	{
		var caretPos = txtarea.caretPos;
		caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? caretPos.text + text + ' ' : caretPos.text + text;
		txtarea.focus();
	} else {
		txtarea.value  += text;
		txtarea.focus();
	}

}