var Logger=function(){};Logger.debug=function(){typeof window.console!="undefined"&&window.console.log("DEBUG:",arguments)};
(function(f,a){var d=f.jQuery||f.Cowboy||(f.Cowboy={}),c;d.throttle=c=function(b,e,g,h){function k(){function j(){l=+new Date;g.apply(n,o)}function p(){i=a}var n=this,m=+new Date-l,o=arguments;h&&!i&&j();i&&clearTimeout(i);if(h===a&&m>b)j();else if(e!==true)i=setTimeout(h?p:j,h===a?b-m:b)}var i,l=0;if(typeof e!=="boolean"){h=g;g=e;e=a}if(d.guid)k.guid=g.guid=g.guid||d.guid++;return k};d.debounce=function(b,e,g){return g===a?c(b,e,false):c(b,g,e!=false)}})(this);jQuery.easing.jswing=jQuery.easing.swing;
jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(f,a,d,c,b){return jQuery.easing[jQuery.easing.def](f,a,d,c,b)},easeInQuad:function(f,a,d,c,b){return c*(a/=b)*a+d},easeOutQuad:function(f,a,d,c,b){return-c*(a/=b)*(a-2)+d},easeInOutQuad:function(f,a,d,c,b){if((a/=b/2)<1)return c/2*a*a+d;return-c/2*(--a*(a-2)-1)+d},easeInCubic:function(f,a,d,c,b){return c*(a/=b)*a*a+d},easeOutCubic:function(f,a,d,c,b){return c*((a=a/b-1)*a*a+1)+d},easeInOutCubic:function(f,a,d,c,b){if((a/=b/2)<1)return c/
2*a*a*a+d;return c/2*((a-=2)*a*a+2)+d},easeInQuart:function(f,a,d,c,b){return c*(a/=b)*a*a*a+d},easeOutQuart:function(f,a,d,c,b){return-c*((a=a/b-1)*a*a*a-1)+d},easeInOutQuart:function(f,a,d,c,b){if((a/=b/2)<1)return c/2*a*a*a*a+d;return-c/2*((a-=2)*a*a*a-2)+d},easeInQuint:function(f,a,d,c,b){return c*(a/=b)*a*a*a*a+d},easeOutQuint:function(f,a,d,c,b){return c*((a=a/b-1)*a*a*a*a+1)+d},easeInOutQuint:function(f,a,d,c,b){if((a/=b/2)<1)return c/2*a*a*a*a*a+d;return c/2*((a-=2)*a*a*a*a+2)+d},easeInSine:function(f,
a,d,c,b){return-c*Math.cos(a/b*(Math.PI/2))+c+d},easeOutSine:function(f,a,d,c,b){return c*Math.sin(a/b*(Math.PI/2))+d},easeInOutSine:function(f,a,d,c,b){return-c/2*(Math.cos(Math.PI*a/b)-1)+d},easeInExpo:function(f,a,d,c,b){return a==0?d:c*Math.pow(2,10*(a/b-1))+d},easeOutExpo:function(f,a,d,c,b){return a==b?d+c:c*(-Math.pow(2,-10*a/b)+1)+d},easeInOutExpo:function(f,a,d,c,b){if(a==0)return d;if(a==b)return d+c;if((a/=b/2)<1)return c/2*Math.pow(2,10*(a-1))+d;return c/2*(-Math.pow(2,-10*--a)+2)+d},
easeInCirc:function(f,a,d,c,b){return-c*(Math.sqrt(1-(a/=b)*a)-1)+d},easeOutCirc:function(f,a,d,c,b){return c*Math.sqrt(1-(a=a/b-1)*a)+d},easeInOutCirc:function(f,a,d,c,b){if((a/=b/2)<1)return-c/2*(Math.sqrt(1-a*a)-1)+d;return c/2*(Math.sqrt(1-(a-=2)*a)+1)+d},easeInElastic:function(f,a,d,c,b){f=1.70158;var e=0,g=c;if(a==0)return d;if((a/=b)==1)return d+c;e||(e=b*0.3);if(g<Math.abs(c)){g=c;f=e/4}else f=e/(2*Math.PI)*Math.asin(c/g);return-(g*Math.pow(2,10*(a-=1))*Math.sin((a*b-f)*2*Math.PI/e))+d},easeOutElastic:function(f,
a,d,c,b){f=1.70158;var e=0,g=c;if(a==0)return d;if((a/=b)==1)return d+c;e||(e=b*0.3);if(g<Math.abs(c)){g=c;f=e/4}else f=e/(2*Math.PI)*Math.asin(c/g);return g*Math.pow(2,-10*a)*Math.sin((a*b-f)*2*Math.PI/e)+c+d},easeInOutElastic:function(f,a,d,c,b){f=1.70158;var e=0,g=c;if(a==0)return d;if((a/=b/2)==2)return d+c;e||(e=b*0.3*1.5);if(g<Math.abs(c)){g=c;f=e/4}else f=e/(2*Math.PI)*Math.asin(c/g);if(a<1)return-0.5*g*Math.pow(2,10*(a-=1))*Math.sin((a*b-f)*2*Math.PI/e)+d;return g*Math.pow(2,-10*(a-=1))*Math.sin((a*
b-f)*2*Math.PI/e)*0.5+c+d},easeInBack:function(f,a,d,c,b,e){if(e==undefined)e=1.70158;return c*(a/=b)*a*((e+1)*a-e)+d},easeOutBack:function(f,a,d,c,b,e){if(e==undefined)e=1.70158;return c*((a=a/b-1)*a*((e+1)*a+e)+1)+d},easeInOutBack:function(f,a,d,c,b,e){if(e==undefined)e=1.70158;if((a/=b/2)<1)return c/2*a*a*(((e*=1.525)+1)*a-e)+d;return c/2*((a-=2)*a*(((e*=1.525)+1)*a+e)+2)+d},easeInBounce:function(f,a,d,c,b){return c-jQuery.easing.easeOutBounce(f,b-a,0,c,b)+d},easeOutBounce:function(f,a,d,c,b){return(a/=
b)<1/2.75?c*7.5625*a*a+d:a<2/2.75?c*(7.5625*(a-=1.5/2.75)*a+0.75)+d:a<2.5/2.75?c*(7.5625*(a-=2.25/2.75)*a+0.9375)+d:c*(7.5625*(a-=2.625/2.75)*a+0.984375)+d},easeInOutBounce:function(f,a,d,c,b){if(a<b/2)return jQuery.easing.easeInBounce(f,a*2,0,c,b)*0.5+d;return jQuery.easing.easeOutBounce(f,a*2-b,0,c,b)*0.5+c*0.5+d}});
(function(f){var a={swipeTolerance:40},d=function(b,e){this.target=f(b);this.touch=e;this.startX=this.currentX=e.screenX;this.startY=this.currentY=e.screenY;this.eventType=null};d.options={};d.latestTap=null;d.prototype.move=function(b){this.currentX=b.screenX;this.currentY=b.screenY};d.prototype.process=function(){var b=this.currentX-this.startX,e=this.currentY-this.startY;if(b==0&&e==0)this.checkForDoubleTap();else if(Math.abs(e)>d.options.swipeTolerance&&Math.abs(e)>Math.abs(b)){this.eventType=
e>0?"swipedown":"swipeup";this.target.trigger("swipe",[this])}else if(Math.abs(b)>d.options.swipeTolerance){this.eventType=b>0?"swiperight":"swipeleft";this.target.trigger("swipe",[this])}this.eventType&&this.target.trigger(this.eventType,[this]);this.target.trigger("touch",[this])};d.prototype.checkForDoubleTap=function(){if(d.latestTap)if(new Date-d.latestTap<400)this.eventType="doubletap";if(!this.eventType)this.eventType="tap";d.latestTap=new Date};var c=function(b,e){d.options=f.extend(a,e);
b.bind("touchstart",this.touchStart);b.bind("touchmove",this.touchMove);b.bind("touchcancel",this.touchCancel);b.bind("touchend",this.touchEnd)};c.prototype.touchStart=function(b){var e=this;c.eachTouch(b,function(g){c.touches[g.identifier]=new d(e,g)})};c.prototype.touchMove=function(b){c.eachTouch(b,function(e){var g=c.touches[e.identifier];g&&g.move(e)})};c.prototype.touchCancel=function(b){c.eachTouch(b,function(e){c.purge(e,true)})};c.prototype.touchEnd=function(b){c.eachTouch(b,function(e){c.purge(e)})};
c.touches={};c.purge=function(b,e){if(!e){var g=c.touches[b.identifier];g&&g.process()}delete c.touches[b.identifier]};c.eachTouch=function(b,e){b=b.originalEvent;for(var g=b.changedTouches.length,h=0;h<g;h++)e(b.changedTouches[h])};f.fn.addSwipeEvents=function(b,e){if(!e&&jQuery.isFunction(b)){e=b;b=null}new c(this,b);e&&this.bind("touch",e);return this}})(jQuery);App={};
(function(f){App.init=function(){f('a[href^="http"]').click(function(a){a.preventDefault();window.open(f(this).attr("href"))});f("#sections-header ul li:last-child").addClass("last-child");f(".feature ul li:last-child").addClass("last-child");f(".main article:last-child").addClass("last-child");f("#users .login a").click(function(){f("#users").toggleClass("opened");f("#login-form").fadeToggle()("fast")});f("#slider").nivoSlider({effect:"fold",slices:1,animSpeed:500,pauseTime:3E3,startSlide:0,directionNav:true,
directionNavHide:false,controlNav:true,keyboardNav:true,pauseOnHover:true,captionOpacity:1});f(".caption_bg").fadeTo(10,0.8);f(".nivo-caption p").fadeTo(10,1)}})(jQuery);

$(".chkpublished").button();
$(".chkpublished").click(function() {
    var id = this.id;
    var checked = this.checked;
    var url = id.replace(/_/g,'/');
    $.ajax(
        {
            url: '/admin/' + url,
            data:"checked="+checked,
            context: document.body, success: function(){

            }
        }
    );
});
