Array.prototype.indexOf||(Array.prototype.indexOf=function(n,t){for(var i=t||0,r=this.length;i<r;i++)if(this[i]===n)return i;return-1});var _gaq=[];JustGiving={__namespace:!0,WriteConsole:function(n){window.console&&window.console.info(n)}},JustGiving.Analytics=function(){function u(t){var r,u;try{if(n){for(r="Analytics Request Sent: _gaq.push([",i=0;i<t.length;i++)u=t[i],i>0&&(r+=", "),r+="'"+u+"'";r+="]);",JustGiving.WriteConsole(r)}}catch(f){}}function r(n){if(n.constructor!=Array)throw"Only Arrays Should be Pushed to JustGiving.Analytics.Push (See: http://bit.ly/gnonOe)";else u(n),_gaq.push(n)}function t(){function t(){var n=document.createElement("script"),t;n.type="text/javascript",n.async=!0,n.src=("https:"==document.location.protocol?"https://ssl":"http://www")+".google-analytics.com/ga.js",t=document.getElementsByTagName("script")[0],t.parentNode.insertBefore(n,t),n.onreadystatechange=function(){t.readyState=="complete"},n.onload=function(){}}t(),n=!0,JustGiving.WriteConsole("JustGiving Google Analytics Spy Running...")}__namespace=!0;var n=!1;return{spy:t,push:r}}(),JustGiving.Analytics.SocialTracking=function(){function i(t){n=$.extend({},n,t)}function t(){if(n.network!==""&&n.socialAction!="")if(n.pagePath!=="")try{JustGiving.Analytics.push(["_trackSocial",n.network,n.socialAction,n.target,n.pagePath])}catch(t){}else try{JustGiving.Analytics.push(["_trackSocial",n.network,n.socialAction,n.target])}catch(t){}else JustGiving.WriteConsole("_trackSocial not pushed to Google Analytics as network and action not defined")}var n={network:"",socialAction:"",target:"",pagePath:""};return{Track:t,ExtendSettings:i}}(),JustGiving.Analytics.spy(),function(n){var t=function(n,t,i,r,u){i=!!i;var e=i?u:r,o=i?r:u,f=function(){t.attr("checked")=="checked"?e(n):o(n)};f(),t.click(f)};n.fn.bindVisibilityToCheckBoxState=function(n){t(this,n.checkBox,!!n.visibleWhenCheckBoxIsUnchecked,n.showMethod||function(n){n.slideDown()},n.hideMethod||function(n){n.slideUp()})}}(jQuery),function(n){n.fn.bindVisibilityToDropDownState=function(t){var r=this,i=function(){var i=t.dropDown.find(":selected").text();if(t.visibleWhenTextValuesAreSelected.indexOf(n.trim(i))!=-1){r.slideDown();return}r.slideUp()};t.dropDown.bind("change",i),i()}}(jQuery),function(n){n.fn.displayCharacterCountRemaining=function(n,t){function i(){var u=r.val(),f=u==undefined?0:u.length,i=t-f;n.text(":"+i+" characters remaining"),i>0?n.removeClass("exceeded"):n.addClass("exceeded")}var r=this;r.keydown(i).keypress(i).keyup(i).mouseout(i).focus(function(){n.show()}).blur(function(){n.hide()}),i(t)}}(jQuery),$(function(){$(".erase-default").live("focus",function(){var n=$(this).val();$(this).val(""),$(this).removeClass("erase-default"),$(this).bind("blur",function(){$.trim($(this).val()).length===0&&($(this).val(n),$(this).addClass("erase-default"))})})}),function(n){n.fn.examplePluginMakeBold=function(){return this.each(function(){n(this).css("font-weight","bold")})}}(jQuery),function(n){n.extend({examplePluginLog:function(n){window.console&&window.console.info(n)}})}(jQuery),function(n){n.fn.exists=function(){return this.length>0}}(jQuery),function(n){n.fn.addGoogleAutoComplete=function(){return this.each(function(){var t=new google.maps.places.Autocomplete(n(this).get(0))})}}(jQuery),function(n){n.fn.helpTips=function(){var t=this,r="tip-link",i=function(n){n.parents(".form-field-group").siblings().find(t).hide()},u=function(u){var f=n(u.target);f.hasClass(r)?(i(f),f.next("p").toggle()):f.is("input")||f.is("select")?i(f):t.hide()};n(document).ready(function(){n('<span class="'+r+'"></span>').insertBefore(t),n("body").click(u),n("body").trigger("click")})}}(jQuery),function(n){n.fn.hiddenInputElementsAsObject=function(){var t={};return this.each(function(){n(this).children("input[type=hidden]").each(function(){var r=n(this).attr("id"),i=n(this).attr("value");r&&i&&(t[r]=i)})}),t}}(jQuery),function(n){var i="",t=[],u="",o=function(){for(var n=0;n<t.length;n++)if(i==t[n].hashName)return t[n].hashFunction(t[n].state);return undefined},r=function(){var n=window.location.hash.replace("#","");n!=i&&(u=i,i=n,o())},s=function(){"onhashchange"in window&&!n.browser.msie?window.onhashchange=r:window.setInterval(r,100)},f=function(n,i){t[t.length]={hashName:n,hashFunction:i}},e=function(n,i){for(var r=0;r<t.length;r++)n==t[r].hashName&&(t[r].state=i)};n.extend({hashRegister:{register:f,init:s,setHashState:e,lastHash:function(){return u}}})}(jQuery),function(){var n={window800:{height:800,width:700,status:1,center:1,scrollbars:1}};$(function(){$(".popupwindow").popupwindow&&$(".popupwindow").popupwindow(n)})}(),function(n){n.fn.simplePaging=function(t){t=jQuery.extend({pageSize:5,page:1,button:n("<a />",{href:"#",text:"More.."}),appendButtonTo:n(this).parent()},t);var f=t.pageSize*(t.page-1),u=t.pageSize*t.page,i=n(this.context),r=n(this,i).selector;n(this,i).hide(),n(r+":lt("+f+")",i).show(),n(r+":lt("+u+")",i).show("fade"),u<n(r,i).length||t.button.remove(),t.page==1&&u<n(r,i).length&&(t.button.click(function(){return t.page+=1,t.button=t.button,n(r,i).simplePaging(t),!1}),t.button.appendTo(t.appendButtonTo))}}(jQuery),String.prototype.truncate=function(n){return this.substring(0,this.substring(0,n).lastIndexOf(" "))},String.prototype.queryStringParam=function(n){var t=new RegExp("[\\?&]"+n.toLowerCase()+"=([^&#]*)").exec(this.toLowerCase());return t?t[1]||0:0},String.prototype.trim=function(){return $.trim(this)},function(n){n.fn.truncate=function(t){var i={transition:700,delay:100,offset:10,maxLength:400,maxTextLength:70};return n.fn.extend(i,t),this.each(function(){n(this).attr("tabindex","0");var t=n(this).text(),r=n(this).html();t&&t.length>i.maxTextLength&&(n(this).css("max-width",i.maxLength+"px").css("overflow","hidden").css("text-overflow","ellipsis").css("white-space","nowrap").css("cursor","pointer"),n(this).bind("mouseenter focus",function(){var t,f,u;n("#truncateTooltip").remove(),t=n('<div id="truncateTooltip" class="tooltip"></div>'),f=n('<div class="tooltip-inner"></div>'),n('<span class="pointer"></span>').appendTo(t),f.html(r).appendTo(t),n("body").append(t),u=n(this).offset(),t.css("position","absolute").css("top",u.top+i.offset+"px").css("left",u.left+"px").css("z-index","1000").hide().delay(i.delay).fadeIn(i.transition)}),n(this).bind("mouseleave blur",function(){n("#truncateTooltip").remove()}))})},n.fn.textWidth=function(){var i=n(this).html(),r="<span>"+i+"</span>",t;return n(this).html(r),t=n(this).find("span:first").width(),n(this).html(i),t}}(jQuery),function(n){n.fn.validateDayDropDown=function(t,i,r){return this.each(function(){var f=n(i).val(),e=n(t).val(),s;f--;if(e==undefined||e<=0){n(r).val("");return}if(f==undefined||f<0){n(r).val("");return}if(n(this).val()<=0){n(r).val("");return}var h=!0,c=!1,u,o=n(this).val();while(c==!1){s=+new Date(e,f,o),u=new Date,u.setTime(s);if(u.getFullYear()==e&&u.getMonth()==f&&u.getDate()==o){n(r).val(u.getDate()+"/"+(u.getMonth()+1)+"/"+u.getFullYear()),c=!0;break}o--,h=!1}h||n(this).val(u.getDate()).effect("highlight",{},1500)})}}(jQuery),function(n){n.extend({view:function(t,i){t=typeof t=="string"?[t]:t;for(var r=0;r<t.length;r++)n("body").data("view")&&n("body").data("view").toLowerCase()==t[r].toLowerCase()&&i()}})}(jQuery)
