// -------------------------------------------------------------------
// DOMツリーが構築されたタイミングで実行するメソッド
// -------------------------------------------------------------------
jQuery.noConflict();
(function ($) { 

$(document).ready(function(){
    // IE6向けの処理
    if(!$.support.style){
        // :hover が効かないIE6向けに .hover を付与する
        $('input.btn, input.submit').hover(function(){
            this.className += ' hover';
        }, function(){
            this.className = this.className.replace(/hover/, '');
        });
        // :focus が効かないIE6向けに .focus を付与する
        $('input[type="text"], textarea').focus(function(){
            this.className += ' focus';
        }).blur(function(){
            this.className = this.className.replace(/focus/, '');
        });
        // [type="text"] が効かないIE6向けに .type-text を付与する
        $('input[type="text"]').each(function(){
            this.className += ' type-text';
        });
        // label設定によるクリック領域拡大
        $("label:not([for]):has(:input)").each(function(){
            var input = $(this).children(":input");
            input.attr("id", input.attr("id") || generateId());
            $(this).attr("for", input.attr("id"));
        });
        // 既存のと重複しない一意のIDを生成する関数
        function generateId(){
            arguments.callee.count |= 0;
            arguments.callee.count++;
            var id = "generated.input.id$" + arguments.callee.count;
            return document.getElementById(id) == null ? id : generateId();
        }
    }
    
    // jQuery setRollover pluginの実行
    $('.btn').setRollover({ disable : "unroll" });
    
    // jQuery setWindow pluginの実行
    $('#container a[rel=external], #container a[rel=nofollow]').setWindow();
    $('#container a[rel=popup]').setWindow({".type1" : { width:400, height:500 }});
    
    // jQuery setLinkIndication pluginの実行
    $('#container a[rel=external], #container a[rel=nofollow]').not(':has(img)').setLinkIndication({ window_icon: "/ec/inc/compo/img/icon_window.png" });
    $('#container a[rel=popup]').not(':has(img)').setLinkIndication({ popup_icon: "/ec/inc/compo/img/icon_popup.png" });
    $('#container a[href$=pdf]').not(':has(img)').setLinkIndication({ pdf_icon: "/ec/inc/compo/img/icon_pdf.png" });
    
    // jQuery set_height pluginの実行
    $('.new-item > li').set_height({ items_per_row:4, group_by_parent: 'ul' });
    $('.reserve-item > li').set_height({ items_per_row:3, group_by_parent: 'ul' });
    $('.guide > li').set_height({ items_per_row:3, group_by_parent: 'ul' });
    $('.search-results > li').set_height({ items_per_row:3, group_by_parent: 'ol' });
    $('.product-category > li').set_height({ items_per_row:3, group_by_parent: 'ul' });
    $('.product-all-category > li').set_height({ items_per_row:3, group_by_parent: 'ul' });
    $('.login-area section').set_height({ items_per_row:2, group_by_parent: 'div' });
    $('.grid > .unit.size1of2').set_height({ items_per_row:2, group_by_parent: '.grid' });
    $('.grid > .unit.size1of3').set_height({ items_per_row:3, group_by_parent: '.grid' });
    $('.grid > .unit.size1of4').set_height({ items_per_row:4, group_by_parent: '.grid' });
    $('.grid > .unit.size1of2-alt > .box').set_height({ items_per_row:2, group_by_parent: '.grid' });
    $('.box-idx-size1of3 > .cont').set_height({ items_per_row:3, group_by_parent: '.box-idx-size1of3' });
    $('.box-idx-size1of3 > .cont h2').set_height({ items_per_row:3, group_by_parent: '.box-idx-size1of3' });
    
    // jQuery setImgAndCaptionStyler pluginの実行
    $('figure').not('.search-results figure').setImgAndCaptionStyler();
    $('p.R, p.L').not('.search-results figure').setImgAndCaptionStyler2();
    $('ul.image li').setImgAndCaptionStyler();
    $('ul.image li').setImgAndCaptionStyler2();
    
    // jQuery setDictionary pluginの実行
    //$('a.help, .help a').setDictionary({ wrapper:"container", tooltip:"tooltip", speed:300, delay:300 });
    $('a.help').setDictionary({ wrapper:"container", tooltip:"tooltip", speed:300, delay:300 });
    
    // jQuery addMoreNavigation pluginの実行
    $('ul.product-category > li').addMoreNavigation({ speed:100 });
    $('ul.product-all-category > li').addMoreNavigation({ speed:100 });
    
    // jQuery addBookmark pluginの実行
    $('ul.my-action > li.bookmark > a').addBookmark();
    
    // jQuery addTweet pluginの実行
    $('ul.my-action > li.twitter > a').addTweet();
    
    // jQuery addMobile pluginの実行
    //$('ul.my-action > li.mobile > a').addMobile();
    
    // jQuery setAlert pluginの実行
    $('form.help-limitation-alert').setAlert({ wrapper:"container", tooltip:"tooltip", speed:300, delay:300 });

    // h2.toggle01のトグル動作
    $(function($){
        var $_ = $('h2.toggle01');
        $_.wrapInner('span').siblings('div.narrow').hide();
        $_.toggle(function(){
            $('span', this).addClass('minus');
            $(this).siblings('div.narrow').fadeIn(400);
        }, function(){
            $('span', this).removeClass('minus');
            $(this).removeClass('minus').siblings('div.narrow').hide();
        });
    });
    //search input focus
    $(function(){
        $('form.search input.name').blur(function(){
            var _obj = $(this);
            if(_obj.val()==''){_obj.addClass('blur');}
        }).focus(function(){
            var _obj = $(this);
            if(_obj.val()==''){_obj.removeClass('blur');}
        }).blur();
    });

    // jQuery setSlideShow pluginの実行
    $(function(){
        $('.slide-type1').setSlideShow({ animation:"fade", speed:2000, delay:5000, auto:1 });
    });

    //IE bg cache
    try{document.execCommand('BackgroundImageCache', false, true);}catch(e){}

});

})(jQuery);


