<?xml version="1.0" encoding="UTF-8" ?>
<Module>
  <ModulePrefs title="赤すぐ内祝い スライドショー"
    description="赤すぐ内祝いの商品をスライドショーで表示"
    author="Taigo Yamada"
    author_email="mt.big5+ig_uchiiwai@gmail.com"
    author_location="Media Technology Labs">
    <Require feature="analytics"/>
    <Require feature="dynamic-height"/>
  </ModulePrefs>
  <UserPref name="category" display_name="カテゴリ" default_value="3698" datatype="enum">
    <EnumValue value="3698" display_value="菓子・グルメ"/>
    <EnumValue value="3701" display_value="酒"/>
  </UserPref>

  <Content type="html">
    <![CDATA[
      <style>
        a img { border: 0; }
        #items { font-size: small; overflow: hidden;}
        .slide {padding: 0; margin: 0; width: 320px; height: 177px;}
        .item img {top: 0; left: 0;}
        .left { float: left;}
        .credit {font-size:xx-small; }
        .desc { margin-top: 15px; margin-left: 10px; font-size: x-small;}
        
      </style>
      <script src="http://mtl.recruit.co.jp/sandbox/yamada/js/jquery-1.2.1.pack.js" type="text/javascript"></script>
      <script src="http://mtl.recruit.co.jp/sandbox/yamada/js/jquery.cycle.all.pack.js" type="text/javascript"></script>
      <script type="text/javascript">
        jQuery.noConflict();
        var $j = jQuery;
        //google analytics
        _IG_Analytics("UA-1358254-2", "/ig/uchiiwai");
        var gPrefs = new _IG_Prefs(__MODULE_ID__);
        function init(){
          var cat = gPrefs.getString('category');
          var url = 'http://webservice.recruit.co.jp/uchiiwai/item/v1/?key=0988394527a1f585&category=' + cat + '&format=jsonp';
          _IG_FetchContent(url,
            function(res){
              if (!res) {return;}
              eval(res);
          });
        }

        function callback(data){
          var obj = data['results']['item'];
          $j( obj ).each( function(){
            var html = '<div class="item"><a href="' + this['urls']['pc'] + '" target="_blank">' + this['name'] + '</a><br/>';
            html += '<div class="left"><a href="' + this['urls']['pc'] + '" target="_blank">';
            html += '<img src="' + this['image']['pc_s'] +'" /></a><br/>';
            html += '<div class="credit">【画像提供：赤すぐ内祝い】</div></div>';
            html += '<div class="desc">' + this['desc'] + '<br/><br/>' + this['price'] + '円</div></div>';
            $j( html ).appendTo('#items');
          });

          $j('#items').cycle('turnDown');

          _IG_AdjustIFrameHeight();
        }

        _IG_RegisterOnloadHandler(
          function(){
            init();
          }
        );

    </script>

    <div id="items" class="slide"></div>
    <div id="footer"><a href="http://webservice.recruit.co.jp/"><img src="http://webservice.recruit.co.jp/banner/uchiiwai-s.gif" alt="赤すぐ内祝い Webサービス" width="135" height="17" border="0" title="赤すぐ内祝い Webサービス"></a></div>

  ]]>
  </Content>
</Module>

