var Xmode = 1;
XKalin = false;
XYatay = false;
XCizili = false;
XSola = false;
XOrtala = false;
XSaga = false;
XAlinti = false;
XResim = false;
XLink = false;
XMail = false;

// FontFace Function
function FontFace(font){
if (font != null && font != ""){
if (Xmode == 2){
alert('This tag is to make the enclosed text in ' + font + '.\nExample:\n\n[FONT=' + font + ']This text is ' + font + '[/FONT]')
}
else if (Xmode == 3){
etext = prompt("Please enter a text you want to make it in " + font, "")
if (etext != "" && etext != null){document.form.yazi.value += ("[FONT=" + font + "]" + etext + "[/FONT]");}
}
else{
document.form.yazi.value += "[FONT=" + font + "][/FONT]";
}
}
document.form.yazi.focus();
}
// END FontFace Function
/////////////////////////////////////////////////////
// FontSize Function
function FontSize(boyut){
if (boyut != null && boyut != ""){
if (Xmode == 2){
alert('This tag is to make the enclosed text in size ' + boyut + '.\nExample:\n\n[SIZE=' + boyut + ']This text is size ' + boyut + '[/SIZE]')
}
else if (Xmode == 3){
etext = prompt("Please enter a text you want to make it size " + boyut, "")
if (etext != "" && etext != null){document.form.yazi.value += ("[SIZE=" + boyut + "]" + etext + "[/SIZE]");}
}
else{
document.form.yazi.value += "[SIZE=" + boyut + "][/SIZE]";
}
}
document.form.yazi.focus();
}
// END FontSize Function
/////////////////////////////////////////////////////
// FontColor Function
function FontColor(renk){
if (renk != null && renk != ""){
if (Xmode == 2){
alert('This tag is to make the enclosed text ' + renk + '.\nExample:\n\n[COLOR=' + renk + ']This text is ' + renk + '[/COLOR]')
}
else if (Xmode == 3){
etext = prompt("Please enter a text you want to make it " + renk, "")
if (etext != "" && etext != null){document.form.yazi.value += ("[COLOR=" + renk + "]" + etext + "[/COLOR]");}
}
else{
document.form.yazi.value += "[COLOR=" + renk + "][/COLOR]";
}
}
document.form.yazi.focus();
}
// END FontColor Function
/////////////////////////////////////////////////////
// Bold Function
function Kalin(){
if (Xmode == 2){
alert('This tag is to make the enclosed text bold.\nExample:\n\n[B]This text is bold[/B]')
}
else if (Xmode == 3){
etext = prompt("Please enter a text you want to make it bold", "")
if (etext != "" && etext != null){document.form.yazi.value += ("[B]" + etext + "[/B]");}
}
else{
if (XKalin == false){
document.form.yazi.value += "[B]";
XKalin = true;
document.images.kalin.src = "imgForum/kalin.gif";
}
else{
document.form.yazi.value += "[/B]";
XKalin = false;
document.images.kalin.src = "imgForum/kalin.gif";
}
}
document.form.yazi.focus();
}
// END Bold Function
/////////////////////////////////////////////////////
// Italic Function
function Yatay(){
if (Xmode == 2){
alert('This tag is to make the enclosed text italicized.\nExample:\n\n[I]This text is italicized[/I]')
}
else if (Xmode == 3){
etext = prompt("Please enter a text you want to make it italicized", "")
if (etext != "" && etext != null){document.form.yazi.value += ("[I]" + etext + "[/I]");}
}
else{
if (XYatay == false){
document.form.yazi.value += "[I]";
XYatay = true;
document.images.yatay.src = "imgForum/yamuk.gif";
}
else{
document.form.yazi.value += "[/I]";
XYatay = false;
document.images.yatay.src = "imgForum/yamuk.gif";
}
}
document.form.yazi.focus();
}
// END Italic Function
/////////////////////////////////////////////////////
// Underline Function
function Cizili(){
if (Xmode == 2){
alert('This tag is to make the enclosed text underlined.\nExample:\n\n[U]This text is underline[/U]')
}
else if (Xmode == 3){
etext = prompt("Please enter a text you want to make it underlined", "")
if (etext != "" && etext != null){document.form.yazi.value += ("[U]" + etext + "[/U]");}
}
else{
if (XCizili == false){
document.form.yazi.value += "[U]";
XCizili = true;
document.images.cizili.src = "imgForum/alticizili.gif";
}
else{
document.form.yazi.value += "[/U]";
XCizili = false;
document.images.cizili.src = "imgForum/alticizili.gif";
}
}
document.form.yazi.focus();
}
// END Underline Function
/////////////////////////////////////////////////////
// Left Function
function Sola(){
if (Xmode == 2){
alert('This tag is to make the enclosed text aligned to the left.\nExample:\n\n[LEFT]This text is left aligned[/LEFT]')
}
else if (Xmode == 3){
etext = prompt("Please enter a text you want to make it aligned on the left", "")
if (etext != "" && etext != null){document.form.yazi.value += ("[LEFT]" + etext + "[/LEFT]");}
}
else{
if (XSola == false){
document.form.yazi.value += "[LEFT]";
XSola = true;
document.images.sola.src = "imgForum/sola.gif";
}
else{
document.form.yazi.value += "[/LEFT]";
XSola = false;
document.images.sola.src = "imgForum/sola.gif";
}
}
document.form.yazi.focus();
}
// END Left Function
/////////////////////////////////////////////////////
// Center Function
function Ortala(){
if (Xmode == 2){
alert('This tag is to make the enclosed text centered.\nExample:\n\n[LEFT]This text is centered[/LEFT]')
}
else if (Xmode == 3){
etext = prompt("Please enter a text you want to make it centered", "")
if (etext != "" && etext != null){document.form.yazi.value += ("[CENTER]" + etext + "[/CENTER]");}
}
else{
if (XOrtala == false){
document.form.yazi.value += "[CENTER]";
XOrtala = true;
document.images.ortala.src = "imgForum/ortala.gif";
}
else{
document.form.yazi.value += "[/CENTER]";
XOrtala = false;
document.images.ortala.src = "imgForum/ortala.gif";
}
}
document.form.yazi.focus();
}
// END Center Function
/////////////////////////////////////////////////////
// Right Function
function Saga(){
if (Xmode == 2){
alert('This tag is to make the enclosed text aligned to the right.\nExample:\n\n[RIGHT]This text is right aligned[/RIGHT]')
}
else if (Xmode == 3){
etext = prompt("Please enter a text you want to make it aligned on the right", "")
if (etext != "" && etext != null){document.form.yazi.value += ("[RIGHT]" + etext + "[/RIGHT]");}
}
else{
if (XSaga == false){
document.form.yazi.value += "[RIGHT]";
XSaga = true;
document.images.saga.src = "imgForum/saga.gif";
}
else{
document.form.yazi.value += "[/RIGHT]";
XSaga = false;
document.images.saga.src = "imgForum/saga.gif";
}
}
document.form.yazi.focus();
}
// END Right Function
/////////////////////////////////////////////////////
// Quote Function
function Alinti(){
if (Xmode == 2){
alert('This tag quotes the enclosed text, suggesting the text has been posted by some else.\nExample:\n\n[QUOTE]This text is quoted[/QUOTE]')
}
else if (Xmode == 3){
etext = prompt("Please enter a text you want to make it quoted", "")
if (etext != "" && etext != null){document.form.yazi.value += ("[QUOTE]" + etext + "[/QUOTE]");}
}
else{
if (XAlinti == false){
document.form.yazi.value += "[QUOTE]";
DidQuote = true;
document.images.alinti.src = "imgForum/alinti.gif";
}
else{
document.form.yazi.value += "[/QUOTE]";
XAlinti = false;
document.images.alinti.src = "imgForum/alinti.gif";
}
}
document.form.yazi.focus();
}
// END Quote Function
/////////////////////////////////////////////////////
// Image Function
function Resim(){
if (Xmode == 2){
alert('This tag will embed the given URL as an image.\nExample:\n\n[IMG]http://yourdomain/picture.jpg[/IMG]')
}
else if (Xmode == 3){
etext = prompt("Please enter a the URL of the image", "")
if (etext != "" && etext != null){document.form.yazi.value += ("[IMG]" + etext + "[/IMG]");}
}
else{
if (XResim == false){
document.form.yazi.value += "[IMG]";
XResim = true;
document.images.resim.src = "imgForum/resim.gif";
}
else{
document.form.yazi.value += "[/IMG]";
XResim = false;
document.images.resim.src = "imgForum/resim.gif";
}
}
document.form.yazi.focus();
}
// END Image Function
/////////////////////////////////////////////////////
// Link Function
function Link(){
if (Xmode == 2){
alert('This tag will embed the given URL as a link.\nExample:\n\n[URL]http://yourdomain/yourpage.htm[/URL]\n\n[URL=http://yourdomain/yourpage.htm]My Website\'s Name[/URL]')
}
else if (Xmode == 3){
etext = prompt("Please enter a the URL of the webpage", "")
etext2 = prompt("Please enter a the name of the webpage\n(leave black to use URL as name)", "")
if (etext != null && etext != ""){
	if (etext2 != null && etext2 != ""){
	document.form.yazi.value += ("[URL=" + etext + "]" + etext2 + "[/URL]");
	}
	else{
	document.form.yazi.value += ("[URL]" + etext + "[/URL]");
	}
}
}
else{
if (XLink == false){
document.form.yazi.value += "[URL]";
XLink = true;
document.images.link.src = "imgForum/link.gif";
}
else{
document.form.yazi.value += "[/URL]";
XLink = false;
document.images.link.src = "imgForum/link.gif";
}
}
document.form.yazi.focus();
}
// END Link Function
/////////////////////////////////////////////////////
// Link Function
function Email(){
if (Xmode == 2){
alert('This tag will embed the given URL as a link.\nExample:\n\n[MAIL]http://yourdomain/yourpage.htm[/MAIL]\n\n[MAIL=http://yourdomain/yourpage.htm]My Website\'s Name[/MAIL]')
}
else if (Xmode == 3){
etext = prompt("Please enter a the URL of the webpage", "")
etext2 = prompt("Please enter a the name of the webpage\n(leave black to use URL as name)", "")
if (etext != null && etext != ""){
	if (etext2 != null && etext2 != ""){
	document.form.yazi.value += ("[MAIL=" + etext + "]" + etext2 + "[/MAIL]");
	}
	else{
	document.form.yazi.value += ("[MAIL]" + etext + "[/MAIL]");
	}
}
}
else{
if (XMail == false){
document.form.yazi.value += "[MAIL]";
XMail = true;
document.images.mail.src = "imgForum/mail.gif";
}
else{
document.form.yazi.value += "[/MAIL]";
XMail = false;
document.images.mail.src = "imgForum/mail.gif";
}
}
document.form.yazi.focus();
}
// END Link Function

function Ifade(ifadetag)
{
document.form.yazi.value += ifadetag;
document.form.yazi.focus();
}