(function($) {
	$.fn.portraitify = function(options) {
	  var defaults = {
      items: []
	  };

	  var opts = $.extend(defaults, options);
    
    var box = $("<div class=\"pic-console\"><div class=\"table\"><ul class=\"list-icon\"></ul></div></div>");
    var shadowlarge =$("<div id=\"portrait-shadow-expand\"></div>");
    var show_info = $("<div id=\"show-info\" class=\"show-info\"></div>");
    
    $.each(opts.items, function(i, val) {
      var item = $("<li><a href=\"" + val.link + "\"><img src=\"" + val.icon + "\" alt=\"" + val.text + "\" /></a></li>");
            
      $("a", item).hover(
        function() {
          show_info.text($("img", this).attr("alt")).show();          
        },
        function() {
          show_info.hide();
        });

      $("ul", box).append(item);
    });

    $(this).prepend(show_info);
    $(this).prepend(shadowlarge);
    $(this).append(box);  
    $(this).hover(
      function () {
        box.show();
        shadowlarge.show();
      }, 
      function () {
        box.hide();
        shadowlarge.hide();
      }
    );
	};
})(jQuery);