$(function() {
  
  $('.btn3, .fbButton, #loginForm2Form .btn9, .loginViaFacebook').click(function(e) {

    //alert('bla');
    
    FB.login(function(response) {
      if (response.authResponse) {
        if (response.perms) {
          // user is logged in and granted some permissions.
          // perms is a comma separated list of granted permissions
        } else {
          // user is logged in, but did not grant any permissions
        }
        document.location = fb_register_url;
      } else {
        // user is not logged in
      }
    }, { scope:'publish_stream,email' });

    e.preventDefault();
  });

});

