
/**
 * @author Lutz|Schulz marketing & kommunikation GmbH / cod.m - Patrik Mayer
 * @copyright Copyright (C) 11/2008 Lutz|Schulz marketing & kommunikation gmbh
 * @licence Dieser Code ist ausschließlich für die Website des Trivium Coaching Portal lizensiert.
 *   
 * Eine Nutzung außerhalb der Website des Trivium Coaching Portals 
 * (zulässige Domains: trivium-coaching.com; trivium-coaching.de; trivium-coaching.eu; trivium-coachingverband.de; 
 * triviumcoaching.com; triviumcoaching.de; triviumcoaching.eu; triviumcoachingverband.de) ist ausdrücklich untersagt. 
 */

function initLoginBox(){
    $('#userinfo INPUT[name="username"]').css('color', '#999999');
    $('#userinfo INPUT[name="username"]').focus(function(){
        if(this.value == 'Benutzername'){
            this.value = '';
        }
        this.style.color = '';
    });

    $('#userinfo INPUT[name="pass"]').css('color', '#999999');
    $('#userinfo INPUT[name="pass"]').focus(function(){
        if(this.value == 'passwort'){
            this.value = '';
        }
        this.style.color = '';
    });
}




function checkLogin(form){
    if(form.username.value == '' || form.username.value == 'Benutzername' || form.pass.value == '' || form.pass.value == 'passwort'){
        return false;
    }else{
        return true;
    }
}




function show_form_error(elem, text){
	id_ext = elem.id;

    if(document.getElementById('form_error_' + id_ext)){
        document.getElementById('form_error_' + id_ext).innerHTML = text;
        $('#form_error_' + id_ext).show();
    }else{
        if(text){
            var div = document.createElement('div');
            div.className = 'error_message';
            div.id = 'form_error_' + id_ext;
            div.innerHTML = text;

            div.style.display = 'none';
            elem.parentNode.appendChild(div);

            $('#form_error_' + id_ext).show('normal');
        }
    	$(elem).addClass('error');
	}
}




function hide_form_error(elem){
	id_ext = elem.id;

    $(elem).removeClass('error');
    if(document.getElementById('form_error_' + id_ext)){
    	$('#form_error_' + id_ext).hide('normal');
    }
}






