/*  tnkjapan JavaScript library
 *  (c) 2007-2008 Yoshiyuki Sugimoto
 *
 *  TNK Japan Web Site is maintained by TNK Travel Japan co., ltd.
 *  http://www.tnkjapan.com/
 *  tnkjapan library is using prototype.js and effects.js libraries.
 ----------------------------------------------------------------------------*/
var TNK = {
    turnPicture: function(pic_id, pane) {
        var current = $('#' + pane + ' div:visible');

        var target;
        if (pic_id == '-1') {
            target = current.prev();
            if (target.html() == null) target = current.parent().children(':last');
        } else if (pic_id == '+1') {
            target = current.next();
            if (target.html() == null) target = current.parent().children(':first');
        } else {
            target = $('#' + pic_id);
        }
        current.fadeOut(1200, function() { current.hide(); target.fadeIn(1200) });
    },

    pushItem: function(item) {
        $.post(
            "mailform/pushItem.php",
            "item=" + encodeURIComponent(item),
            function() { alert("カートに保存しました。\n予約フォームから予約できます。"); }
        );
    }
}

