function remName(a, b){
	if(b == 'Wachtwoord'){
		a.id = 'password';	
	}else{
		if(a.value==b){
			a.value='';
		}else if(a.value==''){
			a.value=b;
		}else{
			a.value=a.value;
		}
	}	

}
 
function chkName(a, b){
	if(a.value==''){
		a.value=b;
	}else{
		a.value=a.value;
	}
}





(function($) {
    $('#loginForm').bind('submit', function(e) {
        var valid = true;

        $(this).find('input').each(function() {
            if ($(this).val() == '' || $(this).val() == 'Gebruikersnaam' || $(this).val() == 'Wachtwoord') { 
                $(this).addClass('error');
                valid = false;
            } else {
                $(this).removeClass('error'); 
            }
        });

        if (!valid) {
            e.preventDefault();
        }
    });

    var $activeItem = $('#menu li.active'); 

    if($activeItem.length == 0) {
        return;
    }
    var $menu = $('#menu'); 
    var $subMenu = $('#sub-menu ul'); 
    
    var activeItemTop = $activeItem.position()['top']; 
    var menuBottom = $menu.position()['top'] + $menu.height(); 
    var subMenuBottom = activeItemTop + $subMenu.height(); 
    
    if(subMenuBottom <= menuBottom) { 
        $subMenu.css('top', activeItemTop + 'px'); 
    } else { 
        var menuDiff = subMenuBottom - menuBottom + 11; $subMenu.css('top', activeItemTop - menuDiff + 'px'); 
    } 
})(jQuery);