// -------------------------------------------------------------------
// プラグイン化したものを以下に記述
// -------------------------------------------------------------------

// jQuery addMobile plugin
// 「携帯に転送」を設定します。
// -------------------------------------------------------------------
(function ($) {
    var name_space = 'addMobile';
    $.fn[name_space] = function () {
        return this.each(function () {
            $(this).click(function(){
                var address = $(this).attr("href");
                address = address.replace(/mailto:/, "");
                var title = document.title;
                var url = location.href;
                location.href = "mailto:?subject="+title+"&body="+url+"&to="+address;
                return false;
            });
        });
    };
})(jQuery);


// jQuery addTweet plugin
// 「つぶやく」を設定します。
// -------------------------------------------------------------------
(function ($) {
    var name_space = 'addTweet';
    $.fn[name_space] = function () {
        return this.each(function () {
            $(this).click(function(){
                var f = 'http://twitter.com/home/?status=RT '+encodeURIComponent(document.title)+' '+encodeURIComponent(window.location.href);
                if(!window.open(f, 'surfing')){
                    location.href = f;
                }
                return false;
            });
        });
    };
})(jQuery);


// jQuery addBookmark plugin
// 「お気に入りに追加」を設定します。
// -------------------------------------------------------------------
(function ($) {
    var name_space = 'addBookmark';
    $.fn[name_space] = function () {
        return this.each(function () {
            $(this).attr("rel", "sidebar");
            $(this).click(function(){
                add(document.title, location.href);
                return false;
            });
            function add(title,url) {
                if (window.sidebar) {
                    window.sidebar.addPanel(title, url,"");
                } else if( document.all ) {
                    window.external.AddFavorite( url, title);
                } else if( window.opera && window.print ) {
                    return true;
                }
                else {
                    alert('command+Dを押すと、当ページをブックマークに追加することができます。');
                    return false;
                }
            }
        });
    };
})(jQuery);


