/*
 * jQuery throttle / debounce - v1.1 - 3/7/2010
 * http://benalman.com/projects/jquery-throttle-debounce-plugin/
 * 
 * Copyright (c) 2010 "Cowboy" Ben Alman
 * Dual licensed under the MIT and GPL licenses.
 * http://benalman.com/about/license/
 */
(function(b,c){
    var $=b.jQuery||b.Cowboy||(b.Cowboy={}),a;
    $.throttle=a=function(e,f,j,i){
        var h,d=0;
        if(typeof f!=="boolean"){
            i=j;
            j=f;
            f=c
        }
        function g(){
            var o=this,m=+new Date()-d,n=arguments;
            function l(){
                d=+new Date();
                j.apply(o,n)
            }
            function k(){
                h=c
            }
            if(i&&!h){
                l()
            }
            h&&clearTimeout(h);
            if(i===c&&m>e){
                l()
            }else{
                if(f!==true){
                    h=setTimeout(i?k:l,i===c?e-m:e)
                }
            }
        }
        if($.guid){
            g.guid=j.guid=j.guid||$.guid++
        }
        return g
    };

    $.debounce=function(d,e,f){
        return f===c?a(d,e,false):a(d,f,e!==false)
    }
})(this);
jQuery.easing.jswing=jQuery.easing.swing;
jQuery.extend(jQuery.easing,{
    def:"easeOutQuad",
    swing:function(e,a,c,b,d){
        return jQuery.easing[jQuery.easing.def](e,a,c,b,d)
    },
    easeInQuad:function(e,a,c,b,d){
        return b*(a/=d)*a+c
    },
    easeOutQuad:function(e,a,c,b,d){
        return-b*(a/=d)*(a-2)+c
    },
    easeInOutQuad:function(e,a,c,b,d){
        if((a/=d/2)<1)return b/2*a*a+c;
        return-b/2*(--a*(a-2)-1)+c
    },
    easeInCubic:function(e,a,c,b,d){
        return b*(a/=d)*a*a+c
    },
    easeOutCubic:function(e,a,c,b,d){
        return b*((a=a/d-1)*a*a+1)+c
    },
    easeInOutCubic:function(e,a,c,b,d){
        if((a/=d/2)<1)return b/
            2*a*a*a+c;
        return b/2*((a-=2)*a*a+2)+c
    },
    easeInQuart:function(e,a,c,b,d){
        return b*(a/=d)*a*a*a+c
    },
    easeOutQuart:function(e,a,c,b,d){
        return-b*((a=a/d-1)*a*a*a-1)+c
    },
    easeInOutQuart:function(e,a,c,b,d){
        if((a/=d/2)<1)return b/2*a*a*a*a+c;
        return-b/2*((a-=2)*a*a*a-2)+c
    },
    easeInQuint:function(e,a,c,b,d){
        return b*(a/=d)*a*a*a*a+c
    },
    easeOutQuint:function(e,a,c,b,d){
        return b*((a=a/d-1)*a*a*a*a+1)+c
    },
    easeInOutQuint:function(e,a,c,b,d){
        if((a/=d/2)<1)return b/2*a*a*a*a*a+c;
        return b/2*((a-=2)*a*a*a*a+2)+c
    },
    easeInSine:function(e,
        a,c,b,d){
        return-b*Math.cos(a/d*(Math.PI/2))+b+c
    },
    easeOutSine:function(e,a,c,b,d){
        return b*Math.sin(a/d*(Math.PI/2))+c
    },
    easeInOutSine:function(e,a,c,b,d){
        return-b/2*(Math.cos(Math.PI*a/d)-1)+c
    },
    easeInExpo:function(e,a,c,b,d){
        return a==0?c:b*Math.pow(2,10*(a/d-1))+c
    },
    easeOutExpo:function(e,a,c,b,d){
        return a==d?c+b:b*(-Math.pow(2,-10*a/d)+1)+c
    },
    easeInOutExpo:function(e,a,c,b,d){
        if(a==0)return c;
        if(a==d)return c+b;
        if((a/=d/2)<1)return b/2*Math.pow(2,10*(a-1))+c;
        return b/2*(-Math.pow(2,-10*--a)+2)+c
    },
    easeInCirc:function(e,a,c,b,d){
        return-b*(Math.sqrt(1-(a/=d)*a)-1)+c
    },
    easeOutCirc:function(e,a,c,b,d){
        return b*Math.sqrt(1-(a=a/d-1)*a)+c
    },
    easeInOutCirc:function(e,a,c,b,d){
        if((a/=d/2)<1)return-b/2*(Math.sqrt(1-a*a)-1)+c;
        return b/2*(Math.sqrt(1-(a-=2)*a)+1)+c
    },
    easeInElastic:function(e,a,c,b,d){
        e=1.70158;
        var f=0,g=b;
        if(a==0)return c;
        if((a/=d)==1)return c+b;
        f||(f=d*0.3);
        if(g<Math.abs(b)){
            g=b;
            e=f/4
        }else e=f/(2*Math.PI)*Math.asin(b/g);
        return-(g*Math.pow(2,10*(a-=1))*Math.sin((a*d-e)*2*Math.PI/f))+c
    },
    easeOutElastic:function(e,
        a,c,b,d){
        e=1.70158;
        var f=0,g=b;
        if(a==0)return c;
        if((a/=d)==1)return c+b;
        f||(f=d*0.3);
        if(g<Math.abs(b)){
            g=b;
            e=f/4
        }else e=f/(2*Math.PI)*Math.asin(b/g);
        return g*Math.pow(2,-10*a)*Math.sin((a*d-e)*2*Math.PI/f)+b+c
    },
    easeInOutElastic:function(e,a,c,b,d){
        e=1.70158;
        var f=0,g=b;
        if(a==0)return c;
        if((a/=d/2)==2)return c+b;
        f||(f=d*0.3*1.5);
        if(g<Math.abs(b)){
            g=b;
            e=f/4
        }else e=f/(2*Math.PI)*Math.asin(b/g);
        if(a<1)return-0.5*g*Math.pow(2,10*(a-=1))*Math.sin((a*d-e)*2*Math.PI/f)+c;
        return g*Math.pow(2,-10*(a-=1))*Math.sin((a*
            d-e)*2*Math.PI/f)*0.5+b+c
    },
    easeInBack:function(e,a,c,b,d,f){
        if(f==undefined)f=1.70158;
        return b*(a/=d)*a*((f+1)*a-f)+c
    },
    easeOutBack:function(e,a,c,b,d,f){
        if(f==undefined)f=1.70158;
        return b*((a=a/d-1)*a*((f+1)*a+f)+1)+c
    },
    easeInOutBack:function(e,a,c,b,d,f){
        if(f==undefined)f=1.70158;
        if((a/=d/2)<1)return b/2*a*a*(((f*=1.525)+1)*a-f)+c;
        return b/2*((a-=2)*a*(((f*=1.525)+1)*a+f)+2)+c
    },
    easeInBounce:function(e,a,c,b,d){
        return b-jQuery.easing.easeOutBounce(e,d-a,0,b,d)+c
    },
    easeOutBounce:function(e,a,c,b,d){
        return(a/=
            d)<1/2.75?b*7.5625*a*a+c:a<2/2.75?b*(7.5625*(a-=1.5/2.75)*a+0.75)+c:a<2.5/2.75?b*(7.5625*(a-=2.25/2.75)*a+0.9375)+c:b*(7.5625*(a-=2.625/2.75)*a+0.984375)+c
    },
    easeInOutBounce:function(e,a,c,b,d){
        if(a<d/2)return jQuery.easing.easeInBounce(e,a*2,0,b,d)*0.5+c;
        return jQuery.easing.easeOutBounce(e,a*2-d,0,b,d)*0.5+b*0.5+c
    }
});
// Underscore.js 1.1.6
// (c) 2011 Jeremy Ashkenas, DocumentCloud Inc.
// Underscore is freely distributable under the MIT license.
// Portions of Underscore are inspired or borrowed from Prototype,
// Oliver Steele's Functional, and John Resig's Micro-Templating.
// For all details and documentation:
// http://documentcloud.github.com/underscore
(function(){
    var p=this,C=p._,m={},i=Array.prototype,n=Object.prototype,f=i.slice,D=i.unshift,E=n.toString,l=n.hasOwnProperty,s=i.forEach,t=i.map,u=i.reduce,v=i.reduceRight,w=i.filter,x=i.every,y=i.some,o=i.indexOf,z=i.lastIndexOf;
    n=Array.isArray;
    var F=Object.keys,q=Function.prototype.bind,b=function(a){
        return new j(a)
    };

    typeof module!=="undefined"&&module.exports?(module.exports=b,b._=b):p._=b;
    b.VERSION="1.1.6";
    var h=b.each=b.forEach=function(a,c,d){
        if(a!=null)if(s&&a.forEach===s)a.forEach(c,d);
            else if(b.isNumber(a.length))for(var e=
                0,k=a.length;e<k;e++){
                if(c.call(d,a[e],e,a)===m)break
            }else for(e in a)if(l.call(a,e)&&c.call(d,a[e],e,a)===m)break
    };

    b.map=function(a,c,b){
        var e=[];
        if(a==null)return e;
        if(t&&a.map===t)return a.map(c,b);
        h(a,function(a,g,G){
            e[e.length]=c.call(b,a,g,G)
        });
        return e
    };

    b.reduce=b.foldl=b.inject=function(a,c,d,e){
        var k=d!==void 0;
        a==null&&(a=[]);
        if(u&&a.reduce===u)return e&&(c=b.bind(c,e)),k?a.reduce(c,d):a.reduce(c);
        h(a,function(a,b,f){
            !k&&b===0?(d=a,k=!0):d=c.call(e,d,a,b,f)
        });
        if(!k)throw new TypeError("Reduce of empty array with no initial value");
        return d
    };

    b.reduceRight=b.foldr=function(a,c,d,e){
        a==null&&(a=[]);
        if(v&&a.reduceRight===v)return e&&(c=b.bind(c,e)),d!==void 0?a.reduceRight(c,d):a.reduceRight(c);
        a=(b.isArray(a)?a.slice():b.toArray(a)).reverse();
        return b.reduce(a,c,d,e)
    };

    b.find=b.detect=function(a,c,b){
        var e;
        A(a,function(a,g,f){
            if(c.call(b,a,g,f))return e=a,!0
        });
        return e
    };

    b.filter=b.select=function(a,c,b){
        var e=[];
        if(a==null)return e;
        if(w&&a.filter===w)return a.filter(c,b);
        h(a,function(a,g,f){
            c.call(b,a,g,f)&&(e[e.length]=a)
        });
        return e
    };
    b.reject=function(a,c,b){
        var e=[];
        if(a==null)return e;
        h(a,function(a,g,f){
            c.call(b,a,g,f)||(e[e.length]=a)
        });
        return e
    };

    b.every=b.all=function(a,c,b){
        var e=!0;
        if(a==null)return e;
        if(x&&a.every===x)return a.every(c,b);
        h(a,function(a,g,f){
            if(!(e=e&&c.call(b,a,g,f)))return m
        });
        return e
    };

    var A=b.some=b.any=function(a,c,d){
        c||(c=b.identity);
        var e=!1;
        if(a==null)return e;
        if(y&&a.some===y)return a.some(c,d);
        h(a,function(a,b,f){
            if(e=c.call(d,a,b,f))return m
        });
        return e
    };

    b.include=b.contains=function(a,c){
        var b=
        !1;
        if(a==null)return b;
        if(o&&a.indexOf===o)return a.indexOf(c)!=-1;
        A(a,function(a){
            if(b=a===c)return!0
        });
        return b
    };

    b.invoke=function(a,c){
        var d=f.call(arguments,2);
        return b.map(a,function(a){
            return(c.call?c||a:a[c]).apply(a,d)
        })
    };

    b.pluck=function(a,c){
        return b.map(a,function(a){
            return a[c]
        })
    };

    b.max=function(a,c,d){
        if(!c&&b.isArray(a))return Math.max.apply(Math,a);
        var e={
            computed:-Infinity
        };

        h(a,function(a,b,f){
            b=c?c.call(d,a,b,f):a;
            b>=e.computed&&(e={
                value:a,
                computed:b
            })
        });
        return e.value
    };

    b.min=function(a,
        c,d){
        if(!c&&b.isArray(a))return Math.min.apply(Math,a);
        var e={
            computed:Infinity
        };

        h(a,function(a,b,f){
            b=c?c.call(d,a,b,f):a;
            b<e.computed&&(e={
                value:a,
                computed:b
            })
        });
        return e.value
    };

    b.sortBy=function(a,c,d){
        return b.pluck(b.map(a,function(a,b,f){
            return{
                value:a,
                criteria:c.call(d,a,b,f)
            }
        }).sort(function(a,b){
            var c=a.criteria,d=b.criteria;
            return c<d?-1:c>d?1:0
        }),"value")
    };

    b.sortedIndex=function(a,c,d){
        d||(d=b.identity);
        for(var e=0,f=a.length;e<f;){
            var g=e+f>>1;
            d(a[g])<d(c)?e=g+1:f=g
        }
        return e
    };

    b.toArray=
    function(a){
        if(!a)return[];
        if(a.toArray)return a.toArray();
        if(b.isArray(a))return a;
        if(b.isArguments(a))return f.call(a);
        return b.values(a)
    };

    b.size=function(a){
        return b.toArray(a).length
    };

    b.first=b.head=function(a,b,d){
        return b!=null&&!d?f.call(a,0,b):a[0]
    };

    b.rest=b.tail=function(a,b,d){
        return f.call(a,b==null||d?1:b)
    };

    b.last=function(a){
        return a[a.length-1]
    };

    b.compact=function(a){
        return b.filter(a,function(a){
            return!!a
        })
    };

    b.flatten=function(a){
        return b.reduce(a,function(a,d){
            if(b.isArray(d))return a.concat(b.flatten(d));
            a[a.length]=d;
            return a
        },[])
    };

    b.without=function(a){
        var c=f.call(arguments,1);
        return b.filter(a,function(a){
            return!b.include(c,a)
        })
    };

    b.uniq=b.unique=function(a,c){
        return b.reduce(a,function(a,e,f){
            if(0==f||(c===!0?b.last(a)!=e:!b.include(a,e)))a[a.length]=e;
            return a
        },[])
    };

    b.intersect=function(a){
        var c=f.call(arguments,1);
        return b.filter(b.uniq(a),function(a){
            return b.every(c,function(c){
                return b.indexOf(c,a)>=0
            })
        })
    };

    b.zip=function(){
        for(var a=f.call(arguments),c=b.max(b.pluck(a,"length")),d=Array(c),
            e=0;e<c;e++)d[e]=b.pluck(a,""+e);
        return d
    };

    b.indexOf=function(a,c,d){
        if(a==null)return-1;
        var e;
        if(d)return d=b.sortedIndex(a,c),a[d]===c?d:-1;
        if(o&&a.indexOf===o)return a.indexOf(c);
        d=0;
        for(e=a.length;d<e;d++)if(a[d]===c)return d;return-1
    };

    b.lastIndexOf=function(a,b){
        if(a==null)return-1;
        if(z&&a.lastIndexOf===z)return a.lastIndexOf(b);
        for(var d=a.length;d--;)if(a[d]===b)return d;return-1
    };

    b.range=function(a,b,d){
        arguments.length<=1&&(b=a||0,a=0);
        d=arguments[2]||1;
        for(var e=Math.max(Math.ceil((b-a)/
            d),0),f=0,g=Array(e);f<e;)g[f++]=a,a+=d;
        return g
    };

    b.bind=function(a,b){
        if(a.bind===q&&q)return q.apply(a,f.call(arguments,1));
        var d=f.call(arguments,2);
        return function(){
            return a.apply(b,d.concat(f.call(arguments)))
        }
    };

    b.bindAll=function(a){
        var c=f.call(arguments,1);
        c.length==0&&(c=b.functions(a));
        h(c,function(c){
            a[c]=b.bind(a[c],a)
        });
        return a
    };

    b.memoize=function(a,c){
        var d={};

        c||(c=b.identity);
        return function(){
            var b=c.apply(this,arguments);
            return l.call(d,b)?d[b]:d[b]=a.apply(this,arguments)
        }
    };

    b.delay=
    function(a,b){
        var d=f.call(arguments,2);
        return setTimeout(function(){
            return a.apply(a,d)
        },b)
    };

    b.defer=function(a){
        return b.delay.apply(b,[a,1].concat(f.call(arguments,1)))
    };

    var B=function(a,b,d){
        var e;
        return function(){
            var f=this,g=arguments,h=function(){
                e=null;
                a.apply(f,g)
            };

            d&&clearTimeout(e);
            if(d||!e)e=setTimeout(h,b)
        }
    };

    b.throttle=function(a,b){
        return B(a,b,!1)
    };

    b.debounce=function(a,b){
        return B(a,b,!0)
    };

    b.once=function(a){
        var b=!1,d;
        return function(){
            if(b)return d;
            b=!0;
            return d=a.apply(this,arguments)
        }
    };
    b.wrap=function(a,b){
        return function(){
            var d=[a].concat(f.call(arguments));
            return b.apply(this,d)
        }
    };

    b.compose=function(){
        var a=f.call(arguments);
        return function(){
            for(var b=f.call(arguments),d=a.length-1;d>=0;d--)b=[a[d].apply(this,b)];
            return b[0]
        }
    };

    b.after=function(a,b){
        return function(){
            if(--a<1)return b.apply(this,arguments)
        }
    };

    b.keys=F||function(a){
        if(a!==Object(a))throw new TypeError("Invalid object");
        var b=[],d;
        for(d in a)l.call(a,d)&&(b[b.length]=d);return b
    };

    b.values=function(a){
        return b.map(a,
            b.identity)
    };

    b.functions=b.methods=function(a){
        return b.filter(b.keys(a),function(c){
            return b.isFunction(a[c])
        }).sort()
    };

    b.extend=function(a){
        h(f.call(arguments,1),function(b){
            for(var d in b)b[d]!==void 0&&(a[d]=b[d])
        });
        return a
    };

    b.defaults=function(a){
        h(f.call(arguments,1),function(b){
            for(var d in b)a[d]==null&&(a[d]=b[d])
        });
        return a
    };

    b.clone=function(a){
        return b.isArray(a)?a.slice():b.extend({},a)
    };

    b.tap=function(a,b){
        b(a);
        return a
    };

    b.isEqual=function(a,c){
        if(a===c)return!0;
        var d=typeof a;
        if(d!=
            typeof c)return!1;
        if(a==c)return!0;
        if(!a&&c||a&&!c)return!1;
        if(a._chain)a=a._wrapped;
        if(c._chain)c=c._wrapped;
        if(a.isEqual)return a.isEqual(c);
        if(b.isDate(a)&&b.isDate(c))return a.getTime()===c.getTime();
        if(b.isNaN(a)&&b.isNaN(c))return!1;
        if(b.isRegExp(a)&&b.isRegExp(c))return a.source===c.source&&a.global===c.global&&a.ignoreCase===c.ignoreCase&&a.multiline===c.multiline;
        if(d!=="object")return!1;
        if(a.length&&a.length!==c.length)return!1;
        d=b.keys(a);
        var e=b.keys(c);
        if(d.length!=e.length)return!1;
        for(var f in a)if(!(f in c)||!b.isEqual(a[f],c[f]))return!1;return!0
    };

    b.isEmpty=function(a){
        if(b.isArray(a)||b.isString(a))return a.length===0;
        for(var c in a)if(l.call(a,c))return!1;return!0
    };

    b.isElement=function(a){
        return!!(a&&a.nodeType==1)
    };

    b.isArray=n||function(a){
        return E.call(a)==="[object Array]"
    };

    b.isArguments=function(a){
        return!(!a||!l.call(a,"callee"))
    };

    b.isFunction=function(a){
        return!(!a||!a.constructor||!a.call||!a.apply)
    };

    b.isString=function(a){
        return!!(a===""||a&&a.charCodeAt&&a.substr)
    };
    b.isNumber=function(a){
        return!!(a===0||a&&a.toExponential&&a.toFixed)
    };

    b.isNaN=function(a){
        return a!==a
    };

    b.isBoolean=function(a){
        return a===!0||a===!1
    };

    b.isDate=function(a){
        return!(!a||!a.getTimezoneOffset||!a.setUTCFullYear)
    };

    b.isRegExp=function(a){
        return!(!a||!a.test||!a.exec||!(a.ignoreCase||a.ignoreCase===!1))
    };

    b.isNull=function(a){
        return a===null
    };

    b.isUndefined=function(a){
        return a===void 0
    };

    b.noConflict=function(){
        p._=C;
        return this
    };

    b.identity=function(a){
        return a
    };

    b.times=function(a,b,d){
        for(var e=
            0;e<a;e++)b.call(d,e)
    };

    b.mixin=function(a){
        h(b.functions(a),function(c){
            H(c,b[c]=a[c])
        })
    };

    var I=0;
    b.uniqueId=function(a){
        var b=I++;
        return a?a+b:b
    };

    b.templateSettings={
        evaluate:/<%([\s\S]+?)%>/g,
        interpolate:/<%=([\s\S]+?)%>/g
    };

    b.template=function(a,c){
        var d=b.templateSettings;
        d="var __p=[],print=function(){__p.push.apply(__p,arguments);};with(obj||{}){__p.push('"+a.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(d.interpolate,function(a,b){
            return"',"+b.replace(/\\'/g,"'")+",'"
        }).replace(d.evaluate||
            null,function(a,b){
                return"');"+b.replace(/\\'/g,"'").replace(/[\r\n\t]/g," ")+"__p.push('"
            }).replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/\t/g,"\\t")+"');}return __p.join('');";
        d=new Function("obj",d);
        return c?d(c):d
    };

    var j=function(a){
        this._wrapped=a
    };

    b.prototype=j.prototype;
    var r=function(a,c){
        return c?b(a).chain():a
    },H=function(a,c){
        j.prototype[a]=function(){
            var a=f.call(arguments);
            D.call(a,this._wrapped);
            return r(c.apply(b,a),this._chain)
        }
    };

    b.mixin(b);
    h(["pop","push","reverse","shift","sort",
        "splice","unshift"],function(a){
            var b=i[a];
            j.prototype[a]=function(){
                b.apply(this._wrapped,arguments);
                return r(this._wrapped,this._chain)
            }
        });
    h(["concat","join","slice"],function(a){
        var b=i[a];
        j.prototype[a]=function(){
            return r(b.apply(this._wrapped,arguments),this._chain)
        }
    });
    j.prototype.chain=function(){
        this._chain=!0;
        return this
    };

    j.prototype.value=function(){
        return this._wrapped
    }
})();

(function(){
    var k,l,m,n,o,i,f=function(d,a){
        return function(){
            return d.apply(a,arguments)
        }
    };

    k=function(){
        function d(a,c,b){
            this.el=a;
            this.position=c;
            this.collection=b;
            this.el=$(this.el);
            this.width=this.el.width();
            this.height=this.el.height();
            this.src=this.el.attr("src");
            this.target=this.el.data("cg-url");
            this.midpoint=this.width/2;
            this.tpl_nav=$("#tpl-feature-nav").html();
            this.nav_container=$("#feature-nav-shim");
            a=new Date;
            this.id="fn-"+this.src.replace(/[^A-Za-z0-9_]/g,"");
            this.id+=a.getMilliseconds();
            this.build_nav()
        }
        d.prototype.build_nav=function(){
            var a,c;
            a="";
            c=_.template(this.tpl_nav);
            a+=c({
                nav:this.id
            });
            this.nav_container.append(a);
            this.nav_el=$("#"+this.id);
            return this.nav_el.click(f(function(b){
                b.preventDefault();
                return this.nav_to(this.id)
            },this))
        };

        d.prototype.toggle=function(){
            var a,c,b;
            a=/feature_nav_off/g;
            c=/feature_nav_on/g;
            b=this.nav_el.attr("src");
            if(a.test(b))b=b.replace(a,"feature_nav_on");
            else if(c.test(b))b=b.replace(c,"feature_nav_off");
            return this.nav_el.attr({
                src:b
            })
        };

        d.prototype.nav_to=function(a){
            this.collection.cycle_state=false;
            return _.each(this.collection.items,f(function(c,b){
                if(c.id===a){
                    this.collection.position=b;
                    return this.collection.center()
                }
            },this))
        };

        return d
    }();
    l=function(){
        function d(a){
            this.image_class=a;
            this.cycle_stop=f(this.cycle_stop,this);
            this.cycle_loop=f(this.cycle_loop,this);
            this.cycle_start=f(this.cycle_start,this);
            this.easing="easeInQuint";
            this.animation_pause=this.animation_time=0;
            this.window_width=$(window).width();
            this.position=0;
            this.items=[];
            this.nav_container=$("#feature-nav-shim");
            this.hotspot_container=$("#feature-hotspot");
            this.hotspot=this.hotspot_container.find("a");
            this.ie7=false
        }
        d.prototype.init=function(){
            var a,c;
            this.images=$(this.image_class);
            this.parent=this.images.parent();
            this.images.each(f(function(b,e){
                return this.items.push(new k(e,b,this))
            },this));
            this.nav_container.css({
                width:this.items.length*18
            });
            this.items[this.position].toggle();
            this.hotspot.attr("href",this.items[this.position].target);
            c=function(){
                var b,e,g,h;
                g=this.items;
                h=[];
                b=0;
                for(e=g.length;b<e;b++){
                    a=g[b];
                    h.push(a.width)
                }
                return h
            }.call(this);
            c=_.reduce(c,function(b,e){
                return b+e
            });
            this.parent.width(c);
            this.center();
            this.cycle_start();
            return this.hotspot_container.css({
                left:this.window_width/2-this.hotspot_container.width()
            })
        };

        d.prototype.ie=function(){
            this.ie7=true;
            this.shim=$("#feature-nav-shim");
            return this.shim.css({
                left:this.window_width/2-this.shim.width()/2
            })
        };

        d.prototype.cycle_start=function(){
            if(this.cycle_state=true)return this.cycle_interval=window.setInterval(this.cycle_loop,
                this.animation_pause)
        };

        d.prototype.cycle_loop=function(){
            if(this.cycle_state)return this.cycle()
        };

        d.prototype.cycle_stop=function(){
            this.cycle_state=false;
            return window.clearInterval(this.cycle_interval)
        };

        d.prototype.cycle=function(){
            return this.cycle_state?this.increment():false
        };

        d.prototype.increment=function(){
            if(this.position===this.items.length-1){
                this.loop_increment();
                this.clear_nav();
                this.items[this.position].toggle();
                return this.center()
            }else{
                this.position+=1;
                this.center();
                this.clear_nav();
                return this.items[this.position].toggle()
            }
        };

        d.prototype.decrement=function(){
            if(this.position===0){
                this.loop_decrement();
                this.clear_nav();
                this.items[this.position].toggle();
                return this.center()
            }else{
                this.position-=1;
                this.center();
                this.clear_nav();
                return this.items[this.position].toggle()
            }
        };

        d.prototype.loop_increment=function(){
            var a;
            a=this.items.shift();
            this.items.push(a);
            return this.reorder_images((this.parent.width()-a.width*2)*-1+(this.window_width-a.width)/2)
        };

        d.prototype.loop_decrement=function(){
            var a;
            a=this.items.pop();
            this.items.unshift(a);
            return this.reorder_images(a.width*-1+(this.window_width-a.width)/2)
        };

        d.prototype.reorder_images=function(a){
            var c;
            this.parent.html("");
            for(c in this.items)this.parent.append(this.items[c].el);return this.parent.css("margin-left",a+"px")
        };

        d.prototype.center=function(){
            var a,c,b;
            if(this.position===0)a=b=0;
            else{
                b=function(){
                    var e,g,h,j;
                    h=this.items.slice(0,this.position-1+1||9E9);
                    j=[];
                    e=0;
                    for(g=h.length;e<g;e++){
                        c=h[e];
                        j.push(c.width)
                    }
                    return j
                }.call(this);
                a=
                _.reduce(b,function(e,g){
                    return e+g
                })
            }
            b=this.window_width/2;
            a+=this.items[this.position].midpoint;
            this.clear_nav();
            this.items[this.position].toggle();
            jQuery.easing.def=this.easing;
            this.parent.animate({
                "margin-left":a*-1+b
            },this.animation_time);
            this.hotspot.attr("href",this.items[this.position].target);
            if(this.ie7){
                b=this.position===0?this.window_width/2-this.shim.width()/2:a-this.shim.width()/2;
                return this.shim.animate({
                    left:b
                },600)
            }
        };

        d.prototype.clear_nav=function(){
            var a;
            a=/feature_nav_on/g;
            return _.each(this.items,
                function(c){
                    var b;
                    b=c.nav_el.attr("src");
                    b=b.replace(a,"feature_nav_off");
                    return c.nav_el.attr({
                        src:b
                    })
                })
        };

        d.prototype.recalc=function(){
            this.window_width=$(window).width();
            return this.center()
        };

        return d
    }();
    o=function(){
        return function(d,a,c){
            this.el=d;
            this.features=a;
            this.direction=c;
            this.el=$(this.el);
            this.el.click(f(function(b){
                b.preventDefault();
                this.features.cycle_state=false;
                if(this.direction==="left")return this.features.increment();
                else if(this.direction==="right")return this.features.decrement()
            },
            this))
        }
    }();
    n=function(){
        function d(a){
            var c;
            this.class_name=a;
            this.mobile=false;
            this.spotlights=$(this.class_name);
            this.items=[];
            c=this;
            _.each(["iPhone","iPod","iPad","Android","webOS","BlackBerry","Windows Phone"],function(b){
                if(navigator.userAgent.match(RegExp(b,"i"))){
                    c.mobile=true;
                    return $(".overlay-close").css({
                        display:"block"
                    })
                }
            });
            this.spotlights.each(f(function(b,e){
                return this.items.push(new m(e,this))
            },this));
            _.each(this.items,function(b){
                b.mobile=c.mobile;
                b.el.mouseenter(function(){
                    b.show();
                    return b.features_collection.cycle_stop()
                });
                return b.el.mouseleave(function(){
                    b.start_count();
                    return b.features_collection.cycle_start()
                })
            })
        }
        d.prototype.clear=function(){
            return _.each(this.items,function(a){
                return a.hide()
            })
        };

        d.prototype.recalc=function(){
            var a;
            a=($(window).width()-$("#features").width())/2;
            return _.each(this.items,function(c){
                c.left=a;
                return c.overlay.css({
                    left:a
                })
            })
        };

        d.prototype.register_features=function(a){
            return _.each(this.items,function(c){
                return c.features_collection=a
            })
        };
        return d
    }();
    m=function(){
        function d(a,c){
            this.el=a;
            this.parent=c;
            this.check_state=f(this.check_state,this);
            this.el=$(this.el);
            this.id=this.el.attr("id");
            this.suffix=this.id.split("-")[1];
            this.left=($(window).width()-$("#features").width())/2;
            this.overlay=$("#overlay-"+this.suffix);
            this.overlay.css({
                left:this.left
            });
            this.state=0;
            this.overlay.find(".overlay-close a").click(f(function(b){
                b.preventDefault();
                return this.hide()
            },this))
        }
        d.prototype.show=function(){
            this.parent.clear();
            this.overlay.fadeIn("fast");
            this.state=0;
            this.overlay.mouseenter(f(function(){
                return this.state=1
            },this));
            return this.overlay.mouseleave(f(function(){
                return this.hide()
            },this))
        };

        d.prototype.hide=function(){
            this.overlay.fadeOut("fast");
            return this.state=0
        };

        d.prototype.check_state=function(){
            if(this.state===0)return this.hide()
        };

        d.prototype.start_count=function(){
            return window.setTimeout(this.check_state,1E3)
        };

        return d
    }();
    i=typeof exports!=="undefined"&&exports!==null?exports:this;
    i.Features=l;
    i.Trigger=o;
    i.Spotlights=n
}).call(this);

