(function($) {
  $.fn.linkhover = function(style_over, style_out) {
    style_over = $.extend({
    },style_over || {});
    style_out = $.extend({
    },style_out || {});

    $(this).mouseover( function() {
      $(this).css({
        'cursor':'pointer'
      });
      if(style_over) {
        $(this).css(style_over);
        $(this).children('a').css(style_over);
      }
    });
    $(this).mouseout( function() {
      $(this).css({
        'text-decoration':'none'
      });
      if(style_out) {
        $(this).css(style_out);
        $(this).children('a').css(style_out);
      }
    });
    $(this).click( function() {
      var a = $(this).find('a');
      var href = a.attr('href');
      var target = a.attr('target');
      if(!target && $('base').attr('target')) {
        target = $('base').attr('target');
      }

      if(href) {
        if(target) {
          window.open(href,target);
        }else{
          window.location.href=href;
        }
      }
    });

    return $;
  };

})(jQuery);

