/**
	lib_forum.js
	Alles rund ums JFBoard
*/

//Globale Variable nicht löschen!
var unbekannt='';

/**
	Hauptseite im Forum
*/
function showmain() {
    document.forummain.submit();
   }


/**
	Beitrag schreiben
*/
function addreply(fid,tid,kat) {
   document.reply.tid.value=tid;
   document.reply.fid.value=fid;
   document.reply.kat.value=kat;
   document.reply.submit();
   }

//forensuche volltext
function searchtext(page) {

	document.searchtext.page.value=page;
	document.searchtext.submit();
}

//forensuche volltext
function searchautor(page) {

	document.searchautor.page.value=page;
	document.searchautor.submit();
}


/**
	Beitrag löschen
*/
   function delreply(kat,postid) {

   document.delreply.kat.value=kat;
   document.delreply.postid.value=postid;
   document.delreply.submit();
   }


/**
	Beitrag bearbeiten
*/
   function editreply(postid,kat) {
   document.ereply.kat.value=kat;
   document.ereply.postid.value=postid;
   document.ereply.submit();
   }


/**
	Thema bearbeiten
*/
   function edittopic(tid,kat) {
   document.etreply.kat.value=kat;
   document.etreply.tid.value=tid;
   document.etreply.submit();
   }

/**
	Shop Kauf
*/
function buy(id) {
   document.buy.buy.value=id;
   document.buy.submit();
   }

function buynow(id) {
   document.buynow.buynow.value=id;
   document.buynow.submit();
   }

/**
	Neues Thema erstellen
*/
function newtopic(fid,kat) {
   document.newt.fid.value=fid;
   document.newt.kat.value=kat;
   document.newt.submit();
   }

/**
	Tools für die Codes
*/
   function oeffnen(wert2)
{
	document.FWCMAIL.daten.value += "[" + wert2 + "]";
	document.FWCMAIL.daten.focus();
}

function put(option2)
{
	document.FWCMAIL.daten.value += option2;
	document.FWCMAIL.daten.focus();
}
/**
	Mail Feature
*/
   function mailFeature()
{
    var MeldungFehler = '';
    var b   = prompt("Vollständige Email Adresse eingeben", "name@domain.de");
    var a = prompt("Einen Namen für diese Email eingeben", "Email Name");
    if (!b)
    {
        MeldungFehler += " " + "Keine Emailadresse angegeben";
    }
    if (!a)
    {
        MeldungFehler += " " + "Keinen Namen für die Adresse angegeben";
    }
    if (MeldungFehler)
    {
        alert("FEHLER! "+MeldungFehler);
        return;
    }
    var ToAdd = "[mail="+b+"=mail]"+a+"[/mail]";
    document.FWCMAIL.daten.value+=ToAdd;
	document.FWCMAIL.daten.focus();
}

/**
	Font wählen
*/
function changeFont(wert1, wert2)
{
    if (wert1 == 0) return;
    else  document.FWCMAIL.daten.value += "[" + wert2 + "=" + wert1 + "]";
    document.FWCMAIL.ffont.selectedIndex  = 0;
    document.FWCMAIL.fsize.selectedIndex  = 0;
    document.FWCMAIL.fcolor.selectedIndex = 0;
    document.FWCMAIL.daten.focus();
}



/**
	Das Topic Feature
*/
   function topicFeature()
{
    var MeldungFehler = '';
    var b   = prompt("Bitte genaue Thread ID eingeben", "");
    var a = prompt("Einen Text für diesen Link eingeben", "Thema");
    if (!b)
    {
        MeldungFehler += " " + "Keine Thread ID angegeben";
    }
    if (!a)
    {
        MeldungFehler += " " + "Keinen Namen für den Link angegeben";
    }
    if (MeldungFehler)
    {
        alert("Error!"+MeldungFehler);
        return;
    }
    var ToAdd = "[showtopic="+b+"=showtopic]"+a+"[/showtopic]";
    document.FWCMAIL.daten.value+=ToAdd;
	document.FWCMAIL.daten.focus();
}


/**
	Image Feature
*/
   function tag_image()
{
    var MeldungFehler = '';
    var b   = prompt("Die vollständige Adresse des Bildes", "http://");
    if (!b) {
        MeldungFehler += " " + "Keine URL angegeben";
    }
    if (MeldungFehler) {
        alert("FEHLER! "+MeldungFehler);
        return;
    }
    var ToAdd = "[img]"+b+"[/img]";
    document.FWCMAIL.daten.value+=ToAdd;
	document.FWCMAIL.daten.focus();
}


