// Allow only alphanumeric characters to be written in a given input
function alphanumeric(inputField){
    var alphanumericValue = inputField.value.toLowerCase().replace(/([^0-9a-z])/g,"");
    if (inputField.value != alphanumericValue)
        inputField.value = alphanumericValue;
}

function hashPassword(loginform) {
    var passwordField = document.getElementById("LoginForm_password");
    var usernameField = document.getElementById("LoginForm_username");
    
    if (passwordField.value.length != 64)
        passwordField.value = SHA256(SHA256("salt") + passwordField.value);
    return true;
}

$(function() {
    $(document).pngFix();
    $("a.fancybox").fancybox({
        'transitionIn'  :   'elastic',
        'transitionOut' :   'elastic',
        'speedIn'       :   600, 
        'speedOut'      :   200, 
        'hideOnContentClick' : true,
        'overlayShow'   :   true,
        'padding'       :   0,
        'titleShow'     :   false
    });
    $("a#readmore").fancybox({
        "width": 850,
        "height": 600,
        "titleShow": false   
    }); 

});

