﻿(function(a){a.fn.jCarouselLite=function(e){e=a.extend({btnPrev:null,btnNext:null,btnGo:null,mouseWheel:false,auto:null,speed:200,easing:null,vertical:false,circular:true,visible:3,start:0,scroll:1,beforeStart:null,afterEnd:null},e||{});return this.each(function(){var n=false,f=e.vertical?"top":"left",o=e.vertical?"height":"width";var h=a(this),r=a("ul",h),q=a("li",r),p=q.size(),t=e.visible;if(e.circular){r.prepend(q.slice(p-t-1+1).clone()).append(q.slice(0,t).clone());e.start+=t}var l=a("li",r),k=l.size(),g=e.start;h.css("visibility","visible");l.css({overflow:"hidden","float":e.vertical?"none":"left"});r.css({margin:"0",padding:"0",position:"relative","list-style-type":"none","z-index":"1"});h.css({overflow:"hidden",position:"relative","z-index":"2",left:"0px"});var m=e.vertical?c(l):d(l);var s=m*k;var i=m*t;l.css({width:l.width(),height:l.height()});r.css(o,s+"px").css(f,-(g*m));h.css(o,i+"px");if(e.btnPrev){a(e.btnPrev).click(function(){return j(g-e.scroll)})}if(e.btnNext){a(e.btnNext).click(function(){return j(g+e.scroll)})}if(e.btnGo){a.each(e.btnGo,function(v,w){a(w).click(function(){return j(e.circular?e.visible+v:v)})})}if(e.mouseWheel&&h.mousewheel){h.mousewheel(function(w,v){return v>0?j(g-e.scroll):j(g+e.scroll)})}if(e.auto){setInterval(function(){j(g+e.scroll)},e.auto+e.speed)}function u(){return l.slice(g).slice(0,t)}function j(v){if(!n){if(e.beforeStart){e.beforeStart.call(this,u())}if(e.circular){if(v<=e.start-t-1){r.css(f,-((k-(t*2))*m)+"px");g=v==e.start-t-1?k-(t*2)-1:k-(t*2)-e.scroll}else{if(v>=k-t+1){r.css(f,-((t)*m)+"px");g=v==k-t+1?t+1:t+e.scroll}else{g=v}}}else{if(v<0||v>k-t){return}else{g=v}}n=true;r.animate(f=="left"?{left:-(g*m)}:{top:-(g*m)},e.speed,e.easing,function(){if(e.afterEnd){e.afterEnd.call(this,u())}n=false});if(!e.circular){a(e.btnPrev+","+e.btnNext).removeClass("disabled");a((g-e.scroll<0&&e.btnPrev)||(g+e.scroll>k-t&&e.btnNext)||[]).addClass("disabled")}}return false}})};function b(e,f){return parseInt(a.css(e[0],f))||0}function d(e){return e[0].offsetWidth+b(e,"marginLeft")+b(e,"marginRight")}function c(e){return e[0].offsetHeight+b(e,"marginTop")+b(e,"marginBottom")}})(jQuery);var animatedcollapse={divholders:{},divgroups:{},lastactiveingroup:{},preloadimages:[],show:function(a){if(typeof a=="object"){for(var b=0;b<a.length;b++){this.showhide(a[b],"show")}}else{this.showhide(a,"show")}},hide:function(a){if(typeof a=="object"){for(var b=0;b<a.length;b++){this.showhide(a[b],"hide")}}else{this.showhide(a,"hide")}},toggle:function(a){if(typeof a=="object"){a=a[0]}this.showhide(a,"toggle")},addDiv:function(b,a){this.divholders[b]=({id:b,$divref:null,attrs:a});this.divholders[b].getAttr=function(d){var c=new RegExp(d+"=([^,]+)","i");return(c.test(this.attrs)&&parseInt(RegExp.$1)!=0)?RegExp.$1:null};this.currentid=b;return this},showhide:function(c,b){var a=this.divholders[c].$divref;if(this.divholders[c]&&a.length==1){var d=this.divgroups[a.attr("groupname")];if(a.attr("groupname")&&d.count>1&&(b=="show"||b=="toggle"&&a.css("display")=="none")){if(d.lastactivedivid&&d.lastactivedivid!=c){this.slideengine(d.lastactivedivid,"hide")}this.slideengine(c,"show");d.lastactivedivid=c}else{this.slideengine(c,b)}}},slideengine:function(e,c){var a=this.divholders[e].$divref;var b=this.divholders[e].$togglerimage;if(this.divholders[e]&&a.length==1){var d={height:c};if(a.attr("fade")){d.opacity=c}a.animate(d,a.attr("speed")?parseInt(a.attr("speed")):500,function(){if(b){b.attr("src",(a.css("display")=="none")?b.data("srcs").closed:b.data("srcs").open)}if(animatedcollapse.ontoggle){try{animatedcollapse.ontoggle(jQuery,a.get(0),a.css("display"))}catch(f){alert('An error exists inside your "ontoggle" function:\n\n'+f+"\n\nAborting execution of function.")}}});return false}},generatemap:function(){var b={};for(var a=0;a<arguments.length;a++){if(arguments[a][1]!=null){b[arguments[a][0]]=arguments[a][1]}}return b},init:function(){var a=this;jQuery(document).ready(function(b){animatedcollapse.ontoggle=animatedcollapse.ontoggle||null;var f=animatedcollapse.urlparamselect();var e=a.getCookie("acopendivids");var d=a.getCookie("acgroupswithpersist");if(e!=null){e=(e=="nada")?[]:e.split(",")}d=(d==null||d=="nada")?[]:d.split(",");jQuery.each(a.divholders,function(){this.$divref=b("#"+this.id);if((this.getAttr("persist")||jQuery.inArray(this.getAttr("group"),d)!=-1)&&e!=null){var g=(jQuery.inArray(this.id,e)!=-1)?"block":"none"}else{var g=this.getAttr("hide")?"none":null}if(f[0]=="all"||jQuery.inArray(this.id,f)!=-1){g="block"}else{if(f[0]=="none"){g="none"}}this.$divref.css(a.generatemap(["height",this.getAttr("height")],["display",g]));this.$divref.attr(a.generatemap(["groupname",this.getAttr("group")],["fade",this.getAttr("fade")],["speed",this.getAttr("speed")]));if(this.getAttr("group")){var h=a.divgroups[this.getAttr("group")]||(a.divgroups[this.getAttr("group")]={});h.count=(h.count||0)+1;if(jQuery.inArray(this.id,f)!=-1){h.lastactivedivid=this.id;h.overridepersist=1}if(!h.lastactivedivid&&this.$divref.css("display")!="none"||g=="block"&&typeof h.overridepersist=="undefined"){h.lastactivedivid=this.id}this.$divref.css({display:"none"})}});jQuery.each(a.divgroups,function(){if(this.lastactivedivid&&f[0]!="none"){a.divholders[this.lastactivedivid].$divref.show()}});if(animatedcollapse.ontoggle){jQuery.each(a.divholders,function(){animatedcollapse.ontoggle(jQuery,this.$divref.get(0),this.$divref.css("display"))})}var c=b("a[rel]").filter('[rel^="collapse["], [rel^="expand["], [rel^="toggle["]');c.each(function(){this._divids=this.getAttribute("rel").replace(/(^\w+)|(\s+)/g,"").replace(/[\[\]']/g,"");if(this.getElementsByTagName("img").length==1&&a.divholders[this._divids]){animatedcollapse.preloadimage(this.getAttribute("data-openimage"),this.getAttribute("data-closedimage"));$togglerimage=b(this).find("img").eq(0).data("srcs",{open:this.getAttribute("data-openimage"),closed:this.getAttribute("data-closedimage")});a.divholders[this._divids].$togglerimage=b(this).find("img").eq(0);a.divholders[this._divids].$togglerimage.attr("src",(a.divholders[this._divids].$divref.css("display")=="none")?$togglerimage.data("srcs").closed:$togglerimage.data("srcs").open)}b(this).click(function(){var h=this.getAttribute("rel");var g=(this._divids=="")?[]:this._divids.split(",");if(g.length>0){animatedcollapse[/expand/i.test(h)?"show":/collapse/i.test(h)?"hide":"toggle"](g);return false}})});b(window).bind("unload",function(){a.uninit()})})},uninit:function(){var b="",a="";jQuery.each(this.divholders,function(){if(this.$divref.css("display")!="none"){b+=this.id+","}if(this.getAttr("group")&&this.getAttr("persist")){a+=this.getAttr("group")+","}});b=(b=="")?"nada":b.replace(/,$/,"");a=(a=="")?"nada":a.replace(/,$/,"");this.setCookie("acopendivids",b);this.setCookie("acgroupswithpersist",a)},getCookie:function(a){var b=new RegExp(a+"=[^;]*","i");if(document.cookie.match(b)){return document.cookie.match(b)[0].split("=")[1]}return null},setCookie:function(c,d,a){if(typeof a!="undefined"){var b=new Date();b.setDate(b.getDate()+a);document.cookie=c+"="+d+"; path=/; expires="+b.toGMTString()}else{document.cookie=c+"="+d+"; path=/"}},urlparamselect:function(){window.location.search.match(/expanddiv=([\w\-_,]+)/i);return(RegExp.$1!="")?RegExp.$1.split(","):[]},preloadimage:function(){var b=this.preloadimages;for(var a=0;a<arguments.length;a++){if(arguments[a]&&arguments[a].length>0){b[b.length]=new Image();b[b.length-1].src=arguments[a]}}}};jQuery(document).ready(function(){jQuery("#cashBanner").appendTo("#nav")});