/**
	Bestimmtes Thema anzeigen
*/
   function showtopic(fid,tid,seite,kat) {
   document.forum2.tid.value=tid;
   document.forum2.fid.value=fid;
   document.forum2.page.value=seite;
   document.forum2.kat.value=kat;
   document.forum2.submit();
   }

/**
	Bestimmte Kategorie anzeigen
*/
function showkat(wert) {
   document.kats.kat.value=wert;
   document.kats.submit();
   }


/**
	Zitieren
*/
function quote(fid, tid, kat, postid) {
   document.qreply.tid.value=tid;
   document.qreply.fid.value=fid;
   document.qreply.isquote.value=postid;
   document.qreply.kat.value=kat;
   document.qreply.submit();
   }



/**
	Forenseite aufrufen
*/
   function showforum(wert,seite,kat) {
   document.forum.fid.value=wert;
   document.forum.page.value=seite;
   document.forum.kat.value=kat;
   document.forum.submit();
   }


/**
	Das URL Feature
*/
   function urlFeature()
{
    var MeldungFehler = '';
    var b   = prompt("Vollständige URL eingeben", "http://");
    var a = prompt("Einen Text für diese URL eingeben", "Homepagename");
    if (!b)
    {
        MeldungFehler += " " + "Keine URL angegeben";
    }
    if (!a)
    {
        MeldungFehler += " " + "Keinen Namen für die Adresse angegeben";
    }
    if (MeldungFehler)
    {
        alert("Error!"+MeldungFehler);
        return;
    }
    var ToAdd = "[url="+b+"=url]"+a+"[/url]";
    document.FWCMAIL.daten.value+=ToAdd;
	document.FWCMAIL.daten.focus();
}



/**************************************************
Gallery Stuff, hier noch besser zusammenfassen
***************************************************/
/**
	Hauptseite der Galerie
*/
function galshowmain() {
    document.galforummain.submit();
   }


/**
	Beitrag schreiben
*/
function galaddreply(fid,tid,kat) {
   document.galreply.tid.value=tid;
   document.galreply.fid.value=fid;
   document.galreply.kat.value=kat;
   document.galreply.submit();
   }
 

/**
	Beitrag löschen
*/
   function galdelreply(kat,postid) {

   document.galdelreply.kat.value=kat;
   document.galdelreply.postid.value=postid;
   document.galdelreply.submit();
   }


/**
	Beitrag bearbeiten
*/
   function galeditreply(postid,kat) {
   document.galereply.kat.value=kat;
   document.galereply.postid.value=postid;
   document.galereply.submit();
   }


/**
	Thema bearbeiten
*/
   function galedittopic(tid,kat) {
   document.galetreply.kat.value=kat;
   document.galetreply.tid.value=tid;
   document.galetreply.submit();
   }
 
/**
	Neues Bild in die Galerie hochladen
*/
function galnewtopic(fid,kat) {
   document.galnewt.fid.value=fid;
   document.galnewt.kat.value=kat;
   document.galnewt.submit();
   }
 

/**
	Bestimmtes Bild anzeigen
*/
   function showpic(fid,tid,seite,kat,counter) {
   document.galforum2.tid.value=tid;
   document.galforum2.fid.value=fid;
   document.galforum2.page.value=seite;
   document.galforum2.kat.value=kat;
   document.galforum2.counter.value=counter;
   document.galforum2.submit();
   }

/**
	Bestimmte Kategorie anzeigen
*/
function galshowkat(wert) {
   document.galkats.kat.value=wert;
   document.galkats.submit();
   }


/**
	Zitieren
*/
function galquote(fid, tid, kat, postid) {
   document.galqreply.tid.value=tid;
   document.galqreply.fid.value=fid;
   document.galqreply.isquote.value=postid;
   document.galqreply.kat.value=kat;
   document.galqreply.submit();
   }



/**
	Forenseite aufrufen
*/
   function galshowforum(wert,seite,kat) {
   document.galforum.fid.value=wert;
   document.galforum.page.value=seite;
   document.galforum.kat.value=kat;
   document.galforum.submit();
   }
 