(function(a){a.fn.hint=function(c){if(!c){c="blur"}return this.each(function(){var h=a(this),f=h.attr("title"),e=a(this.form),g=a(window);function d(){if(h.val()===f&&h.hasClass(c)){h.val("").removeClass(c)}}if(f){h.blur(function(){if(this.value===""){h.val(f).addClass(c)}}).focus(d).blur();e.submit(d);g.unload(d)}})}})(jQuery);jQuery.extend({highlight:function(a,k,h,g){if(a.nodeType===3){var e=a.data.match(k);if(e){var c=document.createElement(h||"span");c.className=g||"highlight";var j=a.splitText(e.index);j.splitText(e[0].length);var f=j.cloneNode(true);c.appendChild(f);j.parentNode.replaceChild(c,j);return 1}}else{if((a.nodeType===1&&a.childNodes)&&!/(script|style)/i.test(a.tagName)&&!(a.tagName===h.toUpperCase()&&a.className===g)){for(var d=0;d<a.childNodes.length;d++){d+=jQuery.highlight(a.childNodes[d],k,h,g)}}}return 0}});jQuery.fn.unhighlight=function(a){var c={className:"highlight",element:"span"};jQuery.extend(c,a);return this.find(c.element+"."+c.className).each(function(){var d=this.parentNode;d.replaceChild(this.firstChild,this);d.normalize()}).end()};jQuery.fn.highlight=function(g,c){var e={className:"highlight",element:"span",caseSensitive:false,wordsOnly:false};jQuery.extend(e,c);if(g.constructor===String){g=[g]}var a=e.caseSensitive?"":"i";var f="("+g.join("|")+")";if(e.wordsOnly){f="\\b"+f+"\\b"}var d=new RegExp(f,a);return this.each(function(){jQuery.highlight(this,d,e.element,e.className)})};(function(g){g.tools=g.tools||{};g.tools.tabs={version:"1.0.4",conf:{tabs:"a",current:"current",onBeforeClick:null,onClick:null,effect:"default",initialIndex:0,event:"click",api:false,rotate:false},addEffect:function(c,a){h[c]=a}};var h={"default":function(a,c){this.getPanes().hide().eq(a).show();c.call()},fade:function(d,l){var k=this.getConf(),a=k.fadeOutSpeed,c=this.getPanes();if(a){c.fadeOut(a)}else{c.hide()}c.eq(d).fadeIn(k.fadeInSpeed,l)},slide:function(a,c){this.getPanes().slideUp(200);this.getPanes().eq(a).slideDown(400,c)},ajax:function(a,c){this.getPanes().eq(0).load(this.getTabs().eq(a).attr("href"),c)}};var e;g.tools.tabs.addEffect("horizontal",function(a,c){if(!e){e=this.getPanes().eq(0).width()}this.getCurrentPane().animate({width:0},function(){g(this).hide()});this.getPanes().eq(a).animate({width:e},function(){g(this).show();c.call()})});function f(k,d,l){var n=this,a=g(this),c;g.each(l,function(o,j){if(g.isFunction(j)){a.bind(o,j)}});g.extend(this,{click:function(q,s){var r=n.getCurrentPane();var p=k.eq(q);if(typeof q=="string"&&q.replace("#","")){p=k.filter("[href*="+q.replace("#","")+"]");q=Math.max(k.index(p),0)}if(l.rotate){var j=k.length-1;if(q<0){return n.click(j,s)}if(q>j){return n.click(0,s)}}if(!p.length){if(c>=0){return n}q=l.initialIndex;p=k.eq(q)}if(q===c){return n}s=s||g.Event();s.type="onBeforeClick";a.trigger(s,[q]);if(s.isDefaultPrevented()){return}h[l.effect].call(n,q,function(){s.type="onClick";a.trigger(s,[q])});s.type="onStart";a.trigger(s,[q]);if(s.isDefaultPrevented()){return}c=q;k.removeClass(l.current);p.addClass(l.current);return n},getConf:function(){return l},getTabs:function(){return k},getPanes:function(){return d},getCurrentPane:function(){return d.eq(c)},getCurrentTab:function(){return k.eq(c)},getIndex:function(){return c},next:function(){return n.click(c+1)},prev:function(){return n.click(c-1)},bind:function(o,j){a.bind(o,j);return n},onBeforeClick:function(j){return this.bind("onBeforeClick",j)},onClick:function(j){return this.bind("onClick",j)},unbind:function(j){a.unbind(j);return n}});k.each(function(j){g(this).bind(l.event,function(o){n.click(j,o);return false})});if(location.hash){n.click(location.hash)}else{if(l.initialIndex===0||l.initialIndex>0){n.click(l.initialIndex)}}d.find("a[href^=#]").click(function(j){n.click(g(this).attr("href"),j)})}g.fn.tabs=function(a,j){var d=this.eq(typeof j=="number"?j:0).data("tabs");if(d){return d}if(g.isFunction(j)){j={onBeforeClick:j}}var c=g.extend({},g.tools.tabs.conf),k=this.length;j=g.extend(c,j);this.each(function(o){var q=g(this);var p=q.find(j.tabs);if(!p.length){p=q.children()}var n=a.jquery?a:q.children(a);if(!n.length){n=k==1?g(a):q.parent().find(a)}d=new f(p,n,j);q.data("tabs",d)});return j.api?d:this}})(jQuery);(function(c){var d=c.tools.tabs;d.plugins=d.plugins||{};d.plugins.slideshow={version:"1.0.2",conf:{next:".forward",prev:".backward",disabledClass:"disabled",autoplay:false,autopause:true,interval:3000,clickable:true,api:false}};c.prototype.slideshow=function(g){var a=c.extend({},d.plugins.slideshow.conf),j=this.length,h;g=c.extend(a,g);this.each(function(){var t=c(this),w=t.tabs(),A=c(w),u=w;c.each(g,function(l,k){if(c.isFunction(k)){w.bind(l,k)}});function v(k){return j==1?c(k):t.parent().find(k)}var D=v(g.next).click(function(){w.next()});var f=v(g.prev).click(function(){w.prev()});var B,z,x,C=false;c.extend(w,{play:function(){if(B){return}var k=c.Event("onBeforePlay");A.trigger(k);if(k.isDefaultPrevented()){return w}C=false;B=setInterval(w.next,g.interval);A.trigger("onPlay");w.next()},pause:function(){if(!B){return w}var k=c.Event("onBeforePause");A.trigger(k);if(k.isDefaultPrevented()){return w}B=clearInterval(B);x=clearInterval(x);A.trigger("onPause")},stop:function(){w.pause();C=true},onBeforePlay:function(k){return w.bind("onBeforePlay",k)},onPlay:function(k){return w.bind("onPlay",k)},onBeforePause:function(k){return w.bind("onBeforePause",k)},onPause:function(k){return w.bind("onPause",k)}});if(g.autopause){var y=w.getTabs().add(D).add(f).add(w.getPanes());y.hover(function(){w.pause();z=clearInterval(z)},function(){if(!C){z=setTimeout(w.play,g.interval)}})}if(g.autoplay){x=setTimeout(w.play,g.interval)}else{w.stop()}if(g.clickable){w.getPanes().click(function(){w.next()})}if(!w.getConf().rotate){var e=g.disabledClass;if(!w.getIndex()){f.addClass(e)}w.onBeforeClick(function(k,l){if(!l){f.addClass(e)}else{f.removeClass(e);if(l==w.getTabs().length-1){D.addClass(e)}else{D.removeClass(e)}}})}});return g.api?h:this}})(jQuery);(function(j){var g=j.tools.tabs;g.plugins=g.plugins||{};g.plugins.history={version:"1.0.2",conf:{api:false}};var h,f;function k(c){if(c){var a=f.contentWindow.document;a.open().close();a.location.hash=c}}j.fn.onHash=function(a){var c=this;if(j.browser.msie&&j.browser.version<"8"){if(!f){f=j("<iframe/>").attr("src","javascript:false;").hide().get(0);j("body").append(f);setInterval(function(){var e=f.contentWindow.document,d=e.location.hash;if(h!==d){j.event.trigger("hash",d);h=d}},100);k(location.hash||"#")}c.bind("click.hash",function(d){k(j(this).attr("href"))})}else{setInterval(function(){var d=location.hash;var e=c.filter("[href$="+d+"]");if(!e.length){d=d.replace("#","");e=c.filter("[href$="+d+"]")}if(e.length&&d!==h){h=d;j.event.trigger("hash",d)}},100)}j(window).bind("hash",a);return this};j.fn.history=function(c){var a=j.extend({},g.plugins.history.conf),d;c=j.extend(a,c);this.each(function(){var e=j(this).tabs(),l=e.getTabs();if(e){d=e}l.onHash(function(o,n){if(!n||n=="#"){n=e.getConf().initialIndex}e.click(n)});l.click(function(n){location.hash=j(this).attr("href").replace("#","")})});return c.api?d:this}})(jQuery);(function(h){var g=[];h.tools=h.tools||{};h.tools.tooltip={version:"1.1.2",conf:{effect:"toggle",fadeOutSpeed:"fast",tip:null,predelay:0,delay:30,opacity:1,lazy:undefined,position:["top","center"],offset:[0,0],cancelDefault:true,relative:false,oneInstance:true,events:{def:"mouseover,mouseout",input:"focus,blur",widget:"focus mouseover,blur mouseout",tooltip:"mouseover,mouseout"},api:false},addEffect:function(d,a,c){e[d]=[a,c]}};var e={toggle:[function(j){var d=this.getConf(),c=this.getTip(),a=d.opacity;if(a<1){c.css({opacity:a})}c.show();j.call()},function(a){this.getTip().hide();a.call()}],fade:[function(a){this.getTip().fadeIn(this.getConf().fadeInSpeed,a)},function(a){this.getTip().fadeOut(this.getConf().fadeOutSpeed,a)}]};function f(x,w){var a=this,s=h(this);x.data("tooltip",a);var r=x.next();if(w.tip){r=h(w.tip);if(r.length>1){r=x.nextAll(w.tip).eq(0);if(!r.length){r=x.parent().nextAll(w.tip).eq(0)}}}function c(k){var l=w.relative?x.position().top:x.offset().top,n=w.relative?x.position().left:x.offset().left,j=w.position[0];l-=r.outerHeight()-w.offset[0];n+=x.outerWidth()+w.offset[1];var p=r.outerHeight()+x.outerHeight();if(j=="center"){l+=p/2}if(j=="bottom"){l+=p}j=w.position[1];var o=r.outerWidth()+x.outerWidth();if(j=="center"){n-=o/2}if(j=="left"){n-=o}return{top:l,left:n}}var u=x.is(":input"),y=u&&x.is(":checkbox, :radio, select, :button"),v=x.attr("type"),d=w.events[v]||w.events[u?(y?"widget":"input"):"def"];d=d.split(/,\s*/);if(d.length!=2){throw"Tooltip: bad events configuration for "+v}x.bind(d[0],function(j){if(w.oneInstance){h.each(g,function(){this.hide()})}var k=r.data("trigger");if(k&&k[0]!=this){r.hide().stop(true,true)}j.target=this;a.show(j);d=w.events.tooltip.split(/,\s*/);r.bind(d[0],function(){a.show(j)});if(d[1]){r.bind(d[1],function(){a.hide(j)})}});x.bind(d[1],function(j){a.hide(j)});if(!h.browser.msie&&!u&&!w.predelay){x.mousemove(function(){if(!a.isShown()){x.triggerHandler("mouseover")}})}if(w.opacity<1){r.css("opacity",w.opacity)}var q=0,t=x.attr("title");if(t&&w.cancelDefault){x.removeAttr("title");x.data("title",t)}h.extend(a,{show:function(j){if(j){x=h(j.target)}clearTimeout(r.data("timer"));if(r.is(":animated")||r.is(":visible")){return a}function k(){r.data("trigger",x);var l=c(j);if(w.tip&&t){r.html(x.data("title"))}j=j||h.Event();j.type="onBeforeShow";s.trigger(j,[l]);if(j.isDefaultPrevented()){return a}l=c(j);r.css({position:"absolute",top:l.top,left:l.left});var n=e[w.effect];if(!n){throw'Nonexistent effect "'+w.effect+'"'}n[0].call(a,function(){j.type="onShow";s.trigger(j)})}if(w.predelay){clearTimeout(q);q=setTimeout(k,w.predelay)}else{k()}return a},hide:function(j){clearTimeout(r.data("timer"));clearTimeout(q);if(!r.is(":visible")){return}function k(){j=j||h.Event();j.type="onBeforeHide";s.trigger(j);if(j.isDefaultPrevented()){return}e[w.effect][1].call(a,function(){j.type="onHide";s.trigger(j)})}if(w.delay&&j){r.data("timer",setTimeout(k,w.delay))}else{k()}return a},isShown:function(){return r.is(":visible, :animated")},getConf:function(){return w},getTip:function(){return r},getTrigger:function(){return x},bind:function(k,j){s.bind(k,j);return a},onHide:function(j){return this.bind("onHide",j)},onBeforeShow:function(j){return this.bind("onBeforeShow",j)},onShow:function(j){return this.bind("onShow",j)},onBeforeHide:function(j){return this.bind("onBeforeHide",j)},unbind:function(j){s.unbind(j);return a}});h.each(w,function(k,j){if(h.isFunction(j)){a.bind(k,j)}})}h.prototype.tooltip=function(d){var c=this.eq(typeof d=="number"?d:0).data("tooltip");if(c){return c}var a=h.extend(true,{},h.tools.tooltip.conf);if(h.isFunction(d)){d={onBeforeShow:d}}else{if(typeof d=="string"){d={tip:d}}}d=h.extend(true,a,d);if(typeof d.position=="string"){d.position=d.position.split(/,?\s/)}if(d.lazy!==false&&(d.lazy===true||this.length>20)){this.one("mouseover",function(j){c=new f(h(this),d);c.show(j);g.push(c)})}else{this.each(function(){c=new f(h(this),d);g.push(c)})}return d.api?c:this}})(jQuery);(function(d){var e=d.tools.tooltip;e.effects=e.effects||{};e.effects.slide={version:"1.0.0"};d.extend(e.conf,{direction:"up",bounce:false,slideOffset:10,slideInSpeed:200,slideOutSpeed:200,slideFade:!d.browser.msie});var f={up:["-","top"],down:["+","top"],left:["-","left"],right:["+","left"]};d.tools.tooltip.addEffect("slide",function(l){var j=this.getConf(),c=this.getTip(),a=j.slideFade?{opacity:j.opacity}:{},k=f[j.direction]||f.up;a[k[1]]=k[0]+"="+j.slideOffset;if(j.slideFade){c.css({opacity:0})}c.show().animate(a,j.slideInSpeed,l)},function(l){var j=this.getConf(),a=j.slideOffset,c=j.slideFade?{opacity:0}:{},k=f[j.direction]||f.up;var n=""+k[0];if(j.bounce){n=n=="+"?"-":"+"}c[k[1]]=n+"="+a;this.getTip().animate(c,j.slideOutSpeed,function(){d(this).hide();l.call()})})})(jQuery);(function(g){var h=g.tools.tooltip;h.plugins=h.plugins||{};h.plugins.dynamic={version:"1.0.1",conf:{api:false,classNames:"top right bottom left"}};function e(a){var j=g(window);var c=j.width()+j.scrollLeft();var d=j.height()+j.scrollTop();return[a.offset().top<=j.scrollTop(),c<=a.offset().left+a.width(),d<=a.offset().top+a.height(),j.scrollLeft()>=a.offset().left]}function f(a){var c=a.length;while(c--){if(a[c]){return false}}return true}g.fn.dynamic=function(d){var c=g.extend({},h.plugins.dynamic.conf),j;if(typeof d=="number"){d={speed:d}}d=g.extend(c,d);var k=d.classNames.split(/\s/),a;this.each(function(){if(g(this).tooltip().jquery){throw"Lazy feature not supported by dynamic plugin. set lazy: false for tooltip"}var l=g(this).tooltip().onBeforeShow(function(t,s){var p=this.getTip(),q=this.getConf();if(!a){a=[q.position[0],q.position[1],q.offset[0],q.offset[1],g.extend({},q)]}g.extend(q,a[4]);q.position=[a[0],a[1]];q.offset=[a[2],a[3]];p.css({visibility:"hidden",position:"absolute",top:s.top,left:s.left}).show();var r=e(p);if(!f(r)){if(r[2]){g.extend(q,d.top);q.position[0]="top";p.addClass(k[0])}if(r[3]){g.extend(q,d.right);q.position[1]="right";p.addClass(k[1])}if(r[0]){g.extend(q,d.bottom);q.position[0]="bottom";p.addClass(k[2])}if(r[1]){g.extend(q,d.left);q.position[1]="left";p.addClass(k[3])}if(r[0]||r[2]){q.offset[0]*=-1}if(r[1]||r[3]){q.offset[1]*=-1}}p.css({visibility:"visible"}).hide()});l.onShow(function(){var n=this.getConf(),o=this.getTip();n.position=[a[0],a[1]];n.offset=[a[2],a[3]]});l.onHide(function(){var n=this.getTip();n.removeClass(d.classNames)});j=l});return d.api?j:this}})(jQuery);(function(d){d.tools=d.tools||{};d.tools.scrollable={version:"1.1.2",conf:{size:5,vertical:false,speed:400,keyboard:true,keyboardSteps:null,disabledClass:"disabled",hoverClass:null,clickable:true,activeClass:"active",easing:"swing",loop:false,items:".items",item:null,prev:".prev",next:".next",prevPage:".prevPage",nextPage:".nextPage",api:false}};var f;function e(t,v){var a=this,s=d(this),E=!v.vertical,D=t.children(),x=0,z;if(!f){f=a}d.each(v,function(h,g){if(d.isFunction(g)){s.bind(h,g)}});if(D.length>1){D=d(v.items,t)}function w(g){var h=d(g);return v.globalNav?h:t.parent().find(g)}t.data("finder",w);var C=w(v.prev),A=w(v.next),B=w(v.prevPage),u=w(v.nextPage);d.extend(a,{getIndex:function(){return x},getClickIndex:function(){var g=a.getItems();return g.index(g.filter("."+v.activeClass))},getConf:function(){return v},getSize:function(){return a.getItems().size()},getPageAmount:function(){return Math.ceil(this.getSize()/v.size)},getPageIndex:function(){return Math.ceil(x/v.size)},getNaviButtons:function(){return C.add(A).add(B).add(u)},getRoot:function(){return t},getItemWrap:function(){return D},getItems:function(){return D.children(v.item)},getVisibleItems:function(){return a.getItems().slice(x,x+v.size)},seekTo:function(n,h,l){if(n<0){n=0}if(x===n){return a}if(d.isFunction(h)){l=h}if(n>a.getSize()-v.size){return v.loop?a.begin():this.end()}var k=a.getItems().eq(n);if(!k.length){return a}var j=d.Event("onBeforeSeek");s.trigger(j,[n]);if(j.isDefaultPrevented()){return a}if(h===undefined||d.isFunction(h)){h=v.speed}function g(){if(l){l.call(a,n)}s.trigger("onSeek",[n])}if(E){D.animate({left:-k.position().left},h,v.easing,g)}else{D.animate({top:-k.position().top},h,v.easing,g)}f=a;x=n;j=d.Event("onStart");s.trigger(j,[n]);if(j.isDefaultPrevented()){return a}C.add(B).toggleClass(v.disabledClass,n===0);A.add(u).toggleClass(v.disabledClass,n>=a.getSize()-v.size);return a},move:function(g,h,j){z=g>0;return this.seekTo(x+g,h,j)},next:function(g,h){return this.move(1,g,h)},prev:function(g,h){return this.move(-1,g,h)},movePage:function(g,h,j){z=g>0;var l=v.size*g;var k=x%v.size;if(k>0){l+=(g>0?-k:v.size-k)}return this.move(l,h,j)},prevPage:function(g,h){return this.movePage(-1,g,h)},nextPage:function(g,h){return this.movePage(1,g,h)},setPage:function(h,g,j){return this.seekTo(h*v.size,g,j)},begin:function(g,h){z=false;return this.seekTo(0,g,h)},end:function(h,j){z=true;var g=this.getSize()-v.size;return g>0?this.seekTo(g,h,j):a},reload:function(){s.trigger("onReload");return a},focus:function(){f=a;return a},click:function(k){var j=a.getItems().eq(k),n=v.activeClass,l=v.size;if(k<0||k>=a.getSize()){return a}if(l==1){if(v.loop){return a.next()}if(k===0||k==a.getSize()-1){z=(z===undefined)?true:!z}return z===false?a.prev():a.next()}if(l==2){if(k==x){k--}a.getItems().removeClass(n);j.addClass(n);return a.seekTo(k,time,fn)}if(!j.hasClass(n)){a.getItems().removeClass(n);j.addClass(n);var g=Math.floor(l/2);var h=k-g;if(h>a.getSize()-l){h=a.getSize()-l}if(h!==k){return a.seekTo(h)}}return a},bind:function(h,g){s.bind(h,g);return a},unbind:function(g){s.unbind(g);return a}});d.each("onBeforeSeek,onStart,onSeek,onReload".split(","),function(h,g){a[g]=function(j){return a.bind(g,j)}});C.addClass(v.disabledClass).click(function(){a.prev()});A.click(function(){a.next()});u.click(function(){a.nextPage()});if(a.getSize()<v.size){A.add(u).addClass(v.disabledClass)}B.addClass(v.disabledClass).click(function(){a.prevPage()});var y=v.hoverClass,c="keydown."+Math.random().toString().substring(10);a.onReload(function(){if(y){a.getItems().hover(function(){d(this).addClass(y)},function(){d(this).removeClass(y)})}if(v.clickable){a.getItems().each(function(g){d(this).unbind("click.scrollable").bind("click.scrollable",function(h){if(d(h.target).is("a")){return}return a.click(g)})})}if(v.keyboard){d(document).unbind(c).bind(c,function(h){if(h.altKey||h.ctrlKey){return}if(v.keyboard!="static"&&f!=a){return}var g=v.keyboardSteps;if(E&&(h.keyCode==37||h.keyCode==39)){a.move(h.keyCode==37?-g:g);return h.preventDefault()}if(!E&&(h.keyCode==38||h.keyCode==40)){a.move(h.keyCode==38?-g:g);return h.preventDefault()}return true})}else{d(document).unbind(c)}});a.reload()}d.fn.scrollable=function(g){var c=this.eq(typeof g=="number"?g:0).data("scrollable");if(c){return c}var a=d.extend({},d.tools.scrollable.conf);g=d.extend(a,g);g.keyboardSteps=g.keyboardSteps||g.size;this.each(function(){c=new e(d(this),g);d(this).data("scrollable",c)});return g.api?c:this}})(jQuery);(function(c){var d=c.tools.scrollable;d.plugins=d.plugins||{};d.plugins.circular={version:"0.5.1",conf:{api:false,clonedClass:"cloned"}};c.fn.circular=function(a){var f=c.extend({},d.plugins.circular.conf),g;c.extend(f,a);this.each(function(){var s=c(this).scrollable(),e=s.getItems(),q=s.getConf(),v=s.getItemWrap(),r=0;if(s){g=s}if(e.length<q.size){return false}e.slice(0,q.size).each(function(h){c(this).clone().appendTo(v).click(function(){s.click(e.length+h)}).addClass(f.clonedClass)});var p=c.makeArray(e.slice(-q.size)).reverse();c(p).each(function(h){c(this).clone().prependTo(v).click(function(){s.click(-h-1)}).addClass(f.clonedClass)});var o=v.children(q.item);var t=q.hoverClass;if(t){o.hover(function(){c(this).addClass(t)},function(){c(this).removeClass(t)})}function u(j){var h=o.eq(j);if(q.vertical){v.css({top:-h.position().top})}else{v.css({left:-h.position().left})}}u(q.size);c.extend(s,{move:function(k,l,w,n){var h=r+k+q.size;var j=h>s.getSize()-q.size;if(h<=0||j){var x=r+q.size+(j?-e.length:e.length);u(x);h=x+k}if(n){o.removeClass(q.activeClass).eq(h+Math.floor(q.size/2)).addClass(q.activeClass)}if(h===r+q.size){return self}return s.seekTo(h,l,w)},begin:function(h,j){return this.seekTo(q.size,h,j)},end:function(h,j){return this.seekTo(e.length,h,j)},click:function(l,j,k){if(!q.clickable){return self}if(q.size==1){return this.next()}var h=l-r,n=q.activeClass;h-=Math.floor(q.size/2);return this.move(h,j,k,true)},getIndex:function(){return r},setPage:function(j,h,k){return this.seekTo(j*q.size+q.size,h,k)},getPageAmount:function(){return Math.ceil(e.length/q.size)},getPageIndex:function(){if(r<0){return this.getPageAmount()-1}if(r>=e.length){return 0}var h=(r+q.size)/q.size-1;return h},getVisibleItems:function(){var h=r+q.size;return o.slice(h,h+q.size)}});s.onStart(function(h,j){r=j-q.size;return false});s.getNaviButtons().removeClass(q.disabledClass)});return f.api?g:this}})(jQuery);(function(c){var d=c.tools.scrollable;d.plugins=d.plugins||{};d.plugins.autoscroll={version:"1.0.1",conf:{autoplay:true,interval:3000,autopause:true,steps:1,api:false}};c.fn.autoscroll=function(f){if(typeof f=="number"){f={interval:f}}var a=c.extend({},d.plugins.autoscroll.conf),g;c.extend(a,f);this.each(function(){var k=c(this).scrollable();if(k){g=k}var e,l,j=true;k.play=function(){if(e){return}j=false;e=setInterval(function(){k.move(a.steps)},a.interval);k.move(a.steps)};k.pause=function(){e=clearInterval(e)};k.stop=function(){k.pause();j=true};if(a.autopause){k.getRoot().add(k.getNaviButtons()).hover(function(){k.pause();clearInterval(l)},function(){if(!j){l=setTimeout(k.play,a.interval)}})}if(a.autoplay){setTimeout(k.play,a.interval)}});return a.api?g:this}})(jQuery);(function(c){var d=c.tools.scrollable;d.plugins=d.plugins||{};d.plugins.navigator={version:"1.0.2",conf:{navi:".navi",naviItem:null,activeClass:"active",indexed:false,api:false,idPrefix:null}};c.fn.navigator=function(f){var a=c.extend({},d.plugins.navigator.conf),g;if(typeof f=="string"){f={navi:f}}f=c.extend(a,f);this.each(function(){var p=c(this).scrollable(),s=p.getRoot(),e=s.data("finder").call(null,f.navi),r=null,n=p.getNaviButtons();if(p){g=p}p.getNaviButtons=function(){return n.add(e)};function o(){if(!e.children().length||e.data("navi")==p){e.empty();e.data("navi",p);for(var h=0;h<p.getPageAmount();h++){e.append(c("<"+(f.naviItem||"a")+"/>"))}r=e.children().each(function(k){var j=c(this);j.click(function(l){p.setPage(k);return l.preventDefault()});if(f.indexed){j.text(k)}if(f.idPrefix){j.attr("id",f.idPrefix+k)}})}else{r=f.naviItem?e.find(f.naviItem):e.children();r.each(function(k){var j=c(this);j.click(function(l){p.setPage(k);return l.preventDefault()})})}r.eq(0).addClass(f.activeClass)}p.onStart(function(j,k){var h=f.activeClass;r.removeClass(h).eq(p.getPageIndex()).addClass(h)});p.onReload(function(){o()});o();var q=r.filter("[href="+location.hash+"]");if(q.length){p.move(r.index(q))}});return f.api?g:this}})(jQuery);(function(e){e.fn.wheel=function(a){return this[a?"bind":"trigger"]("wheel",a)};e.event.special.wheel={setup:function(){e.event.add(this,g,h,{})},teardown:function(){e.event.remove(this,g,h)}};var g=!e.browser.mozilla?"mousewheel":"DOMMouseScroll"+(e.browser.version<"1.9"?" mousemove":"");function h(a){switch(a.type){case"mousemove":return e.extend(a.data,{clientX:a.clientX,clientY:a.clientY,pageX:a.pageX,pageY:a.pageY});case"DOMMouseScroll":e.extend(a,a.data);a.delta=-a.detail/3;break;case"mousewheel":a.delta=a.wheelDelta/120;break}a.type="wheel";return e.event.handle.call(this,a,a.delta)}var f=e.tools.scrollable;f.plugins=f.plugins||{};f.plugins.mousewheel={version:"1.0.1",conf:{api:false,speed:50}};e.fn.mousewheel=function(c){var a=e.extend({},f.plugins.mousewheel.conf),d;if(typeof c=="number"){c={speed:c}}c=e.extend(a,c);this.each(function(){var j=e(this).scrollable();if(j){d=j}j.getRoot().wheel(function(l,k){j.move(k<0?1:-1,c.speed||50);return false})});return c.api?d:this}})(jQuery);(function(h){h.tools=h.tools||{};h.tools.overlay={version:"1.1.2",addEffect:function(d,c,a){e[d]=[c,a]},conf:{top:"10%",left:"center",absolute:false,speed:"normal",closeSpeed:"fast",effect:"default",close:null,oneInstance:true,closeOnClick:true,closeOnEsc:true,api:false,expose:null,target:null}};var e={};h.tools.overlay.addEffect("default",function(a){this.getOverlay().fadeIn(this.getConf().speed,a)},function(a){this.getOverlay().fadeOut(this.getConf().closeSpeed,a)});var g=[];function f(u,q){var a=this,d=h(this),c=h(window),r,s,t,w=q.expose&&h.tools.expose.version;var v=q.target||u.attr("rel");s=v?h(v):null||u;if(!s.length){throw"Could not find Overlay: "+v}if(u&&u.index(s)==-1){u.click(function(j){a.load(j);return j.preventDefault()})}h.each(q,function(k,j){if(h.isFunction(j)){d.bind(k,j)}});h.extend(a,{load:function(j){if(a.isOpened()){return a}var n=e[q.effect];if(!n){throw'Overlay: cannot find effect : "'+q.effect+'"'}if(q.oneInstance){h.each(g,function(){this.close(j)})}j=j||h.Event();j.type="onBeforeLoad";d.trigger(j);if(j.isDefaultPrevented()){return a}t=true;if(w){s.expose().load(j)}var k=q.top;var l=q.left;var x=s.outerWidth({margin:true});var o=s.outerHeight({margin:true});if(typeof k=="string"){k=k=="center"?Math.max((c.height()-o)/2,0):parseInt(k,10)/100*c.height()}if(l=="center"){l=Math.max((c.width()-x)/2,0)}if(!q.absolute){k+=c.scrollTop();l+=c.scrollLeft()}s.css({top:k,left:l,position:"absolute"});j.type="onStart";d.trigger(j);n[0].call(a,function(){if(t){j.type="onLoad";d.trigger(j)}});if(q.closeOnClick){h(document).bind("click.overlay",function(y){if(!a.isOpened()){return}var z=h(y.target);if(z.parents(s).length>1){return}h.each(g,function(){this.close(y)})})}if(q.closeOnEsc){h(document).unbind("keydown.overlay").bind("keydown.overlay",function(y){if(y.keyCode==27){h.each(g,function(){this.close(y)})}})}return a},close:function(j){if(!a.isOpened()){return a}j=j||h.Event();j.type="onBeforeClose";d.trigger(j);if(j.isDefaultPrevented()){return}t=false;e[q.effect][1].call(a,function(){j.type="onClose";d.trigger(j)});var k=true;h.each(g,function(){if(this.isOpened()){k=false}});if(k){h(document).unbind("click.overlay").unbind("keydown.overlay")}return a},getContent:function(){return s},getOverlay:function(){return s},getTrigger:function(){return u},getClosers:function(){return r},isOpened:function(){return t},getConf:function(){return q},bind:function(k,j){d.bind(k,j);return a},unbind:function(j){d.unbind(j);return a}});h.each("onBeforeLoad,onStart,onLoad,onBeforeClose,onClose".split(","),function(k,j){a[j]=function(l){return a.bind(j,l)}});if(w){if(typeof q.expose=="string"){q.expose={color:q.expose}}h.extend(q.expose,{api:true,closeOnClick:q.closeOnClick,closeOnEsc:false});var p=s.expose(q.expose);p.onBeforeClose(function(j){a.close(j)});a.onClose(function(j){p.close(j)})}r=s.find(q.close||".close");if(!r.length&&!q.close){r=h('<div class="close"></div>');s.prepend(r)}r.click(function(j){a.close(j)})}h.fn.overlay=function(d){var c=this.eq(typeof d=="number"?d:0).data("overlay");if(c){return c}if(h.isFunction(d)){d={onBeforeLoad:d}}var a=h.extend({},h.tools.overlay.conf);d=h.extend(true,a,d);this.each(function(){c=new f(h(this),d);g.push(c);h(this).data("overlay",c)});return d.api?c:this}})(jQuery);(function(c){var d=c.tools.overlay;d.plugins=d.plugins||{};d.plugins.gallery={version:"1.0.0",conf:{imgId:"img",next:".next",prev:".prev",info:".info",progress:".progress",disabledClass:"disabled",activeClass:"active",opacity:0.8,speed:"slow",template:"<strong>${title}</strong> <span>Image ${index} of ${total}</span>",autohide:true,preload:true,api:false}};c.fn.gallery=function(F){var v=c.extend({},d.plugins.gallery.conf),x;c.extend(v,F);x=this.overlay();var a=this,A=x.getOverlay(),z=A.find(v.next),C=A.find(v.prev),E=A.find(v.info),G=A.find(v.progress),B=C.add(z).add(E).css({opacity:v.opacity}),H=x.getClosers(),y;function u(f){G.fadeIn();B.hide();H.hide();var g=f.attr("href");var e=new Image();e.onload=function(){G.fadeOut();var o=c("#"+v.imgId,A);if(!o.length){o=c("<img/>").attr("id",v.imgId).css("visibility","hidden");A.prepend(o)}o.attr("src",g).css("visibility","hidden");var l=e.width;var j=(c(window).width()-l)/2;y=a.index(a.filter("[href="+g+"]"));a.removeClass(v.activeClass).eq(y).addClass(v.activeClass);var k=v.disabledClass;B.removeClass(k);if(y===0){C.addClass(k)}if(y==a.length-1){z.addClass(k)}var n=v.template.replace("${title}",f.attr("title")||f.data("title")).replace("${index}",y+1).replace("${total}",a.length);var h=parseInt(E.css("paddingLeft"),10)+parseInt(E.css("paddingRight"),10);E.html(n).css({width:l-h});A.animate({width:l,height:e.height,left:j},v.speed,function(){o.hide().css("visibility","visible").fadeIn(function(){if(!v.autohide){B.fadeIn();H.show()}})})};e.onerror=function(){A.fadeIn().html("Cannot find image "+g)};e.src=g;if(v.preload){a.filter(":eq("+(y-1)+"), :eq("+(y+1)+")").each(function(){var h=new Image();h.src=c(this).attr("href")})}}function D(f,e){f.click(function(){if(f.hasClass(v.disabledClass)){return}var g=a.eq(i=y+(e?1:-1));if(g.length){u(g)}})}D(z,true);D(C);c(document).keydown(function(f){if(!A.is(":visible")||f.altKey||f.ctrlKey){return}if(f.keyCode==37||f.keyCode==39){var e=f.keyCode==37?C:z;e.click();return f.preventDefault()}return true});function t(){if(!A.is(":animated")){B.show();H.show()}}if(v.autohide){A.hover(t,function(){B.fadeOut();H.hide()}).mousemove(t)}var w;this.each(function(){var e=c(this),f=c(this).overlay(),g=f;f.onBeforeLoad(function(){u(e)});f.onClose(function(){a.removeClass(v.activeClass)})});return v.api?w:this}})(jQuery);(function(j){var f=j.tools.overlay;f.effects=f.effects||{};f.effects.apple={version:"1.0.1"};j.extend(f.conf,{start:{absolute:true,top:null,left:null},fadeInSpeed:"fast",zIndex:9999});function k(c){var a=c.offset();return[a.top+c.height()/2,a.left+c.width()/2]}var h=function(e){var t=this.getOverlay(),y=this.getConf(),v=this.getTrigger(),c=this,a=t.outerWidth({margin:true}),p=t.data("img");if(!p){var s=t.css("backgroundImage");if(!s){throw"background-image CSS property not set for overlay"}s=s.substring(s.indexOf("(")+1,s.indexOf(")")).replace(/\"/g,"");t.css("backgroundImage","none");p=j('<img src="'+s+'"/>');p.css({border:0,position:"absolute",display:"none"}).width(a);j("body").append(p);t.data("img",p)}var d=j(window),u=y.start.top||Math.round(d.height()/2),w=y.start.left||Math.round(d.width()/2);if(v){var x=k(v);u=x[0];w=x[1]}if(!y.start.absolute){u+=d.scrollTop();w+=d.scrollLeft()}p.css({top:u,left:w,width:0,zIndex:y.zIndex}).show();p.animate({top:t.css("top"),left:t.css("left"),width:a},y.speed,function(){t.css("zIndex",y.zIndex+1).fadeIn(y.fadeInSpeed,function(){if(c.isOpened()&&!j(this).index(t)){e.call()}else{t.hide()}})})};var g=function(p){var n=this.getOverlay(),e=this.getConf(),o=this.getTrigger(),a=e.start.top,c=e.start.left;n.hide();if(o){var d=k(o);a=d[0];c=d[1]}n.data("img").animate({top:a,left:c,width:0},e.closeSpeed,p)};f.addEffect("apple",h,g)})(jQuery);(function(d){d.tools=d.tools||{};d.tools.expose={version:"1.0.5",conf:{maskId:null,loadSpeed:"slow",closeSpeed:"fast",closeOnClick:true,closeOnEsc:true,zIndex:9998,opacity:0.8,color:"#456",api:false}};function e(){if(d.browser.msie){var a=d(document).height(),c=d(window).height();return[window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,a-c<20?c:a]}return[d(window).width(),d(document).height()]}function f(k,l){var o=this,a=d(this),p=null,n=false,c=0;d.each(l,function(h,g){if(d.isFunction(g)){a.bind(h,g)}});d(window).resize(function(){o.fit()});d.extend(this,{getMask:function(){return p},getExposed:function(){return k},getConf:function(){return l},isLoaded:function(){return n},load:function(q){if(n){return o}c=k.eq(0).css("zIndex");if(l.maskId){p=d("#"+l.maskId)}if(!p||!p.length){var h=e();p=d("<div/>").css({position:"absolute",top:0,left:0,width:h[0],height:h[1],display:"none",opacity:0,zIndex:l.zIndex});if(l.maskId){p.attr("id",l.maskId)}d("body").append(p);var j=p.css("backgroundColor");if(!j||j=="transparent"||j=="rgba(0, 0, 0, 0)"){p.css("backgroundColor",l.color)}if(l.closeOnEsc){d(document).bind("keydown.unexpose",function(r){if(r.keyCode==27){o.close()}})}if(l.closeOnClick){p.bind("click.unexpose",function(r){o.close(r)})}}q=q||d.Event();q.type="onBeforeLoad";a.trigger(q);if(q.isDefaultPrevented()){return o}d.each(k,function(){var r=d(this);if(!/relative|absolute|fixed/i.test(r.css("position"))){r.css("position","relative")}});k.css({zIndex:Math.max(l.zIndex+1,c=="auto"?0:c)});var g=p.height();if(!this.isLoaded()){p.css({opacity:0,display:"block"}).fadeTo(l.loadSpeed,l.opacity,function(){if(p.height()!=g){p.css("height",g)}q.type="onLoad";a.trigger(q)})}n=true;return o},close:function(g){if(!n){return o}g=g||d.Event();g.type="onBeforeClose";a.trigger(g);if(g.isDefaultPrevented()){return o}p.fadeOut(l.closeSpeed,function(){g.type="onClose";a.trigger(g);k.css({zIndex:d.browser.msie?c:null})});n=false;return o},fit:function(){if(p){var g=e();p.css({width:g[0],height:g[1]})}},bind:function(h,g){a.bind(h,g);return o},unbind:function(g){a.unbind(g);return o}});d.each("onBeforeLoad,onLoad,onBeforeClose,onClose".split(","),function(h,g){o[g]=function(j){return o.bind(g,j)}})}d.fn.expose=function(g){var c=this.eq(typeof g=="number"?g:0).data("expose");if(c){return c}if(typeof g=="string"){g={color:g}}var a=d.extend({},d.tools.expose.conf);g=d.extend(a,g);this.each(function(){c=new f(d(this),g);d(this).data("expose",c)});return g.api?c:this}})(jQuery);(function(w){var y=function(a){return a!==undefined&&a!==null},n=function(a,d,c){y(a)&&a.apply(d,c)},v=function(a){setTimeout(a,0)},u="",z="&",p="?",o="success",t="error",r=w("head"),s={},x={callback:"C",url:location.href},q=function(L){L=w.extend({},x,L);var O=L.beforeSend,S=0;L.abort=function(){S=1};if(y(O)&&(O(L,L)===false||S)){return L}var Q=L.success,T=L.complete,j=L.error,N=L.dataFilter,h=L.callbackParameter,g=L.callback,M=L.cache,U=L.pageCache,K=L.url,d=L.data,e=L.timeout,a,f,l,J;K=y(K)?K:u;d=y(d)?((typeof d)=="string"?d:w.param(d)):u;y(h)&&(d+=(d==u?u:z)+escape(h)+"=?");!M&&!U&&(d+=(d==u?u:z)+"_"+(new Date()).getTime()+"=");a=K.split(p);if(d!=u){f=d.split(p);J=a.length-1;J&&(a[J]+=z+f.shift());a=a.concat(f)}l=a.length-2;l&&(a[l]+=g+a.pop());var R=a.join(p),P=function(A){y(N)&&(A=N.apply(L,[A]));n(Q,L,[A,o]);n(T,L,[L,o])},c=function(A){n(j,L,[L,A]);n(T,L,[L,A])},k=s[R];if(U&&y(k)){v(function(){y(k.s)?P(k.s):c(t)});return L}v(function(){if(S){return}var I=w("<iframe />").appendTo(r),G=I[0],E=G.contentWindow||G.contentDocument,C=E.document,H,B,A=function(W,V){U&&!y(V)&&(s[R]=u);H();c(y(V)?V:t)},F=function(V){E[V]=undefined;try{delete E[V]}catch(W){}},D=g=="E"?"X":"E";if(!y(C)){C=E;E=C.getParentNode()}C.open();E[g]=function(V){S=1;U&&(s[R]={s:V});v(function(){H();P(V)})};E[D]=function(V){(!V||V=="complete")&&!S++&&v(A)};L.abort=H=function(){clearTimeout(B);C.open();F(D);F(g);C.write(u);C.close();I.remove()};C.write(['<html><head><script src="',R,'" onload="',D,'()" onreadystatechange="',D,'(this.readyState)"><\/script></head><body onload="',D,'()"></body></html>'].join(u));C.close();e>0&&(B=setTimeout(function(){!S&&A(u,"timeout")},e))});return L};q.setup=function(a){w.extend(x,a)};w.jsonp=q})(jQuery);function str_repeat(c,a){for(var d=[];a>0;d[--a]=c){}return(d.join(""))}function sprintf(){var h=0,g,j=arguments[h++],l=[],e,k,n,d;while(j){if(e=/^[^\x25]+/.exec(j)){l.push(e[0])}else{if(e=/^\x25{2}/.exec(j)){l.push("%")}else{if(e=/^\x25(?:(\d+)\$)?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(j)){if(((g=arguments[e[1]||h++])==null)||(g==undefined)){throw ("Too few arguments.")}if(/[^s]/.test(e[7])&&(typeof(g)!="number")){throw ("Expecting number but found "+typeof(g))}switch(e[7]){case"b":g=g.toString(2);break;case"c":g=String.fromCharCode(g);break;case"d":g=parseInt(g);break;case"e":g=e[6]?g.toExponential(e[6]):g.toExponential();break;case"f":g=e[6]?parseFloat(g).toFixed(e[6]):parseFloat(g);break;case"o":g=g.toString(8);break;case"s":g=((g=String(g))&&e[6]?g.substring(0,e[6]):g);break;case"u":g=Math.abs(g);break;case"x":g=g.toString(16);break;case"X":g=g.toString(16).toUpperCase();break}g=(/[def]/.test(e[7])&&e[2]&&g>0?"+"+g:g);n=e[3]?e[3]=="0"?"0":e[3].charAt(1):" ";d=e[5]-String(g).length;k=e[5]?str_repeat(n,d):"";l.push(e[4]?g+k:k+g)}else{throw ("Huh ?!")}}}j=j.substring(e[0].length)}return l.join("")}function checkAPIs(c){var a="";$.getJSON("http://twitter.com/help/test.json?callback=?",function(d){if(d!="ok"){a="The twitter API is currently down. Please try again later."}});if(a!=""){$("#apistatus").html(a).show()}}function tlist_date(h){var a=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");var k=new Date(h.substring(0,4),h.substring(5,7),h.substring(8,10),h.substring(11,13),h.substring(14,16),h.substring(17,19));var j=a[k.getMonth()-1];var f=k.getDate();var e=k.getHours();var g=k.getMinutes();var c="th";if(e>11){ap="PM";if(e>12){e%=12}}else{ap="AM";if(e==0){e=12}}if(g<10){g="0"+g.toString()}if(f%10==1){c="st"}else{if(f%10==2){c="nd"}else{if(f%10==3){c="rd"}}}return e.toString()+":"+g.toString()+" "+ap+" "+j+" "+f+c}function build_num_search_results_html(d,f,e,c){var g=(f-1)*e+1;var a=(g+c)-1;if(c==1){return"Result "+g+" of "+d}else{return"Results "+g+" - "+a+" of "+d}}function build_paging_links(g,f){var a="";var e=end_page=1;query=$.URLEncode($("#id_query").val());if(g>1){previous_page=g-1;a+='<a class="prev" href="/lists/search/?query='+query+"&page="+previous_page+'">Prev</a>'}if(f>5){if(g<=3){e=1;end_page=(f<5)?f:5}else{if(g>f-2){e=f-4;end_page=f}else{e=g-2;end_page=g+2}}}else{e=1;end_page=f}for(var d=e;d<=end_page;d++){var h=new Array();if(d==e){h.push("first")}else{if(d==end_page){h.push("last")}}if(d==g){h.push("current")}h=' class="'+h.join(" ")+'" ';a+='<a href="/lists/search/?query='+query+"&page="+d+'"'+h+">"+d+"</a>"}if(g<f){next_page=g+1;a+='<a class="next" href="/lists/search/?query='+query+"&page="+next_page+'">Next</a>'}return a}function get_page(a,c){var d=1;if(!c){c=""}else{c+=" "}if(a.attr("class").indexOf("prev")!=-1){d=parseInt($(c+".paging .current").prev().html())}else{if(a.attr("class").indexOf("next")!=-1){d=parseInt($(c+".paging .current").next().html())}else{d=parseInt(a.text())}}return d}function redirect(a){if(navigator.userAgent.toString().indexOf("Chrome/2")!=-1){var c=$("<form></form>");c.attr("method","get");c.attr("action",a);c.submit()}else{location.href=a}}function show_twitter_auth_message(a){var c=$("#a_twitter_oauth_auth").attr("href");$("#a_twitter_oauth_auth").attr("href",twitter_auth_url+"?return_to="+$.URLEncode(a));c=$("#a_twitter_oauth_auth").attr("href");if(c.indexOf("autofollow")>-1){$("#intheader").html("Follow this List!");$("#intdesc").html("You'll need to create a secure connection between TLISTS and Twitter in order to follow this List.")}else{if(c.indexOf("autoapply")>-1){$("#intheader").html("Apply to Join this List");$("#intdesc").html("You'll need to create a secure connection between TLISTS and Twitter, in order to let the List curator know that you have applied to his or her List.")}else{if(c.indexOf("autocreate")>-1){$("#intheader").html("Create your own SuperList");$("#intdesc").html("You'll need to create a secure connection between TLISTS and Twitter in order to create your own SuperList in your account.")}else{if(c.indexOf("create")>-1){$("#intheader").html("Add Your Twitter Lists to TLISTS");$("#intdesc").html("Create a secure connection between TLISTS and Twitter to access TLISTS' Curation tools.")}else{if(c.indexOf("manage")>-1){$("#intheader").html("Improve Your Twitter Lists Using the TLISTS' Curation Tools");$("#intdesc").html("Create a secure connection between TLISTS and Twitter to access TLISTS' Curation tools.")}else{if(c.indexOf("view_applicants")>-1){$("#intheader").html("Someone has Applied to Join Your List!");$("#intdesc").html("Congrats! Someone has applied to join your List. Accept or Reject the Applicant. To access TLISTS power tools you will need to create a secure connection to TLISTS using your Twitter account")}else{$("#intheader").html("Add Your Twitter Lists to TLISTS");$("#intdesc").html("Create a secure connection between TLISTS and Twitter to access TLISTS' Curation tools.")}}}}}}$("#div_twitter_auth_message").overlay({expose:{color:"#3d7592",opacity:0.7},api:true,closeOnClick:false}).load()}function hide_alert_message(){$("#alert_message").hide("fast");$("#alert_message").css("z-index","10")}function alert_message(a){$("#alert_message").css("top",$(window).scrollTop()+"px");$("#alert_message p").html(a);$("#alert_message").show("fast",function(){setTimeout(hide_alert_message,5000)})}function alert_message_top(a){$("#alert_message").css("z-index","20000").css("top",$(window).scrollTop()+"px");$("#alert_message p").html(a);$("#alert_message").show("fast",function(){setTimeout(hide_alert_message,5000)})}$.extend({URLEncode:function(l){var k="";var e=0;l=l.toString();var g=/(^[a-zA-Z0-9_.]*)/;while(e<l.length){var a=g.exec(l.substr(e));if(a!=null&&a.length>1&&a[1]!=""){k+=a[1];e+=a[1].length}else{if(l[e]==" "){k+="+"}else{var j=l.charCodeAt(e);var f=j.toString(16);k+="%"+(f.length<2?"0":"")+f.toUpperCase()}e++}}return k},URLDecode:function(d){var f=d;var a,c;var e=/(%[^%]{2})/;while((m=e.exec(f))!=null&&m.length>1&&m[1]!=""){b=parseInt(m[1].substr(1),16);c=String.fromCharCode(b);f=f.replace(m[1],c)}return f}});jQuery.fn.show_char_limit=function(a,d){if(!d){d={}}if(typeof a==="number"){d.maxlength=a}else{d=a||{}}var e=jQuery.extend({error_class:"error",status_style:"text",status_element_suffix:"__status"},d);var c=function(f){f=jQuery(f);var g=f.val().length;var l=f.attr("maxlength");if(!l||l==""||l==-1){l=e.maxlength}var k=l-g;var j;if(e.status_style=="chars_typed"){j=""+g}else{if(e.status_style=="chars_left"){j=""+k}else{var n=k>=0?"left":"over";var p=(Math.abs(k)!=1?"characters":"character");j=""+Math.abs(k)+" "+p+" "+n}}var o=e.status_element?e.status_element:("#"+f.attr("id")+e.status_element_suffix);if(jQuery(o).size()==0){if(f.attr("id")==""){var h=""+Math.floor(Math.random()*9999999999);f.attr("id",h);o="#"+h+e.status_element_suffix}f.after('<span class="status" id="'+f.attr("id")+e.status_element_suffix+'"></span>')}jQuery(o).html(j);if(e.error_element||e.error_element_suffix){var o=e.error_element?e.error_element:("#"+f.attr("id")+e.error_element_suffix);if(k<0){jQuery(o).addClass(e.error_class)}else{jQuery(o).removeClass(e.error_class)}}};return this.each(function(){c(this);jQuery(this).keyup(function(){c(this)})})};