// jQuery addMoreNavigation plugin
// U2040110, U2040210
// 商品カテゴリに「もっと見る」を設定します。
// -------------------------------------------------------------------
(function ($) {
    var name_space = 'addMoreNavigation';
    $.fn[name_space] = function (options) {
        var settings = $.extend({
            speed: 'normal'
        }, options);
        var elements = $(this);
        elements.each(function () {
            var target = $('.more-link', this);// トグルする要素
            var more = target.after('<p class="more close"><a href="#">すべて表示</a></p>').next();
            var animFlg = false;// アニメーション中フラグ
            target.hide();
            
            // 高さ揃え
            $('.product-category > li').set_height({ items_per_row:3, group_by_parent: 'ul' });
            $('.product-all-category > li').set_height({ items_per_row:3, group_by_parent: 'ul' });

            $('a', more).toggle(function () {
                if (animFlg) { return }
                animFlg = true;
                var _a = $(this);
                target.slideDown(settings.speed, function () {
                    _a.text("折りたたむ");
                    _a.parent().removeClass('close').addClass('open');
                    $('.product-category > li').set_height({ items_per_row:3, group_by_parent: 'ul' });
                    $('.product-all-category > li').set_height({ items_per_row:3, group_by_parent: 'ul' });
                    $('a', target)[0].focus();
                    animFlg = false;
                });
                return false;
            }, function () {
                if (animFlg) {
                    return
                }
                animFlg = true;
                var _a = $(this);
                target.removeClass('open').addClass('close').slideUp(settings.speed, function () {
                    _a.text("すべて表示");
                    _a.parent().removeClass('open').addClass('close');
                    $('.product-category > li').set_height({ items_per_row:3, group_by_parent: 'ul' });
                    $('.product-all-category > li').set_height({ items_per_row:3, group_by_parent: 'ul' });
                    animFlg = false;
                });
                return false;
            });
        });
        return this;
    };
})(jQuery);


// jQuery setAlert plugin
// 同時購入アラート
// -------------------------------------------------------------------
(function($){
    var name_space = 'setAlert';
    $.fn[name_space] = function(options){
        var settings = $.extend({
        }, options);
        
        return this.each(function (i) {
            $_ = $(this);
            $_.submit(function(){
                //alert("help-limitation-alert");
                return false;
            });
        });
    };
})(jQuery);


