function moreOffenePosten()
{
    var i = parseInt(document.paramForm.opAnzahl.value) + 5;
    document.paramForm.opAnzahl.value = i;
    document.paramForm.submit();
}

function lessOffenePosten()
{
    var i = parseInt(document.paramForm.opAnzahl.value) - 5;
    
    if (i > 0) 
        document.paramForm.opAnzahl.value = i;
    
    document.paramForm.submit();
}

function switchAuftraegeView(modus)
{
    if (modus == "all") {
        document.paramForm.alleAuftraege.value = "true";
    }
    if (modus == "current") {
        document.paramForm.alleAuftraege.value = "false";
    }
    if (modus == "letzte") {
        document.paramForm.alleAuftraege.value = "letzte";
    }
    document.paramForm.submit();
}

function moreRechnungen()
{
    var i = parseInt(document.paramForm.rechRangeValue.value) + 5;
    document.paramForm.rechRangeValue.value = i;
    document.paramForm.submit();
}

function lessRechnungen()
{
    var i = parseInt(document.paramForm.rechRangeValue.value) - 5;
    
    if (i > 0) 
        document.paramForm.rechRangeValue.value = i;
    
    document.paramForm.submit();
}

function moreLieferscheine()
{
    var i = parseInt(document.paramForm.liefRangeValue.value) + 5;
    document.paramForm.liefRangeValue.value = i;
    document.paramForm.submit();
}

function lessLieferscheine()
{
    var i = parseInt(document.paramForm.liefRangeValue.value) - 5;
    
    if (i > 0) 
        document.paramForm.liefRangeValue.value = i;
    
    document.paramForm.submit();
}

function morePositionen()
{
    var i = parseInt(document.paramForm.posRangeValue.value) + 5;
    document.paramForm.posRangeValue.value = i;
    document.paramForm.submit();
}

function lessPositionen()
{
    var i = parseInt(document.paramForm.posRangeValue.value) - 5;
    
    if (i > 0) 
        document.paramForm.posRangeValue.value = i;
    
    document.paramForm.submit();
}

function displayChange(id)
{
	for(i = 1; i <= 6; i++)
	  if(document.getElementById("table" + i))
	    if(document.getElementById("table" + i).style.display != 'none' && id != i)
	      Effect.toggle('table' + i,'BLIND');

	if(document.getElementById("table" + id).style.display == 'none')
	  Effect.toggle('table' + id,'BLIND');

	for(i = 1; i <= 6; i++)
	  if(document.getElementById("tablelink" + i))
	    document.getElementById("tablelink" + i).className='inactivetab';

	document.getElementById("tablelink" + id).className='activetab';
}

String.prototype.trim = function ()
{
	return (this.replace(/\s+$/,"").replace(/^\s+/,""));
};

function addTR()
{
	for(var i = 0; i < 20; i++)
	{
		var tr = document.getElementById("tr"+i);
		if(tr.style.display == 'none')
		{
			tr.style.display = '';
			break;
		}
	}

	if(i >= 19)
		document.getElementById("addTR").style.display = 'none';
}