
function hide_object( identifier ){
    var obj;
    if( document.getElementById( identifier ) ){
        obj = document.getElementById( identifier );
        obj.setAttribute('class', 'hidden');    
    }
}

function show_object( identifier ){
    var obj;
    if( document.getElementById( identifier ) ){
        obj = document.getElementById( identifier );
        obj.setAttribute('class', 'visible');    
    }
}





function login_form_submit( ){

	var error_txt = '';

	// check username
	var login_username = document.getElementById('login_username').value;
	if( login_username == '' ){
		error_txt = 'Vul een gebruikersnaam in.<br/>';
	}else if( ( login_username != '' ) && ( login_username.length < 3 ) ){
		error_txt = 'Vul een geldige gebruikersnaam in.<br/>';	
	}
	
	// check password
	var login_password = document.getElementById('login_password').value;
	if( login_password == '' ){
		error_txt += 'Vul een wachtwoord in.';
	}else if( ( login_password != '' )  && ( login_password.length < 3 ) ){
		error_txt += 'Vul een geldig wachtwoord in.';
	}
	
	// show notification
	document.getElementById('login_form_notification').innerHTML = error_txt;
	
	if( error_txt == '' ){
		document.getElementById('login_form').submit();	
	}
}
