/*! carousel-3d - v0.2.0 - 2015-03-13
* Copyright (c) 2015 PAIO co.,Ltd.; Licensed MIT */
!function t(e,i,r){function n(o,h){if(!i[o]){if(!e[o]){var a="function"==typeof require&&require;if(!h&&a)return a(o,!0);if(s)return s(o,!0);var p=new Error("Cannot find module '"+o+"'");throw p.code="MODULE_NOT_FOUND",p}var c=i[o]={exports:{}};e[o][0].call(c.exports,function(t){var i=e[o][1][t];return n(i?i:t)},c,c.exports,t,e,i,r)}return i[o].exports}for(var s="function"==typeof require&&require,o=0;o<r.length;o++)n(r[o]);return n}({1:[function(t,e,i){!function(){"use strict";var e=window.jQuery,i=t("./ChildrenWrapper"),r=t("./Child"),n=function(t){this.el=t,this._makeOption();var r=e(t).children(),n=new i(this),s=0;this.appendChildrenWrapper(n),r.each(function(t,i){e(i).attr("selected")&&(s=t),this.appendChild(i)}.bind(this)),this._prevButton=e("<div data-prev-button></div>")[0],e(this.el).append(this._prevButton),e(this._prevButton).click(this.prev.bind(this)),this._nextButton=e("<div data-next-button></div>")[0],e(this.el).append(this._nextButton),e(this._nextButton).click(this.next.bind(this)),this.rotate(s)};n.prototype.el=null,n.prototype.option={animationDuration:1e3},n.prototype._makeOption=function(){(function(){var t=e("<div data-children-wrapper></div>").hide().appendTo(this.el),i=e("<div data-child></div>").hide().appendTo(t).css("transition-duration");t.remove(),i&&(i.indexOf("ms")>0?this.option.animationDuration=parseInt(i):i.indexOf("s")>0&&(this.option.animationDuration=1e3*parseInt(i)))}).bind(this)()},n.prototype.appendChild=function(t){this._childrenWrapperObj.appendChild(new r(this._childrenWrapperObj,t))},n.prototype.appendChildrenWrapper=function(t){this._childrenWrapperObj=t,e(this.el).append(t.el)},n.prototype.rotate=function(t){for(var i=this._childrenWrapperObj.numChildren(),r=Math.floor(this._childrenWrapperObj.currentIndex()-i/2),n=Math.ceil(this._childrenWrapperObj.currentIndex()+i/2);r>t;)t+=i;for(;t>n;)t-=i;this._childrenWrapperObj.rotate(t),window.setTimeout(function(){for(var i=t;0>i;)i+=this._childrenWrapperObj.numChildren();e(this.el).trigger("select",i%this._childrenWrapperObj.numChildren())}.bind(this),this.option.animationDuration)},n.prototype.prev=function(){this.rotate(this._childrenWrapperObj.currentIndex()-1)},n.prototype.next=function(){this.rotate(this._childrenWrapperObj.currentIndex()+1)},e.fn.Carousel3d=function(){var t,e=this,i=arguments[0],r=Array.prototype.slice.call(arguments,1),s=e.length,o=0;for(o;s>o;o+=1)if("object"==typeof i||"undefined"==typeof i?e[o].Carousel3d=new n(e[o],i):t=e[o].Carousel3d[i].apply(e[o].Carousel3d,r),void 0!==t)return t;return e},e(function(){e("[data-carousel-3d]").Carousel3d()})}()},{"./Child":2,"./ChildrenWrapper":3}],2:[function(t,e,i){!function(){"use strict";var t=window.jQuery,i=window.Modernizr,r=function(e,i){this._childrenWrapperObj=e,this._content=i,this.el=t("<div data-child />")[0],this._frame=t("<div data-child-frame />")[0],this._contentWrapper=t("<div data-content-wrapper />")[0],t(this.el).append(this._frame),t(this._frame).append(this._contentWrapper),t(this._contentWrapper).append(i),this._hideUntilLoad()};r.prototype._childrenWrapperObj=null,r.prototype._content=null,r.prototype.el=null,r.prototype._contentWrapper=null,r.prototype._hideUntilLoad=function(){t(this._content).css("visibility","hidden"),t(this._contentWrapper).waitForImages(function(){setTimeout(function(){this._resize(),t(this._content).resize(this._resize.bind(this)),t(this.el).resize(this._resize.bind(this)),t(this._content).css("visibility","visible")}.bind(this),1)}.bind(this))},r.prototype._resize=function(){t(this._contentWrapper).width(t(this._content).outerWidth()),t(this._contentWrapper).height(t(this._content).outerHeight());var e=t(this._frame).outerWidth()-t(this._frame).innerWidth(),r=t(this._frame).outerHeight()-t(this._frame).innerHeight(),n=(t(this.el).innerWidth()-e)/t(this._content).outerWidth(),s=(t(this.el).innerHeight()-r)/t(this._content).outerHeight(),o=Math.min(n,s),h=Math.floor((t(this.el).innerWidth()-e-t(this._content).outerWidth()*o)/2),a=Math.floor((t(this.el).innerHeight()-r-t(this._content).outerHeight()*o)/2);t(this._frame).width(t(this._content).outerWidth()*o),t(this._frame).height(t(this._content).outerHeight()*o),t(this.el).css("padding-left",h+"px"),t(this.el).css("padding-top",a+"px"),i.csstransforms?(t(this._contentWrapper).css("transform","scale("+o+")"),t(this._contentWrapper).css("-ms-transform","scale("+o+")"),t(this._contentWrapper).css("-moz-transform","scale("+o+")"),t(this._contentWrapper).css("-webkit-transform","scale("+o+")")):(t(this._contentWrapper).css("filter","progid:DXImageTransform.Microsoft.Matrix(M11="+o+", M12=0, M21=0, M22="+o+', SizingMethod="auto expand")'),t(this._contentWrapper).css("-ms-filter","progid:DXImageTransform.Microsoft.Matrix(M11="+o+", M12=0, M21=0, M22="+o+', SizingMethod="auto expand")'))},e.exports=r}()},{}],3:[function(t,e,i){!function(){"use strict";var t=window.jQuery,i=function(e){this._carousel3dObj=e,this.el=t("<div data-children-wrapper></div>")[0],t(e.el).resize(this._resize.bind(this))};i.prototype.el=null,i.prototype._carousel3dObj=null,i.prototype._childObjArray=[],i.prototype._currentIndex=0,i.prototype._tz=0,i.prototype._spacing=.05,i.prototype.currentIndex=function(t){return"undefined"==typeof t||"object"==typeof t||isNaN(t)||(this._currentIndex=t),this._currentIndex},i.prototype._resize=function(){this._tz=t(this.el).outerWidth()/2/Math.tan(Math.PI/this._childObjArray.length),this.rotate(this._currentIndex)},i.prototype.appendChild=function(e){this._childObjArray.push(e),t(this.el).append(e.el),this._resize()},i.prototype.numChildren=function(){return this._childObjArray.length},i.prototype.rotate=function(e){this.currentIndex(e);var i=360/this._childObjArray.length,r=0,n=0;if(Modernizr.csstransforms3d)for(r=0;r<this._childObjArray.length;r+=1){n=i*(r-e);var s="";s+=" translateZ("+-this._tz*(1+this._spacing)+"px)",s+=" rotateY("+n+"deg)",s+=" translateZ("+this._tz*(1+this._spacing)+"px)",t(this._childObjArray[r].el).css("transform",s),t(this._childObjArray[r].el).css("-ms-transform",s),t(this._childObjArray[r].el).css("-moz-transform",s),t(this._childObjArray[r].el).css("-webkit-transform",s),t(this._childObjArray[r].el).css("opacity",Math.cos(Math.PI/180*n)),t(this._childObjArray[r].el).css("z-index",Math.floor(100*(Math.cos(Math.PI/180*n)+1)))}else{var o=t(this.el).width(),h=t(this.el).height(),a=function(e,r){if("_degree"===r.prop){var n=Math.sin(Math.PI/180*e),s=Math.cos(Math.PI/180*e),a=i/2,p=Math.abs(Math.sin(Math.PI/180*(e+a))-Math.sin(Math.PI/180*(e-a)))/(2*Math.sin(Math.PI/180*a))*s,c=(s+1)/2,d=(p+1)/2,l=(n*o/2+o*d/2*n)/2;t(r.elem).css("z-index",Math.floor(100*(s+1))),Modernizr.csstransforms?(t(r.elem).css("left",l+"px"),t(r.elem).css("opacity",s),t(r.elem).css("transform","scale("+d+", "+c+")"),t(r.elem).css("-ms-transform","scale("+d+", "+c+")"),t(r.elem).css("-moz-transform","scale("+d+", "+c+")"),t(r.elem).css("-webkit-transform","scale("+d+", "+c+")")):(t(r.elem).css("top",Math.floor((h-h*c)/2)+"px"),t(r.elem).css("left",(o-o*d)/2+l+"px"),t(r.elem).css("filter","progid:DXImageTransform.Microsoft.Matrix(M11="+d+", M12=0, M21=0, M22="+c+"), progid:DXImageTransform.Microsoft.Alpha(Opacity="+100*s+")"),t(r.elem).css("-ms-filter","progid:DXImageTransform.Microsoft.Matrix(M11="+d+", M12=0, M21=0, M22="+c+"), progid:DXImageTransform.Microsoft.Alpha(Opacity="+100*s+")"))}};for(r=0;r<this._childObjArray.length;r+=1)n=i*(r-e),t(this._childObjArray[r].el).animate({_degree:n},{duration:this._carousel3dObj.option.animationDuration,step:a.bind(this)})}},e.exports=i}()},{}]},{},[1]),function(){"use strict";var t=$.fn.resize;$.fn.resize=function(e){var i=$(this).width(),r=$(this).height();t.call(this,function(){($(this).width()!==i||$(this).height()!==r)&&(i=$(this).width(),r=$(this).height(),e(this))}.bind(this))}}();