// jQuery setDictionary plugin
// ツールチップとして追加情報を表示
// 
// Attributes:
// -@options: オプションのハッシュ
//  -wrapper: ツールチップを含む要素。対象要素のclass名を指定
//  -tooltip: ツールチップ（表示／非表示させる要素）を包含する class 名を設定。デフォルトは"tooltip"
//  -speed: ツールチップ表示時のフェイドアニメーションの実行スピード。ミリセカンドで、デフォルトは300(0.3秒)
//  -delay: アニメーション実行するまでの時間。ミリセカンドで、デフォルトは300(0.3秒)
// -------------------------------------------------------------------
(function($){
    var name_space = 'setDictionary';
    $.fn[name_space] = function(options){
        var settings = $.extend({
            tooltip: "tooltip",
            speed: 300,
            delay: 300
        }, options);
        var tooltip = $("." + settings.tooltip).not("a").css({ position:"absolute", opacity:0.95 }).hide();// 表示/非表示対象となる要素群
        var tip_visible = false;// flag: tooltipがvisible/hidden
        
        return this.each(function (i) {
            $_ = $(this);
            this.index = i;
            var target = tooltip.filter(this.hash);
            var tm = [], delay = settings.delay, speed = settings.speed;
            
            // イベント
            $_.click(function(e){
                tooltip.hide();
                $_show(this, target);
                addPosition(e);
                return false;
            });
            
            $(document).click(function(event){ doc_click(event) });
            if (navigator.userAgent.indexOf('iPhone') != -1) { document.addEventListener("touchstart", doc_click, false) }
            
            function doc_click (event){
                if( $(event.target).attr("class") == settings.tooltip || $(event.target).parents('.'+settings.tooltip).length > 0 ){
                    event.stopPropagation();
                }
                else{
                    $_hide(this, target);
                }
            }

            // イベントが走った要素の位置を起点にしてツールチップのポジションを調整
            function addPosition(event) {
                if (!tip_visible) { return; }
                var limits = {
                    top: $(document).scrollTop(),
                    bottom: $(document).scrollTop() + $(window).height(),
                    left: $(document).scrollLeft(),
                    right: $(document).scrollLeft() + $(window).width()
                };
                // 要素の位置
                var elm_pos = { x: $(event.target).offset().left, y: $(event.target).offset().top }
                // 結果用ポジション
                var real_t_pos = { left: elm_pos.x + 15, top: elm_pos.y + 30 };
                real_t_pos.left = Math.min(real_t_pos.left, limits.right - target.outerWidth());
                
                if ((real_t_pos.top + target.outerHeight()) > limits.bottom && (elm_pos.y - target.outerHeight()) > limits.top) {
                    real_t_pos.top = elm_pos.y - target.outerHeight() - 15;
                }
                target.css({ top: real_t_pos.top, left: real_t_pos.left });
            }
            
            // ターゲット要素の表示/非表示
            var timer;
            function $_show (elem, target) {
                clearTimeout( tm[this.index] );
                tip_visible = true;
                timer = setTimeout(function(){
                    target.fadeIn(speed, function(){
                        if( !$.support.style ) $('select').css("visibility", "hidden");
                        this.setAttribute('tabIndex', 0);
                        this.focus();
                    }).keypress(function(event){
                        var code = event.keyCode;
                        if(code == 27 || code == 8 || code == 37){// Esc key || Backspace || Back
                            $_hide(this, target);
                            this.removeAttribute('tabIndex');
                            elem.focus();
                            event.preventDefault();
                        }
                    });
                }, delay);
            }
            function $_hide (elem, target) {
                clearTimeout( timer );
                tip_visible = false;
                tm[this.index] = setTimeout(function(){
                    target.fadeOut(speed, function(){
                        $('select').css("visibility", "visible");
                    });
                }, 100);
            }
        });
    };
})(jQuery);


// jQuery setRollover plugin
// -------------------------------------------------------------------
(function(a){a.fn.setRollover=function(c){var d=a.extend({disable:"unroll"},c);var b=new Object();return this.each(function(){a("img",this).not('[src*="_o."]').each(function(g){if(a(this).attr("class")==d.disable){return false}var h=this.src;var e=h.substr(h.lastIndexOf("."));var f=h.substr(0,h.lastIndexOf("."));var j=f+"_o"+e;b[this]=new Image();b[this].src=j;a(this).hover(function(){this.src=j},function(){this.src=h})})})}})(jQuery);


