// jQuery.bbrk.home.shopLink.js

(function ($) {
  
  if (typeof $.bbrk === "undefined") {
    $.bbrk = {};
  }
  
  if (typeof $.bbrk.home === "undefined") {
    $.bbrk.home = {};
  }
  
  $.bbrk.home.shopLink = function (data) {
    
    var $shopLink;
    var $contents;
    
    $shopLink = $("<div>", {
      "class": "shopLink"
    });
    
    $contents = $("<div>", {
      "class": "contents"
    });
    
    $shopLink.html($contents);
    
    $contents.html("<div class=\"label\"><img src=\"assets/img/text/buynow.png\" alt=\"\" width=\"99\" height=\"14\"></div>");
    
    for (var i = 0; i < data.length; ++i) {
      var $btn = $.bbrk.home.shopLinkBtn(data[i].url, data[i].src);
      $contents.append($btn);
    }
    
    $shopLink.hide = function () {
      $shopLink.css({
        display: "none"
      });
    };
    
    $shopLink.show = function (duration, easing) {
      
      $shopLink.css({
        display: "block"
      });
      
      $contents.animate({
        top: 0
      }, {
        duration: duration,
        easing: easing
      });
      
    };
    
    return $shopLink;
  };
  
})(jQuery);

