/* name:htool (zepto tools) version:0.3.7 updated:2016.02.01 */ if("undefined"==typeof jquery){var jquery=zepto;if("undefined"==typeof isie6)var isie6=!1}!function(a){function b(a){return("touch"==a.pointertype||a.pointertype==a.mspointer_type_touch)&&a.isprimary}function c(a,b){return a.type=="pointer"+b||a.type.tolowercase()=="mspointer"+b}a.fn.addanimate=function(b){return b?void a(this).addclass(b+" animated").one("webkitanimationend mozanimationend msanimationend oanimationend animationend",function(){a(this).removeanimate(b)}):this},a.fn.removeanimate=function(b){b||(b=""),a(this).removeclass(b+" animated")},a.adaptivewidth=function(b){function e(){if(a("body").width()){if(c.width||(c.width=a("body").width()),c.width){if(0<=a(window).width()-c.width&&a(window).width()-c.width<=30)return!1;f()}a("body").ready(function(){f(),"transform"==c.mode&&g()}),a(window).resize(function(){f()})}else settimeout(function(){e()},100)}function f(){var b=a(window).width()/c.width;if(b==d)return!1;if(d=b,"transform"==c.mode){d>1?a("body").css({"-webkit-transform-origin":"top center","-moz-transform-origin":"top center","-o-transform-origin":"top center","-ms-transform-origin":"top center","transform-origin":"top center"}):a("body").css({"-webkit-transform-origin":"0 0","-moz-transform-origin":"0 0","-o-transform-origin":"0 0","-ms-transform-origin":"0 0","transform-origin":"0 0"});var e="scale("+d+")";a("body").css({"-webkit-transform":e,"-moz-transform":e,"-o-transform":e,"-ms-transform":e,transform:e})}else a("body").css("zoom",d)}function g(){function g(){b=a(window).height(),d=a(window).width()/c.width,e.each(function(c){var d=a(this),e=d.attr("class");d.removeclass(),d.css("top",null),d.css("bottom",null),d.addclass(e);var g=d.css("top"),h=d.css("bottom"),i=parsefloat(g),j=parsefloat(h),k={top:0,bottom:0,height:0};isnan(i)===!1&&b>i?(0!=i&&-1!=g.tolowercase().indexof("%")&&(i=i/100*b),k.top=i):isnan(j)===!1&&b>j&&(0!=j&&-1!=h.tolowercase().indexof("%")&&(j=j/100*b),k.bottom=j,k.height=d.outerheight()),d.css("position","absolute"),f[c]=k}),h()}function h(){b=a(window).height(),e.each(function(c){var e=a(this),g=f[c];g.height>0&&(g.height=e.outerheight(),g.top=b-g.bottom),e.css("top",(a(window).scrolltop()+g.top-g.height)/d)})}a("body").css({"background-attachment":"fixed"}),"none"==a("body").css("background-image")&&a("html").css("background-image","url(about:blank)");var b=a(window).height();a("div").each(function(){var b=a(this);"fixed"==b.css("position")&&(b.css("position","absolute"),b.addclass("transform-fixed"))});var e=a(".transform-fixed"),f={};g();var i;a(window).scroll(function(a){cleartimeout(i),e.fadeto(0,0),i=settimeout(function(){h(),e.fadeto(1e3,1)},500)}),a(window).resize(function(){settimeout(function(){g()},100)})}var c=a.extend({},a.adaptivewidth.defaults,b),d=1;"zoom"==c.mode&&""==a("body").css("zoom")&&(c.mode="transform"),e()},a.adaptivewidth.defaults={width:0,mode:"zoom",scale:1},a.fn.outerwidth=function(){var b=a(this),c=parsefloat(b.css("margin-left"))+parsefloat(b.css("margin-right"));return a(this).width()+c},a.fn.outerheight=function(){var b=a(this),c=parsefloat(b.css("margin-top"))+parsefloat(b.css("margin-bottom"));return a(this).height()+c},a.fn.touch_scroll=function(d){var e=a.extend({},a.fn.touch_scroll.defaults,d);a(this).each(function(d){function t(){s||(e[j]-=o.num,e[j]>0?e[j]=0:e[j]<-i&&(e[j]=-i),s=!0,k=0,l=0,m=0,n=0)}var f=a(this),g=f.find(e.cont);if(e.num>0&&g.length<=e.num)return!1;var h=g.parent();if(1==e.mode){var i=g.length*g.outerwidth();h.width(i),i-=h.parent().width()}else{var i=math.ceil(g.length/math.floor(f.width()/g.outerwidth()))*g.outerheight();h.height(i),i-=h.parent().height()}var j=1==e.mode?"x":"y",k=0,l=0,m=0,n=0,o={x:0,y:0,num:0};e.x=0,e.y=0,e.translate=function(){return{translate:e.x+"px,"+e.y+"px"}},e.touch=function(){if(o.x=math.abs(l-k),o.y=math.abs(n-m),1==e.mode){if(o.xo.y)return!1;o.num=m-n}return!0};var q=!1,r=!1,s=!0;f.on("touchstart mspointerdown pointerdown",function(a){s&&(q=!0,(!(_ispointertype=c(a,"down"))||b(a))&&(firsttouch=_ispointertype?a:a.touches[0],k=firsttouch.pagex,m=firsttouch.pagey))}),f.on("touchmove mspointermove pointermove",function(a){if(q&&(!(_ispointertype=c(a,"move"))||b(a))&&(firsttouch=_ispointertype?a:a.touches[0],l=firsttouch.pagex,n=firsttouch.pagey,0!=e.touch())){r=!0,s=!1,f.find("h3").html("opts:"+e[j]+",num:"+o.num);var d=e[j];return e[j]-=o.num,e[j]>0?e[j]=0:e[j]<-i&&(e[j]=-i),h.animate(e.translate(),0),e[j]=d,!1}}),f.on("touchend mspointerup pointerup",function(a){return r?(q=!1,r=!1,void((!(_ispointertype=c(a,"up"))||b(a))&&(l=firsttouch.pagex,n=firsttouch.pagey,t()))):(q=!1,r=!1,void(s=!0))}),f.on("touchcancel mspointercancel pointercancel",function(){t()})})},a.fn.touch_scroll.defaults={cont:"li",num:1,mode:1},a.fn.roll_settab=function(d){var e=a.extend({},a.fn.roll_settab.defaults,d);a(this).each(function(d){function w(a){g.eq(m-1).removeclass("hover"),"prev"==a?m--:m++,1>m?g.eq(k).addclass("hover"):m>n?g.eq(0).addclass("hover"):g.eq(m-1).addclass("hover"),e[l]=-r*m,p.animate(e.translate(),e.anispeed,function(){0==m?(m=n,e[l]=-r*n,p.animate(e.translate(),0)):m>n?(m=1,e[l]=-r,p.animate(e.translate(),0)):(e[l]=-r*m,p.animate(e.translate(),0))}),0==m?m=n:m>n&&(m=1)}function x(a){g.eq(m).removeclass("hover"),h.hide(),m="prev"==a?m>0?m-1:k:k>m?m+1:0,g.eq(m).addclass("hover");var b=m*e.shownum;h.slice(b,b+e.shownum).fadein(e.anispeed)}function z(){e.roll?w("next"):x("next"),a()}function a(){y=settimeout(function(){z()},e.speed)}function b(){cleartimeout(y)}function l(){if(!k){var a=g.num;k=!0,c=0,d=0,e=0,f=0,a>0?e.roll?w("next"):x("next"):0>a&&(e.roll?w("prev"):x("prev"))}}var f=a(this),g=f.find(e.list),h=f.find(e.cont);if(e.num>0&&h.length<=e.num)return!1;var i=f.find(e.prev),j=f.find(e.next),k=math.ceil(h.length/e.shownum)-1,l=1==e.mode?"x":"y";if(e.roll){var m=1,n=k+1;e.x=0,e.y=0,e.translate=function(){return{translate:e.x+"px,"+e.y+"px"}};var p=h.parent(),q=n*e.shownum-h.length;if(1==e.mode){var r=h.outerwidth()*e.shownum;if(p.width((n+2)*r),q>0){var s=h.outerwidth()*q;h.eq(-1).animate({"margin-right":"+="+s},0)}}else{var r=h.outerheight()*e.shownum;if(p.height((n+2)*r),q>0){var t=h.outerheight()*q;h.eq(-1).animate({"margin-bottom":"+="+t},0)}}var u=p.find(e.cont+":gt("+(h.length-e.shownum+q-1)+")"),v=p.find(e.cont+":lt("+e.shownum+")");p.prepend(u.clone()),p.append(v.clone()),e[l]=-r,p.animate(e.translate(),0),i.tap(function(){w("prev")}),j.tap(function(){w("next")}),g.each(function(b){var c=a(this);c.tap(function(){return m==b+1||b>k?!1:(g.removeclass("hover"),a(this).removeclass("active"),a(this).addclass("hover"),e[l]=-r-r*b,p.animate(e.translate(),e.anispeed),void(m=b+1))})})}else{var m=0;i.tap(function(){x("prev")}),j.tap(function(){x("next")}),g.each(function(b){var c=a(this);c.tap(function(){g.removeclass("hover"),a(this).removeclass("active"),a(this).addclass("hover"),h.hide();var c=b*e.shownum;h.slice(c,c+e.shownum).fadein(e.anispeed),m=b})}),h.hide(),h.slice(0,e.shownum).show()}if(g.eq(0).addclass("hover"),e.autoplay){var y;f.on("touchstart mspointerdown pointerdown",function(a){b()}),f.on("touchend mspointerup pointerup",function(a){a()}),f.on("touchcancel mspointercancel pointercancel",function(){a()}),a()}var c=0,d=0,e=0,f=0,g={x:0,y:0,num:0};e.touch=function(){if(g.x=math.abs(d-c),g.y=math.abs(f-e),1==e.mode){if(g.xg.y)return!1;g.num=e-f}return!0};var i=!1,j=!1,k=!0;f.on("touchstart mspointerdown pointerdown",function(a){k&&(i=!0,(!(_ispointertype=c(a,"down"))||b(a))&&(firsttouch=_ispointertype?a:a.touches[0],c=firsttouch.pagex,e=firsttouch.pagey,cleartimeout(y)))}),f.on("touchmove mspointermove pointermove",function(a){if(i&&(!(_ispointertype=c(a,"move"))||b(a))){if(firsttouch=_ispointertype?a:a.touches[0],d=firsttouch.pagex,f=firsttouch.pagey,!e.roll)return!1;if(0!=e.touch()){j=!0,k=!1;var d=e[l];return e[l]-=g.num,p.animate(e.translate(),0),e[l]=d,!1}}}),f.on("touchend mspointerup pointerup",function(a){return j?(i=!1,j=!1,void((!(_ispointertype=c(a,"up"))||b(a))&&(d=firsttouch.pagex,f=firsttouch.pagey,l()))):(i=!1,j=!1,void(k=!0))}),f.on("touchcancel mspointercancel pointercancel",function(){l()})})},a.fn.roll_settab.defaults={list:".list li",cont:".cont li",prev:".prev",next:".next",mode:1,shownum:1,add:0,num:0,anispeed:300,speed:5e3,roll:!1,autoplay:!1},a.fn.settab=function(b){var c=a.extend({},a.fn.settab.defaults,b);a(this).each(function(b){function i(){d++,d==h&&(d=0),e.eq(d).trigger(c.listevent),j()}function j(){g=settimeout(function(){i()},c.speed)}var d=0,e=a(this).find(c.list),f=a(this).find(c.cont);if(c.hide?(f.each(function(b){var c=a(this);e.eq(b).tap(function(g){e.eq(d).show(),a(this).hide(),f.hide(),c.show(),d=b})}),e.eq(0).hide()):(f.each(function(b){var c=a(this);e.eq(b).tap(function(g){e.removeclass("hover"),a(this).addclass("hover"),f.hide(),c.show(),d=b})}),e.eq(0).addclass("hover")),f.hide(),f.eq(0).show(),c.autoplay){var g,h=f.length;e.tap(function(a){clearinterval(g),j()}),j()}})},a.fn.settab.defaults={list:".list li",cont:".cont li",hide:!1,speed:5e3,autoplay:!1},a.fn.setmenu=function(b){var c=a.extend({},a.fn.setmenu.defaults,b);c.direction=c.direction.tolowercase(),a(this).each(function(){function m(){var a=e?h:i;d.animate(a,function(){e||(""!=c.style&&d.removeclass(c.style),""!=c.active&&(d.attr("style",j),d.addclass(c.active)))},c.speed)}function n(){e=1,""!=c.active&&d.removeclass(c.active),""!=c.style&&d.attr("style",j),d.addclass(c.style),m()}function o(){e=0,m()}var b=a(this),d=b.find(c.cont),e=0,g=0,h={},i={},j=d.attr("sytle"),k=d.outerheight(),l=d.outerwidth();switch(c.direction){case"up":h={top:-k,height:k},i={top:0,height:0};break;case"left":h={left:-l,width:l},i={left:0,width:0};break;case"right":h={right:-l,width:l},i={right:0,width:0};break;case"down":default:h={height:k},i={height:0}}d.css(i),b.tap(function(){e?o():n(),g=1}),a("body").tap(function(){!g&&e&&o(),g=0})})},a.fn.setmenu.defaults={cont:"li",direction:"down",style:"hover",active:"active",speed:300},a.cookie=function(b,c,d){var e,f,g,h;return arguments.length>1&&"[object object]"!==string(c)?(d=a.extend({},d),(null===c||void 0===c)&&(d.expires=-1),"number"==typeof d.expires&&(e=24*d.expires*60*60*1e3,f=d.expires=new date,f.settime(f.gettime()+e)),c=string(c),document.cookie=[encodeuricomponent(b),"=",d.raw?c:encodeuricomponent(c),d.expires?"; expires="+d.expires.toutcstring():"",d.path?"; path="+d.path:"",d.domain?"; domain="+d.domain:"",d.secure?"; secure":""].join("")):(d=c||{},h=d.raw?function(a){return a}:decodeuricomponent,(g=new regexp("(?:^|; )"+encodeuricomponent(b)+"=([^;]*)").exec(document.cookie))?h(g[1]):null)}}(zepto);