// jQuery setWindow plugin
// ポップアップリンクと新規ウィンドウリンクを設定します。
// 「rel="popup"」になってるリンクはポップアップで開き、「rel="external"」のリンクを「target="_blank"」と同じように開きます。
//
// Attributes:
// settings: 設定のハッシュ、{ ".className": { 設定 } }
// 設定は { width:800, height: 600, toolbar: "yes", scrollbars: "yes" } のように設定できます。
//
// Examples:
// :$('a[rel=external]').setWindow();
// =rel=external のリンクを _blank で開きます。
// :$('a[rel=popup]').setWindow({ ".window1": { width:800, height: 600, toolbar: "yes", scrollbars: "yes" } });
// =rel=popup と class="window1" を含むリンクをポップアップで開きます、幅は 800px、縦は 600px、ツールバーとスクロールバーつき。
// -------------------------------------------------------------------
(function(b){var a="setWindow";b.fn[a]=function(c){var d=b(this);d.click(function(){if(this.rel=="external"||this.rel=="nofollow"){window.open(this.href,"_blank");return false}var k="";for(var g in c){if(g.match(/^\.(.*)/)){var e=new RegExp("\\b"+RegExp.$1+"\\b");if(this.className.match(e)){for(param in c[g]){if(param=="name"){continue}k+=param+"="+c[g][param]+","}if(this.href.match(/width=(\d+).*height=(\d+)/)){var f=RegExp.$1;var j=RegExp.$2;if(k.match("width")&&k.match("height")){k=k.replace(/width=\d+/,"width="+f);k=k.replace(/height=\d+/,"height="+j)}else{k+="width="+f+",height="+j}}var h=c[g]["name"]?c[g]["name"]:"popup";window.open(this.href,h,k.split(/,$/)[0]).focus();this.blur();return false}}}})}})(jQuery);


// jQuery setLinkIndication plugin
// target="_balnk"、mailto、参照先がpdf,xls,zipへリンクテキストに自動でアイコンを付与する
// 
// Attributes:
// -@options: オプションのハッシュ
//  -window_icon: 「新しいウィンドウを開く」アイコン画像のパス
//  -popup_icon: 「ポップアップウィンドウを開く」アイコン画像のパス
//  -pdf_icon: PDFアイコン画像のパス
//  -xls_icon: エクセルアイコン画像のパス
//  -dl_icon: ダウンロードアイコン画像のパス
//  -mail_icon: メールアイコン画像のパス
// -------------------------------------------------------------------
(function(B){var A="setLinkIndication";B.fn[A]=function(D){var F=B(this);var E=B.extend({window_icon:false,popup_icon:false,pdf_icon:false,xls_icon:false,dl_icon:false,mail_icon:false},D);var C=new Object();function G(){return function(){var I=B(this);var H=C[this];H=new Image();H.setAttribute("alt","");H.setAttribute("class","icon");if(E.window_icon){H.setAttribute("src",E.window_icon);H.setAttribute("alt","別タブあるいは別ウィンドウでリンクを開きます。");I.not("[href$=pdf]").not("[href$=xls]").not("[href$=zip]").append(H)}if(E.popup_icon){H.setAttribute("src",E.popup_icon);H.setAttribute("alt","ポップアップでリンクを開きます。");I.not("[href$=pdf]").not("[href$=xls]").not("[href$=zip]").append(H)}if(E.pdf_icon){H.setAttribute("src",E.pdf_icon);H.setAttribute("alt","PDFファイルへのリンクです。");I.append(H);I.click(function(){window.open(this.href,"_blank");return false})}if(E.xls_icon){H.setAttribute("src",E.xls_icon);H.setAttribute("alt","XLSファイルへのリンクです。");I.append(H)}if(E.dl_icon){H.setAttribute("src",E.dl_icon);H.setAttribute("alt","ZIPファイルへのリンクです。");I.append(H)}if(E.mail_icon){H.setAttribute("src",E.mail_icon);H.setAttribute("alt","メーラーを立ち上げます。");I.append(H)}}}F.each(G());return this}})(jQuery);


