Array.prototype.index=function(c){for(var b=0,a=this.length;b<a;b++){if(this[b]==c){return b}}return null};Array.prototype.include=function(a){return this.index(a)!==null};Array.each=function(b,d){for(var c=0;c<b.length;c++){d(b[c])}};Array.prototype.each=function(a){Array.each(this,a)};Array.collect=function(b,c){var d=new Array();b.each(function(a){d.push(c(a))});return d};Array.prototype.collect=function(a){return Array.collect(this,a)};(function(a){a().ajaxSend(function(b,d,c){d.setRequestHeader("Accept","text/javascript, text/html, application/xml, text/xml, */*")})})(jQuery);(function(a){a.fn.reset=function(){return this.each(function(){if(typeof this.reset=="function"||(typeof this.reset=="object"&&!this.reset.nodeType)){this.reset()}})};a.fn.enable=function(){return this.each(function(){this.disabled=false})};a.fn.disable=function(){return this.each(function(){this.disabled=true})}})(jQuery);(function(a){a.extend({fieldEvent:function(b,f){var d=b[0]||b,c="change";if(d.type=="radio"||d.type=="checkbox"){c="click"}else{if(f&&d.type=="text"||d.type=="textarea"){c="keyup"}}return c}});a.fn.extend({delayedObserver:function(b,f){var c=a(this);if(typeof window.delayedObserverStack=="undefined"){window.delayedObserverStack=[]}if(typeof window.delayedObserverCallback=="undefined"){window.delayedObserverCallback=function(g){observed=window.delayedObserverStack[g];if(observed.timer){clearTimeout(observed.timer)}observed.timer=setTimeout(function(){observed.timer=null;observed.callback(observed.obj,observed.obj.formVal())},observed.delay*1000);observed.oldVal=observed.obj.formVal()}}window.delayedObserverStack.push({obj:c,timer:null,delay:b,oldVal:c.formVal(),callback:f});var d=window.delayedObserverStack.length-1;if(c[0].tagName=="FORM"){a(":input",c).each(function(){var g=a(this);g.bind(a.fieldEvent(g,b),function(){observed=window.delayedObserverStack[d];if(observed.obj.formVal()==observed.obj.oldVal){return}else{window.delayedObserverCallback(d)}})})}else{c.bind(a.fieldEvent(c,b),function(){observed=window.delayedObserverStack[d];if(observed.obj.formVal()==observed.obj.oldVal){return}else{window.delayedObserverCallback(d)}})}},formVal:function(){var b=this[0];if(b.tagName=="FORM"){return this.serialize()}if(b.type=="checkbox"||self.type=="radio"){return this.filter("input:checked").val()||""}else{return this.val()}}})})(jQuery);(function($){$.fn.extend({visualEffect:function(o){e=o.replace(/\_(.)/g,function(m,l){return l.toUpperCase()});return eval("$(this)."+e+"()")},appear:function(speed,callback){return this.fadeIn(speed,callback)},blindDown:function(speed,callback){return this.show("blind",{direction:"vertical"},speed,callback)},blindUp:function(speed,callback){return this.hide("blind",{direction:"vertical"},speed,callback)},blindRight:function(speed,callback){return this.show("blind",{direction:"horizontal"},speed,callback)},blindLeft:function(speed,callback){this.hide("blind",{direction:"horizontal"},speed,callback);return this},dropOut:function(speed,callback){return this.hide("drop",{direction:"down"},speed,callback)},dropIn:function(speed,callback){return this.show("drop",{direction:"up"},speed,callback)},fade:function(speed,callback){return this.fadeOut(speed,callback)},fadeToggle:function(speed,callback){return this.animate({opacity:"toggle"},speed,callback)},fold:function(speed,callback){return this.hide("fold",{},speed,callback)},foldOut:function(speed,callback){return this.show("fold",{},speed,callback)},grow:function(speed,callback){return this.show("scale",{},speed,callback)},highlight:function(speed,callback){return this.show("highlight",{},speed,callback)},puff:function(speed,callback){return this.hide("puff",{},speed,callback)},pulsate:function(speed,callback){return this.show("pulsate",{},speed,callback)},shake:function(speed,callback){return this.show("shake",{},speed,callback)},shrink:function(speed,callback){return this.hide("scale",{},speed,callback)},squish:function(speed,callback){return this.hide("scale",{origin:["top","left"]},speed,callback)},slideUp:function(speed,callback){return this.hide("slide",{direction:"up"},speed,callback)},slideDown:function(speed,callback){return this.show("slide",{direction:"up"},speed,callback)},switchOff:function(speed,callback){return this.hide("clip",{},speed,callback)},switchOn:function(speed,callback){return this.show("clip",{},speed,callback)}})})(jQuery);var height_=jQuery.fn.height;jQuery.fn.height=function(){if(this[0]==window&&jQuery.browser.opera&&jQuery.browser.version>=9.5){return window.innerHeight}else{return height_.apply($(this[0]))}};jQuery.parseQuery=function(a,b){var c=(typeof a==="string"?a:window.location.search),f={f:function(g){return unescape(g).replace(/\+/g," ")}},b=(typeof a==="object"&&typeof b==="undefined")?a:b,f=jQuery.extend({},f,b),d={};jQuery.each(c.match(/^\??(.*)$/)[1].split("&"),function(g,h){h=h.split("=");h[1]=f.f(h[1]);d[h[0]]=d[h[0]]?((d[h[0]] instanceof Array)?(d[h[0]].push(h[1]),d[h[0]]):[d[h[0]],h[1]]):h[1]});return d};$.fn.bgIframe=$.fn.bgiframe=function(b){if($.browser.msie&&/6.0/.test(navigator.userAgent)){b=$.extend({top:"auto",left:"auto",width:"auto",height:"auto",opacity:true,src:"javascript:false;"},b||{});var c=function(d){return d&&d.constructor==Number?d+"px":d},a='<iframe class="bgiframe"frameborder="0"tabindex="-1"src="'+b.src+'"style="display:block;position:absolute;z-index:-1;'+(b.opacity!==false?"filter:Alpha(Opacity='0');":"")+"top:"+(b.top=="auto"?"expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+'px')":c(b.top))+";left:"+(b.left=="auto"?"expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+'px')":c(b.left))+";width:"+(b.width=="auto"?"expression(this.parentNode.offsetWidth+'px')":c(b.width))+";height:"+(b.height=="auto"?"expression(this.parentNode.offsetHeight+'px')":c(b.height))+';"/>';return this.each(function(){if($("> iframe.bgiframe",this).length==0){this.insertBefore(document.createElement(a),this.firstChild)}})}return this};(function(a){a.InFieldLabels=function(c,f,b){var d=this;d.$label=a(c);d.label=c;d.$field=a(f);d.field=f;d.$label.data("InFieldLabels",d);d.showing=true;d.init=function(){d.options=a.extend({},a.InFieldLabels.defaultOptions,b);if(d.$field.val()!=""){d.$label.hide();d.showing=false}d.$field.focus(function(){d.fadeOnFocus()}).blur(function(){d.checkForEmpty(true)}).bind("keydown.infieldlabel",function(g){d.hideOnChange(g)}).change(function(g){d.checkForEmpty()}).bind("onPropertyChange",function(){d.checkForEmpty()})};d.fadeOnFocus=function(){if(d.showing){d.setOpacity(d.options.fadeOpacity)}};d.setOpacity=function(g){d.$label.stop().animate({opacity:g},d.options.fadeDuration);d.showing=(g>0)};d.checkForEmpty=function(g){if(d.$field.val()==""){d.prepForShow();d.setOpacity(g?1:d.options.fadeOpacity)}else{d.setOpacity(0)}};d.prepForShow=function(g){if(!d.showing){d.$label.css({opacity:0}).show();d.$field.bind("keydown.infieldlabel",function(h){d.hideOnChange(h)})}};d.hideOnChange=function(g){if((g.keyCode==16)||(g.keyCode==9)){return}if(d.showing){d.$label.hide();d.showing=false}d.$field.unbind("keydown.infieldlabel")};d.init()};a.InFieldLabels.defaultOptions={fadeOpacity:0.5,fadeDuration:300};a.fn.inFieldLabels=function(b){return this.each(function(){var d=a(this).attr("for");if(!d){return}var c=a("input#"+d+"[type='text'],input#"+d+"[type='password'],textarea#"+d);if(c.length==0){return}(new a.InFieldLabels(this,c[0],b))})}})(jQuery);$.fn.fixPNG=function(){return this.each(function(){var a=($.browser.msie&&parseInt($.browser.version.substr(0,1))<7);if(!a){return this}var b=$(this).css("backgroundImage");if(b.match(/^url\(["']?(.*\.png)["']?\)$/i)){b=RegExp.$1;$(this).css({backgroundImage:"none",filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod="+($(this).css("backgroundRepeat")=="no-repeat"?"crop":"scale")+", src='"+b+"')"}).each(function(){var c=$(this).css("position");if(c!="absolute"&&c!="relative"){$(this).css("position","relative")}})}return this})};(function(){var f=($.browser.msie&&parseInt($.browser.version.substr(0,1))<7),h=/\.(jpg|gif|png|bmp|jpeg)(.*)?$/i,j=/\?/i,g=/\?$/i,i=/\&$/i,a=null;$.fn.jqpop=function(o){this.each(function(){k(this,o)});return this};jQuery.jqpop={scrollResize:function(o){if(a!=null&&$.isFunction(a.scrollResize)){(a.scrollResize)(o)}},close:function(o){if(a!=null&&$.isFunction(a.close)){(a.close)(o)}return false},getLastAPI:function(){return a}};$.fn.jqpop.defaults={backdropClass:"jqpop_backdrop",backdropId:null,backdropLoadingImageURL:"/images/spinner_orange_on_black.gif",wrapperClass:"jqpop_wrapper",wrapperId:null,hideOnBackdropClick:true,hideOnContentClick:false,showCloseButton:true,closeButtonContent:"",closeButtonClass:"jqpop_close",closeButtonId:"jqpop_close",callbackOnStart:null,callbackBeforeShow:null,callbackAfterShow:null,callbackBeforeClose:null,callbackAfterClose:null,ieBGIFrameClass:"jqpop_bgiframe",addRandomToURL:false,href:null,content:null,repositionOnScroll:false,repositionOnResize:true};function m(o){return(o==null||jQuery.trim(o).length==0)}function c(p,o){return(m(p)?o:p)}function d(p,q,o){return(m(p)?o:q)}function l(o){return d(o," id='"+o+"'","")}function b(o){return d(o," class='"+o+"'","")}function n(o){return $.isFunction(o)?o():o}function k(o,r){var G=jQuery.extend({},$.fn.jqpop.defaults,r);o=$(o);var A=null,v=null,B=null,p=null,t=false;function E(){return G}function z(){if(A!=null){return A}var I=(f?("<iframe class='"+n(G.ieBGIFrameClass)+"' scrolling='no' frameborder='0'></iframe><div class='"+n(G.ieBGIFrameClass)+"'></div>"):"");A=$("<div style='display:none'"+l(n(G.backdropId))+b(n(G.backdropClass))+">"+I+"</div>");return A.appendTo("body").fixPNG()}function H(){if(v!=null){return v}v=$("<div style='display:none' "+l(n(G.wrapperId))+b(n(G.wrapperClass))+"</div>");return v.appendTo("body").fixPNG()}function y(){if($.isFunction(G.callbackBeforeClose)){G.callbackBeforeClose(G)}if(p!=null){p.remove();p=null}v.hide();if(!t){v.children().hide().appendTo($("body"));if(n(G.hideOnContentClick)){B.unbind("click",y)}B=null}v.remove();v=null;function I(){if($.isFunction(G.callbackAfterClose)){G.callbackAfterClose(G)}}$(window).unbind("scroll",C);$(window).unbind("resize",C);if(f){A.hide().remove();A=null;I()}else{A.hide();A.remove();A=null;I()}return false}function F(){if(!n(G.showCloseButton)){return}p=$("<a "+l(n(G.closeButtonId))+b(n(G.closeButtonClass))+" href='#'>"+n(G.closeButtonContent)+"</a>");p.click(y).appendTo(v).fixPNG()}function D(){var M=$(window),J=M.height(),I=M.width(),L=$(document).scrollTop(),K=$(document).scrollLeft();if(A!=null){A.css({width:I,height:J,top:L,left:K})}}function q(L){D();var O=$(window),K=O.height(),J=O.width(),N=$(document).scrollTop(),M=$(document).scrollLeft();if(v!=null){var I={marginTop:Math.round(-v.outerHeight()/2),marginLeft:Math.round(-v.outerWidth()/2),top:N+Math.round(K/2),left:M+Math.round(J/2)};if(I.marginTop+I.top<5){I.marginTop=I.top=3}if(I.marginLeft+I.left<5){I.marginLeft=I.left=3}if(L==null||L<=0){v.css(I)}else{v.animate(I,L)}}}function C(){q(null)}function x(){if($.isFunction(G.callbackBeforeShow)){G.callbackBeforeShow(G)}q();v.show();F();if(n(G.hideOnBackdropClick)){A.click(y).find("iframe div").click(y)}if(n(G.hideOnContentClick)){B.click(y);v.click(y)}$(window).scroll(D).resize(D);if(G.repositionOnScroll){$(window).scroll(C)}if(G.repositionOnResize){$(window).resize(C)}if($.isFunction(G.callbackAfterShow)){G.callbackAfterShow(G)}}function w(){A.css({"background-image":"url("+G.backdropLoadingImageURL+")","background-repeat":"no-repeat","background-position":"center center"})}function u(){A.css({"background-image":"none"})}function s(){a={getBackdrop:z,getWrapper:H,close:y,addCloseButton:F,scrollResize:q,scrollResizeInstant:C,afterLoaded:x,start:s,getSettings:E};A=v=B=p=null;if($.isFunction(G.callbackOnStart)){G.callbackOnStart(G)}z().show();D();setTimeout(D,0);w();H();var I=c(n(G.href),o.attr("href"));if(G.content){B=$(G.content);t=true;B=B.eq(0);B.show().appendTo(v);x();u()}else{if((/^\#/i).test(I)){B=$(I);if(B.size()>0){t=false;B=B.eq(0);B.show().appendTo(v);x();u()}}else{if(h.test(I)){t=true;$(new Image()).load(function(){B=$("<img src='"+I+"' />");B.appendTo(v);x();u()}).attr("src",I)}else{t=true;if(n(G.addRandomToURL)){if(j.test(I)){if(!i.test(I)&&!g.test(I)){I+="&"}}else{I+="?"}I+="randomNumber=";I+=(""+(Math.round(Math.random()*10000000000)));I+=(""+(new Date()).getTime())}v.load(I,null,function(){B=v.children().fixPNG();x();u()})}}}return false}o.unbind("click").click(s)}})();(function(c){var a=c.scrollTo=function(g,f,d){c(window).scrollTo(g,f,d)};a.defaults={axis:"xy",duration:parseFloat(c.fn.jquery)>=1.3?0:1};a.window=function(d){return c(window)._scrollable()};c.fn._scrollable=function(){return this.map(function(){var f=this,d=!f.nodeName||c.inArray(f.nodeName.toLowerCase(),["iframe","#document","html","body"])!=-1;if(!d){return f}var g=(f.contentWindow||f).document||f.ownerDocument||f;return c.browser.safari||g.compatMode=="BackCompat"?g.body:g.documentElement})};c.fn.scrollTo=function(g,f,d){if(typeof f=="object"){d=f;f=0}if(typeof d=="function"){d={onAfter:d}}if(g=="max"){g=9000000000}d=c.extend({},a.defaults,d);f=f||d.speed||d.duration;d.queue=d.queue&&d.axis.length>1;if(d.queue){f/=2}d.offset=b(d.offset);d.over=b(d.over);return this._scrollable().each(function(){var m=this,k=c(m),l=g,j,h={},n=k.is("html,body");switch(typeof l){case"number":case"string":if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(l)){l=b(l);break}l=c(l,this);case"object":if(l.is||l.style){j=(l=c(l)).offset()}}c.each(d.axis.split(""),function(r,s){var t=s=="x"?"Left":"Top",v=t.toLowerCase(),q="scroll"+t,p=m[q],o=a.max(m,s);if(j){h[q]=j[v]+(n?0:p-k.offset()[v]);if(d.margin){h[q]-=parseInt(l.css("margin"+t))||0;h[q]-=parseInt(l.css("border"+t+"Width"))||0}h[q]+=d.offset[v]||0;if(d.over[v]){h[q]+=l[s=="x"?"width":"height"]()*d.over[v]}}else{var u=l[v];h[q]=u.slice&&u.slice(-1)=="%"?parseFloat(u)/100*o:u}if(/^\d+$/.test(h[q])){h[q]=h[q]<=0?0:Math.min(h[q],o)}if(!r&&d.queue){if(p!=h[q]){i(d.onAfterFirst)}delete h[q]}});i(d.onAfter);function i(o){k.animate(h,f,d.easing,o&&function(){o.call(this,g,d)})}}).end()};a.max=function(k,j){var i=j=="x"?"Width":"Height",f="scroll"+i;if(!c(k).is("html,body")){return k[f]-c(k)[i.toLowerCase()]()}var h="client"+i,g=k.ownerDocument.documentElement,d=k.ownerDocument.body;return Math.max(g[f],d[f])-Math.min(g[h],d[h])};function b(d){return typeof d=="object"?d:{top:d,left:d}}})(jQuery);var HM=function(){String.prototype.startsWith=function(W){return(this.match("^"+W)==W)};String.prototype.endsWith=function(W){return(this.match(W+"$")==W)};function J(W){return((W==1)?"":"s")}function d(Y,X,W){return((Y==1)?X:(W?W:(X+J(Y))))}function M(Y){var W=[],X;for(X=Y.length-1;X>=0;X--){W.push(Y[X])}return W.join("")}function g(){$("a.external:not(.externalAttached)").attr("target","_blank").addClass("externalAttached")}var I=null;function A(Y,Z){Z=Z==null?"":Z;Y=$(Y);if(I!=null){o(I)}I=Y;Y.find(".loadingGlaze").remove();var X=$('<div class="loadingGlaze"><p>'+Z+"</p></div>");X.appendTo(Y).fixPNG().show();if(Y.get(0)==document.body){function W(){var ae=$(window),ab=ae.height(),aa=ae.width(),ad=$(document).scrollTop(),ac=$(document).scrollLeft();if(X!=null){X.css({width:aa,height:ab,top:ad,left:ac})}}$(window).scroll(W).resize(W);setTimeout(W,10)}}function o(W){if(W==null){W=I}$(W).find(".loadingGlaze").fadeOut("fast",function(){$(this).remove()});I=null}function y(W){W=W==null?this:W;if(W.tagName!="TEXTAREA"){return true}var X=100;while(W.scrollHeight>(W.clientHeight+4)){W.rows++;if(X--==0){break}}return true}function t(W){W=W==null?this:W;if(W.tagName!="TEXTAREA"){return true}W.rows=1;y(W);return true}function V(W){t(this);return true}function b(W){if(W.which==13){if(!W.shiftKey){var Y=$(this);var X=$.trim(Y.val());Y.val(X);this.blur();return false}else{this.rows++}}y(this);return true}function c(W){var Y=$(this);var X=$.trim(Y.val());Y.val(X);return true}function m(W){$(W).blur(c).blur(V).keypress(b).focus(V).blur(V)}function w(W){setTimeout(function(){$(W.target).select()},10);return true}function i(W){$(W).focus(w);return true}function B(){$(".autofocus:first").focus()}function E(ab,X,aa){var W=0;function Z(){if($(window).scrollTop()>=$(document).height()-(2*$(window).height())){Y()}}function Y(){var ad=$(ab).attr("id");ad=((ad==null)?null:ad.replace(X,""));if(W==ad){return}ad=ad==null?0:ad;$("#endlessPageLoading div").html('<img src="images/spinner_orange_on_white.gif">');W=ad;var ac=aa+ad;$.get(ac,{},function(af){if(af==null||$.trim(af)==""){$("#endlessPageLoading").fadeOut("slow",function(){$(this).remove()})}else{function ae(){$(ab).after(af)}setTimeout(ae,0);setTimeout(Z,1000)}})}$(window).scroll(Z);setTimeout(Y,500)}function D(Y){Y=((Y==null)?this:Y);var aa=$(Y),X=$("#"+aa.attr("id")+"_placeholder").val();function W(){aa.removeClass("placeholder")}inProgress=false;aa.focus(function(ab){W();if(aa.val()==X){aa.val("")}return true});function Z(){var ab=$.trim(aa.val());if(ab==null||ab==""||ab==X){aa.val(X);aa.addClass("placeholder")}else{W()}return true}aa.blur(function(){Z();return true});Z()}function U(W,X){X=X==null?500:X;$("html, body").animate({scrollTop:$(W).attr("offsetTop")},X)}function q(){var W=$(this),X=this.id;$("."+X+":visible").hide();$("."+X+"_"+W.val()).show()}function l(){$(".autoToggle:not(.autoToggleAttached)").change(q).each(q).addClass("autoToggleAttached")}function C(X,W){return((X==null||X=="")?W:X)}function n(W){return W.substr(W.lastIndexOf("_")+1)}function z(W){W.fadeOut("fast",function(){W.remove()})}function K(W){H();var Y=$("<div></div>").attr("id","warning").addClass("floatingFlash").html(W).appendTo(document.body);Y.css("margin-left",-Y.width()/2);function X(){z(Y);return false}setTimeout(function(){Y.fadeTo("slow",0.9).click(X)},10);setTimeout(X,10000)}function F(W){H();var Y=$("<div></div>").attr("id","notice").addClass("floatingFlash").html(W).appendTo(document.body);Y.css("margin-left",-Y.width()/2);function X(){z(Y);return false}setTimeout(function(){Y.fadeTo("slow",0.9).click(X)},10);setTimeout(X,3000)}function s(W){if(W.warning&&W.warning!=""){K(W.warning)}else{if(W.notice&&W.notice!=""){F(W.notice)}else{H()}}}function H(){$("#warning,#notice").remove()}function N(ae,ac,Z){H();Z=Z?Z:ac;var aa=$("<div id='hm_confirmation_dialog'></div>").css("width","320px"),ad=$("<h3></h3>").html(ae).appendTo(aa),Y=$("<p class='buttons'></p>").appendTo(aa),W=$("<a href='#'></a>").addClass("button").css({"padding-left":"2em","padding-right":"2em"}).text("OK").click(function(){$.jqpop.close();setTimeout(function(){ac(true)},10);return false}).appendTo(Y),X=$("<a href='#'></a>").css("margin-left","5px").text("Cancel").click(function(){$.jqpop.close();setTimeout(function(){Z(false)},10);return false}).appendTo(Y),ab=$("<a></a>");ab.jqpop({content:aa,showCloseButton:false,hideOnBackdropClick:false,hideOnContentClick:false,callbackAfterShow:function(){$("div.jqpop_wrapper").focus()}}).click()}var v={"&":"&amp;",">":"&gt;","<":"&lt;","'":"&#39;",'"':"&quot;"};var O=[["&amp;","&"],["&gt;",">"],["&lt;","<"],["&#39;","'"],["&quot;",'"']];function a(Y){if(Y==null){return""}var X,W;for(W=0;W<5;W++){for(X=0;X<O.length;X++){Y=Y.replace(O[X][0],O[X][1])}}return Y}function R(ab){if(ab==null){return""}var X=[],ac=0,W=ab.length,Y,aa,Z;for(Y=0;Y<ab.length;Y++){aa=ab.charAt(Y);X[ac++]=(null==(Z=v[aa]))?aa:Z}return X.join("")}function r(X,Z,aa){var W=aa,Y;for(Y=X.length-1;Y>=0;Y--){if(X[Y]==Z){W=Y;break}}return W}function h(Y,W,X){X=(X==null||X=="")?"...":X;if(Y.length>W){Y=Y.substring(0,W-X.length)+X}return Y}function L(X){X=Number(X);var W=null;if(X<90){W="bad"}else{if(X<95){W="medium"}else{W="good"}}return W}var G=null;var p=5;var k=null;function Q(W){if(W!=null&&W.msg!=null&&W.msg!=""){if(G!=W.msg){$("#system_status").remove();var X=$("<div id='system_status'><p>"+W.msg+" <a class='close' href='javascript:HM.closeSystemMessage();'>[hide]</a></p></div>");X.hide();$(document.body).append(X);X.slideDown("fast");G=W.msg}}else{$("#system_status").remove()}if(W!=null&&W.interval!=null&&W.interval>1){p=W.interval}k=setTimeout(f,p*1000)}function f(){k=null;$.get("/system_status.json",{r:Math.round(Math.random()*100000000)},Q,"json")}function j(){k=setTimeout(f,3000)}function x(){$("#system_status").remove()}function P(W){return(W?'<a href="/upgrades" class="hmProBadge">pro</a>':"")}function S(){var W=$("#leftFeedback a");W.mouseover(function(){W.stop();W.animate({width:"30px"},"fast")}).mouseout(function(){W.stop();W.animate({width:"20px"},"fast")});W.jqpop({href:"/contacts/new?popup=true"})}function T(){l();g();B();j();S()}var u={initPage:T,initEndlessPage:E,attachAutogrow:m,regrowTextArea:t,growTextArea:y,selectAllEventHandler:w,attachSelectAllOnFocus:i,attachPlaceholder:D,showInProgress:A,removeInProgress:o,scrollTo:U,autoToggle:q,attachAutoToggle:l,nvl:C,extractId:n,sanitize:R,unsanitize:a,indexOf:r,truncate:h,strengthClass:L,reverse:M,closeSystemMessage:x,showFlashNotice:F,showFlashWarning:K,flashCallback:s,clearFlashMessages:H,confirm:N,pluralize:d,addS:J,proBadge:P,version:"1.0"};return u}();(function(b){b.fn.confirm=function(a){a=b.extend({msg:"Are you sure?",stopAfter:"never",wrapper:"<span></span>",eventType:"click",dialogShow:"show",dialogSpeed:"",timeout:0},a);a.stopAfter=a.stopAfter.toLowerCase();if(!a.stopAfter in ["never","once","ok","cancel"]){a.stopAfter="never"}a.buttons=b.extend({ok:"Yes",cancel:"No",wrapper:'<a href="#"></a>',separator:"/"},a.buttons);var c=a.eventType;return this.each(function(){var j=this;var f=b(j);var l;var d=function(){var n=b.data(j,"events");if(!n&&j.href){f.bind("click",function(){document.location=j.href});n=b.data(j,"events")}else{if(!n){return}}j._handlers=[];for(var m in n[c]){j._handlers.push(n[c][m])}};var g=b(a.buttons.wrapper).append(a.buttons.ok).click(function(){if(a.timeout!==0){clearTimeout(l)}f.unbind(c,h);f.show();i.hide();if(j._handlers!==undefined){b.each(j._handlers,function(){f.click(this.handler)})}f.click();if(a.stopAfter!="ok"&&a.stopAfter!="once"){f.unbind(c);f.one(c,h)}return false});var k=b(a.buttons.wrapper).append(a.buttons.cancel).click(function(){if(a.timeout!==0){clearTimeout(l)}if(a.stopAfter!="cancel"&&a.stopAfter!="once"){f.one(c,h)}f.show();i.hide();return false});if(a.buttons.cls){g.addClass(a.buttons.cls);k.addClass(a.buttons.cls)}var i=b(a.wrapper).append(a.msg).append(g).append(a.buttons.separator).append(k);var h=function(){b(this).hide();if(a.dialogShow!="show"){i.hide()}i.insertBefore(this);i[a.dialogShow](a.dialogSpeed);if(a.timeout!==0){clearTimeout(l);l=setTimeout(function(){k.click();f.one(c,h)},a.timeout)}return false};d();f.unbind(c);j._confirm=h;j._confirmEvent=c;f.one(c,h)})}})(jQuery);var HMFB=function(){function d(){var h=location.pathname;if(window.after!=null&&""!=window.after){h=window.after}window.location="/users/link_user_accounts?after="+h}function b(h){try{FB.Connect.showPermissionDialog("email",d)}catch(i){alert("Sorry, we could not connect with Facebook.")}}function a(){this.blur();try{FB.Connect.requireSession(b)}catch(h){alert("Sorry, we could not connect with Facebook.")}return false}function c(){this.innerHTML="signing out...";function i(){window.location="/signout"}if(window.FB){setTimeout(i,4000);try{FB.Connect.logout(i)}catch(h){}}else{i()}return false}function g(){$(".fbSignout").click(c);$(".fbSignin").click(a);var h=$(".header_fb_image");h.hide();setTimeout(function(){if(window.FB){h.show()}},2000)}var f={connect:a,signout:c,init:g};return f}();$(document).ready(function(){jQuery.ajaxSetup({error:function(a,d,c){if(a.status!=0&&!this.url.match("/system_status.json")){$.jqpop.close();window.ajaxRequest=a;window.ajaxTextStatus=d;window.ajaxErrorThrown=c;if(500==a.status){var b=a.responseText;if("NOT_FOUND"==b){HM.showInProgress(document.body,"Record not found. Reloading page...");setTimeout(function(){window.location.reload()},2000);return false}else{if("SIGNIN_REQUIRED"==b){HM.showInProgress(document.body,"");setTimeout(function(){window.location.href="/signin?after="+window.location.href},10);return false}else{if("SUBSCRIPTION_REQUIRED"==b){HM.showInProgress(document.body,"");setTimeout(function(){window.location.href="/upgrades"},10);return}else{if("REFRESH"==b){HM.showInProgress(document.body,"");setTimeout(function(){window.location.reload()},10);return false}else{if("INVALID_AUTHENTICITY_TOKEN"==b){HM.showInProgress(document.body,"");setTimeout(function(){window.location.reload()},10);return false}}}}}}else{alert("Sorry, your request could not be completed. Please refresh the page and try again.\n"+a.status+"\n"+d+"\n"+c)}}}});HM.initPage()});