function validate_form ( ){

    valid = true;

    if ( document.login_form.login_name.value == "" && document.login_form.login_pw.value == "" ){
        alert ( "You can't leave the boxes empty" );
        valid = false;
	}

    else if ( document.login_form.login_name.value == "" ){
	    alert ( "You need a Username" );
	    valid = false;
    }

    else if ( document.login_form.login_pw.value == "" ){
    	alert ( "You need a Password" );
    	valid = false;
    }

	else if ( document.login_form.login_pw.value.match(/[a-zA-Z]/)){
		alert ( "The password need to contain only numbers" );
		valid = false;
	}

	else if ( document.login_form.login_name.value.match(/dsv.su.se$/)){
		return valid; }
	else {
		alert ( "The Username needs to end with dsv.su.se" );
		valid = false;
		}

    return valid;
}