// jQuery set_height plugin
// 対象要素群の高さ揃えを有効にします。
// 
// 対象要素群全ての高さを揃える
// $('ul > li').set_height();
// 対象要素群の中でグループで高さを揃える
// $('ul.index-double > li').set_height({ items_per_row:2, group_by_parent: 'ul' });
// -------------------------------------------------------------------
(function(a){a.fn.set_height=function(q){var g={items_per_row:false,delay:1000,group_by_parent:false};if(q){jQuery.extend(g,q)}if(a("#js_etalon").length){var o=a("#js_etalon").get(0)}else{var o=a("body").append('<span id="js_etalon_wrapper" style="height:0px;overflow:hidden;display:block;"><span id="js_etalon">m</span></span>').find("#js_etalon").get(0)}var e=function(t,s){for(var r=0;r<t.length;r++){if(t[r]==s){return}}t.push(s)};var b=this;var f=[];var m=[];var l=[];var k=function(){for(var t=0;t<f.length;t++){var s=0;var u=f[t][0].currentStyle?parseInt(f[t][0].currentStyle.paddingTop)+parseInt(f[t][0].currentStyle.paddingBottom):parseInt(document.defaultView.getComputedStyle(f[t][0],null).getPropertyValue("padding-top"))+parseInt(document.defaultView.getComputedStyle(f[t][0],null).getPropertyValue("padding-bottom"));for(var r=0;r<f[t].length;r++){f[t][r].style.height="auto";s=Math.max(f[t][r].offsetHeight-u,s)}for(var r=0;r<f[t].length;r++){f[t][r].style.height=s+"px"}}};var n=function(){var z=0;var x=0;var r=null;var u=null;f[z]=[];var A=false;for(var v=0;v<b.length;v++){if(g.group_by_parent){r=a(b[v]).parents(g.group_by_parent)[0];if(v>0&&r!=u&&!A){f[++z]=[];x=0}u=r}if(g.items_per_row){b[v].className+=" nb"+parseInt(x%g.items_per_row+1);if(!(x%g.items_per_row)&&x>0){f[++z]=[];x=0;A=true}}f[z][x++]=b[v];A=false}for(var v=0;v<f.length;v++){if(!f[v][0].offsetHeight){var y=f[v][0];while(y.style.display!="none"){y=y.parentNode}m.push(y)}for(var t=0;t<f[v].length;t++){var w=f[v][t].getElementsByTagName("img");for(var s=0;s<w.length;s++){e(l,w[s].src)}}}};if(b.length){n();var d=o.offsetHeight;var c=setInterval(function(){var t=o.offsetHeight;if(t!=d){d=t;k()}for(var s=0;s<m.length;s++){if(m[s].style.display!="none"){k();m=[];for(var r=0;r<f.length;r++){if(!f[r][0].offsetHeight){var u=f[r][0];while(u.style.display!="none"){u=u.parentNode}m.push(u)}}}}},g.delay);k();if(l.length){var h=[];var p=0;for(var j=0;j<l.length;j++){h[j]=document.createElement("img");h[j].onload=function(){p++;if(p==l.length){k()}};h[j].src=l[j]}}}return this}})(jQuery);


// jQuery setImgParallelStyler plugin
// 画像とキャプションの幅を揃える
// -------------------------------------------------------------------
(function(b){var a="setImgAndCaptionStyler";b.fn[a]=function(c){var d=b(this);function e(){return function(){var h=b(this);var f=b("img",h);function g(){var j=f.width();var i=b("figcaption",h);if(j){i.css("width",j)}}g();f.load(function(){g()})}}d.each(e());return this}})(jQuery);
(function(b){var a="setImgAndCaptionStyler2";b.fn[a]=function(c){var d=b(this);function e(){return function(){var h=b(this);var f=b("img",h);function g(){var j=f.width();var i=b(".figcaption",h);if(j){i.css("width",j)}}g();f.load(function(){g()})}}d.each(e());return this}})(jQuery);


