//Hilfelayer schreiben und sichbar machen


function showHelp(text) {

    if ( document.documentElement ) {
        document.getElementById("contextHelp").innerHTML = '<br />' + text;
        
        if ( document.getElementById('layoutContentRight2Bottom') ) {
            document.getElementById('layoutContentRight2Bottom').style.top = '312px';
            document.getElementById('layoutContentRight2Bottom').style.backgroundImage = 'url(/images/closehelp.gif)';
            document.getElementById('layoutContentRight2Bottom').style.backgroundRepeat = 'no-repeat';
        } else if ( document.getElementById('layoutContentRight2BottomMy') ) {
            document.getElementById('layoutContentRight2BottomMy').style.top = '312px';
            document.getElementById('layoutContentRight2BottomMy').style.backgroundImage = 'url(/images/closehelp.gif)';
            document.getElementById('layoutContentRight2BottomMy').style.backgroundRepeat = 'no-repeat';
        } else if ( document.getElementById('layoutContent1Bottom') ) {
            document.getElementById('layoutContent1Bottom').style.top = '312px';
            document.getElementById('layoutContent1Bottom').style.backgroundImage = 'url(/images/closehelp.gif)';
            document.getElementById('layoutContent1Bottom').style.backgroundRepeat = 'no-repeat';
        }
        
    } else {
        alert (text);
    }

}

function closeHelp () {

    if ( document.documentElement ) {
        document.getElementById("contextHelp").innerHTML = '';




        if ( document.getElementById('layoutContentRight2Bottom') ) {
            document.getElementById('layoutContentRight2Bottom').style.top = '412px';
            document.getElementById('layoutContentRight2Bottom').style.backgroundImage = 'url()';
        } else if ( document.getElementById('layoutContentRight2BottomMy') ) {
            document.getElementById('layoutContentRight2BottomMy').style.top = '412px';
            document.getElementById('layoutContentRight2BottomMy').style.backgroundImage = 'url()';
        } else if ( document.getElementById('layoutContent1Bottom') ) {
            document.getElementById('layoutContent1Bottom').style.top = '412px';
            document.getElementById('layoutContent1Bottom').style.backgroundImage = 'url()';
        }
        
        
    }           
}

function openWin ( url, winWidth, winHeight ) {

	var prop = 'toolbar=no,width=' + winWidth + ',height=' + winHeight + ',directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no';
	
	open ( url, "EBC", prop );

}

function openPrintWin ( url, winWidth, winHeight ) {

	var prop = 'toolbar=no,width=' + winWidth + ',height=' + winHeight + ',directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no';
	
	open ( url + '&popup=2', "EBC", prop );

}

function openWinLatLng ( url, winWidth, winHeight ) {
    
    var params = '';
    if ( ( document.getElementById ( 'latitude' ) ) && ( document.getElementById ( 'latitude' ).value != '' )
            && ( document.getElementById ( 'longitude' ) ) && ( document.getElementById ( 'longitude' ).value != '' ) ) {
        params = '&lat=' + document.getElementById ( 'latitude' ).value + '&lng=' + document.getElementById ( 'longitude' ).value;
    }

	var prop = 'toolbar=no,width=' + winWidth + ',height=' + winHeight + ',directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no';
	
	open ( url + params, "EBC", prop );

}


function displayFormBlock ( id ) {

    document.getElementById('ls').style.display = 'none';
    document.getElementById('cc').style.display = 'none';

    if ( id == 2 ) {
        document.getElementById('ls').style.display = 'block';
    } else if ( id == 3 ) {
        document.getElementById('cc').style.display = 'block';
    }

}


function showFieldIdBetreuer () {
    if ( document.getElementById('organisation_art_id_organisation_art').options[1].selected == true ) {
        document.getElementById('rowIdBetreuer').style.visibility = 'visible';
    } else {
        document.getElementById('rowIdBetreuer').style.visibility = 'hidden';
    }  
}

var lastCategorie = '0';
function showCategories () {
    
    var categories = document.getElementById('categories');

    for ( var i = 0; i < categories.options.length; i++ ) { 
        if ( categories.options[i].selected == true ) {
            document.getElementById('k' + lastCategorie).style.display = 'none';
            document.getElementById('k' + categories.options[i].value).style.display = 'block';
            lastCategorie = categories.options[i].value;
            break;
        }
    }

}

