function clearErrorText()
{
if ($('errorArea').innerHTML != "")
{
$('errorArea').innerHTML = "";
}
}
function newArghShowTextCommonStart()
{
// take break-stuff properly into account
if ($('newArghBreak').style.display == "block")
{
$('newArghBreak').style.display = "none";
}
// take link-stuff properly into account
if ($('newArghLink').style.display == "block")
{
$('newArghLink').style.display = "none";
}
// take photo-stuff properly into account
if ($('newArghPhoto').style.display == "block")
{
$('newArghPhoto').style.display = "none";
}
// take insider-stuff properly into account
if ($('newArghInsiderInfo').style.display == "block")
{
$('newArghInsiderInfo').style.display = "none";
}
if ($('option-break').style.display == "none")
{
$('option-break').style.display = "block";
}
if ($('option-link').style.display == "none")
{
$('option-link').style.display = "block";
}
}
function newArghShowTextCommonEnd()
{
clearErrorText();
$('newArghText').style.display = "block";
location.href="#contentStart";
}
function newArghShowText()
{
newArghShowTextCommonStart();
if ($('text-span-name').style.display == "inline")
{
$('text-span-name').style.display = "none";
}
if ($('text-span-insider').style.display == "none")
{
$('text-span-insider').style.display = "inline";
}
$('text-input-span-insider').innerHTML = '';
$('text-input-span-name').innerHTML = '';
$('text-input-span-spam').innerHTML = '';
newArghShowTextCommonEnd();
}
function newArghShowTextWithoutInsider()
{
newArghShowTextCommonStart();
if ($('text-span-insider').style.display == "inline")
{
$('text-span-insider').style.display = "none";
}
if ($('text-span-name').style.display == "none")
{
$('text-span-name').style.display = "inline";
}
$('text-input-span-name').innerHTML = '';
$('text-input-span-spam').innerHTML = '';
$('text-input-span-insider').innerHTML = '';
newArghShowTextCommonEnd();
}
function newArghShowLink()
{
// take text-stuff properly into account
if ($('newArghText').style.display == "none")
{
$('newArghText').style.display = "block";
}
// take photo-stuff properly into account
if ($('newArghPhoto').style.display == "block")
{
$('newArghPhoto').style.display = "none";
}
// take insider-stuff properly into account
if ($('newArghInsiderInfo').style.display == "block")
{
$('newArghInsiderInfo').style.display = "none";
}
clearErrorText();
$('newArghLink').style.display = "block";
location.href="#contentStart";
}
function newArghShowBreak()
{
// take text-stuff properly into account
if ($('newArghText').style.display == "none")
{
$('newArghText').style.display = "block";
}
// take photo-stuff properly into account
if ($('newArghPhoto').style.display == "block")
{
$('newArghPhoto').style.display = "none";
}
// take insider-stuff properly into account
if ($('newArghInsiderInfo').style.display == "block")
{
$('newArghInsiderInfo').style.display = "none";
}
clearErrorText();
$('newArghBreak').style.display = "block";
location.href="#contentStart";
}
function newArghShowPhotoCommonStart()
{
// take text-stuff properly into account
if ($('newArghText').style.display == "block")
{
$('newArghText').style.display = "none";
}
// take link-stuff properly into account
if ($('newArghLink').style.display == "block")
{
$('newArghLink').style.display = "none";
}
// take break-stuff properly into account
if ($('newArghBreak').style.display == "block")
{
$('newArghBreak').style.display = "none";
}
// take insider-stuff properly into account
if ($('newArghInsiderInfo').style.display == "block")
{
$('newArghInsiderInfo').style.display = "none";
}
}
function newArghShowPhotoCommonEnd()
{
clearErrorText();
$('newArghPhoto').style.display = "block";
location.href="#contentStart";
}
function newArghShowPhoto()
{
newArghShowPhotoCommonStart();
if ($('photo-span-name').style.display == "inline")
{
$('photo-span-name').style.display = "none";
}
if ($('photo-span-insider').style.display == "none")
{
$('photo-span-insider').style.display = "inline";
}
$('photo-input-span-insider').innerHTML = '';
$('photo-input-span-name').innerHTML = '';
$('photo-input-span-spam').innerHTML = '';
newArghShowPhotoCommonEnd();
}
function newArghShowPhotoWithoutInsider()
{
newArghShowPhotoCommonStart();
if ($('photo-span-name').style.display == "none")
{
$('photo-span-name').style.display = "inline";
}
if ($('photo-span-insider').style.display == "inline")
{
$('photo-span-insider').style.display = "none";
}
$('photo-input-span-name').innerHTML = '';
$('photo-input-span-spam').innerHTML = '';
$('photo-input-span-insider').innerHTML = '';
newArghShowPhotoCommonEnd();
}
function newArghShowInsiderInfo()
{
// take text-stuff properly into account
if ($('newArghText').style.display == "block")
{
$('newArghText').style.display = "none";
}
// take link-stuff properly into account
if ($('newArghLink').style.display == "block")
{
$('newArghLink').style.display = "none";
}
// take break-stuff properly into account
if ($('newArghBreak').style.display == "block")
{
$('newArghBreak').style.display = "none";
}
// take photo-stuff properly into account
if ($('newArghPhoto').style.display == "block")
{
$('newArghPhoto').style.display = "none";
}
clearErrorText();
$('newArghInsiderInfo').style.display = "block";
location.href="#contentStart";
}
function newArghGotoDescription()
{
// must be here (at start)
location.href="#center-content-section";
// take text-stuff properly into account
if ($('newArghText').style.display == "block")
{
$('newArghText').style.display = "none";
}
// take link-stuff properly into account
if ($('newArghLink').style.display == "block")
{
$('newArghLink').style.display = "none";
}
// take break-stuff properly into account
if ($('newArghBreak').style.display == "block")
{
$('newArghBreak').style.display = "none";
}
// take photo-stuff properly into account
if ($('newArghPhoto').style.display == "block")
{
$('newArghPhoto').style.display = "none";
}
// take insider-stuff properly into account
if ($('newArghInsiderInfo').style.display == "block")
{
$('newArghInsiderInfo').style.display = "none";
}
clearErrorText();
}
function newArghTakeSelection()
{
var value = document.getElementById("newArghSelect").value;
if (value == "text")
{
newArghShowText();
}
else if (value == "text-without-insider")
{
newArghShowTextWithoutInsider();
}
else if (value == "link")
{
newArghShowLink();
}
else if (value == "break")
{
newArghShowBreak();
}
else if (value == "photo")
{
newArghShowPhoto();
}
else if (value == "photo-without-insider")
{
newArghShowPhotoWithoutInsider();
}
else if (value == "insider")
{
newArghShowInsiderInfo();
}
else if (value == "description")
{
newArghGotoDescription();
}
else
{
var values = value.split(',');
var val = values[0];
var script = values[1];
var num = values[2];
if (val == "all-photos")
{
showLoadActivity('NewArghSelect');
location.href = "./" + script + "?i=" + num + "&imgOnly";
}
else if (val == "refresh")
{
showLoadActivity('NewArghSelect');
location.href = "./" + script + "?i=" + num + "&contentStart";
}
else
{
console.log("wtf?");
}
}
}
function showLoadActivity(id)
{
$('loadActivity' + id).style.display = "block";
$('button' + id).style.display = "none";
}
function transmitForumData(num, lastEntryNumber) {
showLoadActivity( true );
var request = new Ajax.Request('server_new.php',
{
method:'get',
parameters: $('newTableForm').serialize(true),
onSuccess: function(transport) {
var response = transport.responseText || "no response text";
showNewEntry(response, num, lastEntryNumber);
},
onFailure: function(){ alert('Ajax-Aufruf schlug fehl') }
});
}
function newArghAddBreakForm()
{
document.forumFormular.entry.value += "\n(--------)\n";
document.getElementById("newArghInputStuff").focus();
}
function newArghAddLinkForm()
{
var linkName = document.linkFormular.name.value;
var linkAddress = document.linkFormular.address.value;
if( linkName.length == 0 )
{
linkName = "Doofbacke";
}
if( (linkAddress.length == 0) || (linkAddress == "http://") )
{
linkAddress = "http://www.nirgendwo.xyz";
}
var syntax = "\n(l: " + linkName + " | " + linkAddress + " :l)\n";
document.forumFormular.entry.value += syntax;
document.getElementById("newArghInputStuff").focus();
}