/* 
Copyright (c) 2010 by Adecco management & consulting S.A.
Description: General functions for anonymous users. This file will be include in the HTML head element.
Vendor: #0701
*/

function XOR(a,b) {
    return ( a ? 1 : 0 ) ^ ( b ? 1 : 0 );
}

function RegisterKeyRedirect(keycode, href, shift, confirmText)
{
    $(document).keydown(function(e) {
        if (e.which == keycode && !XOR(e.shiftKey, shift)) {
            var conf = true;
            if(confirmText) conf = confirm(confirmText);
            
            if(conf) window.location.href = href;
        }
    });
}
