(function($) {

  $.sjfak = {
    functions: {
      followURL: function(url) {
        document.location = url;
        return false;
      }
		},
		constants: {
		}
	};

  $.fn.mailLink = function() {
    return this.each(function() {
			var $domain = $(this).attr("href");
			$domain = $domain.split(".");
			$domain = $domain[($domain.length-2)] + "." + $domain[($domain.length-1)];
      $(this).attr("href","mailto:" + $(this).attr("rel") + "@" + $domain);
    });
  }

  $(function() {
    
		$(".mailaddress").mailLink();
		
    $(".promo-click").click(function() {
      var $url = $(this).find("a.promo-url:first").attr("href");
      $.sjfak.functions.followURL($url);
    });
    $("form .ak-button-submit").click(function() {
      $(this).parents("form:first").submit();
      return false;
    });
		
  });
})(jQuery);

