var dest = "/php/";
// JS - Datei für Workflow
function StatusInfo(param)
{
	window.status = param;
}


function zurSuche()
{
	window.location.href = document.forms["zurSuche"].action;
	return false;
}

function dbv_zurueck()
{
    document.forms["zurSuche"].remotePath.value  = dest + 'idw_login_dbv.php';
    document.forms["zurSuche"].submit();
}

function newSearch(sessionId, gruppe, css)
{
    var uri  = document.forms["seminare"].action + '?GSAG=' + sessionId + '&GRUPPE=' + gruppe + '&CSS=' + css;
    window.location.href = uri;
    return false;
}


function jumpNext(aktField, nextField, Len)
{
    laenge  = document.getElementById(aktField).value.Length();
    alert(laenge);
}


// WPA end (start)
function blaettern(seite)
{
    document.forms["seminare"].remotePath.value  = dest + 'seminarsuche.php';
    document.forms["seminare"].gs_FIRST.value    = seite;
    document.forms["seminare"].menu.value        = '0001';
    document.forms["seminare"].submit();
}

function selectSeminar(tab, semnr)
{
    document.forms["seminare"].TABELLE.value     = tab;
    document.forms["seminare"].SEMINARNR.value   = semnr;
    document.forms["seminare"].menu.value        = '0002';
    document.forms["seminare"].submit();
}

function setOrder(feld, desc)
{
    document.forms["seminare"].remotePath.value  = dest + 'seminarsuche.php';
    document.forms["seminare"].gs_SORT.value     = feld+' '+desc;
    document.forms["seminare"].submit();
}
// WPA end (end)
function anmelden(art, tab, jump_atg)
{
    if(tab == 'MGL_1_30')
    {
        gr = 'SEMINAR';
        st = '3';
    }
    else if(tab == 'MGL_1_35')
    {
        gr = 'TAGUNG';
        st = '3';
    }
    else if(tab == 'MGL_1_38')
    {
        gr = 'LG';
        st = '10';
    }

    if(art == 'nichtmitglied')
    {
        document.forms["anmeldung"].remotePath.value = dest + "workflow.php";
        document.forms["anmeldung"].stepback.value = st;
        document.forms["anmeldung"].NICHTMITGLIED.value = "1";
        document.forms["anmeldung"].GRUPPE.value = gr;
    }
    else if(art == 'dbv')
    {
    	document.forms["anmeldung"].stepback.value = st;
        document.forms["anmeldung"].GRUPPE.value = gr;
        document.forms["anmeldung"].remotePath.value = dest + "idw_login_dbv.php";
    }
    else if(art == 'examenskandidat')
    {
        document.forms["anmeldung"].stepback.value = st;
        document.forms["anmeldung"].GRUPPE.value = gr;
        document.forms["anmeldung"].remotePath.value = dest + "idw_login_exam.php";
    }
    else if ( document.forms["anmeldung"].MITGLIEDNR.value == '' || document.forms["anmeldung"].MITGLIEDNR.value == 'null' || document.forms["anmeldung"].MITGLIEDNR.value == '0' || document.forms["anmeldung"].MITGLIEDNR.value == 'value')
    {
        window.alert("Sie sind nicht als Mitglied am IDW Portal angemeldet, bitte melden Sie sich anhand der Login-Box auf der linken Seite ein!");
        return false;
    }
    else
    {
        document.forms["anmeldung"].remotePath.value = dest + "workflow.php";
        document.forms["anmeldung"].stepback.value = st;
        document.forms["anmeldung"].GRUPPE.value = gr;
    }
    
    document.forms["anmeldung"].submit();
}

function sucherechnungsadresse(step)
{
    document.forms[1].wiederholeseite.value=step;
    document.forms[1].submit();
}

function setMaxLength(feld, feldlen,len)
{
    str          = document.forms["zurSuche"].elements[feld].value;
    strlaenge    = str.length;

    if(strlaenge > len)
    {
        str      = str.substring(0, len);
        document.forms["zurSuche"].elements[feld].value = str;
    }
    document.forms["zurSuche"].elements[feldlen].value = (len - str.length);
}

// WPA begin (start)
function loeschebuchung(lfdnr,artnr,mitgliednr,step)
{
    if(confirm('Wollen Sie diesen Teilnehmer wirklich loeschen?'))
    {
		if(step == '')
			step = 5;
        document.forms["zurSuche"].wiederholeseite.value=step;
        document.forms["zurSuche"].deletesingle.value=lfdnr;
        document.forms["zurSuche"].submit();
    }
}

function aenderebuchung(lfdnr,artnr) {
	document.forms["zurSuche"].STEP.value='';
	document.forms["zurSuche"].stepback.value='4';
	document.forms["zurSuche"].DATENSATZ.value=lfdnr;
	document.forms["zurSuche"].ARTIKEL_NR.value=artnr;
	document.forms["zurSuche"].submit();
}

function weiterebuchung() {
	document.forms["zurSuche"].STEP.value='';
	document.forms["zurSuche"].stepback.value=2;
	document.forms["zurSuche"].wiederholeseite.value='2';
	document.forms["zurSuche"].DATENSATZ.value='';
	document.forms["zurSuche"].ARTIKEL_NR.value='';
	document.forms["zurSuche"].submit();
}// WPA begin (start)
function bucheweiterentln( artnr, mitgliednr ) {
    document.forms["zurSuche"].STEP.value='';
    document.forms["zurSuche"].stepback.value=4;
    document.forms["zurSuche"].wiederholeseite.value='3';
    document.forms["zurSuche"].DATENSATZ.value='';
    document.forms["zurSuche"].ARTIKEL_NR.value=artnr;
    document.forms["zurSuche"].MITGLIEDNR.value=mitgliednr;
    document.forms["zurSuche"].submit();
} 

function addartikel(intkateg,gruppe,table)
{
    document.forms["zurSuche"].INT_KATEG.value=intkateg;
    document.forms["zurSuche"].TABLE.value=table;
    document.forms["zurSuche"].NEWGRUPPE.value=gruppe;
    document.forms["zurSuche"].submit();
}


function re_changed(e) 
{
    document.forms["zurSuche"].ZAHLER.value='';
}
        	
function teiln_changed(e) 
{
   	document.forms["zurSuche"].MITGLIEDNR.value='';
}

function weiter() {
    document.forms["zurSuche"].remotePath.value = dest + "workflow.php";
	document.forms["zurSuche"].submit();
}

function exam_zurueck()
{
    document.forms["zurSuche"].remotePath.value = dest + 'idw_login_exam.php';
    document.forms["zurSuche"].submit();
}