// jQuery setSlideShow plugin
// スライドショー
// 
// * Attributes:
// * -@options: オプションのハッシュ
// *  -animation: 切替アニメーションの種類。デフォルトはフェイド
// *  -speed: 要素を見せるときのスピード。値は、ミリセカンドで、デフォルトは1000（1秒）
// *  -delay: 次の要素に切り替わるまでの時間。値は、ミリセカンドで、デフォルトは5000（5秒）
// *  -auto: 自動切替のON/OFF。値は、0(なし)か1(あり)。デフォルトは0
// -------------------------------------------------------------------
(function(b){var a="setSlideShow";b.fn[a]=function(c){var d=b.extend({animation:"fade",speed:1000,delay:5000,auto:0},c);var e=b(this);function f(){return function(){var g=b(".panel",this);var s=b(".panelArea",this);var r=b("ul.menu > li > a",this);var h;var k=g.width();var t=g.height();var j=g.length;var u=true;g.parent().css({position:"relative",width:k,height:t});g.css({position:"absolute",top:"0",left:"0",width:k,height:t});for(var m=0;m<=j;m++){b(g[m]).css({zIndex:"100"-m})}o(r.filter(":first")[0]);p();if(u==true){r.each(function(w){b(this).hover(function(){clearTimeout("timer");q(this,w)},function(){p()});b(this).click(function(){l(this)})})}g.each(function(){if(b("img",this).filter("[src*=_o.]").length>0){v(b("img",this)[0])}});function l(x){var w=g.filter(x.hash);var i=b("a",w).attr("href");b(x).attr("href",i)}function p(){if(d.auto==0){return false}h=setTimeout(function(){i()},d.delay);function i(){r.each(function(w){if(b(this).parent("li").hasClass("current")){var y=b(this).parent("li").next();var x;(y.length==0)?(x=r.filter(":first")[0]):(x=b(">a",y)[0]);q(x,w);return false}});h=setTimeout(function(){i()},d.delay)}}function q(y,w){clearTimeout(h);var i=b(y);if(!i.parent("li").hasClass("current")){var x=g.filter(y.hash);if(d.animation=="fade"){n.fade(x,d.speed,w)}else{if(d.animation=="slide"){n.slide(x,d.speed,w)}else{return}}o(y)}}function o(w){var i=b(w);r.each(function(y){var A=b(this);A.parent("li").removeClass("current");i.parent("li").addClass("current");g.removeClass("current");g.filter(w.hash).addClass("current");var x=b(">img",this);var z=b(">img",i);if(x.length>0){(A.parent("li").hasClass("current"))?z.attr("src",z.attr("src").replace("_o.","_h.")):x.attr("src",x.attr("src").replace("_h.","_o."))}})}function v(w){var i=new Image;i.src=w.src.replace("_o.","_h.");b(w).hover(function(){w.src=w.src.replace(new RegExp("_o(.[a-z]+)$"),"_h$1")},function(){w.src=w.src.replace("_h","_o")})}var n={};n.fade=function(w,i){u=false;g.hide();w.fadeIn(i,function(){u=true})};n.slide=function(A,z,x){u=false;var w=b("p.current",s);for(var y=0;y<=j;y++){b(g[y]).css({zIndex:"100"-y})}w.css({zIndex:"102"});w.stop(true,false).animate({left:A.width()},z,"easeInCubic",function(){u=true});(x+1==g.length)?b(g[0]).css({left:0}):w.next().css({left:0});A.css({left:"0",zIndex:"101"})}}}e.each(f());return this}})(jQuery);jQuery.easing.jswing=jQuery.easing.swing;jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(e,f,a,h,g){return jQuery.easing[jQuery.easing.def](e,f,a,h,g)},easeInQuad:function(e,f,a,h,g){return h*(f/=g)*f+a},easeOutQuad:function(e,f,a,h,g){return -h*(f/=g)*(f-2)+a},easeInOutQuad:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f+a}return -h/2*((--f)*(f-2)-1)+a},easeInCubic:function(e,f,a,h,g){return h*(f/=g)*f*f+a},easeOutCubic:function(e,f,a,h,g){return h*((f=f/g-1)*f*f+1)+a},easeInOutCubic:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f+a}return h/2*((f-=2)*f*f+2)+a},easeInQuart:function(e,f,a,h,g){return h*(f/=g)*f*f*f+a},easeOutQuart:function(e,f,a,h,g){return -h*((f=f/g-1)*f*f*f-1)+a},easeInOutQuart:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f*f+a}return -h/2*((f-=2)*f*f*f-2)+a},easeInQuint:function(e,f,a,h,g){return h*(f/=g)*f*f*f*f+a},easeOutQuint:function(e,f,a,h,g){return h*((f=f/g-1)*f*f*f*f+1)+a},easeInOutQuint:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f*f*f+a}return h/2*((f-=2)*f*f*f*f+2)+a},easeInSine:function(e,f,a,h,g){return -h*Math.cos(f/g*(Math.PI/2))+h+a},easeOutSine:function(e,f,a,h,g){return h*Math.sin(f/g*(Math.PI/2))+a},easeInOutSine:function(e,f,a,h,g){return -h/2*(Math.cos(Math.PI*f/g)-1)+a},easeInExpo:function(e,f,a,h,g){return(f==0)?a:h*Math.pow(2,10*(f/g-1))+a},easeOutExpo:function(e,f,a,h,g){return(f==g)?a+h:h*(-Math.pow(2,-10*f/g)+1)+a},easeInOutExpo:function(e,f,a,h,g){if(f==0){return a}if(f==g){return a+h}if((f/=g/2)<1){return h/2*Math.pow(2,10*(f-1))+a}return h/2*(-Math.pow(2,-10*--f)+2)+a},easeInCirc:function(e,f,a,h,g){return -h*(Math.sqrt(1-(f/=g)*f)-1)+a},easeOutCirc:function(e,f,a,h,g){return h*Math.sqrt(1-(f=f/g-1)*f)+a},easeInOutCirc:function(e,f,a,h,g){if((f/=g/2)<1){return -h/2*(Math.sqrt(1-f*f)-1)+a}return h/2*(Math.sqrt(1-(f-=2)*f)+1)+a},easeInElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k)==1){return e+l}if(!j){j=k*0.3}if(g<Math.abs(l)){g=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/g)}return -(g*Math.pow(2,10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j))+e},easeOutElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k)==1){return e+l}if(!j){j=k*0.3}if(g<Math.abs(l)){g=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/g)}return g*Math.pow(2,-10*h)*Math.sin((h*k-i)*(2*Math.PI)/j)+l+e},easeInOutElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k/2)==2){return e+l}if(!j){j=k*(0.3*1.5)}if(g<Math.abs(l)){g=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/g)}if(h<1){return -0.5*(g*Math.pow(2,10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j))+e}return g*Math.pow(2,-10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j)*0.5+l+e},easeInBack:function(e,f,a,i,h,g){if(g==undefined){g=1.70158}return i*(f/=h)*f*((g+1)*f-g)+a},easeOutBack:function(e,f,a,i,h,g){if(g==undefined){g=1.70158}return i*((f=f/h-1)*f*((g+1)*f+g)+1)+a},easeInOutBack:function(e,f,a,i,h,g){if(g==undefined){g=1.70158}if((f/=h/2)<1){return i/2*(f*f*(((g*=(1.525))+1)*f-g))+a}return i/2*((f-=2)*f*(((g*=(1.525))+1)*f+g)+2)+a},easeInBounce:function(e,f,a,h,g){return h-jQuery.easing.easeOutBounce(e,g-f,0,h,g)+a},easeOutBounce:function(e,f,a,h,g){if((f/=g)<(1/2.75)){return h*(7.5625*f*f)+a}else{if(f<(2/2.75)){return h*(7.5625*(f-=(1.5/2.75))*f+0.75)+a}else{if(f<(2.5/2.75)){return h*(7.5625*(f-=(2.25/2.75))*f+0.9375)+a}else{return h*(7.5625*(f-=(2.625/2.75))*f+0.984375)+a}}}},easeInOutBounce:function(e,f,a,h,g){if(f<g/2){return jQuery.easing.easeInBounce(e,f*2,0,h,g)*0.5+a}return jQuery.easing.easeOutBounce(e,f*2-g,0,h,g)*0.5+h*0.5+a}});
