/* luminateExtend.js | Version: 1.7.1 (12-MAY-2015) */
!function(e){var t=function(t){return t&&e.inArray(t,["es_US","en_CA","fr_CA","en_GB","en_AU"])<0&&(t="en_US"),t},a=function(e){return e&&(e=t(e),luminateExtend.sessionVars.set("locale",e)),e},n=function(e,t){return(e?luminateExtend.global.path.secure+"S":luminateExtend.global.path.nonsecure)+"PageServer"+(luminateExtend.global.routingId&&""!==luminateExtend.global.routingId?";"+luminateExtend.global.routingId:"")+"?pagename=luminateExtend_server&pgwrap=n"+(t?"&"+t:"")},i=function(t,a){if(t.responseFilter&&t.responseFilter.array&&t.responseFilter.filter&&luminateExtend.utils.stringToObj(t.responseFilter.array,a)){var n,i,l=t.responseFilter.filter.split("==")[0].split("!=")[0].replace(/^\s+|\s+$/g,"");if(-1!==t.responseFilter.filter.indexOf("!=")?(n="nequal",i=t.responseFilter.filter.split("!=")[1]):-1!==t.responseFilter.filter.indexOf("==")&&(n="equal",i=t.responseFilter.filter.split("==")[1]),n&&i){i=i.replace(/^\s+|\s+$/g,"");var o=[],r=!1;if(e.each(luminateExtend.utils.ensureArray(luminateExtend.utils.stringToObj(t.responseFilter.array,a)),function(){"nequal"===n&&this[l]===i||"equal"===n&&this[l]!==i?r=!0:o.push(this)}),r){var s=t.responseFilter.array.split(".");e.each(a,function(t,n){t===s[0]&&e.each(n,function(n,i){n===s[1]&&(2===s.length?a[t][n]=o:e.each(i,function(i,l){i===s[2]&&(3===s.length?a[t][n][i]=o:e.each(l,function(e){e===s[3]&&4===s.length&&(a[t][n][i][e]=o)}))}))})})}}}var u=e.noop;t.callback&&("function"==typeof t.callback?u=t.callback:t.callback.error&&a.errorResponse?u=t.callback.error:t.callback.success&&!a.errorResponse&&(u=t.callback.success));var d=-1!==t.data.indexOf("&method=login")&&-1===t.data.indexOf("&method=loginTest"),p=-1!==t.data.indexOf("&method=logout");if(d||p){var c=function(){u(a)},m={callback:c,useCache:!1,useHTTPS:t.useHTTPS};d&&a.loginResponse&&a.loginResponse.nonce&&(m.nonce="NONCE_TOKEN="+a.loginResponse.nonce),luminateExtend.api.getAuth(m)}else u(a)};window.luminateExtend=function(e){luminateExtend.init(e||{})},luminateExtend.library={version:"1.7.1"},luminateExtend.global={update:function(t,n){t&&(t.length?n&&("locale"===t&&(n=a(n)),luminateExtend.global[t]=n):(t.locale&&(t.locale=a(t.locale)),luminateExtend.global=e.extend(luminateExtend.global,t)))}},luminateExtend.init=function(a){var n=e.extend({apiCommon:{},auth:{type:"auth"},path:{}},a||{});if(n.locale&&(n.locale=t(n.locale)),n.supportsCORS=!1,window.XMLHttpRequest){var i=new XMLHttpRequest;"withCredentials"in i&&(n.supportsCORS=!0)}return luminateExtend.global=e.extend(luminateExtend.global,n),luminateExtend},luminateExtend.api=function(e){luminateExtend.api.request(e||{})},luminateExtend.api.bind=function(t){return t=t||"form.luminateApi",e(t).length>0&&e(t).each(function(){"form"===this.nodeName.toLowerCase()&&e(this).bind("submit",function(t){t.cancelBubble=!0,t.returnValue=!1,t.stopPropagation&&(t.stopPropagation(),t.preventDefault()),e(this).attr("id")||e(this).attr("id","luminateApi-"+(new Date).getTime());var a,n=e(this).attr("action"),i=n.split("?"),l=e(this).data("luminateapi"),o=-1!==i[0].indexOf("/site/")?i[0].split("/site/")[1]:i[0],r=e(this).attr("enctype"),s=i.length>1?i[1]:"",u="#"+e(this).attr("id"),d=!1,p=!1;l&&(l.callback&&(a=luminateExtend.utils.stringToObj(l.callback)),l.requiresAuth&&"true"===l.requiresAuth&&(d=!0),(0===n.indexOf("https:")||"https:"===window.location.protocol&&-1===n.indexOf("http"))&&(p=!0)),luminateExtend.api.request({api:o,callback:a,contentType:r,data:s,form:u,requiresAuth:d,useHTTPS:p})})}),luminateExtend},luminateExtend.api.getAuth=function(t){var a=e.extend({useCache:!0,useHTTPS:!1},t||{});if(luminateExtend.api.getAuthLoad)if(luminateExtend.api.getAuthLoad=!1,a.useCache&&luminateExtend.global.auth.type&&luminateExtend.global.auth.token)luminateExtend.api.getAuthLoad=!0,a.callback&&a.callback();else{var i=function(e){luminateExtend.global.update(e),luminateExtend.api.getAuthLoad=!0,a.callback&&a.callback()};e.ajax(luminateExtend.global.supportsCORS?{url:(a.useHTTPS?luminateExtend.global.path.secure:luminateExtend.global.path.nonsecure)+"CRConsAPI",data:"luminateExtend="+luminateExtend.library.version+(a.nonce&&""!==a.nonce?"&"+a.nonce:"")+"&api_key="+luminateExtend.global.apiKey+"&method=getLoginUrl&response_format=json&v=1.0",xhrFields:{withCredentials:!0},dataType:"json",success:function(e){var t=e.getLoginUrlResponse,a=t.url,n=t.routing_id,l=t.JSESSIONID;n||-1===a.indexOf("CRConsAPI;jsessionid=")||(n=a.split("CRConsAPI;jsessionid=")[1].split("?")[0]),i({auth:{type:"auth",token:t.token},routingId:n?"jsessionid="+n:"",sessionCookie:l?"JSESSIONID="+l:""})}}:{url:n(a.useHTTPS,"action=getAuth&callback=?"),dataType:"jsonp",success:i})}else{var l=function(){luminateExtend.api.getAuth(a)};setTimeout(l,1e3)}},luminateExtend.api.getAuthLoad=!0;var l=function(t){var a=e.extend({contentType:"application/x-www-form-urlencoded",data:"",requiresAuth:!1,useHashTransport:!1,useHTTPS:null},t||{}),l=["addressbook","advocacy","connect","cons","content","datasync","donation","email","group","orgevent","recurring","survey","teamraiser"];if(e.inArray(a.api.toLowerCase(),l)>=0&&(a.api="CR"+a.api.charAt(0).toUpperCase()+a.api.slice(1).toLowerCase()+"API",a.api=a.api.replace("Addressbook","AddressBook").replace("Datasync","DataSync").replace("Orgevent","OrgEvent")),luminateExtend.global.path.nonsecure&&luminateExtend.global.path.secure&&luminateExtend.global.apiKey&&a.api){a.contentType="multipart/form-data"===a.contentType.split(";")[0]?"multipart/form-data":"application/x-www-form-urlencoded",a.contentType+="; charset=UTF-8",a.data="luminateExtend="+luminateExtend.library.version+(""===a.data?"":"&"+a.data),a.form&&e(a.form).length>0&&(a.data+="&"+e(a.form).eq(0).serialize()),-1===a.data.indexOf("&api_key=")&&(a.data+="&api_key="+luminateExtend.global.apiKey),luminateExtend.global.apiCommon.centerId&&-1===a.data.indexOf("¢er_id=")&&(a.data+="¢er_id="+luminateExtend.global.apiCommon.centerId),luminateExtend.global.apiCommon.categoryId&&-1===a.data.indexOf("&list_category_id=")&&(a.data+="&list_category_id="+luminateExtend.global.apiCommon.categoryId),-1!==a.data.indexOf("&response_format=xml")?a.data=a.data.replace(/&response_format=xml/g,"&response_format=json"):-1===a.data.indexOf("&response_format=")&&(a.data+="&response_format=json"),luminateExtend.global.apiCommon.source&&-1===a.data.indexOf("&source=")&&(a.data+="&source="+luminateExtend.global.apiCommon.source),luminateExtend.global.apiCommon.subSource&&-1===a.data.indexOf("&sub_source=")&&(a.data+="&sub_source="+luminateExtend.global.apiCommon.subSource),-1===a.data.indexOf("&suppress_response_codes=")&&(a.data+="&suppress_response_codes=true"),luminateExtend.global.locale&&-1===a.data.indexOf("&s_locale=")&&(a.data+="&s_locale="+luminateExtend.global.locale),-1===a.data.indexOf("&v=")&&(a.data+="&v=1.0");var o="http://",r=luminateExtend.global.path.nonsecure.split("http://")[1];a.useHTTPS="CRDonationAPI"===a.api||"CRTeamraiserAPI"===a.api||"CRConnectAPI"!==a.api&&("https:"===window.location.protocol&&null==a.useHTTPS||1==a.useHTTPS)?!0:!1,a.useHTTPS&&(o="https://",r=luminateExtend.global.path.secure.split("https://")[1]),o+=r+a.api;var s=!1,u=!1,d=!1;a.useHashTransport||(window.location.protocol===o.split("//")[0]&&document.domain===r.split("/")[0]?(s=!0,u=!0):luminateExtend.global.supportsCORS?u=!0:"postMessage"in window&&(d=!0));var p;p=u?function(){luminateExtend.global.routingId&&""!==luminateExtend.global.routingId&&(o+=";"+luminateExtend.global.routingId),a.requiresAuth&&-1===a.data.indexOf("&"+luminateExtend.global.auth.type+"=")&&(a.data+="&"+luminateExtend.global.auth.type+"="+luminateExtend.global.auth.token),luminateExtend.global.sessionCookie&&""!==luminateExtend.global.sessionCookie&&(a.data+="&"+luminateExtend.global.sessionCookie),a.data+="&ts="+(new Date).getTime(),e.ajax({url:o,data:a.data,xhrFields:{withCredentials:!0},contentType:a.contentType,dataType:"json",type:"POST",success:function(e){i(a,e)}})}:d?function(){var t=(new Date).getTime(),l="luminateApiPostMessage"+t,r=n(a.useHTTPS,"action=postMessage");luminateExtend.global.routingId&&""!==luminateExtend.global.routingId&&(o+=";"+luminateExtend.global.routingId),a.requiresAuth&&-1===a.data.indexOf("&"+luminateExtend.global.auth.type+"=")&&(a.data+="&"+luminateExtend.global.auth.type+"="+luminateExtend.global.auth.token),luminateExtend.global.sessionCookie&&""!==luminateExtend.global.sessionCookie&&(a.data+="&"+luminateExtend.global.sessionCookie),a.data+="&ts="+t,luminateExtend.api.request.postMessageEventHandler||(luminateExtend.api.request.postMessageEventHandler={},luminateExtend.api.request.postMessageEventHandler.handler=function(t){if(-1!==luminateExtend.global.path.nonsecure.indexOf(t.origin)||-1!==luminateExtend.global.path.secure.indexOf(t.origin)){var a=e.parseJSON(t.data),n=a.postMessageFrameId,i=e.parseJSON(decodeURIComponent(a.response));luminateExtend.api.request.postMessageEventHandler[n]&&luminateExtend.api.request.postMessageEventHandler[n](n,i)}},"undefined"!=typeof window.addEventListener?window.addEventListener("message",luminateExtend.api.request.postMessageEventHandler.handler,!1):"undefined"!=typeof window.attachEvent&&window.attachEvent("onmessage",luminateExtend.api.request.postMessageEventHandler.handler)),luminateExtend.api.request.postMessageEventHandler[l]=function(t,n){i(a,n),e("#"+t).remove(),delete luminateExtend.api.request.postMessageEventHandler[t]},e("body").append(''),e("#"+l).bind("load",function(){var t='{"postMessageFrameId": "'+e(this).attr("id")+'", "requestUrl": "'+o+'", "requestContentType": "'+a.contentType+'", "requestData": "'+a.data+'"}',n=o.split("/site/")[0].split("/admin/")[0];document.getElementById(e(this).attr("id")).contentWindow.postMessage(t,n)}),e("#"+l).attr("src",r)}:function(){var t=(new Date).getTime(),l="luminateApiHashTransport"+t,r=n(a.useHTTPS,"action=hashTransport"),s=window.location.protocol+"//"+document.domain+"/luminateExtend_client.html";luminateExtend.global.routingId&&""!==luminateExtend.global.routingId&&(o+=";"+luminateExtend.global.routingId),a.requiresAuth&&-1===a.data.indexOf("&"+luminateExtend.global.auth.type+"=")&&(a.data+="&"+luminateExtend.global.auth.type+"="+luminateExtend.global.auth.token),luminateExtend.global.sessionCookie&&""!==luminateExtend.global.sessionCookie&&(a.data+="&"+luminateExtend.global.sessionCookie),a.data+="&ts="+t,r+="#&hashTransportClientUrl="+encodeURIComponent(s)+"&hashTransportFrameId="+l+"&requestUrl="+encodeURIComponent(o)+"&requestContentType="+encodeURIComponent(a.contentType)+"&requestData="+encodeURIComponent(a.data),luminateExtend.api.request.hashTransportEventHandler||(luminateExtend.api.request.hashTransportEventHandler={},luminateExtend.api.request.hashTransportEventHandler.handler=function(e,t){luminateExtend.api.request.hashTransportEventHandler[e]&&luminateExtend.api.request.hashTransportEventHandler[e](e,t)}),luminateExtend.api.request.hashTransportEventHandler[l]=function(t,n){i(a,n),e("#"+t).remove(),delete luminateExtend.api.request.hashTransportEventHandler[t]},e("body").append('')},a.requiresAuth||!u&&!s&&!luminateExtend.global.sessionCookie?luminateExtend.api.getAuth({callback:p,useHTTPS:a.useHTTPS}):p()}};luminateExtend.api.request=function(t){if(e.isArray(t)){t.reverse();var a=[];e.each(t,function(n){var i=e.extend({async:!0},this);if(i.async||n===t.length-1)a.push(i);else{var o=t[n+1];if(o.callback&&"function"!=typeof o.callback){var r=o.callback.success||e.noop;o.callback.success=function(e){r(e),l(i)}}else{var o=t[n+1],s=o.callback||e.noop;o.callback={success:function(e){s(e),l(i)},error:function(e){s(e)}}}}}),a.reverse(),e.each(a,function(){l(this)})}else l(t)},luminateExtend.sessionVars={set:function(e,t,a){var n={};a&&(n.callback=a),e&&(n.data="s_"+e+"="+(t||""),luminateExtend.utils.ping(n))}},luminateExtend.tags=function(e,t){luminateExtend.tags.parse(e,t)},luminateExtend.tags.parse=function(t,a){luminateExtend.widgets?luminateExtend.widgets(t,a):(t=t&&"all"!==t?luminateExtend.utils.ensureArray(t):["cons"],a=a||"body",e.each(t,function(t,n){if("cons"===n){var i=e(a).find(document.getElementsByTagName("luminate:cons"));if(i.length>0){var l=function(t){i.each(function(){t.getConsResponse?e(this).replaceWith(luminateExtend.utils.stringToObj(e(this).attr("field"),t.getConsResponse)):e(this).remove()})};luminateExtend.api.request({api:"cons",callback:l,data:"method=getUser",requiresAuth:!0})}}}))},luminateExtend.utils={ensureArray:function(t){return e.isArray(t)?t:t?[t]:[]},stringToObj:function(e,t){var a=t||window;if(e)for(var n=e.split("."),i=0;i'),e("#"+n).bind("load",function(){e(this).remove(),a.callback&&a.callback()}),e("#"+n).attr("src",("https:"===window.location.protocol?luminateExtend.global.path.secure:luminateExtend.global.path.nonsecure)+"EstablishSession"+(luminateExtend.global.routingId&&""!==luminateExtend.global.routingId?";"+luminateExtend.global.routingId:"")+"?"+(null==a.data?"":a.data+"&")+"NEXTURL="+encodeURIComponent(("https:"===window.location.protocol?luminateExtend.global.path.secure:luminateExtend.global.path.nonsecure)+"PixelServer"))},simpleDateFormat:function(a,n,i){if(i=i||luminateExtend.global.locale,i=t(i),n=n||(e.inArray(i,["en_CA","fr_CA","en_GB","en_AU"])>=0?"d/M/yy":"M/d/yy"),a=a||new Date,!(a instanceof Date)){var l=a.split("T")[0].split("-"),o=a.split("T").length>1?a.split("T")[1].split(".")[0].split("Z")[0].split("-")[0].split(":"):["00","00","00"];a=new Date(l[0],l[1]-1,l[2],o[0],o[1],o[2])}var r=function(e){return e=""+e,0===e.indexOf("0")&&"0"!==e?e.substring(1):e},s=function(e){return e=Number(e),isNaN(e)?"00":(10>e?"0":"")+e},u={month:s(a.getMonth()+1),date:s(a.getDate()),year:s(a.getFullYear()),day:a.getDay(),hour24:a.getHours(),hour12:a.getHours(),minutes:s(a.getMinutes()),ampm:"AM"};u.hour24>11&&(u.ampm="PM"),u.hour24=s(u.hour24),0===u.hour12&&(u.hour12=12),u.hour12>12&&(u.hour12=u.hour12-12),u.hour12=s(u.hour12);var d,p=function(e){var t=e.replace(/yy+(?=y)/g,"yy").replace(/MMM+(?=M)/g,"MMM").replace(/d+(?=d)/g,"d").replace(/EEE+(?=E)/g,"EEE").replace(/a+(?=a)/g,"").replace(/k+(?=k)/g,"k").replace(/h+(?=h)/g,"h").replace(/m+(?=m)/g,"m"),a=t.replace(/yyy/g,u.year).replace(/yy/g,u.year.substring(2)).replace(/y/g,u.year).replace(/dd/g,u.date).replace(/d/g,r(u.date)),n=function(e,t,a){for(var n=1;n23&&(i=23);var l="+"===a?i:0-i;"kk"===t||"k"===t?(l=Number(u.hour24)+l,l>24?l-=24:0>l&&(l+=24)):(l=Number(u.hour12)+l,l>24?l-=24:0>l&&(l+=24),l>12&&(l-=12)),l=""+l,("kk"===t||"hh"===t)&&(l=s(l)),("h"===t&&0===l||"hh"===t&&"00"===l)&&(l="12"),e[n]=l+e[n]}return e.join("")};-1!==a.indexOf("k+")&&(a=n(a.split("kk+"),"kk","+"),a=n(a.split("k+"),"k","+")),-1!==a.indexOf("k-")&&(a=n(a.split("kk-"),"kk","-"),a=n(a.split("k-"),"k","-")),a=a.replace(/kk/g,u.hour24).replace(/k/g,r(u.hour24)),-1!==a.indexOf("h+")&&(a=n(a.split("hh+"),"hh","+"),a=n(a.split("h+"),"h","+")),-1!==a.indexOf("h-")&&(a=n(a.split("hh-"),"hh","-"),a=n(a.split("h-"),"h","-")),a=a.replace(/hh/g,u.hour12<12&&u.hour12.indexOf&&0!==u.hour12.indexOf("0")?"0"+u.hour12:u.hour12).replace(/h/g,r(u.hour12)),a=a.replace(/mm/g,u.minutes).replace(/m/g,r(u.minutes)),a=a.replace(/a/g,"A");var l=["January","February","march","april","may","June","July","august","September","October","November","December"];"es_US"===i&&(l=["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"]),"fr_CA"===i&&(l=["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"]),a=a.replace(/MMMM/g,l[Number(u.month)-1]).replace(/MMM/g,l[Number(u.month)-1].substring(0,3)).replace(/MM/g,u.month).replace(/M/g,r(u.month)).replace(/march/g,"March").replace(/may/g,"May").replace(/Mayo/g,"mayo");var o=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];return"es_US"===i&&(o=["domingo","lunes","martes","miércoles","jueves","viernes","sábado"]),"fr_CA"===i&&(o=["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"]),a=a.replace(/EEEE/g,o[u.day]).replace(/EEE/g,o[u.day].substring(0,3)).replace(/EE/g,o[u.day].substring(0,3)).replace(/E/g,o[u.day].substring(0,3)),a=a.replace(/A/g,u.ampm).replace(/april/g,"April").replace(/august/g,"August")};if(-1!==n.indexOf("'")){var c=n.replace(/\'+(?=\')/g,"''").split("''");if(1===c.length){c=n.split("'");for(var m=0;m