if(typeof YAHOO=="undefined"||!YAHOO){var YAHOO={}}YAHOO.namespace=function(){var F=arguments,G=null,I,J,H;for(I=0;I<F.length;I=I+1){H=F[I].split(".");G=YAHOO;for(J=(H[0]=="YAHOO")?1:0;J<H.length;J=J+1){G[H[J]]=G[H[J]]||{};G=G[H[J]]}}return G};YAHOO.log=function(F,E,G){var H=YAHOO.widget.Logger;if(H&&H.log){return H.log(F,E,G)}else{return false}};YAHOO.register=function(M,R,J){var N=YAHOO.env.modules;if(!N[M]){N[M]={versions:[],builds:[]}}var L=N[M],O=J.version,P=J.build,Q=YAHOO.env.listeners;L.name=M;L.version=O;L.build=P;L.versions.push(O);L.builds.push(P);L.mainClass=R;for(var K=0;K<Q.length;K=K+1){Q[K](L)}if(R){R.VERSION=O;R.BUILD=P}else{YAHOO.log("mainClass is undefined for module "+M,"warn")}};YAHOO.env=YAHOO.env||{modules:[],listeners:[]};YAHOO.env.getVersion=function(B){return YAHOO.env.modules[B]||null};YAHOO.env.ua=function(){var E={ie:0,opera:0,gecko:0,webkit:0,mobile:null,air:0};var F=navigator.userAgent,D;if((/KHTML/).test(F)){E.webkit=1}D=F.match(/AppleWebKit\/([^\s]*)/);if(D&&D[1]){E.webkit=parseFloat(D[1]);if(/ Mobile\//.test(F)){E.mobile="Apple"}else{D=F.match(/NokiaN[^\/]*/);if(D){E.mobile=D[0]}}D=F.match(/AdobeAIR\/([^\s]*)/);if(D){E.air=D[0]}}if(!E.webkit){D=F.match(/Opera[\s\/]([^\s]*)/);if(D&&D[1]){E.opera=parseFloat(D[1]);D=F.match(/Opera Mini[^;]*/);if(D){E.mobile=D[0]}}else{D=F.match(/MSIE\s([^;]*)/);if(D&&D[1]){E.ie=parseFloat(D[1])}else{D=F.match(/Gecko\/([^\s]*)/);if(D){E.gecko=1;D=F.match(/rv:([^\s\)]*)/);if(D&&D[1]){E.gecko=parseFloat(D[1])}}}}}return E}();(function(){YAHOO.namespace("util","widget","example");if("undefined"!==typeof YAHOO_config){var H=YAHOO_config.listener,E=YAHOO.env.listeners,F=true,G;if(H){for(G=0;G<E.length;G=G+1){if(E[G]==H){F=false;break}}if(F){E.push(H)}}}})();YAHOO.lang=YAHOO.lang||{isArray:function(D){if(D){var C=YAHOO.lang;return C.isNumber(D.length)&&C.isFunction(D.splice)}return false},isBoolean:function(B){return typeof B==="boolean"},isFunction:function(B){return typeof B==="function"},isNull:function(B){return B===null},isNumber:function(B){return typeof B==="number"&&isFinite(B)},isObject:function(B){return(B&&(typeof B==="object"||YAHOO.lang.isFunction(B)))||false},isString:function(B){return typeof B==="string"},isUndefined:function(B){return typeof B==="undefined"},hasOwnProperty:function(C,D){if(Object.prototype.hasOwnProperty){return C.hasOwnProperty(D)}return !YAHOO.lang.isUndefined(C[D])&&C.constructor.prototype[D]!==C[D]},_IEEnumFix:function(K,L){if(YAHOO.env.ua.ie){var I=["toString","valueOf"],G;for(G=0;G<I.length;G=G+1){var H=I[G],J=L[H];if(YAHOO.lang.isFunction(J)&&J!=Object.prototype[H]){K[H]=J}}}},extend:function(H,G,I){if(!G||!H){throw new Error("YAHOO.lang.extend failed, please check that all dependencies are included.")}var J=function(){};J.prototype=G.prototype;H.prototype=new J();H.prototype.constructor=H;H.superclass=G.prototype;if(G.prototype.constructor==Object.prototype.constructor){G.prototype.constructor=G}if(I){for(var F in I){H.prototype[F]=I[F]}YAHOO.lang._IEEnumFix(H.prototype,I)}},augmentObject:function(I,J){if(!J||!I){throw new Error("Absorb failed, verify dependencies.")}var G=arguments,K,H,L=G[2];if(L&&L!==true){for(K=2;K<G.length;K=K+1){I[G[K]]=J[G[K]]}}else{for(H in J){if(L||!I[H]){I[H]=J[H]}}YAHOO.lang._IEEnumFix(I,J)}},augmentProto:function(F,G){if(!G||!F){throw new Error("Augment failed, verify dependencies.")}var E=[F.prototype,G.prototype];for(var H=2;H<arguments.length;H=H+1){E.push(arguments[H])}YAHOO.lang.augmentObject.apply(this,E)},dump:function(N,R){var L=YAHOO.lang,K,S,P=[],O="{...}",M="f(){...}",Q=", ",T=" => ";if(!L.isObject(N)){return N+""}else{if(N instanceof Date||("nodeType" in N&&"tagName" in N)){return N}else{if(L.isFunction(N)){return M}}}R=(L.isNumber(R))?R:3;if(L.isArray(N)){P.push("[");for(K=0,S=N.length;K<S;K=K+1){if(L.isObject(N[K])){P.push((R>0)?L.dump(N[K],R-1):O)}else{P.push(N[K])}P.push(Q)}if(P.length>1){P.pop()}P.push("]")}else{P.push("{");for(K in N){if(L.hasOwnProperty(N,K)){P.push(K+T);if(L.isObject(N[K])){P.push((R>0)?L.dump(N[K],R-1):O)}else{P.push(N[K])}P.push(Q)}}if(P.length>1){P.pop()}P.push("}")}return P.join("")},substitute:function(V,T,d){var g,h,l,Z,Y,W,R=YAHOO.lang,b=[],S,f="dump",c=" ",U="{",X="}";for(;;){g=V.lastIndexOf(U);if(g<0){break}h=V.indexOf(X,g);if(g+1>=h){break}S=V.substring(g+1,h);Z=S;W=null;l=Z.indexOf(c);if(l>-1){W=Z.substring(l+1);Z=Z.substring(0,l)}Y=T[Z];if(d){Y=d(Z,Y,W)}if(R.isObject(Y)){if(R.isArray(Y)){Y=R.dump(Y,parseInt(W,10))}else{W=W||"";var e=W.indexOf(f);if(e>-1){W=W.substring(4)}if(Y.toString===Object.prototype.toString||e>-1){Y=R.dump(Y,parseInt(W,10))}else{Y=Y.toString()}}}else{if(!R.isString(Y)&&!R.isNumber(Y)){Y="~-"+b.length+"-~";b[b.length]=S}}V=V.substring(0,g)+Y+V.substring(h+1)}for(g=b.length-1;g>=0;g=g-1){V=V.replace(new RegExp("~-"+g+"-~"),"{"+b[g]+"}","g")}return V},trim:function(C){try{return C.replace(/^\s+|\s+$/g,"")}catch(D){return C}},merge:function(){var F={},H=arguments;for(var G=0,E=H.length;G<E;G=G+1){YAHOO.lang.augmentObject(F,H[G],true)}return F},later:function(O,L,N,J,R){O=O||0;L=L||{};var K=N,P=J,Q,M;if(YAHOO.lang.isString(N)){K=L[N]}if(!K){throw new TypeError("method undefined")}if(!YAHOO.lang.isArray(P)){P=[J]}Q=function(){K.apply(L,P)};M=(R)?setInterval(Q,O):setTimeout(Q,O);return{interval:R,cancel:function(){if(this.interval){clearInterval(M)}else{clearTimeout(M)}}}},isValue:function(D){var C=YAHOO.lang;return(C.isObject(D)||C.isString(D)||C.isNumber(D)||C.isBoolean(D))}};YAHOO.util.Lang=YAHOO.lang;YAHOO.lang.augment=YAHOO.lang.augmentProto;YAHOO.augment=YAHOO.lang.augmentProto;YAHOO.extend=YAHOO.lang.extend;YAHOO.register("yahoo",YAHOO,{version:"2.5.1",build:"984"});YAHOO.util.CustomEvent=function(H,J,I,F){this.type=H;this.scope=J||window;this.silent=I;this.signature=F||YAHOO.util.CustomEvent.LIST;this.subscribers=[];if(!this.silent){}var G="_YUICEOnSubscribe";if(H!==G){this.subscribeEvent=new YAHOO.util.CustomEvent(G,this,true)}this.lastError=null};YAHOO.util.CustomEvent.LIST=0;YAHOO.util.CustomEvent.FLAT=1;YAHOO.util.CustomEvent.prototype={subscribe:function(F,E,D){if(!F){throw new Error("Invalid callback for subscriber to '"+this.type+"'")}if(this.subscribeEvent){this.subscribeEvent.fire(F,E,D)}this.subscribers.push(new YAHOO.util.Subscriber(F,E,D))},unsubscribe:function(J,H){if(!J){return this.unsubscribeAll()}var I=false;for(var L=0,G=this.subscribers.length;L<G;++L){var K=this.subscribers[L];if(K&&K.contains(J,H)){this._delete(L);I=true}}return I},fire:function(){var L=this.subscribers.length;if(!L&&this.silent){return true}var S=[].slice.call(arguments,0),U=true,M,R=false;if(!this.silent){}var N=this.subscribers.slice();for(M=0;M<L;++M){var P=N[M];if(!P){R=true}else{if(!this.silent){}var Q=P.getScope(this.scope);if(this.signature==YAHOO.util.CustomEvent.FLAT){var O=null;if(S.length>0){O=S[0]}try{U=P.fn.call(Q,O,P.obj)}catch(V){this.lastError=V}}else{try{U=P.fn.call(Q,this.type,S,P.obj)}catch(T){this.lastError=T}}if(false===U){if(!this.silent){}return false}}}return true},unsubscribeAll:function(){for(var B=this.subscribers.length-1;B>-1;B--){this._delete(B)}this.subscribers=[];return B},_delete:function(C){var D=this.subscribers[C];if(D){delete D.fn;delete D.obj}this.subscribers.splice(C,1)},toString:function(){return"CustomEvent: '"+this.type+"', scope: "+this.scope}};YAHOO.util.Subscriber=function(F,E,D){this.fn=F;this.obj=YAHOO.lang.isUndefined(E)?null:E;this.override=D};YAHOO.util.Subscriber.prototype.getScope=function(B){if(this.override){if(this.override===true){return this.obj}else{return this.override}}return B};YAHOO.util.Subscriber.prototype.contains=function(C,D){if(D){return(this.fn==C&&this.obj==D)}else{return(this.fn==C)}};YAHOO.util.Subscriber.prototype.toString=function(){return"Subscriber { obj: "+this.obj+", override: "+(this.override||"no")+" }"};if(!YAHOO.util.Event){YAHOO.util.Event=function(){var Q=false;var P=[];var O=[];var R=[];var T=[];var L=0;var S=[];var M=[];var N=0;var K={63232:38,63233:40,63234:37,63235:39,63276:33,63277:34,25:9};return{POLL_RETRYS:2000,POLL_INTERVAL:20,EL:0,TYPE:1,FN:2,WFN:3,UNLOAD_OBJ:3,ADJ_SCOPE:4,OBJ:5,OVERRIDE:6,lastError:null,isSafari:YAHOO.env.ua.webkit,webkit:YAHOO.env.ua.webkit,isIE:YAHOO.env.ua.ie,_interval:null,_dri:null,DOMReady:false,startInterval:function(){if(!this._interval){var B=this;var A=function(){B._tryPreloadAttach()};this._interval=setInterval(A,this.POLL_INTERVAL)}},onAvailable:function(D,G,C,E,F){var B=(YAHOO.lang.isString(D))?[D]:D;for(var A=0;A<B.length;A=A+1){S.push({id:B[A],fn:G,obj:C,override:E,checkReady:F})}L=this.POLL_RETRYS;this.startInterval()},onContentReady:function(D,B,C,A){this.onAvailable(D,B,C,A,true)},onDOMReady:function(B,C,A){if(this.DOMReady){setTimeout(function(){var D=window;if(A){if(A===true){D=C}else{D=A}}B.call(D,"DOMReady",[],C)},0)}else{this.DOMReadyEvent.subscribe(B,C,A)}},addListener:function(c,e,D,I,d){if(!D||!D.call){return false}if(this._isValidCollection(c)){var C=true;for(var H=0,F=c.length;H<F;++H){C=this.on(c[H],e,D,I,d)&&C}return C}else{if(YAHOO.lang.isString(c)){var J=this.getEl(c);if(J){c=J}else{this.onAvailable(c,function(){YAHOO.util.Event.on(c,e,D,I,d)});return true}}}if(!c){return false}if("unload"==e&&I!==this){O[O.length]=[c,e,D,I,d];return true}var A=c;if(d){if(d===true){A=I}else{A=d}}var b=function(U){return D.call(A,YAHOO.util.Event.getEvent(U,c),I)};var B=[c,e,D,b,A,I,d];var G=P.length;P[G]=B;if(this.useLegacyEvent(c,e)){var Z=this.getLegacyIndex(c,e);if(Z==-1||c!=R[Z][0]){Z=R.length;M[c.id+e]=Z;R[Z]=[c,e,c["on"+e]];T[Z]=[];c["on"+e]=function(U){YAHOO.util.Event.fireLegacyEvent(YAHOO.util.Event.getEvent(U),Z)}}T[Z].push(B)}else{try{this._simpleAdd(c,e,b,false)}catch(E){this.lastError=E;this.removeListener(c,e,D);return false}}return true},fireLegacyEvent:function(F,H){var D=true,J,B,C,A,E;B=T[H].slice();for(var I=0,G=B.length;I<G;++I){C=B[I];if(C&&C[this.WFN]){A=C[this.ADJ_SCOPE];E=C[this.WFN].call(A,F);D=(D&&E)}}J=R[H];if(J&&J[2]){J[2](F)}return D},getLegacyIndex:function(A,C){var B=this.generateId(A)+C;if(typeof M[B]=="undefined"){return -1}else{return M[B]}},useLegacyEvent:function(A,C){if(this.webkit&&("click"==C||"dblclick"==C)){var B=parseInt(this.webkit,10);if(!isNaN(B)&&B<418){return true}}return false},removeListener:function(W,X,C){var H,E,A;if(typeof W=="string"){W=this.getEl(W)}else{if(this._isValidCollection(W)){var B=true;for(H=W.length-1;H>-1;H--){B=(this.removeListener(W[H],X,C)&&B)}return B}}if(!C||!C.call){return this.purgeElement(W,false,X)}if("unload"==X){for(H=O.length-1;H>-1;H--){A=O[H];if(A&&A[0]==W&&A[1]==X&&A[2]==C){O.splice(H,1);return true}}return false}var G=null;var F=arguments[3];if("undefined"===typeof F){F=this._getCacheIndex(W,X,C)}if(F>=0){G=P[F]}if(!W||!G){return false}if(this.useLegacyEvent(W,X)){var I=this.getLegacyIndex(W,X);var J=T[I];if(J){for(H=0,E=J.length;H<E;++H){A=J[H];if(A&&A[this.EL]==W&&A[this.TYPE]==X&&A[this.FN]==C){J.splice(H,1);break}}}}else{try{this._simpleRemove(W,X,G[this.WFN],false)}catch(D){this.lastError=D;return false}}delete P[F][this.WFN];delete P[F][this.FN];P.splice(F,1);return true},getTarget:function(C,A){var B=C.target||C.srcElement;return this.resolveTextNode(B)},resolveTextNode:function(A){try{if(A&&3==A.nodeType){return A.parentNode}}catch(B){}return A},getPageX:function(A){var B=A.pageX;if(!B&&0!==B){B=A.clientX||0;if(this.isIE){B+=this._getScrollLeft()}}return B},getPageY:function(B){var A=B.pageY;if(!A&&0!==A){A=B.clientY||0;if(this.isIE){A+=this._getScrollTop()}}return A},getXY:function(A){return[this.getPageX(A),this.getPageY(A)]},getRelatedTarget:function(A){var B=A.relatedTarget;if(!B){if(A.type=="mouseout"){B=A.toElement}else{if(A.type=="mouseover"){B=A.fromElement}}}return this.resolveTextNode(B)},getTime:function(C){if(!C.time){var A=new Date().getTime();try{C.time=A}catch(B){this.lastError=B;return A}}return C.time},stopEvent:function(A){this.stopPropagation(A);this.preventDefault(A)},stopPropagation:function(A){if(A.stopPropagation){A.stopPropagation()}else{A.cancelBubble=true}},preventDefault:function(A){if(A.preventDefault){A.preventDefault()}else{A.returnValue=false}},getEvent:function(D,B){var A=D||window.event;if(!A){var C=this.getEvent.caller;while(C){A=C.arguments[0];if(A&&Event==A.constructor){break}C=C.caller}}return A},getCharCode:function(A){var B=A.keyCode||A.charCode||0;if(YAHOO.env.ua.webkit&&(B in K)){B=K[B]}return B},_getCacheIndex:function(D,C,E){for(var F=0,A=P.length;F<A;F=F+1){var B=P[F];if(B&&B[this.FN]==E&&B[this.EL]==D&&B[this.TYPE]==C){return F}}return -1},generateId:function(B){var A=B.id;if(!A){A="yuievtautoid-"+N;++N;B.id=A}return A},_isValidCollection:function(A){try{return(A&&typeof A!=="string"&&A.length&&!A.tagName&&!A.alert&&typeof A[0]!=="undefined")}catch(B){return false}},elCache:{},getEl:function(A){return(typeof A==="string")?document.getElementById(A):A},clearCache:function(){},DOMReadyEvent:new YAHOO.util.CustomEvent("DOMReady",this),_load:function(A){if(!Q){Q=true;var B=YAHOO.util.Event;B._ready();B._tryPreloadAttach()}},_ready:function(A){var B=YAHOO.util.Event;if(!B.DOMReady){B.DOMReady=true;B.DOMReadyEvent.fire();B._simpleRemove(document,"DOMContentLoaded",B._ready)}},_tryPreloadAttach:function(){if(S.length===0){L=0;clearInterval(this._interval);this._interval=null;return }if(this.locked){return }if(this.isIE){if(!this.DOMReady){this.startInterval();return }}this.locked=true;var D=!Q;if(!D){D=(L>0&&S.length>0)}var E=[];var C=function(J,I){var V=J;if(I.override){if(I.override===true){V=I.obj}else{V=I.override}}I.fn.call(V,I.obj)};var A,B,F,G,H=[];for(A=0,B=S.length;A<B;A=A+1){F=S[A];if(F){G=this.getEl(F.id);if(G){if(F.checkReady){if(Q||G.nextSibling||!D){H.push(F);S[A]=null}}else{C(G,F);S[A]=null}}else{E.push(F)}}}for(A=0,B=H.length;A<B;A=A+1){F=H[A];C(this.getEl(F.id),F)}L--;if(D){for(A=S.length-1;A>-1;A--){F=S[A];if(!F||!F.id){S.splice(A,1)}}this.startInterval()}else{clearInterval(this._interval);this._interval=null}this.locked=false},purgeElement:function(F,E,C){var H=(YAHOO.lang.isString(F))?this.getEl(F):F;var D=this.getListeners(H,C),G,B;if(D){for(G=D.length-1;G>-1;G--){var A=D[G];this.removeListener(H,A.type,A.fn)}}if(E&&H&&H.childNodes){for(G=0,B=H.childNodes.length;G<B;++G){this.purgeElement(H.childNodes[G],E,C)}}},getListeners:function(H,J){var E=[],I;if(!J){I=[P,O]}else{if(J==="unload"){I=[O]}else{I=[P]}}var C=(YAHOO.lang.isString(H))?this.getEl(H):H;for(var F=0;F<I.length;F=F+1){var A=I[F];if(A){for(var D=0,B=A.length;D<B;++D){var G=A[D];if(G&&G[this.EL]===C&&(!J||J===G[this.TYPE])){E.push({type:G[this.TYPE],fn:G[this.FN],obj:G[this.OBJ],adjust:G[this.OVERRIDE],scope:G[this.ADJ_SCOPE],index:D})}}}}return(E.length)?E:null},_unload:function(C){var I=YAHOO.util.Event,F,G,H,D,E,B=O.slice();for(F=0,D=O.length;F<D;++F){H=B[F];if(H){var A=window;if(H[I.ADJ_SCOPE]){if(H[I.ADJ_SCOPE]===true){A=H[I.UNLOAD_OBJ]}else{A=H[I.ADJ_SCOPE]}}H[I.FN].call(A,I.getEvent(C,H[I.EL]),H[I.UNLOAD_OBJ]);B[F]=null;H=null;A=null}}O=null;if(P){for(G=P.length-1;G>-1;G--){H=P[G];if(H){I.removeListener(H[I.EL],H[I.TYPE],H[I.FN],G)}}H=null}R=null;I._simpleRemove(window,"unload",I._unload)},_getScrollLeft:function(){return this._getScroll()[1]},_getScrollTop:function(){return this._getScroll()[0]},_getScroll:function(){var B=document.documentElement,A=document.body;if(B&&(B.scrollTop||B.scrollLeft)){return[B.scrollTop,B.scrollLeft]}else{if(A){return[A.scrollTop,A.scrollLeft]}else{return[0,0]}}},regCE:function(){},_simpleAdd:function(){if(window.addEventListener){return function(D,C,A,B){D.addEventListener(C,A,(B))}}else{if(window.attachEvent){return function(D,C,A,B){D.attachEvent("on"+C,A)}}else{return function(){}}}}(),_simpleRemove:function(){if(window.removeEventListener){return function(D,C,A,B){D.removeEventListener(C,A,(B))}}else{if(window.detachEvent){return function(A,C,B){A.detachEvent("on"+C,B)}}else{return function(){}}}}()}}();(function(){var A=YAHOO.util.Event;A.on=A.addListener;if(A.isIE){YAHOO.util.Event.onDOMReady(YAHOO.util.Event._tryPreloadAttach,YAHOO.util.Event,true);var B=document.createElement("p");A._dri=setInterval(function(){try{B.doScroll("left");clearInterval(A._dri);A._dri=null;A._ready();B=null}catch(C){}},A.POLL_INTERVAL)}else{if(A.webkit&&A.webkit<525){A._dri=setInterval(function(){var C=document.readyState;if("loaded"==C||"complete"==C){clearInterval(A._dri);A._dri=null;A._ready()}},A.POLL_INTERVAL)}else{A._simpleAdd(document,"DOMContentLoaded",A._ready)}}A._simpleAdd(window,"load",A._load);A._simpleAdd(window,"unload",A._unload);A._tryPreloadAttach()})()}YAHOO.util.EventProvider=function(){};YAHOO.util.EventProvider.prototype={__yui_events:null,__yui_subscribers:null,subscribe:function(G,K,H,I){this.__yui_events=this.__yui_events||{};var J=this.__yui_events[G];if(J){J.subscribe(K,H,I)}else{this.__yui_subscribers=this.__yui_subscribers||{};var L=this.__yui_subscribers;if(!L[G]){L[G]=[]}L[G].push({fn:K,obj:H,override:I})}},unsubscribe:function(M,K,I){this.__yui_events=this.__yui_events||{};var H=this.__yui_events;if(M){var J=H[M];if(J){return J.unsubscribe(K,I)}}else{var N=true;for(var L in H){if(YAHOO.lang.hasOwnProperty(H,L)){N=N&&H[L].unsubscribe(K,I)}}return N}return false},unsubscribeAll:function(B){return this.unsubscribe(B)},createEvent:function(P,J){this.__yui_events=this.__yui_events||{};var M=J||{};var N=this.__yui_events;if(N[P]){}else{var O=M.scope||this;var R=(M.silent);var L=new YAHOO.util.CustomEvent(P,O,R,YAHOO.util.CustomEvent.FLAT);N[P]=L;if(M.onSubscribeCallback){L.subscribeEvent.subscribe(M.onSubscribeCallback)}this.__yui_subscribers=this.__yui_subscribers||{};var Q=this.__yui_subscribers[P];if(Q){for(var K=0;K<Q.length;++K){L.subscribe(Q[K].fn,Q[K].obj,Q[K].override)}}}return N[P]},fireEvent:function(K,L,H,M){this.__yui_events=this.__yui_events||{};var I=this.__yui_events[K];if(!I){return null}var N=[];for(var J=1;J<arguments.length;++J){N.push(arguments[J])}return I.fire.apply(I,N)},hasEvent:function(B){if(this.__yui_events){if(this.__yui_events[B]){return true}}return false}};YAHOO.util.KeyListener=function(G,H,L,K){if(!G){}else{if(!H){}else{if(!L){}}}if(!K){K=YAHOO.util.KeyListener.KEYDOWN}var J=new YAHOO.util.CustomEvent("keyPressed");this.enabledEvent=new YAHOO.util.CustomEvent("enabled");this.disabledEvent=new YAHOO.util.CustomEvent("disabled");if(typeof G=="string"){G=document.getElementById(G)}if(typeof L=="function"){J.subscribe(L)}else{J.subscribe(L.fn,L.scope,L.correctScope)}function I(A,B){if(!H.shift){H.shift=false}if(!H.alt){H.alt=false}if(!H.ctrl){H.ctrl=false}if(A.shiftKey==H.shift&&A.altKey==H.alt&&A.ctrlKey==H.ctrl){var D;if(H.keys instanceof Array){for(var C=0;C<H.keys.length;C++){D=H.keys[C];if(D==A.charCode){J.fire(A.charCode,A);break}else{if(D==A.keyCode){J.fire(A.keyCode,A);break}}}}else{D=H.keys;if(D==A.charCode){J.fire(A.charCode,A)}else{if(D==A.keyCode){J.fire(A.keyCode,A)}}}}}this.enable=function(){if(!this.enabled){YAHOO.util.Event.addListener(G,K,I);this.enabledEvent.fire(H)}this.enabled=true};this.disable=function(){if(this.enabled){YAHOO.util.Event.removeListener(G,K,I);this.disabledEvent.fire(H)}this.enabled=false};this.toString=function(){return"KeyListener ["+H.keys+"] "+G.tagName+(G.id?"["+G.id+"]":"")}};YAHOO.util.KeyListener.KEYDOWN="keydown";YAHOO.util.KeyListener.KEYUP="keyup";YAHOO.util.KeyListener.KEY={ALT:18,BACK_SPACE:8,CAPS_LOCK:20,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,META:224,NUM_LOCK:144,PAGE_DOWN:34,PAGE_UP:33,PAUSE:19,PRINTSCREEN:44,RIGHT:39,SCROLL_LOCK:145,SHIFT:16,SPACE:32,TAB:9,UP:38};YAHOO.register("event",YAHOO.util.Event,{version:"2.5.1",build:"984"});YAHOO.util.History=(function(){var M=null;var P=null;var U=false;var L=[];var N=[];function R(){var B,A;A=top.location.href;B=A.indexOf("#");return B>=0?A.substr(B+1):null}function O(){var D,C,B=[],A=[];for(D in L){if(YAHOO.lang.hasOwnProperty(L,D)){C=L[D];B.push(D+"="+C.initialState);A.push(D+"="+C.currentState)}}P.value=B.join("&")+"|"+A.join("&");if(YAHOO.env.ua.webkit){P.value+="|"+N.join(",")}}function S(I){var D,C,H,F,E,A,B,G;if(!I){for(H in L){if(YAHOO.lang.hasOwnProperty(L,H)){F=L[H];F.currentState=F.initialState;F.onStateChange(unescape(F.currentState))}}return }E=[];A=I.split("&");for(D=0,C=A.length;D<C;D++){B=A[D].split("=");if(B.length===2){H=B[0];G=B[1];E[H]=G}}for(H in L){if(YAHOO.lang.hasOwnProperty(L,H)){F=L[H];G=E[H];if(!G||F.currentState!==G){F.currentState=G||F.initialState;F.onStateChange(unescape(F.currentState))}}}}function Q(B){var A,C;A='<html><body><div id="state">'+B+"</div></body></html>";try{C=M.contentWindow.document;C.open();C.write(A);C.close();return true}catch(D){return false}}function T(){var B,A,C,D;if(!M.contentWindow||!M.contentWindow.document){setTimeout(T,10);return }B=M.contentWindow.document;A=B.getElementById("state");C=A?A.innerText:null;D=R();setInterval(function(){var E,I,H,G,F,J;B=M.contentWindow.document;A=B.getElementById("state");E=A?A.innerText:null;F=R();if(E!==C){C=E;S(C);if(!C){I=[];for(H in L){if(YAHOO.lang.hasOwnProperty(L,H)){G=L[H];I.push(H+"="+G.initialState)}}F=I.join("&")}else{F=C}top.location.hash=F;D=F;O()}else{if(F!==D){D=F;Q(F)}}},50);U=true;YAHOO.util.History.onLoadEvent.fire()}function V(){var E,C,G,A,K,I,B,H,D,J,X,F;G=P.value.split("|");if(G.length>1){B=G[0].split("&");for(E=0,C=B.length;E<C;E++){A=B[E].split("=");if(A.length===2){K=A[0];H=A[1];I=L[K];if(I){I.initialState=H}}}D=G[1].split("&");for(E=0,C=D.length;E<C;E++){A=D[E].split("=");if(A.length>=2){K=A[0];J=A[1];I=L[K];if(I){I.currentState=J}}}}if(G.length>2){N=G[2].split(",")}if(YAHOO.env.ua.ie){T()}else{X=history.length;F=R();setInterval(function(){var W,c,b;c=R();b=history.length;if(c!==F){F=c;X=b;S(F);O()}else{if(b!==X&&YAHOO.env.ua.webkit){F=c;X=b;W=N[X-1];S(W);O()}}},50);U=true;YAHOO.util.History.onLoadEvent.fire()}}return{onLoadEvent:new YAHOO.util.CustomEvent("onLoad"),onReady:function(C,B,A){if(U){setTimeout(function(){var D=window;if(A){if(A===true){D=B}else{D=A}}C.call(D,"onLoad",[],B)},0)}else{YAHOO.util.History.onLoadEvent.subscribe(C,B,A)}},register:function(E,A,C,B,F){var D,G;if(typeof E!=="string"||YAHOO.lang.trim(E)===""||typeof A!=="string"||typeof C!=="function"){throw new Error("Missing or invalid argument")}if(L[E]){return }if(U){throw new Error("All modules must be registered before calling YAHOO.util.History.initialize")}E=escape(E);A=escape(A);D=null;if(F===true){D=B}else{D=F}G=function(H){return C.call(D,H,B)};L[E]={name:E,initialState:A,currentState:A,onStateChange:G}},initialize:function(A,B){if(U){return }if(YAHOO.env.ua.opera){}if(typeof A==="string"){A=document.getElementById(A)}if(!A||A.tagName.toUpperCase()!=="TEXTAREA"&&(A.tagName.toUpperCase()!=="INPUT"||A.type!=="hidden"&&A.type!=="text")){throw new Error("Missing or invalid argument")}P=A;if(YAHOO.env.ua.ie){if(typeof B==="string"){B=document.getElementById(B)}if(!B||B.tagName.toUpperCase()!=="IFRAME"){throw new Error("Missing or invalid argument")}M=B}YAHOO.util.Event.onDOMReady(V)},navigate:function(C,B){var A;if(typeof C!=="string"||typeof B!=="string"){throw new Error("Missing or invalid argument")}A={};A[C]=B;return YAHOO.util.History.multiNavigate(A)},multiNavigate:function(F){var A,E,C,D,B;if(typeof F!=="object"){throw new Error("Missing or invalid argument")}if(!U){throw new Error("The Browser History Manager is not initialized")}for(E in F){if(!L[E]){throw new Error("The following module has not been registered: "+E)}}A=[];for(E in L){if(YAHOO.lang.hasOwnProperty(L,E)){C=L[E];if(YAHOO.lang.hasOwnProperty(F,E)){D=F[unescape(E)]}else{D=unescape(C.currentState)}E=escape(E);D=escape(D);A.push(E+"="+D)}}B=A.join("&");if(YAHOO.env.ua.ie){return Q(B)}else{top.location.hash=B;if(YAHOO.env.ua.webkit){N[history.length]=B;O()}return true}},getCurrentState:function(A){var B;if(typeof A!=="string"){throw new Error("Missing or invalid argument")}if(!U){throw new Error("The Browser History Manager is not initialized")}B=L[A];if(!B){throw new Error("No such registered module: "+A)}return unescape(B.currentState)},getBookmarkedState:function(D){var E,H,A,B,G,C,F;if(typeof D!=="string"){throw new Error("Missing or invalid argument")}A=top.location.href.indexOf("#");B=A>=0?top.location.href.substr(A+1):top.location.href;G=B.split("&");for(E=0,H=G.length;E<H;E++){C=G[E].split("=");if(C.length===2){F=C[0];if(F===D){return unescape(C[1])}}}return null},getQueryStringParameter:function(D,G){var F,H,A,B,C,E;G=G||top.location.href;A=G.indexOf("?");B=A>=0?G.substr(A+1):G;A=B.lastIndexOf("#");B=A>=0?B.substr(0,A):B;C=B.split("&");for(F=0,H=C.length;F<H;F++){E=C[F].split("=");if(E.length>=2){if(E[0]===D){return unescape(E[1])}}}return null}}})();YAHOO.register("history",YAHOO.util.History,{version:"2.5.1",build:"984"});var _gat=new Object({c:"length",lb:"4.3",m:"cookie",b:undefined,cb:function(B,A){this.zb=B;this.Nb=A},r:"__utma=",W:"__utmb=",ma:"__utmc=",Ta:"__utmk=",na:"__utmv=",oa:"__utmx=",Sa:"GASO=",X:"__utmz=",lc:"http://www.google-analytics.com/__utm.gif",mc:"https://ssl.google-analytics.com/__utm.gif",Wa:"utmcid=",Ya:"utmcsr=",$a:"utmgclid=",Ua:"utmccn=",Xa:"utmcmd=",Za:"utmctr=",Va:"utmcct=",Hb:false,_gasoDomain:undefined,_gasoCPath:undefined,e:window,a:document,k:navigator,t:function(D){var A=1,E=0,B,C;if(!_gat.q(D)){A=0;for(B=D[_gat.c]-1;B>=0;B--){C=D.charCodeAt(B);A=(A<<6&268435455)+C+(C<<14);E=A&266338304;A=E!=0?A^E>>21:A}}return A},C:function(G,B,H){var E=_gat,F="-",C,A,D=E.q;if(!D(G)&&!D(B)&&!D(H)){C=E.w(G,B);if(C>-1){A=G.indexOf(H,C);if(A<0){A=G[E.c]}F=E.F(G,C+E.w(B,"=")+1,A)}}return F},Ea:function(D){var A=false,E=0,B,C;if(!_gat.q(D)){A=true;for(B=0;B<D[_gat.c];B++){C=D.charAt(B);E+="."==C?1:0;A=A&&E<=1&&(0==B&&"-"==C||_gat.P(".0123456789",C))}}return A},d:function(B,A){var C=encodeURIComponent;return C instanceof Function?(A?encodeURI(B):C(B)):escape(B)},J:function(D,A){var E=decodeURIComponent,B;D=D.split("+").join(" ");if(E instanceof Function){try{B=A?decodeURI(D):E(D)}catch(C){B=unescape(D)}}else{B=unescape(D)}return B},Db:function(A){return A&&A.hash?_gat.F(A.href,_gat.w(A.href,"#")):""},q:function(A){return _gat.b==A||"-"==A||""==A},Lb:function(A){return A[_gat.c]>0&&_gat.P(" \n\r\t",A)},P:function(B,A){return _gat.w(B,A)>-1},h:function(B,A){B[B[_gat.c]]=A},T:function(A){return A.toLowerCase()},z:function(B,A){return B.split(A)},w:function(B,A){return B.indexOf(A)},F:function(B,A,C){C=_gat.b==C?B[_gat.c]:C;return B.substring(A,C)},uc:function(){var B=_gat.b,A=window;if(A&&A.gaGlobal&&A.gaGlobal.hid){B=A.gaGlobal.hid}else{B=Math.round(Math.random()*2147483647);A.gaGlobal=A.gaGlobal?A.gaGlobal:{};A.gaGlobal.hid=B}return B},wa:function(){return Math.round(Math.random()*2147483647)},Gc:function(){return(_gat.wa()^_gat.vc())*2147483647},vc:function(){var G=_gat.k,B=_gat.a,H=_gat.e,E=B[_gat.m]?B[_gat.m]:"",F=H.history[_gat.c],C,A,D=[G.appName,G.version,G.language?G.language:G.browserLanguage,G.platform,G.userAgent,G.javaEnabled()?1:0].join("");if(H.screen){D+=H.screen.width+"x"+H.screen.height+H.screen.colorDepth}else{if(H.java){A=java.awt.Toolkit.getDefaultToolkit().getScreenSize();D+=A.screen.width+"x"+A.screen.height}}D+=E;D+=B.referrer?B.referrer:"";C=D[_gat.c];while(F>0){D+=F--^C++}return _gat.t(D)}});_gat.hc=function(){var B=this,A=_gat.cb;function C(D,E){return new A(D,E)}B.db="utm_campaign";B.eb="utm_content";B.fb="utm_id";B.gb="utm_medium";B.hb="utm_nooverride";B.ib="utm_source";B.jb="utm_term";B.kb="gclid";B.pa=0;B.I=0;B.wb="15768000";B.Tb="1800";B.ea=[];B.ga=[];B.Ic="cse";B.Gb="q";B.ab="google";B.fa=[C(B.ab,B.Gb),C("yahoo","p"),C("msn","q"),C("aol","query"),C("aol","encquery"),C("lycos","query"),C("ask","q"),C("altavista","q"),C("netscape","query"),C("cnn","query"),C("looksmart","qt"),C("about","terms"),C("mamma","query"),C("alltheweb","q"),C("gigablast","q"),C("voila","rdata"),C("virgilio","qs"),C("live","q"),C("baidu","wd"),C("alice","qs"),C("yandex","text"),C("najdi","q"),C("aol","q"),C("club-internet","query"),C("mama","query"),C("seznam","q"),C("search","q"),C("wp","szukaj"),C("onet","qt"),C("netsprint","q"),C("google.interia","q"),C("szukacz","q"),C("yam","k"),C("pchome","q"),C("kvasir","searchExpr"),C("sesam","q"),C("ozu","q"),C("terra","query"),C("nostrum","query"),C("mynet","q"),C("ekolay","q"),C("search.ilse","search_for")];B.B=undefined;B.Kb=false;B.p="/";B.ha=100;B.Da="/__utm.gif";B.ta=1;B.ua=1;B.G="|";B.sa=1;B.qa=1;B.pb=1;B.g="auto";B.D=1;B.Ga=1000;B.Yc=10;B.nc=10;B.Zc=0.2};_gat.Y=function(U,W){var V,R,M,Q,P,G,J,T=this,N=_gat,E=N.q,D=N.c,S,C=W;T.a=U;function I(B){var A=B instanceof Array?B.join("."):"";return E(A)?"-":A}function L(X,A){var Y=[],B;if(!E(X)){Y=N.z(X,".");if(A){for(B=0;B<Y[D];B++){if(!N.Ea(Y[B])){Y[B]="-"}}}}return Y}function K(){return F(63072000000)}function F(B){var A=new Date,X=new Date(A.getTime()+B);return"expires="+X.toGMTString()+"; "}function O(B,A){T.a[N.m]=B+"; path="+C.p+"; "+A+T.Cc()}function H(Z,A,c){var X=T.V,Y,B;for(Y=0;Y<X[D];Y++){B=X[Y][0];B+=E(A)?A:A+X[Y][4];X[Y][2](N.C(Z,B,c))}}T.Jb=function(){return N.b==S||S==T.t()};T.Ba=function(){return P?P:"-"};T.Wb=function(A){P=A};T.Ma=function(A){S=N.Ea(A)?A*1:"-"};T.Aa=function(){return I(G)};T.Na=function(A){G=L(A)};T.Hc=function(){return S?S:"-"};T.Cc=function(){return E(C.g)?"":"domain="+C.g+";"};T.ya=function(){return I(V)};T.Ub=function(A){V=L(A,1)};T.K=function(){return I(R)};T.La=function(A){R=L(A,1)};T.za=function(){return I(M)};T.Vb=function(A){M=L(A,1)};T.Ca=function(){return I(Q)};T.Xb=function(B){Q=L(B);for(var A=0;A<Q[D];A++){if(A<4&&!N.Ea(Q[A])){Q[A]="-"}}};T.Dc=function(){return J};T.Uc=function(A){J=A};T.pc=function(){V=[];R=[];M=[];Q=[];P=N.b;G=[];S=N.b};T.t=function(){var B="",A;for(A=0;A<T.V[D];A++){B+=T.V[A][1]()}return N.t(B)};T.Ha=function(B){var A=T.a[N.m],X=false;if(A){H(A,B,";");T.Ma(T.t());X=true}return X};T.Rc=function(A){H(A,"","&");T.Ma(N.C(A,N.Ta,"&"))};T.Wc=function(){var B=T.V,A=[],X;for(X=0;X<B[D];X++){N.h(A,B[X][0]+B[X][1]())}N.h(A,N.Ta+T.t());return A.join("&")};T.bd=function(Y,A){var Z=T.V,B=C.p,X;T.Ha(Y);C.p=A;for(X=0;X<Z[D];X++){if(!E(Z[X][1]())){Z[X][3]()}}C.p=B};T.dc=function(){O(N.r+T.ya(),K())};T.Pa=function(){O(N.W+T.K(),F(C.Tb*1000))};T.ec=function(){O(N.ma+T.za(),"")};T.Ra=function(){O(N.X+T.Ca(),F(C.wb*1000))};T.fc=function(){O(N.oa+T.Ba(),K())};T.Qa=function(){O(N.na+T.Aa(),K())};T.cd=function(){O(N.Sa+T.Dc(),"")};T.V=[[N.r,T.ya,T.Ub,T.dc,"."],[N.W,T.K,T.La,T.Pa,""],[N.ma,T.za,T.Vb,T.ec,""],[N.oa,T.Ba,T.Wb,T.fc,""],[N.X,T.Ca,T.Xb,T.Ra,"."],[N.na,T.Aa,T.Na,T.Qa,"."]]};_gat.jc=function(E){var A=this,F=_gat,C=E,D,B=function(G){var H=(new Date).getTime(),I;I=(H-G[3])*(C.Zc/1000);if(I>=1){G[2]=Math.min(Math.floor(G[2]*1+I),C.nc);G[3]=H}return G};A.O=function(L,S,G,N,K,Q,P){var M,O=C.D,I=G.location;if(!D){D=new F.Y(G,C)}D.Ha(N);M=F.z(D.K(),".");if(M[1]<500||K){if(Q){M=B(M)}if(K||!Q||M[2]>=1){if(!K&&Q){M[2]=M[2]*1-1}M[1]=M[1]*1+1;L="?utmwv="+_gat.lb+"&utmn="+F.wa()+(F.q(I.hostname)?"":"&utmhn="+F.d(I.hostname))+(C.ha==100?"":"&utmsp="+F.d(C.ha))+L;if(0==O||2==O){var J=new Image(1,1);J.src=C.Da+L;var H=2==O?function(){}:P||function(){};J.onload=H}if(1==O||2==O){var R=new Image(1,1);R.src=("https:"==I.protocol?F.mc:F.lc)+L+"&utmac="+S+"&utmcc="+A.wc(G,N);R.onload=P||function(){}}}}D.La(M.join("."));D.Pa()};A.wc=function(I,J){var L=[],K=[F.r,F.X,F.na,F.oa],M,H=I[F.m],G;for(M=0;M<K[F.c];M++){G=F.C(H,K[M]+J,";");if(!F.q(G)){F.h(L,K[M]+G+";")}}return F.d(L.join("+"))}};_gat.i=function(){this.la=[]};_gat.i.bb=function(F,B,G,D,E,C){var A=this;A.cc=F;A.Oa=B;A.L=G;A.sb=D;A.Pb=E;A.Qb=C};_gat.i.bb.prototype.S=function(){var B=this,A=_gat.d;return"&"+["utmt=item","utmtid="+A(B.cc),"utmipc="+A(B.Oa),"utmipn="+A(B.L),"utmiva="+A(B.sb),"utmipr="+A(B.Pb),"utmiqt="+A(B.Qb)].join("&")};_gat.i.$=function(F,H,G,E,B,D,C,I){var A=this;A.v=F;A.ob=H;A.bc=G;A.ac=E;A.Yb=B;A.ub=D;A.$b=C;A.xb=I;A.ca=[]};_gat.i.$.prototype.mb=function(F,H,G,E,B){var D=this,C=D.Eb(F),I=D.v,A=_gat;if(A.b==C){A.h(D.ca,new A.i.bb(I,F,H,G,E,B))}else{C.cc=I;C.Oa=F;C.L=H;C.sb=G;C.Pb=E;C.Qb=B}};_gat.i.$.prototype.Eb=function(C){var A,D=this.ca,B;for(B=0;B<D[_gat.c];B++){A=C==D[B].Oa?D[B]:A}return A};_gat.i.$.prototype.S=function(){var B=this,A=_gat.d;return"&"+["utmt=tran","utmtid="+A(B.v),"utmtst="+A(B.ob),"utmtto="+A(B.bc),"utmttx="+A(B.ac),"utmtsp="+A(B.Yb),"utmtci="+A(B.ub),"utmtrg="+A(B.$b),"utmtco="+A(B.xb)].join("&")};_gat.i.prototype.nb=function(H,J,I,F,B,E,D,K){var A=this,G=_gat,C=A.xa(H);if(G.b==C){C=new G.i.$(H,J,I,F,B,E,D,K);G.h(A.la,C)}else{C.ob=J;C.bc=I;C.ac=F;C.Yb=B;C.ub=E;C.$b=D;C.xb=K}return C};_gat.i.prototype.xa=function(C){var A,D=this.la,B;for(B=0;B<D[_gat.c];B++){A=C==D[B].v?D[B]:A}return A};_gat.gc=function(E){var A=this,F="-",C=_gat,D=E;A.Ja=screen;A.qb=!self.screen&&self.java?java.awt.Toolkit.getDefaultToolkit():C.b;A.a=document;A.e=window;A.k=navigator;A.Ka=F;A.Sb=F;A.tb=F;A.Ob=F;A.Mb=1;A.Bb=F;function B(){var I,O,G,K,H="ShockwaveFlash",N="$version",M=A.k?A.k.plugins:C.b;if(M&&M[C.c]>0){for(I=0;I<M[C.c]&&!G;I++){O=M[I];if(C.P(O.name,"Shockwave Flash")){G=C.z(O.description,"Shockwave Flash ")[1]}}}else{H=H+"."+H;try{K=new ActiveXObject(H+".7");G=K.GetVariable(N)}catch(J){}if(!G){try{K=new ActiveXObject(H+".6");G="WIN 6,0,21,0";K.AllowScriptAccess="always";G=K.GetVariable(N)}catch(L){}}if(!G){try{K=new ActiveXObject(H);G=K.GetVariable(N)}catch(L){}}if(G){G=C.z(C.z(G," ")[1],",");G=G[0]+"."+G[1]+" r"+G[2]}}return G?G:F}A.xc=function(){var G;if(self.screen){A.Ka=A.Ja.width+"x"+A.Ja.height;A.Sb=A.Ja.colorDepth+"-bit"}else{if(A.qb){try{G=A.qb.getScreenSize();A.Ka=G.width+"x"+G.height}catch(H){}}}A.Ob=C.T(A.k&&A.k.language?A.k.language:(A.k&&A.k.browserLanguage?A.k.browserLanguage:F));A.Mb=A.k&&A.k.javaEnabled()?1:0;A.Bb=D?B():F;A.tb=C.d(A.a.characterSet?A.a.characterSet:(A.a.charset?A.a.charset:F))};A.Xc=function(){return"&"+["utmcs="+C.d(A.tb),"utmsr="+A.Ka,"utmsc="+A.Sb,"utmul="+A.Ob,"utmje="+A.Mb,"utmfl="+C.d(A.Bb)].join("&")}};_gat.n=function(M,Q,O,J,F){var I=this,H=_gat,S=H.q,C=H.b,L=H.P,G=H.C,R=H.T,P=H.z,K=H.c;I.a=Q;I.f=M;I.Rb=O;I.ja=J;I.o=F;function N(A){return S(A)||"0"==A||!L(A,"://")}function D(B){var A="";B=R(P(B,"://")[1]);if(L(B,"/")){B=P(B,"/")[1];if(L(B,"?")){A=P(B,"?")[0]}}return A}function E(B){var A="";A=R(P(B,"://")[1]);if(L(A,"/")){A=P(A,"/")[0]}return A}I.Fc=function(T){var B=I.Fb(),A=I.o;return new H.n.s(G(T,A.fb+"=","&"),G(T,A.ib+"=","&"),G(T,A.kb+"=","&"),I.ba(T,A.db,"(not set)"),I.ba(T,A.gb,"(not set)"),I.ba(T,A.jb,B&&!S(B.R)?H.J(B.R):C),I.ba(T,A.eb,C))};I.Ib=function(T){var B=E(T),A=D(T);if(L(B,I.o.ab)){T=P(T,"?").join("&");if(L(T,"&"+I.o.Gb+"=")){if(A==I.o.Ic){return true}}}return false};I.Fb=function(){var W,T,B=I.Rb,V,U,A=I.o.fa;if(N(B)||I.Ib(B)){return }W=E(B);for(V=0;V<A[K];V++){U=A[V];if(L(W,R(U.zb))){B=P(B,"?").join("&");if(L(B,"&"+U.Nb+"=")){T=P(B,"&"+U.Nb+"=")[1];if(L(T,"&")){T=P(T,"&")[0]}return new H.n.s(C,U.zb,C,"(organic)","organic",T,C)}}}};I.ba=function(V,B,A){var U=G(V,B+"=","&"),T=!S(U)?H.J(U):(!S(A)?A:"-");return T};I.Nc=function(V){var B=I.o.ea,A=false,U,T;if(V&&"organic"==V.da){U=R(H.J(V.R));for(T=0;T<B[K];T++){A=A||R(B[T])==U}}return A};I.Ec=function(){var T="",B="",A=I.Rb;if(N(A)||I.Ib(A)){return }T=R(P(A,"://")[1]);if(L(T,"/")){B=H.F(T,H.w(T,"/"));if(L(B,"?")){B=P(B,"?")[0]}T=P(T,"/")[0]}if(0==H.w(T,"www.")){T=H.F(T,4)}return new H.n.s(C,T,C,"(referral)","referral",C,B)};I.sc=function(B){var A="";if(I.o.pa){A=H.Db(B);A=""!=A?A+"&":A}A+=B.search;return A};I.zc=function(){return new H.n.s(C,"(direct)",C,"(direct)","(none)",C,C)};I.Oc=function(V){var B=false,A,U,T=I.o.ga;if(V&&"referral"==V.da){A=R(H.d(V.ia));for(U=0;U<T[K];U++){B=B||L(A,R(T[U]))}}return B};I.U=function(A){return C!=A&&A.Fa()};I.yc=function(B,f){var T="",A="-",V,Y,W=0,U,h,c=I.f;if(!B){return""}h=I.a[H.m]?I.a[H.m]:"";T=I.sc(I.a.location);if(I.o.I&&B.Jb()){A=B.Ca();if(!S(A)&&!L(A,";")){B.Ra();return""}}A=G(h,H.X+c+".",";");V=I.Fc(T);if(I.U(V)){Y=G(T,I.o.hb+"=","&");if("1"==Y&&!S(A)){return""}}if(!I.U(V)){V=I.Fb();if(!S(A)&&I.Nc(V)){return""}}if(!I.U(V)&&f){V=I.Ec();if(!S(A)&&I.Oc(V)){return""}}if(!I.U(V)){if(S(A)&&f){V=I.zc()}}if(!I.U(V)){return""}if(!S(A)){var X=P(A,"."),l=new H.n.s;l.Cb(X.slice(4).join("."));U=R(l.ka())==R(V.ka());W=X[3]*1}if(!U||f){var g=G(h,H.r+c+".",";"),Z=g.lastIndexOf("."),d=Z>9?H.F(g,Z+1)*1:0;W++;d=0==d?1:d;B.Xb([c,I.ja,d,W,V.ka()].join("."));B.Ra();return"&utmcn=1"}else{return"&utmcr=1"}}};_gat.n.s=function(G,B,H,E,F,C,A){var D=this;D.v=G;D.ia=B;D.ra=H;D.L=E;D.da=F;D.R=C;D.vb=A};_gat.n.s.prototype.ka=function(){var E=this,A=_gat,F=[],C=[[A.Wa,E.v],[A.Ya,E.ia],[A.$a,E.ra],[A.Ua,E.L],[A.Xa,E.da],[A.Za,E.R],[A.Va,E.vb]],D,B;if(E.Fa()){for(D=0;D<C[A.c];D++){if(!A.q(C[D][1])){B=C[D][1].split("+").join("%20");B=B.split(" ").join("%20");A.h(F,C[D][0]+B)}}}return F.join("|")};_gat.n.s.prototype.Fa=function(){var B=this,A=_gat.q;return !(A(B.v)&&A(B.ia)&&A(B.ra))};_gat.n.s.prototype.Cb=function(C){var A=this,D=_gat,B=function(E){return D.J(D.C(C,E,"|"))};A.v=B(D.Wa);A.ia=B(D.Ya);A.ra=B(D.$a);A.L=B(D.Ua);A.da=B(D.Xa);A.R=B(D.Za);A.vb=B(D.Va)};_gat.Z=function(){var S=this,U=_gat,T={},P="k",L="v",O=[P,L],N="(",G=")",I="*",R="!",M="'",E={};E[M]="'0";E[G]="'1";E[I]="'2";E[R]="'3";var D=1;function Q(B,W,V,A){if(U.b==T[B]){T[B]={}}if(U.b==T[B][W]){T[B][W]=[]}T[B][W][V]=A}function C(A,V,B){return U.b!=T[A]&&U.b!=T[A][V]?T[A][V][B]:U.b}function H(B,W){if(U.b!=T[B]&&U.b!=T[B][W]){T[B][W]=U.b;var V=true,A;for(A=0;A<O[U.c];A++){if(U.b!=T[B][O[A]]){V=false;break}}if(V){T[B]=U.b}}}function K(B){var W="",V=false,A,X;for(A=0;A<O[U.c];A++){X=B[O[A]];if(U.b!=X){if(V){W+=O[A]}W+=J(X);V=false}else{V=true}}return W}function J(B){var W=[],V,A;for(A=0;A<B[U.c];A++){if(U.b!=B[A]){V="";if(A!=D&&U.b==B[A-1]){V+=A.toString();V+=R}V+=F(B[A]);U.h(W,V)}}return N+W.join(I)+G}function F(B){var W="",V,A,X;for(V=0;V<B[U.c];V++){A=B.charAt(V);X=E[A];W+=U.b!=X?X:A}return W}S.Kc=function(A){return U.b!=T[A]};S.N=function(){var A=[],B;for(B in T){if(U.b!=T[B]){U.h(A,B.toString()+K(T[B]))}}return A.join("")};S.Sc=function(A){if(A==U.b){return S.N()}var V=[A.N()],B;for(B in T){if(U.b!=T[B]&&!A.Kc(B)){U.h(V,B.toString()+K(T[B]))}}return V.join("")};S._setKey=function(A,V,B){if(typeof B!="string"){return false}Q(A,P,V,B);return true};S._setValue=function(A,V,B){if(typeof B!="number"&&(U.b==Number||!(B instanceof Number))){return false}if(Math.round(B)!=B||B==NaN||B==Infinity){return false}Q(A,L,V,B.toString());return true};S._getKey=function(A,B){return C(A,P,B)};S._getValue=function(A,B){return C(A,L,B)};S._clearKey=function(A){H(A,P)};S._clearValue=function(A){H(A,L)}};_gat.ic=function(B,A){var C=this;C.jd=A;C.Pc=B;C._trackEvent=function(E,F,D){return A._trackEvent(C.Pc,E,F,D)}};_gat.kc=function(V){var X=this,W=_gat,S=W.b,M=W.q,Q=W.w,P=W.F,G=W.C,J=W.P,U=W.z,N="location",E=W.c,D=S,T=new W.hc,C=false;X.a=document;X.e=window;X.ja=Math.round((new Date).getTime()/1000);X.H=V;X.yb=X.a.referrer;X.va=S;X.j=S;X.A=S;X.M=false;X.aa=S;X.rb="";X.l=S;X.Ab=S;X.f=S;X.u=S;function I(){if("auto"==T.g){var A=X.a.domain;if("www."==P(A,0,4)){A=P(A,4)}T.g=A}T.g=W.T(T.g)}function L(){var A=T.g,B=Q(A,"www.google.")*Q(A,".google.")*Q(A,"google.");return B||"/"!=T.p||Q(A,"google.org")>-1}function K(A,c,Y){if(M(A)||M(c)||M(Y)){return"-"}var Z=G(A,W.r+X.f+".",c),B;if(!M(Z)){B=U(Z,".");B[5]=B[5]?B[5]*1+1:1;B[3]=B[4];B[4]=Y;Z=B.join(".")}return Z}function F(){return"file:"!=X.a[N].protocol&&L()}function O(A){if(!A||""==A){return""}while(W.Lb(A.charAt(0))){A=P(A,1)}while(W.Lb(A.charAt(A[E]-1))){A=P(A,0,A[E]-1)}return A}function H(A,Y,B){if(!M(A())){Y(W.J(A()));if(!J(A(),";")){B()}}}function R(A){var Y,B=""!=A&&X.a[N].host!=A;if(B){for(Y=0;Y<T.B[E];Y++){B=B&&Q(W.T(A),W.T(T.B[Y]))==-1}}return B}X.Bc=function(){if(!T.g||""==T.g||"none"==T.g){T.g="";return 1}I();return T.pb?W.t(T.g):1};X.tc=function(A,Y){if(M(A)){A="-"}else{Y+=T.p&&"/"!=T.p?T.p:"";var B=Q(A,Y);A=B>=0&&B<=8?"0":("["==A.charAt(0)&&"]"==A.charAt(A[E]-1)?"-":A)}return A};X.Ia=function(A){var Y="",B=X.a;Y+=X.aa?X.aa.Xc():"";Y+=T.qa?X.rb:"";Y+=T.ta&&!M(B.title)?"&utmdt="+W.d(B.title):"";Y+="&utmhid="+W.uc()+"&utmr="+X.va+"&utmp="+X.Tc(A);return Y};X.Tc=function(A){var B=X.a[N];A=S!=A&&""!=A?W.d(A,true):W.d(B.pathname+unescape(B.search),true);return A};X.$c=function(A){if(X.Q()){var B="";if(X.l!=S&&X.l.N().length>0){B+="&utme="+W.d(X.l.N())}B+=X.Ia(A);D.O(B,X.H,X.a,X.f)}};X.qc=function(){var A=new W.Y(X.a,T);return A.Ha(X.f)?A.Wc():S};X._getLinkerUrl=function(A,c){var Y=U(A,"#"),Z=A,B=X.qc();if(B){if(c&&1>=Y[E]){Z+="#"+B}else{if(!c||1>=Y[E]){if(1>=Y[E]){Z+=(J(A,"?")?"&":"?")+B}else{Z=Y[0]+(J(A,"?")?"&":"?")+B+"#"+Y[1]}}}}return Z};X.Zb=function(){var A;if(X.A&&X.A[E]>=10&&!J(X.A,"=")){X.u.Uc(X.A);X.u.cd();W._gasoDomain=T.g;W._gasoCPath=T.p;A=X.a.createElement("script");A.type="text/javascript";A.id="_gasojs";A.src="https://www.google.com/analytics/reporting/overlay_js?gaso="+X.A+"&"+W.wa();X.a.getElementsByTagName("head")[0].appendChild(A)}};X.Jc=function(){var f=X.a[W.m],Z=X.ja,Y=X.u,w=X.f+"",q=X.e,d=q?q.gaGlobal:S,x,u=J(f,W.r+w+"."),h=J(f,W.W+w),r=J(f,W.ma+w),B,A=[],l="",c=false,g;f=M(f)?"":f;if(T.I){x=W.Db(X.a[N]);if(T.pa&&!M(x)){l=x+"&"}l+=X.a[N].search;if(!M(l)&&J(l,W.r)){Y.Rc(l);if(!Y.Jb()){Y.pc()}B=Y.ya()}H(Y.Ba,Y.Wb,Y.fc);H(Y.Aa,Y.Na,Y.Qa)}if(!M(B)){if(M(Y.K())||M(Y.za())){B=K(l,"&",Z);X.M=true}else{A=U(Y.K(),".");w=A[0]}}else{if(u){if(!h||!r){B=K(f,";",Z);X.M=true}else{B=G(f,W.r+w+".",";");A=U(G(f,W.W+w,";"),".")}}else{B=[w,W.Gc(),Z,Z,Z,1].join(".");X.M=true;c=true}}B=U(B,".");if(q&&d&&d.dh==w){B[4]=d.sid?d.sid:B[4];if(c){B[3]=d.sid?d.sid:B[4];if(d.vid){g=U(d.vid,".");B[1]=g[0];B[2]=g[1]}}}Y.Ub(B.join("."));A[0]=w;A[1]=A[1]?A[1]:0;A[2]=undefined!=A[2]?A[2]:T.Yc;A[3]=A[3]?A[3]:B[4];Y.La(A.join("."));Y.Vb(w);if(!M(Y.Hc())){Y.Ma(Y.t())}Y.dc();Y.Pa();Y.ec()};X.Lc=function(){D=new W.jc(T)};X._initData=function(){var A;if(!C){X.Lc();X.f=X.Bc();X.u=new W.Y(X.a,T)}if(F()){X.Jc()}if(!C){if(F()){X.va=X.tc(X.Ac(),X.a.domain);if(T.sa){X.aa=new W.gc(T.ua);X.aa.xc()}if(T.qa){A=new W.n(X.f,X.a,X.va,X.ja,T);X.rb=A.yc(X.u,X.M)}}X.l=new W.Z;X.Ab=new W.Z;C=true}if(!W.Hb){X.Mc()}};X._visitCode=function(){X._initData();var A=G(X.a[W.m],W.r+X.f+".",";"),B=U(A,".");return B[E]<4?"":B[1]};X._cookiePathCopy=function(A){X._initData();if(X.u){X.u.bd(X.f,A)}};X.Mc=function(){var A=X.a[N].hash,B;B=A&&""!=A&&0==Q(A,"#gaso=")?G(A,"gaso=","&"):G(X.a[W.m],W.Sa,";");if(B[E]>=10){X.A=B;if(X.e.addEventListener){X.e.addEventListener("load",X.Zb,false)}else{X.e.attachEvent("onload",X.Zb)}}W.Hb=true};X.Q=function(){return X._visitCode()%10000<T.ha*100};X.Vc=function(){var A,Z,B=X.a.links;if(!T.Kb){var Y=X.a.domain;if("www."==P(Y,0,4)){Y=P(Y,4)}T.B.push("."+Y)}for(A=0;A<B[E]&&(T.Ga==-1||A<T.Ga);A++){Z=B[A];if(R(Z.host)){if(!Z.gatcOnclick){Z.gatcOnclick=Z.onclick?Z.onclick:X.Qc;Z.onclick=function(b){var c=!this.target||this.target=="_self"||this.target=="_top"||this.target=="_parent";c=c&&!X.oc(b);X.ad(b,this,c);return c?false:(this.gatcOnclick?this.gatcOnclick(b):true)}}}}};X.Qc=function(){};X._trackPageview=function(A){if(F()){X._initData();if(T.B){X.Vc()}X.$c(A);X.M=false}};X._trackTrans=function(){var A=X.f,c=[],Y,Z,B,d;X._initData();if(X.j&&X.Q()){for(Y=0;Y<X.j.la[E];Y++){Z=X.j.la[Y];W.h(c,Z.S());for(B=0;B<Z.ca[E];B++){W.h(c,Z.ca[B].S())}}for(d=0;d<c[E];d++){D.O(c[d],X.H,X.a,A,true)}}};X._setTrans=function(){var A=X.a,c,Y,Z,B,d=A.getElementById?A.getElementById("utmtrans"):(A.utmform&&A.utmform.utmtrans?A.utmform.utmtrans:S);X._initData();if(d&&d.value){X.j=new W.i;B=U(d.value,"UTM:");T.G=!T.G||""==T.G?"|":T.G;for(c=0;c<B[E];c++){B[c]=O(B[c]);Y=U(B[c],T.G);for(Z=0;Z<Y[E];Z++){Y[Z]=O(Y[Z])}if("T"==Y[0]){X._addTrans(Y[1],Y[2],Y[3],Y[4],Y[5],Y[6],Y[7],Y[8])}else{if("I"==Y[0]){X._addItem(Y[1],Y[2],Y[3],Y[4],Y[5],Y[6])}}}}};X._addTrans=function(A,f,Y,Z,B,g,d,c){X.j=X.j?X.j:new W.i;return X.j.nb(A,f,Y,Z,B,g,d,c)};X._addItem=function(A,d,Y,Z,B,f){var c;X.j=X.j?X.j:new W.i;c=X.j.xa(A);if(!c){c=X._addTrans(A,"","","","","","","")}c.mb(d,Y,Z,B,f)};X._setVar=function(A){if(A&&""!=A&&L()){X._initData();var Y=new W.Y(X.a,T),B=X.f;Y.Na(B+"."+W.d(A));Y.Qa();if(X.Q()){D.O("&utmt=var",X.H,X.a,X.f)}}};X._link=function(A,B){if(T.I&&A){X._initData();X.a[N].href=X._getLinkerUrl(A,B)}};X._linkByPost=function(A,B){if(T.I&&A&&A.action){X._initData();A.action=X._getLinkerUrl(A.action,B)}};X._setXKey=function(A,Y,B){X.l._setKey(A,Y,B)};X._setXValue=function(A,Y,B){X.l._setValue(A,Y,B)};X._getXKey=function(A,B){return X.l._getKey(A,B)};X._getXValue=function(A,B){return X.l.getValue(A,B)};X._clearXKey=function(A){X.l._clearKey(A)};X._clearXValue=function(A){X.l._clearValue(A)};X._createXObj=function(){X._initData();return new W.Z};X._sendXEvent=function(A){var B="";X._initData();if(X.Q()){B+="&utmt=event&utme="+W.d(X.l.Sc(A))+X.Ia();D.O(B,X.H,X.a,X.f,false,true)}};X._createEventTracker=function(A){X._initData();return new W.ic(A,X)};X._trackEvent=function(A,c,Y,Z){var B=true,d=X.Ab;if(S!=A&&S!=c&&""!=A&&""!=c){d._clearKey(5);d._clearValue(5);B=d._setKey(5,1,A)?B:false;B=d._setKey(5,2,c)?B:false;B=S==Y||d._setKey(5,3,Y)?B:false;B=S==Z||d._setValue(5,1,Z)?B:false;if(B){X._sendXEvent(d)}}else{B=false}return B};X.ad=function(A,c,Y){X._initData();if(X.Q()){var Z=new W.Z;Z._setKey(6,1,c.href);var B=Y?function(){X.rc(A,c)}:undefined;D.O("&utmt=event&utme="+W.d(Z.N())+X.Ia(),X.H,X.a,X.f,false,true,B)}};X.rc=function(A,Y){if(!A){A=X.e.event}var B=true;if(Y.gatcOnclick){B=Y.gatcOnclick(A)}if(B||typeof B=="undefined"){if(!Y.target||Y.target=="_self"){X.e.location=Y.href}else{if(Y.target=="_top"){X.e.top.document.location=Y.href}else{if(Y.target=="_parent"){X.e.parent.document.location=Y.href}}}}};X.oc=function(A){if(!A){A=X.e.event}var B=A.shiftKey||A.ctrlKey||A.altKey;if(!B){if(A.modifiers&&X.e.Event){B=A.modifiers&X.e.Event.CONTROL_MASK||A.modifiers&X.e.Event.SHIFT_MASK||A.modifiers&X.e.Event.ALT_MASK}}return B};X._setDomainName=function(A){T.g=A};X.dd=function(){return T.g};X._addOrganic=function(A,B){W.h(T.fa,new W.cb(A,B))};X._clearOrganic=function(){T.fa=[]};X.hd=function(){return T.fa};X._addIgnoredOrganic=function(A){W.h(T.ea,A)};X._clearIgnoredOrganic=function(){T.ea=[]};X.ed=function(){return T.ea};X._addIgnoredRef=function(A){W.h(T.ga,A)};X._clearIgnoredRef=function(){T.ga=[]};X.fd=function(){return T.ga};X._setAllowHash=function(A){T.pb=A?1:0};X._setCampaignTrack=function(A){T.qa=A?1:0};X._setClientInfo=function(A){T.sa=A?1:0};X._getClientInfo=function(){return T.sa};X._setCookiePath=function(A){T.p=A};X._setTransactionDelim=function(A){T.G=A};X._setCookieTimeout=function(A){T.wb=A};X._setDetectFlash=function(A){T.ua=A?1:0};X._getDetectFlash=function(){return T.ua};X._setDetectTitle=function(A){T.ta=A?1:0};X._getDetectTitle=function(){return T.ta};X._setLocalGifPath=function(A){T.Da=A};X._getLocalGifPath=function(){return T.Da};X._setLocalServerMode=function(){T.D=0};X._setRemoteServerMode=function(){T.D=1};X._setLocalRemoteServerMode=function(){T.D=2};X.gd=function(){return T.D};X._getServiceMode=function(){return T.D};X._setSampleRate=function(A){T.ha=A};X._setSessionTimeout=function(A){T.Tb=A};X._setAllowLinker=function(A){T.I=A?1:0};X._setAllowAnchor=function(A){T.pa=A?1:0};X._setCampNameKey=function(A){T.db=A};X._setCampContentKey=function(A){T.eb=A};X._setCampIdKey=function(A){T.fb=A};X._setCampMediumKey=function(A){T.gb=A};X._setCampNOKey=function(A){T.hb=A};X._setCampSourceKey=function(A){T.ib=A};X._setCampTermKey=function(A){T.jb=A};X._setCampCIdKey=function(A){T.kb=A};X._getAccount=function(){return X.H};X._getVersion=function(){return _gat.lb};X.kd=function(A){T.B=[];if(A){T.B=A}};X.md=function(A){T.Kb=A};X.ld=function(A){T.Ga=A};X._setReferrerOverride=function(A){X.yb=A};X.Ac=function(){return X.yb}};_gat._getTracker=function(B){var A=new _gat.kc(B);return A};Af.ElementCollection=Class.create();Af.ElementCollection.prototype={initialize:function(A){this.top=A;this.list=new Array();this.list.push(this.top);this.buildList(this.top)},buildList:function(C){var B=C.childNodes;for(var A=0;A<B.length;A++){this.list.push(B[A]);this.buildList(B[A])}},getIterator:function(){return new Af.ElementIterator(this.list)},getElements:function(C){var A=new Array();var B=this.getIterator();while(B.hasNext()){var D=B.next();if(D.tagName==C){A.push(D)}}return A},getElementsIndexedById:function(C){var A=new Object();var B=this.getIterator();while(B.hasNext()){var D=B.next();if(D.tagName==C){A[D.id]=D}}return A},getFirstElement:function(B){var A=this.getIterator();while(A.hasNext()){var C=A.next();if(C.tagName==B){return C}}return null},getFirstElementById:function(C){var A=this.getIterator();while(A.hasNext()){var B=A.next();if(B.id==C){return B}}return null}};Af.ElementIterator=Class.create();Af.ElementIterator.prototype={initialize:function(A){this.list=A;this.currentIndex=0},hasNext:function(){return this.currentIndex<this.list.length},next:function(){if(this.hasNext()){return this.list[this.currentIndex++]}return null}};Af.HtmlTable=Class.create();Af.HtmlTable.prototype={initialize:function(C,B,A){this.tableId=C;this.columns=B;this.tableElement=null;this.listener=null;this.selectedCell=null;this.selectedRowNumber=-1;this.previousRowNumber=-1;this.normalBackcolor="";this.selectionColor="#e0eeef";this.normalTextColor="#000000";this.dndMgr2=null;this.draggableAttr=null;this.header=null;this.draggableType="Unknown";this.ec=A;this.draggables=new Array();this.autoDeselect=true;this.init()},init:function(){this.columnList=this.columns.split(",");for(var C=0;C<this.columnList.length;C++){this.columnList[C]=trim(this.columnList[C])}var F;if(this.ec==null){F=document.getElementById(this.tableId)}else{F=this.ec.getFirstElementById(this.tableId)}this.tableElement=F;if(F==null){return }if(F.tBodies.length==0){return }var A=F.tBodies[0];if(A.rows.length==0){return }var B=new Af.ElementCollection(this.tableElement);var E=B.getFirstElement("TH");var D=null;if(E==null){this.templateRow=this.tableElement.rows[0];D=this.tableElement.rows[0]}else{this.header=this.tableElement.rows[0];this.templateRow=this.tableElement.rows[1];D=this.tableElement.rows[1]}if(this.templateRow.id==null){this.templateRow.id=this.tableElement.id+"TR"}this.columnsWidth=new Array(D.length);for(var C=0;C<D.cells.length;C++){this.columnsWidth[C]=D.cells[C].offsetWidth}removeAll(A)},cleanup:function(){var A=this.tableElement.tBodies[0];if(this.header!=null){this.header.style.display="none";A.appendChild(this.header)}if(this.templateRow!=null){this.templateRow.style.display="none";A.appendChild(this.templateRow)}this.draggables.length=0},setDataList:function(K){this.dlist=K;this.draggables.length=0;if(this.dlist==null){this.dlist=new Array()}if(this.dndMgr2!=null){this.dndMgr2.clearDraggables()}this.selectedRowNumber=-1;this.previousRowNumber=-1;var E=this.tableElement.tBodies[0];removeAll(E);if(this.header!=null&&this.dlist.length>0){E.appendChild(this.header)}for(var G=0;G<this.dlist.length;G++){var F=this.dlist[G];var N=this.templateRow.cloneNode(true);N.id=""+G;E.appendChild(N);var B=this.columnList.length;if(N.cells.length<B){B=N.cells.length}for(var D=0;D<B;D++){var J=N.cells[D];J.id="C_"+G+"_"+D;var M=this.columnList[D];if(M==""){continue}var I=F[M];if(I==null){I=""}else{I=""+I}var A=null;if(J.childNodes.length>0){A=J.childNodes[0];for(var C=0;C<J.childNodes.length;C++){var L=J.childNodes[C];if(L.tagName!=null){A=L;break}}if(A==null){A=J.childNodes[0]}}if(A!=null){if(A.tagName=="INPUT"){var L=A.type;if(L!=null){L=L.toLowerCase()}if(L=="checkbox"){I=I.toLowerCase();if(I=="true"){A.checked=true}else{A.checked=false}}else{A.value=I}A.onfocus=this.cellSelected.bindAsEventListener(this);A.onchange=this.cellChanged.bindAsEventListener(this)}else{if(I!=null){J.innerHTML=htmlEncode(I)}else{J.innerHTML=I}}}else{if(I!=null){J.innerHTML=htmlEncode(I)}else{J.innerHTML=I}}if(this.dndMgr2!=null&&this.draggableAttr==M){var H=this.dndMgr2.registerDraggable(this.draggableType,G,J,I);this.draggables.push(H)}J.onclick=this.cellSelected.bindAsEventListener(this);J.ondblclick=this.cellDoubleSelected.bindAsEventListener(this)}}},cellDoubleSelected:function(A){this.cellSelected(A,true)},cellSelected:function(H,E){var D=H.target?H.target:H.srcElement;if(D.tagName!="TD"){if(D.parentNode!=null&&D.parentNode.tagName=="TD"){D=D.parentNode}else{return }}var A=D.id;var F=A.indexOf("_");var C=A.lastIndexOf("_");var I=parseInt(A.substring(F+1,C));var B=parseInt(A.substring(C+1));var G=this.getCell(I,B);this.selectedCell=G;this.previousRowNumber=this.selectedRowNumber;if(this.listener!=null&&this.listener.cellSelected!=null){if(this.selectedRowNumber!=I&&this.autoDeselect){this.unselectRow(this.selectedRowNumber)}this.selectedRowNumber=I;this.listener.cellSelected(I,B,this.previousRowNumber==I,this);if(E&&this.previousRowNumber!=I){this.listener.cellSelected(I,B,true,this)}}else{this.setSelectedRow(I)}return true},cellChanged:function(G){var E=G.target?G.target:G.srcElement;var H=E;while(H!=null&&H.tagName!="TD"){H=H.parentNode}if(H==null){return }var A=H.id;var F=A.indexOf("_");var D=A.lastIndexOf("_");var J=parseInt(A.substring(F+1,D));var B=parseInt(A.substring(D+1));var I=E.type;if(I!=null){I=I.toLowerCase()}if(I=="checkbox"){v=E.checked}else{v=E.value}if(this.listener!=null&&this.listener.cellChanged!=null){this.listener.cellChanged(J,B,E.id,v)}else{var C=this.dlist[J];if(v==null){v=""}C[this.columnList[B]]=v}},setSelectedRow:function(A){this.previousRowNumber=this.selectedRowNumber;if(this.selectedRowNumber!=A){this.unselectRow(this.selectedRowNumber);this.selectedRowNumber=A;this.selectRow(this.selectedRowNumber)}},selectRow:function(F,E,B){var A=this.tableElement.tBodies[0];var G=A.childNodes.length;if(F<0||F>=G){return }this.selectedRowNumber=F;if(E==null){E=this.selectionColor}if(B==null){B=this.normalTextColor}var D=A.childNodes[F];for(var C=0;C<D.cells.length;C++){D.cells[C].style.backgroundColor=E;D.cells[C].style.color=B}},unselectRow:function(D){if(D<0){return }var A=this.tableElement.tBodies[0];var E=A.childNodes.length;if(D<0||D>=E){return }var C=A.childNodes[D];for(var B=0;B<C.cells.length;B++){C.cells[B].style.backgroundColor=this.normalBackcolor;C.cells[B].style.color=this.normalTextColor}if(this.selectedRowNumber==D){this.selectedRowNumber=-1;this.selectedCell=null}},getCell:function(C,B){var A=this.tableElement.tBodies[0];var D=A.childNodes.length;if(C<0||C>=D){return null}D=A.childNodes[C].cells.length;if(B<0||B>=D){return null}return A.childNodes[C].cells[B]},getSelectedRowData:function(){if(this.dlist==null||this.selectedRowNumber<0||this.selectedRowNumber>this.dlist.length){return null}return this.dlist[this.selectedRowNumber]},draggableTextChanged:function(B,A){var C=this.draggables.length;if(B<0||B>=C){return }this.draggables[B].text=A},disableCheckedColumn:function(B){var A=this.tableElement.tBodies[0];var E=A.childNodes.length;var D;for(var C=0;C<E;C++){D=A.childNodes[C];if(D.cells[B].childNodes[0].checked){D.cells[B].childNodes[0].disabled=true}}}};Af.HtmlTitlePane2=Class.create();Af.HtmlTitlePane2.prototype={initialize:function(E,D,B,A,C){this.relatedPaneId=E;this.titleId=D;this.titleTriggerId=D+"Trigger";this.openTitleClass=B;this.closeTitleClass=A;this.open=true;this.init();this.listener=C},init:function(){this.relatedPane=document.getElementById(this.relatedPaneId);if(this.relatedPane==null){return }if(this.titleId!=null){this.title=document.getElementById(this.titleId);this.title.onclick=this.titleSelected.bindAsEventListener(this);this.title.parentNode.onclick=this.titleSelected.bindAsEventListener(this);this.titleTrigger=document.getElementById(this.titleTriggerId);if(this.titleTrigger!=null){this.titleTrigger.onclick=this.toggleOpenClose.bindAsEventListener(this)}}},toggleOpenClose:function(A){this.setPaneState(!this.open);return consumeEvent(A)},titleSelected:function(A){if(this.listener!=null&&this.listener.viewSelected!=null){this.listener.viewSelected(this)}return consumeEvent(A)},setPaneState:function(D){this.open=D;var B;var A;if(this.open){B="";A=this.openTitleClass}else{B="none";A=this.closeTitleClass}if(this.titleTrigger!=null){this.titleTrigger.className=A}this.relatedPane.style.display=B;if(this.listener!=null){this.listener.paneStateChanged(this)}var C;if(this.open){B="";C="+ ";prefix="- "}else{B="none";C="- ";prefix="+ "}}};Af.HtmlDialog=Class.create();Af.HtmlDialog.prototype={initialize:function(C,A,B){this._initializeDialog(C,A,B)},_initializeDialog:function(C,A,B){this.title=C;this.handler=A;this.content=B;this.titleElement=null;this.titleSpan=null;this.cb=null;this.visible=false;this.width=-1;this.firstTime=true;this.left=-1;this.top=-1;this.obj=null;this.isCreateMode=false;this.contentContainer=null;this.container=null;this.isDialog=true;this.childDialog=null;if(this.handler!=null&&this.handler.isDialog&&this.handler!=this){this.handler.childDialog=this}this.armedButton=null},showHTMLTemplate:function(B,A,C){this.container=A;this.sourceElementId=C;if(this.element==null){this.createElement()}if(this.tl==null){this.tl=new Af.TemplateLoader(B,null,C,this.dialogArea);this.tl.listener=this;this.tl.loadTemplate(B)}else{this.makeVisible()}},newObject:function(C,B,D,A){if(B==null){naminAttr="name"}if(D==null){D=""}else{D=dtCache.getUniqueValue(A,B,D)}var E=new Object();E[B]=D;if(A!=null){E.__parent=A.__parent;E.__className=A.__className;E.__index=A.length;setUniqueId(A,E);A.push(E)}else{E.__className=C;E.__id=C+".0";E.__fullId=C+".0"}this.isCreateMode=true;dtCache.beginTx();dtCache.addCreateChange(E,A);this.postCreate(E);dtCache.endTx();this.setObj(E);return E},postCreate:function(A){},setObj:function(A,B){this.obj=A;this.isCreateMode=B},templateLoaded:function(){if(this.handler!=null&&this.handler.templateLoaded!=null){this.handler.templateLoaded()}},makeVisible:function(){this.visible=true;var B;if(typeof this.container=="string"){B=document.getElementById(this.container)}else{B=this.container}this.hideSelectBoxes();B.appendChild(this.element);if(this.firstTime){this.firstTime=false;var A;if(this.left<0){A=B.offsetLeft+(B.offsetWidth-this.element.offsetWidth)/2}else{A=B.offsetLeft+this.left}if(A>0){this.element.style.left=A+"px"}if(this.top<0){A=B.offsetTop+(B.offsetHeight-this.element.offsetHeight)/2}else{A=B.offsetTop+this.top}if(A>0){}draggable=new Rico.Draggable(this.sourceElementId,this.element);draggable.allowedTarget=this.titleElement;dndMgr.registerDraggable(draggable)}},close:function(A){if(this.handler!=null&&this.closeDialog){this.handler.closeDialog(this)}else{this.hide()}},hide:function(){if(this.childDialog!=null){this.childDialog.hide();this.childDialog=null}if(this.handler!=null&&this.handler.isDialog){this.handler.childDialog=null}this.visible=false;if(this.element!=null&&this.container!=null){var B;if(typeof this.container=="string"){B=document.getElementById(this.container)}else{B=this.container}try{B.removeChild(this.element);this.showSelectBoxes()}catch(A){}}},setLocation:function(A,B){this.firstTime=false;this.element.style.left=A+"px";this.element.style.top=B+"px"},createElement:function(){var G=document.createElement("div");if(is_ie){G.style.overflow="visible"}else{G.style.overflow="auto"}if(this.width!=-1){G.style.width=this.width}G.className="Dialog";var D=document.createElement("table");D.cellSpacing="0px";D.cellPadding="0px";G.appendChild(D);var B=document.createElement("tbody");D.appendChild(B);var F;var E;E=document.createElement("tr");B.appendChild(E);F=document.createElement("td");F.className="DialogTitle";E.appendChild(F);this.titleElement=F;var C=document.createElement("span");C.className="DialogTitleSpan";this.titleSpan=C;this.setTitle(this.title);F.appendChild(C);this.cb=document.createElement("a");this.cb.className="DialogTitleButton";var A=document.createElement("img");A.className="DialogCloseButtonImage";A.src="/images/close.gif";this.cb.appendChild(A);F.appendChild(this.cb);this.cb.onclick=this.close.bindAsEventListener(this);E=document.createElement("tr");B.appendChild(E);F=document.createElement("td");E.appendChild(F);this.contentContainer=F;if(this.content!=null){if(typeof this.content=="string"){F.innerHTML=this.content}else{F.appendChild(this.content)}}this.dialogArea=F;this.element=G;this.element.onkeydown=this.keyDown.bindAsEventListener(this)},setTitle:function(A){this.title=A;this.titleSpan.innerHTML=A},setContent:function(A){this.content=A;if(this.content!=null&&this.contentContainer!=null){if(typeof this.content=="string"){this.contentContainer.innerHTML=this.content}else{this.contentContainer.appendChild(this.content)}}},centerDialog:function(F,A){if(this.element==null){this.createElement()}var E=this.getViewportHeight();var G=this.getViewportWidth();var D,B;if(self.pageYOffset){D=self.pageXOffset;B=self.pageYOffset}else{if(document.documentElement&&document.documentElement.scrollTop){D=document.documentElement.scrollLeft;B=document.documentElement.scrollTop}else{if(document.body){D=document.body.scrollLeft;B=document.body.scrollTop}}}var C=B+((E-A)/2);if(C<0){C=0}if(this.element!=null){this.element.style.top=C+"px"}if(this.element!=null){this.element.style.left=(D+((G-F)/2))+"px"}},getViewportHeight:function(){if(window.innerHeight!=window.undefined){return window.innerHeight}if(document.compatMode=="CSS1Compat"){return document.documentElement.clientHeight}if(document.body){return document.body.clientHeight}return window.undefined},getViewportWidth:function(){if(window.innerWidth!=window.undefined){return window.innerWidth}if(document.compatMode=="CSS1Compat"){return document.documentElement.clientWidth}if(document.body){return document.body.clientWidth}return window.undefined},hideSelectBoxes:function(){if(this.handler!=null&&this.handler.isDialog){return }if(is_ie&&!is_ie7){var D=document.getElementsByTagName("SELECT");if(D){for(var C=0;C<D.length;C++){var E=D[C];E.style.visibility="hidden"}}var B=new Af.ElementCollection(this.element);var A=B.getIterator();while(A.hasNext()){var E=A.next();if(E.tagName=="SELECT"){E.style.visibility="visible"}}}},showSelectBoxes:function(){if(this.handler!=null&&this.handler.isDialog){return }if(is_ie&&!is_ie7){var B=document.getElementsByTagName("SELECT");if(B){for(var A=0;A<B.length;A++){var C=B[A];B[A].style.visibility="visible"}}}},keyDown:function(B){var A=B.target?B.target:B.srcElement;var C=B.keyCode?B.keyCode:B.which;if(C==13){setTimeout(this.loseFocus.bind(this,A),1)}return true},loseFocus:function(A){if(is_ie){try{}catch(B){}}setTimeout(this.doClick.bind(this,A),1)},doClick:function(A){if(this.armedButton!=null&&this.armedButton.onclick){if(A!=null&&(A.value!="Submit"&&A.value!="Cancel"&&A.value!="Done"&&A.value!="Save"&&A.value!="Ok"&&A.value!="Continue")){if(A.type!="button"&&A.type!="submit"&&A.type!="textarea"){this.armedButton.onclick()}}}}};Af.TemplateLoader=Class.create();Af.TemplateLoader.prototype={initialize:function(A,B,C,D){this.url=A;if(D==null&&B!=null){this.target=document.getElementById(B)}else{this.target=D}this.sourceElementId=C;this.listener=null},loadTemplate:function(){if(this.target==null){return false}var A=new Af.DataRequest(this.url,this.requestCompletedTemplateLoad.bind(this),requestFailedCommon,null,requestTimedoutCommon);ajaxEngine.processRequest(A)},requestCompletedTemplateLoad:function(A){if(this.listener!=null&&this.listener.makeVisible){this.listener.makeVisible(this)}removeAll(this.target);this.target.innerHTML=A.responseText;if(this.sourceElementId!=null){var B=new Af.ElementCollection(this.target);var C=B.getFirstElementById(this.sourceElementId);if(C!=null){this.element=C}}else{this.element=this.target.childNodes[0]}if(this.listener!=null&&this.listener.templateLoaded){this.listener.templateLoaded(this)}},loadTemplateUsingService:function(){var A=new Af.DataRequest(svcURL,this.requestTemplateLoadUsingServiceCompleted.bind(this),requestFailedCommon,null,requestTimedoutCommon);A.addService("TemplateService","getTemplate");A.addParameter("htmlFile",this.url);A.addParameter("elementId",this.sourceElementId);ajaxEngine.processRequest(A)},requestTemplateLoadUsingServiceCompleted:function(A){debugA(A.responseText)},reAttachElement:function(){if(this.target.childNodes.length>0&&this.target.childNodes[0]==this.element){return }removeAll(this.target);try{this.target.appendChild(this.element)}catch(A){}}};Af.HtmlSingleSelect=Class.create();Af.HtmlSingleSelect.prototype={initialize:function(B,A){this.selectId=B;this.attrName=A;this.selectElement=document.getElementById(this.selectId);this.dlist=null;this.listener=null;this.selectElement.onchange=this.selectionChanged.bind(this)},setDataList:function(A,C){var F;if(C!=null){debugA(C);F=C}else{F=this.getSelectedIndex()}this.dlist=A;if(this.dlist==null){this.dlist=new Array()}removeAll(this.selectElement);for(var B=0;B<this.dlist.length;B++){var D=this.dlist[B];var E=document.createElement("option");E.value=""+B;E.label=D[this.attrName];E.appendChild(document.createTextNode(E.label));this.selectElement.appendChild(E);if(F==B){E.selected=true}}},getSelectedObj:function(){for(var A=0;A<this.selectElement.options.length;A++){var B=this.selectElement.options[A];if(B.selected){return this.dlist[A]}}return null},getSelectedIndex:function(){for(var A=0;A<this.selectElement.options.length;A++){var B=this.selectElement.options[A];if(B.selected){return A}}return -1},setSelectedIndex:function(A){this.selectElement.selectedIndex=A},selectionChanged:function(){if(this.listener!=null&&this.listener.selectionChanged!=null){this.listener.selectionChanged(this)}}};Af.StepsMaker=Class.create();usedNextStepFromQueryString=false;Af.StepsMaker.prototype={TEMPLATE_STEP1:"1",TEMPLATE_STEP2:"2",TEMPLATE_STEP3:"3",TEMPLATE_STEP_PAYMENT_REQUEST:"PaymentRequest",TEMPLATE_STEP_PAYMENT_REQUEST_THROUGH_AMAZON:"PaymentRequestThroughAmazon",TEMPLATE_STEP_PAYMENT_ATTEMPT:"PaymentAttempt",TEMPLATE_STEP_PAYMENT_ATTEMPT_THROUGH_AMAZON:"PaymentAttemptThroughAmazon",initialize:function(){this.sc=new Array();this.date=new Date();this.disabledInput=null;this.hasAttachments=false;this.miniCalendar=null;this.miniTableElement='<div id="miniCalContainer" class="miniBox miniCalOneList"  style="z-index:300; position:abolute; "><div id="miniCalTitlePane" style="z-index:100; background-color:#FFFFFF; border:2px solid #489f97; width:185px;"><h3><a id="miniPrevious" href="#">&lt;</a><span id="miniCalHeading"> December 2007 </span><a id="miniNext" href="#">&gt;</a><span id="miniCalHeading">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a id="miniClose" href="#">X</a></span></h3><table id="miniCalTable" cellspacing="0"></table></div></div>';this.groupSelectedList=new Array();this.peopleSelectedList=new Array();this.listObj=null;this.exitStep=1;this.isUpdatedAfterSend=false;this.attachDiv='<span class="attachCont"><input type="file" name="attachItem" value="" class="dark"/></span><div class="attachDelete"><a href="#"><span class="closeBtn" title="Delete"></span></a></div>';this.ATTACHMENT_ROWS=10;this.emailValidator=new HJ.EmailValidator();this.selectedStepInitialized=false;this.maxVariableFee=1.9;this.maxFixedFee=0.3;this.minFee=5},loadTemplate:function(){this.doLoadTemplate()},doLoadTemplate:function(){if(this.listObj!=null&&this.listObj.listDeleted!=null&&this.listObj.listDeleted=="true"){var A=document.getElementById("errorText");if(A!=null&&A.style!=null&&A.style.display!=null&&A.innerHTML!=null){A.style.display="block";A.innerHTML="The requester has canceled this Sign-Up"}else{window.alert("This Sign-Up is cancelled")}return }showModalMessageDialog("Processing ... please wait",300,40);var B="step"+this.selectedStep;this.tl=new Af.TemplateLoader(this.url[B],this.targetContainerId[B],null);this.tl.listener=this;this.tl.loadTemplate();if(app){app.templateLinkClicked=true}},loadEditTemplate:function(){this.selectedStep=1;this.loadTemplate()},loadPublishTemplate:function(A){if(this.publishTemplateDisplayed||login==null||app==null){}this.publishTemplateDisplayed=true;this.timerSet=true;setTimeout(this.onTimeout.bind(this),10);this.publishTemplateObj=new HJ.PublishMyList(this);this.publishTemplateObj.loadTemplate();return false},loadCopyTemplate:function(){hideModalMessageDialog();if(this.data.templateType=="OrganizeShifts"){window.location=basePageURL+"OrganizeShifts.htm?copyFrom="+this.data.UUID;return false}if(login==null){window.location=basePageURL+"Signin.htm?template=temp&l="+this.data.UUID;return false}this.data.UUID=null;this.data.saveSend=null;this.data.name="Copy of "+this.data.name;this.selectedStep=1;var A=this.data.item;if(A!=null){for(var B=0;B<A.length;B++){A[B].listId=null;A[B].UUID=null;A[B].helper=null;A[B].helperId=null;A[B].helperEmail=null;A[B].notes=null;A[B].helperEventId=null}}this.loadTemplate()},cleanUp:function(){this.data=new Array;this.selectedStep=1;this.loadTemplate();if(this.showCancelDialog!=null){this.showCancelDialog.close()}},templateLoaded:function(){var E=document.getElementById("printPlanner");this.hideAfterLoad=true;if(E!=null){if(this.data.UUID==null||this.data.UUID==""){E.style.display="none"}else{var A=true;if(this.selectedStep==4&&this.data.helperID!=null){A=false}if(A){E.style.display="block";E.onclick=this.printPlanner.bindAsEventListener(this)}}}if(this.exitStep!=1){this.selectedStep=this.exitStep;this.loadTemplate();this.exitStep=1;login.returnToObject=null;return }if(this.listObj!=null){var C=this.listObj.latestPaymentRequestAttempt;if(C==null){C=this.listObj.latestPaymentRequest}if(C!=null){C=C[0];if(typeof (this.data.collectPayments)=="undefined"){this.data.collectPayments=true}if(typeof (this.data.suggestedAmount)=="undefined"){this.data.suggestedAmount=C.requestedAmount}if(typeof (this.data.payerCanChangeAmount)=="undefined"){if(C.payerCanChangeAmount!=null&&C.payerCanChangeAmount=="true"){this.data.helperCanModifyAmount=true}else{this.data.helperCanModifyAmount=false}}if(typeof (this.data.payerSeesFees)=="undefined"){if(C.payerSeesFees!=null&&C.payerSeesFees=="true"){this.data.showFeesToHelper=true}else{this.data.showFeesToHelper=false}}}}if(this.selectedStep==this.TEMPLATE_STEP_PAYMENT_REQUEST_THROUGH_AMAZON){this.loadPaymentRequestThroughAmazonStep();hideModalMessageDialog();return false}if(this.selectedStep==this.TEMPLATE_STEP_PAYMENT_ATTEMPT_THROUGH_AMAZON){this.loadPaymentAttemptThroughAmazonStep();hideModalMessageDialog();return false}if(this.selectedStep==2){this.nextButton=document.getElementById("nextButton");this.nextButton.onclick=this.goNext.bindAsEventListener(this);this.saveDraftButton=document.getElementById("saveDraftButton");this.updateButton=document.getElementById("updateButton");this.saveDraftButton.onclick=this.goSave.bindAsEventListener(this);this.updateButton.onclick=this.goUpdateAfterSend.bindAsEventListener(this);if(this.data.saveSend=="send"){this.saveDraftButton.style.display="none"}else{this.updateButton.style.display="none"}this.backButton=document.getElementById("backButton");this.backButton.onclick=this.goBack.bindAsEventListener(this);this.cancelButton=document.getElementById("cancelButton");this.cancelButton.onclick=this.goCancel.bindAsEventListener(this);this.loadStep2();this.initializeAttachmentsSection(true);this.setCurrentStepInYUIHistoryMgr(Af.StepsMaker.prototype.TEMPLATE_STEP2);this.addIconButton=document.getElementById("customizeIconAddButton");if(this.addIconButton){this.addIconButton.style.display="none"}this.addIconText=document.getElementById("customizeIconAddText");if(this.addIconText){this.addIconText.style.display="none"}if(this.implicitIconListId){this.loadListIcon(this.implicitIconListId)}this.loadListAttachment()}else{if(this.selectedStep==3){this.nextButton=document.getElementById("nextButton");this.nextButton.onclick=this.goNext.bindAsEventListener(this);this.saveDraftButton=document.getElementById("saveDraftButton");this.updateButton=document.getElementById("updateButton");this.updateButton.style.display="none";this.saveDraftButton.onclick=this.goSave.bindAsEventListener(this);if(this.data.saveSend=="send"){this.saveDraftButton.style.display="none"}this.backButton=document.getElementById("backButton");this.backButton.onclick=this.goBack.bindAsEventListener(this);this.cancelButton=document.getElementById("cancelButton");this.cancelButton.onclick=this.goCancel.bindAsEventListener(this);this.loadStep3();this.setCurrentStepInYUIHistoryMgr(Af.StepsMaker.prototype.TEMPLATE_STEP3)}else{if(this.selectedStep==4){this.loadStepsMakerStep4();this.loadStep4();this.initializeAttachmentsSection(false);if(this.data.helperID!=null){GATrackAction("helper_view_signup_request_for_"+this.templateType)}else{GATrackAction("organizer_view_signup_request_for_"+this.templateType)}this.loadListIcon();this.loadListAttachment()}else{if(this.selectedStep==5){GATrackAction("helper_signed_up_for_"+this.templateType);this.loadStep5()}else{if(this.selectedStep==6){this.loadStep6()}else{if(this.selectedStep==this.TEMPLATE_STEP_PAYMENT_REQUEST){this.nextButton=document.getElementById("nextButton");this.nextButton.onclick=this.goNext.bindAsEventListener(this);this.backButton=document.getElementById("backButton");this.backButton.onclick=this.goBack.bindAsEventListener(this);this.loadPaymentRequestStep()}else{if(this.selectedStep==this.TEMPLATE_STEP_PAYMENT_ATTEMPT){this.backButton=document.getElementById("backButton");this.backButton.onclick=this.goBack.bindAsEventListener(this);this.loadPaymentAttemptStep()}else{if(this.listObj==null){GATrackAction("start_"+this.templateType)}this.nextButton=document.getElementById("nextButton");this.nextButton.onclick=this.goNext.bindAsEventListener(this);this.saveDraftButton=document.getElementById("saveDraftButton");this.updateButton=document.getElementById("updateButton");this.saveDraftButton.onclick=this.goSave.bindAsEventListener(this);this.updateButton.onclick=this.goUpdateAfterSend.bindAsEventListener(this);if(this.data.saveSend=="send"){this.saveDraftButton.style.display="none"}else{this.updateButton.style.display="none"}this.backButton=document.getElementById("backButton");this.backButton.onclick=this.goBack.bindAsEventListener(this);this.cancelButton=document.getElementById("cancelButton");this.cancelButton.onclick=this.goCancel.bindAsEventListener(this);this.customizeIconButton=document.getElementById("customizeIconButton");if(this.customizeIconButton){this.customizeIconButton.onclick=this.showUploadIconDialog.bindAsEventListener(this)}this.loadStep1();this.initializeAttachmentsSection(true);this.loadListIcon();this.loadListAttachment();this.setCurrentStepInYUIHistoryMgr(Af.StepsMaker.prototype.TEMPLATE_STEP1)}}}}}}}if(this.hideAfterLoad){hideModalMessageDialog()}var B=document.getElementById("homePage");if(B){var D=B.getElementsByTagName("a");if(D.length>0){D[0].focus()}}},initializeAttachmentsSection:function(B){this.uploadResponseIFrame=document.getElementById("uploadResponse");this.addAttachmentBlock=document.getElementById("addAttachmentBlock");if(this.addAttachmentBlock!=null){this.addAttachmentBlock.onclick=this.addAttachmentBlockClicked.bindAsEventListener(this)}this.sendFileLink=document.getElementById("sendFileLink");if(this.sendFileLink!=null){this.sendFileLink.onclick=this.sendFileClicked.bindAsEventListener(this)}this.addButton=document.getElementById("addAttachButton");if(this.addButton!=null){this.addButton.onclick=this.addAttachment.bindAsEventListener(this)}this.addLink=document.getElementById("addAttachLink");if(this.addLink!=null){this.addLink.onclick=this.showUploadAttachmentDialog.bindAsEventListener(this)}this.attachmentListContainer=document.getElementById("attachmentList");var A=null;if(this.listObj!=null){A=this.listObj.UUID}else{if(this.implicitListId!=null){A=this.implicitListId}}if(this.attachmentListContainer!=null){this.attachments=new HJ.Attachments(this.attachmentListContainer,null,this.ATTACHMENT_ROWS,A,this.addAttachmentBlock);this.attachments.fetchAttachments(B)}},loadStep2:function(){this.sideNavBar.className="navStep2"},loadPaymentAttemptThroughAmazonStep:function(){this.createAmazonPaymentRequestFormElement("variableMarketPlaceFee",this.variableMarketPlaceFee);this.createAmazonPaymentRequestFormElement("fixedMarketplaceFee",this.fixedMarketplaceFee);this.createAmazonPaymentRequestFormElement("immediateReturn",this.immediateReturn);this.createAmazonPaymentRequestFormElement("collectShippingAddress",this.collectShippingAddress);this.createAmazonPaymentRequestFormElement("accessKey",this.accessKey);this.createAmazonPaymentRequestFormElement("referenceId",this.referenceId);this.createAmazonPaymentRequestFormElement("recipientEmail",this.recipientEmail);this.createAmazonPaymentRequestFormElement("amount",this.amount);this.createAmazonPaymentRequestFormElement("signature",this.signature);this.createAmazonPaymentRequestFormElement("isDonationWidget",this.isDonationWidget);this.createAmazonPaymentRequestFormElement("description",this.description);this.createAmazonPaymentRequestFormElement("ipnUrl",this.ipnUrl);this.createAmazonPaymentRequestFormElement("returnUrl",this.returnUrl);this.createAmazonPaymentRequestFormElement("processImmediate",this.processImmediate);this.createAmazonPaymentRequestFormElement("cobrandingStyle",this.cobrandingStyle);this.createAmazonPaymentRequestFormElement("abandonUrl",this.abandonUrl);this.createAmazonPaymentRequestFormElement("signatureVersion",this.signatureVersion);this.createAmazonPaymentRequestFormElement("signatureMethod",this.signatureMethod);this.createAmazonPaymentRequestFormElement("variableMarketplaceFee",this.variableMarketplaceFee);if(this.paymentUrl!=null&&this.paymentUrl!=""){document.amazonPayForm.action=this.paymentUrl}},createAmazonPaymentRequestFormElement:function(B,C){if(C==null||C==""){return }var A=document.amazonPayForm;var D=document.createElement("input");D.setAttribute("type","hidden");D.setAttribute("name",B);D.setAttribute("value",C);A.appendChild(D)},loadPaymentRequestThroughAmazonStep:function(){this.createAmazonPaymentRequestFormElement("maxVariableFee",this.maxVariableFee);this.createAmazonPaymentRequestFormElement("maxFixedFee",this.maxFixedFee);this.createAmazonPaymentRequestFormElement("callerAccountId",this.callerAccountId);this.createAmazonPaymentRequestFormElement("recipientPaysFee",this.recipientPaysFee);this.createAmazonPaymentRequestFormElement("collectEmailAddress",this.collectEmailAddress);this.createAmazonPaymentRequestFormElement("callerReference",this.callerReference);this.createAmazonPaymentRequestFormElement("callerKey",this.callerKey);this.createAmazonPaymentRequestFormElement("pipelineName",this.pipelineName);this.createAmazonPaymentRequestFormElement("returnURL",this.returnURL);this.createAmazonPaymentRequestFormElement("version",this.version);this.createAmazonPaymentRequestFormElement("signature",this.signature);this.createAmazonPaymentRequestFormElement("signatureVersion",this.signatureVersion);this.createAmazonPaymentRequestFormElement("signatureMethod",this.signatureMethod);this.createAmazonPaymentRequestFormElement("maxVariableFee",this.maxVariableFee);if(this.paymentUrl!=null&&this.paymentUrl!=""){document.amazonPayForm.action=this.paymentUrl}},loadPaymentRequestStep:function(){this.sideNavBar=document.getElementById("sideNavBar");this.navDivs=this.sideNavBar.getElementsByTagName("div");for(var A=0;A<this.navDivs.length;A++){this.navDivs[A].onclick=this.navBarClicked.bindAsEventListener(this)}this.saveDraftButton=document.getElementById("saveDraftButton");this.updateButton=document.getElementById("updateButton");this.saveDraftButton.onclick=this.goSave.bindAsEventListener(this);this.updateButton.onclick=this.goUpdateAfterSend.bindAsEventListener(this);if(this.data.saveSend=="send"){this.saveDraftButton.style.display="none"}else{this.updateButton.style.display="none"}this.collectPaymentElem=document.getElementById("collectPayment");this.suggestedAmountElem=document.getElementById("suggestedAmount");this.organizerAmountElem=document.getElementById("organizerAmountReceived");this.skipPaymentElem=document.getElementById("skipPayment");this.helperCanModifyAmountElem=document.getElementById("participantCanModifyAmount");this.showFeesToHelperElem=document.getElementById("showFeesToParticipant");this.collectPaymentElem.onclick=this.makePaymentsVisible.bind(this);this.skipPaymentElem.onclick=this.skipPaymentSetup.bind(this);this.suggestedAmountElem.onkeyup=this.calculatePaymentFees.bind(this);this.organizerAmountElem.onkeyup=this.calculateRequiredPayment.bind(this);this.suggestedAmountElem.onchange=this.setFixedWidthOnAmount.bind(this);this.organizerAmountElem.onchange=this.setFixedWidthOnAmount.bind(this);if(this.data.collectPayments!=null&&this.data.collectPayments==true){this.collectPaymentElem.checked=true;this.makePaymentsVisible();if(this.data.suggestedAmount!=null){this.suggestedAmountElem.value=this.data.suggestedAmount}if(this.data.helperCanModifyAmount!=null&this.data.helperCanModifyAmount==true){this.helperCanModifyAmountElem.checked=true}if(this.data.showFeesToHelper!=null&this.data.showFeesToHelper==true){this.showFeesToHelperElem.checked=true}}this.calculatePaymentFees();this.setFixedWidthOnAmount()},loadPaymentAttemptStep:function(){this.helperEmailElem=document.getElementById("helperEmail");if(this.helperEmailElem!=null&&this.data.helperEmail!=null&&this.data.helperEmail!=""){this.helperEmailElem.value=this.data.helperEmail}if(this.data.name!=null){document.getElementById("plannerName").innerHTML=this.data.name}this.paymentQtyAmountElem=document.getElementById("paymentQty");this.unitPaymentAmountElem=document.getElementById("unitPaymentAmount");this.paymentQtyAmountElem.onkeyup=this.calculateTotalPaymentForHelper.bind(this);this.unitPaymentAmountElem.onkeyup=this.calculateTotalPaymentForHelper.bind(this);var C=this.data.latestPaymentRequest[0];var B=parseFloat(C.requestedAmount);B=B.toFixed(2);this.unitPaymentAmountElem.value=B.toString();if(C.payerCanChangeAmount!="true"){this.unitPaymentAmountElem.disabled=true}if(typeof (C.quantity)!="undefined"){this.paymentQtyAmountElem.value=C.quantity}if(C.payerSeesFees=="true"){document.getElementById("processingFeeTitleDiv").style.visibility="";document.getElementById("processingFeeAmountDiv").style.visibility=""}this.payAtAmazonButton=document.getElementById("payAtAmazonButton");if(this.payAtAmazonButton!=null){this.payAtAmazonButton.onclick=this.prepareToPayAtAmazon.bind(this)}var A=document.getElementById("skipPaymentButton");if(A!=null){A.onclick=this.skipPayment.bind(this)}this.calculateTotalPaymentForHelper()},loadStep3:function(){this.sideNavBar=document.getElementById("sideNavBar");this.sideNavBar.className="navStep3";this.navDivs=this.sideNavBar.getElementsByTagName("div");for(var A=0;A<this.navDivs.length;A++){this.navDivs[A].onclick=this.navBarClicked.bindAsEventListener(this)}this.peopleSelectTrigger=document.getElementById("peopleSelector");this.peopleSelectTrigger.onclick=this.selectPeople.bind(this);this.peopleSelectTrigger2=document.getElementById("peopleSelector2");this.peopleSelectTrigger2.onclick=this.selectPeople.bind(this);this.emailSubject=document.getElementById("emailSubject");if(login!=null){this.emailSubject.value=this.data.name+" - Please participate!"}else{this.emailSubject.value=this.data.name+" - Please participate!"}this.emailMessage=document.getElementById("emailMessage");if(this.data.lastEmailNote!=null){this.emailMessage.value=this.data.lastEmailNote}else{if(this.templateType==HJ.TEMPLATE_TYPE_SIMPLE_LIST){this.emailMessage.value="I am sending you a Jooners' List that I think you will find useful.\n\nPlease view it. A copy is awaiting you at www.jooners.com"}else{this.emailMessage.value="Hello,\n\nI would like to invite you to sign up for "+this.data.name+". Please click on the link above to sign up.\n\nI am using Jooners to organize this activity. To participate, you do not need to register or become a member of Jooners.\n\nThank you!\n";if(login!=null){this.emailMessage.value+=login.userData.fName;this.emailMessage.value+=" ";this.emailMessage.value+=login.userData.lName}}}this.emailString=document.getElementById("emailString");if(this.data.lastEmailString!=null&&this.data.lastEmailString!=""&&this.data.lastEmailString!="undefined"){this.emailString.value=this.data.lastEmailString}else{if(login){this.emailString.value=login.userData.email}}},loadStepsMakerStep4:function(){this.helperNextStepButton=document.getElementById("helperNextStepButton");this.rsvpButton=document.getElementById("rsvpButton");this.changesButton=document.getElementById("volunteerChangesButton");if(this.data.latestPaymentRequest==null||this.data.helperID==null){if(this.helperNextStepButton!=null){this.helperNextStepButton.parentNode.style.display="none"}this.rsvpButton.style.display="block"}else{if(this.helperNextStepButton!=null){this.helperNextStepButton.parentNode.style.display="block"}this.rsvpButton.style.display="none"}var L=document.getElementById("sentEmails");this.copyButton=document.getElementById("copyButton");var D=HJ.readCookie(HJ.COOKIE_USER_EMAIL_ID);if(this.data.helperID!=null){var A=document.getElementById("helperEmailDiv");if(A!=null){A.style.display="block"}if(this.helperNextStepButton!=null){this.helperNextStepButton.onclick=this.helperNextStep.bindAsEventListener(this)}if(this.rsvpButton!=null){this.rsvpButton.onclick=this.goRSVP.bindAsEventListener(this);var O=this.rsvpButton.getElementsByTagName("span")[0];O.innerHTML="Sign-Up"}if(D!=null&&D.match("@jooners.com")!=null){this.copyButton.style.display="inline";this.copyButton.onclick=this.showCopySelection.bind(this)}L.innerHTML="This sign-up sheet sent by: "+this.data.sender;this.helperEmailElem=document.getElementById("helperEmail");if(this.helperEmailElem!=null){if(this.data.helperEmail==null){var C=document.getElementById("helperEmailNote");if(C!=null){C.style.display="none"}this.emailWarningMsg="Please ensure that your email address is entered in the email box at the top of the page and click Sign-Up again"}else{this.helperEmailElem.value=this.data.helperEmail;this.emailWarningMsg="Please confirm that your email address is in the email box at the top of the page and click Sign-Up again."}}var E=document.getElementById("helperPaidAmountDiv");if(E!=null){var P=this.data.helperPaidAmount;if(P!=null){try{P=parseFloat(P);if(!isNaN(P)&&P!=0){E.style.display="block"}}catch(I){}}}if(this.changesButton){if(this.data.allowVolunteerChanges!=null&&this.data.allowVolunteerChanges=="true"){this.changesButton.parentNode.style.display="inline";var B=document.getElementById("tempBtnLeft");var N=B.clientWidth;B.style.width=(N-120)+"px";var J=document.getElementById("tempBtnRight");N=J.clientWidth;J.style.width=(N+120)+"px";this.changesButton.onclick=this.volunteerChangesCommitment.bindAsEventListener(this)}else{this.changesButton.parentNode.style.display="none"}}var M=document.getElementById("fbLikeBtn");if(M){M.focus()}}else{var H=document.getElementById("organizerRequestedPaymentDiv");if(H!=null){var K=this.listObj.latestPaymentRequest;if(K!=null){H.style.display="block"}}if(this.helperNextStepButton!=null){var O=this.helperNextStepButton.getElementsByTagName("span")[0];O.innerHTML="Done";this.helperNextStepButton.onclick=this.loadSIHP.bindAsEventListener(this)}if(this.rsvpButton!=null){var O=this.rsvpButton.getElementsByTagName("span")[0];O.innerHTML="Done";this.rsvpButton.onclick=this.processDoneInStep4.bindAsEventListener(this)}this.editButton=document.getElementById("editButton");this.editButton.style.display="inline";this.editButton.onclick=this.loadEditTemplate.bind(this);this.copyButton.style.display="inline";this.copyButton.onclick=this.showCopySelection.bind(this);this.askMoreHelpersElem=document.getElementById("askMoreHelpers");this.askMoreHelpersElem.style.display="inline";this.askMoreHelpersElem.onclick=this.displayAskMoreHelpersDialog.bindAsEventListener(this);this.contactVolunteersElem=document.getElementById("contactVolunteers");if(this.contactVolunteersElem!=null){this.contactVolunteersElem.style.display="inline";this.contactVolunteersElem.onclick=this.displayContactVolunteersDialog.bindAsEventListener(this);var B=document.getElementById("tempBtnLeft");var N=B.clientWidth;B.style.width=(N+60)+"px";var J=document.getElementById("tempBtnRight");N=J.clientWidth;J.style.width=(N-60)+"px"}this.publicLinkElem=document.getElementById("publicLink");if(this.publicLinkElem!=null){this.publicLinkElem.style.display="inline";this.publicLinkElem.onclick=this.displayPublicLink.bindAsEventListener(this)}this.publish=document.getElementById("publish");if(this.publish!=null){if(login.userData.email.search(/jooners.com/i)!=-1){this.publish.style.display="inline";this.publish.onclick=this.loadPublishTemplate.bind(this)}}if(this.data.lastEmailString==null){this.data.lastEmailString=""}var F=this.data.lastEmailString.split(",");if(F.length==1){F=F[0].split(";")}var G="";for(i=0;i<F.length;i++){G+=F[i]+"<br />"}L.innerHTML="This signup sheet has been sent to:<br />"+G+"<br />"}},loadStep5:function(){this.emailList=document.getElementById("emailList");if(this.data.lastEmailString==null){this.data.lastEmailString=""}var C=this.data.lastEmailString.split(",");if(C.length==1){C=C[0].split(";")}var A="";for(i=0;i<C.length;i++){A+=C[i]+"\n"}this.emailList.innerHTML=A;this.emailList.setAttribute("readonly","true");this.publicLinkElem=document.getElementById("publicLink");if(this.publicLinkElem!=null){var B=window.location.protocol+"//"+window.location.host+"/guest?t=help&p=none&l="+this.data.UUID;this.publicLinkElem.innerHTML=B}},loadStep6:function(){if(this.templateType==HJ.TEMPLATE_TYPE_SIMPLE_LIST){var H=document.getElementById("rsvpHeader");if(H!=null){H.innerHTML=""}var G=document.getElementById("signupList");if(G!=null){G.innerHTML=""}}else{if(this.templateType==HJ.TEMPLATE_TYPE_COLLECT_INFORMATION){var D=document.getElementById("collectInformationSignupInfo");if(D==null){return false}D.innerHTML=this.collectInformationGenerateSignedUpDetailsHTML(this.listObj.helperEmail)}else{var F=document.getElementById("signupInfoDiv");if(F==null){return false}F.innerHTML=this.generateSignedUpDetailsHTML(this.listObj.helperID)}}var B=this.data.helperPaidAmount;if(B!=null){try{B=parseFloat(B)}catch(E){return false}if(isNaN(B)||B==0){A.innerHTML="(payment unsuccessful)";return false}var C=document.getElementById("helperPaidAmountDiv");var A=document.getElementById("helperPaidAmount");if(C!=null){C.style.display="block";A.innerHTML="$ "+B.toFixed(2)}}},loadSIHP:function(){if(app.homePageUI!=null){app.homePageUI.loadNewHomePageTemplate()}else{window.location=basePageURL}},generateSignedUpDetailsHTML:function(E){var D="<table>";D+="<tr><td colspan='2'>&nbsp;</td></tr>";D+="<tr><td colspan='2'><span style='font-size:12pt;'><b>"+this.listObj.displayName+"</b></span></td></tr>";D+="<tr><td colspan='2'>&nbsp;</td></tr>";var A=this.listObj.item;switch(this.templateType){case HJ.TEMPLATE_TYPE_ORGANIZE_VOLUNTEERS:D+="<tr><td align='left' colspan=\"2\"><b>Date:&nbsp;&nbsp;</b>"+this.listObj.startDT+"</td></tr>";D+="<tr><td align='left' colspan=\"2\"><b>Time:&nbsp;&nbsp;</b>"+this.listObj.fromTime+"</td></tr>";D+="<tr><td align='left'><b>Your Responsibility:&nbsp;&nbsp;</b></td>";break;case HJ.TEMPLATE_TYPE_PRACTICE_CARPOOL:D+="<tr><td align='left' colspan=\"2\"><b>From Date:&nbsp;&nbsp;</b>"+this.listObj.startDT+"</td></tr>";D+="<tr><td align='left' colspan=\"2\"><b>To Date:&nbsp;&nbsp;</b>"+this.listObj.endDT+"</td></tr>";D+="<tr><td align='left'><b>Your Responsibility:&nbsp;&nbsp;</b></td>";break;case HJ.TEMPLATE_TYPE_SNACK_DUTY:D+="<tr><td align='left'><b>Your Responsibility:&nbsp;&nbsp;</b></td>";break;case HJ.TEMPLATE_TYPE_COLLECT_INFORMATION:D+="";break;case HJ.TEMPLATE_TYPE_GENERIC_SIGNUP:default:D+="<tr><td align='right'><b>Your Responsibility:</b></td>"}if(E==null||E==""||A==null||A.length==0){D+="</tr><tr><td><br /><br /></td></tr></table>";return D}var B=true;for(var C=0;C<A.length;C++){if(A[C].helperId!=E&&A[C].helperId!=this.data.helperEmail){continue}if(B){B=false;D+="<td>"}else{D+="<tr><td>&nbsp;</td><td>"}switch(this.templateType){case HJ.TEMPLATE_TYPE_ORGANIZE_VOLUNTEERS:D+=A[C].description;break;case HJ.TEMPLATE_TYPE_PRACTICE_CARPOOL:if(A[C].fromTo=="from"){D+="Pick-Up on "}else{D+="Drop-off on "}D+=A[C].day;if(A[C].time!=null&&A[C].time!=""){D+=" at "+A[C].time}break;case HJ.TEMPLATE_TYPE_SNACK_DUTY:D+=A[C].dueDate;break;case HJ.TEMPLATE_TYPE_GENERIC_SIGNUP:D+=A[C].description;D+="&nbsp;";D+="on "+A[C].dueDate;break;case HJ.TEMPLATE_TYPE_COLLECT_INFORMATION:D+="";break;default:D+=A[C].description}D+="</td></tr>"}D+="</table>";return D},loadIndex:function(){window.location=basePageURL+"index.htm"},loadSignupPage:function(){window.location=basePageURL+"Registration.html"},loadSigninPage:function(){window.location=basePageURL+"Signin.htm"},loadTempLearnPage:function(){return window.open("/learnMore.html","_blank","toolbar=yes, location=yes, directories=no, status=no, menubar=yes, scrollbars=yes, resizable=yes, copyhistory=yes, width=800, height=600")},loadCalendarTemplate:function(){app.setCurrentTab(HJ.DESTINATION_PAGE_OUR_CAL);app.db.displayCurrentTab();return false},saveEmailData:function(){if(this.emailMessage.value!=null){this.data.lastEmailNote=this.emailMessage.value}if(this.emailString.value!=null){this.data.lastEmailString=this.emailString.value}if(this.emailSubject.value!=null){this.data.lastEmailSubject=this.emailSubject.value}},navBarClicked:function(A){var C=A.target?A.target:A.srcElement;var B="";if(this.checkEventReminderDay!=null&&this.checkEventReminderDay!="undefined"){if(!this.checkEventReminderDay()){return false}}if(C.id=="navStepPaymentRequest"){B=this.TEMPLATE_STEP_PAYMENT_REQUEST}else{B=C.id.substr(C.id.length-1)}this.sideNavBar.className="navStep"+B;return this.goBack(A,B)},previewEmail:function(){if(this.previewEmailDialog==null||this.previewEmailDialog!=null){var A={templateLoaded:function(){this.parent.goPreviewEmailLoad()},parent:this};this.previewEmailDialog=new Af.HtmlDialog("Preview Email",A,null);this.previewEmailDialog.width="850px"}this.previewEmailDialog.showHTMLTemplate(basePageURL+"previewEmail.htm","MainArea","Preview Email")},goPreviewEmailLoad:function(){var A=this.emailMessage.value;document.getElementById("dialogEmailMessage").innerHTML="<pre>"+A+"</pre>"},doInitialRoute:function(){if(this.data.helperID!=null){if(!this.selectedStepInitialized){this.selectedStep=4}}else{if(this.data.saveSend=="send"){this.selectedStep=4}}this.selectedStepInitialized=true},selectPeople:function(){if(login==null){login=new HJ.Login(this,"true");login.startStep1();return false}this.groupSelectedList=new Array;this.peopleSelectedList=new Array;var A=getPoepleGroupSelector(this);A.setDataList(app.workspace.myGroup,app.workspace.myPeople,this.groupSelectedList,this.peopleSelectedList);return false},selectionDone:function(H,D){var C=this.peopleSelectedList;var J="";if(C==null){C=new Array()}for(var E=0;E<C.length;E++){var A=C[E];A=findObjById(app.workspace.myPeople,A.UUID);if(A==null){continue}if(J==""){J+=A.email}else{J+=","+A.email}}var C=this.groupSelectedList;var B="";if(C==null){C=new Array()}if(C!=null){for(var E=0;E<C.length;E++){var F=C[E];F=findObjById(app.workspace.myGroup,F.UUID);if(F==null){continue}var I=F.people;if(I!=null){for(pId=0;pId<I.length;pId++){var A=I[pId];A=findObjById(app.workspace.myPeople,A.UUID);if(A==null){continue}B+=A.email+","}}}}var G=this.emailString.value;if(G==""||G==null){G=""}if(G==""||G.charAt(G.length-1)==","){G=G+B+J}else{G=G+","+B+J}this.emailString.value=G},helperNextStep:function(){this.goRSVP()},goRSVP:function(){if(this.listObj!=null&&this.listObj.listDeleted=="true"){showMessageDialog("The requester has canceled this Sign-Up","Notice",250,100,null,true);return false}var K=this.data.item;var G=false;var L=document.getElementById("helperEmail");var D=null;if(L!=null){D=L.value;if(D!=null&&D!=""){if(!this.emailValidator.validateEmail(D)){showMessageDialog(D,"Invalid Email Address",300,100);return false}D=this.emailValidator.extractEmailAddress(D);G=true;this.data.helperEmail=D}else{this.showEmptyEmailMessage();return false}}var I=false;var J=false;if(K!=null&&K.length>0){for(var H=0;H<K.length;H++){var O=K[H];var F=document.getElementById(O.divName);var M=F.getElementsByTagName("input");if(M[0]!=null){var N=M[0].value;if(M[0].disabled==false&&N!="Drivers Sign Up Here"){if(N!=null&&N!=""&&N!="undefined"){I=true;O.helperEmail=D}else{if(O.helperEmail!=null&&O.helperEmail!=""&&O.helperEmail!="undefined"){J=true;O.helperEmail="";O.helperId=""}}O.helper=N;if(this.templateType==HJ.TEMPLATE_TYPE_COLLECT_INFORMATION){var B="";for(var C=0;C<this.maxColumns;C++){var E=document.getElementById("informationField_"+H+"_"+C);B+=E.value;if(C+1<this.maxColumns){B+=";"}}O.notes=B}else{var A=document.getElementById("notes_"+H);if(A!=null){notesvalue=A.value;if(A.disabled==false&&notesvalue!="Drivers Write Notes Here"){O.notes=notesvalue}}}}}}if(!I){this.showEnterEmailAgainDialog();return false}if(G){if(this.emailAddrWarningShown==undefined||this.emailAddrWarningShown==false){this.showConfirmEmailDialog();return false}else{this.doSave();return false}}}if(this.data.latestPaymentRequest!=null&&this.helperNextStepButton!=null){this.selectedStep=this.TEMPLATE_STEP_PAYMENT_ATTEMPT}else{this.selectedStep=6}this.loadTemplate()},volunteerChangesCommitment:function(){this.emailInputDialog=showInputDialog("Please enter your email address ... ","","Change my commitment",300,200,this.volunteerChangesEmailEntered.bind(this));return false},volunteerChangesEmailEntered:function(){hideDialogWin();var G=this.emailInputDialog.textField.value;if(G==null||G==""||G=="undefined"){this.emailInputDialog=showInputDialog("Email is empty. Please enter your email address ... ","","Change my commitment",300,200,this.volunteerChangesEmailEntered.bind(this));return false}else{G=G.toLowerCase();var A=this.data.item;var D=false;var F=false;this.prevCommitment=[];for(var B=0;B<A.length;B++){if(A[B].helperEmail==null||A[B].helperEmail==""){continue}if(G==A[B].helperEmail.toLowerCase()){var C=A[B];D=true;this.prevCommitment.push(A[B])}}if(!D){this.emailInputDialog=showInputDialog("There is no email address on this sign up sheet that matches the email address you entered. Please try again. ","","Change my commitment",300,200,this.volunteerChangesEmailEntered.bind(this));return false}else{var E=new HJ.ChangeCommitmentDialog(this);E.setMyListUUID(this.data.UUID);E.setMyItems(this.prevCommitment);E.loadTemplate();return false}}return false},updateCommitments:function(I){var Q=I.length;var E=false;for(var O=0;O<Q;O++){var J=this.data.item;var G=J.length;for(var N=0;N<G;N++){var S=J[N];if(S.UUID==I[O].UUID){this.data.helperID=S.helperID;this.data.helperEmail=S.helperEmail;var F=document.getElementById(S.divName);var C=F.getElementsByTagName("input");C[0].value="";C[0].removeAttribute("disabled");C[0].style.color="#000000";if(this.templateType==HJ.TEMPLATE_TYPE_COLLECT_INFORMATION){for(var R=0;R<3;R++){C[4+R].value="";C[4+R].removeAttribute("disabled");C[4+R].style.color="#000000"}}else{C[4].value="";C[4].removeAttribute("disabled");C[4].style.color="#000000"}S.helperEmail="";S.helper="";S.helperId="";S.helperEventId="";S.notes="";E=true;break}}}if(E){var D="<HELPResult>";D+='<MyList class="MyList" UUID="'+this.data.UUID+'">';var M=this.data.item;for(var O=0;O<M.length;O++){var S=M[O];D+='<item class="MyListItem" UUID="'+S.UUID+'">';D+='<property name="lastUpdateDate" value="'+S.lastUpdateDate+'" />';var P=S.helper;if(P==null||P=="Drivers Sign Up Here"){P=""}else{P=xmlEncode(P)}D+='<property name="helper" value="'+P+'" />';var H=S.notes;if(H==null||H=="Drivers Write Notes Here"){H=""}else{H=xmlEncode(H)}D+='<property name="notes" value="'+H+'" />';if(P!=""){var L=S.helperEmail;if(L==null||L=="undefined"){L=""}else{L=xmlEncode(L)}D+='<property name="helperEmail" value="'+L+'" />'}else{D+='<property name="helperEmail" value="" />'}var K=S.helperId;if(K==null||K==""||K=="undefined"){K="";if(P!=null&&P!=""){K=this.data.helperEmail;S.helperId=K}}D+='<property name="helperId" value="'+K+'" />';var B=S.helperEventId;if(B==null||B=="undefined"){B=""}else{B=xmlEncode(B)}D+='<property name="helperEventId" value="'+B+'" />';D+="</item>"}D+="</MyList>";D+="<idOfUser>"+this.data.idOfUser+"</idOfUser>";D+="<idOfHelper>"+this.data.helperID+"</idOfHelper>";D+="<helperEmail>"+this.data.helperEmail+"</helperEmail>";D+="</HELPResult>";this.xml=D;this.saveUrl=svcURL;showModalMessageDialog("Processing your request... please wait",300,40);var A=new Af.DataRequest(this.saveUrl,this.updateCommitmentCompleted.bind(this),this.requestFailedCommon.bind(this),null,this.requestTimedoutCommon.bind(this));A.addService("PublicService","saveHelpResult");A.addParameter("isSendReminder","false");A.addParameter("helperID",this.data.helperID);A.addParameter("helperEmail",this.data.helperEmail);A.addParameter("listUUID",this.data.UUID);A.xmlDoc=this.xml;ajaxEngine.processRequest(A)}},updateCommitmentCompleted:function(A){window.location.reload()},removeHelper:function(B){var D=Event.element(B);var A=parseInt(D.name);var C=this.data.item;C[A].helper="";C[A].helperId=null;C[A].helperEmail=null;this.data.item=C;this.doSave("no");return false},goUpdateAfterSend:function(){this.isUpdatedAfterSend=true;this.goSave("save");return false},goSave:function(A){if(this.checkEventReminderDay!=null&&this.checkEventReminderDay!="undefined"){if(!this.checkEventReminderDay()){return false}}if(this.selectedStep==1||this.selectedStep==2||this.selectedStep==4){this.saveHoldData()}else{if(this.selectedStep==3){this.saveEmailData()}else{if(this.selectedStep==this.TEMPLATE_STEP_PAYMENT_REQUEST){this.processPaymentRequest(false)}}}if(A=="send"){this.action="send"}else{this.action="save"}if(login==null){showModalMessageDialog("Initializing ... please wait",240,40);login=new HJ.Login(this,"true");login.startStep1();return false}this.saveAfterLogin();return false},saveAfterLogin:function(){if(this.action!=null&&this.action=="send"){this.validateUI()}else{this.saveMyList("save")}if(this.showCancelDialog!=null){this.showCancelDialog.close()}return false},goNext:function(A){if(this.selectedStep==1||this.selectedStep==2){this.saveHoldData()}if(this.selectedStep==3){this.goSend();if(!A){var A=window.event}if(A){YAHOO.util.Event.stopEvent(A)}return false}if(this.checkEventReminderDay!=null&&this.checkEventReminderDay!="undefined"){if(!this.checkEventReminderDay()){return false}}if(this.selectedStep==this.TEMPLATE_STEP_PAYMENT_REQUEST){this.goBack(A,3);return false}else{if(this.selectedStep==2){this.selectedStep=this.TEMPLATE_STEP_PAYMENT_REQUEST}else{this.selectedStep++}}this.loadTemplate();if(!A){var A=window.event}if(A){YAHOO.util.Event.stopEvent(A)}return false},goBack:function(B,A){if(this.selectedStep==3){this.saveEmailData()}if(this.selectedStep==2||this.selectedStep==1){this.saveHoldData()}if(this.selectedStep==this.TEMPLATE_STEP_PAYMENT_ATTEMPT){var C=this.data.latestPaymentRequest[0];C.requestedAmount=document.getElementById("unitPaymentAmount").value;C.quantity=document.getElementById("paymentQty").value;A=4}if(A==null){if(this.selectedStep==this.TEMPLATE_STEP_PAYMENT_REQUEST){A=2}else{if(this.selectedStep==3){A=this.TEMPLATE_STEP_PAYMENT_REQUEST}else{A=this.selectedStep-1}}}var D=document.getElementById("collectPayment");if(this.selectedStep==this.TEMPLATE_STEP_PAYMENT_REQUEST){this.data.collectPayments=document.getElementById("collectPayment").checked;this.data.suggestedAmount=document.getElementById("suggestedAmount").value;this.data.helperCanModifyAmount=document.getElementById("participantCanModifyAmount").checked;this.data.showFeesToHelper=document.getElementById("showFeesToParticipant").checked}if(this.selectedStep==this.TEMPLATE_STEP_PAYMENT_REQUEST&&D.checked==true&&A==3&&this.data.saveSend!="send"){if(login==null){login=new HJ.Login(this,"true");login.startStep1();return false}this.nextStep=A;this.processPaymentRequest(true)}else{this.selectedStep=A;this.loadTemplate()}if(A==1||A==2){this.loadListIcon();this.loadListAttachment()}if(!B){var B=window.event}if(B){YAHOO.util.Event.stopEvent(B)}return false},goCancel:function(A){this.loadSIHP();if(!A){var A=window.event}if(A){YAHOO.util.Event.stopEvent(A)}return false},goSend:function(){this.goSave("send");return false},doCancelConfirmation:function(){if(this.showCancelDialog==null){var A={templateLoaded:function(){this.parent.goCancelConfirmationLoad()},parent:this};this.showCancelDialog=new Af.HtmlDialog("Sure you want to cancel?",A,null);this.showCancelDialog.width="320px"}this.showCancelDialog.showHTMLTemplate(basePageURL+"cancelMessage.htm","MainArea","cancelConfirmation");this.showCancelDialog.centerDialog(350,350)},goCancelConfirmationLoad:function(){this.save=document.getElementById("save");this.save.onclick=this.goSave.bind(this);this.dontSave=document.getElementById("dontSave");this.dontSave.onclick=this.cleanUp.bind(this)},validateUI:function(){var E=this.listFields;var F=this.data.lastEmailString;if(F!=null&&F!=""){var D=this.data.lastEmailString.split(",");if(D.length==1){D=D[0].split(";")}for(var C=0;C<D.length;C++){var G=trim(D[C]);if(G=="null"){continue}if(G!=""&&!this.emailValidator.validateEmail(G)){showMessageDialog(D[C],"Invalid Email Address",300,100);return }}this.data.lastEmailString=this.emailValidator.extractEmailAddressList(this.data.lastEmailString)}else{var H=this.data.item;var A=false;if(H!=null){for(var C=0;C<H.length;C++){if(H[C].helperId!=null&&H[C].helperId!=""){A=true;break}}}if(!A){showMessageDialog("Please enter at least one email address to send to.","No Email Addresses",300,100);return }return false}var I=false;for(var C=0;C<E.length;C++){var B=E[C];if(this.data[B]==null||this.data[B]==""||this.data[B]==undefined){I=I}}if(this.data.item==null){I=true}if(I){this.verificationConfirmation();return }if(this.templateType!="SimpleList"){this.data.lastEmailString=F}this.saveMyList("send")},verificationConfirmation:function(){if(this.verificationDialog==null){var A={templateLoaded:function(){this.parent.verificationConfirmationLoad()},parent:this};this.verificationDialog=new Af.HtmlDialog("Missing Fields",A,null);this.verificationDialog.width="320px"}this.verificationDialog.showHTMLTemplate(basePageURL+"verificationMessage.htm","MainArea","cancelConfirmation");this.verificationDialog.centerDialog(350,350)},verificationConfirmationLoad:function(){this.sendAnyway=document.getElementById("sendAnyway");this.sendAnyway.onclick=this.sendWithError.bind(this);this.reCheck=document.getElementById("reCheck");this.reCheck.onclick=this.reCheckError.bind(this)},sendWithError:function(){if(this.verificationDialog!=null){this.verificationDialog.close()}this.saveMyList("send")},reCheckError:function(){if(this.verificationDialog!=null){this.verificationDialog.close()}},updateMyListItemHelper:function(D,F,E){showModalMessageDialog("Processing ... please wait",300,40);var A=this.data.item;var C=null;for(var B=0;B<A.length;B++){if(A[B].UUID==E){C=A[B];break}}if(C==null){hideModalMessageDialog();return false}C.helper=D;C.helperId=F;this.saveMyListItem(C)},saveMyListItem:function(B){req=new Af.DataRequest(svcURL,this.requestMyListItemCompletedCommon.bind(this),this.requestFailedCommon.bind(this),null,this.requestTimedoutCommon.bind(this));req.addService("WorkspaceService","saveMyListItem");req.addParameter("myListUUID",this.data.UUID);var A=this.getXMLFromItem(B);req.xmlDoc=A;ajaxEngine.processRequest(req)},savePublishedTemplate:function(G,F,H,B,C,A,D){showModalMessageDialog("Processing ... please wait",300,40);req=new Af.DataRequest(svcURL,this.requestPublishMyListCompletedCommon.bind(this),this.requestFailedCommon.bind(this),null,this.requestTimedoutCommon.bind(this));req.addService("WorkspaceService","publishMyList");req.addParameter("UUID",H);var E="<message>";E+="<metaTitle>"+xmlEncode(C)+"</metaTitle>";E+="<metaDescription>"+xmlEncode(A)+"</metaDescription>";E+="<metaKeywords>"+xmlEncode(D)+"</metaKeywords>";E+="<title>"+xmlEncode(G)+"</title>";E+="<description>"+xmlEncode(F)+"</description>";E+=B;E+="</message>";req.xmlDoc=E;ajaxEngine.processRequest(req)},saveMyList:function(A,G){this.hideAfterLoad=false;showModalMessageDialog("Processing ... please wait",300,40);var E=this.data;if(G!=null&&G==true){A="save"}else{G=false}E.saveSend=A;var H=this.data.item;var F=this.listFields;var I=null;if(A=="saveCopy"){A="save";E.saveSend="save";I=new Af.DataRequest(svcURL,this.requestMyListSaveCopy.bind(this),this.requestFailedCommon.bind(this),null,this.requestTimedoutCommon.bind(this))}else{if(A=="saveImplicit"){A="save";E.saveSend="save";I=new Af.DataRequest(svcURL,this.requestMyListSaveImplicit.bind(this),this.requestFailedCommon.bind(this),null,this.requestTimedoutCommon.bind(this))}else{if(A=="saveImplicitIcon"){A="save";E.saveSend="save";I=new Af.DataRequest(svcURL,this.uploadIconDialog.requestMyListSaveImplicitIcon.bind(this.uploadIconDialog),this.requestFailedCommon.bind(this),null,this.requestTimedoutCommon.bind(this))}else{if(A=="saveImplicitAttachment"){A="save";E.saveSend="save";I=new Af.DataRequest(svcURL,this.uploadAttachmentDialog.requestMyListSaveImplicitAttachment.bind(this.uploadAttachmentDialog),this.requestFailedCommon.bind(this),null,this.requestTimedoutCommon.bind(this))}else{if(G){E.saveSend="save";I=new Af.DataRequest(svcURL,this.myListPaymentRequestCompleted.bind(this),this.myListPaymentRequestFailed.bind(this),null,this.requestTimedoutCommon.bind(this))}else{I=new Af.DataRequest(svcURL,this.requestMyListCompletedCommon.bind(this),this.requestFailedCommon.bind(this),null,this.requestTimedoutCommon.bind(this))}}}}}var K="<message>";K+="<myListName>"+xmlEncode(E.name)+"</myListName>";K+="<templateType>"+this.templateType+"</templateType>";K+="<saveSend>"+E.saveSend+"</saveSend>";I.addService("WorkspaceService","saveMyList");if(E.UUID!=null){I.addParameter("UUID",E.UUID)}else{if(this.implicitListId!=null){I.addParameter("UUID",this.implicitListId)}else{I.addParameter("UUID","58d67de8:12e50bb53fb:-7ffc")}}this.data.lastEmailString=this.emailValidator.extractEmailAddressList(this.data.lastEmailString);for(var D=0;D<F.length;D++){var C=F[D];if(E[C]!=null&&E[C]!=undefined){K+="<"+C+">"+xmlEncode(E[C])+"</"+C+">"}else{K+="<"+C+"></"+C+">"}}if(H!=null){for(var B=0;B<H.length;B++){var J=H[B];K+=this.getXMLFromItem(J)}}K+="</message>";I.xmlDoc=K;this.saveObj=E;ajaxEngine.processRequest(I)},requestMyListSaveCopy:function(A){hideModalMessageDialog();GATrackAction("successful_copy_"+copyFromList.templateType+"::"+this.saveObj.name+"_published_template");GATrackAction("successful_copy_published_template");app.SIHP.archive.fetchArchive()},requestMyListSaveImplicit:function(A){if(this.saveObj.UUID==null){var D=A.responseText.split(";");this.saveObj.UUID=D[0];if(D.length>1){for(var B=1;B<D.length;B++){var C=D[B];this.data.item[B-1].UUID=D[B]}}}this.implicitListId=this.saveObj.UUID;if(this.uploadResponseIFrame!=null){/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent)?this.uploadResponseIFrame.onload=this.uploadResponse.bindAsEventListener(this):this.uploadResponseIFrame.onreadystatechange=this.uploadIE.bindAsEventListener(this);this.sendFileForm.action="/rose/upload?MyListId="+this.implicitListId;this.sendFileForm.submit()}hideModalMessageDialog()},requestMyListCompletedCommon:function(A){hideModalMessageDialog();if(this.saveObj.UUID==null){var D=A.responseText.split(";");this.saveObj.UUID=D[0];if(D.length>1){for(var B=1;B<D.length;B++){var C=D[B];this.data.item[B-1].UUID=D[B]}}}if(this.saveObj.saveSend=="save"){if(this.saveSilently==undefined||!this.saveSilently){showMessageDialog("You've successfully saved your work!","Saved",300,100)}this.saveSilently=false;if(this.selectedStep==4){this.loadSIHP();return false}if(this.isUpdatedAfterSend){showMessageDialog("This sign-up sheet has been updated. An email has been sent to only those people who's item or time/slot was changed or eliminated","Saved",300,100);app.db.handleHomeTabClick()}return false}else{this.selectedStep=5;GATrackAction("successful_"+this.templateType+"_send");this.loadTemplate()}},requestMyListItemCompletedCommon:function(A){hideModalMessageDialog();return false},requestPublishMyListCompletedCommon:function(A){hideModalMessageDialog();return false},requestFailedCommon:function(A,B){hideModalMessageDialog();hideDialogWin();showMessageDialog("We are currently unable to save this record. Please try again.<br/><br/>Error message: "+B,"Excuse us!",400,150)},requestHelpSaveFailed:function(A,B){hideModalMessageDialog();hideDialogWin();showMessageDialog(B,"Excuse us!",400,150)},requestTimedoutCommon:function(A){hideModalMessageDialog();hideDialogWin();showMessageDialog("We are currently unable to save this record. Please try again.","Excuse us!",400,150)},getRepeatNumber:function(B){var A=0;A=A|(1<<B);return A},doSave:function(A){var E="<HELPResult>";E+='<MyList class="MyList" UUID="'+this.data.UUID+'">';var F=this.data.item;for(var D=0;D<F.length;D++){var J=F[D];E+='<item class="MyListItem" UUID="'+J.UUID+'">';E+='<property name="lastUpdateDate" value="'+J.lastUpdateDate+'" />';var C=J.helper;if(C==null||C=="Drivers Sign Up Here"){C=""}else{C=xmlEncode(C)}E+='<property name="helper" value="'+C+'" />';var G=J.notes;if(G==null||G=="Drivers Write Notes Here"){G=""}else{G=xmlEncode(G)}E+='<property name="notes" value="'+G+'" />';if(C!=""){var H=J.helperEmail;if(H==null||H=="undefined"){H=""}else{H=xmlEncode(H)}E+='<property name="helperEmail" value="'+H+'" />'}else{E+='<property name="helperEmail" value="" />'}var B=J.helperId;if(B==null||B==""||B=="undefined"){B="";if(C!=null&&C!=""){B=this.data.helperEmail;J.helperId=B}}E+='<property name="helperId" value="'+B+'" />';var I=J.helperEventId;if(I==null||I=="undefined"){I=""}else{I=xmlEncode(I)}E+='<property name="helperEventId" value="'+I+'" />';E+="</item>"}E+="</MyList>";E+="<idOfUser>"+this.data.idOfUser+"</idOfUser>";E+="<idOfHelper>"+this.data.helperID+"</idOfHelper>";E+="<helperEmail>"+this.data.helperEmail+"</helperEmail>";E+="</HELPResult>";this.xml=E;this.saveUrl=svcURL;this.saveHelperList(A)},doSaveHelpResult:function(){this.isHelpSaved=true;if(!this.reminder.checked){this.openConfirmDialog()}else{this.doSendReminder()}},openConfirmDialog:function(){if(this.confDialog==null){var A={templateLoaded:function(){this.parent.confirmDialogLoaded()},parent:this};this.confDialog=new Af.HtmlDialog("Thank you for your help!",A,null);this.confDialog.width="300px"}this.confDialog.showHTMLTemplate(basePageURL+"ConfirmDialog.htm","MainArea","confirmHTMLDailog");this.confDialog.centerDialog(350,350)},confirmDialogLoaded:function(){this.messageText=document.getElementById("messageText");this.send=document.getElementById("sendButton");this.dontSend=document.getElementById("dontSendButton");this.send.onclick=this.doSend.bind(this);this.dontSend.onclick=this.doDontSend.bind(this);this.messageText.innerHTML="Would you like to have a reminder of your sign-up emailed to you ?"},doSend:function(){this.confDialog.hide();this.doSendReminder()},doDontSend:function(){this.confDialog.hide();this.saveHelperList()},saveHelperList:function(B){showModalMessageDialog("Processing your request... please wait",300,40);var A=new Af.DataRequest(this.saveUrl,this.requestHelpSaveCompleted.bind(this),this.requestHelpSaveFailed.bind(this),null,this.requestTimedoutCommon.bind(this));A.addService("PublicService","saveHelpResult");if(B==null){A.addParameter("isSendReminder","Yes")}else{A.addParameter("isSendReminder",B)}A.addParameter("helperID",this.data.helperID);A.addParameter("helperEmail",this.data.helperEmail);A.addParameter("listUUID",this.data.UUID);A.xmlDoc=this.xml;ajaxEngine.processRequest(A)},requestHelpSaveCompleted:function(A){GATrackAction("helper_signed_up_for_"+this.templateType);this.listObj.helperID=A.responseText;if(this.data.latestPaymentRequest!=null&&this.helperNextStepButton!=null){this.selectedStep=this.TEMPLATE_STEP_PAYMENT_ATTEMPT}else{this.selectedStep=6}this.loadTemplate()},doOpenHomePage:function(){window.location.href="index.htm"},reminderDialog:function(){if(this.rmndrDialog==null){var A={templateLoaded:function(){this.parent.confirmRMNDRDialogLoaded()},parent:this};this.rmndrDialog=new Af.HtmlDialog("Request",A,null);this.rmndrDialog.width="350px"}this.rmndrDialog.showHTMLTemplate(basePageURL+"SignUpRmdrDialog.htm","MainArea","confirmHTMLDailog");this.rmndrDialog.centerDialog(350,350)},confirmRMNDRDialogLoaded:function(){this.messageText=document.getElementById("messageText");this.noSignUp=document.getElementById("noSignUp");this.returnToSignUp=document.getElementById("returnToSignUp");this.noSignUp.onclick=this.noSignUpNow.bind(this);this.returnToSignUp.onclick=this.returnToSignUpNow.bind(this)},noSignUpNow:function(){this.rmndrDialog.hide();this.doOpenHomePage()},returnToSignUpNow:function(){this.rmndrDialog.hide()},continueAfterLoginOrRegistration:function(){showModalMessageDialog("Processing your request... please wait",300,40);this.exitStep=this.selectedStep;this.selectedStep=1;this.loadTemplate()},loadSavedStep:function(A){this.selectedStep=A;this.loadTemplate()},onTimeout:function(){this.timerSet=false},showMiniCal:function(A){var B=A.target?A.target:A.srcElement;var C=B.parentNode;if(this.miniCalendar!=null){return false}this.timerSet=true;setTimeout(this.onTimeout.bind(this),10);this.littleBox=document.createElement("span");this.littleBox.id="miniCalBox";this.littleBox.className="miniCalList";this.mouseClickInMiniCalendar=false;this.littleBox.onclick=this.ignoreClick.bind(this);document.onclick=this.removeMiniCal.bind(this);this.littleBox.innerHTML=this.miniTableElement;C.appendChild(this.littleBox);this.miniClose=document.getElementById("miniClose");this.miniClose.onclick=this.removeMiniCal.bind(this);this.miniCalendar=new HJ.MiniCalendar(true);this.miniCalendar.listener=this;this.miniCalendar.render(this.sc,this.date);this.selectedInput=C.getElementsByTagName("input")[0];this.selectedInput.disabled="disabled";this.selectedDateDiv=C;this.selectedInput.onclick=this.removeMiniCal.bindAsEventListener(this);this.disabledInput=this.selectedInput;return false},selectHelper:function(A){if(login==null){if(this.selectedStep==2){showMessageDialog("To use this feature, you must be logged in first","Not Logged In",250,100,this.goToSignInWithoutDialog.bind(this));this.selectHelperDisplayed=true;return false}return false}if(this.selectHelperDisplayed||app==null||login==null){return false}this.selectHelperDisplayed=true;this.targetHelperElement=A.target?A.target:A.srcElement;this.timerSet=true;setTimeout(this.onTimeout.bind(this),10);this.selectHelperObj=new HJ.SelectHelper(this);this.selectHelperObj.loadTemplate();return false},goToSignInWithoutDialog:function(A){hideDialogWin();hideModalMessageDialog();login=new HJ.Login(this,"true",false);login.startStep1()},modifyHelper:function(K,J,N,E){this.targetHelperElement.value=N;var I=this.targetHelperElement.parentNode;var C=I.nextSibling;var M=null;var D=null;var B=-1;var F=I.parentNode;var G=F.getAttribute("id");var H=G.match(/^(signupDiv|item)_/);if(H!=""&&H!="undefined"&&H!=null){var A=parseInt(G.replace(/^(signupDiv|item)_/,""));if(A!=null&&A>=0){B=A;var L=this.data.item[B];L.helperEmail=E;L.helper=N,L.helperId=J}}while(C!=null){if(C.className=="helperId"){D=C.childNodes[0];D.value=J}if(C.className=="listItemUUID"){M=C.childNodes[0].value}C=C.nextSibling}if(this.templateType!=HJ.TEMPLATE_TYPE_COLLECT_INFORMATION){if(this.data.saveSend=="send"&&this.selectedStep==4){this.updateMyListItemHelper(N,D.value,M)}}},publishTemplate:function(B,G,F,H,C,D,A,E){this.savePublishedTemplate(G,F,H,C,D,A,E)},closeSelectHelperDialog:function(){this.selectHelperDisplayed=false;return false},closePublishMyListDialog:function(){this.publishMyListDisplayed=false;return false},ignoreClick:function(A){return false},removeMiniCal:function(A){if(this.timerSet){return false}document.onclick=null;this.dateDisabledOff();var B=document.getElementById("miniCalBox");if(B!=null){B.parentNode.removeChild(B)}this.miniCalendar=null;return false},dateDisabledOff:function(){if(this.disabledInput!=null){this.disabledInput.disabled=false}},dateClicked:function(B,A){this.dateDisabledOff();this.showDate(A);return this.removeMiniCal()},showDate:function(B){var C=this.currentRow;var A=(B.getMonth()+1)+"/"+B.getDate()+"/"+B.getFullYear();this.selectedInput.value=A},showToolTip:function(A){var B=A.target?A.target:A.srcElement;var D=B.id;var C=this.toolTipTexts[D];javascript:Tip(C,SHADOW,true,TITLE,"",PADDING,9,FONTSIZE,"8pt",SHADOWCOLOR,"#dd99aa",BGCOLOR,"#FF9A47",BORDERCOLOR,"#fff",WIDTH,200,TITLEBGCOLOR,"#ADD57C");return },eraseDefaultField:function(A){Event.element(A).className="dark"},processSignupNameFieldKeyPress:function(B){Event.extend(B);if(B.keyCode==Event.KEY_RETURN){var A=document.getElementById("item0");if(A==null){this.addItem()}Event.stop(B)}},processItemFieldKeyPress:function(A){Event.extend(A);if(A.keyCode==Event.KEY_RETURN){this.processAddItemEvent(A);Event.stop(A)}},processAddItemEvent:function(D){Event.extend(D);var F=null;var E=D.target?D.target:D.srcElement;if(E!=null){var C=this.getItemDivAncestor(E);if(C!=null){F=parseInt(C.id.substring(5));this.saveHoldData();var A=this.data.item;for(var B=A.length;B>F;B--){A[B]=A[B-1]}this.data.item[B+1]=new Object();this.addItem(null,(F+1));return false}}return false},addItemElementToDisplay:function(E,B){var D=document.getElementById("item_"+B);if(this.listContainer.childNodes.length>0){var A=this.listContainer.childNodes.length;for(var C=A-1;C>=B;C--){var F=document.getElementById("item_"+C);F.id="item_"+(C+1)}}this.listContainer.insertBefore(E,D)},deleteItem:function(A){var F=A.target?A.target:A.srcElement;var C=this.getItemDivAncestor(F);var B=C.id.match(/[\d\.]+/g)[0];this.listContainer.removeChild(C);for(var D=parseInt(B)+1;D<this.itemCount;D++){var E=document.getElementById("item_"+D);E.id="item_"+(D-1)}this.itemCount--;this.itemCount==0?this.addItem("first"):null;return false},getItemDivAncestor:function(A){if(A!=null){if(A.id.indexOf("item_")==0){return A}else{return this.getItemDivAncestor(A.parentNode)}}return null},shiftFocusToTextChild:function(B){var C=B.getElementsByTagName("input");if(C!=null&&C.length>0){for(var A=0;A<C.length;A++){if(C[A].getAttribute("type")=="text"){C[A].focus();break}}}},setCurrentStepInYUIHistoryMgr:function(C,D){try{var B="template"+C;if(app){app.setCurrentTabInYUIHistoryMgr(B,true)}}catch(A){}},timeChanged:function(D,C,A){if(D==this.fromTime){var C=parseInt(C);var A=parseInt(A);var B=parseInt(this.toTime.getValue());var B=C+(B-A);if(B>=1440){B=B-1440}else{if(B<0){B=1440+B}}}},getXMLFromItem:function(C){if(C==null){return"<item> <uuid> </uuid> </item>"}var B="";B+="<item>";if(C.UUID!=null&&C.UUID!=""&&C.UUID!=undefined){B+="<uuid>"+C.UUID+"</uuid>"}else{B+="<uuid> </uuid>"}if(C.helperId==null||C.helperId==""){C.helper="";C.helperEmail=""}for(var A=0;A<this.listItemFields.length;A++){var D=this.listItemFields[A];B+="<"+D+">"+xmlEncode(C[D])+"</"+D+">"}B+="</item>";return B},displayAskMoreHelpersDialog:function(){var A=new HJ.AskMoreHelpersDialog(this);A.loadTemplate();return false},displayContactVolunteersDialog:function(){var A=new HJ.ContactVolunteersDialog(this);A.setMyListUUID(this.data.UUID);A.setMyItems(this.data.item);A.setItemHeader(this.data.col1Name,this.data.col2Name);A.setEventName(this.data.name);A.loadTemplate();return false},displayPublicLink:function(){var A=new HJ.PublicLinkDialog(this);A.setMyListUUID(this.data.UUID);A.loadTemplate();return false},addAttachment:function(C,B){if(B==null){C=null;if(this.data.attach!=null){B=this.data.attach.length}else{B=0}}var A=document.createElement("div");A.innerHTML=this.attachDiv;A.className="attachCont";A.id="attach"+B;var D=A.getElementsByTagName("input");var E=A.getElementsByTagName("a")[0];if(C!=null){D[0].value=C.attachItem}return false},addAttachmentBlockClicked:function(A){if((this.listObj==null||this.listObj.UUID==null)&&this.implicitListId==null){if(this.data.name==null){this.data.name=""}}this.addAttachmentBlock.style.display="none";this.attachmentUploadBlock=document.getElementById("attachmentUploadBlock");this.attachmentUploadBlock.style.display="block";return false},uploadIE:function(A){if(this.uploadResponseIFrame.readyState=="complete"){this.uploadResponse(A)}return false},sendFileClicked:function(A){if(this.listObj==null||this.listObj.UUID==null){this.saveMyList("saveImplicit")}else{this.uploadResponseIFrame.onload=this.uploadResponse.bindAsEventListener(this);this.sendFileForm.action="/rose/upload?MyListId="+this.listObj.UUID;this.sendFileForm.submit()}return false},uploadResponse:function(B){this.uploadResponseIFrame.contentDocument?this.lastServerAttachmentResponse=this.uploadResponseIFrame.contentDocument.documentElement.innerHTML:this.lastServerAttachmentResponse=this.uploadResponseIFrame.contentWindow.document.documentElement.innerHTML;this.addAttachmentBlock.style.display="none";this.attachmentUploadBlock.style.display="none";this.attachmentListContainer=document.getElementById("attachmentListItems");this.attachmentListContainer.style.display="block";var A=null;if(this.listObj!=null){A=this.listObj.UUID}else{if(this.implicitListId!=null){A=this.implicitListId}else{if(this.implicitIconListId!=null){A=this.implicitIconListId}}}this.attachments=new HJ.Attachments(this.attachmentListContainer,null,this.ATTACHMENT_ROWS,A,this.addAttachmentBlock);this.attachments.fetchAttachments(true);this.uploadResponseIFrame.onload=null;return consumeEvent(B)},deleteAttachment:function(A){var D=A.target?A.target:A.srcElement;var C=D.parentNode.id.substr(D.id.length-1);var B=documentElementById("attach"+C);this.attachmentListContainer.removeChild(B);this.attachmentListContainer.style.display="none";this.addAttachmentBlock.style.display="block";this.attachmentUploadBlock.style.display="block"},calculatePaymentFees:function(H){var F=this.suggestedAmountElem.value;var G=0;try{G=parseFloat(F)}catch(D){document.getElementById("particpantAmountErrorText").innerHTML="Invalid Amount";return false}var A=document.getElementById("processingFeesSpan");var C=document.getElementById("organizerAmountReceived");document.getElementById("organizerAmountErrorText").innerHTML="";if(isNaN(G)||G==0){document.getElementById("particpantAmountErrorText").innerHTML="Invalid Amount";A.innerHTML="0.00";C.value="0.00";return false}var B=9.96;var I=9.99;if(G>=B&&G<=I){document.getElementById("particpantAmountErrorText").innerHTML="Values between "+B+" and "+I+" are not accepted";A.innerHTML="0.00";C.value="0.00";return false}if(G<this.minFee){document.getElementById("particpantAmountErrorText").innerHTML="Values must be $"+this.minFee.toFixed(2)+" or more";A.innerHTML="0.00";C.value="0.00";return false}document.getElementById("particpantAmountErrorText").innerHTML="";G=Math.round(G*100)/100;var E=this.getRecievedValue(G);A.innerHTML=(G-E).toFixed(2);C.value=E.toFixed(2);return false},calculateRequiredPayment:function(I){var C=document.getElementById("organizerAmountReceived");var H=this.organizerAmountElem.value;var F=0;try{F=parseFloat(H)}catch(G){document.getElementById("organizerAmountErrorText").innerHTML="Invalid Amount";return false}var E=document.getElementById("suggestedAmount");var A=document.getElementById("processingFeesSpan");document.getElementById("particpantAmountErrorText").innerHTML="";if(isNaN(F)||F==0){document.getElementById("organizerAmountErrorText").innerHTML="Invalid Amount";A.innerHTML="0.00";E.value="0.00";return false}document.getElementById("organizerAmountErrorText").innerHTML="";F=Math.round(F*100)/100;var B=this.getApproximateCollectedValue(F);B+=0.02;B=Math.ceil(B*100)/100;var D=this.getRecievedValue(B);while(F<D){B-=0.01;B=Math.round(B*100)/100;D=this.getRecievedValue(B)}if(F>D){B+=0.01;B=Math.round(B*100)/100}if(B<this.minFee){document.getElementById("organizerAmountErrorText").innerHTML="Values must be greater than $"+this.minFee.toFixed(2);A.innerHTML="0.00";E.value="0.00";return false}E.value=B.toFixed(2);A.innerHTML=(B-F).toFixed(2);return false},getRecievedValue:function(C,E){var B=0;var D=0;var E=(typeof (E)!="undefined")?E:false;if(C>=10){B=(C*2.9/100)+0.3}else{B=(C*5/100)+0.05}D=(C*this.maxVariableFee/100)+this.maxFixedFee;B=Math.round(B*100)/100;D=Math.round(D*100)/100;var A=C-B-D;A=Math.round(A*100)/100;if(!E){var F=this.getRecievedValue(Math.round((C+0.01)*100)/100,true);if(F==A){A-=0.01;A=Math.round(A*100)/100}}return(A)},getApproximateCollectedValue:function(D){var B=this.maxVariableFee/100;var A=this.maxFixedFee;var E=this.getRecievedValue(10);var G=0;var F=0;if(E<=D){G=2.9/100;F=0.3}else{G=5/100;F=0.05}var C=(D+F+A)/(1-G-B);return(Math.floor(C*100)/100)},setFixedWidthOnAmount:function(A){var F=document.getElementById("organizerAmountReceived");var D=document.getElementById("suggestedAmount");var C=0;var B=0;try{C=parseFloat(F.value);B=parseFloat(D.value)}catch(E){}if(!isNaN(C)){F.value=C.toFixed(2)}if(!isNaN(B)){D.value=B.toFixed(2)}},makePaymentsVisible:function(A){var B=document.getElementById("myform");var C=document.getElementById("collectPayment");document.getElementById("skipPayment").checked=false;if(B.style.visibility==""){this.data.suggestedAmount=document.getElementById("suggestedAmount").value;this.data.helperCanModifyAmount=document.getElementById("participantCanModifyAmount").checked;this.data.showFeesToHelper=document.getElementById("showFeesToParticipant").checked;B.style.visibility="hidden"}else{if(typeof (this.data.suggestedAmount)!="undefined"){document.getElementById("suggestedAmount").value=this.data.suggestedAmount}if(typeof (this.data.participantCanModifyAmount)!="undefined"){document.getElementById("participantCanModifyAmount").checked=this.data.helperCanModifyAmount}if(typeof (this.data.showFeesToParticipant)!="undefined"){document.getElementById("showFeesToParticipant").checked=this.data.showFeesToHelper}this.calculatePaymentFees();B.style.visibility=""}},skipPaymentSetup:function(A){document.getElementById("myform").style.visibility="hidden";document.getElementById("collectPayment").checked=false;this.data.collectPayments=false;document.getElementById("skipPayment").checked=true;this.goNext();return true},processPaymentRequest:function(D){var H=document.getElementById("collectPayment").checked;var E=this.suggestedAmountElem.value;var G=this.helperCanModifyAmountElem.checked;var B=this.showFeesToHelperElem.checked;var A=0;this.setFixedWidthOnAmount();try{A=parseFloat(E)}catch(C){showMessageDialog('"'+E+'" is not a valid amount. Please correct.',"Invalid Participant Amount",300,100);return }if(isNaN(A)){showMessageDialog('"'+E+'" is not a valid amount. Please correct.',"Invalid Participant Amount",300,100);return }if(A<this.minFee){showMessageDialog('"'+E+'" is not a valid amount. Please correct.',"Invalid Participant Amount",300,100);return }var F=this.data.latestPaymentRequest;if(F!=null){F=F[0];if(F!=null&&F.requestedAmount==toString(A)&&F.payerCanChangeAmount==toString(G)&&F.payerSeesFees==toString(B)){this.selectedStep=this.nextStep;this.loadTemplate();return }}this.data.collectPayments=H;this.data.suggestedAmount=A;this.data.helperCanModifyAmount=G;this.data.showFeesToHelper=B;this.data.nextStep=this.nextStep;if(D){this.data.nextStep=this.TEMPLATE_STEP_PAYMENT_REQUEST;this.saveMyList("save",true)}},myListPaymentRequestCompleted:function(C){hideModalMessageDialog();var A=new Array();A=C.responseText.split(";;");var D=this.valueOf(A,"error");var B=this.valueOf(A,"MyList.UUID");if(this.data.UUID==null){this.data.UUID=B}if(D!=null){if(D=="UninitializedAmazonPaymentRecipient"||D=="ExpiredAmazonPaymentRecipient"){this.maxVariableFee=this.valueOf(A,"maxVariableFee");this.maxFixedFee=this.valueOf(A,"maxFixedFee");this.callerAccountId=this.valueOf(A,"callerAccountId");this.recipientPaysFee=this.valueOf(A,"recipientPaysFee");this.collectEmailAddress=this.valueOf(A,"collectEmailAddress");this.callerReference=this.valueOf(A,"callerReference");this.callerKey=this.valueOf(A,"callerKey");this.pipelineName=this.valueOf(A,"pipelineName");this.returnURL=this.valueOf(A,"returnURL");this.awsSignature=this.valueOf(A,"awsSignature");this.version=this.valueOf(A,"version");this.signatureVersion=this.valueOf(A,"signatureVersion");this.signatureMethod=this.valueOf(A,"signatureMethod");this.signature=this.valueOf(A,"signature");this.paymentUrl=this.valueOf(A,"paymentUrl");this.selectedStep=this.TEMPLATE_STEP_PAYMENT_REQUEST_THROUGH_AMAZON}}else{this.selectedStep=this.nextStep}this.loadTemplate()},valueOf:function(B,D){if(B==null){return null}var C;for(i=0;i<B.length;i++){C=B[i];if(C.indexOf(D)==0){var A=C.indexOf("=");if(C.substring(0,A)==D){return C.substring(A+1)}}}return null},myListPaymentRequestFailed:function(){hideModalMessageDialog()},calculateTotalPaymentForHelper:function(I){Event.extend(I);var F=this.paymentQtyAmountElem.value;var A=document.getElementById("paymentQtyErrorSpan");var G=document.getElementById("unitPaymentAmountErrorSpan");var B=document.getElementById("totalPaymentAmount");var K=document.getElementById("processingFeeAmount");this.paymentQty=0;try{this.paymentQty=parseInt(F)}catch(E){A.innerHTML="Invalid Quantity";B.innerHTML="0.00";K.innerHTML="0.00";return false}if(isNaN(this.paymentQty)||this.paymentQty<=0){A.innerHTML="Invalid Quantity";B.innerHTML="0.00";K.innerHTML="0.00";return false}A.innerHTML="";var H=this.unitPaymentAmountElem.value;this.unitPayment=1;try{this.unitPayment=parseFloat(H)}catch(E){G.innerHTML="Invalid Amount";B.innerHTML="0.00";K.innerHTML="0.00";return false}if(isNaN(this.unitPayment)||this.unitPayment<this.minFee){if(!isNaN(this.unitPayment)){G.innerHTML="Amount must be $"+this.minFee.toFixed(2)+" or more"}else{G.innerHTML="Invalid Amount"}B.innerHTML="0.00";K.innerHTML="0.00";return false}var D=Math.round(this.unitPayment*this.paymentQty*100)/100;var J=this.getRecievedValue(D);var C=D-J;G.innerHTML="";K.innerHTML=C.toFixed(2);B.innerHTML=D.toFixed(2);return true},prepareToPayAtAmazon:function(){if(!this.calculateTotalPaymentForHelper()){showMessageDialog("Please fix the payment amount before proceeding","Invalid Amount",250,100,null,true);return false}if(!this.emailValidator.validateEmail(this.helperEmailElem.value)){showMessageDialog(helperEmailVal,"Invalid Payer Email Address",300,100);return false}var B=this.data.helperPaidAmount;if(B!=null){try{B=parseFloat(B);if(!isNaN(B)&&B!=0){if(this.previousPaymentWarningDialog==null){var A={templateLoaded:function(){this.parent.handlePreviousPaymentWarningLoad()},parent:this};this.previousPaymentWarningDialog=new Af.HtmlDialog("Sure you want to pay?",A,null);this.previousPaymentWarningDialog.width="320px"}this.previousPaymentWarningDialog.showHTMLTemplate(basePageURL+"previousPaymentWarningDialog.htm","bodyContainer","warningDiv");this.previousPaymentWarningDialog.centerDialog(350,350);return false}}catch(C){}}this.doProceedToPayAtAmazon();return false},doProceedToPayAtAmazon:function(){var A=this.data.latestPaymentRequest[0];req=new Af.DataRequest(svcURL,this.myListPrepareToPayAtAmazonCompleted.bind(this),this.myListPrepareToPayAtAmazonFailed.bind(this),null,this.requestTimedoutCommon.bind(this));req.addService("PublicService","prepareToPayAtAmazon");req.addParameter("paymentRequestId",A.UUID);req.addParameter("unitPayment",this.unitPayment);req.addParameter("paymentQty",this.paymentQty);req.addParameter("payerEmail",this.emailValidator.extractEmailAddress(this.helperEmailElem.value));ajaxEngine.processRequest(req)},handlePreviousPaymentWarningLoad:function(){var A=document.getElementById("Pay");A.onclick=this.doProceedToPayAtAmazon.bind(this);var B=document.getElementById("DontPay");B.onclick=this.skipPayment.bind(this)},myListPrepareToPayAtAmazonCompleted:function(B){var A=new Array();A=B.responseText.split(";;");var C=this.valueOf(A,"error");this.variableMarketplaceFee=this.valueOf(A,"variableMarketplaceFee");this.fixedMarketplaceFee=this.valueOf(A,"fixedMarketplaceFee");this.immediateReturn=this.valueOf(A,"immediateReturn");this.collectShippingAddress=this.valueOf(A,"collectShippingAddress");this.accessKey=this.valueOf(A,"accessKey");this.referenceId=this.valueOf(A,"referenceId");this.recipientEmail=this.valueOf(A,"recipientEmail");this.amount=this.valueOf(A,"amount");this.signature=this.valueOf(A,"signature");this.isDonationWidget=this.valueOf(A,"isDonationWidget");this.description=this.valueOf(A,"description");this.amazonPaymentsAccountId=this.valueOf(A,"amazonPaymentsAccountId");this.ipnUrl=this.valueOf(A,"ipnUrl");this.returnUrl=this.valueOf(A,"returnUrl");this.processImmediate=this.valueOf(A,"processImmediate");this.cobrandingStyle=this.valueOf(A,"cobrandingStyle");this.abandonUrl=this.valueOf(A,"abandonUrl");this.signatureVersion=this.valueOf(A,"signatureVersion");this.signatureMethod=this.valueOf(A,"signatureMethod");this.paymentUrl=this.valueOf(A,"paymentUrl");this.loadPaymentAttemptThroughAmazonStep();document.amazonPayForm.submit()},myListPrepareToPayAtAmazonFailed:function(){},skipPayment:function(){this.selectedStep=6;this.loadTemplate()},initializeSelectedStepFromQueryString:function(){if(!usedNextStepFromQueryString){usedNextStepFromQueryString=true;this.selectedStep=HJ.requestQueryString.get("nextStep",null)}if(this.selectedStep==null){this.selectedStep=1;this.selectedStepInitialized=false}else{this.selectedStepInitialized=true}},copyToClipboard:function(A){HJ.copyToClipboard(document.getElementById("publishableURL"));Event.extend(A);Event.stop(A)},showPublishableURLHelpDialog:function(A){showMessageDialog("You can imbed the link (URL, web address) of this sign-up sheet in other electronic media (eNews, website, etc.) so people can sign-up by clicking on the link there.<br /><br />You can send the sign-up sheet to both emails and/or use the link in other electronic media. All participants will be taken to the same active sign-up page.","What to do with a link to your sign-up page?",380,175,null,true);Event.extend(A);Event.stop(A)},showPublishableURL:function(A){var B=document.getElementById("publishableURL");if(B!=null){B.value=window.location.protocol+"//"+window.location.host+"/guest?t=help&p=none&l="+A}},printPlanner:function(){var A=window.open("/planner/print?uuid="+this.data.UUID,"_print","toolbar=no, location=no, directories=no, status=no, menubar=yes, scrollbars=yes, resizable=yes, copyhistory=no, width=700, height=800");return false},processDoneInStep4:function(){this.saveSilently=true;this.goUpdateAfterSend()},showCopySelection:function(){var A=new HJ.CopyTemplateDialog(this);A.loadTemplate();return false},showUploadIconDialog:function(A){showModalMessageDialog("Loading ... please wait",300,40);this.uploadIconDialog=new HJ.UploadIconDialog(this);this.uploadIconDialog.loadTemplate();return false},loadListIcon:function(C){var D=new Date().getTime();var B=null;if(C){B=C}else{if(this.listObj!=null&&this.listObj.useIcon=="true"){B=this.listObj.UUID}}var A=document.getElementById("listIcon");if(A){if(B){this.origIcon=A.src;A.src="/rose/loadIcon?listId="+B+"&t="+D}A.style.display="inline"}},showConfirmEmailDialog:function(){var D=document.createElement("table");D.setAttribute("width","100%");D.style.width="100%";D.className="emailDialog";var A=document.createElement("tbody");D.appendChild(A);var E=document.createElement("tr");A.appendChild(E);var F=document.createElement("td");F.setAttribute("colspan","3");F.innerHTML="&nbsp;";E.appendChild(F);var E=document.createElement("tr");A.appendChild(E);var F=document.createElement("td");F.setAttribute("colspan","3");E.appendChild(F);F.innerHTML="<center>Your reminder will be sent to <br/>"+this.data.helperEmail+".</center>";E=document.createElement("tr");A.appendChild(E);F=document.createElement("td");F.setAttribute("colspan","3");F.innerHTML="&nbsp;";E.appendChild(F);E=document.createElement("tr");A.appendChild(E);F=document.createElement("td");F.style.textAlign="center";E.appendChild(F);a=document.createElement("a");a.className="normalOrangeBtn";a.href="#";a.style.display="block";a.style.width="200px";a.style.margin="5px auto";span=document.createElement("span");span.innerHTML="Confirm sign-up";a.appendChild(span);F.appendChild(a);a.onclick=function(){this.confirmEmailDialog.close();this.emailAddrWarningShown=true;this.goRSVP();return false}.bind(this);E=document.createElement("tr");A.appendChild(E);F=document.createElement("td");F.setAttribute("colspan","3");F.setAttribute("align","center");F.style.textAlign="center";F.innerHTML='<span style="padding: 5px;">or</span>';E.appendChild(F);E=document.createElement("tr");A.appendChild(E);F=document.createElement("td");F.style.textAlign="center";E.appendChild(F);a=document.createElement("a");a.className="normalOrangeBtn";a.href="#";a.style.display="block";a.style.width="200px";a.style.margin="5px auto";span=document.createElement("span");span.innerHTML="Change contact email";a.appendChild(span);F.appendChild(a);F=document.createElement("td");F.style.textAligned="center";E.appendChild(F);a.onclick=function(){this.confirmEmailDialog.close();this.showEnterEmailAgain();return false}.bind(this);E=document.createElement("tr");A.appendChild(E);F=document.createElement("td");F.setAttribute("colspan","3");F.innerHTML="&nbsp;";E.appendChild(F);if(this.confirmEmailDialog&&this.confirmEmailDialog.element){p=this.confirmEmailDialog.element.parentNode;if(p){p.removeChild(this.confirmEmailDialog.element);this.confirmEmailDialog=null}}this.confirmEmailDialog=new Af.HtmlDialog("Please confirm",null,D);this.confirmEmailDialog.createElement();this.confirmEmailDialog.container="helperEmailDiv";this.confirmEmailDialog.centerDialog(300,300);var C=this.confirmEmailDialog.element;C.style.width="300px";D=C.firstChild;D.style.width="100%";this.confirmEmailDialog.makeVisible();window.scrollTo(0,0);var B=document.getElementById("helperEmailDiv");this.confirmEmailDialog.element.style.left=(B.offsetLeft+50)+"px";this.confirmEmailDialog.element.style.top=(B.offsetTop+50)+"px";return false},showEmptyEmailMessage:function(){var C=document.createElement("table");C.width="100%";C.className="emailDialog";var A=document.createElement("tbody");C.appendChild(A);var D=document.createElement("tr");A.appendChild(D);var E=document.createElement("td");E.setAttribute("colspan","3");E.innerHTML="&nbsp;";D.appendChild(E);var D=document.createElement("tr");A.appendChild(D);var E=document.createElement("td");E.setAttribute("colspan","3");D.appendChild(E);E.innerHTML='<center>Please enter your email in the email<br/>address box <span style="color: red;">and click the Sign-Up button again</span>. This is required so that Jooners can send you a reminder email.</center>';D=document.createElement("tr");A.appendChild(D);E=document.createElement("td");E.setAttribute("colspan","3");E.innerHTML="&nbsp;";D.appendChild(E);D=document.createElement("tr");A.appendChild(D);E=document.createElement("td");E.style.textAlign="center";D.appendChild(E);a=document.createElement("a");a.className="normalOrangeBtn";a.href="#";a.style.display="block";a.style.width="100px";a.style.margin="5px auto";span=document.createElement("span");span.innerHTML="OK";a.appendChild(span);E.appendChild(a);D=document.createElement("tr");A.appendChild(D);E=document.createElement("td");E.setAttribute("colspan","3");E.innerHTML="&nbsp;";D.appendChild(E);if(this.emptyEmailDialog=="undefined"||this.emptyEmailDialog==null){this.emptyEmailDialog=new Af.HtmlDialog("Error",null,C);this.emptyEmailDialog.container="helperEmailDiv";this.emptyEmailDialog.width="300px";this.emptyEmailDialog.centerDialog(300,150)}a.onclick=function(){this.emptyEmailDialog.close();return false}.bind(this);var B=document.getElementById("helperEmail");B.focus();window.scrollTo(0,0);this.emptyEmailDialog.makeVisible("helperEmailDiv");this.emptyEmailDialog.element.style.left=B.offsetLeft+"px";this.emptyEmailDialog.element.style.top=(B.offsetTop+90)+"px";return false},showUploadAttachmentDialog:function(){showModalMessageDialog("Loading ... please wait",300,40);this.uploadAttachmentDialog=new HJ.UploadAttachmentDialog(this);this.uploadAttachmentDialog.loadTemplate();return false},loadListAttachment:function(B){var C=new Date().getTime();var A=null;if(B){A=B}else{if(this.listObj!=null){A=this.listObj.UUID}else{if(this.implicitAttachmentListId){A=this.implicitAttachmentListId}}}this.attachmentListElem=document.getElementById("attachmentList");if(!this.attachmentListElem){return }this.addLink=document.getElementById("addAttachLink");if(this.addLink!=null){this.addLink.onclick=this.showUploadAttachmentDialog.bindAsEventListener(this)}if(A==null){this.addLink.style.display="block";return }if(this.attachmentListContainer!=null){this.attachments=new HJ.Attachments(this.attachmentListElem,null,this.ATTACHMENT_ROWS,A,null);this.attachments.fetchAttachments(this.selectedStep!=4)}},showEnterEmailAgain:function(){var D=document.createElement("table");D.width="100%";D.className="emailDialog";var B=document.createElement("tbody");D.appendChild(B);var E=document.createElement("tr");B.appendChild(E);var F=document.createElement("td");F.setAttribute("colspan","3");F.innerHTML="&nbsp;";E.appendChild(F);var E=document.createElement("tr");B.appendChild(E);var F=document.createElement("td");F.setAttribute("colspan","3");E.appendChild(F);F.innerHTML="<center>Please enter the email you wish to use in the email address box and click the Sign-Up button again.</center>";E=document.createElement("tr");B.appendChild(E);F=document.createElement("td");F.setAttribute("colspan","3");F.innerHTML="&nbsp;";E.appendChild(F);E=document.createElement("tr");B.appendChild(E);F=document.createElement("td");F.style.textAlign="center";E.appendChild(F);a=document.createElement("a");a.className="normalOrangeBtn";a.href="#";a.style.display="block";a.style.width="100px";a.style.margin="5px auto";span=document.createElement("span");span.innerHTML="OK";a.appendChild(span);F.appendChild(a);E=document.createElement("tr");B.appendChild(E);F=document.createElement("td");F.setAttribute("colspan","3");F.innerHTML="&nbsp;";E.appendChild(F);if(this.enterEmailAgainDialog=="undefined"||this.enterEmailAgainDialog==null){this.enterEmailAgainDialog=new Af.HtmlDialog("Error",null,D);this.enterEmailAgainDialog.container="helperEmailDiv";this.enterEmailAgainDialog.width="300px";this.enterEmailAgainDialog.centerDialog(300,150)}this.enterEmailAgainDialog.makeVisible("helperEmailDiv");a.onclick=function(){this.enterEmailAgainDialog.close();return false}.bind(this);var C=document.getElementById("helperEmail");var A=document.getElementsByTagName("a");C.focus();C.select();this.enterEmailAgainDialog.element.style.left=(C.offsetLeft+50)+"px";this.enterEmailAgainDialog.element.style.top=(C.offsetTop+80)+"px";return false},showEnterEmailAgainDialog:function(){var I=document.createElement("table");I.width="100%";I.className="emailDialog";var D=document.createElement("tbody");I.appendChild(D);var F=document.createElement("tr");D.appendChild(F);var A=document.createElement("td");A.setAttribute("colspan","3");A.innerHTML="&nbsp;";F.appendChild(A);var F=document.createElement("tr");D.appendChild(F);var A=document.createElement("td");A.setAttribute("colspan","3");F.appendChild(A);if(this.templateType==HJ.TEMPLATE_TYPE_COLLECT_INFORMATION){A.innerHTML="<center>Please enter your name and any other required information and click on the Sign-Up button again.</center>"}else{A.innerHTML="<center>Please enter your name next to the item you want to sign up for and click the Sign-Up button again.</center>"}F=document.createElement("tr");D.appendChild(F);A=document.createElement("td");A.setAttribute("colspan","3");A.innerHTML="&nbsp;";F.appendChild(A);F=document.createElement("tr");D.appendChild(F);A=document.createElement("td");A.style.textAlign="center";F.appendChild(A);a=document.createElement("a");a.className="normalOrangeBtn";a.href="#";a.style.display="block";a.style.width="100px";a.style.margin="5px auto";span=document.createElement("span");span.innerHTML="OK";a.appendChild(span);A.appendChild(a);F=document.createElement("tr");D.appendChild(F);A=document.createElement("td");A.setAttribute("colspan","3");A.innerHTML="&nbsp;";F.appendChild(A);var E=document.getElementById("listItems");var H=E.getElementsByTagName("input");for(var C=0;C<H.length;C++){var B=H[C];if(B.disabled==false&&B.type=="text"){B.focus();break}}if(E){var G=E.offsetTop;if(G>10){window.scrollTo(0,G-10)}}if(this.enterNameDialog=="undefined"||this.enterNameDialog==null){this.enterNameDialog=new Af.HtmlDialog("Error",null,I);this.enterNameDialog.container="helperEmailDiv";this.enterNameDialog.width="300px";this.enterNameDialog.centerDialog(300,150)}a.onclick=function(){this.enterNameDialog.close();return false}.bind(this);this.enterNameDialog.element.style.left=E.offsetLeft+"px";this.enterNameDialog.element.style.top=E.offsetTop+"px";this.enterNameDialog.makeVisible(E);return false}};Af.HtmlMultiSelect=Class.create();Af.HtmlMultiSelect.prototype={initialize:function(B,A){this.selectId=B;this.attrName=A;this.selectElement=document.getElementById(this.selectId);this.dlist=null},setDataList:function(A){this.dlist=A;if(this.dlist==null){this.dlist=new Array()}this.selectElement.options.length=0;for(var B=0;B<this.dlist.length;B++){var C=this.dlist[B];var D=document.createElement("option");D.value=""+B;D.label=C[this.attrName];D.appendChild(document.createTextNode(D.label));this.selectElement.appendChild(D)}},getSelectedObjs:function(){var A=new Array();if(this.dlist==null){return A}for(var B=0;B<this.selectElement.options.length;B++){var C=this.selectElement.options[B];if(C.selected){A.push(this.dlist[B])}}return A}};var COLOR_PICKER_WIDTH=162;var COLOR_PICKER_HEIGHT=108;Af.ColorPicker=Class.create();Af.ColorPicker.prototype={initialize:function(A){this._initializeDialog(A)},_initializeDialog:function(A){this.handler=A;this.titleElement=null;this.element=null;this.cb=null;this.visible=false;this.width=COLOR_PICKER_WIDTH+"px";this.height=(COLOR_PICKER_HEIGHT+16)+"px";this.firstTime=true;this.div=null},close:function(A){this.hide()},hide:function(){this.visible=false;if(this.component){this.component.changeVisibility(false)}if(this.element!=null){this.element.style.display="none"}},show:function(B,A,D){this.visible=true;if(this.element==null){this.createElement()}var C=document.getElementById(B);C.appendChild(this.element);this.element.style.left=A+"px";this.element.style.top=(D+2)+"px";this.element.style.display=""},createElement:function(){var C=document.createElement("table");C.cellSpacing="0px";C.cellPadding="0px";C.className="ColorPicker";C.style.width=this.width;C.style.height=this.height;var B=document.createElement("tbody");C.appendChild(B);var E;var D;D=document.createElement("tr");B.appendChild(D);E=document.createElement("td");E.className="ColorPickerTitle";D.appendChild(E);this.titleElement=E;E=document.createElement("td");E.className="ColorPickerTitleButtonBar";D.appendChild(E);this.cb=document.createElement("a");var A=document.createElement("img");A.className="ColorPickerCloseButtonImage";A.src="/images/close.gif";this.cb.appendChild(A);E.appendChild(this.cb);this.cb.onclick=this.close.bindAsEventListener(this);D=document.createElement("tr");B.appendChild(D);E=document.createElement("td");E.colSpan="2";D.appendChild(E);this.div=document.createElement("div");this.div.src=topURL+"common/color.html";this.div.width="100%";this.div.height=COLOR_PICKER_HEIGHT;this.div.frameBorder="0";E.appendChild(this.div);this.element=C;this.element.onclick=this.cellSelected.bindAsEventListener(this);this.element.onmousedown=this.mouseDownOnElement.bindAsEventListener(this);this.loadMyComp()},loadMyComp:function(){var A=new Af.DataRequest(topURL+"common/color.html",this.requestCompletedMyComp.bind(this),requestFailedCommon,null,requestTimedoutCommon);ajaxEngine.processRequest(A)},requestCompletedMyComp:function(A){this.div.innerHTML=A.responseText},cellSelected:function(A){var B=A.target?A.target:A.srcElement;if(B.tagName=="TD"&&B.className=="colorcell"&&this.handler!=null){this.handler.colorSelected(B.title)}this.hide();if(A.stopPropagation){A.stopPropagation()}else{A.cancelBubble=true}A.returnValue=false;return false},mouseDownOnElement:function(A){if(A.stopPropagation){A.stopPropagation()}else{A.cancelBubble=true}A.returnValue=false;return false}};Af.Rectangle=Class.create();Af.Rectangle.prototype={initialize:function(A,D,B,C){this.x=A;this.y=D;this.w=B;this.h=C},intersects:function(A){var H=this.w;var D=this.h;var E=A.w;var I=A.h;if(E<=0||I<=0||H<=0||D<=0){return false}var G=this.x;var F=this.y;var C=A.x;var B=A.y;E+=C;I+=B;H+=G;D+=F;return((E<C||E>G)&&(I<B||I>F)&&(H<G||H>C)&&(D<F||D>B))},contains:function(A,C){var B=A>=this.x&&A<=(this.x+this.w)&&C>=this.y&&C<=(this.y+this.h);return B},intersection:function(A){var C=this.x;var I=this.y;var G=A.x;var E=A.y;var B=C;B+=this.w;var H=I;H+=this.h;var F=G;F+=A.w;var D=E;D+=A.h;if(C<G){C=G}if(I<E){I=E}if(B>F){B=F}if(H>D){H=D}B-=C;H-=I;return new Af.Rectangle(C,I,B,H)},print:function(){debugA("rectangle - "+this.x+", "+this.y+", "+this.w+", "+this.h)}};Af.HtmlColumnRepeater=Class.create();Af.HtmlColumnRepeater.prototype={initialize:function(B,A,C){this.tableId=B;this.columns=A;this.tableElement=null;this.cols=C;this.init();this.listener=null},init:function(){this.columnList=this.columns.split(",");for(var C=0;C<this.columnList.length;C++){this.columnList[C]=trim(this.columnList[C])}var E=document.getElementById(this.tableId);this.tableElement=E;if(E==null){return }if(E.tBodies.length==0){return }var A=E.tBodies[0];if(A.rows.length==0){return }var B=new Af.ElementCollection(this.tableElement);var D=B.getFirstElement("TH");if(D==null){this.templateRow=this.tableElement.rows[0].cloneNode(true);this.tableElement.tBodies[0].removeChild(this.tableElement.rows[0])}else{this.header=this.tableElement.rows[0];this.templateRow=this.tableElement.rows[1].cloneNode(true)}removeAll(A)},setDataList:function(G){this.dlist=G;if(this.dlist==null){this.dlist=new Array()}if(this.tableElement==null){this.tableElement=document.getElementById(this.tableId)}if(this.tableElement==null){return }var B=this.tableElement.tBodies[0];removeAll(B);if(this.header!=null&&this.dlist.length>0){B.appendChild(this.header)}for(var C=0;C<G.length;C++){var E=G[C];var H=this.templateRow.cloneNode(true);B.appendChild(H);H.onclick=this.rowSelected.bindAsEventListener(this);H.id=C;var D=new Af.ElementCollection(H);for(var A=0;A<this.columnList.length;A++){var I=this.columnList[A];var F=D.getFirstElementById(I);F.innerHTML=E[I]}}},rowSelected:function(A){var B=A.target?A.target:A.srcElement;while(B!=null){if(B.tagName=="TR"){break}B=B.parentNode}if(B!=null&&this.listener!=null&&this.listener.columnRepeaterRowSelected!=null){var C=parseInt(B.id);this.listener.columnRepeaterRowSelected(this,C)}return false}};Af.DropDown=Class.create();Af.DropDown.prototype={initialize:function(B,D,A,C){this._initializeDialog(B,D,A,C)},_initializeDialog:function(B,D,A,C){this.handler=B;this.content=D;this.container=A;this.title=C;this.content.onclick=this.mouseClicked.bindAsEventListener(this);this.width="60px"},mouseClicked:function(A){if(this.handler!=null&&this.handler.dropDownClicked!=null){this.handler.dropDownClicked(this,A)}},close:function(A){this.hide()},hide:function(){this.visible=false;if(this.element!=null){this.element.style.display="none"}},show:function(A,B){this.visible=true;if(this.element==null){this.createElement()}this.container.appendChild(this.element);this.element.style.left=A+"px";this.element.style.top=(B+2)+"px";this.element.style.display=""},createElement:function(){var D=document.createElement("table");D.cellSpacing="0px";D.cellPadding="0px";D.className="Dialog";if(this.width){D.style.width=this.width}if(this.height){D.style.height=this.height}var B=document.createElement("tbody");D.appendChild(B);var F;var E;E=document.createElement("tr");B.appendChild(E);F=document.createElement("td");F.className="DialogTitle";E.appendChild(F);this.titleElement=F;this.titleElement=F;var C=document.createElement("span");C.innerHTML=this.title;C.className="DialogTitleSpan";F.appendChild(C);this.cb=document.createElement("a");this.cb.className="DialogTitleButton";var A=document.createElement("img");A.className="DialogCloseButtonImage";A.src="/images/close.gif";this.cb.appendChild(A);F.appendChild(this.cb);this.cb.onclick=this.close.bindAsEventListener(this);E=document.createElement("tr");B.appendChild(E);F=document.createElement("td");F.colSpan="2";E.appendChild(F);this.content.style.width="100%";this.content.style.display="";F.appendChild(this.content);this.element=D}};Af.HtmlColumnRepeater2=Class.create();Af.HtmlColumnRepeater2.prototype={initialize:function(B,A,C){this.tableId=B;this.columns=A;this.tableElement=null;this.cols=C;this.listener=null;this.init()},init:function(){this.columnList=this.columns.split(",");for(var C=0;C<this.columnList.length;C++){this.columnList[C]=trim(this.columnList[C])}var E=document.getElementById(this.tableId);this.tableElement=E;if(E==null){return }if(E.tBodies.length==0){return }var A=E.tBodies[0];if(A.rows.length==0){return }var B=new Af.ElementCollection(this.tableElement);var D=B.getFirstElement("TH");if(D==null){this.templateRow=this.tableElement.rows[0].cloneNode(true);this.tableElement.tBodies[0].removeChild(this.tableElement.rows[0])}else{this.header=this.tableElement.rows[0];this.templateRow=this.tableElement.rows[1].cloneNode(true)}removeAll(A)},setDataList:function(K){this.dlist=K;if(this.dlist==null){this.dlist=new Array()}if(this.tableElement==null){this.tableElement=document.getElementById(this.tableId)}if(this.tableElement==null){return }var C=this.tableElement.tBodies[0];removeAll(C);if(this.header!=null&&this.dlist.length>0){C.appendChild(this.header)}for(var D=0;D<(Math.floor(K.length/this.cols)+(K.length%this.cols>0?1:0));D++){var N=this.templateRow.cloneNode(true);C.appendChild(N);var G=N.cells[0].cloneNode(true);removeAll(N);for(B=0;B<this.cols;++B){var J=G.cloneNode(true);N.appendChild(J);J.onclick=this.columnSelected.bindAsEventListener(this)}}var I=0;for(var F=0;F<this.cols;++F){for(var B=0;B<this.tableElement.rows.length;++B){var J=this.tableElement.rows[B].cells[F];J.id=I;var E=new Af.ElementCollection(this.tableElement.rows[B].cells[F]);if(I>=K.length){J.innerHTML="&nbsp;"}else{for(var H=0;H<this.columnList.length;++H){var M=this.columnList[H];var L=E.getFirstElementById(M);L.innerHTML=this.dlist[I][M]}++I}}}var A=document.getElementById(this.tableId)},columnSelected:function(A){var B=A.target?A.target:A.srcElement;while(B!=null){if(B.tagName=="TD"){break}B=B.parentNode}if(B!=null&&this.listener!=null&&this.listener.columnSelected!=null){var C=parseInt(B.id);this.listener.columnSelected(this,C)}return false}};Af.DateUtil=Class.create();Af.DateUtil.prototype={initialize:function(){this.days=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];this.months=["January","February","March","April","May","June","July","August","September","October","November","December"];this.daysLong=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];this.monthsShort=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];this.weeks=["1st","2nd","3rd","4th","5th"]},getWeekOfMonth:function(A){var C=A.getDate();var B=-1;while(C>0){B+=1;C-=7}return B},isDayInFirstWeek:function(A){return A.getDate()<7},isDayInLastWeek:function(B){var A=new Date(B.getTime());A.setDate(A.getDate()+7);return B.getMonth()!=A.getMonth()},getRepeatList:function(B){var A=new Array();var C=new Object();C.label="Every Day";C.value="ED";A.push(C);var D=B.getDay();if(D>=1&&D<=5){C=new Object();C.label="Every Weekday";C.value="EWD";A.push(C)}C=new Object();C.label="Every "+this.daysLong[B.getDay()];C.value="EW_SAME_DAY";A.push(C);C=new Object();C.label="-------";C.value="NULL1";A.push(C);C=new Object();C.label=B.getDate()+" of every month";C.value="A_DATE";A.push(C);var D=this.getWeekOfMonth(B);if(D<4){C=new Object();C.label=this.weeks[D]+" "+this.daysLong[B.getDay()]+" of every month";C.value="NTH_WEEK_A_DAY";A.push(C)}if(this.isDayInLastWeek(B)){C=new Object();C.label="Last "+this.daysLong[B.getDay()]+" of every month";C.value="LAST_WEEK_A_DAY";A.push(C)}C=new Object();C.label="-------";C.value="NULL2";A.push(C);C=new Object();C.label="More Choices";C.value="MORE";A.push(C);return A},getDaysAfter:function(E,D){var C=E.getTime();var A=D.getTime();if((E.getYear()<=D.getYear())||(E.getMonth()<=D.getMonth())||(E.getDate()<=D.getDate())){n=0;var B=new Date(C);while(B.getTime()<A){n++;B.setDate(B.getDate()+1)}return n}return -1}};Af.TimeDropDown=Class.create();Af.TimeDropDown.prototype={initialize:function(E,C,D,B,A){this._initializeDialog(E,C,D,B,A);this.value=0},_initializeDialog:function(E,C,D,B,A){this.textBox=E;this.trigger=C;this.handler=D;this.container=B;this.dialogContainer=A;this.trigger.onclick=this.timeSelectorClicked.bindAsEventListener(this);this.textBox.onchange=this.parseTime.bind(this)},timeSelectorClicked:function(B){var D=B.target?B.target:B.srcElement;var C=RicoUtil.toDocumentPosition(D);var A=C.x;var E=C.y+D.offsetHeight;if(!is_firefox){A+=document.documentElement.scrollLeft;E+=document.documentElement.scrollTop}this.show(A,E);return true},parseTime:function(){try{var I=this.textBox.value;if(I==null){showMessageDialog("The time you have entered for this event is incomplete. Please enter or select a valid time.","Excuse us!",350,130,null,true);this.textBox.value="8:00 AM";return -1}I=I.toLowerCase();var D=I.indexOf(":");var C=I.indexOf("am");var F=true;if(C<0){F=false;C=I.indexOf("pm")}if(C<0||C<=D){this.textBox.value="8:00 AM";showMessageDialog("The time you have entered for this event is incomplete. Please enter or select a valid time.","Excuse us!",350,130,null,true);return -1}var H;if(D>=0){H=I.substring(0,D)}else{H=I.substring(0,C)}var E=parseInt(H,10);if(!F&&E!=12){E+=12}if(E>24){E=1}var B=0;if(D>=0){H=I.substring(D+1,C);B=parseInt(H,10)}E+=parseInt(B/60,10);B=B%60;var A=this.value;if(E==12&&F){E=0}this.setValue(E*60+B);if(this.handler!=null){this.handler.timeChanged(this,this.value,A)}return this.value}catch(G){this.textBox.value="8:00 AM";showMessageDialog("The time you have entered for this event is incomplete. Please enter or select a valid time.","Excuse us!",350,130,null,true);return -1}},setValue:function(A){this.value=A;this.textBox.value=this.getDisplayTimeFromMins(A)},getValue:function(A){return this.value},close:function(A){this.hide()},hide:function(){if(this.element!=null){try{document.getElementsByTagName("body")[0].removeChild(this.element);this.element.style.display="none"}catch(A){this.element.style.display="none"}}document.onclick=null;this.visible=false},addDcoumentClickListener:function(){document.onmousedown=this.documentClicked.bindAsEventListener(this)},documentClicked:function(A){var C=A.target?A.target:A.srcElement;var B=C;while(B!=null){if(B==this.element){return true}B=B.parentNode}this.hide()},show:function(A,C){document.onclick=null;this.visible=true;if(this.element==null){this.createElement()}document.getElementsByTagName("body")[0].appendChild(this.element);this.element.style.left=A+"px";this.element.style.top=(C+2)+"px";this.element.style.zIndex="5000010";this.element.style.display="";setTimeout(this.addDcoumentClickListener.bind(this),10);var B=0;if(this.value!=0){B=parseInt((this.value/30)*15)}this.scrollTop=B;setTimeout(this.doScroll.bind(this),10)},doScroll:function(){this.element.scrollTop=this.scrollTop},createElement:function(){var F;var E;var A=document.createElement("div");A.className="TimeDropDown";var C=document.createElement("table");C.cellSpacing="0px";C.cellPadding="0px";C.className="TimeTable";A.appendChild(C);tbody=document.createElement("tbody");C.appendChild(tbody);var B=this.getTimeOptions();for(var D=0;D<B.length;D++){E=document.createElement("tr");tbody.appendChild(E);F=document.createElement("td");F.onmouseover=this.cellMouseOver.bindAsEventListener(this);F.onmouseout=this.cellMouseOut.bindAsEventListener(this);F.className="TimeCell";F.innerHTML=this.getDisplayTimeFromMins(B[D]);F.id=B[D];E.appendChild(F)}C.onclick=this.cellSelected.bindAsEventListener(this);this.table=C;this.element=A},cellMouseOver:function(A){var B=A.target?A.target:A.srcElement;B.className="TimeCellHighlighted"},cellMouseOut:function(A){var B=A.target?A.target:A.srcElement;B.className="TimeCell"},getTimeOptions:function(){m=0;var A=new Array(48);for(var B=0;B<A.length;B++){A[B]=m;m+=30}return A},cellSelected:function(A){var D=A.target?A.target:A.srcElement;var C=D;while(C!=null){if(C==this.element){return true}else{if(C==this.table){break}}C=C.parentNode}if(D.tagName=="TD"){var B=this.value;this.setValue(D.id);if(this.handler!=null){this.handler.timeChanged(this,this.value,B)}}this.hide();return this.consume(A)},mouseDownOnElement:function(A){this.consume(A)},mouseDownOnElement2:function(A){this.consume(A)},getDisplayTimeFromMins:function(D){D=parseInt(D);var C=parseInt(D/60);var A=D%60;var B="AM";if(C>=12){B="PM";if(C>12){C-=12}}if(A==0){A="00"}else{if(A<10){A="0"+A}}if(C==0){C=12}return C+":"+A+" "+B},consume:function(A){if(A.preventDefault){A.preventDefault()}if(A.stopPropagation){A.stopPropagation()}A.cancelBubble=true;return false}};Af.BaseCalendar=Class.create();Af.BaseCalendar.prototype={initialize:function(){this.days=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];this.months=["January","February","March","April","May","June","July","August","September","October","November","December"];this.daysLong=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];this.monthsShort=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];this.schedules=null;this.dateUtil=new Af.DateUtil();this.evtObj=new Object();this.actualDate=null},tableClicked:function(C){var E=C.target?C.target:C.srcElement;if(E.tagName=="A"&&E.id!=null){if(E.id.indexOf("E_")==0){this.eventDetailView(E.id,E.name);return false}try{var A=parseInt(E.id);var B=new Date(A);B.setHours(0,0,0,0);this.listener.dateClicked(this,B)}catch(D){}}return false},scheduleListChanged:function(A){this.render(A,this.date)},getEventLink:function(J,B,A,C){var H;var G=false;if(J.UUID!=A.scheduleId&&(J.UUID==A.driver1||J.UUID==A.driver2)){var E=app.workspace.schedule;var D=findObjById(E,A.scheduleId);if(D==null){H=J.color}else{H=D.color;G=true}}else{H=J.color}if(G){I="#c2c2c2";H="#f2f2f2"}else{var I=getTextColor(H);H=getBackground(H)}if(J.sharing=="FREE_TIME"){var K=document.createElement("span");if(H!=null){K.style.backgroundColor=H}if(I!=null){K.style.color=I}K.innerHTML=get_nbsp(A.displayName);K.style.margin="0 -2px";K.id="E_"+B+"_"+C;return K}else{var K=document.createElement("a");if(H!=null){K.style.backgroundColor=H}if(I!=null){K.style.color=I}K.href="#";K.innerHTML=A.displayName;K.id="E_"+B+"_"+C;K.style.cursor="move";this.evtObj[K.id]=A;if(is_ie||is_ie7){K.onmouseover=this.showToolTip.bindAsEventListener(this)}else{var F="";F+=A.displayName;if(A.locationName!=null){F+="<br/><b> Location:</b> "+A.locationName}if(A.noTimeFlag!=null&&"true"==trim(""+A.noTimeFlag)){F+="<br/><b>Time:</b> No   Time"}else{F+="<br/><b>Time:</b> "+getDisplayTimeFromMins(A.fromTime)+" to "+getDisplayTimeFromMins(A.toTime)}K.setAttribute("onmouseover","javascript:Tip('"+F+"<br/>', SHADOW, true, TITLE, 'Click for Event Details', PADDING, 9 ,FONTSIZE, '8pt', SHADOWCOLOR, '#99957E', BGCOLOR, '#C9CCC1', BORDERCOLOR, '#fff', WIDTH, 180, TITLEBGCOLOR, '#BAA32B')")}return K}},getTravelLink:function(I,C,A,D,L){if(I.sharing=="FREE_TIME"){return null}s=trim(A["driver"+L]);if(s==""){return null}var F=app.workspace.schedule;var E=findObjById(F,s);if(E==null){return null}var G=E.color;var H=getTextColor(G);G=getBackground(G);var J=document.createElement("a");if(G!=null){J.style.backgroundColor=G}if(H!=null){J.style.color=H}s=A["minuteBefore"+L];var K=15;if(s!=null){K=parseInt(s);if(isNaN(K)){K=15}if(K>59){K=59}}J.href="#";J.innerHTML="Travel ("+A.displayName+")";J.id="E_"+C+"_"+D;J.style.cursor="move";if(is_ie||is_ie7){J.onmouseover=this.showToolTip.bindAsEventListener(this)}else{J.setAttribute("onmouseover","javascript:Tip('"+A.displayName+"', SHADOW, true, TITLE, 'Click for Event Details', PADDING, 9 ,FONTSIZE, '8pt', SHADOWCOLOR, '#dd99aa', BGCOLOR, '#FF9A47', BORDERCOLOR, '#fff', WIDTH, 200, TITLEBGCOLOR, '#ADD57C')")}var B=new Object();B.link=J;B.duration=K;return B},showToolTip:function(A){var C=A.target?A.target:A.srcElement;var D="";var B=this.evtObj[C.id];if(B!=null){D=B.displayName}else{D="Click on Me";B=new Object()}var E="";E+=D;if(B.locationName!=null){E+="<br/><b> Location:</b> "+B.locationName}if(B.noTimeFlag!=null&&"true"==trim(""+B.noTimeFlag)){E+="<br/><b>Time:</b> No   Time"}else{E+="<br/><b>Time:</b> "+getDisplayTimeFromMins(B.fromTime)+" to "+getDisplayTimeFromMins(B.toTime)}javascript:Tip(E,SHADOW,true,TITLE,"Click for Event Details",PADDING,9,FONTSIZE,"8pt",SHADOWCOLOR,"#dd99aa",BGCOLOR,"#FF9A47",BORDERCOLOR,"#fff",WIDTH,200,TITLEBGCOLOR,"#ADD57C");return false},getEventByIndex:function(G){var A=G.indexOf("_");var B=G.lastIndexOf("_");var F=parseInt(G.substring(A+1,B));var C=parseInt(G.substring(B+1));var E=this.schedules[F];var D=E.event[C];return D},getScheduleByIndex:function(E){var A=E.indexOf("_");var B=E.lastIndexOf("_");var D=parseInt(E.substring(A+1,B));var C=this.schedules[D];return C},eventDetailView:function(D,C){var K=D.indexOf("_");var G=D.lastIndexOf("_");var E=parseInt(D.substring(K+1,G));var I=parseInt(D.substring(G+1));var J=this.schedules[E];var B=J.event[I];var F=-1;if(C!=null){F=parseInt(C);if(isNaN(F)){F=-1}}var A=J.UUID;var H=null;if(A!=B.scheduleId&&(B.driver1==A||B.driver2==A)){H=J;J=findObjById(app.workspace.schedule,B.scheduleId)}app.schedule.editEventDetails(B,J,false,F,H)},getTimeCell:function(H,A){var F=H.color;var G=getTextColor(F);F=getBackground(F);var D=document.createElement("td");var J=parseInt(A.startDT);var B=new Date(J);if(F!=null){D.style.backgroundColor=F}if(G!=null){D.style.color=G}if(A.timeFlag+""=="false"){D.innerHTML=" "}else{var C=""+B.getMinutes();if(C.length==1){C="0"+C}var E=B.getHours();var J;if(E>=12){if(E>12){E=E-12}J=E+":"+C+" pm"}else{if(E==0){E=12}J=E+":"+C+" am"}var I=parseInt(A.endDT);B=new Date(I);var C=""+B.getMinutes();if(C.length==1){C="0"+C}var E=B.getHours();if(E>=12){if(E>12){E=E-12}J+=" - "+E+":"+C+" pm"}else{if(E==0){E=12}J+=" - "+E+":"+C+" am"}D.innerHTML=J}return D},getAgendaEventCell:function(I,B,A,C,D){var G=I.color;var H=getTextColor(G);G=getBackground(G);var E=document.createElement("td");var J;if(G!=null){E.style.backgroundColor=G}var J;var L;if(I.sharing=="FREE_TIME"){var J=document.createElement("span");if(G!=null){J.style.backgroundColor=G}if(H!=null){J.style.color=H}L=get_nbsp(A.displayName);J.id="E_"+B+"_"+C;J.style.margin="0 -2px"}else{var J=document.createElement("a");J.href="#";L=A.displayName;J.id="E_"+B+"_"+C;if(H!=null){J.style.color=H}}J.name=D.getTime();var F=null;if(trim(A.driver1)!=""){var K=A.minuteBefore1;if(K!=null){F=" (Travel "+K+" mins before"}}if(trim(A.driver2)!=""){var K=A.minuteBefore2;if(K!=null){if(F==null){F=" (Travel "}else{F+=" - "}F+=K+" mins after"}}if(F!=null){L+=F+")"}J.innerHTML=L;E.appendChild(J);return E},processDragBegin:function(A){},processDragged:function(A,B){},moveToNewStartTime:function(G,D){var H=this.getScheduleByIndex(G.key);var F=this.getEventByIndex(G.key);if(this.isPastEvent(F,D)){return }var E=parseInt(F.startDT);var C=parseInt(F.endDT);var A=D.getTime()-parseInt(F.startDT);E+=A;C+=A;F.startDT=""+E;F.endDT=""+C;F.timeFlag="true";F.noTimeFlag="false";E=new Date(E);var B=E.getHours();F.fromTime=B*60+E.getMinutes();C=new Date(C);B=C.getHours();F.toTime=B*60+C.getMinutes();this.save2(H,F)},moveToNoTime:function(C,A){var D=this.getScheduleByIndex(C.key);var B=this.getEventByIndex(C.key);if(this.isPastEvent(B,A)){return }B.startDT=""+A;B.endDT=""+(A+(30*60*1000));B.timeFlag="false";B.noTimeFlag="true";this.save2(D,B)},save:function(A){var B=app.schedule.getSelectedSchedule();if(B==null){return }if(B.event==null){createOneToManyAssoc(B,"event","Event")}initializeCreatedObject(B.event,A);B.event.push(A);this.doSave(B,A)},doSave:function(D,C,F){if(C.repeatFlag+""=="true"){F="modifyInstance"}this.addlAction=F;this.obj=C;this.originalSch=D;var A=new Af.ObjEditor();var E=A.getChangeXmlForObj(C,["displayName","startDT","endDT","timeFlag","noTimeFlag","fromTime","toTime"],"ObjModify",null);var B=new Af.DataRequest(svcURL,this.saveSuccessful.bind(this),this.saveFailed.bind(this),null,this.saveTimedOut.bind(this));B.addService("WorkspaceService","saveEventDetails");B.addParameter("parentId",D.UUID);C.scheduleId=D.UUID;if(C.UUID!=null){B.addParameter("UUID",C.UUID)}if(F!=null){B.addParameter("addlAction",F)}if(this.actualDate!=null){B.addParameter("actualDate",this.actualDate)}B.xmlDoc=E;this.savedObj=C;ajaxEngine.processRequest(B)},saveSuccessful:function(B){if(this.addlAction=="resendEmail"){showMessageDialog("Your event details have been saved.  A notification of the event changes has been sent to your guests.","Success",300,120)}var A=new Af.XMLToDataSet(B.responseXML);var C=A.data;if(this.savedObj.UUID==null){this.savedObj.UUID=C.UUID;app.schedule.miniCalendar.updateMiniCalendar(this.savedObj)}if(this.addlAction=="modifyInstance"){replaceInArray(this.originalSch.event,this.obj,C.Event[0]);this.originalSch.event.push(C.Event[1]);app.schedule.selectScheduleAndRefresh(this.originalSch);return }},saveFailed:function(A,B){showMessageDialog("We are currently unable to save these event details.  Please try again.","Excuse us!",350,130)},saveTimedOut:function(A){showMessageDialog("A bit of network congestion has caused a delay.  Nonetheless, be assured that your event has been saved.","Excuse us!",400,150)},scrollTo7AM:function(){},handleScroll:function(){},getVisibleEventsList:function(C,E,K,N){var A=new Array();var J=E.getTime();var I=K.getTime();for(var H=0;H<this.schedules.length;H++){var M=this.schedules[H];var F=M.event;if(F!=null){for(var G=0;G<F.length;G++){var B=F[G];var P=parseInt(B.startDT);var L=parseInt(B.endDT);var O=new Date(P);O.setHours(0,0,0,0);if(N&&O.getTime()<=C.getTime()&&(B.repeatFlag+""=="true")){if(B.deletedSeqList==null){setEventDeleteSeqList(B)}if(B.modifiedSeqList==null){setEventModifySeqList(B)}if(!isEventInSeq(B,C.getTime())){continue}B=this.getRpt(B,C,E,K);if(B==null){continue}}else{if(P<J||P>=I){continue}}var D=new Object();D.schedule=M;D.scindex=H;D.event=B;D.eventindex=G;D.actualDate=C;A.push(D)}}}if(A!=null&&A.length>0){A.sort(sortEventByStartTime)}return A},getEventMatrics:function(D,R,L,C){var Q=new Array(25);for(var X=0;X<25;X++){Q[X]=new Array()}var J=L.getTime();var G=C.getTime();for(var X=0;X<this.schedules.length;X++){var A=this.schedules[X];var S=A.event;if(S!=null){for(var V=0;V<S.length;V++){var W=S[V];var K=parseInt(W.startDT);var b=parseInt(W.endDT);if(isNaN(K)||isNaN(b)){continue}var I=new Date(K);I.setHours(0,0,0,0);if(I.getTime()<=R.getTime()&&(W.repeatFlag+""=="true")){if(W.deletedSeqList==null){setEventDeleteSeqList(W)}if(W.modifiedSeqList==null){setEventModifySeqList(W)}if(!isEventInSeq(W,R.getTime())){continue}W=this.getRpt(W,R,L,C);if(W==null){continue}}else{if(K<J||K>=G){continue}}var O=new Object();O.schedule=A;O.scindex=X;O.event=W;O.eventindex=V;O.link=this.getEventLink(A,X,W,V);O.link.name=R.getTime();O.cols=1;O.offsetInCell=0;O.isRendered=false;O.driver1=this.getTravelLink(A,X,W,V,1);if(O.driver1!=null){O.driver1.link.name=R.getTime()}O.driver2=this.getTravelLink(A,X,W,V,2);if(O.driver2!=null){O.driver2.link.name=R.getTime()}if(W.timeFlag+""=="false"){O.r=24;O.endRow=24;Q[24].push(O)}else{var M=new Date(K);var f=parseInt(W.fromTime);if(!isNaN(f)){var Z=f%60;var T=f-(Z*60);M.setHours(Z,T,0,0)}if(O.driver1!=null){M.setMinutes(M.getMinutes()-O.driver1.duration)}var Y=M.getHours();O.minuteOffsetStart=M.getMinutes()/60;var U=new Date(b);var E=parseInt(W.toTime);if(!isNaN(E)){var Z=E%60;var T=E-(Z*60);U.setHours(Z,T,0,0)}if(O.driver2!=null){U.setMinutes(U.getMinutes()+O.driver2.duration)}var F=U.getHours();if(F<Y){F=24}var H=0;O.r=Y;try{Q[Y].push(O)}catch(N){if(O.driver1!=null){var B=O.driver1.duration}alert(N+" : "+Y+" : "+W.displayName+" : "+O.driver1+" : "+B)}if(Y<F){while(Y<F&&Y<24){H++;Y++;Q[Y].push(O)}}O.minuteOffsetEnd=(60-U.getMinutes())/60;if(O.minuteOffsetEnd>0){H++}O.rows=H}if(this.dndMgr2!=null&&A.sharing!="ALL_TIME"&&A.sharing!="FREE_TIME"){var c=O.link;var d=c.id;this.dndMgr2.registerDraggable("Event",d,c,W.displayName)}}}}for(var X=0;X<24;X++){var c=Q[X];var P=c.length;for(var V=0;V<P;V++){var O=c[V];if(O.offsetInCell<V){O.offsetInCell=V}if(O.cols<P){O.cols=P}}}return Q},renderMatrics:function(Y,L,Q){var R=document.getElementById("allDayEvents");var l=RicoUtil.toDocumentPosition(R);var F=RicoUtil.toDocumentPosition(L);var G=RicoUtil.toDocumentPosition(document.getElementById("wrapper"));var M=l.y+R.offsetHeight+this.calendarArea.offsetHeight;var b=0;var N=RicoUtil.toDocumentPosition(L.rows[0].cells[0]);b=N.y;N=RicoUtil.toDocumentPosition(L.rows[1].cells[0]);b=N.y-b;var Z=1;while((Z*b<this.calendarArea.scrollTop)){Z++}Z--;for(var e=0;e<24;e++){var K=Y[e];if(K.length==0){continue}var P=L.rows[e].cells[Q];if(P.childNodes.length>1){removeAll(P);P.innerHTML="&nbsp;"}var E=RicoUtil.toDocumentPosition(P);var H=RicoUtil.toViewportPosition(P);for(var d=0;d<K.length;d++){var W=K[d];if(W.r==e){W.isRendered=false}if((W.r+W.rows)<e||e<Z){continue}if(W.isRendered){continue}W.isRendered=true;var J=e+(W.rows-(e-W.r));while(!(J<=24)){J--}J--;var C=L.rows[J].cells[Q];var I=RicoUtil.toDocumentPosition(C);var D=RicoUtil.toViewportPosition(C);var V=new Object();V.x=E.x-G.x;V.y=E.y-G.y;var B=parseInt(W.minuteOffsetStart*b);var A=parseInt(W.minuteOffsetEnd*b);var S=0;if(e==W.r&&e>Z){V.y+=B;S=V.y}else{V.y=l.y+R.offsetHeight;S=V.y}if(S>=(l.y+R.offsetHeight)&&S<M){var q=W.link;var T=parseInt((P.offsetWidth-W.cols*K.length)/W.cols);var g=document.createElement("div");g.style.width=T+"px";g.style.position="absolute";g.style.left=(V.x+((T+1)*W.offsetInCell))+"px";g.style.top=(V.y+1)+"px";if(navigator.userAgent.toLowerCase().indexOf("msie")!=-1){g.style.top=(V.y+(E.y-H.y)+1)+"px"}g.style.overflow="hidden";g.style.padding="0px";g.style.margin="0px";q.style.verticalAlign="top";q.style.padding="0px";q.style.bottomPaddding="2px";q.style.margin="0px";var f=(b*(W.rows-(e-W.r)))-1-B-A;if(f<10){f=10;q.style.fontSize="7px"}var u=S+f;if(u>M){f-=u-M}var r=W.driver1;var U=0;if(r!=null){var c=document.createElement("div");c.style.width=T+"px";c.style.backgroundColor=r.link.style.backgroundColor;var O=parseInt((r.duration*b)/60);if(O<10){f+=10-O;O=10;r.link.style.fontSize="8px"}c.style.height=O+"px";c.appendChild(r.link);g.appendChild(c);U=O}g.id=q.id;r=W.driver2;hd2=0;if(r!=null){var c=document.createElement("div");c.style.width=T+"px";c.style.backgroundColor=r.link.style.backgroundColor;var O=parseInt((r.duration*b)/60);if(O<10){f+=10-O;O=10;r.link.style.fontSize="8px"}c.style.height=O+"px";c.appendChild(r.link);var X=document.createElement("div");X.style.width=T+"px";X.style.backgroundColor=q.style.backgroundColor;X.style.height=(f-U-O)+"px";X.appendChild(q);g.appendChild(X);g.appendChild(c)}else{g.appendChild(q)}g.style.height=f+"px";g.style.backgroundColor=q.style.backgroundColor;P.appendChild(g)}}}},getRpt:function(F,E,D,A){var C=parseInt(F.repeatUntil);if(C<D.getTime()){return null}var B=F.repeatType;if(B=="ED"){return this.getEDRpt(F,E)}else{if(B=="EWD"){return this.getEWDRpt(F,E)}else{if(B=="EW_SAME_DAY"){return this.getEW_SAME_DAYRpt(F,E)}else{if(B=="A_DATE"){return this.getA_DATERpt(F,E)}else{if(B=="NTH_WEEK_A_DAY"){return this.getNTH_WEEK_A_DAYRpt(F,E)}else{if(B=="LAST_WEEK_A_DAY"){return this.getLAST_WEEK_A_DAYRpt(F,E)}else{if(B=="MORE"){return this.getMoreRpt(F,E)}}}}}}}return null},getEDRpt:function(B,A){return B},getEWDRpt:function(B,A){var C=A.getDay();if(C>=1&&C<=5){return B}return null},getEW_SAME_DAYRpt:function(F,E){var C=parseInt(F.startDT);var D=new Date(C);var B=D.getDay();var A=E.getDay();if(B==A){return F}return null},getA_DATERpt:function(F,E){var C=parseInt(F.startDT);var D=new Date(C);var B=D.getDate();var A=E.getDate();if(B==A){return F}return null},getNTH_WEEK_A_DAYRpt:function(F,E){var C=parseInt(F.startDT);var D=new Date(C);var B=D.getDay();var A=E.getDay();if(B==A){B=this.dateUtil.getWeekOfMonth(D);A=this.dateUtil.getWeekOfMonth(E);if(B==A){return F}}return null},getLAST_WEEK_A_DAYRpt:function(F,E){var C=parseInt(F.startDT);var D=new Date(C);var B=D.getDay();var A=E.getDay();if(B==A){if(this.dateUtil.isDayInLastWeek(E)){return F}}return null},getMoreRpt:function(C,B){var A=C.repeatSubtype;if(A.indexOf("REPEAT")==0){return this.getMoreRepeatAfter(C,B)}else{return this.getMoreByWeek(C,B)}return null},getMoreRepeatAfter:function(C,B){var A=C.repeatSubtype;if(A=="REPEAT_AFTER_DAYS"){return this.getRepeatAfterDays(C,B)}else{if(A=="REPEAT_AFTER_WEEKS"){return this.getRepeatAfterWeeks(C,B)}else{if(A=="REPEAT__AFTER_MONTHS_BY_DATE"){return this.getRepeatAfterMonthsDate(C,B)}else{if(A=="REPEAT_AFTER_MONTHS_BY_DAY"){return this.getRepeatAfterMonthsDay(C,B)}else{if(A=="REPEAT_AFTER_YEARS"){return this.getRepeatAfterYear(C,B)}}}}}return null},getRepeatNumber:function(B){var A=B.repeatNumber;if(A==null){return 1}A=parseInt(A);if(A<1){A=1}return A},getRepeatAfterDays:function(F,E){var C=parseInt(F.startDT);var D=new Date(C);var B=this.dateUtil.getDaysAfter(D,E);if(B>-1){var A=this.getRepeatNumber(F);if((B%A)==0){return F}}return null},getRepeatAfterWeeks:function(F,E){var C=parseInt(F.startDT);var D=new Date(C);var B=this.dateUtil.getDaysAfter(D,E);if(B>-1){var A=this.getRepeatNumber(F);if((B%(A*7))==0){return F}}return null},getRepeatAfterMonthsDate:function(G,A){var I=parseInt(G.startDT);var F=new Date(I);F.setHours(0,0,0,0);if(A.getTime()<F.getTime()){return null}var H=A.getTime();var B=new Date(I);var E=B.getDate();var C=this.getRepeatNumber(G);while(B.getTime()<H){B.setMonth(B.getMonth()+C)}if(B.getMonth()==A.getMonth()){if(B.getDate()!=E){var D=B.getMonth();while(D==B.getMonth()){B.setDate(B.getDate()-1)}}if(A.getDate()==B.getDate()){return G}}return null},getRepeatAfterMonthsDay:function(I,A){var N=parseInt(I.startDT);var E=new Date(N);E.setHours(0,0,0,0);if(A.getTime()<E.getTime()){return null}var M=A.getTime();var B=new Date(N);var D=B.getDate();var C=this.getRepeatNumber(I);var J=B.getFullYear();var H=A.getFullYear();var L=B.getMonth();var K=A.getMonth();while(J<H||(J==H&&L<K)){B.setMonth(B.getMonth()+C);J=B.getFullYear();L=B.getMonth()}if(A.getMonth()==B.getMonth()){B=new Date(N);var G=B.getDay();var F=A.getDay();if(G==F){G=this.dateUtil.getWeekOfMonth(B);F=this.dateUtil.getWeekOfMonth(A);if(G==F){return I}}}return null},getRepeatAfterYear:function(G,F){var D=parseInt(G.startDT);var B=new Date(D);B.setHours(0,0,0,0);if(F.getTime()<B.getTime()){return null}var C=F.getFullYear();var E=new Date(D);if(F.getDate()!=E.getDate()||F.getMonth()!=E.getMonth()){return null}var A=E.getDate();var H=this.getRepeatNumber(G);while(E.getFullYear()<C){E.setFullYear(E.getFullYear()+H)}if(F.getFullYear()==E.getFullYear()){return G}return null},getMoreByWeek:function(C,B){var A=C.repeatSubtype;if(A=="EVERY_WEEK"){return this.getMoreEveryWeek(C,B)}else{if(A=="OTHER_WEEK"){return this.getMoreEveryOtherWeek(C,B)}else{if(A=="1st_WEEK"){return this.getMoreNthWeek(C,B,0)}else{if(A=="2nd_WEEK"){return this.getMoreNthWeek(C,B,1)}else{if(A=="3rd_WEEK"){return this.getMoreNthWeek(C,B,2)}else{if(A=="4th_WEEK"){return this.getMoreNthWeek(C,B,3)}else{if(A=="LAST_WEEK"){return this.getMoreLastWeek(C,B)}}}}}}}return null},getMoreEveryWeek:function(E,D){var C=D.getDay();var B=this.getRepeatNumber(E);var A=(1<<C)&B;if(A!=0){return E}return null},getMoreEveryOtherWeek:function(G,F){var D=parseInt(G.startDT);var E=new Date(D);var C=this.dateUtil.getDaysAfter(E,F);if(C>-1){var B=parseInt(C/7);if(B%2==0){var C=F.getDay();var B=this.getRepeatNumber(G);var A=(1<<C)&B;if(A!=0){return G}}}return null},getMoreNthWeek:function(G,F,H){var D=parseInt(G.startDT);var E=new Date(D);B=this.dateUtil.getWeekOfMonth(F);if(B==H){var C=F.getDay();var B=this.getRepeatNumber(G);var A=(1<<C)&B;if(A!=0){return G}}return null},getMoreLastWeek:function(G,F,H){var D=parseInt(G.startDT);var E=new Date(D);if(this.dateUtil.isDayInLastWeek(F)){var C=F.getDay();var B=this.getRepeatNumber(G);var A=(1<<C)&B;if(A!=0){return G}}return null},getDayNumber:function(A){var B=new Date(this.startTime.getTime());var C=0;while(B.getTime()<=A){C++;B.setDate(B.getDate()+1)}return C},mouseDownOnTable:function(D){var C=D.target?D.target:D.srcElement;var B=false;var A=C;while(A!=null){if(A==this.table){B=true;break}A=A.parentNode}if(B){this.table.onmousemove=this.mouseMoveOnTable.bindAsEventListener(this);this.table.onmouseup=this.mouseUpOnTable.bindAsEventListener(this);document.onmouseup=this.mouseUpOnTable.bindAsEventListener(this);document.onmousemove=this.mouseMoveOnTable.bindAsEventListener(this);this.startIdx=htmlTableRowIndexAt(this.table,D);this.cellIdx=htmlTableCellIndexAt(this.table,this.table.rows[this.startIdx],D);this.endIdx=-1;this.msDownX=this.mx1=D.clientX;this.msDownY=this.my1=D.clientY;return consumeEvent(D)}},mouseMoveOnTable:function(D){var A=D.clientX;var E=D.clientY;var C=A-this.mx1;var B=E-this.my1;if(this.endIdx<0){if(Math.abs(C)>=2||Math.abs(B)>=2){this.endIdx=htmlTableRowIndexAt(this.table,D);if(this.endIdx<0){this.endIdx=this.startIdx}}}else{this.deselectRows();this.endIdx=htmlTableRowIndexAt(this.table,D);if(this.endIdx<0){this.endIdx=this.startIdx}}this.selectRows();return consumeEvent(D)},mouseUpOnTable:function(A){this.table.onmousemove=null;document.onmousemove=null;this.table.onmouseup=null;document.onmouseup=null;if(this.endIdx>0){this.showQuickEventDialog()}this.deselectRows();return consumeEvent(A)},mouseDownOnAllDaysTable:function(D){var C=D.target?D.target:D.srcElement;var B=false;var A=C;while(A!=null){if(A==this.allDayEvents){B=true;break}A=A.parentNode}if(B){this.allDayEvents.onmousemove=this.mouseMoveOnAllDaysTable.bindAsEventListener(this);this.allDayEvents.onmouseup=this.mouseUpOnAllDaysTable.bindAsEventListener(this);document.onmouseup=this.mouseUpOnAllDaysTable.bindAsEventListener(this);document.onmousemove=this.mouseMoveOnAllDaysTable.bindAsEventListener(this);this.startIdx=8;this.cellIdx=htmlTableCellIndexAt(this.allDayEvents,this.allDayEvents.rows[0],D);this.cellIdx++;this.endIdx=-1;this.msDownX=this.mx1=D.clientX;this.msDownY=this.my1=D.clientY;return consumeEvent(D)}},mouseMoveOnAllDaysTable:function(D){var A=D.clientX;var E=D.clientY;var C=A-this.mx1;var B=E-this.my1;if(this.endIdx<0){if(Math.abs(C)>=2||Math.abs(B)>=2){this.endIdx=this.startIdx}}return consumeEvent(D)},mouseUpOnAllDaysTable:function(A){this.allDayEvents.onmousemove=null;document.onmousemove=null;this.allDayEvents.onmouseup=null;document.onmouseup=null;if(this.endIdx>0){this.showQuickEventDialog(true)}return consumeEvent(A)},selectRows:function(){if(this.endIdx<0){return }var C;var D;if(this.startIdx<=this.endIdx){C=this.startIdx;D=this.endIdx}else{D=this.startIdx;C=this.endIdx}var A=this.cellIdx;for(var B=C;B<=D;B++){this.table.rows[B].cells[A].style.backgroundColor="#c2c2c2"}},deselectRows:function(){if(this.endIdx<0){return }var C;var D;if(this.startIdx<=this.endIdx){C=this.startIdx;D=this.endIdx}else{D=this.startIdx;C=this.endIdx}var A=this.cellIdx;for(var B=C;B<=D;B++){this.table.rows[B].cells[A].style.backgroundColor="#ffffff"}},showQuickEventDialog:function(){},save2:function(B,A){if(A.rsvp!=null&&A.rsvp!=""){this.scheduleToBeSaved=B;this.eventToBeSaved=A;this.openConfirmDialog()}else{this.doSave(B,A)}},isPastEvent:function(C,A){var B=(new Date()).getTime();if((A<B)&&(C.rsvp!=null&&C.rsvp!="")){showMessageDialog("You are not allowed to move this event to a past date because you have already invited guests to this event.","Excuse us!",350,120);return true}return false},openConfirmDialog:function(){if(app.confDialog==null){var A={templateLoaded:function(){this.parent.confirmDialogLoaded()},parent:this};app.confDialog=new Af.HtmlDialog("Notify Guests?",A,null);app.confDialog.width="300px"}app.confDialog.showHTMLTemplate(basePageURL+"ConfirmDialog.htm","MainArea","confirmHTMLDailog");app.confDialog.centerDialog(350,350)},confirmDialogLoaded:function(){this.messageText=document.getElementById("messageText");this.sendButton=document.getElementById("sendButton");this.dontSendButton=document.getElementById("dontSendButton");this.sendButton.onclick=this.doSendChangeNotification.bind(this);this.dontSendButton.onclick=this.doDontSendChangeNotification.bind(this);this.messageText.innerHTML="Would you like to notify your guests of changes to this event?"},doSendChangeNotification:function(){app.confDialog.hide();this.doSave(this.scheduleToBeSaved,this.eventToBeSaved,"resendEmail")},doDontSendChangeNotification:function(){app.confDialog.hide();this.doSave(this.scheduleToBeSaved,this.eventToBeSaved)}};function eventOrder(E,D){var G=E.event;var F=D.event;if(G.timeFlag+""=="false"||G.fromTime==null){return -1}if(F.timeFlag+""=="false"||F.fromTime==null){return 1}try{var C=parseInt(G.fromTime);var B=parseInt(F.fromTime);return C-B}catch(A){return 0}}function setEventDeleteSeqList(D){var A=new Array();var C=D.deletedSeqs;if(C!=null){var A=C.split(",");for(var B=0;B<A.length;B++){A[B]=parseInt(A[B])}}D.deletedSeqsList=A}function setEventModifySeqList(D){var A=new Array();var C=D.modifiedSeqs;if(C!=null){var A=C.split(",");for(var B=0;B<A.length;B++){A[B]=parseInt(A[B])}}D.modifiedSeqsList=A}function isEventInSeq(D,C){var A=D.deletedSeqsList;if(A!=null){for(var B=0;B<A.length;B++){if(A[B]==C){return false}}}A=D.modifiedSeqsList;if(A!=null){for(var B=0;B<A.length;B++){if(A[B]==C){return false}}}return true}function appendDeleteSeq(C,A){var B=C.deletedSeqs;if(B==""||B==null){B=""+A}else{B+=","+A}C.deletedSeqs=B;setEventDeleteSeqList(C)}function appendModifySeq(C,A){var B=C.modifiedSeqs;if(B==""||B==null){B=""+A}else{B+=","+A}C.modifiedSeqs=B;setEventModifySeqList(C)}Af.PrintUtil=Class.create();Af.PrintUtil.prototype={initialize:function(A){this.printTable=null;this.listener=A},showPrintView:function(B){var A=document.getElementsByTagName("body")[0];var E=document.createElement("table");E.style.margin="auto";var D=E.insertRow(0);var G=D.insertCell(0);G.width="100%";G.style.textAlign="left";G.innerHTML=B.responseText;D=E.insertRow(1);G=D.insertCell(0);G.width="100%";G.style.textAlign="right";G.style.padding="5px";var F=document.createElement("a");F.appendChild(document.createTextNode("Return"));G.appendChild(F);F.onclick=this.printingDone.bind(this);F.className="Link";F.href="#";for(var C=0;C<A.childNodes.length;C++){if(A.childNodes[C].style){A.childNodes[C].style.display="none"}}A.appendChild(E);this.printTable=E},printingDone:function(){var A=document.getElementsByTagName("body")[0];A.removeChild(this.printTable);for(var B=0;B<A.childNodes.length;B++){if(A.childNodes[B].style){A.childNodes[B].style.display=""}}if(this.listener!=null){this.listener.printingDone()}}};Af.DndMgr2=Class.create();Af.DndMgr2.prototype={initialize:function(A){this.dtable=new Array();this.draggableElement=document.createElement("div");this.draggableElement.style.border="1px dashed black";this.draggableElement.style.padding="2px";this.draggableElement.style.textAlign="center";this.draggableElement.style.backgroundColor="#ffffff";this.draggableElement.style.fontSize="10px";this.draggableElement.style.width="100px";this.draggableElement.style.height="12px";this.draggableElement.style.overflow="hidden";this.dndMgr=new Rico.DragAndDrop();this.dndMgr.dragStartX_Delta=5;this.dndMgr.dragStartY_Delta=5;this.handler=A},registerDraggable:function(D,C,B,E){var A=new Af.Draggable(D,C,B,false,this.draggableElement,E);A.allowedTarget=B;this.dndMgr.registerDraggable(A);return A},registerDropZone:function(D,B,C){var A=new Af.Dropzone(C?C:this.handler,B,D);this.dndMgr.registerDropZone(A);return A},registerDropZone2:function(A){this.dndMgr.registerDropZone(A)},deregisterDropZone:function(A){this.dndMgr.deregisterDropZone(A)},clearAll:function(){this.dndMgr.clearDropZones();this.dndMgr.clearDraggables()},clearDraggables:function(){this.dndMgr.clearDraggables()},clearDropZones:function(){this.dndMgr.clearDropZones()}};Af.Draggable=Class.create();Af.Draggable.prototype=Object.extend(new Rico.Draggable(),{initialize:function(B,A,C,E,F,D){this.type=B;this.key=A;this.htmlElement=C;this.text=D;if(this.text==null){this.text=""}this.selected=false;this.draggableElement=F;this.allowedTarget=null;if(E!=null){this.repositionable=E}else{this.repositionable=false}},startDrag:function(){this.draggableElement.innerHTML=this.text},select:function(){this.selected=true;this.showingSelected=true},deselect:function(){this.selected=false;if(!this.showingSelected){return }this.showingSelected=false}});Af.ObjEditor=Class.create();Af.ObjEditor.prototype=Object.extend(new Af.BaseEditor(),{initialize:function(){this.components=new Array();this.nvl=new Array()},addTextByName:function(A){var B=document.getElementById(A);if(B==null){return }return this.addText(B)},addTextByEC:function(B,A){var C=B.getFirstElementById(A);if(C==null){return }return this.addText(C)},addTextAreaByName:function(A){var B=document.getElementById(A);if(B==null){return }return this.addAreaText(B)},addTextAreaByEC:function(B,A){var C=B.getFirstElementById(A);if(C==null){return }return this.addTextArea(C)},addIntByName:function(A){var B=document.getElementById(A);if(B==null){return }return this.addInt(B)},addIntByEC:function(B,A){var C=B.getFirstElementById(A);if(C==null){return }return this.addInt(C)},addSelectByName:function(A){var B=document.getElementById(A);if(B==null){return }return this.addSelect(B)},addSelectByEC:function(B,A){var C=B.getFirstElementById(A);if(C==null){return }return this.addSelect(C)},addDynamicSelectByName:function(B,C,E,A,F){var D=document.getElementById(B);if(D==null){return }return this.addDynamicSelect(D,C,E,A,F)},addDynamicSelectByEC:function(C,B,D,F,A,G){var E=C.getFirstElementById(B);if(E==null){return }return this.addDynamicSelect(E,D,F,A,G)},addCheckBoxByName:function(A){var B=document.getElementById(A);if(B==null){return }return this.addCheckBox(B)},addCheckBoxByEC:function(B,A){var C=B.getFirstElementById(A);if(C==null){return }return this.addCheckBox(C)},addDateByName:function(B,A){var D=document.getElementById(B);if(D==null){return }var C=document.getElementById(A);if(C==null){return }return this.addDate(D,C)},addDatetByEC:function(C,B,A){var E=C.getFirstElementById(B);if(E==null){return }var D=C.getFirstElementById(A);if(D==null){return }return this.addDate(E,D)},addNV:function(D,C){var B=new Object();B.name=D;B.value=C;var A=-1;for(var E=0;E<this.nvl.length;E++){var F=this.nvl[E];if(F.name==D){A=E;break}}if(A!=-1){this.nvl[A]=B}else{this.nvl.push(B)}},setValueFromObj:function(B){this.obj=B;for(var A=0;A<this.components.length;A++){var C=this.components[A];C.setValueFromObj(B)}},clearChanges:function(){for(var A=0;A<this.components.length;A++){var B=this.components[A];B.modified=false}this.nvl.length=0},getChangeXml:function(G,D){if(this.obj==null){return null}var I;if(G){I="ObjCreate"}else{I="ObjModify"}var J="<"+I+' id="'+this.obj.__id+'"';J+=' class="'+this.obj.__className+'"';if(this.obj.__atype!="U"&&this.obj.__index!=null){J+=' index="'+this.obj.__index+'"'}if(this.obj.UUID!=null){J+=' UUID="'+this.obj.UUID+'"'}J+=">";var F=false;for(var B=0;B<this.components.length;B++){var E=this.components[B];if(E.modified){var A=E.name;var H=""+E.getInternalValue();H=xmlEncode(H);this.addNV(A,H)}}for(var B=0;B<this.nvl.length;B++){var C=this.nvl[B];var A=C.name;var H=C.value;if(H==null){continue}H=""+H;H=xmlEncode(H);J+='<property name="'+A+'" value="'+H+'" />';F=true}if(D!=null){F=true;J+=D}J+="</"+I+">";if(F){return J}return null},getChangeXmlForObjList:function(A,F,D){var C="";for(var B=0;B<A.length;B++){var E=A[B];C+=this.getChangeXmlForObj(E,F,D)}return C},getChangeXmlForObj:function(G,F,C,E){var D="<"+C+' id="'+G.__id+'"';D+=' class="'+G.__className+'"';if(G.__atype!="U"&&G.__index!=null){D+=' index="'+G.__index+'"'}if(G.UUID!=null){D+=' UUID="'+G.UUID+'"'}D+=">";for(var B=0;B<F.length;B++){var H=F[B];var A=G[H];if(A==null){continue}A=""+A;A=xmlEncode(A);D+='<property name="'+H+'" value="'+A+'" />'}if(E!=null){D+=E}D+="</"+C+">";return D}});Af.HtmlTab=Class.create();Af.HtmlTab.prototype={initialize:function(C,B,A,D){this.currentTab=0;this.tabSheets=new Array();this.tabColumns=new Array();this.listener=null;this.activeTabCLS="TabSelected";this.normalTabCLS="TabNormal";this._init(C,B,A,D);this.tabSelectionListener=null},_init:function(I,H,F,E){var G=H.split(",");var B=F.split(",");for(var D=0;D<G.length;D++){G[D]=trim(G[D])}this.columnList=G;this.validityFlags=Object();for(var D=0;D<B.length;D++){B[D]=trim(B[D]);this.validityFlags[B[D]]=true}this.header=$(I);for(D=0;D<G.length;++D){var A=$(G[D]);var C=$(B[D]);A.id="tabH_"+D;this.tabColumns.push(A);this.tabSheets.push(C);A.onclick=this.tabSelected.bindAsEventListener(this);if(D==0){this._showTab(D)}else{this._hideTab(D)}}this.tabList=B},tabSelected:function(A){var D=A.target?A.target:A.srcElement;var B=D.id;if(B==this.currentTab){return }var C=this.currentTab;var E=B.lastIndexOf("_");this.currentTab=parseInt(B.substring(E+1));this._hideTab(C);this._showTab(this.currentTab);return false},_showTab:function(A){this.currentTab=A;this.tabSheets[A].style.display="";this.tabColumns[A].className=this.columnList[A]+"_on";if(this.tabSelectionListener!=null&&this.tabSelectionListener.tabSelected!=null){this.tabSelectionListener.tabSelected(this.currentTab,this.columnList[this.currentTab])}},_hideTab:function(A){this.tabSheets[A].style.display="none";this.tabColumns[A].className=this.columnList[A]+"_off"},showTab:function(A){this._hideTab(this.currentTab);this._showTab(A)},next:function(){var C=this.currentTab+1;for(var B=C;B<this.tabList.length;B++){if(this.validityFlags[this.tabList[B]]){break}else{C++}}if(C>=this.tabColumns.length){return }var A=this.currentTab;this.currentTab=C;this._hideTab(A);this._showTab(this.currentTab)},previous:function(){var C=this.currentTab-1;for(var B=C;B>=0;C--,B--){if(this.validityFlags[this.tabList[B]]){break}}if(C<0){return }var A=this.currentTab;this.currentTab=C;this._hideTab(A);this._showTab(this.currentTab)},getSelectedTab:function(){if(this.currentTab<0){return null}return this.columnList[this.currentTab]}};var HJ={Version:"1.0",DEVELOPER_VERSION:currentDomain==DEV_DOMAIN?true:false,ENABLE_PAYMENTS:true,requestQueryString:new QueryString(),DESTINATION_PAGE_PARAM:"j_dest",DESTINATION_PAGE_OUR_CAL:"our_cal",DESTINATION_PAGE_SIGNUPS:"signups",DESTINATION_PAGE_FRIENDS:"friends",DESTINATION_PAGE_INAROUND:"inAround",DESTINATION_PAGE_HOME:"home",POST_LOGIN_ACTION_PARAM:"j_action",POST_LOGIN_ACTION_ADD_EVENT:"add_event",POST_LOGIN_ACTION_SHOW_MY_INFO:"show_my_info",POST_LOGIN_ACTION_TELL_A_FRIEND:"tellAFriend",POST_LOGIN_ACTION_ORGANIZER_VIEW_SIGNUP:"organizerViewSignup",MYLIST_UUID_PARAM:"l",YUI_HISTORY_MANAGER_MODULE_DASHBOARD:"dashboard",YUI_HISTORY_MANAGER_MODULE_TEMPLATE_STEP:"templateStep",COOKIE_CONTEXT_ID:"_j_context_id_",COOKIE_USER_ID:"_hj_uid_",COOKIE_USER_EMAIL_ID:"_j_email_id_",COOKIE_CONTEXT_ID_EXPIRATION_DAYS:90,COOKIE_KEEP_LOGGED_IN:"_hj_keep_logged_in_",TEMPLATE_TYPE_ORGANIZE_VOLUNTEERS:"OrganizeVolunteers",TEMPLATE_TYPE_PRACTICE_CARPOOL:"PracticeCarpool",TEMPLATE_TYPE_GENERIC_SIGNUP:"GenericSignup",TEMPLATE_TYPE_GENERIC_INVITATION:"GenericInvitation",TEMPLATE_TYPE_SNACK_DUTY:"SnackDuty",TEMPLATE_TYPE_SIMPLE_LIST:"SimpleList",TEMPLATE_TYPE_ORGANIZE_SHIFTS:"OrganizeShifts",TEMPLATE_TYPE_COLLECT_INFORMATION:"CollectInformation",NO_CURRENT_SUBSCRIPTION:"__1$_no_2$__",NO_CURRENT_SESSION:"__1$_yes_2$__",postLoginActionProcessed:false,getDestinationPage:function(){return HJ.requestQueryString.get(HJ.DESTINATION_PAGE_PARAM,null)},getPostLoginAction:function(){return HJ.requestQueryString.get(HJ.POST_LOGIN_ACTION_PARAM,null)},createCookie:function(C,D,F,E){var A="";if(F!=null&&F>0){var B=new Date();B.setTime(B.getTime()+(F*24*60*60*1000));A="; expires="+B.toUTCString()}if(E==null||E==""){E="/"}D=escape(D);D=D.replace(/@/ig,"%40");document.cookie=C+"="+D+A+"; path="+E},readCookie:function(B){var D=B+"=";var A=document.cookie.split(";");for(var C=0;C<A.length;C++){var E=A[C];while(E.charAt(0)==" "){E=E.substring(1,E.length)}if(E.indexOf(D)==0){return E.substring(D.length,E.length)}}return null},eraseCookie:function(A,C){var B=new Date();if(C==null||C==""){C="/"}document.cookie=A+"= ; expires=Thu, 01-Jan-1970 00:00:01 GMT; path="+C},stopEvent:function(A){if(!A){var A=window.event}consumeEvent(A);return false},ignoreEnterKeyPress:function(A){Event.extend(A);if(A.keyCode==Event.KEY_RETURN){Event.stop(A)}},ignoreAnyKeyPress:function(A){Event.extend(A);Event.stop(A)},hideElements:function(){var A=document.getElementById("MainArea");if(A!=null){A.style.display="none"}A=document.getElementById("MainArea2");if(A!=null){A.style.display="none"}A=document.getElementById("homeFooter");if(A!=null){A.style.display="none"}showModalMessageDialog("Refreshing ... please wait",240,40)},copyToClipboard:function(A){if(A==null){return }Element.extend(A);A.focus();A.select();if(window.clipboardData!=undefined&&window.clipboardData!=null){window.clipboardData.setData("text",A.value)}}};HJ.DialogTemplate=Class.create();HJ.DialogTemplate.prototype={initialize:function(A){if(A==null){this.loadTemplate();return }this.dialogContainer=A.dialogContainer.cloneNode(true);this.templateLoaded()},loadTemplate:function(){var A=basePageURL+"HJ_DialogTemplate.htm";var B=document.createElement("div");if(is_ie){B.style.overflow="visible"}else{B.style.overflow="auto"}B.className="HJ_Dialog_Container";this.dialogContainer=B;this.tl=new Af.TemplateLoader(A,null,"dialogTemplate",this.dialogContainer);this.tl.listener=this;this.tl.loadTemplate(A)},templateLoaded:function(){var A=new Af.ElementCollection(this.dialogContainer);this.titleElement=A.getFirstElementById("HJ_Dialog.titleSpan");this.titleDragTarget=A.getFirstElementById("HJ_Dialog.title");this.closeButton=A.getFirstElementById("HJ_Dialog.closeButton");this.contentContainer=A.getFirstElementById("HJ_Dialog.content")},getTemplate:function(){return new HJ.DialogTemplate(this)},getElement:function(){return this.dialogContainer},setTitle:function(A){if(A==null){this.titleElement.innerHTML="";return }if(typeof A=="string"){this.titleElement.innerHTML=A}else{this.titleElement.appendChild(A)}},setCloseListener:function(A){this.closeButton.onclick=A},setContent:function(A){if(A==null){this.contentContainer.innerHTML="";return }if(typeof A=="string"){this.contentContainer.innerHTML=A}else{this.contentContainer.appendChild(A)}},getContentContainer:function(){return this.contentContainer},getTitleDragTarget:function(){return this.titleDragTarget}};HJ.Dialog=Class.create();HJ.Dialog.prototype=Object.extend(new Af.HtmlDialog(),{initialize:function(C,A,B){},HJ_Dialog_initialize:function(D,B,C){var A=this._initializeDialog(D,B,C);this.dialogTemplate=HJ.dialogTemplate.getTemplate()},createElement:function(){var A=this.dialogTemplate.getElement();this.setTitle(this.title);this.dialogTemplate.setCloseListener(this.close.bindAsEventListener(this));this.dialogTemplate.setContent(this.content);this.titleElement=this.dialogTemplate.getTitleDragTarget();this.contentContainer=this.dialogTemplate.getContentContainer();this.dialogArea=this.dialogTemplate.getContentContainer();this.element=this.dialogTemplate.getElement();this.setWidth(this.width)},postHTMLTemplate:function(C,A,F,E){this.container=A;this.sourceElementId=F;var B=new Af.TemplateLoader(C,null,F,this.dialogArea);this.tl=B;B.listener=this;var D=new Af.DataRequest(C,B.requestCompletedTemplateLoad.bind(B),requestFailedCommon,null,requestTimedoutCommon);D.xmlDoc=E;ajaxEngine.processRequest(D)},setTitle:function(A){this.title=A;this.dialogTemplate.setTitle(A)},setContent:function(A){this.content=A;this.dialogTemplate.setContent(A)},setWidth:function(A){this.width=A;if(this.width!=-1){this.element.style.width=this.width}}});HJ.App=Class.create();HJ.App.prototype={initialize:function(){this.db=null},initialize1:function(){this.enableBrowserHistory=true;var A=YAHOO.util.History.getBookmarkedState(HJ.YUI_HISTORY_MANAGER_MODULE_DASHBOARD);this.currentTabInYUIHistoryManager=A||HJ.DESTINATION_PAGE_HOME;YAHOO.util.History.register(HJ.YUI_HISTORY_MANAGER_MODULE_DASHBOARD,this.currentTabInYUIHistoryManager,this.backButtonPressHandler.bind(this));YAHOO.util.History.onReady(function(){var B;B=YAHOO.util.History.getCurrentState(HJ.YUI_HISTORY_MANAGER_MODULE_DASHBOARD)});YAHOO.util.History.initialize("yui-history-field","yui-history-iframe");document.onkeypress=this.keyPressHandler.bindAsEventListener(this);this.tabLinkClicked=false;this.templateLinkClicked=false;this.mainTab=null;this.homePageUI=new HJ.HomePageUI();this.SIHP=new HJ.SIHP();this.db=new HJ.Dashboard();this.db.init()},initialize2:function(){restrictBack();this.colorPicker=new Af.ColorPicker();this.dndMgrScribble=new Af.DndMgr2(this);this.dndMgrMyLists=new Af.DndMgr2(this);this.schedule=new HJ.Schedule();this.invitation=new HJ.Invitation();this.calenderTop=document.getElementById("calenderTop");this.myLists=new HJ.MyLists();this.myGroups=new HJ.MyGroup();this.myPeople=new HJ.MyPeople();this.myResources=new HJ.MyResources();this.myLovedOne=new HJ.MyLovedOne();this.communityCalendar=new HJ.CommunityCalendar();this.holiday=new HJ.holiday();this.resource=new HJ.Resource();this.question=new HJ.Question();this.summerCamps=new HJ.SummerCamps();this.signups=new HJ.Signups();this.currentView=null;return },initialize3:function(){this.formatPhone=new Af.PhoneFormatter();this.emailValidator=new HJ.EmailValidator();this.validator=new HJ.Validator();this.myMHM=new HJ.MyMHM();this.myInfo=new HJ.MyInfo();this.publicProfile=new HJ.MyPublicProfile();this.commResProfile=new HJ.MyCommResourcesProfile();this.seeingStar=new HJ.SeeingStar();this.seeingStarMHM=new HJ.SeeingStarMHM();this.seeingStarComRes=new HJ.SeeingStarCommResources();this.memberProfile=new HJ.SeeingStarMemberProfile();this.thankYouNote=new HJ.ThankYouNote();this.db.loadMyPeople();return },cleanup:function(){if(this.db!=null){this.dndMgrScribble.clearAll();this.dndMgrMyLists.clearAll();if(login!=null){login.cleanup()}this.db.cleanup();this.schedule.cleanup();this.invitation.cleanup();this.communityCalendar.cleanup();this.myLists.cleanup();this.myGroups.cleanup();this.myPeople.cleanup();this.myResources.cleanup();this.myLovedOne.cleanup();this.myResources.cleanup();var A=document.getElementById("MainArea");A.appendChild(this.dndMgrScribble.draggableElement);A.appendChild(this.dndMgrMyLists.draggableElement);this.colorPicker=null;this.dndMgrScribble=null;this.dndMgrMyLists=null;this.schedule=null;this.invitation=null;this.myLists=null;this.myGroups=null;this.myPeople=null;this.myResources=null;this.myLovedOne=null;this.communityCalendar=null;this.holiday=null;this.camp=null;this.resource=null;this.question=null;this.formatPhone=null;this.emailValidator=null;this.validator=null;this.myInfo=null;this.myMHM=null;this.publicProfile=null;this.commResProfile=null;this.seeingStar=null;this.seeingStarMHM=null;this.seeingStarComRes=null;this.memberProfile=null;this.thankYouNote=null}},setCurrentView:function(A){if(this.currentView==A){return }document.getElementById("content").style.backgroundColor="white";this.dndMgrScribble.clearDropZones();this.dndMgrMyLists.clearDropZones();if(this.currentView!=null&&this.currentView.setVisible){this.currentView.setVisible(false)}this.currentView=A;if(this.currentView!=null&&this.currentView.setVisible){this.currentView.setVisible(true)}this.db.QATitle.src="img/buttons/Moms_helping_moms01.jpg";this.db.communityResourcesTitle.src="img/buttons/Community_Resources01.gif"},groupUpdated:function(G,B){var C=G.people;var H=new Array();var I=new Array();for(var D=0;D<B.length;D++){var A=B[D];if(findObjIndex(C,A)<0){H.push(A)}else{I.push(A)}}for(var D=0;D<I.length;D++){var E=I[D]["group"];if(E==null){createOneToManyAssoc(I[D],"group","Group");E=I[D]["group"]}if(findObjIndex(E,G)<0){E.push(G)}}for(var D=0;D<H.length;D++){var E=H[D]["group"];if(E==null){continue}var F=findObjIndex(E,G);if(F>=0){deleteFromArray(E,E[F])}}},groupDeleted:function(D,B){for(var C=0;C<B.length;C++){var E=B[C]["group"];if(E==null){continue}var A=findObjIndex(E,D);if(A>=0){deleteFromArray(E,E[A])}}},peopleUpdated:function(H,F){var A=H.group;var G=new Array();var I=new Array();for(var C=0;C<F.length;C++){var D=F[C];if(findObjIndex(A,D)<0){G.push(D)}else{I.push(D)}}for(var C=0;C<I.length;C++){var B=I[C]["people"];if(B==null){createOneToManyAssoc(I[C],"people","Person");B=I[C]["people"]}if(findObjIndex(B,H)<0){B.push(H)}}for(var C=0;C<G.length;C++){var B=G[C]["people"];if(B==null){continue}var E=findObjIndex(B,H);if(findObjIndex(B,H)>=0){deleteFromArray(B,B[E])}}},peopleDeleted:function(E,B){for(var C=0;C<B.length;C++){var D=B[C]["people"];if(D==null){continue}var A=findObjIndex(D,E);if(A>=0){deleteFromArray(D,D[A])}}},keyPressHandler:function(B){var A=B.target?B.target:B.srcElement;var C=B.keyCode?B.keyCode:B.which;if((A.tagName!="TEXTAREA"&&A.tagName!="INPUT")&&(C==8)){consumeEvent(B);return false}},updateEventReferences:function(H,F){var B=this.workspace.schedule;o=F.addnlSchedules;var A;if(o!=null){var A=o.split(",")}else{A=new Array()}var E=trim(F.driver1);if(E!=""){A.push(E)}E=trim(F.driver2);if(E!=""){A.push(E)}for(var C=0;C<A.length;C++){var E=trim(A[C]);var G=findObjById(B,E);if(H==G||G==null){continue}var D=G.event;if(D==null){createOneToManyAssoc(G,"event","Event");D=G.event}if(findObjById(D,F.UUID)==null){D.push(F)}}},deleteEventReferences:function(A,H,F){var B=this.workspace.schedule;for(var C=0;C<A.length;C++){var E=trim(A[C]);var G=findObjById(B,E);if(H==G||G==null){continue}var D=G.event;deleteFromArray(D,F)}},setCurrentTab:function(A,B){this.mainTab=A},setCurrentTabInYUIHistoryMgr:function(C,B){if(B==null||!B){this.tabLinkClicked=true}if(this.currentTabInYUIHistoryManager!=null&&this.currentTabInYUIHistoryManager==C){return }try{YAHOO.util.History.navigate(HJ.YUI_HISTORY_MANAGER_MODULE_DASHBOARD,C);this.currentTabInYUIHistoryManager=C}catch(A){}},getCurrentTab:function(){return this.mainTab},backButtonPressHandler:function(A){if(!this.enableBrowserHistory){return false}if(this.tabLinkClicked){this.tabLinkClicked=false;if(this.templateLinkClicked){this.templateLinkClicked=false}return false}if(this.templateLinkClicked){this.templateLinkClicked=false;return false}if(this.currentTabInYUIHistoryManager==A){return false}if(A==HJ.DESTINATION_PAGE_FRIENDS||A==HJ.DESTINATION_PAGE_HOME||A==HJ.DESTINATION_PAGE_INAROUND||A==HJ.DESTINATION_PAGE_OUR_CAL){}else{A=HJ.DESTINATION_PAGE_HOME}this.setCurrentTabInYUIHistoryMgr(A,true);this.setCurrentTab(A);this.db.displayCurrentTab();return false},showBusy:function(){showModalMessageDialog("Processing ... please wait",300,40)},endBusy:function(){hideModalMessageDialog()}};function getGroupsPeople(B){var A=B;var F="";if(A==null){A=new Array()}if(A!=null){for(var C=0;C<A.length;C++){var D=A[C];D=findObjById(app.workspace.myGroup,D.UUID);if(D==null){continue}if(F==""){F="<strong>GROUPS<br/>"+D.name+"</strong><br/>"}else{F+=" <br/><strong>"+D.name+"</strong> <br/>"}var E=D.people;if(E!=null){for(pId=0;pId<E.length;pId++){var G=E[pId];G=findObjById(app.workspace.myPeople,G.UUID);if(G==null){continue}F+=(""==trim(getFullName(G))?G.email:getFullName(G))+"<br/>"}}}}return F}function getPeopleNames(E){var B=E;var A="";if(B==null){B=new Array()}for(var C=0;C<B.length;C++){var D=B[C];D=findObjById(app.workspace.myPeople,D.UUID);if(D==null){continue}if(A==""){A="<strong>INDIVIDUALS</strong><br/>"+(""==trim(getFullName(D))?D.email:getFullName(D))}else{A+="<br/>"+(""==trim(getFullName(D))?D.email:getFullName(D))}}return A}function getNewGroupsPeople(F,I){var D=F;var B="";if(D==null){D=new Array()}if(D!=null){for(var E=0;E<D.length;E++){var G=D[E];G=findObjById(app.workspace.myGroup,G.UUID);if(G==null){continue}if(I!=null&&I.length>0){var C=findObjIndex(I,G);if(C!=-1){C=null;continue}}if(B==""){B="<strong>GROUPS<br/>"+G.name+"</strong><br/>"}else{B+=" <br/><strong>"+G.name+"</strong> <br/>"}var H=G.people;if(H!=null){for(pId=0;pId<H.length;pId++){var A=H[pId];A=findObjById(app.workspace.myPeople,A.UUID);if(A==null){continue}B+=(""==trim(getFullName(A))?A.email:getFullName(A))+"<br/>"}}}}return B}function getNewPeopleNames(G,D){var B=G;var A="";if(B==null){B=new Array()}for(var C=0;C<B.length;C++){var E=B[C];E=findObjById(app.workspace.myPeople,E.UUID);if(E==null){continue}if(D!=null&&D.length>0){var F=findObjIndex(D,E);if(F!=-1){F=null;continue}}if(A==""){A="<strong>INDIVIDUALS 1 </strong><br/>"+(""==trim(getFullName(E))?E.email:getFullName(E))}else{A+="<br/>"+(""==trim(getFullName(E))?E.email:getFullName(E))}}return A}function refreshWidget(){if(app.schedule.target.style.backgroundColor!="white"){app.schedule.target.style.backgroundColor="white";if(app.schedule.scheduleTable==null){return false}var C=app.schedule.scheduleTable.selectedRowNumber;if(C!=-1){var A=app.schedule.scheduleTable.getSelectedRowData();if(A==null){return false}var B=A.color;var D=getTextColor(B);var B=getBackground(B);app.schedule.scheduleTable.unselectRow(C);app.schedule.scheduleTable.tableElement.rows[C].cells[2].style.backgroundColor=B;app.schedule.scheduleTable.tableElement.rows[C].cells[2].style.color=D}}return false}function openPopWindows(A){window.open(A,"_blank","toolbar=yes, location=yes, directories=no, status=no, //menubar=yes, scrollbars=yes, resizable=yes, copyhistory=yes, width=800, height=600");addLog("advClicked",A);return false}function addLog(A,D,C){var B=new Af.DataRequest(svcURL,addLogSuccess,requestFailedCommon,null,requestTimedoutCommon);B.addService("AuditLogService","addLog");B.addParameter("operation",A);B.addParameter("source",D);if(C!=null){B.addParameter("description",C)}ajaxEngine.processRequest(B)}function addLogSuccess(){}HJ.Footer=Class.create();HJ.Footer.prototype={initialize:function(A){this.url=basePageURL+"footer.htm";this.targetContainerId=A==null?"homeFooter":A;this.data=null},viewSelected:function(){this.doLoadTemplate()},doLoadTemplate:function(){this.load=new Af.TemplateLoader(this.url,this.targetContainerId,null);this.load.listener=this;this.load.loadTemplate()},templateLoaded:function(){var A=document.getElementById(this.targetContainerId);if(A){A.style.display="block"}this.gettingStartedLink=document.getElementById("gettingStarted");if(this.gettingStartedLink.onclick){this.gettingStartedLink.onclick=this.displayGettingStartedDialog.bindAsEventListener(this);if(app==null||login==null){this.gettingStartedLink.style.visibility="hidden"}}},displayGettingStartedDialog:function(){var A=new HJ.GettingStartedDialog();A.showTemplate();return false},show:function(){var A=document.getElementById(this.targetContainerId);if(A){A.style.display="block"}}};HJ.Login=Class.create();HJ.Login.prototype={initialize:function(A,B,C){this.returnToObject=A;this.userId="HJ User";this.userFullName="None";this.signUpEmail=null;this.userEmail=HJ.requestQueryString.get("user_email",null);this.IsNewSignUp=false;this.IsSignupAfterLogin=false;this.userId=null;this.password=null;this.showContactImporter=false;this.showLoginPageContent=B;this.showReturnDialog=(typeof (C)=="undefined")?true:C;ajaxEngine.commFailureHandler=commFailure;ajaxEngine.timoutHandler=commTimedout;this.saveTemplateAction=HJ.requestQueryString.get("saveTemplate",null);this.templateStep=HJ.requestQueryString.get("step","0");return false},cleanup:function(){if(this.loginLink!=null&&this.loginLink!=undefined){this.loginLink.onclick=null;this.sendPasswordLink.onclick=null;this.signupLink.onclick=null}},startStep1:function(){if(this.userEmail==null){var B=HJ.requestQueryString.get("contextId",null);if(B!=null){ajaxEngine.setContextId(B)}else{B=HJ.readCookie(HJ.COOKIE_CONTEXT_ID);if(B!=null&&B!=""){ajaxEngine.setContextId(B)}}}else{ajaxEngine.setContextId(null);var A=new Object();A.responseText=HJ.NO_CURRENT_SESSION;this.checkLoginRequired(A);return false}this.startCheckLoginRequired();return false},startCheckLoginRequired:function(){var A=new Af.DataRequest(svcURL,this.checkLoginRequired.bind(this),this.requestFailedCommon.bind(this),null,this.requestTimedOutCommon.bind(this));A.addService("adminSvc.loginRequired","loginRequired");ajaxEngine.processRequest(A);return false},checkLoginRequired:function(A){hideModalMessageDialog();if(A.responseText==HJ.NO_CURRENT_SESSION){HJ.eraseCookie(HJ.COOKIE_CONTEXT_ID);GATrackAction(GA_ACTION_START_LOGIN);if(this.returnToObject!=null){if(this.showReturnDialog){showMessageDialog("You need to become a member or log in before performing this action.  Start your free trial now.","Log In or Become a Member",300,100)}}if(this.showLoginPageContent!=null&&this.showLoginPageContent=="true"){if(app.footer==null||app.footer=="undefined"){app.footer=new HJ.Footer();app.footer.doLoadTemplate()}this.url=basePageURL+"SigninContent.htm";this.targetContainerId="MainArea";if(this.tl==null){this.tl=new Af.TemplateLoader(this.url,this.targetContainerId,null);this.tl.listener=this;this.tl.loadTemplate()}else{this.tl.reAttachElement()}}else{this.templateLoaded()}}else{if(A.responseText==HJ.NO_CURRENT_SUBSCRIPTION){var E=showConfirmDialog("Jooners is now a subscription service. Please consider signing up today! You'll get another free trial month before any charges are made.<br /><br />For just the cost of a good book, you can put organizing volunteers on auto-pilot for the entire year!<br /><br />For our new subscription service, please agree to our new <a href='#' onClick=\"return window.open('LegalAgreement.htm','_blank','toolbar=yes, location=yes, directories=no, status=no, menubar=yes, scrollbars=yes, resizable=yes, copyhistory=yes, width=800, height=600');\">Terms of Service</a>.","Subscription Needed",300,250,this.goToSubscriptionPage.bind(this),this.logout.bind(this),true);if(E!=null){var D=document.getElementsByClassName("ButtonStyle");for(var C=0;C<D.length;C++){if(D[C].innerHTML=="OK"){D[C].innerHTML="I agree";continue}if(D[C].innerHTML=="Cancel"){D[C].innerHTML="No thank you"}}}return }else{if(pageTracker!=null&&pageTracker!="undefined"){try{pageTracker._setVar("member")}catch(B){}}this.userId=A.responseText;this.getUserName();if(this.saveTemplateAction!=null){window.location=basePageURL+"OrganizeShifts.htm?step="+this.templateStep;return false}this.startStep2()}}},goToSubscriptionPage:function(){if(this.userEmail!=null){window.location=basePageURL+"/subscription?userEmail="+this.userEmail}else{window.location=basePageURL+"/subscription"}return false},login:function(){var A=document.getElementById("txtEmailId").value;if(A==null){A=""}else{A=trim(A)}if(A==""){showMessageDialog("Please enter your email address to begin registration .<br/>","Request",300,100);return false}if(validator.validateEmail(A)==false){showMessageDialog("Please enter a valid email address.","Request",250,100,null,true);return false}var C=document.getElementById("txtPassword").value;if(C==null){C=""}var E=document.getElementById("chkAutoLogin");this.userEmail=A;this.password=C;this.keepLoggedIn=E.checked;var D=new Af.DataRequest(svcURL,this.loginSuccessful.bind(this),this.loginFailed.bind(this),null,this.loginTimedOut.bind(this));D.addService("adminSvc.login","login");var B="<login>";B+="<userId>"+A+"</userId>";B+="<pw>"+C+"</pw>";B+="<keepLoggedIn>"+this.keepLoggedIn+"</keepLoggedIn>";B+="</login>";D.xmlDoc=B;showModalMessageDialog("Logging in ... please wait",240,40);ajaxEngine.processRequest(D);return false},loginSuccessful:function(C){var F=C.responseText.split(";");var B=F[0];var A=F[1];hideModalMessageDialog();GATrackAction(GA_ACTION_SUCCESSFUL_LOGIN);ajaxEngine.setContextId(B);var E=new Date();E.setDate(E.getDate()+HJ.COOKIE_CONTEXT_ID_EXPIRATION_DAYS);d_str=E.toGMTString();var D=document.getElementById("chkAutoLogin");if(D&&D.checked){d_str=3650;HJ.createCookie(HJ.COOKIE_KEEP_LOGGED_IN,A,d_str)}if(this.userId!=null){HJ.createCookie(HJ.COOKIE_USER_ID,this.userId,d_str)}if(this.userEmail!=null){HJ.createCookie(HJ.COOKIE_USER_EMAIL_ID,this.userEmail,d_str)}HJ.createCookie(HJ.COOKIE_CONTEXT_ID,B,d_str);ajaxEngine.setContextId(B);this.startCheckLoginRequired()},loginFailed:function(A,B){hideModalMessageDialog();showMessageDialog("We do not recognize your email address and password combination.<br/> If you need your password, please click Send me my password","Authentication failed",400,150)},loginTimedOut:function(A){hideModalMessageDialog();showMessageDialog("We do not recognize your email address and password combination.<br/> If you need your password, please click Send me my password","Authentication failed",400,150)},startStep2:function(){_useFile=false;ajaxEngine.loginRequiredHandler=loginRequired;app.initialize1();initializeTimer()},submitEmail:function(){var B="";var A=trim(document.getElementById("saveEmailId").value);if(A==""){B="Please enter a valid email address to receive information about Jooners. <br/>"}if(B!=""){showMessageDialog(B,"Request",400,150);return }if(A=="Enter your email address"){return }if(validator.validateEmail(A)==false){showMessageDialog("Please enter a valid email address.","Request",250,100,null,true);return }var C=new Af.DataRequest(svcURL,this.requestSavedSuccessful.bind(this),this.requestFailedCommon.bind(this),null,this.requestTimedOutCommon.bind(this));C.addService("PublicService","submitEmail");C.addParameter("saveEmailId",A);ajaxEngine.processRequest(C);return false},requestSavedSuccessful:function(A){debugA("Completed successful: ");showMessageDialog("Thank you.  We will contact you when our site becomes public.","Success !",300,100);document.getElementById("saveEmailId").value="Enter your email address"},requestFailedCommon:function(A,B){showMessageDialog("We are currently unable to save your email address. Please try to enter it again.","Excuse us!",350,100)},requestTimedOutCommon:function(A){showMessageDialog("We are currently unable to save your email address. Please try to enter it again.","Excuse us!",350,100)},signup:function(){var B="";var A=trim(document.getElementById("singupEmail").value);if(A==""||A=="Enter your email address here"){B="Please enter your email address to begin registration .<br/>"}if(B!=""){showMessageDialog(B,"Request",300,100);return false}if(validator.validateEmail(A)==false){showMessageDialog("Please enter a valid email address.","Request",300,100,null,true);return false}this.signUpEmail=A;var C=new Af.DataRequest(svcURL,this.requestVerifySuccessful.bind(this),this.requestFailedVerify.bind(this),null,this.requestTimedOutCommon.bind(this));C.addService("PublicService","verifyUser");C.addParameter("emailId",A);ajaxEngine.processRequest(C);return false},requestVerifySuccessful:function(A){if(A.responseText=="alreadySignedUp"){showMessageDialog("This email address is already signed up.<br/>Please try another.","Excuse us!",350,120);return }this.doSignup()},requestFailedVerify:function(A,B){if("NOT_LISTED_USER"==B){showMessageDialog("<p>We're sorry. We don't recognize the information you have given us. Please try again.</p><p>Currently our site is only open to invited guests. If you would like to be contacted when we are open to the public, please enter your email in the box at the lower left corner of page.</p> <p> Thank You !</p>"," Invited Guests Only",350,200)}else{showMessageDialog("The email you have entered does not match our records.  Please try again.","Informing You",350,100)}},doSignup:function(){var B=HJ.readCookie(HJ.COOKIE_CONTEXT_ID);if(B!=null&&B!=""){window.location=basePageURL+"Signin.htm";return false}this.IsNewSignUp=true;GATrackAction(GA_ACTION_START_REGISTRATION);var A=new Af.TemplateLoader(basePageURL+"SignUp2.html","MainArea");A.listener=this;A.loadTemplate()},joinHJ:function(){var K="";var H="";var G=trim(document.getElementById("userId").value);if(G==""){K="Please enter a screen name you will use while on Jooners. It will be used to protect your identity.<br/>"}if(this.signUpEmail==null){H=trim(document.getElementById("email").value);if(H==""){K+="Please enter your email address.<br/>"}if(validator.validateEmail(H)==false){K+="Please enter a valid email address.<br/>"}}else{H=this.signUpEmail}if(K!=""){showMessageDialog(K,"Request",330,150,null,true);return }var D=/[0-9a-zA-Z]$/;var J=trim(document.getElementById("password").value);var B=trim(document.getElementById("rptPassword").value);if(!D.test(J)||!D.test(B)||B.length<6||J.length<6){if(J.length<6||B.length<6){showMessageDialog("Password must be at least 6 characters.","Excuse us!",320,110);return }showMessageDialog("No Special characters allowed.","Excuse us!",320,110);return }if(J!=B){showMessageDialog("The password you entered doesn't match.  Please try again.","Request",300,100);return }var E=document.getElementById("agreedCheck");debugA("agreedCheck.checked: "+E.checked);if(E!=null&&!E.checked){showMessageDialog("Please read our User Agreement and check the box to agree to its terms.","Request",350,100);return }var A=trim(document.getElementById("lName").value);var F=trim(document.getElementById("fName").value);var C=trim(document.getElementById("zip").value);var K='<user class="User">';K+=xmlP("userId",G);K+=xmlP("email",H);K+=xmlP("password",J);K+=xmlP("rptPassword",B);K+=xmlP("lName",A);K+=xmlP("fName",F);K+=xmlP("zip",C);K+="</user>";this.userId=G;this.userEmail=H;this.password=J;var I=new Af.DataRequest(svcURL,this.joinSuccessful.bind(this),this.joinFailed.bind(this),null,this.joinTimedOut.bind(this));I.addService("adminSvc.register","register");I.xmlDoc=K;app.showBusy();ajaxEngine.processRequest(I)},joinSuccessful:function(A){app.endBusy();if(this.userId!=null){HJ.createCookie(HJ.COOKIE_USER_ID,this.userId,HJ.COOKIE_CONTEXT_ID_EXPIRATION_DAYS)}if(this.userEmail!=null){HJ.createCookie(HJ.COOKIE_USER_EMAIL_ID,this.userEmail,HJ.COOKIE_CONTEXT_ID_EXPIRATION_DAYS)}GATrackAction(GA_ACTION_SUCCESSFUL_REGISTRATION);ActionTracker.track(ActionTracker.TRACKED_ACTION_SUCCESSFUL_REGISTRATION);window.location=basePageURL+"/subscription?userEmail="+this.userEmail;return false;HJ.createCookie(HJ.COOKIE_CONTEXT_ID,A.responseText,HJ.COOKIE_CONTEXT_ID_EXPIRATION_DAYS);ajaxEngine.setContextId(A.responseText);this.startCheckLoginRequired();this.showContactImporter=true},joinFailed:function(A,B){app.endBusy();showMessageDialog(B,"A problem was encountered",350,100)},joinTimedOut:function(A){hideModalMessageDialog();showMessageDialog("We are currently unable to process your registration.<br/> Please try again.","Excuse us!",300,100)},logout:function(){var A=new Af.DataRequest(svcURL,this.logoutStep2.bind(this),this.requestFailedCommon.bind(this),null,this.requestTimedOutCommon.bind(this));A.addService("adminSvc.logout","logout");ajaxEngine.processRequest(A);this.IsSignupAfterLogin=true;showModalMessageDialog("Logging out ...",240,40);return false},logoutStep2:function(){stopTimer();HJ.eraseCookie(HJ.COOKIE_CONTEXT_ID);HJ.eraseCookie(HJ.COOKIE_USER_EMAIL_ID);HJ.eraseCookie(HJ.COOKIE_KEEP_LOGGED_IN);HJ.eraseCookie("JSESSIONID");HJ.eraseCookie("JSESSIONID","/rose");hideModalMessageDialog();window.location=basePageURL+"Signin.htm";return false},doVerifyUser:function(){var A=new Af.TemplateLoader(basePageURL+"NeedPassword.htm","signinContainer");A.listener=this;A.loadTemplate();return false},verifyPassword:function(){var B="";var A=trim(document.getElementById("txtEmailId").value);if(A==""){B="Please enter your email address and we will send you your password.<br/>"}if(B!=""){showMessageDialog(B,"Request",400,150);return }var C=new Af.DataRequest(svcURL,this.requestVerifyUserIdSuccessful.bind(this),this.requestFailedVerifyUserId.bind(this),null,this.requestTimedOutCommon.bind(this));C.addService("PublicService","verifyUser");C.addParameter("emailId",A);ajaxEngine.processRequest(C)},requestVerifyUserIdSuccessful:function(A){this.doVerifyUser()},requestFailedVerifyUserId:function(A,B){if("NOT_LISTED_USER"==B){showMessageDialog("Please enter the email address you used to sign-up with Jooners.","Request",350,100)}else{showMessageDialog("This email was returned from the server and is undeliverable.","Excuse us!",350,100)}},doSendPassword:function(){var B="";var A=trim(document.getElementById("emailId").value);if(A==""){B="Please enter your email address  to get the password<br/>"}if(validator.validateEmail(A)==false){B+="The email address you gave us is not valid.  Please try again."}if(B!=""){showMessageDialog(B,"Request",400,150,null,true);return }this.enteredEmail=A;var C=new Af.DataRequest(svcURL,this.sendPasswordSuccessful.bind(this),this.failedtoSendEmail.bind(this),null,this.requestTimedOutSendEmail.bind(this));C.addService("AccessControlSvc","sendPassword");C.addParameter("emailId",A);ajaxEngine.processRequest(C)},sendPasswordSuccessful:function(A){showMessageDialog("This email has been successfully sent.","Success!",300,80);this.doSentSuccessful()},failedtoSendEmail:function(A,B){showMessageDialog(B,"Excuse us!",350,100)},requestTimedOutSendEmail:function(){showMessageDialog("We are currently unable to send your password.  Please request it again.","Excuse us!",350,100)},doSentSuccessful:function(){var A=new Af.TemplateLoader(basePageURL+"PasswordSent.htm","signinContainer");A.listener=this;this.showSent=false;A.loadTemplate();this.showSent=true},templateLoaded:function(){if(this.showSent!=null&&this.showSent==true){this.showSent=false;document.getElementById("sendTo").innerHTML=this.enteredEmail}var E=navigator.appName;var C=parseInt(navigator.appVersion);if(E=="Microsoft Internet Explorer"&&C<=6){document.getElementById("joonersLogo").src="img/logo.gif"}this.loginLink=document.getElementById("loginLink");this.sendPasswordLink=document.getElementById("sendPasswordLink");this.signupLink=document.getElementById("signupLink");this.fbOkButton=document.getElementById("fbOkButton");this.pwElement=document.getElementById("txtPassword");var F=document.getElementById("singupEmail");if(F!=null){Event.observe(F,"click",this.eraseTextFieldValue.bindAsEventListener(this))}if(this.fbOkButton!=null){}if(this.loginLink!=null){this.loginLink.onclick=this.login.bind(this)}if(this.pwElement!=null){Event.observe(this.pwElement,"keypress",this.processPasswordKeypress.bindAsEventListener(this))}if(this.sendPasswordLink!=null){this.sendPasswordLink.onclick=this.doVerifyUser.bind(this)}if(this.signupLink!=null){this.signupLink.onclick=this.signup.bind(this)}var A=document.getElementById("txtEmailId");if(A==null){return }if(this.userEmail==null){this.userEmail=HJ.readCookie(HJ.COOKIE_USER_EMAIL_ID)}if(this.userId==null){this.userId=HJ.readCookie(HJ.COOKIE_USER_ID)}if(this.userEmail!=null){this.userEmail=this.userEmail.replace(/%40/ig,"@");A.value=this.userEmail}if(this.showSent){var D=document.getElementById("sendTo");D.innerHTML=this.enteredEmail}if(this.IsNewSignUp){this.IsNewSignUp=false;var B=document.getElementById("email");if(this.signUpEmail!=null){B.readOnly=true;B.value=this.signUpEmail}return }else{if(this.IsSignupAfterLogin){this.IsSignupAfterLogin=false}}},goBack:function(){window.location.href="index.htm"},goSignIn:function(){window.location.href="Signin.htm"},doCancel:function(){window.location.href="index.htm"},getUserName:function(){var A=new Af.DataRequest(svcURL,this.reqGetUserComplete.bind(this),this.reqGetUserFailed.bind(this),null,this.reqGetUserTimeOut.bind(this));A.addService("AccessControlSvc","getUserProfile");A.addParameter("userId",this.userId);ajaxEngine.processRequest(A)},reqGetUserComplete:function(B){var A=new Af.XMLToDataSet(B.responseXML);this.userData=A.data;this.userFullName=this.userData.fName;this.userEmail=this.userData.email;var D=new Date();D.setDate(D.getDate()+HJ.COOKIE_CONTEXT_ID_EXPIRATION_DAYS);d_str=D.toGMTString();var C=HJ.readCookie(HJ.COOKIE_KEEP_LOGGED_IN);if(C&&C!=""){d_str=3650}HJ.createCookie(HJ.COOKIE_USER_EMAIL_ID,this.userEmail,d_str)},reqGetUserFailed:function(){this.userFullName=this.userId},reqGetUserTimeOut:function(){this.userFullName=this.userId},homepageBtnClicked:function(){index.fbOkBtnClicked()},pingCompleted:function(A){startTimer()},pingFailed:function(A){debug("Ping failed ...");loginRequired()},processPasswordKeypress:function(A){Event.extend(A);if(A.keyCode!=null&&A.keyCode==Event.KEY_RETURN){this.login();return false}},eraseTextFieldValue:function(A){Event.extend(A);if(Event.element(A).value=="Enter your email address here"){Event.element(A).value=""}}};var count;var timerID=null;var timerRunning=false;var delay=1000*60*5;function initializeTimer(){timerID=null;timerRunning=false;stopTimer()}function stopTimer(){if(timerRunning){clearTimeout(timerID)}timerRunning=false}function startTimer(){timerID=setTimeout("sendPingRequest()",delay);timerRunning=true}function sendPingRequest(){if(currentDomain==DEV_DOMAIN){return }var A=new Af.DataRequest(svcURL,login.pingCompleted.bind(this),login.pingFailed.bind(this),null,login.pingFailed.bind(this));A.addService("PingService","ping");ajaxEngine.processRequest(A)}function loginRequired(){stopTimer();var A='<h1><span style="font-size:18.0pt">You\'re Now Signed Off</span></h1><p style="font-size:12.0pt">Thank you for using <em>Jooners</em>. Your session has ended.</p><p style="font-size:12.0pt">In order to access your account information, you will need to <a href="Signin.htm">Sign In</a> again.<br/> </p>';showMessageDialog(A,"Request",400,200,login.goSignIn,false,true)}function commFailure(B){stopTimer();try{console.log(B.stack)}catch(A){}var C='<h1><span style="font-size:18.0pt">Your session on Jooners has ended due to an interruption in communications.</span></h1><p style="font-size:12.0pt">We are sorry for the inconvenience.</p><p style="font-size:12.0pt">In order to access your account information, you will need to <a href="Signin.htm">Sign In</a> again.<br/> </p><p style="font-size:12.0pt">If the problem persists, please try in few minutes. We may be temporarily out of service for maintenance.</p>';showMessageDialog(C,"Request",600,240,login.goSignIn,false,true)}function commTimedout(){stopTimer();var A='<h1><span style="font-size:18.0pt">Your session on Jooners has ended due to an interruption in communications.</span></h1><p style="font-size:12.0pt">We are sorry for the inconvenience.</p><p style="font-size:12.0pt">In order to access your account information, you will need to <a href="Signin.htm">Sign In</a> again.<br/> </p><p style="font-size:12.0pt">If the problem persists, please try in few minutes. We may be temporarily out of service for maintenance.</p>';showMessageDialog(A,"Request",600,240,login.goSignIn,false,true)}HJ.TellAFriendPage=Class.create();HJ.TellAFriendPage.prototype={initialize:function(){this.url=basePageURL+"tellafriend_general.html";this.sourceContainerId="tellafriend_form_wrapper";this.targetContainerId="tellafriend_form_wrapper";this.data=null;this.tl=null;this.emailValidator=new HJ.EmailValidator();this.thankYouNote=new HJ.ThankYouNote();this.showThankYou=false},cleanup:function(){},init:function(A){if(A!=null){this.targetContainerId=A;this.sourceContainerId="tellAFriendFormContent"}if(this.tl==null){this.tl=new Af.TemplateLoader(this.url,this.targetContainerId,this.sourceContainerId);this.tl.listener=this;this.tl.loadTemplate()}else{this.tl.reAttachElement()}this.isCommunityResource=false;this.emails="";ajaxEngine.commFailureHandler=commFailure;ajaxEngine.timoutHandler=commTimedout},templateLoaded:function(){if(this.showThankYou){return }var A=new Af.ElementCollection(this.tl.element);if(login!=null){var B=document.getElementById("tellAFriendHeaderImage");if(B){B.style.display="none"}}this.subjectElem=A.getFirstElementById("subject");this.sendButtonElem=A.getFirstElementById("send");this.armedButton=this.sendButtonElem;this.dontSendButtonElem=A.getFirstElementById("dontSend");this.sendButtonElem.onclick=this.doSendEmail.bind(this);this.dontSendButtonElem.onclick=this.doDontSend.bind(this);this.toEmailListErrorMsgElem=A.getFirstElementById("toEmailListErrorMsg");this.subjectErrorMsgElem=A.getFirstElementById("subjectErrorMsg");this.toEmailListElem=A.getFirstElementById("toEmailList");this.personalNote=A.getFirstElementById("personalNote");this.subjectDefaultValue='Be a "Jooner" like me!';this.toEmailListElem.onfocus=this.focusOnToEmailListElem.bindAsEventListener(this);this.toEmailListElem.onblur=this.focusLostToEmailListElem.bindAsEventListener(this);this.emailsDefaultValue=this.toEmailListElem.value;this.mySetObj()},requestTellAFriendCompleted:function(A){if(this.invalidEmails!=""){alert("We are unable to send email to the following email addresses:<BR/> "+this.invalidEmails)}alert("Email sent to your friends ","Email Sent",300,100);GATrackAction(GA_ACTION_SUCCESSFUL_TELL_A_FRIEND);if(app!=null&&app.db!=null){app.db.displayCurrentTab()}else{window.location=basePageURL}},requestFailedCommon:function(A,B){alert("We are currently unable to process this tell a friend request. <br/> Please try again.")},requestTimedoutCommon:function(A){alert("We are currently unable to process this tell a friend request. <br/> Please try again.")},doDontSend:function(){if(app!=null){app.db.displayCurrentTab()}else{window.location=basePageURL}return false},mySetObj:function(){if(this.toEmailListElem!=null){this.toEmailListElem.value="Enter email addresses separated by commas";this.emailsDefaultValue=this.toEmailListElem.value}},focusOnToEmailListElem:function(A){var B=this.toEmailListElem.value;if(B==null){B=""}else{B=trim(B)}if(B==trim(this.emailsDefaultValue)||B==""){this.toEmailListElem.value="";consumeEvent(A)}this.toEmailListElem.focus()},validateToEmailListElem:function(){this.emails="";this.invalidEmails="";if((this.toEmailListElem.value!=this.emailsDefaultValue)){var C=trim(this.toEmailListElem.value);var A=C.split(",");if(A.length==1){A=A[0].split(";")}for(var B=0;B<A.length;B++){C=trim(A[B]);if(this.emailValidator.validateEmail(C)==false){if(C!=""){if(this.invalidEmails==""){this.invalidEmails+=C}else{if(this.invalidEmails.indexOf(C)==-1){this.invalidEmails+=","+C}}}continue}C=this.emailValidator.extractEmailAddress(C);if(C!=""){if(this.emails==""){this.emails+=C}else{if(this.emails.indexOf(C)<0){this.emails+=","+C}}}}}if(this.emails==""||this.invalidEmails!=""){this.toEmailListErrorMsgElem.style.display="block";return false}this.toEmailListErrorMsgElem.style.display="none";return true},focusLostToEmailListElem:function(A){var B=this.toEmailListElem.value;if(B==null){B=""}else{B=trim(B)}if(B==trim(this.emailsDefaultValue)||B==""){this.toEmailListElem.value=this.emailsDefaultValue}if(!this.validateToEmailListElem()){this.toEmailListElem.focus();return false}this.toEmailListErrorMsgElem.style.display="none";return true},doSendEmail:function(A){var D=this.validateToEmailListElem(A);if(!D){alert("Please correct the errors shown");consumeEvent(A);return false}var C=new Af.DataRequest(svcURL,this.requestTellAFriendCompleted.bind(this),this.requestFailedCommon.bind(this),null,this.requestTimedoutCommon.bind(this));C.addService("CommunityResourceService","tellAFriend");C.addParameter("emails",xmlEncode(this.emails));var B="<messages>";B+="<subject>"+xmlEncode(this.subjectDefaultValue)+"</subject>";B+="<senderName>"+xmlEncode(login.userData.fName+" "+login.userData.lName)+"</senderName>";B+="<senderEmailAddress>"+xmlEncode(login.userData.email)+"</senderEmailAddress>";B+="<personalNote>"+xmlEncode(this.personalNote.value)+"</personalNote>";B+="</messages>";C.xmlDoc=B;ajaxEngine.processRequest(C);return false}};HJ.TellAFriendDialog=Class.create();HJ.TellAFriendDialog.prototype=Object.extend(new HJ.Dialog(),{initialize:function(A){this.HJ_Dialog_initialize("Invite Friends",null,null);this.obj=null;this.url=basePageURL+"TellAFriendDialog.htm";this.toEmailList=A;this.emailValidator=new HJ.EmailValidator()},showTemplate:function(){this.showHTMLTemplate(this.url,"MainArea","tellAFriendFormContent");this.centerDialog(520,250);this.emails="";ajaxEngine.commFailureHandler=commFailure;ajaxEngine.timoutHandler=commTimedout},templateLoaded:function(){hideModalMessageDialog();var A=new Af.ElementCollection(this.element);this.sendButtonElem=A.getFirstElementById("send");this.armedButton=this.sendButtonElem;this.sendButtonElem.onclick=this.doSendEmail.bind(this);this.toEmailListErrorMsgElem=A.getFirstElementById("toEmailListErrorMsg");this.toEmailListElem=A.getFirstElementById("toEmailList");this.personalNote=A.getFirstElementById("personalNote");this.toEmailListElem.onfocus=this.focusOnToEmailListElem.bindAsEventListener(this);this.toEmailListElem.onblur=this.focusLostToEmailListElem.bindAsEventListener(this);this.emailsDefaultValue=this.toEmailListElem.value;if(this.toEmailList!=null){this.toEmailListElem.value=this.toEmailList}},requestTellAFriendCompleted:function(A){if(this.invalidEmails!=""){alert("We are unable to send email to the following email addresses:<BR/> "+this.invalidEmails);return false}alert("Email sent to your friends ","Email Sent",300,100);GATrackAction(GA_ACTION_SUCCESSFUL_TELL_A_FRIEND);this.close();return false},requestFailedCommon:function(A,B){alert("We are currently unable to process this tell a friend request. <br/> Please try again.")},requestTimedoutCommon:function(A){alert("We are currently unable to process this tell a friend request. <br/> Please try again.")},doDontSend:function(){if(app!=null){app.db.displayCurrentTab()}else{window.location=basePageURL}return false},focusOnToEmailListElem:function(A){var B=this.toEmailListElem.value;if(B==null){B=""}else{B=trim(B)}if(B==trim(this.emailsDefaultValue)||B==""){this.toEmailListElem.value="";consumeEvent(A)}this.toEmailListElem.focus()},validateToEmailListElem:function(){this.emails="";this.invalidEmails="";if((this.toEmailListElem.value!=this.emailsDefaultValue)){var C=trim(this.toEmailListElem.value);var A=C.split(",");if(A.length==1){A=A[0].split(";")}for(var B=0;B<A.length;B++){C=trim(A[B]);if(this.emailValidator.validateEmail(C)==false){if(C!=""){if(this.invalidEmails==""){this.invalidEmails+=C}else{if(this.invalidEmails.indexOf(C)==-1){this.invalidEmails+=","+C}}}continue}C=this.emailValidator.extractEmailAddress(C);if(C!=""){if(this.emails==""){this.emails+=C}else{if(this.emails.indexOf(C)<0){this.emails+=","+C}}}}}if(this.emails==""||this.invalidEmails!=""){this.toEmailListErrorMsgElem.style.display="block";return false}this.toEmailListErrorMsgElem.style.display="none";return true},focusLostToEmailListElem:function(A){var B=this.toEmailListElem.value;if(B==null){B=""}else{B=trim(B)}if(B==trim(this.emailsDefaultValue)||B==""){this.toEmailListElem.value=this.emailsDefaultValue}if(!this.validateToEmailListElem()){this.toEmailListElem.focus();return false}this.toEmailListErrorMsgElem.style.display="none";return true},doSendEmail:function(A){var D=this.validateToEmailListElem(A);if(!D){alert("Please correct the errors shown");consumeEvent(A);return false}var C=new Af.DataRequest(svcURL,this.requestTellAFriendCompleted.bind(this),this.requestFailedCommon.bind(this),null,this.requestTimedoutCommon.bind(this));C.addService("WorkspaceService","tellAFriend");C.addParameter("emails",xmlEncode(this.emails));var B="<messages>";B+="<personalNote>"+xmlEncode(this.personalNote.value)+"</personalNote>";B+="</messages>";C.xmlDoc=B;ajaxEngine.processRequest(C);return false}});HJ.Dashboard=Class.create();HJ.Dashboard.prototype={initialize:function(){this.url=basePageURL+"Dashboard.htm";this.targetContainerId="MainArea";this.url1=basePageURL+"CommunityResources.htm";this.data=null;this.previousIdleHandler=null;var A=HJ.getDestinationPage();if(A==null){A=HJ.DESTINATION_PAGE_HOME}this.inviteFriendsRequest=HJ.requestQueryString.get("j_invite_friends",null);this.inviteFriendsDialogDisplayed=false;this.workspace=null;this.loadWorkspaceCalled=false;app.setCurrentTabInYUIHistoryMgr(A,true);app.setCurrentTab(A);this.previousIdleHandler=ajaxEngine.setIdleHandler(this.idleHandler.bind(this));this.myPeopleLoaded=false},cleanup:function(){this.logoutLink=null;this.inputBoxSubmit=null},init:function(){if(this.tl==null){showModalMessageDialog("Loading Your Jooners ... please wait",300,40);this.tl=new Af.TemplateLoader(this.url,this.targetContainerId,null);this.tl.listener=this;this.tl.loadTemplate()}else{this.tl.reAttachElement();this.tl.element.style.display="block"}},displayCurrentTab:function(){if(this.workspace==null){this.waitForWorkspaceLoad(this.displayCurrentTab.bind(this),true)}if(app.getCurrentTab()==HJ.DESTINATION_PAGE_OUR_CAL){this.displayCalendarTab()}else{if(app.getCurrentTab()==HJ.DESTINATION_PAGE_FRIENDS){this.displayFriendsTab()}else{app.homePageUI.loadNewHomePageTemplate()}}},waitForWorkspaceLoad:function(A,B){if(this.workspace!=null&&app.schedule.scheduleList!=null){hideModalMessageDialog();this.methodToCallAfterWorkspaceLoad();return false}if(B!=null&&B==true){this.methodToCallAfterWorkspaceLoad=A}showModalMessageDialog("Loading ... please wait",300,40);setTimeout(this.waitForWorkspaceLoad.bind(this),100)},templateLoaded:function(){dndMgr.registerDropZone(new Af.Dropzone(this,$("MainArea")));this.setHeaderLinks();app.initialize2();var B=navigator.appName;var A=parseInt(navigator.appVersion);if(B=="Microsoft Internet Explorer"&&A<=6){document.getElementById("joonersLogo").src="img/logo.gif"}this.scribbleTitlePane=new Af.HtmlTitlePane2("scribbleTitlePane","scribbleTitle","openClose","openClose",this);this.scheduleTitlePane=new Af.HtmlTitlePane2("scheduleTitleInternalPane","scheduleTitle","openClose","openClose",this);this.myListsTitlePane=new Af.HtmlTitlePane2("myListsTable","myListsTitle","openClose","openClose",this);this.peopleTitlePane=new Af.HtmlTitlePane2("peopleTitlePane","peopleTitle","openClose","openClose",this);this.communityTitlePane=new Af.HtmlTitlePane2("communityTitlePane","communityTitle","openClose","openClose",this);this.myScheduleTitlePane=new Af.HtmlTitlePane2("scheduleTable","myScheduleTitle","boxLink open","boxLink closed",this);this.sharedScheduleTitlePane=new Af.HtmlTitlePane2("sharedScheduleTable","sharedScheduleTitle","boxLink open","boxLink closed",this);this.invitationTitlePane=new Af.HtmlTitlePane2("invitationTable","invitationTitle","boxLink open","boxLink closed",this);this.communityResourcesTitle=document.getElementById("communityResourcesTitle");this.communityResourcesTitle.onclick=this.displayCommunityResourcesSubTab.bind(this);this.QATitle=document.getElementById("MHMTitle");this.QATitle.onclick=this.displayQASubTab.bind(this);this.communityCalenderTitle=document.getElementById("communityCalenderTitle");this.communityCalenderTitle.onclick=this.displayCommCalendarSubTab.bind(this);this.holidayTitle=document.getElementById("holidayTitle");this.holidayTitle.onclick=this.displayHolidaySubTab.bind(this,true);this.homePage=document.getElementById("homePage");this.homePage.onclick=this.handleHomeTabClick.bind(this);this.friends=document.getElementById("friends");this.friends.onclick=this.handleFriendsTabClick.bind(this);this.ourCalendar=document.getElementById("ourCalendar");this.ourCalendar.onclick=this.handleCalendarTabClick.bind(this);this.navBox=document.getElementById("tabs");this.contentBox=document.getElementById("content");this.calenderTop=document.getElementById("calenderTop");this.planningDiv=document.getElementById("planningDiv");this.pageBottom=document.getElementById("pageBottom");this.commCalBox=document.getElementById("commCal");this.scheduleBox=document.getElementById("scheduleTitlePane");this.leftNavAd=document.getElementById("leftNavAd");this.listBox=document.getElementById("myListsTitlePane");this.peopleBox=document.getElementById("peopleBox");this.promptsDiv=document.getElementById("promptsDiv");this.promptCreateSignups=document.getElementById("createSignups");this.promptCreateSignups.onclick=this.displaySignupsTab.bind(this);this.promptWriteScribbles=document.getElementById("writeScribbles");this.promptWriteScribbles.onclick=this.displayFriendsTab.bind(this);this.promptSeeCommunityEvents=document.getElementById("seeCommunityEvents");this.promptSeeCommunityEvents.onclick=this.displayCommCalendarSubTab.bind(this);this.promptSeeCommunityResources=document.getElementById("seeCommunityResources");this.promptSeeCommunityResources.onclick=this.displayCommunityResourcesSubTab.bind(this);this.leftNavPlanningDiv=document.getElementById("leftNavPlanningDiv");this.subTabs=document.getElementById("tabsII");if(app.getCurrentTab()!=HJ.DESTINATION_PAGE_HOME){this.loadWorkspace();return }app.homePageUI.loadNewHomePageTemplate();hideModalMessageDialog()},handleHomeTabClick:function(A){app.setCurrentTabInYUIHistoryMgr(HJ.DESTINATION_PAGE_HOME);app.homePageUI.loadNewHomePageTemplate();if(!A){var A=window.event}if(A){YAHOO.util.Event.stopEvent(A)}if(app.footer==null||app.footer=="undefined"){app.footer=new HJ.Footer();app.footer.doLoadTemplate()}app.footer.show();return false},handleFriendsTabClick:function(A){app.setCurrentTabInYUIHistoryMgr(HJ.DESTINATION_PAGE_FRIENDS);this.displayFriendsTab();if(!A){var A=window.event}if(A){YAHOO.util.Event.stopEvent(A)}if(app.footer==null||app.footer=="undefined"){app.footer=new HJ.Footer();app.footer.doLoadTemplate()}app.footer.show();return false},handleCalendarTabClick:function(A){app.setCurrentTabInYUIHistoryMgr(HJ.DESTINATION_PAGE_OUR_CAL);this.displayCalendarTab();if(!A){var A=window.event}if(A){YAHOO.util.Event.stopEvent(A)}if(app.footer==null||app.footer=="undefined"){app.footer=new HJ.Footer();app.footer.doLoadTemplate()}app.footer.show();return false},handleInAroundTabClick:function(A){app.setCurrentTabInYUIHistoryMgr(HJ.DESTINATION_PAGE_INAROUND);this.displayInAroundTab();if(!A){var A=window.event}if(A){YAHOO.util.Event.stopEvent(A)}if(app.footer==null||app.footer=="undefined"){app.footer=new HJ.Footer();app.footer.doLoadTemplate()}app.footer.show();return false},viewSelected:function(A){if(A.titleId=="myListsTitle"){this.displayCalendarHeader(false);app.myLists.viewSelected(this)}else{if(A.titleId=="scheduleTitle"||A.titleId=="myScheduleTitle"||A.titleId=="sharedScheduleTitle"||A.titleId=="invitationTitle"){this.displayCalendarHeader(true);app.schedule.viewSelected(this)}else{if(A.titleId=="peopleTitle"){this.displayCalendarHeader(false);app.myPeople.viewSelected(this)}else{if(A.titleId=="communityTitle"){this.displayCalendarHeader(false);app.communityCalendar.viewSelected(this)}}}}return false},loadWorkspace:function(){if(this.workspace!=null){return true}if(this.loadWorkspaceCalled){return false}this.loadWorkspaceCalled=true;var A=new Af.DataRequest(svcURL,this.requestWorkspaceLoadCompleted.bind(this),this.requestFailedCommon.bind(this),null,this.requestTimedoutCommon.bind(this));A.addService("WorkspaceService","getWorkspaceSimple");ajaxEngine.processRequest(A)},requestWorkspaceLoadCompleted:function(B){var A=new Af.XMLToDataSet(B.responseXML);this.workspace=A.data;app.workspace=this.workspace;this.completeWorkspace(this.workspace);app.schedule.setWorkspace(this.workspace);app.invitation.setDataList(this.workspace.invitation);app.myLists.setDataList(this.workspace.myList);app.initialize3();app.myGroups.setDataList(this.workspace.myGroup,this.workspace.myPeople);app.myPeople.setDataList(this.workspace.myPeople,this.workspace.myGroup);app.myLovedOne.setDataList(this.workspace.myLove);app.myResources.setDataList(this.workspace.myResource);if(app.getCurrentTab()!=HJ.DESTINATION_PAGE_HOME){hideModalMessageDialog();this.displayCurrentTab();document.getElementById("homeFooter").style.display="block"}if(app.footer==null||app.footer=="undefined"){app.footer=new HJ.Footer();app.footer.doLoadTemplate()}if(login.showContactImporter!=null&&login.showContactImporter){login.showContactImporter=false;this.inviteFriendsDialogDisplayed=true;var C=new HJ.ContactImporter();C.showTemplate(true,false)}},requestFailedCommon:function(A,B){hideDialogWin();showMessageDialog("We are currently unable to create this display. Please try again.","Excuse us!",350,100)},requestTimedoutCommon:function(){hideDialogWin();showMessageDialog("We are currently unable to create this display. Please try again.","Excuse us!",350,100)},paneStateChanged:function(B){var A=document.getElementById(B.titleId+"Img");if(!B.open){if(A!=null){A.src="img/plus.gif"}}else{if(A!=null){A.src="img/minus.gif"}}return ;if(this.scribbleTitlePane==null){return false}this.updateScribbleState();this.updateAnnounceState();this.updateCalendarState();return false},updateScribbleState:function(){var A=document.getElementById("scribbleTitleContaner");if(this.scribbleTitlePane.open){if(this.miniCalTitlePane.open){A.className="box largeScrollBox"}else{A.className="box largeScrollBox largeScrollBoxOpen"}}else{A.className="box closed scribblesBoxClosed"}},updateAnnounceState:function(){var C=document.getElementById("announceId");var D=document.getElementById("googleBoxId");var B=document.getElementById("hjAnnouncementId");var A=document.getElementById("content");if(this.scribbleTitlePane.open){C.className="googleAnnounce";D.className="googleBox";B.className="hjAnnouncement";C.insertBefore(B,D);A.className="contentScribble"}else{C.className="noScribble";D.className="noScribble_googleBox";B.className="noScribble_hjAnnouncement";C.insertBefore(D,B);A.className="contentNoScribble"}},updateCalendarState:function(){var D=document.getElementById("scribbleTitleContaner");var C=document.getElementById("miniCalContaner");var B=document.getElementById("leftBar");if(this.scribbleTitlePane.open&&this.miniCalTitlePane.open){C.className="box miniCal";D.parentNode.insertBefore(C,B)}else{C.className="box soloCal";var A=document.getElementById("scheduleTitlePane");B.insertBefore(C,A)}},displaySignupsTab:function(){app.homePageUI.loadNewHomePageTemplate();return false},displayCalendarTab:function(){if(this.workspace==null){this.waitForWorkspaceLoad(this.displayCalendarTab.bind(this),true);return false}if(HJ.getPostLoginAction()!=null&&HJ.getPostLoginAction()==HJ.POST_LOGIN_ACTION_SHOW_MY_INFO&&!HJ.postLoginActionProcessed){HJ.postLoginActionProcessed=true;this.displayMyInfo();return false}app.schedule.monthlyCalendarSelected();app.schedule.viewSelected(this);app.setCurrentTab(HJ.DESTINATION_PAGE_OUR_CAL);this.init();this.tl.element.style.display="";this.navBox.className="calendar-page";this.listBox.style.display="none";this.peopleBox.style.display="none";this.subTabs.style.display="none";this.commCalBox.style.display="block";this.scheduleBox.style.display="block";this.displayCalendarHeader(true);this.leftNavPlanningDiv.style.display="block";this.leftNavAd.style.display="none";this.planningDiv.style.display="inline";this.pageBottom.style.display="none";this.promptsDiv.style.display="block";this.contentBox.style.display="block";return false},displayInAroundTab:function(){return this.displayCalendarTab();this.init();app.setCurrentTab(HJ.DESTINATION_PAGE_INAROUND);this.tl.element.style.display="";this.navBox.className="city-page";this.promptsDiv.style.display="none";this.displayHolidaySubTab();return false},displayFriendsTab:function(){if(this.workspace==null){this.waitForWorkspaceLoad(this.displayFriendsTab.bind(this),true);return false}this.init();app.setCurrentTab(HJ.DESTINATION_PAGE_FRIENDS);if(!this.loadWorkspace()){return false}this.tl.element.style.display="";app.myPeople.viewSelected();this.navBox.className="friends-page";this.listBox.style.display="none";this.peopleBox.style.display="block";this.subTabs.style.display="none";this.commCalBox.style.display="none";this.scheduleBox.style.display="none";this.displayCalendarHeader(false);this.leftNavPlanningDiv.style.display="block";this.leftNavAd.style.display="none";this.planningDiv.style.display="inline";this.pageBottom.style.display="none";this.contentBox.style.backgroundColor="#ffffff";this.promptsDiv.style.display="none";if(this.inviteFriendsRequest!=null&&!this.inviteFriendsDialogDisplayed){this.inviteFriends();this.inviteFriendsDialogDisplayed=true}return false},displayCommunityResourcesSubTab:function(){this.displayCalendarTab();app.communityCalendar.viewSelected(this);this.subTabs.style.display="block";this.planningDiv.style.display="none";this.leftNavPlanningDiv.style.display="block";this.leftNavAd.style.display="block";this.commCalBox.style.display="none";this.pageBottom.style.display="inline";this.promptsDiv.style.display="none";app.resource.loadCommunityResourcesTemplate();return false},displayQASubTab:function(){this.displayCalendarTab();this.subTabs.style.display="block";this.promptsDiv.style.display="none";this.planningDiv.style.display="none";this.leftNavPlanningDiv.style.display="block";this.leftNavAd.style.display="block";this.commCalBox.style.display="none";this.pageBottom.style.display="inline";app.question.loadQATemplate();return false},displayMyInfo:function(){if(app.myInfo==null){hideModalMessageDialog();showModalMessageDialog("Processing ... please wait",300,40);window.setTimeout(this.displayMyInfo.bind(this),3000);return false}this.displayCalendarTab();this.leftNavPlanningDiv.style.display="none";this.leftNavAd.style.display="block";this.planningDiv.style.display="none";this.pageBottom.style.display="inline";this.promptsDiv.style.display="none";app.myInfo.loadMyInfoTemplate();return false},displayCommCalendarSubTab:function(){this.displayCalendarTab();app.communityCalendar.viewSelected(this);this.listBox.style.display="none";this.peopleBox.style.display="none";this.subTabs.style.display="block";this.commCalBox.style.display="block";this.scheduleBox.style.display="none";this.displayCalendarHeader(false);this.leftNavPlanningDiv.style.display="block";this.leftNavAd.style.display="block";this.planningDiv.style.display="inline";this.pageBottom.style.display="none";return false},displayHolidaySubTab:function(A){this.displayCalendarTab();this.listBox.style.display="none";this.peopleBox.style.display="none";this.subTabs.style.display="block";this.commCalBox.style.display="none";this.scheduleBox.style.display="none";this.displayCalendarHeader(false);this.leftNavPlanningDiv.style.display="block";this.leftNavAd.style.display="block";this.promptsDiv.style.display="none";this.planningDiv.style.display="inline";this.pageBottom.style.display="none";if(A){addLog("CampTab_Clicked","Dashboard")}app.summerCamps.viewSelected(this);return false},completeWorkspace:function(K){if(K.scribble==null){createOneToManyAssoc(K,"scribble","Scribble")}else{K.scribble.sort(seqComparator)}if(K.schedule==null){createOneToManyAssoc(K,"schedule","Schedule")}if(K.sharedSchedule==null){createOneToManyAssoc(K,"sharedSchedule","Schedule")}if(K.communitySchedule==null){createOneToManyAssoc(K,"communitySchedule","Schedule")}if(K.invitation==null){createOneToManyAssoc(K,"invitation","Event")}if(K.notes==null){createOneToManyAssoc(K,"notes","Note")}if(K.myList==null){createOneToManyAssoc(K,"myList","MyList")}if(K.myGroup==null){createOneToManyAssoc(K,"myGroup","Group")}if(K.myPeople==null){createOneToManyAssoc(K,"myPeople","Person")}var G=K.myPeople;for(var I=0;I<G.length;I++){var E=G[I];var M=E.fName;var L=E.lName;if(M==null){M=""}if(L==null){L=""}E.name=M+" "+L}if(K.myLove==null){createOneToManyAssoc(K,"myLove","MyLovedOne")}if(K.myResource==null){createOneToManyAssoc(K,"myResource","Resource")}this.drefAssociations(K,"myPeople","myGroup","group");this.drefAssociations(K,"myGroup","myPeople","people");this.drefAssociations(K,"myLove","myPeople","contact1");this.drefAssociations(K,"myLove","myPeople","contact2");this.drefAssociations(K,"myLove","myPeople","friendContact1");this.drefAssociations(K,"myLove","myPeople","friendContact2");this.drefAssociations(K,"myLove","myResource","doctor1");this.drefAssociations(K,"myLove","myResource","doctor2");this.drefAssociations(K,"myLove","myResource","insuranceCarrier");this.drefAssociations(K,"schedule","myPeople","people");this.drefAssociations(K,"schedule","myPeople","people2");this.drefAssociations(K,"schedule","myGroup","group");this.drefAssociations(K,"schedule","myGroup","group2");var C=new Date();var G=K.schedule;var B=K.invitation;for(var I=0;I<G.length;I++){var A=G[I];var F=A.event;if(F==null){continue}for(var H=0;H<F.length;H++){var J=F[H];if(J.inviteStatus=="invited"){var O=new Date(parseInt(J.endDT));if(C.getTime()<=O.getTime()){B.push(J)}var D=new Date(parseInt(J.startDT));var N=(D.getMonth()+1)+"/"+D.getDate();J.dateSmallStr=N;J.rsvpSummary=""}}}B=B.sort(sortByStartTime);for(var I=0;I<G.length;I++){var A=G[I];var F=A.event;if(F==null){continue}for(var H=0;H<F.length;H++){var J=F[H];app.updateEventReferences(A,J)}}},drefAssociations:function(C,F,G,E){l1=C[F];l2=C[G];for(var D=0;D<l1.length;D++){var H=l1[D][E];if(H==null){continue}var B=new Array();B.__parent=H.__parent;B.__className=H.__className;for(j=0;j<H.length;j++){var A=findObjIndex(l2,H[j]);if(A>-1){B.push(l2[A])}}l1[D][E]=B}},processDragBegin:function(A){},processDragged:function(A,B){},processDragComplete:function(A){},changeScreenName:function(){if(this.userScreenName!=null){this.userScreenName.innerHTML="Hi "+login.userFullName+"!"}},doChangePassword:function(){if(this.pwdDialog==null){this.pwdDialog=new HJ.ChangePassword("Password",this,null);this.pwdDialog.width="370px"}this.pwdDialog.showHTMLTemplate(basePageURL+"ChangePassword.htm","content","changePwdContent");this.pwdDialog.centerDialog(400,280);return false},doShowContactUs:function(){if(this.hp==null){this.hp=new HJ.Hompage()}this.hp.loadContactUsTemplate()},doShowSendStories:function(){if(this.hp==null){this.hp=new HJ.Hompage()}this.hp.loadSendStoriesTemplate()},doShowHelp:function(){if(this.hp==null){this.hp=new HJ.Hompage()}this.hp.loadHelpTemplate()},doShowFeedBack:function(){if(this.hp==null){this.hp=new HJ.Hompage()}this.hp.loadFeedBackTemplate()},setHeaderLinks:function(){this.userScreenName=document.getElementById("userId");if(this.userScreenName!=null){this.userScreenName.innerHTML="Welcome <strong>"+login.userFullName+"</strong>!"}this.logoutLink=document.getElementById("logoutLink");if(this.logoutLink!=null){this.logoutLink.onclick=login.logout.bind(login)}this.myInfo=document.getElementById("myInfoLink");this.myInfo.onclick=this.displayMyInfo.bind(this)},doTellAFriend:function(){var A=new HJ.TellAFriendDialog();A.showTemplate()},refreshMyPeople:function(){var A=new Af.DataRequest(svcURL,this.peopleRefreshCompleted.bind(this),requestFailedCommon.bind(this),null,requestTimedoutCommon.bind(this));A.addService("WorkspaceService","getMyPeople");ajaxEngine.processRequest(A)},peopleRefreshCompleted:function(B){var A=new Af.XMLToDataSet(B.responseXML);app.workspace.myPeople=A.data.Person;if(app.workspace.myPeople==null){createOneToManyAssoc(app.workspace,"myPeople","Person")}app.myPeople.setDataList(app.workspace.myPeople,app.workspace.myGroup);app.myGroups.refresh();if(app.getCurrentTab()==HJ.DESTINATION_PAGE_FRIENDS){app.myPeople.refresh()}this.myPeopleLoaded=true;hideModalMessageDialog()},refreshMyGroups:function(){var A=new Af.DataRequest(svcURL,this.groupsRefreshCompleted.bind(this),requestFailedCommon.bind(this),null,requestTimedoutCommon.bind(this));A.addService("WorkspaceService","getMyGroups");ajaxEngine.processRequest(A)},groupsRefreshCompleted:function(B){var A=new Af.XMLToDataSet(B.responseXML);app.workspace.myGroup=A.data.Group;if(app.workspace.myGroup==null){createOneToManyAssoc(app.workspace,"myGroup","Group")}this.drefAssociations(app.workspace,"myPeople","myGroup","group");this.drefAssociations(app.workspace,"myGroup","myPeople","people");app.myGroups.setDataList(this.workspace.myGroup,this.workspace.myPeople);app.myPeople.setDataList(app.workspace.myPeople,app.workspace.myGroup);if(app.getCurrentTab()==HJ.DESTINATION_PAGE_FRIENDS){app.myGroups.refresh()}},displayCalendarHeader:function(A){if(this.calenderTop==null){this.calenderTop=document.getElementById("calenderTop")}if(this.calenderTop==null){return }if(A){this.calenderTop.style.display="block"}else{this.calenderTop.style.display="none"}},idleHandler:function(A){this.loadWorkspace();if(this.previousIdleHandler!=null){this.previousIdleHandler(A)}},loadMyPeople:function(){if(!this.myPeopleLoaded){this.refreshMyPeople();this.refreshMyGroups()}}};function seqComparator(D,C){var B=parseInt(D.seq);var A=parseInt(C.seq);return B-A}HJ.CalendarDashboard=Class.create();HJ.CalendarDashboard.prototype={initialize:function(){this.url=basePageURL+"CalendarOnlyDashboard.htm";this.targetContainerId="MainArea";this.data=null},cleanup:function(){this.singOutLink=null;this.inputBoxSubmit=null},init:function(A,C,B){this.svcName=A;this.svcMethod=C;this.UUID=B;if(this.tl==null){showModalMessageDialog("Initializing Dashboard ... please wait",300,40);this.tl=new Af.TemplateLoader(this.url,this.targetContainerId,"wrapper");this.tl.listener=this;this.tl.loadTemplate()}else{this.tl.reAttachElement()}},templateLoaded:function(){app.db=this;app.initialize2();app.initialize3();this.scribbleTitlePane=new Af.HtmlTitlePane2("scribbleTitlePane","scribbleTitle","openClose","openClose",this);this.scheduleTitlePane=new Af.HtmlTitlePane2("scheduleTitleInternalPane","scheduleTitle","openClose","openClose",this);this.myListsTitlePane=new Af.HtmlTitlePane2("myListsTable","myListsTitle","openClose","openClose",this);this.peopleTitlePane=new Af.HtmlTitlePane2("peopleTitlePane","peopleTitle","openClose","openClose",this);this.communityTitlePane=new Af.HtmlTitlePane2("communityTitlePane","communityTitle","openClose","openClose",this);this.myScheduleTitlePane=new Af.HtmlTitlePane2("scheduleTable","myScheduleTitle","boxLink open","boxLink closed",this);this.sharedScheduleTitlePane=new Af.HtmlTitlePane2("sharedScheduleTable","sharedScheduleTitle","boxLink open","boxLink closed",this);this.invitationTitlePane=new Af.HtmlTitlePane2("invitationTable","invitationTitle","boxLink open","boxLink closed",this);this.communityResourcesTitle=document.getElementById("communityResourcesTitle");this.mhmTitle=document.getElementById("MHMTitle");this.myInfo=document.getElementById("myInfoLink");this.planningTitle=document.getElementById("planningTitle");this.communityCalendarTitle=document.getElementById("communityCalenderTitle");this.holidayTitle=document.getElementById("holidayTitle");this.planningDiv=document.getElementById("planningDiv");this.pageBottom=document.getElementById("pageBottom");this.leftNavPlanningDiv=document.getElementById("leftNavPlanningDiv");this.calenderTop=document.getElementById("calenderTop");this.scribbles=document.getElementById("scribblePaneDiv");this.calendarTabs=document.getElementById("tabsII");this.topNav=document.getElementById("topNav2");this.loadWorkspace()},loadWorkspace:function(){var A=new Af.DataRequest(svcURL,this.requestWorkspaceLoadCompleted.bind(this),this.requestFailedCommon.bind(this),null,this.requestTimedoutCommon.bind(this));A.addService(this.svcName,this.svcMethod);A.addParameter("UUID",this.UUID);ajaxEngine.processRequest(A)},requestWorkspaceLoadCompleted:function(B){var A=new Af.XMLToDataSet(B.responseXML);this.workspace=A.data;app.workspace=this.workspace;this.completeWorkspace(this.workspace);app.schedule.setWorkspace(this.workspace);this.tl.element.style.display="";hideModalMessageDialog();this.leftNavPlanningDiv.style.display="none";this.leftNavPlanningDiv.style.width=0;this.communityResourcesTitle.style.display="none";this.mhmTitle.style.display="none";this.myInfo.style.display="none";this.planningTitle.style.display="none";this.communityCalendarTitle.style.display="none";this.holidayTitle.style.display="none";this.scribbles.style.display="none";this.calendarTabs.style.display="none";this.topNav.style.display="none"},requestFailedCommon:function(A,B){hideDialogWin();showMessageDialog("We are currently unable to create this display. Please try again.","Excuse us!",350,100)},requestTimedoutCommon:function(){hideDialogWin();showMessageDialog("We are currently unable to create this display. Please try again.","Excuse us!",350,100)},paneStateChanged:function(B){var A=document.getElementById(B.titleId+"Img");if(!B.open){if(A!=null){A.src="img/plus.gif"}}else{if(A!=null){A.src="img/minus.gif"}}return ;if(this.scribbleTitlePane==null){return false}this.updateScribbleState();this.updateAnnounceState();this.updateCalendarState();return false},updateCalendarState:function(){var D=document.getElementById("scribbleTitleContaner");var C=document.getElementById("miniCalContaner");var B=document.getElementById("leftBar");if(this.scribbleTitlePane.open&&this.miniCalTitlePane.open){C.className="box miniCal";D.parentNode.insertBefore(C,B)}else{C.className="box soloCal";var A=document.getElementById("scheduleTitlePane");B.insertBefore(C,A)}},loadCommunityResourcesTemplate:function(){this.planningDiv.style.display="none";this.pageBottom.style.display="inline";app.resource.loadCommunityResourcesTemplate();return false},loadMHMTemplate:function(){this.planningDiv.style.display="none";this.pageBottom.style.display="inline";app.question.loadQATemplate();return false},loadMyInfoTemplate:function(){this.planningDiv.style.display="none";this.pageBottom.style.display="inline";app.myInfo.loadMyInfoTemplate();return false},loadSeeingStarPubProfile:function(A){this.planningDiv.style.display="none";this.pageBottom.style.display="inline";app.memberProfile.loadMemberProfileTemplate(A);return },loadCalendarTemplate:function(){app.schedule.monthlyCalendarSelected();app.schedule.viewSelected(this);this.calenderTop.style.display="block";this.planningDiv.style.display="inline";this.pageBottom.style.display="none";return false},loadCommCalendarTemplate:function(){app.communityCalendar.viewSelected(this);this.calenderTop.style.display="none";this.planningDiv.style.display="inline";this.pageBottom.style.display="none";return false},loadAboutLinkTemplate:function(){app.about.loadAboutTemplate()},loadSeeingStarTemplate:function(){app.seeingStar.loadSeeingStarTemplate();return false},completeWorkspace:function(A){if(A.schedule==null){createOneToManyAssoc(A,"schedule","Schedule")}if(A.sharedSchedule==null){createOneToManyAssoc(A,"sharedSchedule","Schedule")}if(A.communitySchedule==null){createOneToManyAssoc(A,"communitySchedule","Schedule")}if(A.notes==null){createOneToManyAssoc(A,"notes","Note")}var F=A.schedule;for(var C=0;C<F.length;C++){var D=F[C]["event"];if(D==null){continue}for(var B=0;B<D.length;B++){var E=D[B];app.updateEventReferences(A,E)}}this.drefAssociations(A,"schedule","myPeople","people");this.drefAssociations(A,"schedule","myPeople","people2");this.drefAssociations(A,"schedule","myGroup","group");this.drefAssociations(A,"schedule","myGroup","group2")},drefAssociations:function(C,F,G,E){l1=C[F];l2=C[G];for(var D=0;D<l1.length;D++){var H=l1[D][E];if(H==null){continue}var B=new Array();B.__parent=H.__parent;B.__className=H.__className;for(j=0;j<H.length;j++){var A=findObjIndex(l2,H[j]);if(A>-1){B.push(l2[A])}}l1[D][E]=B}},doShowHelp:function(){if(this.hp==null){this.hp=new HJ.Hompage()}this.hp.loadHelpTemplate()},doShowFeedBack:function(){if(this.hp==null){this.hp=new HJ.Hompage()}this.hp.loadFeedBackTemplate()}};function seqComparator(D,C){var B=parseInt(D.seq);var A=parseInt(C.seq);return B-A}var calenderTop;HJ.Schedule=Class.create();HJ.Schedule.prototype={initialize:function(){this.date=new Date();this.eventDataMonth;this.scheduleList=null;this.sharedSchedules=null;this.communitySchedules=null;this.targetContainerId="content";this.target=document.getElementById(this.targetContainerId);this.scheduleTable=new Af.HtmlTable("scheduleTable",",,name");this.sharedScheduleTable=new Af.HtmlTable("sharedScheduleTable",",,name");this.communityScheduleTable=new Af.HtmlTable("communityCalTable",",,name");this.sharedScheduleTable.autoDeselect=false;this.communityScheduleTable.autoDeselect=false;this.scheduleTable.listener=this;this.sharedScheduleTable.listener=this;this.communityScheduleTable.listener=this;this.currentRow=-1;this.currentSch=null;this.calendarContainer=document.getElementById("templateCalendar");this.delCommCalndLink=document.getElementById("delCommCalndLink");this.delCommCalndLink.onclick=this.doDelCommCalndLink.bindAsEventListener(this);this.delSharedSchLink=document.getElementById("delSharedSchLink");this.delSharedSchLink.onclick=this.doDelSharedSchLink.bindAsEventListener(this);this.scheduleAddLink=document.getElementById("scheduleAddLink");this.scheduleAddLink.onclick=this.loadScheduleDetailTemplate1.bindAsEventListener(this);this.scheduleEditLink=document.getElementById("scheduleEditLink");this.scheduleEditLink.onclick=this.loadScheduleDetailTemplate2.bindAsEventListener(this);this.tl=null;this.url=basePageURL+"ScheduleAddEdit.html";this.targetContainerId="content";this.currentCalType="monthly";this.calendarDisplayStyle=document.getElementById("calendarDisplayStyle");this.addEventLink=document.getElementById("addEvent");this.printEventLink=document.getElementById("printEvent");this.todaysCalendarLink=document.getElementById("todaysCalendar");this.previousCalendarLink=document.getElementById("previousCalendar");this.dayCalendarLink=document.getElementById("dayCalendar");this.weeklyCalendarLink=document.getElementById("weeklyCalendar");this.monthlyCalendarLink=document.getElementById("monthlyCalendar");this.yearlyCalendarLink=document.getElementById("yearlyCalendar");this.nextCalendarLink=document.getElementById("nextCalendar");this.calendarHeader=document.getElementById("calendarHeader");this.calendarArea=document.getElementById("calendarArea");this.allDayEvents=document.getElementById("allDayEvents");this.calendarTitle=document.getElementById("calendarTitle");this.journalArea=document.getElementById("journalArea");this.calendarDisplayStyle.onclick=this.calendarDisplayStyleChanged.bind(this);this.addEventLink.onclick=this.addEventClicked.bind(this);this.printEventLink.onclick=this.printEventClicked.bind(this);this.todaysCalendarLink.onclick=this.todaysCalendarSelected.bind(this);this.previousCalendarLink.onclick=this.previousCalendarSelected.bind(this);this.dayCalendarLink.onclick=this.dayCalendarSelected.bind(this);this.weeklyCalendarLink.onclick=this.weeklyCalendarSelected.bind(this);this.monthlyCalendarLink.onclick=this.monthlyCalendarSelected.bind(this);this.yearlyCalendarLink.onclick=this.yearlyCalendarSelected.bind(this);this.nextCalendarLink.onclick=this.nextCalendarSelected.bind(this);this.dailyCalendar=new HJ.DailyCalendar(this.calendarTitle,this.calendarArea,this.calendarHeader,this.allDayEvents,this.todaysCalendarLink);this.dailyAgenda=new HJ.DailyAgenda(this.calendarTitle,this.calendarArea,this.calendarHeader,this.allDayEvents,this.todaysCalendarLink);this.weeklyCalendar=new HJ.WeeklyCalendar(this.calendarTitle,this.calendarArea,this.calendarHeader,this.allDayEvents);this.weeklyAgenda=new HJ.WeeklyAgenda(this.calendarTitle,this.calendarArea,this.calendarHeader,this.allDayEvents);this.monthlyCalendar=new HJ.MonthlyCalendar(this.calendarTitle,this.calendarArea,this.calendarHeader,this.allDayEvents);this.monthlyCalendar.listener=this;this.monthlyAgenda=new HJ.MonthlyAgenda(this.calendarTitle,this.calendarArea,this.calendarHeader,this.allDayEvents);this.yearlyCalendar=new HJ.YearlyCalendar(this.calendarTitle,this.calendarArea,this.calendarHeader,this.allDayEvents);this.yearlyCalendar.listener=this;this.yearlyAgenda=new HJ.YearlyAgenda(this.calendarTitle,this.calendarArea,this.calendarHeader,this.allDayEvents);this.currentCalendar=this.monthlyCalendar;this.currentAgenda=this.monthlyAgenda;this.currentActiveLink=this.monthlyCalendarLink;this.date.setHours(0,0,0,0);this.DT_10_DAYS=10*24*3600000;this.DT_51_DAYS=51*24*3600000;this.normalBackcolor="";this.normalTextColor="#000000";this.shownScList=new Array();this.miniCalendar=new HJ.MiniCalendar();this.miniCalendar.listener=this;this.miniCalendar.render(this.shownScList,this.date);this.calendarArea.onscroll=this.handleScroll.bindAsEventListener(this);this.journalText=document.getElementById("journalText");this.journalText.onblur=this.saveNote.bindAsEventListener(this);this.currentNote=null;this.newHomePageCalendar=null},cleanup:function(){this.scheduleAddLink.onclick=null;this.scheduleEditLink.onclick=null;this.addEventLink.onclick=null;this.printEventLink.onclick=null;this.todaysCalendarLink.onclick=null;this.previousCalendarLink.onclick=null;this.dayCalendarLink.onclick=null;this.weeklyCalendarLink.onclick=null;this.monthlyCalendarLink.onclick=null;this.yearlyCalendarLink.onclick=null;this.nextCalendarLink.onclick=null;this.calendarArea.onscroll=null;this.allDayEvents.onclick=null;this.scheduleTable.cleanup();this.sharedScheduleTable.cleanup();this.communityScheduleTable.cleanup();this.dailyCalendar.cleanup();this.dailyAgenda.cleanup();this.weeklyCalendar.cleanup();this.weeklyAgenda.cleanup();this.monthlyCalendar.cleanup();this.monthlyAgenda.cleanup();this.yearlyCalendar.cleanup();this.yearlyAgenda.cleanup();this.newHomePageCalendar=null},handleScroll:function(){if(!this.calendarDisplayStyle.checked){this.currentCalendar.handleScroll()}},getSelectedSchedule:function(){var A=this.scheduleTable.getSelectedRowData();return A},showCalendar:function(){if(this.target.childNodes.length>0&&this.target.childNodes[0]==this.calendarContainer){return }removeAll(this.target);this.target.appendChild(this.calendarContainer);if(this.calendarDisplayStyle.checked){app.setCurrentView(this.currentAgenda)}else{app.setCurrentView(this.currentCalendar);setTimeout(this.currentCalendar.scrollTo7AM.bind(this.currentCalendar),10)}this.setCalendarColor()},setWorkspace:function(A){this.workspace=A;if(this.eventDataMonth!=null){return }this.eventDataMonth=this.getMonthStart(new Date());this.setSchedules(A.schedule,A.sharedSchedule,A.communitySchedule)},setSchedules:function(F,D,C){this.shownScList.length=0;this.scheduleList=F;this.sharedSchedules=D;this.communitySchedules=C;this.scheduleTable.setDataList(this.scheduleList);this.sharedScheduleTable.setDataList(this.sharedSchedules);this.communityScheduleTable.setDataList(this.communitySchedules);this.addCheckClickListener(this.scheduleTable);this.addCheckClickListener(this.sharedScheduleTable);this.addCheckClickListener(this.communityScheduleTable);this.showCurrentCalendar(false);setTimeout(this.currentCalendar.scrollTo7AM.bind(this.currentCalendar),10);if(this.scheduleList==null){return }var B=HJ.requestQueryString.get("sched_id",null);app.db.displayCalendarHeader(true);this.showCalendar();if(B==null){var E=this.scheduleList.length;if(E>10){E=10}for(idx=0;idx<E&&E>0;idx++){if(this.scheduleList[idx].selected=="false"&&E<this.scheduleList.length){E++}this.showEventsInSchedule(idx,2,this.scheduleTable)}}if(B==null){var E=this.communitySchedules.length;if(E>10){E=10}for(idx=0;idx<E&&E>0;idx++){if(this.communitySchedules[idx].selected=="false"&&E<this.communitySchedules.length){E++}this.showEventsInSchedule(idx,2,this.communityScheduleTable)}}if(this.sharedSchedules==null){return }if(B==null){var E=this.sharedSchedules.length;if(E>10){E=10}for(idx1=0;idx1<E&&E>0;idx1++){if(this.sharedSchedules[idx1].selected=="false"&&E<this.sharedSchedules.length){E++}this.showEventsInSchedule(idx1,2,this.sharedScheduleTable)}}else{for(idx1=0;idx1<this.sharedSchedules.length;idx1++){if(this.sharedSchedules[idx1].UUID==B){this.showEventsInSchedule(idx1,2,this.sharedScheduleTable);var A=new Af.DataRequest(svcURL,this.requestFirstEventDateLoadCompleted.bind(this),this.requestFailedCommon.bind(this),null,this.requestTimedoutCommon.bind(this));A.addService("WorkspaceService","getFirstEventDate");A.addParameter("scheduleUUID",B);ajaxEngine.processRequest(A)}}}},requestFirstEventDateLoadCompleted:function(){if(response.responseText==null||response.responseText==""){}},communityCalendarListChanged:function(){this.communityScheduleTable.setDataList(this.communitySchedules);this.addCheckClickListener(this.communityScheduleTable);this.updateShceduleSelection(this.communityScheduleTable,this.communitySchedules)},viewSelected:function(A){if(this.currentRow==-1&&this.scheduleList.length>0){this.cellSelected(0,0,false,this.scheduleTable)}else{this.showCalendar()}},cellSelected:function(K,D,A,E){app.db.displayCalendarHeader(true);this.showCalendar();if(this.scheduleTable==E){this.currentRow=K;this.currentSch=this.scheduleList[this.currentRow];if(!A){var H=this.scheduleList[K]["color"];var I=getTextColor(H);var H=getBackground(H);this.setScheduleCheckState(E,E.tableElement.rows[K],K,true);var J=E.tableElement.rows[K].cells[1];var C;for(var G=0;G<J.childNodes.length;G++){if(J.childNodes[G]&&J.childNodes[G].tagName=="INPUT"){C=J.childNodes[G];break}}if(C!=null&&this.scheduleList[K].selected){C.checked=true}E.selectRow(K,H,I);this.target.style.backgroundColor=H}}else{var J=E.tableElement.rows[K].cells[1];var C;var I;var H;for(var G=0;G<J.childNodes.length;G++){if(J.childNodes[G]&&J.childNodes[G].tagName=="INPUT"){C=J.childNodes[G];break}}if(C!=null){C.checked=true}this.setScheduleCheckState(E,E.tableElement.rows[K],K,true);var H=E.dlist[K]["color"];I=getTextColor(H);H=getBackground(H);var B=E.previousRowNumber;if(B>=0){E.unselectRow(B);var F=E.dlist[B]["color"];E.tableElement.rows[B].cells[2].style.backgroundColor=getBackground(F);E.tableElement.rows[B].cells[2].style.color=getTextColor(F)}E.selectRow(K,H,I)}},showEventsInSchedule:function(I,B,C){if(this.scheduleTable==C){this.currentSch=this.scheduleList[I];if(true){var E=this.scheduleList[I]["color"];var F=getTextColor(E);var E=getBackground(E);if(this.scheduleList[I].selected=="true"){this.setScheduleCheckState(C,C.tableElement.rows[I],I,true);var G=C.tableElement.rows[I].cells[1];var A;for(var D=0;D<G.childNodes.length;D++){if(G.childNodes[D]&&G.childNodes[D].tagName=="INPUT"){A=G.childNodes[D];break}}if(A!=null){A.checked=true}}if(I==0){C.selectRow(I,E,F);this.target.style.backgroundColor=E}}}if(this.sharedScheduleTable==C){if(true){var E=this.sharedSchedules[I]["color"];var F=getTextColor(E);var E=getBackground(E);if(this.sharedSchedules[I].selected=="true"){this.setScheduleCheckState(C,C.tableElement.rows[I],I,true);var G=C.tableElement.rows[I].cells[1];var A;for(var D=0;D<G.childNodes.length;D++){if(G.childNodes[D]&&G.childNodes[D].tagName=="INPUT"){A=G.childNodes[D];break}}if(A!=null){A.checked=true}}}}if(this.communityScheduleTable==C){if(true){var H=this.communitySchedules[I];var E=H.color;var F=getTextColor(E);var E=getBackground(E);if(this.communitySchedules[I].selected=="true"){this.setScheduleCheckState(C,C.tableElement.rows[I],I,true);var G=C.tableElement.rows[I].cells[1];var A;for(var D=0;D<G.childNodes.length;D++){if(G.childNodes[D]&&G.childNodes[D].tagName=="INPUT"){A=G.childNodes[D];break}}if(A!=null){A.checked=true}}}}},selectScheduleAndRefresh:function(A){var B=findObjIndex(this.scheduleTable.dlist,A);if(B<0){return false}this.setScheduleCheckState(this.scheduleTable,this.scheduleTable.tableElement.rows[B],B,true)},addCheckClickListener:function(C){var G=C.tableElement;for(var E=0;E<G.rows.length;E++){var F=G.rows[E];var A=F.cells[1];var B=null;for(var D=0;D<A.childNodes.length;D++){if(A.childNodes[D]&&A.childNodes[D].tagName=="INPUT"){B=A.childNodes[D];break}}if(B!=null){B.onclick=this.scheduleCheckClicked.bindAsEventListener(this)}}},scheduleCheckClicked:function(B){app.db.displayCalendarHeader(true);var F=B.target?B.target:B.srcElement;var D=F.parentNode.parentNode;var C=parseInt(D.id);this.showCalendar();var E=D.parentNode.parentNode;var A=null;if(E==this.scheduleTable.tableElement){A=this.scheduleTable}else{if(E==this.sharedScheduleTable.tableElement){A=this.sharedScheduleTable}else{if(E==this.communityScheduleTable.tableElement){A=this.communityScheduleTable}}}if(A!=null){if(!F.checked){A.unselectRow(C)}else{if(A==this.sharedScheduleTable||A==this.communityScheduleTable){A.selectedRowNumber=C}}this.setScheduleCheckState(A,D,C,F.checked)}},setScheduleCheckState:function(B,H,A,D){var E;var G;var F=B.dlist;if(D){E=F[A]["color"];G=getTextColor(E);E=getBackground(E);this.addToShownList(F[A])}else{E=this.normalBackcolor;G=this.normalTextColor;this.removeFromShownList(F[A])}H.cells[2].style.backgroundColor=E;H.cells[2].style.color=G;var C=D?"true":"false";var J=null;var K=null;J=this.eventDataMonth.getTime()-this.DT_10_DAYS;K=J+this.DT_51_DAYS;var I=new Af.DataRequest(svcURL,this.requestSelectScheduleCompleted.bind(this),requestFailedCommon.bind(this),null,requestTimedoutCommon.bind(this));var L="<Schedule></Schedule>";I.addService("WorkspaceService","selectSchedule");I.addParameter("UUID",F[A].UUID);I.addParameter("Select",C);I.addParameter("startDT",J);I.addParameter("endDT",K);I.xmlDoc=L;ajaxEngine.processRequest(I)},requestSelectScheduleCompleted:function(B){if(B!=null&&B.responseText!=""){var A=new Af.XMLToDataSet(B.responseXML);var C=A.data;for(i=0;i<this.scheduleList.length;i++){if(this.scheduleList[i].UUID==C.UUID){this.scheduleList[i].event=C.event;break}}}this.renderCurrentCalendar(false);app.endBusy();return false},paneStateChanged:function(A){},loadScheduleDetailTemplate:function(){app.db.displayCalendarHeader(false);if(this.tl==null){this.tl=new Af.TemplateLoader(this.url,this.targetContainerId,"schedulesView");this.tl.listener=this;this.tl.loadTemplate()}else{this.tl.reAttachElement();this.myScheduleDetail.setSchedules(this.scheduleList,this.scheduleObj);app.setCurrentView(this)}return false},loadScheduleDetailTemplate1:function(A){consumeEvent(A);this.scheduleObj=null;this.loadScheduleDetailTemplate();GATrackEvent("addCalendar");return false},loadScheduleDetailTemplate2:function(B){consumeEvent(B);if(this.scheduleTable.selectedRowNumber==-1){return }var A=this.scheduleTable.dlist;this.scheduleObj=A[this.scheduleTable.selectedRowNumber];this.loadScheduleDetailTemplate();return false},templateLoaded:function(){this.myScheduleDetail=new HJ.ScheduleDetail();this.myScheduleDetail.setSchedules(this.scheduleList,this.scheduleObj);app.setCurrentView(this)},calendarDisplayStyleChanged:function(){setTimeout(this.showCurrentCalendar.bind(this,true),1);return true},saveCurrentCalendarDate:function(){if(this.calendarDisplayStyle.checked){this.date=this.currentAgenda.date}else{this.date=this.currentCalendar.date}if(this.currentCalendar==this.dailyCalendar){var A=this.getNote(this.date.getTime());if(A==null){this.journalText.value=""}else{if(A.description==null){this.journalText.value=""}else{this.journalText.value=textDisplay((A.description))}}}},showCurrentCalendar:function(A){this.loadEventData(this.date);if(this.currentCalendar!=this.dailyCalendar){this.journalArea.style.display="none"}else{this.journalArea.style.display="";var B=this.getNote(this.date.getTime());if(B==null){this.journalText.value=""}else{if(B.description==null){this.journalText.value=""}else{this.journalText.value=textDisplay((B.description))}}}this.renderCurrentCalendar(A);this.setCalendarColor()},renderCurrentCalendar:function(A){if(this.calendarDisplayStyle.checked){this.currentAgenda.render(this.shownScList,this.date);app.setCurrentView(this.currentAgenda)}else{if(app.getCurrentTab()==HJ.DESTINATION_PAGE_HOME&&this.newHomePageCalendar!=null){this.newHomePageCalendar.render(this.shownScList,this.date)}else{this.currentCalendar.render(this.shownScList,this.date);app.setCurrentView(this.currentCalendar);if(A){this.currentCalendar.scrollTo7AM()}}}this.miniCalendar.render(this.shownScList,this.date)},addEventClicked:function(){var A;if(this.calendarDisplayStyle.checked){A=this.currentAgenda.date}else{A=this.currentCalendar.date}this.addNewEvent(A);GATrackEvent("addEvent");return false},addNewEvent:function(A){if(app.db.workspace==null){showMessageDialog("Initializing...please try again","Excuse us!",200,150);return false}if(this.scheduleList.length==0){this.showSelectScehduleMessage();return }if(this.newEventDialog!=null){}if(this.eventDialog!=null){this.eventDialog.close();delete this.eventDialog}this.eventDialog=new HJ.EventDetail("Event Details",this,null);this.eventDialog.setWorkspace(this.workspace);this.eventDialog.width="470px";var C=new Object();C.timeFlag=true;C.fromTime="450";C.toTime="510";var B;C.date=A.getTime();var B=new Date(C.date);B.setHours(7,30,0,0);C.startDT=B.getTime();B.setHours(8,30,0,0);C.endDT=B.getTime();this.eventDialog.setObj(C,true,this.getSelectedSchedule());this.eventDialog.showHTMLTemplate(basePageURL+"EventDetails2.html","content","eventDetail");return false},addQuickNewEvent:function(B,A,C){if(this.newEventDialog!=null){delete this.newEventDialog}this.newEventDialog=new HJ.NewEvent("New Event Detail",this,null);this.newEventDialog.setWorkspace(this.workspace);this.newEventDialog.width="470px";this.newEventDialog.centerDialog(470,280);this.newEventDialog.showHTMLTemplate(basePageURL+"NewEvent.html","content","newEventDetail");this.newEventDialog.setObj(B,true,A);return false},editEventDetails:function(G,A,H,C,I,J,B){if(J==null){J="content"}if(this.eventDialog!=null){var E=document.getElementsByClassName("Dialog");if(E!=null&&E.length>0){for(var F=0;F<E.length;F++){var K=E[F];if(K.style.display!="none"){return false}}}delete this.eventDialog}this.eventDialog=new HJ.EventDetail("Event Details",this,null);this.eventDialog.setWorkspace(this.workspace);this.eventDialog.width="470px";this.eventDialog.showHTMLTemplate(basePageURL+"EventDetails2.html",J,"eventDetail");if(!this.isPrivateCalendar(A)){var D=cloneObject(G);this.eventDialog.setObj(D,H,A,C,I,B)}else{this.eventDialog.setObj(G,H,A,C,I,B)}return false},editEvent:function(D,E,A,C){var F;for(var B=0;B<this.scheduleList.length;B++){if(this.scheduleList[B].UUID==D.scheduleId){F=this.scheduleList[B];break}}if(F==null){return }this.editEventDetails(D,F,E,-1,null,A,C)},printEventClicked:function(){var B="";for(index=0;index<this.shownScList.length;index++){if(B==""){B=this.shownScList[index].UUID}else{B+=","+this.shownScList[index].UUID}}var A=new Af.DataRequest(svcURL,this.printCompleted.bind(this),this.printFailed.bind(this),null,this.requestTimedout.bind(this));A.addService("WorkspaceService","getPrintHtmlFromXML");A.addParameter("templateName","printAgenda");A.addParameter("xlstFile","printAgenda.xsl");A.addParameter("noOfIds",B);A.addParameter("displayCalType",this.currentCalType);A.addParameter("date",this.date.getTime());ajaxEngine.processRequest(A);return false},printingDone:function(){this.currentCalendar.scrollTo7AM()},todaysCalendarSelected:function(){this.currentCalType="day";if(this.currentCalendar!=this.dailyCalendar){this.setActiveLink(this.dayCalendarLink);this.currentCalendar=this.dailyCalendar;this.currentAgenda=this.dailyAgenda;this.date=new Date();this.date.setHours(0,0,0,0);this.showCurrentCalendar(true)}else{this.saveCurrentCalendarDate();var A=new Date();A.setHours(0,0,0,0);if(A.getTime()!=this.date.getTime()){this.date=A;this.showCurrentCalendar(true)}}return false},previousCalendarSelected:function(){app.showBusy();if(this.calendarDisplayStyle.checked){this.currentAgenda.previous();this.date=this.currentAgenda.date}else{this.currentCalendar.previous();this.date=this.currentCalendar.date}app.endBusy();return false},dayCalendarSelected:function(){this.currentCalType="day";var A=this.currentCalendar!=this.dailyCalendar;this.saveCurrentCalendarDate();this.setActiveLink(this.dayCalendarLink);this.currentCalendar=this.dailyCalendar;this.currentAgenda=this.dailyAgenda;this.showCurrentCalendar(A);return false},weeklyCalendarSelected:function(){app.showBusy();this.currentCalType="weekly";if(this.currentCalendar!=this.weeklyCalendar){this.saveCurrentCalendarDate();this.setActiveLink(this.weeklyCalendarLink);this.currentCalendar=this.weeklyCalendar;this.currentAgenda=this.weeklyAgenda;this.showCurrentCalendar(true)}app.endBusy();return false},monthlyCalendarSelected:function(){app.showBusy();this.currentCalType="monthly";if(this.currentCalendar!=this.monthlyCalendar){this.saveCurrentCalendarDate();this.setActiveLink(this.monthlyCalendarLink);this.currentCalendar=this.monthlyCalendar;this.currentAgenda=this.monthlyAgenda;this.showCurrentCalendar(true)}app.endBusy();return false},yearlyCalendarSelected:function(){app.showBusy();this.currentCalType="yearly";if(this.currentCalendar!=this.yearlyCalendar){this.saveCurrentCalendarDate();this.setActiveLink(this.yearlyCalendarLink);this.currentCalendar=this.yearlyCalendar;this.currentAgenda=this.yearlyAgenda;this.showCurrentCalendar(true)}app.endBusy();return false},nextCalendarSelected:function(){app.showBusy();if(this.calendarDisplayStyle.checked){this.currentAgenda.next();this.date=this.currentAgenda.date}else{this.currentCalendar.next();this.date=this.currentCalendar.date}app.endBusy();return false},setCalendarDate:function(A){this.date=A;this.renderCurrentCalendar(false)},setActiveLink:function(A){if(A.parentNode.childNodes[0]!=null){var C=A.parentNode.childNodes[0].id;var B=A.parentNode.childNodes[0].className;if(B==(C+"_on")){}else{A.parentNode.childNodes[0].className=(C+"_on");if(A==this.dayCalendarLink||A==this.todaysCalendarLink){this.todaysCalendarLink.className="todaysCalendar_on";this.dayCalendarLink.className="dayCalendar_on"}else{this.todaysCalendarLink.className="todaysCalendar_off";this.dayCalendarLink.className="dayCalendar_off"}if(A!=this.weeklyCalendarLink){this.weeklyCalendarLink.className="weeklyCalendar_off"}if(A!=this.monthlyCalendarLink){this.monthlyCalendarLink.className="monthlyCalendar_off"}if(A!=this.yearlyCalendarLink){this.yearlyCalendarLink.className="yearlyCalendar_off"}}}},dateClicked:function(C,A){var B=this.currentCalendar!=this.dailyCalendar;this.currentCalType="day";this.date=new Date(A.getTime());this.date.setHours(0,0,0,0);this.setActiveLink(this.dayCalendarLink);this.currentCalendar=this.dailyCalendar;this.currentAgenda=this.dailyAgenda;this.showCalendar();this.showCurrentCalendar(B)},addToShownList:function(C){for(var B=0;B<this.shownScList.length;B++){if(this.shownScList[B]==C){return }}var A=this.shownScList.length==0;this.shownScList.push(C);this.shownScheduleListChanged();if(A&&!this.calendarDisplayStyle.checked){this.currentCalendar.scrollTo7AM()}},selectedScheduleDeleted:function(){this.currentRow=-1;this.currentSch=null},removeFromShownList:function(D){var A=new Array();var C=false;for(var B=0;B<this.shownScList.length;B++){if(this.shownScList[B]!=D){A.push(this.shownScList[B])}else{C=true}}this.shownScList.length=0;for(var B=0;B<A.length;B++){this.shownScList.push(A[B])}if(C){this.shownScheduleListChanged()}},shownScheduleListChanged:function(){if(this.target.childNodes.length<1||this.target.childNodes[0]!=this.calendarContainer){}if(this.calendarDisplayStyle.checked){this.currentAgenda.scheduleListChanged(this.shownScList)}else{this.currentCalendar.scheduleListChanged(this.shownScList)}this.miniCalendar.scheduleListChanged(this.shownScList)},myScheduleListChanged:function(D){this.scheduleTable.setDataList(this.scheduleList);this.addCheckClickListener(this.scheduleTable);if(this.currentSch!=null){this.currentRow=findObjIndex(this.scheduleList,this.currentSch)}if(this.currentRow>=0&&this.currentRow<this.scheduleList.length){var G=this.getRowColor(this.scheduleList[this.currentRow]["color"]);this.scheduleTable.selectRow(this.currentRow,G.background,G.foreground);var F=this.scheduleTable.tableElement.rows[this.currentRow];var B=F.cells[1];var C;for(var E=0;E<B.childNodes.length;E++){if(B.childNodes[E]&&B.childNodes[E].tagName=="INPUT"){C=B.childNodes[E];break}}if(C!=null){C.checked=true}}else{this.currentRow=-1}for(var E=0;E<this.shownScList.length;E++){var A=findObjIndex(this.scheduleList,this.shownScList[E]);if(A>=0){var G=this.getRowColor(this.scheduleList[A]["color"]);var F=this.scheduleTable.tableElement.rows[A];F.cells[2].style.backgroundColor=G.background;F.cells[2].style.color=G.foreground;for(var A=0;A<F.cells[1].childNodes.length;A++){if(F.cells[1].childNodes[A].tagName=="INPUT"){F.cells[1].childNodes[A].checked=true}}}}if(!D){this.showCurrentCalendar(false)}},getRowColor:function(A){var B=getTextColor(A);var A=getBackground(A);return{background:A,foreground:B}},printCompleted:function(A){var B=new Af.PrintUtil(this);B.showPrintView(A)},printFailed:function(){showMessageDialog("We are currently unable to print Calendar. Please try again.","Excuse us!",350,100)},requestTimedout:function(){showMessageDialog("We are currently unable to print Calendar. Please try again.","Excuse us!",350,100)},doDelCommCalndLink:function(B){consumeEvent(B);if(this.communityScheduleTable.selectedRowNumber==-1){showMessageDialog("Please select the community calendar you would like to delete, then click Delete icon.","Select Community Calendar",350,100);return false}var A=this.communitySchedules;this.calObj=A[this.communityScheduleTable.selectedRowNumber];showConfirmDialog("Are you sure you want to delete this Calendar?","Are You Sure?",300,110,this.doDelCommCalndr.bind(this));return false},doDelCommCalndr:function(){hideDialogWin();var A=this.communitySchedules;this.calObj=A[this.communityScheduleTable.selectedRowNumber];if(this.calObj!=null){var B=new Af.DataTable(this.communitySchedules);B.deleteObjectByIndex(this.communityScheduleTable.selectedRowNumber);this.communityScheduleTable.setDataList(B.getDataList());this.removeFromShownList(this.calObj);this.deleteCommCalander()}},deleteCommCalander:function(){var A=new Af.DataRequest(svcURL,this.reqDeletedCompleted.bind(this),requestFailedCommon,null,requestTimedoutCommon);A.addService("WorkspaceService","deleteCommCalander");A.addParameter("UUID",this.calObj.UUID);ajaxEngine.processRequest(A)},reqDeletedCompleted:function(A){var B=A.responseText;if(B=="SUCCESS"){showMessageDialog("This Community Calendar has been successfully deleted. "," Deletion Successful",320,100);this.communityCalendarListChanged()}else{showMessageDialog("We are currently unable to delete this Community Calendar. Please try again.","Excuse us!",320,100)}},doDelSharedSchLink:function(B){consumeEvent(B);if(this.sharedScheduleTable.selectedRowNumber==-1){return false}var A=this.sharedSchedules;this.calObj=A[this.sharedScheduleTable.selectedRowNumber];showConfirmDialog("You will need to ask the originator to send it to you again if you need it.","Are you sure you want to delete this calendar? ",370,120,this.doDelSharedCalndr.bind(this));return false},doDelSharedCalndr:function(){hideDialogWin();var A=this.sharedSchedules;this.calObj=A[this.sharedScheduleTable.selectedRowNumber];if(this.calObj!=null){var B=new Af.DataTable(this.sharedSchedules);B.deleteObjectByIndex(this.sharedScheduleTable.selectedRowNumber);this.sharedScheduleTable.setDataList(B.getDataList());this.removeFromShownList(this.calObj);this.deleteSharedCalander()}},deleteSharedCalander:function(){var A=new Af.DataRequest(svcURL,this.reqSharedCalDeletedCompleted.bind(this),requestFailedCommon,null,requestTimedoutCommon);A.addService("WorkspaceService","deleteSharedCalander");A.addParameter("UUID",this.calObj.UUID);ajaxEngine.processRequest(A)},reqSharedCalDeletedCompleted:function(A){var B=A.responseText;if(B=="SUCCESS"){showMessageDialog("Your Calendar has been successfully deleted.","Deletion Successful",300,100);this.sharedScheduleTable.setDataList(this.sharedSchedules);this.addCheckClickListener(this.sharedScheduleTable);this.updateShceduleSelection(this.sharedScheduleTable,this.sharedSchedules)}else{showMessageDialog("We are currently unable to delete this shared Calendar. <br/> Please try again.","Excuse us!",300,100)}},updateShceduleSelection:function(E,D){var G=-1;for(var B=0;B<this.shownScList.length;B++){var A=findObjIndex(D,this.shownScList[B]);if(A>=0){if(G<0){G=A}var F=this.getRowColor(D[A]["color"]);var C=E.tableElement.rows[A];C.cells[2].style.backgroundColor=F.background;C.cells[2].style.color=F.foreground;C.cells[1].childNodes[0].checked=true}}E.selectedRowNumber=G;this.showCurrentCalendar(false)},getNote:function(D){var E=new Date(D);E.setHours(0,0,0,0);D=E.getTime();var A=this.workspace.notes;for(var C=0;C<A.length;C++){var F=A[C];var B=parseInt(F.notedate);if(B==D){return F}}return null},saveNote:function(){var C="<properties>";var B=this.journalText.value;if(B==null){B=""}B=xmlEncode(B);C+='<property name="description" value="'+B+'" />';if(this.calendarDisplayStyle.checked){this.date=this.currentAgenda.date}else{this.date=this.currentCalendar.date}var E=new Date(this.date.getTime());E.setHours(0,0,0,0);C+='<property name="notedate" value="'+E.getTime()+'" />';C+="</properties>";this.currentNote=this.getNote(E.getTime());if(this.currentNote==null){this.currentNote=new Object();this.currentNote.notedate=E.getTime();var A=this.workspace.notes;A.push(this.currentNote)}this.currentNote.description=B;var D=new Af.DataRequest(svcURL,this.reqSaveNoteCompleted.bind(this),requestFailedCommon,null,requestTimedoutCommon);D.addService("WorkspaceService","saveNotes");if(this.currentNote.UUID!=null){D.addParameter("UUID",this.currentNote.UUID)}D.xmlDoc=C;ajaxEngine.processRequest(D);return false},reqSaveNoteCompleted:function(A){if(this.currentNote.UUID==null){this.currentNote.UUID=A.responseText}},showSelectScehduleMessage:function(){var A=this.scheduleList;if(this.scheduleTable.selectedRowNumber>-1){showMessageDialog("You need to select a My Calendar for the intended operation. <br/>A selected Calendar is shown using a long bar in the Calendar widget.","Excuse us!",400,150);return }else{if(this.sharedScheduleTable.selectedRowNumber>-1){showMessageDialog("This is a shared Calendar. <br/>You do not have access to modify it.","Excuse us!",310,120);return }else{if(this.communityScheduleTable.selectedRowNumber>-1){showMessageDialog("This is a community Calendar. <br/>You do not have access to modify it.","Excuse us!",310,120);return }else{if(A.length==0){showMessageDialog("There are no Calendars to add the event to. Create a Calendar first.","Excuse us!",350,120);return }showMessageDialog("You need to select a My Calendar for the intended operation. <br/>A selected Calendar is shown using a long bar in the Calendar widget.","Excuse us!",400,150)}}}},setCalendarColor:function(){if(this.currentRow>=0&&this.currentRow<this.scheduleList.length){var A=this.getRowColor(this.scheduleList[this.currentRow]["color"]);this.target.style.backgroundColor=A.background}},isPrivateCalendar:function(A){if(A==null){return false}this.index=findObjIndex(this.scheduleList,A);if(this.index==-1){return false}return true},loadEventData:function(C){if(C==null){return false}var D=this.getMonthStart(C);if(this.eventDataMonth!=null&&D.getTime()==this.eventDataMonth.getTime()){return true}else{}var B=D.getTime()-this.DT_10_DAYS;var A=B+this.DT_51_DAYS;this.loadSchedule(B,A);this.eventDataMonth=D;return false},getMonthStart:function(A){var B=new Date(A);B.setDate(1);B.setHours(0,0,0,0);return B},loadSchedule:function(D,B){var E=new Date(D);var A=new Date(B);var C=new Af.DataRequest(svcURL,this.requestGetSchedulesCompleted.bind(this),requestFailedCommon.bind(this),null,requestTimedoutCommon.bind(this));C.addService("WorkspaceService","getSchedules");C.addParameter("startDT",D);C.addParameter("endDT",B);ajaxEngine.processRequest(C)},requestGetSchedulesCompleted:function(B){var A=new Af.XMLToDataSet(B.responseXML);var D=A.data.ObjList;var C=new Array();C.schedule=D[0].Schedule;C.sharedSchedule=D[1].Schedule;C.communitySchedule=D[2].Schedule;if(C.schedule==null){createOneToManyAssoc(C,"schedule","Schedule")}if(C.sharedSchedule==null){createOneToManyAssoc(C,"sharedSchedule","Schedule")}if(C.communitySchedule==null){createOneToManyAssoc(C,"communitySchedule","Schedule")}if(this.scheduleList==null){this.setSchedules(C.schedule,C.sharedSchedule,C.communitySchedule);return }this.updateEvents(this.scheduleList,C.schedule);this.updateEvents(this.sharedSchedules,C.sharedSchedule);this.updateEvents(this.communitySchedules,C.communitySchedule);this.renderCurrentCalendar(false)},updateEvents:function(D,A){for(var C=0;C<D.length;C++){var E=D[C];var B=findObjById(A,D[C].UUID);if(B!=null){E.event=B.event}}},setNewHomePageCalendar:function(A){this.newHomePageCalendar=A},getNewHomePageCalendar:function(){return this.newHomePageCalendar},eventChanged:function(A,B){if(this.newHomePageCalendar!=null){this.newHomePageCalendar.eventChanged(A,B)}if((app.SIHP!=null)&&(app.SIHP.archive!=null)){app.SIHP.archive.eventChanged(A,B)}}};HJ.CommunityCalendar=Class.create();HJ.CommunityCalendar.prototype={initialize:function(){this.targetContainerId="content";this.url=basePageURL+"CommunityCalendar.htm";this.communityAddLink=document.getElementById("communityAddLink");this.dlist=null;this.resultList=null;this.defaultSearchValue=""},cleanup:function(){this.communityAddLink.onclick=null;return false},viewSelected:function(A){this.doLoadTemplate();document.getElementById(this.targetContainerId).style.backgroundColor="white";return false},doLoadTemplate:function(){if(this.load==null){this.load=new Af.TemplateLoader(this.url,this.targetContainerId,"communityCalendarContent");this.load.listener=this;this.load.loadTemplate()}else{this.load.reAttachElement();this.doLoadCalCategoryInfo();if(this.resultTitle!=null){this.resultTitle.style.display="none"}if(this.searchResultsArea!=null){this.searchResultsArea.innerHTML=""}}return false},templateLoaded:function(){var A=new Af.ElementCollection(this.load.element);this.searchTrigger=A.getFirstElementById("searchTrigger");this.searchString=A.getFirstElementById("searchString");this.resultTitle=document.getElementById("resultTitle");this.defaultSearchValue=this.searchString.value;this.searchResultsArea=document.getElementById("searchResultsArea");this.showHowToEarnPnt=document.getElementById("showHowToEarnPnt");this.showHowToEarnPnt.onclick=this.doShowPoints.bind(this);this.searchString.onfocus=this.focusOnTextBox.bindAsEventListener(this);this.searchString.onblur=this.focusLostTextBox.bindAsEventListener(this);if(is_ie){this.textChanger=new Af.TextChanger(this.searchString)}this.searchTrigger.onclick=this.doSearch.bind(this);this.dontSeeLocalCal=document.getElementById("dontSeeLocalCal");this.createCommCalLink=document.getElementById("createCommCalLink");this.createCommCalLink.onclick=this.doCreateCommCal.bind(this);this.loadMyProfile();this.doLoadCalCategoryInfo();return false},doLoadCalCategoryInfo:function(){var A=new Af.DataRequest(svcURL,this.requestInfoListCompleted.bind(this),requestFailedCommon.bind(this),null,requestTimedoutCommon.bind(this));A.addService("PublicService","getCalCategoryInfoList");ajaxEngine.processRequest(A)},requestInfoListCompleted:function(C){var A=new Af.XMLToDataSet(C.responseXML);var F=A.data.CategoryInfo;for(var D=0;D<F.length;D++){var G=F[D];if(G.name=="GENERAL"||G.name=="Adults/Gen Family"){this.c1=G;this.categoryTable1=new Af.HtmlColumnRepeater("categoryInfoListTable1","name,count",1);this.categoryTable1.setDataList(G.subCategory);this.categoryTable1.listener=this}else{if(G.name=="Camps"){this.c2=G;this.categoryTable2=new Af.HtmlColumnRepeater("categoryInfoListTable2","name,count",1);this.categoryTable2.setDataList(G.subCategory);this.categoryTable2.listener=this}}}if(this.selectedCatName!=null){var E=this.selectedCatName;this.selectedCatName=null;var B=this.c2.subCategory;for(var D=0;D<B.length;D++){if(B[D]["name"]==E){this._columnRepeaterRowSelected(B[D]);break}}}return false},columnRepeaterRowSelected:function(A,C){var B=A.dlist[C];this._columnRepeaterRowSelected(B);return false},_columnRepeaterRowSelected:function(B){var A=new Af.DataRequest(svcURL,this.requestGetCommunityCalCompleted.bind(this),requestFailedCommon.bind(this),null,requestTimedoutCommon.bind(this));A.addService("PublicService","getCommunityCalendars");A.addParameter("UUID",B.UUID);ajaxEngine.processRequest(A)},requestGetCommunityCalCompleted:function(A){this.searchResultsArea.innerHTML=A.responseText;this.searchTemplateLoaded();this.resultTitle.innerHTML=this.catName;this.resultTitle.style.display="block";return false},searchTemplateLoaded:function(){var F=document.getElementsByName("addCalendar");this.schUUIDList=document.getElementsByName("schUUID");var H=document.getElementsByName("catNameList");var B=document.getElementsByName("showOwnersInfo");var D=document.getElementsByName("preview");if(F!=null){for(var G=0;G<F.length;G++){F[G].id=G;F[G].onclick=this.addCalendar.bindAsEventListener(this)}}if(D!=null){for(var G=0;G<D.length;G++){D[G].id=G;D[G].onclick=this.preview.bindAsEventListener(this)}}for(var A=0;A<H.length;A++){var C=document.getElementById(H[A].id+this.schUUIDList[A].id);if(C!=null){C.innerHTML=this.getCategoryString(H[A].id);this.catName=C.innerHTML}}for(var E=0;E<B.length;E++){B[E].onclick=this.doShowOwnersInfo.bindAsEventListener(this)}return false},getCategoryString:function(A){var B=findObjById(this.c1.subCategory,A);if(B!=null){return this.c1.name+" : "+B.name}B=findObjById(this.c2.subCategory,A);if(B!=null){return this.c2.name+" : "+B.name}return"---"},preview:function(A){if(this.schUUIDList==null){return }var C=A.target?A.target:A.srcElement;var D=parseInt(C.id);var B=this.schUUIDList[D].id;url=window.location.toString()+"&svcName=WorkspaceService&methodName=getScheduleByUUID&UUID="+B;window.open(url,"previewCommunityCalendarWindow","toolbar=no,menubar=no,copyhistory=no");return },addCalendar:function(A){if(this.schUUIDList==null){return }var D=A.target?A.target:A.srcElement;var E=parseInt(D.id);var B=this.schUUIDList[E].id;var C=new Af.DataRequest(svcURL,this.requestAddCommunityCalCompleted.bind(this),this.requestAddCommunityCalFailed.bind(this),null,requestTimedoutCommon.bind(this));C.addService("WorkspaceService","addCommunityCalendar");C.addParameter("reference",B);ajaxEngine.processRequest(C)},doShowOwnersInfo:function(A){var B=A.target?A.target:A.srcElement;if(B==null||B.id==null){return }app.db.loadSeeingStarPubProfile(B.id);return },requestAddCommunityCalCompleted:function(C){var A=new Af.XMLToDataSet(C.responseXML);var D=A.data;var B=app.schedule.communityScheduleTable.dlist;if(B!=null){B.push(D);app.schedule.communityCalendarListChanged();var E=findObjIndex(B,D);app.schedule.showEventsInSchedule(E,1,app.schedule.communityScheduleTable);app.db.displayCalendarTab()}return false},requestAddCommunityCalFailed:function(A,B){showMessageDialog(B,"Attention!",400,150)},doSearch:function(){var A=this.searchString.value;A=trim(A);if(A==""){return false}var B=new Af.DataRequest(svcURL,this.requestGetCommunityCalCompleted.bind(this),requestFailedCommon.bind(this),null,requestTimedoutCommon.bind(this));B.addService("WorkspaceService","searchCommunityCal");B.addParameter("queryString",A);ajaxEngine.processRequest(B);return false},focusOnTextBox:function(A){var B=this.searchString.value;if(B==null){B=""}B=trim(B);if(B==this.defaultSearchValue){this.searchString.value=""}this.searchString.focus();return false},focusLostTextBox:function(A){var B=this.searchString.value;if(B==null){B=""}else{B=trim(B)}if(B==this.defaultSearchValue||B==""){this.searchString.value=this.defaultSearchValue;consumeEvent(A)}else{this.doSearch()}return false},doShowPoints:function(){app.seeingStar.doLearnAboutPoints();return false},doTellAFriend:function(){var A=new HJ.TellAFriendPage();A.init(this.targetContainerId);return false},doCreateCommCal:function(A){app.mainTab="ourCalendar";app.db.init();app.schedule.loadScheduleDetailTemplate1(A);app.schedule.myScheduleDetail.schDetail.sharing.value="shared";app.schedule.myScheduleDetail.schDetail.sharingChanged();return false},loadMyProfile:function(){var A=new Af.DataRequest(svcURL,this.requestMyProfileLoadCompleted.bind(this),this.requestFailedCommon.bind(this),null,this.requestTimedoutCommon.bind(this));A.addService("AccessControlSvc","getMyProfile");ajaxEngine.processRequest(A)},requestMyProfileLoadCompleted:function(C){var A=new Af.XMLToDataSet(C.responseXML);var B=A.data;if(B.zip!=null&&B.zip.substring(0,2)=="94"){this.dontSeeLocalCal.style.display="none"}else{this.dontSeeLocalCal.style.display="block"}return false},requestFailedCommon:function(A,B){},requestTimedoutCommon:function(A,B){}};HJ.holiday=Class.create();HJ.holiday.prototype={initialize:function(){this.targetContainerId="content";this.url=basePageURL+"holiday.htm";this.dlist=null;this.resultList=null;this.defaultSearchValue=""},cleanup:function(){},viewSelected:function(A){this.doLoadTemplate();document.getElementById(this.targetContainerId).style.backgroundColor="white"},doLoadTemplate:function(){this.load=new Af.TemplateLoader(this.url,this.targetContainerId,"holidayDiv");this.load.listener=this;this.load.loadTemplate()},templateLoaded:function(){this.holidayCal=document.getElementById("holidayCal");this.holidayCal.onclick=this.loadCommCalendarTemplate.bind(this);this.holidaySources=document.getElementById("holidaySources");this.holidaySources.onclick=this.loadCommunityResourcesTemplate.bind(this);this.holidayMHM=document.getElementById("holidayMHM");this.holidayMHM.onclick=this.loadMHMTemplate.bind(this);this.calenderTop=document.getElementById("calenderTop");calenderTop=this.calenderTop;this.planningDiv=document.getElementById("planningDiv");this.pageBottom=document.getElementById("pageBottom");this.leftNavPlanningDiv=document.getElementById("leftNavPlanningDiv");this.leftNavAd=document.getElementById("leftNavAd")},loadCommCalendarTemplate:function(){app.communityCalendar.viewSelected(this);this.calenderTop.style.display="none";this.leftNavPlanningDiv.style.display="block";this.leftNavAd.style.display="none";this.planningDiv.style.display="inline";this.pageBottom.style.display="none";return false},loadCommunityResourcesTemplate:function(){this.planningDiv.style.display="none";this.leftNavPlanningDiv.style.display="none";this.leftNavAd.style.display="block";this.pageBottom.style.display="inline";app.resource.loadCommunityResourcesTemplate();return false},loadMHMTemplate:function(){this.planningDiv.style.display="none";this.leftNavPlanningDiv.style.display="none";this.leftNavAd.style.display="block";this.pageBottom.style.display="inline";app.question.loadQATemplate();return false}};HJ.SummerCamps=Class.create();HJ.SummerCamps.prototype={initialize:function(){this.targetContainerId="content";this.url=basePageURL+"summerCamp.htm";this.dlist=null;this.resultList=null;this.defaultSearchValue=""},cleanup:function(){},viewSelected:function(A){this.doLoadTemplate();document.getElementById(this.targetContainerId).style.backgroundColor="white"},doLoadTemplate:function(){this.load=new Af.TemplateLoader(this.url,this.targetContainerId,"dashboardCamp");this.load.listener=this;this.load.loadTemplate()},templateLoaded:function(){this.teamRosters=document.getElementById("teamRosters");this.teamRosters.onclick=this.loadCalendarTemplate.bindAsEventListener(this);this.scheduleSharing=document.getElementById("scheduleSharing");this.scheduleSharing.onclick=this.loadCalendarTemplate.bindAsEventListener(this);this.quickVolunteer=document.getElementById("quickVolunteer");this.quickVolunteer.onclick=this.loadCalendarTemplate.bindAsEventListener(this);this.featuredCamps=document.getElementById("featuredCamps");this.featuredCamps.onclick=this.loadCommCalendarTemplate.bindAsEventListener(this);this.language=document.getElementById("language");this.language.onclick=this.loadCommCalendarTemplate.bindAsEventListener(this);this.otherCamps=document.getElementById("otherCamps");this.otherCamps.onclick=this.loadCommCalendarTemplate.bindAsEventListener(this);this.academics=document.getElementById("academics");this.academics.onclick=this.loadCommCalendarTemplate.bindAsEventListener(this);this.theater=document.getElementById("theater");this.theater.onclick=this.loadCommCalendarTemplate.bindAsEventListener(this);this.comingSoon=document.getElementById("comingSoon");this.comingSoon.onclick=this.loadCommCalendarTemplate.bindAsEventListener(this);this.art=document.getElementById("art");this.art.onclick=this.loadCommCalendarTemplate.bindAsEventListener(this);this.science=document.getElementById("science");this.science.onclick=this.loadCommCalendarTemplate.bindAsEventListener(this);this.greatOutdoors=document.getElementById("greatOutdoors");this.greatOutdoors.onclick=this.loadCommCalendarTemplate.bindAsEventListener(this);this.sports=document.getElementById("sports");this.sports.onclick=this.loadCommCalendarTemplate.bindAsEventListener(this);this.calenderTop=document.getElementById("calenderTop");calenderTop=this.calenderTop;this.planningDiv=document.getElementById("planningDiv");this.pageBottom=document.getElementById("pageBottom");this.leftNavPlanningDiv=document.getElementById("leftNavPlanningDiv");this.leftNavAd=document.getElementById("leftNavAd");this.tellAFriend=document.getElementById("tellAFriend");this.tellAFriend.onclick=this.doTellAFriend.bind(this)},loadCalendarTemplate:function(){app.schedule.monthlyCalendarSelected();app.schedule.viewSelected(this);this.calenderTop.style.display="block";this.leftNavPlanningDiv.style.display="block";this.leftNavAd.style.display="none";this.planningDiv.style.display="inline";this.pageBottom.style.display="none";return false},loadCommCalendarTemplate:function(B){var A=B.target?B.target:B.srcElement;app.communityCalendar.selectedCatName=A.name;app.communityCalendar.viewSelected(this);this.calenderTop.style.display="none";this.leftNavPlanningDiv.style.display="block";this.leftNavAd.style.display="none";this.planningDiv.style.display="inline";this.pageBottom.style.display="none";return false},loadCommunityResourcesTemplate:function(){this.planningDiv.style.display="none";this.leftNavPlanningDiv.style.display="none";this.leftNavAd.style.display="block";this.pageBottom.style.display="inline";app.resource.loadCommunityResourcesTemplate();return false},loadMHMTemplate:function(){this.planningDiv.style.display="none";this.leftNavPlanningDiv.style.display="none";this.leftNavAd.style.display="block";this.pageBottom.style.display="inline";app.question.loadQATemplate();return false},doTellAFriend:function(){var A=new HJ.TellAFriendPage();A.init(this.targetContainerId)}};HJ.Invitation=Class.create();HJ.Invitation.prototype={initialize:function(){this.invitationTable=new Af.HtmlTable("invitationTable","dateSmallStr,displayName,rsvpSummary");this.dlist=null;this.invitationTable.listener=this},cleanup:function(){this.invitationTable.cleanup()},setDataList:function(A){this.dlist=A;this.invitationTable.setDataList(A)},invitationSent:function(D,C){var E=this.dlist;var B=new Date(parseFloat(D.startDT));var A=(B.getMonth()+1)+"/"+B.getDate();D.dateSmallStr=A;D.rsvpSummary="";if(findObjIndex(E,D)<0){E.push(D)}E=E.sort(sortByStartTime);this.invitationTable.setDataList(E)},cellSelected:function(G,C,E,B){this.invitationTable.selectRow(G);var A=this.invitationTable.dlist;var D=A[G];var F=findObjById(app.schedule.scheduleList,D.scheduleId);app.schedule.editEventDetails(D,F)}};HJ.MyLists=Class.create();HJ.MyLists.prototype={initialize:function(){this.myListsTable=new Af.HtmlTable("myListsTable","name,count");this.myListsTable.dndMgr2=app.dndMgrMyLists;this.myListsTable.draggableAttr="name";this.myListsTable.listener=this;this.currentRow=-1;this.url=basePageURL+"MyListsDetailView.html";this.targetContainerId="content";this.tl=null;this.addNewMyList=document.getElementById("addNewMyListLink");this.addNewMyList.onclick=this.doAddNewMyList.bindAsEventListener(this);this.delMyListLink=document.getElementById("delMyListLink");this.delMyListLink.onclick=this.doDelMyList.bindAsEventListener(this)},cleanup:function(){this.delMyListLink.onclick=null;this.addNewMyList.onclick=null;this.myListsTable.cleanup()},setDataList:function(A){this.myListsTable.setDataList(A);this.dataTable=new Af.DataTable(A)},refreshListDetailView:function(A){if(this.myOneList!=null){this.myOneList.listNameElement.innerHTML=A.name}return },viewSelected:function(A){if(calenderTop==null){calenderTop=document.getElementById("calenderTop")}calenderTop.style.display="none";if(this.tl==null){var B=this.dataTable.getDataList().length>0?0:-1;this.cellSelected(B,0,false)}else{this.tl.reAttachElement();app.setCurrentView(this.myOneList)}},cellSelected:function(C,A,B){if(calenderTop==null){calenderTop=document.getElementById("calenderTop")}calenderTop.style.display="none";this.currentRow=C;if(!B){this.myListsTable.selectRow(C);this.loadMyListsTemplate()}else{if(this.tl!=null){this.tl.reAttachElement();app.setCurrentView(this.myOneList)}}return false},loadMyListsTemplate:function(){if(this.tl==null){this.tl=new Af.TemplateLoader(this.url,this.targetContainerId,"MyListDetails");this.tl.listener=this;this.tl.loadTemplate()}else{this.tl.reAttachElement();if(this.myOneList!=null&&this.currentRow>=0&&this.currentRow<this.dataTable.getDataList().length){this.myOneList.setMyOneList(this.dataTable.getDataList()[this.currentRow])}app.setCurrentView(this.myOneList)}},templateLoaded:function(){this.myOneList=new HJ.MyOneList(this.tl.element);if(this.currentRow>=0&&this.currentRow<this.dataTable.getDataList().length){this.myOneList.setMyOneList(this.dataTable.getDataList()[this.currentRow])}app.setCurrentView(this.myOneList)},doAddNewMyList:function(A){consumeEvent(A);if(this.dialog==null){this.dialog=new HJ.AddMyListDialog("Add New MyList",this,null);this.dialog.left=200;this.dialog.top=60}this.dialog.showHTMLTemplate(basePageURL+"AddMyList.html","content","newMyList");this.dialog.centerDialog(400,280);this.dialog.setDataObject(null,"Type the name of a new MyList");return false},doDelMyList:function(){if(this.currentRow==-1){showMessageDialog("Please select the item you would like to delete, then click Delete icon.","Select Item",350,100);return false}showConfirmDialog("Are you sure you want to delete this list?","Are You Sure?",300,100,this.doDelMyList2.bind(this))},doDelMyList2:function(){hideDialogWin();var A=this.dataTable.deleteObjectByIndex(this.currentRow);this.myListsTable.setDataList(this.dataTable.getDataList());this.deleteMyListObj(A);var B=this.dataTable.getDataList().length;if(B>=0){if(this.currentRow>=B){this.currentRow--}this.myListsTable.setSelectedRow(this.currentRow);this.myOneList.setMyOneList(this.dataTable.getDataList()[this.currentRow])}else{this.currentRow=-1;this.myOneList.setMyOneList(new Object())}},deleteMyListObj:function(B){if(this.currentRow==-1){return }var A=new Af.DataRequest(svcURL,this.requestMyListDeletedCompleted.bind(this),requestFailedCommon,null,requestTimedoutCommon);A.addService("WorkspaceService","deleteMyList");A.addParameter("UUID",B.UUID);ajaxEngine.processRequest(A)},requestMyListDeletedCompleted:function(A){}};HJ.MyOneList=Class.create();HJ.MyOneList.prototype={initialize:function(C,A){this.element=C;this.dialogContainer=A;var B=new Af.ElementCollection(this.element);this.oneListTable=new Af.HtmlTable("myOneListTable","taskDone,description,dueDate,cal,helper",B);this.oneListTable.listener=this;this.currentRow=-1;this.listNameElement=B.getFirstElementById("listNameId");this.listItemInputBox=B.getFirstElementById("listItemInputBox");this.listItemInputBox.onchange=this.changed.bindAsEventListener(this);this.listItemInputBox.onfocus=this.focusOnTextBox.bindAsEventListener(this);this.listItemInputBox.onblur=this.focusLostTextBox.bindAsEventListener(this);this.defaultValue=this.listItemInputBox.value;if(is_ie){this.textChanger=new Af.TextChanger(this.listItemInputBox)}this.deleteListItem=B.getFirstElementById("deleteListItem");this.deleteListItem.onclick=this.deleteItem.bind(this);this.printMyListItem=B.getFirstElementById("printMyList");if(this.printMyListItem!=null){this.printMyListItem.onclick=this.printMyList.bind(this)}this.editingCell=null;this.selectedInput=null;this.selectedTD=null;this.selectedDateDiv=null;this.cellChildNode=null;this.listOptions=B.getFirstElementById("listOptions");this.listOptions.onclick=this.showListOptions.bindAsEventListener(this);this.listOptionPopup=B.getFirstElementById("listOptionPopup");this.dueDatesOption=B.getFirstElementById("dueDatesOption");this.completedItemsOption=B.getFirstElementById("completedItemsOption");this.addToSchOption=B.getFirstElementById("addToSchOption");this.helpNeededOption=B.getFirstElementById("helpNeededOption");this.askForHelp=B.getFirstElementById("askForHelp");if(this.askForHelp!=null){this.askForHelp.onclick=this.sendAskForHelpEmail.bind(this)}this.sendList=B.getFirstElementById("sendList");if(this.sendList!=null){this.sendList.onclick=this.sendSimpleList.bind(this)}this.learnMore=document.getElementById("learnMore");if(this.learnMore!=null){this.learnMore.onclick=this.doShowListHelp.bind(this)}this.myListsTableHeader=B.getFirstElementById("myListsTableHeader");this.renameMyListLink=document.getElementById("renameMyListLink");if(this.renameMyListLink!=null){this.renameMyListLink.onclick=this.doRenameMyList.bindAsEventListener(this)}this.simpleView=true;this.isDoneSelected=false;this.isDueSelected=false;this.isHelperSelected=false;this.updateListColumns();this.sc=new Array();this.date=new Date();this.disabledInput=null;this.miniTableElement='<div id="miniCalContainer" class="miniBox miniCalOneList"  style="z-index:300; position:abolute; "><div id="miniCalTitlePane" style="z-index:100; background-color:#FFFFFF; border:2px solid #489f97; width:185px;"><h3><a id="miniPrevious" href="#">&lt;</a><span id="miniCalHeading"> December 2007 </span><a id="miniNext" href="#">&gt;</a></h3><table id="miniCalTable" cellspacing="0"></table></div></div>'},showCal:function(){this.removeCal();var A=document.createElement("span");A.id="miniCalBox";A.className="miniCalList";A.innerHTML=this.miniTableElement;this.selectedDateDiv.appendChild(A);this.miniCalendar=new HJ.MiniCalendar();this.miniCalendar.listener=this;this.miniCalendar.render(this.sc,this.date);this.selectedInput.disabled="disabled";this.disabledInput=this.selectedInput},removeCal:function(){this.dateDisabledOff();var A=document.getElementById("miniCalBox");if(A!=null){A.parentNode.removeChild(A)}if(this.miniCalendar!=null){this.miniCalenar=null}},dateDisabledOff:function(){if(this.disabledInput!=null){this.disabledInput.disabled=false}},dateClicked:function(B,A){this.dateDisabledOff();this.showDate(A)},showDate:function(C){var E=this.currentRow;var A=(C.getMonth()+1)+"/"+C.getDate()+"/"+C.getFullYear();this.selectedInput.value=A;var B=document.getElementById("miniCalBox");this.selectedDateDiv.removeChild(B);var D=this.oneListDataTable.getDataList()[E];D.dueDate=A;this.saveMyList(D)},setVisible:function(A){if(A){app.dndMgrScribble.registerDropZone("myOneListTable",this.oneListTable.tableElement,this);app.dndMgrScribble.registerDropZone("myOneListTable",this.element,this)}},setMyOneList:function(A){this.oneList=A;if(this.oneList!=null){this.listNameElement.innerHTML=A.name;if(this.oneList.item==null){createOneToManyAssoc(A,"item","MyListItem")}this.setDataList(A.item)}else{this.setDataList(new Array());this.listNameElement.innerHTML="&nbsp;"}this.updateListStatus()},setDataList:function(A){this.oneListDataTable=new Af.DataTable(A);this.oneListTable.setDataList(A)},changed:function(A){var D=A.target?A.target:A.srcElement;if(this.oneListDataTable==null){showMessageDialog("Please add My List name and then insert items to list.","Request!",330,120);return }if(this.listItemInputBox.value!=""){if(D==this.listItemInputBox){var B=((this.oneListDataTable.getDataList().length));var C=this.oneListDataTable.insertObject("description",this.listItemInputBox.value,B,true);this.saveMyList(C);this.listItemInputBox.value=""}}return false},cellChanged:function(E,B,C,A){var D=this.oneListDataTable.getDataList()[E];if(A==null){A=""}else{A=""+A}if(D[C]==A){return }D[C]=A;this.saveMyList(D)},saveMyList:function(C){var B=new Af.DataRequest(svcURL,this.requestMyListCompletedCommon.bind(this),this.requestFailedCommon.bind(this),null,this.requestTimedoutCommon.bind(this));B.addService("WorkspaceService","saveMyListItem");if(C.UUID!=null){B.addParameter("UUID",C.UUID)}B.addParameter("selMyListId",this.oneList.UUID);B.addParameter("taskDone",C.taskDone);var A="<messages>";if(C.description!=""&&C.description!=undefined){A+="<description>"+xmlEncode(C.description)+"</description>"}else{A+="<description> </description>"}if(C.dueDate!=""&&C.dueDate!=undefined){A+="<dueDate>"+xmlEncode(C.dueDate)+"</dueDate>"}else{A+="<dueDate> </dueDate>"}if(C.helper!=""&&C.helper!=undefined){A+="<helper>"+xmlEncode(C.helper)+"</helper>"}else{A+="<helper> </helper>"}if(C.day!=""&&C.day!=undefined){A+="<day>"+xmlEncode(C.day)+"</day>"}else{A+="<day> </day>"}if(C.time!=""&&C.time!=undefined){A+="<time>"+xmlEncode(C.time)+"</time>"}else{A+="<time> </time>"}if(C.location!=""&&C.location!=undefined){A+="<location>"+xmlEncode(C.location)+"</location>"}else{A+="<location> </location>"}if(C.notes!=""&&C.notes!=undefined){A+="<notes>"+xmlEncode(C.notes)+"</notes>"}else{A+="<notes> </notes>"}A+="</messages>";B.xmlDoc=A;this.saveObj=C;ajaxEngine.processRequest(B)},requestMyListCompletedCommon:function(A){if(this.saveObj.UUID==null){this.saveObj.UUID=A.responseText;this.oneListTable.setDataList(this.oneListDataTable.getDataList());this.currentRow=-1}},requestFailedCommon:function(A,B){hideDialogWin();showMessageDialog("We are currently unable to save this record. Please try again.","Excuse us!",400,150)},requestTimedoutCommon:function(A){hideDialogWin();showMessageDialog("We are currently unable to save this record. Please try again.","Excuse us!",400,150)},cellSelected:function(E,B,D){this.removeCal();this.selectedRow=E;var C=this.oneListTable.getCell(E,B);this.currentRow=E;this.currentCol=B;if(D){if(C==this.editingCell){return }this.editingCell=C}else{this.oneListTable.selectRow(E)}if(B==2){var A=C.getElementsByTagName("input");this.selectedInput=A[0];this.selectedDateDiv=C;this.showCal()}},deleteItem:function(){if(this.currentRow==-1){showMessageDialog("Please click on the item you would like to delete <br/> then click Delete.","Select Item",350,100);return false}var A=this.oneListDataTable.deleteObjectByIndex(this.currentRow);this.oneListTable.setDataList(this.oneListDataTable.getDataList());this.deleteMyListItem(A);this.currentRow=-1;return false},deleteMyListItem:function(B){if(this.currentRow==-1){return }var A=new Af.DataRequest(svcURL,this.requestMyListDeletedCompletedCommon.bind(this),this.requestFailedCommon.bind(this),null,this.requestTimedoutCommon.bind(this));A.addService("WorkspaceService","deleteMyListItem");A.addParameter("UUID",B.UUID);A.addParameter("selMyListId",this.oneList.UUID);ajaxEngine.processRequest(A)},requestMyListDeletedCompletedCommon:function(A){},processDragBegin:function(A){},processDragged:function(A,B){},processDragComplete:function(B,E,D){var A=htmlTableRowIndexAt(this.oneListTable.tableElement,D);if(A<0){A=this.oneListDataTable.getDataList().length}else{}if(A>=0){var C=this.oneListDataTable.insertObject("description",B.text,A,true);this.oneListTable.setDataList(this.oneListDataTable.getDataList());this.currentRow=-1;this.saveMyList(C)}},showListOptions:function(C){if(this.listOptionsDropDown==null){this.listOptionsDropDown=new Af.DropDown(this,this.listOptionPopup,this.element,"List Options")}var B=RicoUtil.toDocumentPosition(this.listOptions);var A=B.x;var D=B.y+this.listOptions.offsetHeight;if(this.dialogContainer!=null){B=RicoUtil.toDocumentPosition(this.dialogContainer);A-=B.x;D-=B.y}this.listOptionsDropDown.show(A,D);if(is_ie&&!is_ie7){this.setOptionStatus()}return false},setOptionStatus:function(){if(this.oneList.isDoneSelected=="Yes"){this.completedItemsOption.checked=true}if(this.oneList.isDueSelected=="Yes"){this.dueDatesOption.checked=true}if(this.oneList.isHelperSelected=="Yes"){this.helpNeededOption.checked=true}return },dropDownClicked:function(C,B){var A=B.target?B.target:B.srcElement;if(A.checked!=null){this.updateListColumns();this.doMemoriesListStatus()}},updateListColumns:function(){this.simpleView=true;var C=this.oneListTable.templateRow;var B=this.oneListTable.columnsWidth;var A=B[1];var F=C.getElementsByTagName("TD");var D=this.myListsTableHeader.getElementsByTagName("TD");if(this.completedItemsOption.checked){F[0].style.display=""}else{F[0].style.display="none";A+=B[0]}if(this.dueDatesOption.checked){F[2].style.display=""}else{F[2].style.display="none";A+=B[2]}if(this.addToSchOption.checked){F[3].style.display=""}else{F[3].style.display="none";A+=B[3]}if(this.helpNeededOption.checked){F[4].style.display=""}else{F[4].style.display="none";A+=B[4]}F[1].style.width=A+"px";var E=F[1].getElementsByTagName("INPUT");if(E.length>0){E[0].style.width=(A-4)+"px"}D[1].style.width=A+"px";if(this.completedItemsOption.checked){D[0].style.display="";this.simpleView=false;this.isDoneSelected=true;if(this.oneList!=null){this.oneList.isDoneSelected="Yes"}}else{D[0].style.display="none";this.isDoneSelected=false;if(this.oneList!=null){this.oneList.isDoneSelected="No"}}if(this.dueDatesOption.checked){D[2].style.display="";this.simpleView=false;this.isDueSelected=true;if(this.oneList!=null){this.oneList.isDueSelected="Yes"}}else{D[2].style.display="none";this.isDueSelected=false;if(this.oneList!=null){this.oneList.isDueSelected="No"}}if(this.addToSchOption.checked){D[3].style.display="";this.simpleView=false}else{D[3].style.display="none"}if(this.helpNeededOption.checked){D[4].style.display="";this.simpleView=false;this.isHelperSelected=true;if(this.oneList!=null){this.oneList.isHelperSelected="Yes"}}else{D[4].style.display="none";this.isHelperSelected=false;if(this.oneList!=null){this.oneList.isHelperSelected="No"}}if(this.oneList!=null){this.setDataList(this.oneList.item)}},updateListStatus:function(){if(this.oneList!=null){if(this.oneList.isDoneSelected==null||this.oneList.isDoneSelected=="Yes"){this.completedItemsOption.checked=true}else{this.completedItemsOption.checked=false}if(this.oneList.isDueSelected==null||this.oneList.isDueSelected=="Yes"){this.dueDatesOption.checked=true}else{this.dueDatesOption.checked=false}if(this.oneList.isHelperSelected==null||this.oneList.isHelperSelected=="Yes"){this.helpNeededOption.checked=true}else{this.helpNeededOption.checked=false}this.updateListColumns()}return },doMemoriesListStatus:function(){if(this.oneList==null||this.oneList==undefined){return }var A=new Af.DataRequest(svcURL,this.statusSaveCompleted.bind(this),this.statusSaveFailed.bind(this),null,this.statusSaveTimedout.bind(this));A.addService("WorkspaceService","memoriesListStatus");A.addParameter("myListId",this.oneList.UUID);A.addParameter("isDoneClicked",this.isDoneSelected);A.addParameter("isDueClicked",this.isDueSelected);A.addParameter("isHelperClicked",this.isHelperSelected);ajaxEngine.processRequest(A)},statusSaveCompleted:function(A){},statusSaveFailed:function(){},statusSaveTimedout:function(){},printMyList:function(){var A=new Af.DataRequest(svcURL,this.printCompleted.bind(this),this.printFailed.bind(this),null,this.requestTimedout.bind(this));A.addService("WorkspaceService","getPrintHtmlFromXML");A.addParameter("templateName","myLists");if(this.simpleView){A.addParameter("xlstFile","MyListsSimpleView.xsl")}else{A.addParameter("xlstFile","MyListWithSignUp.xsl")}if(this.completedItemsOption.checked){A.addParameter("isDoneClicked","Yes")}if(this.helpNeededOption.checked){A.addParameter("isHelperClicked","Yes")}if(this.dueDatesOption.checked){A.addParameter("isDueClicked","Yes")}A.addParameter("myListId",this.oneList.UUID);ajaxEngine.processRequest(A);return false},printCompleted:function(A){var B=new Af.PrintUtil();B.showPrintView(A)},printFailed:function(){showMessageDialog("<br/>Printing is currently unavailable. Please try again.","Printing Unavailable",400,150)},requestTimedout:function(){showMessageDialog("<br/>Printing is currently unavailable. Please try again.","Printing Unavailable",400,150)},sendAskForHelpEmail:function(){if(this.oneListDataTable==null||this.oneListDataTable.getDataList().length==0){showMessageDialog("Please add items to your list before asking for help with them.","Request",400,130);return false}if(this.askForHelpDialog==null){this.askForHelpDialog=new HJ.MyListEmail("Request Sign-Ups Email",this,null);this.askForHelpDialog.requestType="askForHelp";this.askForHelpDialog.width="330px"}this.askForHelpDialog.showHTMLTemplate(basePageURL+"MyListsAskForHelpEmail.htm","content","myListAskForHelpEmail");this.askForHelpDialog.centerDialog(150,250);this.askForHelpDialog.setObj(this.oneList)},sendSimpleList:function(){if(this.oneListDataTable==null||this.oneListDataTable.getDataList().length==0){showMessageDialog("Please add items to your list before sending it to others","Request",400,130);return false}if(this.sendDialog==null){this.sendDialog=new HJ.MyListEmail("Send List Email",this,null);this.sendDialog.width="330px"}this.sendDialog.showHTMLTemplate(basePageURL+"MyListsSimpleListEmail.htm","content","myListSimpleEmail");this.sendDialog.centerDialog(150,250);this.sendDialog.setObj(this.oneList)},focusOnTextBox:function(A){this.listItemInputBox.value="";this.listItemInputBox.focus()},focusLostTextBox:function(A){this.listItemInputBox.value=this.defaultValue;consumeEvent(A)},doRenameMyList:function(A){consumeEvent(A);if(this.oneList.name==null||this.oneList.name==""){showMessageDialog("please select list name to rename.","Request!",300,100);return }if(this.editDialog==null){this.editDialog=new HJ.AddMyListDialog("Rename MyList",this,null);this.editDialog.left=200;this.editDialog.top=60}this.editDialog.showHTMLTemplate(basePageURL+"AddMyList.html","content","newMyList");this.editDialog.centerDialog(400,280);this.editDialog.setDataObject(this.oneList,"Type new Name of MyList");return false},doShowListHelp:function(){if(this.showListHelpDialog!=null){delete this.showListHelpDialog}var A={templateLoaded:function(){this.parent.showListHelpTemplateLoaded()},parent:this};this.showListHelpDialog=new Af.HtmlDialog("Send List Help",A,null);this.showListHelpDialog.width="560px";this.showListHelpDialog.showHTMLTemplate(basePageURL+"SendListGuide.htm","MainArea","listGuidelineDiv");this.showListHelpDialog.centerDialog(350,350);this.showListHelpDialog.setLocation("100","100")},showListHelpTemplateLoaded:function(){this.okButton=document.getElementById("OkButton");this.okButton.onclick=this.doHideListHelp.bind(this)},doHideListHelp:function(){this.showListHelpDialog.hide()}};HJ.AddMyListDialog=Class.create();HJ.AddMyListDialog.prototype=Object.extend(new Af.HtmlDialog(),{initialize:function(C,A,B,D){this.zIndex=D;this._initializeDialog(C,A,B);this.obj=null;this.message=""},templateLoaded:function(){if(this.zIndex!=null){this.element.style.zIndex=this.zIndex}this.ec=new Af.ElementCollection(this.element);this.save=this.ec.getFirstElementById("save");this.armedButton=this.save;this.displayMessage=this.ec.getFirstElementById("displayMessage");this.myListName=this.ec.getFirstElementById("myListName");this.cancel=this.ec.getFirstElementById("cancel");this.cancel.onclick=this.doCancel.bind(this);this.save.onclick=this.doSave.bind(this);this.initializeTemplateData()},setDataObject:function(B,A){this.obj=B;this.message=A;this.initializeTemplateData()},initializeTemplateData:function(){if(this.message!=null&&this.displayMessage!=null){this.displayMessage.innerHTML=this.message}if(this.myListName!=null&&this.obj!=null){this.myListName.value=this.obj.name}if(this.myListName!=null){this.myListName.focus()}return },doSave:function(){if(this.myListName.value==null||trim(this.myListName.value)==""){this.hide();return }var A;if(this.obj!=null){this.obj.name=this.myListName.value;A=this.obj;app.myLists.refreshListDetailView(A)}else{A=app.myLists.dataTable.insertObject("name",this.myListName.value,0,true)}this.hide();this.saveMyList(A)},saveMyList:function(C){var A="<message>";A+="<myListName>"+xmlEncode(this.myListName.value)+"</myListName>";A+="<templateType>default</templateType>";A+="<startDT> </startDT>";A+="<endDT> </endDT>";A+="<repeatType> </repeatType>";A+="<organizerName>"+login.userFullName+"</organizerName>";A+="<phone> </phone>";A+="<notes> </notes>";A+="</message>";var B=new Af.DataRequest(svcURL,this.requestSaveMyListCompletedCommon.bind(this),this.requestFailedCommon.bind(this),null,this.requestTimedoutCommon.bind(this));B.addService("WorkspaceService","saveMyList");if(C.UUID!=null){B.addParameter("UUID",C.UUID)}this.saveObj=C;B.xmlDoc=A;ajaxEngine.processRequest(B)},requestSaveMyListCompletedCommon:function(A){this.myListName.value="";if(this.saveObj.UUID==null){this.saveObj.UUID=A.responseText}app.myLists.myListsTable.setDataList(app.myLists.dataTable.getDataList());if(this.handler.myListCreated!=null){this.handler.myListCreated(this.saveObj.UUID)}},requestFailedCommon:function(){showMessageDialog("We are currently unable to save this list. Please try again.","Excuse us!",350,100)},requestTimedoutCommon:function(){showMessageDialog("We are currently unable to save this list. Please try again.","Excuse us!",350,100)},doCancel:function(){this.hide()}});HJ.Calendar=Class.create();HJ.Calendar.prototype=Object.extend(new Af.BaseCalendar(),{initialize:function(){}});HJ.Agenda=Class.create();HJ.Agenda.prototype=Object.extend(new Af.BaseCalendar(),{initialize:function(){}});HJ.DailyCalendar=Class.create();HJ.DailyCalendar.prototype=Object.extend(new HJ.Calendar(),{initialize:function(E,D,C,B,A){this.calendarTitle=E;this.calendarArea=D;this.calendarHeader=C;this.allDayEvents=B;this.todaysCalendarLink=A;this.table=document.createElement("table");this.table.id="dailyCTable";this.allDayEventsBody=document.createElement("tbody");this.dndMgr2=new Af.DndMgr2(this);this.m=null;this.dropZone=null;this.allDayDropZone=null},cleanup:function(){this.table.ondblclick=null;this.table.onclick=null;this.dndMgr2.clearAll();this.table.style.display="none";this.calendarArea.appendChild(this.table);this.calendarArea.appendChild(this.dndMgr2.draggableElement)},setVisible:function(A){if(A){if(this.allDayDropZone==null){this.allDayDropZone=this.dndMgr2.registerDropZone("dailyCalendar_allDayEvents",this.allDayEvents,this)}else{this.dndMgr2.registerDropZone2(this.allDayDropZone)}if(this.dropZone==null){this.dropZone=this.dndMgr2.registerDropZone("dailyCalendar",this.table,this)}else{this.dndMgr2.registerDropZone2(this.dropZone)}app.dndMgrScribble.registerDropZone("dailyCalendar_allDayEvents",this.allDayEvents,this);app.dndMgrMyLists.registerDropZone("dailyCalendar_allDayEvents",this.allDayEvents,this);app.dndMgrScribble.registerDropZone("dailyCalendar",this.table,this);app.dndMgrMyLists.registerDropZone("dailyCalendar",this.table,this);this.allDayEvents.onmousedown=this.mouseDownOnAllDaysTable.bindAsEventListener(this)}else{if(this.allDayDropZone!=null){this.dndMgr2.deregisterDropZone(this.allDayDropZone)}if(this.dropZone!=null){this.dndMgr2.deregisterDropZone(this.dropZone)}}},render:function(D,B){app.showBusy();this.schedules=D;this.date=B;this.startTime=new Date(this.date.getTime());this.endTime=new Date(this.date.getTime());this.endTime.setHours(24,0,0);if(this.todaysCalendarLink!=null){var A=new Date();A.setHours(0,0,0,0);if(A.getTime()==this.date.getTime()){this.todaysCalendarLink.className="todaysCalendar_on"}else{this.todaysCalendarLink.className="todaysCalendar_off"}}this.calendarHeader.className="calendarHeader";this.calendarTitle.innerHTML=this.daysLong[this.date.getDay()]+", "+this.months[this.date.getMonth()]+" "+this.date.getDate()+", "+this.date.getFullYear();removeAll(this.calendarArea);removeAll(this.calendarHeader);this.calendarArea.className="calendar";this.allDayEvents.style.display="";var E=this.table;removeAll(E);E.cellSpacing="0";this.calendarArea.appendChild(E);var G=document.createElement("tbody");G.id="dailyCTB";E.appendChild(G);for(var F=0;F<24;F++){var I=document.createElement("tr");G.appendChild(I);var C=document.createElement("td");C.className="calTime";var H;if(F==0){H="12 am"}else{if(F==12){H="12 pm"}else{if(F>12){H=(F-12)+" pm"}else{H=F+" am"}}}C.vAling="top";C.appendChild(document.createTextNode(H));I.appendChild(C);C=document.createElement("td");C.innerHTML="&nbsp;";I.appendChild(C);C.className="dailyCalEventName"}this.renderEvents();this.table.ondblclick=this.doubleClicked.bindAsEventListener(this);this.table.onclick=this.tableClicked.bindAsEventListener(this);this.table.onmousedown=this.mouseDownOnTable.bindAsEventListener(this);app.endBusy()},next:function(){var A=new Date(this.startTime.getTime());A.setDate(A.getDate()+1);this.render(this.schedules,A);app.schedule.saveCurrentCalendarDate()},previous:function(){var A=new Date(this.startTime.getTime());A.setDate(A.getDate()-1);this.render(this.schedules,A);app.schedule.saveCurrentCalendarDate()},renderEvents:function(){this.allDayEvents.className="allDay";removeAll(this.allDayEvents);var D=this.allDayEventsBody;removeAll(D);this.allDayEvents.appendChild(D);this.allDayEvents.onclick=this.tableClicked.bindAsEventListener(this);this.m=this.getEventMatrics(this.table,this.date,this.startTime,this.endTime);var B=this.m;var F=B[24];this.allDayEvents.style.tableLayout="auto";if(F.length>0){for(var C=0;C<F.length;C++){var G=F[C];if(G.r<24){continue}var E=document.createElement("tr");D.appendChild(E);var H=document.createElement("td");E.appendChild(H);H.style.paddingTop="4px";H.appendChild(G.link)}}else{var E=document.createElement("tr");D.appendChild(E);var H=document.createElement("td");H.style.height="20px";E.appendChild(H);H.innerHTML="&nbsp;"}var A=this.table.rows[1];if(A.cells[0].offsetWidth!=0){this.allDayEvents.style.marginLeft=(A.cells[0].offsetWidth-1)+"px";this.allDayEvents.style.tableLayout="fixed";this.allDayEvents.style.width=(A.cells[1].offsetWidth+1)+"px"}this.renderMatrics(this.m,this.table,1)},handleScroll:function(){this.renderMatrics(this.m,this.table,1)},processDragBegin:function(A){this.bFlag=true},processDragged:function(B,F){if(!this.bFlag){return }var A=htmlTableRowIndexAt(this.table,F);if(A>=0){var E=A;var D=new Date(this.startTime.getTime());var C=new Date(D.getTime());this.bFlag=false;this.actualDate=D.getTime()}},processDragComplete:function(B,F,G){if(F.htmlElement==this.allDayEvents){this.processDragCompleteOnNoTime(B,F,G);return }var H=RicoUtil.toViewportPosition(this.calendarArea);var D=H.y+this.calendarArea.scrollTop;var I;if(!is_Safari){I=G.clientY}else{I=G.clientY-document.body.scrollTop}if(I<D){return }var K=htmlTableRowIndexAt(this.table,G);if(K>=0){var L=K;var J=new Date(this.startTime.getTime());var E=new Date(J.getTime());J.setHours(K);E.setHours(K,30)}else{return }if(B.type!="Event"){var A=app.schedule.getSelectedSchedule();if(A==null){app.schedule.showSelectScehduleMessage();return }var C=new Object();C.displayName=B.text;C.startDT=""+J.getTime();C.endDT=""+E.getTime();C.timeFlag="true";C.noTimeFlag="false";C.fromTime=L*60;C.toTime=L*60+30;this.save(C);this.render(this.schedules,this.date)}else{this.moveToNewStartTime(B,J);this.render(this.schedules,this.date)}},processDragCompleteOnNoTime:function(E,G,F){if(E.type!="Event"){var D=app.schedule.getSelectedSchedule();if(D==null){app.schedule.showSelectScehduleMessage();return }var B=new Date(this.startTime.getTime());var A=new Date(B.getTime());var C=new Object();C.displayName=E.text;C.timeFlag="false";C.noTimeFlag="true";C.startDT=""+B.getTime();C.endDT=""+(A.getTime()+(30*60*1000));C.fromTime=8*60;C.toTime=8*60+30;this.save(C);this.render(this.schedules,this.date)}else{this.moveToNoTime(E,this.startTime.getTime());this.render(this.schedules,this.date)}},doubleClicked:function(H){var G=H.target?H.target:H.srcElement;if(G.tagName=="A"&&G.id!=null){return }var F=app.schedule.getSelectedSchedule();if(F==null){app.schedule.showSelectScehduleMessage();return }var A=htmlTableRowIndexAt(this.table,H);if(A>=0){var D=A;var C=new Date(this.startTime.getTime());var B=new Date(C.getTime());C.setHours(A);B.setHours(A,30);var E=new Object();E.displayName="New Event";E.startDT=""+C.getTime();E.endDT=""+B.getTime();E.timeFlag="true";E.noTimeFlag="false";E.fromTime=D*60;E.toTime=D*60+30;app.schedule.editEventDetails(E,F,true)}},scrollTo7AM:function(){if(is_ie){this.calendarArea.scrollTop="189"}else{this.calendarArea.scrollTop="162"}},showQuickEventDialog:function(D){var F=app.schedule.getSelectedSchedule();if(F==null){app.schedule.showSelectScehduleMessage();return }var C=this.startIdx;var B=new Date(this.startTime.getTime());var A=new Date(B.getTime());B.setHours(C);A.setHours(this.endIdx+1);var E=new Object();E.displayName="New Event";if(B.getTime()-A.getTime()<=0){E.startDT=""+B.getTime();E.endDT=""+A.getTime()}else{E.startDT=""+A.getTime();E.endDT=""+B.getTime()}if(D){E.timeFlag="false";E.noTimeFlag="true"}else{E.timeFlag="true";E.noTimeFlag="false"}if(C*60-(this.endIdx+1)*60<=0){E.fromTime=C*60;E.toTime=(this.endIdx+1)*60}else{E.fromTime=(this.endIdx+1)*60;E.toTime=C*60}app.schedule.addQuickNewEvent(E,F,true)}});HJ.DailyAgenda=Class.create();HJ.DailyAgenda.prototype=Object.extend(new HJ.Agenda(),{initialize:function(E,D,C,B,A){this.calendarTitle=E;this.calendarArea=D;this.calendarHeader=C;this.allDayEvents=B;this.todaysCalendarLink=A;this.tbody2=document.createElement("tbody")},cleanup:function(){this.tbody2.style.display="none";this.allDayEvents.appendChild(this.tbody2)},render:function(G,E){app.showBusy();this.allDayEvents.className="allDay";this.allDayEvents.style.tableLayout="auto";removeAll(this.allDayEvents);this.allDayEvents.appendChild(this.tbody2);removeAll(this.tbody2);this.allDayEvents.onclick=this.tableClicked.bindAsEventListener(this);this.schedules=G;this.date=E;app.schedule.loadEventData(this.date);this.startTime=new Date(this.date.getTime());this.endTime=new Date(this.date.getTime());this.endTime.setHours(24,0,0);if(this.todaysCalendarLink!=null){var D=new Date();D.setHours(0,0,0,0);if(D.getTime()==this.date.getTime()){this.todaysCalendarLink.className="todaysCalendar_on"}else{this.todaysCalendarLink.className="todaysCalendar_off"}}this.calendarTitle.innerHTML=this.daysLong[this.date.getDay()]+", "+this.months[this.date.getMonth()]+" "+this.date.getDate()+", "+this.date.getFullYear();removeAll(this.calendarArea);removeAll(this.calendarHeader);this.calendarArea.className="calDayAgenda";this.allDayEvents.style.display="";var H=document.createElement("table");H.cellSpacing="2";this.calendarArea.appendChild(H);var J=document.createElement("tbody");H.appendChild(J);var A=this.getVisibleEventsList(this.date,this.startTime,this.endTime,true);var B=false;for(var I=0;I<A.length;I++){var C=A[I];if(C.event.timeFlag+""=="false"){B=true;var K=document.createElement("tr");this.tbody2.appendChild(K);F=this.getAgendaEventCell(C.schedule,C.scindex,C.event,C.eventindex,C.actualDate);K.appendChild(F)}else{var K=document.createElement("tr");J.appendChild(K);var F=this.getTimeCell(C.schedule,C.event);F.style.width="20%";K.appendChild(F);F=this.getAgendaEventCell(C.schedule,C.scindex,C.event,C.eventindex,C.actualDate);F.style.width="80%";K.appendChild(F)}}if(!B){var K=document.createElement("tr");this.tbody2.appendChild(K);var F=document.createElement("td");F.style.height="20px";K.appendChild(F);F.innerHTML="&nbsp;"}this.allDayEvents.style.marginLeft="19px";this.allDayEvents.style.width="650px";this.allDayEvents.style.tableLayout="fixed";H.onclick=this.tableClicked.bindAsEventListener(this);app.endBusy()},next:function(){var A=new Date(this.startTime.getTime());A.setDate(A.getDate()+1);this.render(this.schedules,A);app.schedule.saveCurrentCalendarDate()},previous:function(){var A=new Date(this.startTime.getTime());A.setDate(A.getDate()-1);this.render(this.schedules,A);app.schedule.saveCurrentCalendarDate()}});HJ.WeeklyCalendar=Class.create();HJ.WeeklyCalendar.prototype=Object.extend(new HJ.Calendar(),{initialize:function(D,C,B,A){this.calendarTitle=D;this.calendarArea=C;this.calendarHeader=B;this.allDayEvents=A;this.table=document.createElement("table");this.table.cellSpacing="0";this.calendarArea.appendChild(this.table);this.allDayEventsBody=document.createElement("tbody");this.dndMgr2=new Af.DndMgr2(this);this.table.ondblclick=this.doubleClicked.bindAsEventListener(this);this.table.onclick=this.tableClicked.bindAsEventListener(this);this.allDayEvents.onclick=this.tableClicked.bindAsEventListener(this);this.table.onmousedown=this.mouseDownOnTable.bindAsEventListener(this);this.dropZone=null;this.allDayDropZone=null},cleanup:function(){this.table.ondblclick=null;this.table.onclick=null;this.dndMgr2.clearAll();this.table.style.display="none";this.calendarArea.appendChild(this.table);this.calendarArea.appendChild(this.dndMgr2.draggableElement)},setVisible:function(A){if(A){if(this.allDayDropZone==null){this.allDayDropZone=this.dndMgr2.registerDropZone("dailyCalendar_allDayEvents",this.allDayEvents,this)}else{this.dndMgr2.registerDropZone2(this.allDayDropZone)}if(this.dropZone==null){this.dropZone=this.dndMgr2.registerDropZone("dailyCalendar",this.table,this)}else{this.dndMgr2.registerDropZone2(this.dropZone)}app.dndMgrScribble.registerDropZone("weeklyCalendar_allDayEvents",this.allDayEvents,this);app.dndMgrMyLists.registerDropZone("weeklyCalendar_allDayEvents",this.allDayEvents,this);app.dndMgrScribble.registerDropZone("weeklyCalendar",this.table,this);app.dndMgrMyLists.registerDropZone("weeklyCalendar",this.table,this);this.allDayEvents.onmousedown=this.mouseDownOnAllDaysTable.bindAsEventListener(this)}else{if(this.allDayDropZone!=null){this.dndMgr2.deregisterDropZone(this.allDayDropZone)}if(this.dropZone!=null){this.dndMgr2.deregisterDropZone(this.dropZone)}}},render:function(E,B){app.showBusy();var C;this.schedules=E;this.date=B;app.schedule.loadEventData(this.date);this.startTime=new Date(this.date.getTime());var L=B.getDay();this.startTime.setDate(this.startTime.getDate()-L);this.endTime=new Date(this.startTime.getTime());this.endTime.setDate(this.endTime.getDate()+7);var A=new Date(this.startTime.getTime());A.setDate(A.getDate()+6);this.calendarTitle.innerHTML="Week of "+this.months[this.startTime.getMonth()]+" "+this.startTime.getDate()+", "+this.startTime.getFullYear();removeAll(this.calendarArea);removeAll(this.calendarHeader);this.calendarHeader.className="calendarHeader";this.calendarArea.className="calendar";this.allDayEvents.style.display="";var G=document.createElement("table");G.cellSpacing="0";G.className="calDays";this.calendarHeader.appendChild(G);var H=document.createElement("tbody");G.appendChild(H);var K=document.createElement("tr");H.appendChild(K);var A=new Date(this.startTime.getTime());for(var F=0;F<7;F++){C=document.createElement("td");C.className="calDay";C.innerHTML=A.getDate()+" "+this.days[F];K.appendChild(C);A.setDate(A.getDate()+1)}G=this.table;removeAll(G);G.cellSpacing="0";this.calendarArea.appendChild(G);H=document.createElement("tbody");G.appendChild(H);for(var F=0;F<24;F++){K=document.createElement("tr");H.appendChild(K);C=document.createElement("td");C.className="calTime";var J;if(F==0){J="12 am"}else{if(F==12){J="12 pm"}else{if(F>12){J=(F-12)+" pm"}else{J=F+" am"}}}C.innerHTML=J;K.appendChild(C);for(var D=0;D<7;D++){C=document.createElement("td");C.className="weeklyCalEventName";C.innerHTML="&nbsp;";K.appendChild(C)}}var I=this.table.rows[0];G=this.allDayEvents;G.className="calDaysNoTime";G.style.tableLayout="auto";removeAll(G);G.cellSpacing="0";G.border="0";var H=this.allDayEventsBody;removeAll(H);G.appendChild(H);var K=document.createElement("tr");H.appendChild(K);var I=this.table.rows[0];G.style.marginLeft=(I.cells[0].offsetWidth-1)+"px";var M=0;for(var D=0;D<7;D++){C=document.createElement("td");if(D==0){C.className="weeklyCalNoTimeEventName1"}else{C.className="weeklyCalNoTimeEventName"}M+=I.cells[D+1].offsetWidth;C.style.width=(I.cells[D+1].offsetWidth-5)+"px";K.appendChild(C)}G.style.tableLayout="fixed";G.style.width=M+"px";this.renderEvents();app.endBusy()},next:function(){var A=this.date;A.setDate(A.getDate()+7);this.render(this.schedules,A)},previous:function(){var A=this.date;A.setDate(A.getDate()-7);this.render(this.schedules,A)},renderEvents:function(){this.mlist=new Array(7);var D=new Date(this.startTime.getTime());for(var G=0;G<this.mlist.length;G++){var C=new Date(D.getTime());C.setDate(C.getDate()+1);this.mlist[G]=this.getEventMatrics(this.table,D,D,C);D=C}var F=this.allDayEvents;for(var G=0;G<this.mlist.length;G++){var H=this.mlist[G][24];var J=F.rows[0].cells[G];J.innerHTML="&nbsp;&nbsp;";for(var E=0;E<H.length;E++){var B=H[E];if(B.r<24){continue}if(F.style.display=="none"){F.style.display=""}var I;if(J.childNodes[0].tagName!="DIV"){removeAll(J);I=document.createElement("div");I.style.overflow="hidden";I.style.width=J.width;J.appendChild(I)}else{I=J.childNodes[0];var A=document.createElement("span");A.style.fontSize="4px";A.innerHTML="<br/><br/>";I.appendChild(A)}I.appendChild(B.link)}}this.renderMatricsList()},renderMatricsList:function(){for(var A=0;A<this.mlist.length;A++){this.renderMatrics(this.mlist[A],this.table,A+1)}},handleScroll:function(){this.renderMatricsList()},processDragBegin:function(A){this.bFlag=true},processDragged:function(B,F){if(!this.bFlag){return }var A=htmlTableRowIndexAt(this.table,F);if(A>=0){var C=htmlTableCellIndexAt(this.table,this.table.rows[A],F);if(C<0){return }if(C>0){C--}var E=A;var D=new Date(this.startTime.getTime());D.setDate(D.getDate()+C);this.bFlag=false;this.actualDate=D.getTime()}},processDragComplete:function(B,G,H){if(G.htmlElement==this.allDayEvents){this.processDragCompleteOnNoTime(B,G,H);return }var I=RicoUtil.toViewportPosition(this.calendarArea);var D=I.y+this.calendarArea.scrollTop;var J;if(!is_Safari){J=H.clientY}else{J=H.clientY-document.body.scrollTop}if(J<D){return }var L=htmlTableRowIndexAt(this.table,H);if(L>=0){var E=htmlTableCellIndexAt(this.table,this.table.rows[L],H);if(E<0){return }if(E>0){E--}var M=L;var K=new Date(this.startTime.getTime());K.setDate(K.getDate()+E);var F=new Date(K.getTime());K.setHours(L);F.setHours(L,30)}else{return }if(B.type!="Event"){var A=app.schedule.getSelectedSchedule();if(A==null){app.schedule.showSelectScehduleMessage();return }var C=new Object();C.displayName=B.text;C.startDT=""+K.getTime();C.endDT=""+F.getTime();C.timeFlag="true";C.noTimeFlag="false";C.fromTime=M*60;C.toTime=M*60+30;this.save(C);this.render(this.schedules,this.date)}else{this.moveToNewStartTime(B,K);this.render(this.schedules,this.date)}},processDragCompleteOnNoTime:function(F,H,G){var B=htmlTableCellIndexAt(this.allDayEvents,this.allDayEvents.rows[0],G);if(B<0){return }debugA("idx2: "+B);var C=new Date(this.startTime.getTime());C.setDate(C.getDate()+B);var A=new Date(C.getTime());if(F.type!="Event"){var E=app.schedule.getSelectedSchedule();if(E==null){app.schedule.showSelectScehduleMessage();return }var D=new Object();D.displayName=F.text;D.timeFlag="false";D.noTimeFlag="true";D.startDT=""+C.getTime();D.endDT=""+(A.getTime()+(30*60*1000));D.fromTime=8*60;D.toTime=8*60+30;this.save(D);this.render(this.schedules,this.date)}else{this.moveToNoTime(F,C.getTime());this.render(this.schedules,this.date)}},doubleClicked:function(E){var G=E.target?E.target:E.srcElement;if(G.tagName=="A"&&G.id!=null){return }var A=app.schedule.getSelectedSchedule();if(A==null){app.schedule.showSelectScehduleMessage();return }var H=htmlTableRowIndexAt(this.table,E);if(H>=0){var C=htmlTableCellIndexAt(this.table,this.table.rows[H],E);if(C<0){return }if(C>0){C--}var I=H;var F=new Date(this.startTime.getTime());F.setDate(F.getDate()+C);var D=new Date(F.getTime());F.setHours(H);D.setHours(H,30);var B=new Object();B.displayName="New Event";B.startDT=""+F.getTime();B.endDT=""+D.getTime();B.timeFlag="true";B.noTimeFlag="false";B.fromTime=I*60;B.toTime=I*60+30;app.schedule.editEventDetails(B,A,true)}},scrollTo7AM:function(){if(is_ie){this.calendarArea.scrollTop="189"}else{this.calendarArea.scrollTop="162"}},showQuickEventDialog:function(D){var F=app.schedule.getSelectedSchedule();if(F==null){app.schedule.showSelectScehduleMessage();return }var C=this.startIdx;var B=new Date(this.startTime.getTime());B.setDate(B.getDate()+(this.cellIdx-1));var A=new Date(B.getTime());B.setHours(C);A.setHours(this.endIdx+1);var E=new Object();E.displayName="New Event";E.startDT=""+B.getTime();E.endDT=""+A.getTime();if(D){E.timeFlag="false";E.noTimeFlag="true"}else{E.timeFlag="true";E.noTimeFlag="false"}E.fromTime=C*60;E.toTime=(this.endIdx+1)*60;app.schedule.addQuickNewEvent(E,F,true)}});HJ.WeeklyAgenda=Class.create();HJ.WeeklyAgenda.prototype=Object.extend(new HJ.Agenda(),{initialize:function(D,C,B,A){this.calendarTitle=D;this.calendarArea=C;this.calendarHeader=B;this.allDayEvents=A;this.table=document.createElement("table");this.table.onclick=this.tableClicked.bindAsEventListener(this)},cleanup:function(){this.table.onclick=null;this.table.style.display="none";this.calendarArea.appendChild(this.table)},render:function(H,E){app.showBusy();this.schedules=H;this.date=E;if(!app.schedule.loadEventData(this.date)){return false}this.startTime=new Date(this.date.getTime());var N=E.getDay();this.startTime.setDate(this.startTime.getDate()-N);this.endTime=new Date(this.startTime.getTime());this.endTime.setDate(this.endTime.getDate()+7);var C=new Date(this.startTime.getTime());C.setDate(C.getDate()+6);this.calendarTitle.innerHTML="Week of "+this.months[this.startTime.getMonth()]+" "+this.startTime.getDate()+", "+this.startTime.getFullYear();removeAll(this.calendarArea);removeAll(this.calendarHeader);this.calendarArea.className="calDayAgenda";this.allDayEvents.style.display="none";var K=this.table;removeAll(K);K.cellSpacing="2";this.calendarArea.appendChild(K);var L=document.createElement("tbody");K.appendChild(L);var F=new Date(this.startTime.getTime());for(var I=0;I<7;I++){var D=new Date(F.getTime());D.setDate(D.getDate()+1);var A=this.getVisibleEventsList(F,F,D,true);for(var J=0;J<A.length;J++){var B=A[J];var M=document.createElement("tr");L.appendChild(M);var G=document.createElement("td");var C=B.actualDate;if(C==null){var O=parseInt(B.event.startDT);C=new Date(O)}G.innerHTML=this.daysLong[C.getDay()]+" "+this.monthsShort[C.getMonth()]+" "+C.getDate();G.style.width="20%";M.appendChild(G);G=this.getTimeCell(B.schedule,B.event);G.style.width="20%";M.appendChild(G);G=this.getAgendaEventCell(B.schedule,B.scindex,B.event,B.eventindex,B.actualDate);G.style.width="60%";M.appendChild(G)}F=D}app.endBusy()},next:function(){var A=this.date;A.setDate(A.getDate()+7);this.render(this.schedules,A)},previous:function(){var A=this.date;A.setDate(A.getDate()-7);this.render(this.schedules,A)}});HJ.MonthlyCalendar=Class.create();HJ.MonthlyCalendar.prototype=Object.extend(new HJ.Calendar(),{initialize:function(D,C,B,A){this.calendarTitle=D;this.calendarArea=C;this.calendarHeader=B;this.allDayEvents=A;this.listener=null;this.table=document.createElement("table");this.dndMgr2=new Af.DndMgr2(this);this.table.ondblclick=this.doubleClicked.bindAsEventListener(this);this.table.onclick=this.tableClicked.bindAsEventListener(this);this.dropZone=null},cleanup:function(){this.table.ondblclick=null;this.table.onclick=null;this.dndMgr2.clearAll();this.table.style.display="none";this.calendarArea.appendChild(this.table);this.calendarArea.appendChild(this.dndMgr2.draggableElement)},setVisible:function(A){if(A){if(this.dropZone==null){this.dropZone=this.dndMgr2.registerDropZone("monthlyCalendar",this.table,this)}else{this.dndMgr2.registerDropZone2(this.dropZone)}app.dndMgrScribble.registerDropZone("monthlyCalendar",this.table,this);app.dndMgrMyLists.registerDropZone("monthlyCalendar",this.table,this)}else{if(this.dropZone!=null){this.dndMgr2.deregisterDropZone(this.dropZone)}}},render:function(G,C){this.schedules=G;this.date=C;if(!app.schedule.loadEventData(this.date)){return false}var E=new Date(C.getTime());E.setDate(1);this.calendarTitle.innerHTML=this.months[E.getMonth()]+" "+E.getFullYear();this.startTime=new Date(E.getTime());var M=E.getDay();this.startTime.setDate(this.startTime.getDate()-M);removeAll(this.calendarArea);removeAll(this.calendarHeader);this.calendarArea.className="fullMonth";this.calendarHeader.className="calendarHeaderFullMonth";this.allDayEvents.style.display="none";var H=document.createElement("table");H.cellSpacing="0";H.className="calMonthHeaderDays";this.calendarHeader.appendChild(H);var J=document.createElement("tbody");H.appendChild(J);var K=document.createElement("tr");J.appendChild(K);for(var I=0;I<7;I++){var D=document.createElement("td");D.className="calMonthHeaderDays";D.innerHTML=this.days[I];K.appendChild(D)}H=this.table;removeAll(H);H.cellSpacing="2";H.cellPadding="1";this.calendarArea.appendChild(H);J=document.createElement("tbody");H.appendChild(J);var B=E.getMonth();var L=E.getFullYear();var A=new Date(this.startTime.getTime());while((A.getMonth()<=B&&A.getFullYear()==L)||(A.getMonth()>B&&A.getFullYear()<L)){var K=document.createElement("tr");J.appendChild(K);for(var F=0;F<7;F++){var O=A.getTime();D=document.createElement("td");D.id=""+O;var N=document.createElement("a");if(A.getMonth()!=B){N.className="otherMonthDay"}else{N.className="monthDay"}N.href="#";N.innerHTML=""+A.getDate();N.id=""+O;D.appendChild(N);K.appendChild(D);A.setDate(A.getDate()+1)}}this.endTime=A;this.renderEvents(H)},next:function(){var A=this.date.getMonth();var B=this.date.getFullYear();A+=1;if(A>11){A=0;B++}this.date.setFullYear(B);this.date.setMonth(A);this.render(this.schedules,this.date)},previous:function(){var A=this.date.getMonth();var B=this.date.getFullYear();A-=1;if(A<0){A=11;B--}this.date.setFullYear(B);this.date.setMonth(A);this.render(this.schedules,this.date)},renderEvents:function(D){var X=new Date(this.date.getTime());X.setDate(1);var F=X.getDay();var R=new Date(this.startTime.getTime());while(R.getTime()<this.endTime.getTime()){var O=new Date(R.getTime());O.setDate(O.getDate()+1);var H=R.getTime();var E=O.getTime();var L=new Array();for(var Q=0;Q<this.schedules.length;Q++){var A=this.schedules[Q];var M=A.event;if(M!=null){for(var N=0;N<M.length;N++){var P=M[N];var I=parseInt(P.startDT);var S=parseInt(P.endDT);var G=new Date(I);G.setHours(0,0,0,0);if(G.getTime()<=H&&(P.repeatFlag+""=="true")){if(P.deletedSeqList==null){setEventDeleteSeqList(P)}if(P.modifiedSeqList==null){setEventModifySeqList(P)}if(!isEventInSeq(P,R.getTime())){continue}P=this.getRpt(P,R,R,O);if(P==null){continue}I=R.getTime()}else{if(I<H||I>=E){continue}}var T=new Date(I);var C=this.getDayNumber(I)-1;if(C<0){debugA(P.displayName+" : "+T.toString());continue}var J=parseInt(C/7);var U=C%7;var K=new Object();K.schedule=A;K.scindex=Q;K.event=P;K.eventindex=N;K.link=this.getEventLink(A,Q,P,N);K.link.name=I;K.r=J;K.c=U;L.push(K);if(this.dndMgr2!=null&&A.sharing!="ALL_TIME"&&A.sharing!="FREE_TIME"&&A.sharing!="public"){var V=K.link;var W=V.id;this.dndMgr2.registerDraggable("Event",W,V,P.displayName)}}}}L.sort(eventOrder);for(N=0;N<L.length;N++){var K=L[N];var B=D.rows[K.r].cells[K.c];B.appendChild(K.link)}R=O}},processDragBegin:function(A){this.bFlag=true},processDragged:function(C,F){if(!this.bFlag){return }var B=htmlTableRowIndexAt(this.table,F);if(B>=0){var D=htmlTableCellIndexAt(this.table,this.table.rows[B],F);if(D<0){return }var A=this.table.rows[B].cells[D];var E=new Date(parseInt(A.id));this.bFlag=false;this.actualDate=E.getTime()}},processDragComplete:function(B,F,G){var I=htmlTableRowIndexAt(this.table,G);if(I>=0){var D=htmlTableCellIndexAt(this.table,this.table.rows[I],G);if(D<0){return }var J=this.table.rows[I].cells[D];var H=new Date(parseInt(J.id));var E=new Date(H.getTime());H.setHours(8);E.setHours(8,30)}else{return }if(B.type!="Event"){var A=app.schedule.getSelectedSchedule();if(A==null){app.schedule.showSelectScehduleMessage();return }var C=new Object();C.displayName=B.text;C.startDT=""+H.getTime();C.endDT=""+E.getTime();C.timeFlag="false";C.noTimeFlag="true";this.save(C);this.render(this.schedules,this.date)}else{var C=this.getEventByIndex(B.key);if(C!=null&&C.fromTime!=null&&(C.timeFlag+"")=="true"&&(C.noTimeFlag==null||C.noTimeFlag=="false")){H.setHours(0);H.setMinutes(C.fromTime);this.moveToNewStartTime(B,H)}else{this.moveToNoTime(B,H.getTime())}this.render(this.schedules,this.date)}},doubleClicked:function(E){var G=E.target?E.target:E.srcElement;if(G.tagName=="A"&&G.id!=null){return }var A=app.schedule.getSelectedSchedule();if(A==null){app.schedule.showSelectScehduleMessage();return }var H=htmlTableRowIndexAt(this.table,E);if(H>=0){var C=htmlTableCellIndexAt(this.table,this.table.rows[H],E);if(C<0){return }var I=this.table.rows[H].cells[C];var F=new Date(parseInt(I.id));var D=new Date(F.getTime());F.setHours(8);D.setHours(8,30);var B=new Object();B.displayName="New Event";B.startDT=""+F.getTime();B.endDT=""+D.getTime();B.timeFlag="true";B.noTimeFlag="false";app.schedule.editEventDetails(B,A,true)}}});HJ.MonthlyAgenda=Class.create();HJ.MonthlyAgenda.prototype=Object.extend(new HJ.Agenda(),{initialize:function(D,C,B,A){this.calendarTitle=D;this.calendarArea=C;this.calendarHeader=B;this.allDayEvents=A;this.table=document.createElement("table");this.table.onclick=this.tableClicked.bindAsEventListener(this)},cleanup:function(){this.table.onclick=null;this.table.style.display="none";this.calendarArea.appendChild(this.table)},render:function(D,Q){app.showBusy();this.schedules=D;this.date=Q;if(!app.schedule.loadEventData(this.date)){return false}var R=new Date(Q.getTime());R.setDate(1);R.setHours(0,0,0,0);this.calendarTitle.innerHTML=this.months[R.getMonth()]+" "+R.getFullYear();this.startTime=R;var P;var J;var N=28;var L=this.date.getMonth();J=new Date(this.startTime.getTime());while(true){J.setDate(N);if(J.getMonth()!=L){break}N++}if(N>31){N=31}this.endTime=new Date(this.startTime.getTime());this.endTime.setDate(N);this.calendarTitle.innerHTML=this.months[Q.getMonth()]+" "+Q.getFullYear();removeAll(this.calendarArea);removeAll(this.calendarHeader);this.calendarArea.className="calDayAgenda";this.allDayEvents.style.display="none";var E=this.table;removeAll(E);E.cellSpacing="2";this.calendarArea.appendChild(E);var A=document.createElement("tbody");E.appendChild(A);var O=new Date(this.startTime.getTime());while(O.getTime()<=this.endTime.getTime()){var M=new Date(O.getTime());M.setDate(M.getDate()+1);var H=O.getTime();var G=M.getTime();var C=this.getVisibleEventsList(O,O,M,true);for(var N=0;N<C.length;N++){var K=C[N];var B=document.createElement("tr");A.appendChild(B);var F=document.createElement("td");var J=K.actualDate;if(J==null){var I=parseInt(K.event.startDT);J=new Date(I)}F.innerHTML=this.daysLong[J.getDay()]+" "+this.monthsShort[J.getMonth()]+" "+J.getDate();F.style.width="20%";B.appendChild(F);F=this.getTimeCell(K.schedule,K.event);F.style.width="20%";B.appendChild(F);F=this.getAgendaEventCell(K.schedule,K.scindex,K.event,K.eventindex,K.actualDate);F.style.width="60%";B.appendChild(F)}O=M}app.endBusy()},next:function(){var A=this.date.getMonth();var B=this.date.getFullYear();A+=1;if(A>11){A=0;B++}this.date.setFullYear(B);this.date.setMonth(A);this.render(this.schedules,this.date)},previous:function(){var A=this.date.getMonth();var B=this.date.getFullYear();A-=1;if(A<0){A=11;B--}this.date.setFullYear(B);this.date.setMonth(A);this.render(this.schedules,this.date)}});HJ.YearlyCalendar=Class.create();HJ.YearlyCalendar.prototype=Object.extend(new HJ.Calendar(),{initialize:function(D,C,B,A){this.calendarTitle=D;this.calendarArea=C;this.calendarHeader=B;this.allDayEvents=A;this.table=document.createElement("table");this.table.onclick=this.tableClicked.bindAsEventListener(this)},cleanup:function(){this.table.onclick=null;this.table.style.display="none";this.calendarArea.appendChild(this.table)},render:function(E,C){app.showBusy();this.schedules=E;this.date=C;var D=new Date(C.getTime());D.setMonth(0);D.setDate(1);this.calendarTitle.innerHTML=D.getFullYear();this.startTime=new Date(D.getTime());var A=new Date();A.setFullYear(D.getFullYear());A.setMonth(11);A.setDate(31);this.endTime=A;removeAll(this.calendarArea);removeAll(this.calendarHeader);this.calendarArea.className="fullYear";this.allDayEvents.style.display="none";var F=this.table;removeAll(F);F.cellSpacing="1";F.cellPadding="0";this.calendarArea.appendChild(F);var H=document.createElement("tbody");F.appendChild(H);var I=null;for(var G=0;G<12;G++){D.setMonth(G);var B=G%3;if(B==0){var I=document.createElement("tr");H.appendChild(I)}I.appendChild(this.renderAMonth(D))}app.endBusy()},renderAMonth:function(B){var A=new Date(B.getTime());var K=B.getDay();A.setDate(A.getDate()-K);var C=B.getMonth();var J=B.getFullYear();var D=document.createElement("td");D.className="yearMonth";var G=document.createElement("h5");G.innerHTML=this.months[B.getMonth()];D.appendChild(G);var O=document.createElement("table");var I;var N;var F=document.createElement("tbody");O.appendChild(F);I=document.createElement("tr");for(var E=0;E<7;E++){N=document.createElement("td");I.appendChild(N);Element.extend(N);switch(E){case 0:N.innerHTML="S";break;case 1:N.innerHTML="M";break;case 2:N.innerHTML="T";break;case 3:N.innerHTML="W";break;case 4:N.innerHTML="T";break;case 5:N.innerHTML="F";break;case 6:N.innerHTML="S";break}}F.appendChild(I);while((A.getMonth()<=C&&A.getFullYear()==J)||(A.getMonth()>C&&A.getFullYear()<J)){I=document.createElement("tr");for(var E=0;E<7;E++){temp=A.getTime();N=document.createElement("td");if(A.getMonth()==C){var L=document.createElement("a");L.href="#";L.innerHTML=""+A.getDate();L.id=""+temp;N.appendChild(L)}else{var M=document.createElement("span");M.innerHTML="";N.appendChild(M)}I.appendChild(N);F.appendChild(I);A.setDate(A.getDate()+1)}}D.appendChild(O);var H=document.createElement("div");H.className="mozFix";D.appendChild(H);return D},next:function(){var A=this.date.getFullYear();A++;this.date.setFullYear(A);this.render(this.schedules,this.date)},previous:function(){var A=this.date.getFullYear();A--;this.date.setFullYear(A);this.render(this.schedules,this.date)},scheduleListChanged:function(A){this.schedules=A}});HJ.YearlyAgenda=Class.create();HJ.YearlyAgenda.prototype=Object.extend(new HJ.Agenda(),{initialize:function(D,C,B,A){this.calendarTitle=D;this.calendarArea=C;this.calendarHeader=B;this.allDayEvents=A;this.table=document.createElement("table");this.table.onclick=this.tableClicked.bindAsEventListener(this)},cleanup:function(){this.table.onclick=null;this.table.style.display="none";this.calendarArea.appendChild(this.table)},render:function(I,E){app.showBusy();this.schedules=I;this.date=E;var H=new Date(E.getTime());H.setMonth(0);H.setDate(1);this.calendarTitle.innerHTML=H.getFullYear();this.startTime=new Date(H.getTime());var C=new Date();C.setFullYear(H.getFullYear());C.setMonth(11);C.setDate(31);this.endTime=C;removeAll(this.calendarArea);removeAll(this.calendarHeader);this.calendarArea.className="calDayAgenda";this.allDayEvents.style.display="none";var K=this.table;removeAll(K);K.cellSpacing="2";this.calendarArea.appendChild(K);var L=document.createElement("tbody");K.appendChild(L);var F=new Date(this.startTime.getTime());while(F.getTime()<this.endTime.getTime()){var D=new Date(F.getTime());D.setDate(D.getDate()+1);var N=F.getTime();var M=D.getTime();var A=this.getVisibleEventsList(F,F,D,true);for(var J=0;J<A.length;J++){var B=A[J];var O=document.createElement("tr");L.appendChild(O);var G=document.createElement("td");var C=B.actualDate;if(C==null){var P=parseInt(B.event.startDT);C=new Date(P)}G.innerHTML=this.days[C.getDay()]+" "+this.monthsShort[C.getMonth()]+" "+C.getDate()+", "+E.getFullYear();G.style.width="20%";O.appendChild(G);G=this.getTimeCell(B.schedule,B.event);G.style.width="20%";O.appendChild(G);G=this.getAgendaEventCell(B.schedule,B.scindex,B.event,B.eventindex,B.actualDate);G.style.width="60%";O.appendChild(G)}F=D}app.endBusy()},next:function(){var A=this.date.getFullYear();A++;this.date.setFullYear(A);this.render(this.schedules,this.date)},previous:function(){var A=this.date.getFullYear();A--;this.date.setFullYear(A);this.render(this.schedules,this.date)}});HJ.MiniCalendar=Class.create();HJ.MiniCalendar.prototype=Object.extend(new HJ.Calendar(),{initialize:function(A){A!=null?this.blockPastDateFlag=true:this.blockPastDateFlag=false;this.miniPrevious=document.getElementById("miniPrevious");this.miniNext=document.getElementById("miniNext");this.miniCalHeading=document.getElementById("miniCalHeading");this.table=document.getElementById("miniCalTable");this.miniPrevious.onclick=this.previous.bind(this);this.miniNext.onclick=this.next.bind(this);this.smallDays=["S","M","T","W","T","F","S"];this.table.onclick=this.tableClicked.bindAsEventListener(this);if(this.table.tBodies.length>0){this.tbody=this.table.tBodies[0]}else{this.tbody=document.createElement("tbody");this.table.appendChild(this.tbody)}},render:function(C,P){this.schedules=C;this.date=P;if(P==null){return }if(app.schedule!=null){app.schedule.loadEventData(this.date)}var R=new Date(P.getTime());R.setDate(1);this.miniCalHeading.innerHTML=this.months[R.getMonth()]+" "+R.getFullYear();this.startTime=new Date(R.getTime());var K=R.getDay();this.startTime.setDate(this.startTime.getDate()-K);var I=new Date();I.setHours(0,0,0,0);var O=I.getTime();var G=I.getDay();I.setDate(I.getDate()-G);var M=new Date(I.getTime());M.setDate(I.getDate()+7);I=I.getTime();M=M.getTime();tbl=this.table;var A=this.tbody;removeAll(A);var B=document.createElement("tr");A.appendChild(B);for(var L=0;L<7;L++){var D=document.createElement("td");D.className="weekDays";D.innerHTML=this.smallDays[L];B.appendChild(D)}var H=R.getMonth();var E=R.getFullYear();var N=this.startTime;var F=new Date(this.startTime.getTime());while((F.getMonth()<=H&&F.getFullYear()==E)||(F.getMonth()>H&&F.getFullYear()<E)){var B=document.createElement("tr");A.appendChild(B);for(var J=0;J<7;J++){var N=F.getTime();D=document.createElement("td");D.id=""+N;if(F.getMonth()!=H){D.innerHTML="&nbsp;"}else{if(this.blockPastDateFlag==true&&N<O){var Q=document.createElement("span");Q.innerHTML=""+F.getDate();Q.id=""+N;D.appendChild(Q);D.className="miniCalCurrentWeek"}else{var Q=document.createElement("a");Q.href="#";Q.innerHTML=""+F.getDate();Q.id=""+N;D.appendChild(Q);if(N>=I&&N<M&&this.blockPastDateFlag==false){D.className="miniCalCurrentWeek"}}}B.appendChild(D);F.setDate(F.getDate()+1)}}this.endTime=F;if(this.schedules!=null){this.renderEvents(tbl)}},renderEvents:function(D){return ;var T=new Date(this.date.getTime());T.setDate(1);var F=T.getDay();var P=new Date(this.startTime.getTime());while(P.getTime()<this.endTime.getTime()){var M=new Date(P.getTime());M.setDate(M.getDate()+1);var H=P.getTime();var E=M.getTime();for(var O=0;O<this.schedules.length;O++){var A=this.schedules[O];var K=A.event;if(K!=null){for(var L=0;L<K.length;L++){var N=K[L];var I=parseInt(N.startDT);var Q=parseInt(N.endDT);var G=new Date(I);G.setHours(0,0,0,0);if(G.getTime()<=H&&(N.repeatFlag+""=="true")){if(N.deletedSeqList==null){setEventDeleteSeqList(N)}if(N.modifiedSeqList==null){setEventModifySeqList(N)}if(!isEventInSeq(N,P.getTime())){continue}N=this.getRpt(N,P,P,M);if(N==null){continue}I=P.getTime()}else{if(I<H||I>=E){continue}}var R=new Date(I);var C=this.getDayNumber(I)-1;if(C<0){continue}var J=parseInt(C/7);var S=C%7;var B=D.rows[J+1].cells[S];B.style.fontWeight="bold"}}}P=M}},next:function(B){var A=this.date.getMonth();var C=this.date.getFullYear();A+=1;if(A>11){A=0;C++}this.date.setFullYear(C);this.date.setMonth(A);this.render(this.schedules,this.date);HJ.stopEvent(B);return false},previous:function(B){var A=this.date.getMonth();var C=this.date.getFullYear();A-=1;if(A<0){A=11;C--}this.date.setFullYear(C);this.date.setMonth(A);this.render(this.schedules,this.date);HJ.stopEvent(B);return false},updateMiniCalendar:function(B){var A=parseInt(B.startDT);if(A>=this.startTime.getTime()&&A<=this.endTime.getTime()){this.render(this.schedules,this.date)}}});HJ.NewHomePageCalendar=Class.create();HJ.NewHomePageCalendar.prototype=Object.extend(new HJ.Calendar(),{initialize:function(C,G,F,E,A,B,D){this.signedIn=C;this.weekTable=G;this.weeks=F;this.weeksContainer=E;this.monthName=A;this.previousMonth=B;this.nextMonth=D;this.DATE_CELL=0;this.EVENTS_CELL=1;this.DAYS_TO_DISPLAY=7;this.DAY_MILLISECONDS=86400000;if(this.signedIn){this.weekTable.onclick=this.tableClicked.bindAsEventListener(this)}this.previousMonth.onclick=this.previousMonthClicked.bindAsEventListener(this);this.nextMonth.onclick=this.nextMonthClicked.bindAsEventListener(this);this.weeksContainer.onclick=this.weeksContainerClicked.bindAsEventListener(this);this.LAST_MONTH="LM_";this.THIS_MONTH="TM_";this.NEXT_MONTH="NM_";this.firstTime=true},cleanup:function(){},render:function(C,B){this.schedules=C;this.date=B;if(this.signedIn){if(this.firstTime){this.firstTime=false;app.schedule.loadEventData(this.date,true)}else{app.schedule.loadEventData(this.date)}}this.renderWeeks(B);this.monthName.innerHTML=this.months[B.getMonth()];this.startTime=new Date(this.date.getTime());this.endTime=new Date(this.startTime.getTime());this.endTime.setDate(this.endTime.getDate()+this.DAYS_TO_DISPLAY);var E=new Date(this.startTime.getTime());var E=new Date(this.startTime.getTime());for(var D=0;D<this.DAYS_TO_DISPLAY;D++){var F=this.weekTable.rows[D];var G=F.cells[this.DATE_CELL];G.className="homepageDateTD";if(D==0){G.innerHTML='<div class="dateOrange"><span>'+this.daysLong[E.getDay()]+'</span><div class="dateNumberOrange">'+E.getDate()+"</div></div>"}else{G.innerHTML='<div class="date"><span>'+this.daysLong[E.getDay()]+'</span><div class="dateNumber">'+E.getDate()+"</div></div>"}var A=F.cells[this.EVENTS_CELL];A.innerHTML="";E.setDate(E.getDate()+1)}if(this.signedIn){this.renderEvents(this.weekTable);if(HJ.getPostLoginAction()!=null&&HJ.getPostLoginAction()==HJ.POST_LOGIN_ACTION_ADD_EVENT&&!HJ.postLoginActionProcessed){HJ.postLoginActionProcessed=true;this.addEventClicked()}}},setNewDate:function(A){if(this.signedIn){app.schedule.setCalendarDate(A)}else{this.render(this.schedules,A)}},next:function(){var A=this.date;A.setDate(A.getDate()+this.DAYS_TO_DISPLAY);this.setNewDate(A)},previous:function(){var A=this.date;A.setDate(A.getDate()-this.DAYS_TO_DISPLAY);this.setNewDate(A)},nextMonthClicked:function(A){var B=new Date(this.date);B.setMonth(B.getMonth()+1);this.setNewDate(B)},previousMonthClicked:function(A){var B=new Date(this.date);B.setMonth(B.getMonth()-1);this.setNewDate(B)},renderEvents:function(D){var E=this.startTime.getTime();var S=new Date(this.startTime.getTime());var F=0;while(S.getTime()<this.endTime.getTime()){if(F>=this.DAYS_TO_DISPLAY){alert("NewHomePageCalendar: ran out of rows");break}var P=new Date(S.getTime());P.setDate(P.getDate()+1);var I=S.getTime();var G=P.getTime();var M=new Array();for(var R=0;R<this.schedules.length;R++){var A=this.schedules[R];var N=A.event;if(N!=null){for(var O=0;O<N.length;O++){var Q=N[O];var K=parseInt(Q.startDT);var T=parseInt(Q.endDT);var H=new Date(K);H.setHours(0,0,0,0);if(H.getTime()<=I&&(Q.repeatFlag+""=="true")){if(Q.deletedSeqList==null){setEventDeleteSeqList(Q)}if(Q.modifiedSeqList==null){setEventModifySeqList(Q)}if(!isEventInSeq(Q,S.getTime())){continue}Q=this.getRpt(Q,S,S,P);if(Q==null){continue}K=S.getTime()}else{if(K<I||K>=G){continue}}var U=new Date(K);var C=this.getDayNumber(K)-1;if(C<0){debugA(Q.displayName+" : "+U.toString());continue}var L=new Object();L.schedule=A;L.scindex=R;L.event=Q;L.eventindex=O;L.link=this.getEventLink(A,R,Q,O,S.getTime());L.r=F;L.c=this.EVENTS_CELL;M.push(L);if(this.dndMgr2!=null&&A.sharing!="ALL_TIME"&&A.sharing!="FREE_TIME"){var V=L.link;var W=V.id;this.dndMgr2.registerDraggable("Event",W,V,Q.displayName)}}}}M.sort(eventOrder);var B=D.rows[F].cells[this.EVENTS_CELL];var J=document.createElement("ul");for(O=0;O<M.length;O++){var L=M[O];J.appendChild(L.link)}B.appendChild(J);S=P;F++}},renderWeeks:function(D){var H=new Date(D.getTime());H.setDate(1);var K=H.getDay();week=this.weeks[0];weekIndex=0;var C=new Date();var J=C.getDate();if(C.getMonth()!=D.getMonth()||C.getFullYear()!=D.getFullYear()){J=-1}if(K>0){var E=new Date(H.getTime()-this.DAY_MILLISECONDS);var B=E.getDate();while(K>0){K--;week[K].innerHTML="";week[K].className="past";week[K].appendChild(this.createDayAnchor(B,false,true));B--}K=H.getDay()}var M=H.getMonth();var F=false;while(true){var I=H.getDate();var L=this.createDayAnchor(I,F,false);var A=week[K];A.innerHTML="";if(F){A.className="future"}else{if(I==J){A.className="today"}else{A.className=""}}A.appendChild(L);H.setDate(I+1);K=H.getDay();if(H.getMonth()!=M){F=true}if(K==0){if(F){break}weekIndex++;week=this.weeks[weekIndex]}}weekIndex++;if(weekIndex<this.weeks.length){week=this.weeks[weekIndex];for(var G=0;G<7;G++){week[G].innerHTML=""}}},createDayAnchor:function(B,C,D){var A=document.createElement("a");A.innerHTML=B;A.href="#";if(C){A.id=this.NEXT_MONTH+B}else{if(D){A.id=this.LAST_MONTH+B}else{A.id=this.THIS_MONTH+B}}return A},getEventLink:function(J,B,A,C,F){var H;var G=false;if(J.UUID!=A.scheduleId&&(J.UUID==A.driver1||J.UUID==A.driver2)){var E=app.workspace.schedule;var D=findObjById(E,A.scheduleId);if(D==null){H=J.color}else{H=D.color;G=true}}else{H=J.color}if(G){I="#c2c2c2";H="#f2f2f2"}else{var I=getTextColor(H);H=getBackground(H)}if(J.sharing=="FREE_TIME"){var K=document.createElement("span");if(H!=null){K.style.backgroundColor=H}if(I!=null){K.style.color=I}K.innerHTML=get_nbsp(A.displayName);K.id="E_"+B+"_"+C;K.style.margin="0 -2px";return K}else{var M=document.createElement("li");if(H!=null){}var K=document.createElement("a");K.href="#";var L=A.displayName+"<br>";if(A.timeFlag=="true"){L=getDisplayTimeFromMins(A.fromTime)+"&nbsp;&nbsp;"+L}K.innerHTML=L;K.id="E_"+B+"_"+C;K.style.cursor="move";if(F!=null){K.name=F}this.evtObj[K.id]=A;K.onmouseover=this.showToolTip.bindAsEventListener(this);M.appendChild(K);return M}},setAddEventOnClick:function(A){A.onclick=this.addEventClicked.bindAsEventListener(this)},addEventClicked:function(A){if(this.signedIn){app.schedule.addNewEvent(this.date)}else{window.location.href="/Signin.htm?"+HJ.POST_LOGIN_ACTION_PARAM+"="+HJ.POST_LOGIN_ACTION_ADD_EVENT}return false},weeksContainerClicked:function(D){var F=D.target?D.target:D.srcElement;if(F.tagName!="A"||F.id==null){return true}var C=F.id.indexOf("_");if(C==-1){return true}C++;var B=F.id.substring(0,C);var E=F.id.substring(C);var A=new Date(this.date.getTime());switch(B){case this.THIS_MONTH:break;case this.NEXT_MONTH:A.setMonth(A.getMonth()+1);break;case this.LAST_MONTH:A.setMonth(A.getMonth()-1);break;default:return true}A.setDate(E);this.setNewDate(A)},eventChanged:function(A,B){if(document.getElementById("homePageCalendarContainer")==null){return }this.render(this.schedules,this.date)}});HJ.NewsFeed=Class.create();HJ.NewsFeed.prototype={initialize:function(A){this.list=document.getElementById("newsFeedList");this.selectedFeedType=null},load:function(){var A=new Af.DataRequest(svcURL,this.requestLoadCompleted.bind(this),requestFailedCommon.bind(this),null,requestTimedoutCommon.bind(this));A.addService("WorkspaceService","getNewsFeed");ajaxEngine.processRequest(A)},requestLoadCompleted:function(B){var A=new Af.XMLToDataSet(B.responseXML);this.newsFeed=A.data;this.render()},render:function(){this.list.innerHTML="";this.renderDataItems(this.newsFeed.Schedule);this.renderDataItems(this.newsFeed.Resource);this.renderDataItems(this.newsFeed.Question)},renderDataItems:function(A){if(A==null){return }for(var B=0;B<A.length;B++){var C=document.createElement("li");this.renderDataItem(A[B],C);this.list.appendChild(C)}},renderDataItem:function(A,B){if(A.__className=="Resource"){B.innerHTML='<a href="#">'+A.businessName+"</a>";B.onclick=this.loadCommunityResourcesTemplate.bind(this)}else{if(A.__className=="Event"){B.innerHTML='<a href="#">'+A.displayName+"</a>"}else{if(A.__className=="Schedule"){B.innerHTML='<a href="#">'+A.communityTitle+"</a>";B.onclick=this.loadCommCalendarTemplate.bind(this)}else{if(A.__className=="Question"){B.innerHTML='<a href="#">'+A.question+"</a>";B.onclick=this.loadMHMTemplate.bind(this)}}}}},loadCommCalendarTemplate:function(){app.db.init();app.db.loadCommCalendarTemplate()},loadCommunityResourcesTemplate:function(){app.db.init();app.db.loadCommunityResourcesTemplate()},loadMHMTemplate:function(){app.db.init();app.db.loadMHMTemplate()}};HJ.MyGroup=Class.create();HJ.MyGroup.prototype={initialize:function(){this.targetContainerId="content";this.myGroupTable=new Af.HtmlTable("myGroupTable",",,name");this.myGroupTable.listener=this;this.currentRow=-1;this.myGroupTitleLink=new Af.HtmlTitlePane2("myGroupTable","myGroupTitle","boxLink open","boxLink closed");this.myGroupTitleLink.listener=this;this.tl=null;this.url=basePageURL+"MyGroup.html";this.url2=basePageURL+"GroupDetails.html";this.tl=null;this.leftList=null;this.rightList=null;this.myPeopleList=null;this.dataTable=null},cleanup:function(){this.myGroupTable.cleanup()},setDataList:function(A,B){this.myPeopleList=B;this.dataTable=new Af.DataTable(A);if(A!=null&&A.length>0){A.sort(sortGroups)}this.myGroupTable.setDataList(A);this.setAllLists()},viewSelected:function(A){if(calenderTop==null){calenderTop=document.getElementById("calenderTop")}calenderTop.style.display="none";this.loadMyGroupTemplate()},setAllLists:function(A){if(this.leftList==null||this.myPeopleList==null){return false}if(this.currentRow<0||this.currentRow>=this.dataTable.getDataList().length){this.currentRow=0}this.setGroupSelectorList(this.currentRow);this.setPeopleGroupSelectorList();this.setRightList();this.setLeftList()},setGroupSelectorList:function(A){this.groupSelector.setDataList(this.dataTable.getDataList(),A)},setPeopleGroupSelectorList:function(){var B=new Array();B=B.slice(0,B.length);var D=new Object();D.name="MY PEOPLE";B.push(D);D=new Object();D.name="-------------";B.push(D);var A=this.dataTable.getDataList();for(var C=0;C<A.length;C++){B.push(A[C])}this.peopleGroupSelector.setDataList(B)},setLeftList:function(){var D=this.leftList.selectElement.selectedIndex;var J=this.peopleGroupListSelector.selectedIndex;if(J==1){this.leftList.setDataList(new Array());return }var C;if(J==0){C=this.myPeopleList}else{var G=this.dataTable.getDataList()[J-2];C=G.people;if(C==null){C=new Array()}}var H;var E=this.groupSelector.getSelectedObj();if(E==null){H=new Array();for(var F=0;F<C.length;F++){var A=C[F];if(""!=trim(getFullName(A))){A.name=getFullName(A)}else{A.name=A.email}H.push(A)}}else{var B=E.people;if(B==null){createOneToManyAssoc(E,"people","Person");H=C}else{H=new Array();for(var F=0;F<C.length;F++){var A=C[F];if(findObjIndex(B,A)<0){if(""!=trim(getFullName(A))){A.name=getFullName(A)}else{A.name=A.email}H.push(A)}}}}this.leftList.setDataList(H.sort(sortByLastName));if(H.length>0){try{if(this.leftList.selectElement.options.length>D){this.leftList.selectElement.options[D].selected=true}else{this.leftList.selectElement.options[0].selected=true}}catch(I){}}else{this.leftList.selectElement.selectedIndex=-1}J=null;H=null;C=null},setRightList:function(){var C=this.groupSelector.getSelectedObj();if(C==null){this.rightList.setDataList(new Array());this.groupListSelector.selectedIndex=-1;return }if(C.people==null){createOneToManyAssoc(C,"people","Person")}var A=C.people;if(this.rightList==null){return }for(var B=0;B<A.length;B++){if(""==trim(getFullName(A[B]))){A[B]["name"]=A[B]["email"]}}if(A!=null){this.rightList.setDataList(A.sort(sortByLastName))}},cellSelected:function(C,A,B){if(calenderTop==null){calenderTop=document.getElementById("calenderTop")}calenderTop.style.display="none";refreshWidget();this.currentRow=C;if(!B){this.myGroupTable.selectRow(C)}this.loadMyGroupTemplate2()},paneStateChanged:function(A){this.loadMyGroupTemplate()},showGroupDetails:function(){if(this.currentRow==-1||this.dataTable.getDataList().length==0){showMessageDialog("please select Group name.","Request!",300,100);return }this.loadMyGroupTemplate2()},loadMyGroupTemplate:function(){if(this.tl==null){this.tl=new Af.TemplateLoader(this.url,this.targetContainerId,"MyGroupContent");this.tl.listener=this;this.tl.loadTemplate()}else{this.tl.reAttachElement();app.setCurrentView(this);this.setAllLists()}},loadMyGroupTemplate2:function(){if(this.tl2==null){this.tl2=new Af.TemplateLoader(this.url2,this.targetContainerId,"GroupDetails");this.tl2.listener=this;this.tl2.loadTemplate()}else{this.tl2.reAttachElement();app.setCurrentView(this);this.setGroupDetails()}},templateLoaded:function(A){if(A==this.tl){this.templateLoaded1()}else{if(A==this.tl2){this.templateLoaded2()}}},templateLoaded1:function(){this.leftList=new Af.HtmlMultiSelect("MyGroupSubscribed","name");this.rightList=new Af.HtmlMultiSelect("available","name");this.addGroup=document.getElementById("addGroup");this.addGroup.onclick=this.doAddGroup.bind(this);var A=document.getElementById("shareGroup");A.onclick=this.shareGroupClicked.bind(this);this.renameGroup=document.getElementById("renameGroup");this.renameGroup.onclick=this.doRenameGroup.bind(this);this.addPerson=document.getElementById("addPerson");this.addPerson.onclick=this.doAddPerson.bind(this);this.editPerson=document.getElementById("editPerson");this.editPerson.onclick=this.doEditPerson.bind(this);this.deleteGroup=document.getElementById("deleteGroup");this.deleteGroup.onclick=this.deleteGroupConfirm.bind(this);this.addToGroup=document.getElementById("addToGroup");this.addToGroup.onclick=this.doAddToGroup.bind(this);this.doneGroup=document.getElementById("doneGroup");this.doneGroup.onclick=this.showGroupDetails.bind(this);this.removeFromGroup=document.getElementById("removeFromGroup");this.removeFromGroup.onclick=this.doRemoveFromGroup.bind(this);this.peopleGroupSelector=new Af.HtmlSingleSelect("peopleGroupSelector","name");this.peopleGroupListSelector=document.getElementById("peopleGroupSelector");this.peopleGroupListSelector.onchange=this.leftListTypeChanged.bind(this);this.groupSelector=new Af.HtmlSingleSelect("myGroupList","name");this.groupListSelector=document.getElementById("myGroupList");this.groupListSelector.onchange=this.rightListTypeChanged.bind(this);this.setAllLists();app.setCurrentView(this)},templateLoaded2:function(){var B=new Af.ElementCollection(this.tl2.element);this.addPersonGroupDetails=B.getFirstElementById("addPersonGroupDetails");this.groupDetailsTitle=B.getFirstElementById("groupDetailsTitle");this.addPersonGroupDetails.onclick=this.doAddPerson.bind(this);this.printGroupDetails=B.getFirstElementById("printGroupDetails");this.printGroupDetails.onclick=this.doPrintGroupDetails.bind(this);var C=B.getFirstElementById("groupDetailsTable");this.tableElement=C;if(C==null){return }if(C.tBodies.length==0){return }var A=C.tBodies[0];if(A.rows.length==0){return }this.templateRow=this.tableElement.rows[0].cloneNode(true);removeAll(A);this.setGroupDetails()},setGroupDetails:function(){if(this.dataTable.getDataList().length==0){return }if(this.currentRow<0||this.currentRow>=this.dataTable.getDataList().length){this.currentRow=0}var F=this.dataTable.getDataList()[this.currentRow];this.groupDetailsTitle.innerHTML=F.name;var A=this.tableElement.tBodies[0];removeAll(A);var B=F.people;if(B==null){return }B.sort(sortByLastName);for(var D=0;D<B.length;D++){var G=B[D];var H=this.templateRow.cloneNode(true);H.id=""+D;A.appendChild(H);if(G.fName!=null){H.cells[0].innerHTML=G.fName}if(G.lName!=null){H.cells[1].innerHTML=G.lName}var E=G.phonePrimary;if(E==null){E=""}H.cells[2].innerHTML=E;var C="";E=G.email;if(E==null){E=""}H.cells[3].innerHTML=E}},shareGroupClicked:function(A){if(this.shareGroupDisplayed||login==null||app==null){return false}this.shareGroupDialog=new HJ.ShareGroup(this);this.shareGroupDialog.loadTemplate();return false},shareGroupDialogClosed:function(A){this.shareGroupDisplayed=false;this.shareGroupDialog=null},doAddToGroup:function(){var C=this.groupSelector.getSelectedObj();if(C==null){return }var A=this.leftList.getSelectedObjs();if(A.length>0){for(var B=0;B<A.length;B++){if(this.rightList.dlist!=null){this.rightList.dlist.push(A[B])}}this.setAllLists()}else{return }app.groupUpdated(C,this.myPeopleList);this.saveGroup(C)},doRemoveFromGroup:function(){var C=this.groupSelector.getSelectedObj();if(C==null){return }var A=this.rightList.getSelectedObjs();if(A.length>0){for(var B=0;B<A.length;B++){if(this.rightList.dlist!=null&&this.rightList.dlist.length>0){deleteFromArray(this.rightList.dlist,A[B])}}this.setAllLists()}else{return }app.groupUpdated(C,this.myPeopleList);this.saveGroup(C)},leftListTypeChanged:function(){this.setLeftList()},rightListTypeChanged:function(){this.currentRow=this.groupSelector.getSelectedIndex();this.setRightList();this.setLeftList()},doAddGroup:function(){if(this.dialog!=null){delete this.dialog}this.dialog=new HJ.GroupDialog("Add Group",this,null);this.dialog.showHTMLTemplate(basePageURL+"AddGroup.html","content","newGroup");this.dialog.centerDialog(400,250);this.dialog.setDataObject(null,"Type the name of a new group.");return false},doRenameGroup:function(){if(this.currentRow==-1||this.dataTable.getDataList().length==0){showMessageDialog("please select Group name.","Request!",300,100);return }if(this.renamedialog!=null){delete this.renamedialog}this.renamedialog=new HJ.GroupDialog("Rename Group",this,null);this.renamedialog.showHTMLTemplate(basePageURL+"AddGroup.html","content","newGroup");this.renamedialog.centerDialog(400,250);this.renamedialog.setDataObject(this.dataTable.getDataList()[this.currentRow],"Type new group name.");return false},doAddPerson:function(){app.myPeople.doAddPerson();return false},deleteGroupConfirm:function(){if(this.currentRow>=0&&this.dataTable.getDataList()[this.currentRow]!=null){var A=this.dataTable.getDataList()[this.currentRow];showConfirmDialog("Are you sure you want to delete this group? <br/> All people in the group will remain in My People.","Are You Sure?",300,120,this.doDeleteGroup.bind(this))}else{showMessageDialog("Please select a group to delete.","Request",300,80)}},doDeleteGroup:function(){hideDialogWin();if(this.currentRow>=0){var A=this.dataTable.deleteObjectByIndex(this.currentRow);this.myGroupTable.setDataList(this.dataTable.getDataList());app.groupDeleted(A,this.myPeopleList);this.currentRow=-1;this.deleteGroupName(A)}else{showMessageDialog("Please select group to delete.","Request",300,80)}},deleteGroupName:function(B){var A=new Af.DataRequest(svcURL,this.requestDeleteGroupCompleted.bind(this),this.requestFailedCommon.bind(this),null,this.requestTimedoutCommon.bind(this));A.addService("WorkspaceService","deleteGroupName");A.addParameter("UUID",B.UUID);ajaxEngine.processRequest(A)},requestDeleteGroupCompleted:function(A){this.setAllLists()},requestFailedCommon:function(A,B){showMessageDialog("We are currently unable to delete this group.  Please try again.","Excuse us!",350,100)},requestTimedoutCommon:function(){showMessageDialog("We are currently unable to delete this group.  Please try again.","Excuse us!",350,100)},saveGroup:function(E){var A=new Af.ObjEditor();var C=A.getChangeXmlForObjList(E.people,["name","fName","lName"],"people");var D=A.getChangeXmlForObj(E,["name"],"ObjModify",C);var B=new Af.DataRequest(svcURL,this.requestSaveGroupCompletedCommon.bind(this),this.requestFailedCommon.bind(this),null,this.requestTimedoutCommon.bind(this));B.addService("WorkspaceService","saveGroupDetails");B.addParameter("UUID",E.UUID);B.xmlDoc=D;ajaxEngine.processRequest(B)},requestSaveGroupCompletedCommon:function(A){},doPrintGroupDetails:function(){var A=this.dataTable.getDataList()[this.currentRow];var B=new Af.DataRequest(svcURL,this.printCompleted.bind(this),this.printFailed.bind(this),null,this.requestTimedout.bind(this));B.addService("WorkspaceService","getPrintHtmlFromXML");B.addParameter("templateName","myGroups");B.addParameter("xlstFile","MyGroups.xsl");B.addParameter("UUID",A.UUID);ajaxEngine.processRequest(B);return false},printCompleted:function(A){var B=new Af.PrintUtil();B.showPrintView(A)},printFailed:function(){showMessageDialog("<br/>Printing is currently unavailable.Please try again.","Printing Unavailable",350,100)},requestTimedout:function(){showMessageDialog("<br/>Printing is currently unavailable.Please try again.","Printing Unavailable",350,100)},doEditPerson:function(){var A=this.leftList.getSelectedObjs();if(A.length==1){if(this.editPersonDialog1!=null){delete this.editPersonDialog1}this.editPersonDialog1=new HJ.MyPeopleDetail("Person Details",app.myPeople,null);this.editPersonDialog1.width="520px";this.editPersonDialog1.showHTMLTemplate(basePageURL+"MyPeopleDetail.html","content","peopleDetail");this.editPersonDialog1.centerDialog(520,250);var A=A[0];this.editPersonDialog1.setObj(A);this.editPersonDialog1.personHandlerIs="myGroup"}else{showMessageDialog("Please choose one person's record to edit.","Request",350,100)}return false},refresh:function(){this.setDataList(app.workspace.myGroup,app.workspace.myPeople);if(this.groupDetailsTitle!=null){this.setGroupDetails()}return }};HJ.MyPeople=Class.create();HJ.MyPeople.prototype={initialize:function(){this.url=basePageURL+"MyPeople.html";this.targetContainerId="content";this.IsNewPerson=false;this.tl=null;this.myPeopleTitleContainer=document.getElementById("myPeopleTitleContainer");this.myPeopleTitleContainer.onclick=this.loadMyPeopleTemplate.bind(this)},cleanup:function(){this.myPeopleTitleContainer.onclick=null},viewSelected:function(A){if(this.tl==null){this.loadMyPeopleTemplate()}else{this.tl.reAttachElement();app.setCurrentView(this)}return false},setDataList:function(A,B){this.groupList=B;this.dataTable=new Af.DataTable((A))},myPeopleListChanged:function(){},paneStateChanged:function(A){this.loadMyPeopleTemplate()},loadMyPeopleTemplate:function(){if(calenderTop==null){calenderTop=document.getElementById("calenderTop")}calenderTop.style.display="none";if(this.tl==null){this.tl=new Af.TemplateLoader(this.url,this.targetContainerId,"myPeople");this.tl.listener=this;this.tl.loadTemplate()}else{this.tl.reAttachElement();var A=this.dataTable.getDataList();this.myPeopleDetailsTable.setDataList(A);app.setCurrentView(this)}return false},templateLoaded:function(){this.myPeopleDetailsTable=new Af.HtmlTable("myPeopleDetailsTable","null, fName, lName, phonePrimary, email");this.myPeopleDetailsTable.listener=this;var A=this.dataTable.getDataList();this.myPeopleDetailsTable.setDataList(A);this.deletePerson=document.getElementById("deletePerson");this.deletePerson.onclick=this.doDeletePerson.bind(this);this.addPerson=document.getElementById("addPerson");this.addPerson.onclick=this.doAddPerson.bind(this);this.editPerson=document.getElementById("editPerson");this.editPerson.onclick=this.doEditPerson.bind(this);this.importLink=document.getElementById("importLink");this.importLink.onclick=this.loadImportTemplate.bind(this);this.printPersonList=document.getElementById("printPersonList");this.printPersonList.onclick=this.doPrintPersonList.bind(this);this.selectAll=document.getElementById("selectAll");this.selectAll.onclick=this.selectAllPeople.bind(this);app.setCurrentView(this);return false},doDeletePerson:function(){var D=document.getElementsByClassName("selectPerson");var C=false;if(D!=null&&D.length>0){for(var B=0;B<D.length;B++){var A=D[B];if(A.checked){C=true;break}}}if(C){showConfirmDialog("<br/>Are you sure you want to delete these people(s)?","",400,100,this.doDeletePersonOk.bind(this),this.doDeletePersonCancel.bind(this))}else{showMessageDialog("<br/>Select person(s) you want to delete and click on 'Delete Person'","",400,100)}return false},doDeletePersonOk:function(){hideDialogWin();var F=document.getElementsByClassName("selectPerson");if(F!=null&&F.length>0){this.totalDelete=0;var C=[];var G="<message>";showModalMessageDialog("Deleting... please wait",240,40);for(var D=0;D<F.length;D++){var A=F[D];if(A.checked){this.totalDelete++;var B=this.dataTable.getDataList()[D];C.push(B);G+="<person><uuid>"+B.UUID+"</uuid></person>"}}G+="</message>";var E=new Af.DataRequest(svcURL,this.deletePeopleCompleted.bind(this),this.deletePeopleFailed.bind(this),null,this.requestTimedout.bind(this));E.addService("WorkspaceService","deleteMultiplePerson");E.xmlDoc=G;ajaxEngine.processRequest(E)}return false},deletePeopleCompleted:function(){this.refreshPeople();hideModalMessageDialog()},deletePeopleFailed:function(){hideModalMessageDialog();showMessageDialog("Failed deleting record ","",400,150);this.refreshPeople()},doDeletePersonCancel:function(){hideDialogWin()},doAddPerson:function(){this.IsNewPerson=true;if(this.dialog!=null){delete this.dialog}this.dialog=new HJ.MyPeopleDetail("Person Details",this,null);this.dialog.width="520px";var A=new Object();this.dialog.showHTMLTemplate(basePageURL+"MyPeopleDetail.html","MainArea","peopleDetail");this.dialog.centerDialog(520,250);this.dialog.setObj(A,true);return false},doPrintPersonList:function(){showModalMessageDialog("Preparing ... please wait",240,40);var A=new Af.DataRequest(svcURL,this.printCompleted.bind(this),this.printFailed.bind(this),null,this.requestTimedout.bind(this));A.addService("WorkspaceService","getPrintHtmlFromXML");A.addParameter("templateName","mypeople");A.addParameter("xlstFile","mypeoplelist.xsl");ajaxEngine.processRequest(A);return false},printCompleted:function(A){hideModalMessageDialog();var B=new Af.PrintUtil();B.listener=this;B.showPrintView(A);return false},printingDone:function(){this.viewSelected();return false},printFailed:function(){showMessageDialog("<br/>Printing is currently unavailable.Please try again. ","Printing Unavailable",400,150)},requestTimedout:function(){showMessageDialog("<br/>Printing is currently unavailable.Please try again. ","Printing Unavailable",400,150)},doEditPerson:function(){var B=this.myPeopleDetailsTable.selectedRowNumber;if(B<0||B>=this.dataTable.getDataList().length){showMessageDialog("Please select the record you would like to edit, then click Edit person.","Select Record",350,100);return false}if(this.dialog!=null){delete this.dialog}this.dialog=new HJ.MyPeopleDetail("Person Details",this,null);this.dialog.width="520px";this.dialog.showHTMLTemplate(basePageURL+"MyPeopleDetail.html","MainArea","peopleDetail");this.dialog.centerDialog(520,250);var A=this.dataTable.getDataList()[B];this.dialog.setObj(A);this.dialog.personHandlerIs="myPeople";return false},refresh:function(){app.workspace.myPeople=this.dataTable.getDataList();if(this.myPeopleDetailsTable!=null){this.myPeopleDetailsTable.setDataList(app.workspace.myPeople)}this.loadMyPeopleTemplate()},sortList:function(A){A.sort(sortByLastName);return A},setTableWidth:function(){return ;if(this.myPeopleDetailsTable==null){return }var A=this.myPeopleDetailsTable.templateRow;var B=A.getElementsByTagName("TD");B[0].style.width="150px";B[1].style.width="150px";B[2].style.width="150px";B[3].style.width="200px";B[4].style.width="200px";return },loadImportTemplate:function(){document.importObj=new HJ.Import();document.importObj.loadImportTemplate(false);return false},cellSelected:function(B,A){this.myPeopleDetailsTable.normalBackcolor="#eef7f6";this.myPeopleDetailsTable.selectRow(B,"#e0eeef");if(A==1){this.doEditPerson()}return false},refreshPeople:function(){app.db.refreshMyPeople();return false},selectAllPeople:function(){var C=document.getElementsByClassName("selectPerson");if(C!=null&&C.length>0){for(var B=0;B<C.length;B++){var A=C[B];A.checked=this.selectAll.checked}}return true}};function myPeopleComparator(G,F){var D=getFullName(G);var A=getFullName(F);if(D==null||D==""||D==" "||D=="  "){D=G.email}if(D==null){D=""}if(A==null||A==""||A==" "||A=="  "){A=F.email}if(A==null){A=""}D=D.toLowerCase();A=A.toLowerCase();var E=D[0];var C=A[0];var B=0;while(E!=null&&C!=null){E=D[B];C=A[B];if(E>C){return 1}else{if(E<C){return -1}}B++}return -1}HJ.MyPeopleDetail=Class.create();HJ.MyPeopleDetail.prototype=Object.extend(new Af.HtmlDialog(),{initialize:function(C,A,B){this._initializeDialog(C,A,B);this.isCallFromMyLovedOne=false;this.handler=A;this.personHandlerIs=null},templateLoaded:function(){this.fNameCursor=document.getElementById("fName");var A=new Af.ElementCollection(this.element);this.save=A.getFirstElementById("save");this.armedButton=this.save;this.dontSave=A.getFirstElementById("dontSave");this.save.onclick=this.doSave.bind(this);this.dontSave.onclick=this.doDontSave.bind(this);this.groupSelector=A.getFirstElementById("groupSelector");this.groupSelector.onclick=this.doGroupSelection.bindAsEventListener(this);this.deletePersonLink=A.getFirstElementById("deletePerson");this.deletePersonLink.onclick=this.deletePeopleConfirm.bind(this);this.printPersonDetails=A.getFirstElementById("printDetails");this.printPersonDetails.onclick=this.doPrintDetails.bind(this);this.editor=new Af.ObjEditor();this.fName=this.editor.addTextByEC(A,"fName");this.editor.addTextByEC(A,"lName");this.phone1=this.editor.addTextByEC(A,"phone1");this.phone2=this.editor.addTextByEC(A,"phone2");this.phone3=this.editor.addTextByEC(A,"phone3");this.email=this.editor.addTextByEC(A,"email");this.editor.addTextByEC(A,"alternateEmail");this.editor.addTextByEC(A,"myNotes");this.address=this.editor.addTextByEC(A,"address");this.editor.addTextByEC(A,"city");this.editor.addSelectByEC(A,"state");this.zip=this.editor.addTextByEC(A,"zip");this.phoneType1=this.editor.addSelectByEC(A,"phoneType1");this.phoneType2=this.editor.addSelectByEC(A,"phoneType2");this.phoneType3=this.editor.addSelectByEC(A,"phoneType3");this.phonePrimary=this.editor.addTextByEC(A,"phonePrimary");this.primaryRadio=new Array(3);this.primaryRadio[0]=A.getFirstElementById("phonePrimary1");this.primaryRadio[1]=A.getFirstElementById("phonePrimary2");this.primaryRadio[2]=A.getFirstElementById("phonePrimary3");this.zip.element.onkeypress=this.doValidateZipCode.bindAsEventListener(this);if(this.obj!=null){this.editor.clearChanges();this.editor.setValueFromObj(this.obj)}this.showDeleteAndPrintLink();this.showPrimaryNumber()},setObj:function(A,B){this.isCreateMode=B;this.cloneObj=new Object();this.cloneObj=cloneObject(A);this.obj=(A);if(this.obj.group==null){createOneToManyAssoc(this.obj,"group","Group")}if(this.editor!=null){this.editor.clearChanges();this.editor.setValueFromObj(this.obj)}this.showDeleteAndPrintLink();this.showPrimaryNumber()},showDeleteAndPrintLink:function(){if(this.deletePersonLink!=null&&this.printPersonDetails!=null){if(this.handler.IsNewPerson!=null&&this.handler.IsNewPerson==true){this.deletePersonLink.style.display="none";this.printPersonDetails.style.display="none";this.handler.IsNewPerson=false}else{this.deletePersonLink.style.display="";this.printPersonDetails.style.display=""}}if(this.phone1!=null&&this.phone2!=null&&this.phone3!=null&&this.obj!=null){var A=cloneObject(this.obj);app.formatPhone.setListenerOnPhonesId("phone1,phone2,phone3",this.obj)}if(this.fNameCursor!=null){}},showPrimaryNumber:function(){if(this.obj==null||this.primaryRadio==null){return }for(var B=0;B<this.primaryRadio.length;B++){var A=this.obj["phone"+(B+1)];if(this.obj.phonePrimary==A&&A!=""){this.primaryRadio[B].checked=true;break}}},doSave:function(){if(this.isEmailIDExist()){return }if(this.obj.address!=null){this.obj.address=this.obj.address}var G=app.formatPhone.getFormattedObject();if(G.phone1!=undefined&&G.phone1!=null){this.obj.phone1=G.phone1}if(G.phone2!=undefined&&G.phone2!=null){this.obj.phone2=G.phone2}if(G.phone3!=undefined&&G.phone3!=null){this.obj.phone3=G.phone3}this.editor.addNV("phone1",this.obj.phone1);this.editor.addNV("phone2",this.obj.phone2);this.editor.addNV("phone3",this.obj.phone3);var C=this.primaryRadio;var K=this.obj.phone1;var I=this.obj.phone2;var H=this.obj.phone3;if(K==null){K=""}if(I==null){I=""}if(H==null){H=""}if(K!=""&&(I==""&&H=="")){C[0].checked=true;this.phonePrimary.setValue(K);this.obj.phonePrimary=K}else{if(I!=""&&(K==""&&H=="")){C[1].checked=true;this.phonePrimary.setValue(I);this.obj.phonePrimary=I}else{if(H!=""&&(K==""&&I=="")){C[2].checked=true;this.phonePrimary.setValue(H);this.obj.phonePrimary=H}else{for(var A=0;A<C.length;A++){var D=this.obj["phone"+(A+1)];if(C[A].checked&&D!=null&&D!=undefined){var J=D;if(J==null){J=""}this.phonePrimary.setValue(J);this.obj.phonePrimary=J}}}}}if(this.phoneType1.value==undefined){this.phoneType1.setValue("Home")}if(this.phoneType2.value==undefined){this.phoneType2.setValue("Office")}if(this.phoneType3.value==undefined){this.phoneType3.setValue("Mobile")}if(this.fName.getValue()==""||this.fName.getValue()==undefined){showMessageDialog("Please enter first name of person.","Request",300,100,null,true);return }if(this.email.getValue()!=""&&this.email.getValue()!=undefined){if(app.emailValidator.validateEmail(trim(this.email.value))==false){showMessageDialog("Please enter a valid email address.","Request",300,100,null,true);return }}this.email.value=app.emailValidator.extractEmailAddress(this.email.value);if(this.address.value!=undefined&&this.address.value.length>100){showMessageDialog("The address you have entered is too long. Please enter a shorter version.","Request",300,100,null,true);return }if(this.zip.value!=undefined&&this.zip.value!=""){if(app.validator.validateZip(this.zip.value)==false){showMessageDialog("<br/>Please enter a valid zip code.","Request",300,100,null,true);return }}app.peopleUpdated(this.obj,app.workspace.myGroup);var B=this.editor.getChangeXmlForObjList(this.obj.group,["name"],"group");var E=this.editor.getChangeXml(this.isCreateMode,B);if(E==null){showMessageDialog("Any changes made have been saved.","Informing You",300,100,null,true);return }this.obj.name=getFullName(this.obj);if(this.isCreateMode){this.handler.dataTable.addObject(this.obj)}var F=new Af.DataRequest(svcURL,this.saveSuccessful.bind(this),this.saveFailed.bind(this),null,this.saveTimedOut.bind(this));F.addService("WorkspaceService","savePersonDetails");if(this.obj.UUID!=null){F.addParameter("UUID",this.obj.UUID)}F.xmlDoc=E;ajaxEngine.processRequest(F);this.hide();return true},doDontSave:function(){this.editor.clearChanges();this.hide();if(this.isCallFromMyLovedOne){this.isCallFromMyLovedOne=false;app.myLovedOne.showInfo=0}if(this.handler.myPeopleDetailsTable!=null&&this.personHandlerIs=="myPeople"){var A=this.handler.myPeopleDetailsTable.selectedRowNumber;if(A>=0){this.handler.dataTable.getDataList()[A]=this.cloneObj}}else{if(this.personHandlerIs=="myGroup"){var B=findObjIndex(app.myPeople.dataTable.getDataList(),this.cloneObj);if(B!=-1){app.myPeople.dataTable.getDataList()[B]=this.cloneObj}}}},doGroupSelection:function(A){var B=getGroupSelector(this);B.setGroupDataList(app.workspace.myGroup,this.obj.group)},saveSuccessful:function(A){if(this.handler.myPeopleDetailsTable!=null&&this.personHandlerIs=="myPeople"&&!this.isCreateMode){var B=this.handler.myPeopleDetailsTable.selectedRowNumber;if(B>=0){this.handler.dataTable.getDataList()[B]=this.obj}}else{if(this.personHandlerIs=="myGroup"){var C=findObjIndex(app.myPeople.dataTable.getDataList(),this.obj);if(C!=-1){app.myPeople.dataTable.getDataList()[C]=this.obj}}}if(this.obj.UUID==null){this.obj.UUID=A.responseText}this.editor.clearChanges();app.myGroups.refresh();if(this.isCallFromMyLovedOne){this.isCallFromMyLovedOne=false;if(app.myLovedOne.createNewObjectOfType!=""){app.myLovedOne.obj[app.myLovedOne.createNewObjectOfType][0]=this.obj;app.myLovedOne.createNewObjectOfType=""}app.myLovedOne.showContactInformation(this.obj)}else{this.handler.refresh()}},saveFailed:function(A,B){showMessageDialog(B+"<br/>We are currently unable to save this record. Please try again.","Excuse us!",400,150,null,true)},saveTimedOut:function(A){showMessageDialog(msg+"<br/>We are currently unable to save this record. Please try again.","Excuse us!",400,150,null,true)},setGroupListSelected:function(){this.groupSelectorDialog.setDataList(this.selectedGroups)},deletePeopleConfirm:function(){showConfirmDialog("Are you sure you want to delete this person from My People?","Are You Sure?",300,100,this.doDeletePerson.bind(this));return false},doDeletePerson:function(){if(this.personHandlerIs=="myGroup"){var C=findObjIndex(app.myPeople.dataTable.getDataList(),this.obj);if(C!=-1){var B=this.handler.dataTable.deleteObjectByIndex(C);app.peopleDeleted(B,app.workspace.myGroup);app.myGroups.refresh();this.deletePerson(B)}}else{if(this.personHandlerIs=="myPeople"){var A=this.handler.myPeopleDetailsTable.selectedRowNumber;if(A>=0){var B=this.handler.dataTable.deleteObjectByIndex(A);this.handler.myPeopleDetailsTable.setDataList(this.handler.dataTable.getDataList());app.peopleDeleted(B,app.workspace.myGroup);A=-1;this.deletePerson(B)}}else{showMessageDialog("Please select a person's record to delete.","Request",300,80,null,true)}}return false},deletePerson:function(B){hideDialogWin();var A=new Af.DataRequest(svcURL,this.requestDeletePersonCompleted.bind(this),this.requestFailedCommon.bind(this),null,this.requestTimedoutCommon.bind(this));A.addService("WorkspaceService","deletePerson");A.addParameter("UUID",this.obj.UUID);ajaxEngine.processRequest(A);return false},requestDeletePersonCompleted:function(A){this.hide();showMessageDialog("This person's record was successfully deleted.","Deletion Successful",300,80,null,true)},requestFailedCommon:function(){showMessageDialog("<br/>We are currently unable to delete this record. Please try again.","Excuse us!",400,150,null,true)},requestTimedoutCommon:function(){showMessageDialog("<br/>We are currently unable to delete this record. Please try again.","Excuse us!",400,150,null,true)},doPrintDetails:function(){if(this.doSave()){this.printDetails()}return false},printDetails:function(){var A=new Af.DataRequest(svcURL,this.printCompleted.bind(this),this.printFailed.bind(this),null,this.requestTimedout.bind(this));A.addService("WorkspaceService","getPrintHtmlFromXML");A.addParameter("templateName","personDetails");A.addParameter("xlstFile","personDetail.xsl");A.addParameter("id",this.obj.UUID);ajaxEngine.processRequest(A);return false},printCompleted:function(A){var B=new Af.PrintUtil();B.showPrintView(A)},printFailed:function(){showMessageDialog("<br/>Printing is currently unavailable. Please try again.","Printing Unavailable",400,150,null,true)},requestTimedout:function(){showMessageDialog("<br/>Printing is currently unavailable. Please try again.","Printing Unavailable",400,150,null,true)},isEmailIDExist:function(B){var C=this.email.getValue();if(C==null||C==""){return false}C=trim(C);var D=this.handler.dataTable.getDataList();var E=findObjIndex(D,this.obj);for(var A=0;A<D.length;A++){if(this.obj.UUID==null){if(C==D[A]["email"]){showMessageDialog("Person with email ID "+C+" already exists. Please try again.","Excuse us!",330,120,null,true);return true}}else{if(C==D[A]["email"]&&E!=A){showMessageDialog("Person with email ID "+C+" already exists. Please try again.","Excuse us!",330,120,null,true);return true}}}return false},doValidateZipCode:function(A){return app.validator.doValidateZipCode(A)}});HJ.ShareGroup=Class.create();HJ.ShareGroup.prototype=Object.extend(new HJ.Dialog(),{initialize:function(A){this.HJ_Dialog_initialize("Share a Group",null,null);this.handler=A;this.emailValidator=new HJ.EmailValidator()},loadTemplate:function(){this.showHTMLTemplate(basePageURL+"groups/shareGroup?userUUID="+login.userData.UUID,"MainArea","shareGroup")},templateLoaded:function(){app.endBusy();var A=new Af.ElementCollection(this.element);var B=A.getFirstElementById("successButton");if(B!=null){B.onclick=this.successButtonClicked.bind(this);return }this.selectPersonToShareWith=A.getFirstElementById("selectPersonToShareWith");this.shareToEmail=A.getFirstElementById("shareToEmail");this.selectGroupToShare=A.getFirstElementById("selectGroupToShare");this.errorText=A.getFirstElementById("errorText");B=A.getFirstElementById("okButton");B.onclick=this.okButtonClicked.bind(this);var B=A.getFirstElementById("cancelButton");B.onclick=this.cancelButtonClicked.bind(this);var E=0;var D=0;var C=document.getElementById("MyGroupContent");if(C.offsetParent){do{E+=C.offsetLeft;D+=C.offsetTop}while(C=C.offsetParent)}this.setLocation(E,D)},close:function(){if(this.handler!=null){this.handler.shareGroupDialogClosed(this)}this.hide();return false},successButtonClicked:function(){return this.close()},okButtonClicked:function(B){this.clearErrorText();var A=this.getShareToParameter();if(A==null){this.addErrorText("Please select a Jooners user from your contacts or enter the email address of a Jooners user.  ");return false}var C=this.getGroupParameter();if(C==null){this.addErrorText("Please select a group to share.  ");return false}app.showBusy();this.tl=null;this.showHTMLTemplate(basePageURL+"groups/shareGroup?userUUID="+login.userData.UUID+"&"+C+"&"+A,"MainArea","shareGroup");return false},getShareToParameter:function(){var A=trim(this.shareToEmail.value);if(A!=""){if(!this.emailValidator.validateEmail(A)){this.addErrorText("Invalid email address "+A+".<br/>");return null}A=this.emailValidator.extractEmailAddress(A);return"shareToEmail="+A}var B=this.selectPersonToShareWith.selectedIndex;if(B!=0){return"shareToUUID="+this.selectPersonToShareWith[B].value}return null},getGroupParameter:function(){var A=this.selectGroupToShare.selectedIndex;if(A==0){return null}return"groupUUID="+this.selectGroupToShare[A].value},cancelButtonClicked:function(){this.close();return false},clearErrorText:function(){this.errorText.innerHTML=""},addErrorText:function(A){this.errorText.innerHTML=this.errorText.innerHTML+A}});HJ.GroupDialog=Class.create();HJ.GroupDialog.prototype=Object.extend(new Af.HtmlDialog(),{initialize:function(C,A,B){this._initializeDialog(C,A,B);this.obj=null;this.message="";this.handler=A;this.isRename=false},templateLoaded:function(){var A=new Af.ElementCollection(this.element);this.groupName=A.getFirstElementById("groupName");this.save=A.getFirstElementById("save");this.armedButton=this.save;this.cancel=A.getFirstElementById("cancel");this.displayMessage=A.getFirstElementById("displayMessage");this.save.onclick=this.doSave.bind(this);this.cancel.onclick=this.doDontSave.bind(this);this.groupName.focus();if(this.obj!=null){this.initializeTemplateData()}},setDataObject:function(B,A){this.obj=B;this.message=A;if(this.element!=null){this.initializeTemplateData()}},initializeTemplateData:function(){if(this.message!=null&&this.displayMessage!=null){this.displayMessage.innerHTML=this.message}if(this.groupName!=null&&this.obj!=null){this.groupName.value=this.obj.name}if(this.groupName!=null){this.groupName.focus()}return },doSave:function(){var B=this.handler.dataTable.getDataList();for(var C=0;C<B.length;C++){var D=trim(B[C]["name"]);var A=trim(this.groupName.value);if(D==A){showMessageDialog(A+" already exist. Please try other name.","Excuse us!",350,100);return false}}if(this.groupName.value!=""){var E;if(this.obj!=null){this.obj.name=this.groupName.value;this.isRename=true;E=this.obj}else{E=this.handler.dataTable.insertObject("name",this.groupName.value,0,true);createOneToManyAssoc(E,"people","Person")}this.saveNewGroup(E)}return false},saveNewGroup:function(E){E.name=this.groupName.value;var A=new Af.ObjEditor();var C=A.getChangeXmlForObjList(E.people,["name","fName","lName"],"people");var D=A.getChangeXmlForObj(E,["name"],"ObjModify",C);var B=new Af.DataRequest(svcURL,this.requestSaveGroupCompletedCommon.bind(this),this.requestFailedCommon.bind(this),null,this.requestTimedoutCommon.bind(this));B.addService("WorkspaceService","saveGroupDetails");if(E.UUID!=null){B.addParameter("UUID",E.UUID)}if(this.isRename){B.addParameter("newName",E.name)}B.xmlDoc=D;this.savedObj=E;ajaxEngine.processRequest(B);this.isRename=false;return false},completeRequestSaveGroup:function(){this.handler.rightListTypeChanged()},requestSaveGroupCompletedCommon:function(B){this.groupName.value="";if(this.savedObj.UUID==null){this.savedObj.UUID=B.responseText}this.hide();var A=this.handler.dataTable.getDataList();if(A!=null&&A.length>0){A.sort(sortGroups)}this.handler.myGroupTable.setDataList(A);this.handler.setAllLists();var C=findObjIndex(A,this.savedObj);if(C>-1){this.handler.groupSelector.setSelectedIndex(C);setTimeout(this.completeRequestSaveGroup.bind(this),100)}return false},requestFailedCommon:function(A,B){hideDialogWin();showMessageDialog("We are currently unable to save this record.  Please try again.","Excuse us!",350,100);return false},requestTimedoutCommon:function(){hideDialogWin();showMessageDialog("We are currently unable to save this record.  Please try again.","Excuse us!",350,100);return false},doDontSave:function(){this.hide();return false}});HJ.ScheduleDetail=Class.create();HJ.ScheduleDetail.prototype={initialize:function(){this.table=document.getElementById("myScheduleListTable");this.tableContainer=document.getElementById("myScheduleListContainer");this.emails="";this.schDetail=null},setSchedules:function(A,B){this.schedules=A;if(this.schDetail==null){this.schDetail=new HJ.OneScheduleDetail(this,this.tableContainer,this.table)}if(B==null){var B=new Object();initializeCreatedObject(this.schedules,B);this.sch=B;this.sch.name="New Calendar";this.schDetail.setSchedule(this.sch);this.schDetail.doSave()}else{this.sch=B;this.schDetail.setSchedule(this.sch)}},doDeleteSchedule:function(B,A){deleteFromArray(this.schedules,B);app.schedule.selectedScheduleDeleted();app.schedule.removeFromShownList(B);app.schedule.myScheduleListChanged(true);this.deleteSchedule(B)},deleteSchedule:function(B){var A=new Af.DataRequest(svcURL,this.requestDeleteScheduleCompleted.bind(this),this.requestFailedCommon.bind(this),null,this.requestTimedoutCommon.bind(this));A.addService("WorkspaceService","deleteSchedule");A.addParameter("UUID",B.UUID);ajaxEngine.processRequest(A)},requestDeleteScheduleCompleted:function(A){this.table.style.display="none"},requestFailedCommon:function(A,B){showMessageDialog("We are currently unable to delete this Calendar. Please try again.","Excuse us!",350,100)},requestTimedoutCommon:function(A){showMessageDialog("We are currently unable to delete this Calendar. Please try again.","Excuse us!",350,100)}};HJ.OneScheduleDetail=Class.create();HJ.OneScheduleDetail.prototype={initialize:function(C,B,D,E){this.parent=C;this.table=D;this.tableContainer=B;this.table.style.display="";var A=new Af.ElementCollection(this.table);this.showFreeTimeTrigger=A.getFirstElementById("showFreeTimeTrigger");this.showAllTrigger=A.getFirstElementById("showAllTrigger");this.showFreeTimeTrigger.onclick=this.doShowFree.bind(this);this.showAllTrigger.onclick=this.doShowAll.bind(this);this.deleteButton=A.getFirstElementById("deleteButton");this.deleteButton.onclick=this.deleteScheduleConfirm.bind(this);this.stopAllTrigger=A.getFirstElementById("stopAllTrigger");this.stopAllTrigger.onclick=this.doShowUnSelectedAll.bind(this);this.stopFreeTimeTrigger=A.getFirstElementById("stopFreeTimeTrigger");this.stopFreeTimeTrigger.onclick=this.doShowUnSelectedFree.bind(this);this.nameComp=A.getFirstElementById("name");this.sharing=A.getFirstElementById("sharing");this.published=A.getFirstElementById("publishRemoveTrigger");this.color=A.getFirstElementById("color");if(is_ie){this.textChanger=new Af.TextChanger(this.nameComp)}this.publishMessage=A.getFirstElementById("publishMessage");this.nameComp.onfocus=this.focusOnTextBox.bindAsEventListener(this);this.nameComp.onblur=this.focusLostTextBox.bindAsEventListener(this);this.sharing.onchange=this.sharingChanged.bind(this);this.published.onclick=this.publishedClicked.bindAsEventListener(this);this.color.onclick=this.pickColor.bind(this);this.allTimeList=A.getFirstElementById("allTimeList");this.allTimeListGList=A.getFirstElementById("allTimeListGList");this.freeTimeList=A.getFirstElementById("freeTimeList");this.freeTimeListGList=A.getFirstElementById("freeTimeListGList");this.removeMessageText="This Calendar has been published to Jooners Community Calendars.<br/>To remove it from Community Calendars, Click:";this.publishMessageText="To publish to Jooners Community Calendars, Click:";this.removeLabel="Remove";this.publishLabel="Publish"},setSchedule:function(B){this.table.style.display="";this.sch=B;if(B.people==null){createOneToManyAssoc(B,"people","Person")}if(B.group==null){createOneToManyAssoc(B,"group","Group")}if(B.people2==null){createOneToManyAssoc(B,"people2","Person")}if(B.group2==null){createOneToManyAssoc(B,"group2","Group")}this.sch=B;var A=this.sch.name;if(A==null){A="New Calendar";this.sch.name=A}this.nameComp.value=A;A=this.sch.sharing;if(A==null){A="private";this.sch.sharing=A}this.sharing.value=A;A=this.sch.published;if(A==null){A=false;this.sch.published=""+A}A=this.sch.color;if(A==null){A="green";this.sch.color=A}this.color.style.background=getBackground(A);this.updateSharingState();this.showPeopleGroups()},doShowFree:function(){this.showNotifyDialog(false);GATrackEvent("share");return false},doShowAll:function(){this.showNotifyDialog(true);try{GATrackEvent("share")}catch(A){}return false},doShowUnSelectedAll:function(){this.allDetails="ALL_TIME";this.doShowUnSelectedAllPeople(true)},doShowUnSelectedAllPeople:function(A){if(A){this.originalGrList=this.sch.group2;this.originalPplList=this.sch.people2}else{this.originalGrList=this.sch.group;this.originalPplList=this.sch.people}this.pplList=this.originalPplList.slice(0,this.originalPplList.length);this.grpList=this.originalGrList.slice(0,this.originalGrList.length);if(this.pgSelector==null){this.pgSelector=new HJ.PeopleGroupSelector("Choose to unshare Calendar",this,null);this.pgSelector.centerDialog(400,300);this.pgSelector.displayTextMessage="Please choose group and people with whom you want to unshare Calendar. <BR/><BR/>"}this.pgSelector.showHTMLTemplate(basePageURL+"PeopleGroupSelector.htm","MainArea","peopleSelector");this.pgSelector.centerDialog(400,300);this.pgSelector.setDataList(this.grpList,this.pplList,new Array(),new Array());return false},doShowUnSelectedFree:function(){this.allDetails="FREE_TIME";this.doShowUnSelectedAllPeople(false)},selectionDone:function(D){var C=D.myPeopleDataList;this.personIdArr=new Array();this.groupIdArr=new Array();for(var A=0;A<C.length;A++){if(C[A]["isSelected"]==true){this.personIdArr.push(C[A].UUID)}}for(var B=0;B<this.originalGrList.length;B++){if(this.originalGrList[B]["isSelected"]==true){this.groupIdArr.push(this.originalGrList[B].UUID)}}if(this.personIdArr.length>0||this.groupIdArr.length>0){showConfirmDialog("Are you sure you want to unshare this Calendar ?","Are You Sure?",300,100,this.unshareSharedSch.bind(this),this.sharingChangedCancel.bind(this))}},unshareSharedSch:function(){hideDialogWin();if(this.personIdArr.length>0||this.groupIdArr.length>0){this.unShareSharedSchedule(this.sch,this.personIdArr,this.groupIdArr)}},unShareSharedSchedule:function(D,B,A){var C=new Af.DataRequest(svcURL,this.reqDeleteSharedScheduleCompleted.bind(this),this.reqFailedDeleteShaSch.bind(this),null,this.reqTimedoutDeleteShaSch.bind(this));C.addService("WorkspaceService","deleteSharing");C.addParameter("sharedSchId",D.UUID);if(B.length>0){C.addParameter("personIds",B)}if(A.length>0){C.addParameter("groupIds",A)}if(this.allDetails!=null){C.addParameter("allDetails",this.allDetails)}ajaxEngine.processRequest(C)},reqDeleteSharedScheduleCompleted:function(A){var E=A.responseText;if(E=="SUCCESS"){showMessageDialog("Your shared Calendar has been successfully unshared.","Unshare Successful",300,100);if(this.allDetails=="ALL_TIME"&&this.sch.people2.length>0){var D=this.sch.people2.length;if(D>0){for(var G=0;G<D;G++){if(this.sch.people2[0]["isSelected"]==true){deleteFromArray(this.sch.people2,this.sch.people2[0])}}}}if(this.allDetails=="ALL_TIME"&&this.sch.group2.length>0){var C=this.sch.group2.length;if(C>0){for(var G=0;G<C;G++){if(this.sch.group2[0]["isSelected"]==true){deleteFromArray(this.sch.group2,this.sch.group2[0])}}}}if(this.allDetails=="FREE_TIME"&&this.sch.people.length>0){var F=this.sch.people.length;if(F>0){for(var G=0;G<F;G++){if(this.sch.people[0]["isSelected"]==true){deleteFromArray(this.sch.people,this.sch.people[0])}}}}if(this.allDetails=="FREE_TIME"&&this.sch.group.length>0){var B=this.sch.group.length;if(B>0){for(var G=0;G<B;G++){if(this.sch.group[0]["isSelected"]==true){deleteFromArray(this.sch.group,this.sch.group[0])}}}}this.doSave()}},reqFailedDeleteShaSch:function(){showMessageDialog("We are currently unable to delete this shared Calendar. <br/> Please try again.","Excuse us!",300,100)},reqTimedoutDeleteShaSch:function(){showMessageDialog("We are currently unable to delete this shared Calendar. <br/> Please try again.","Excuse us!",300,100)},nameChanged:function(){this.sch.name=this.nameComp.value;this.doSave()},sharingChanged:function(){if(this.sharing.value=="private"){showConfirmDialog("Are you sure you want to change this Calendar to be private?","Are You Sure?",300,100,this.sharingChangedOK.bind(this),this.sharingChangedCancel.bind(this))}else{this.sch.sharing=this.sharing.value;this.doSave()}return false},sharingChangedOK:function(){hideDialogWin();this.sch.sharing=this.sharing.value;if(this.sharing.value=="private"){this.sch.people.length=0;this.sch.group.length=0;this.sch.people2.length=0;this.sch.group2.length=0}this.doSave()},sharingChangedCancel:function(){hideDialogWin();this.sharing.value=this.sch.sharing},pickColor:function(){var B=RicoUtil.toDocumentPosition(this.color);var A=B.x;var C=B.y+this.color.offsetHeight;app.colorPicker.handler=this;app.colorPicker.show("content",A,C)},colorSelected:function(A){this.sch.color=A;this.color.style.background=getBackground(A);this.doSave()},updateSharingState:function(){if(this.sharing.value=="shared"){this.table.rows[3].style.display="";this.table.rows[4].style.display="";this.table.rows[5].style.display=""}else{this.table.rows[3].style.display="none";this.table.rows[4].style.display="none";this.table.rows[5].style.display="none"}if(this.sch.published=="true"){this.publishMessage.innerHTML=this.removeMessageText;this.published.value=this.removeLabel}else{this.publishMessage.innerHTML=this.publishMessageText;this.published.value=this.publishLabel}},deleteScheduleConfirm:function(){showConfirmDialog("Are you sure you want to delete this Calendar?","Are You Sure?",300,110,this.doDeleteSchedule.bind(this))},doDeleteSchedule:function(){hideDialogWin();this.parent.doDeleteSchedule(this.sch,this)},doSave:function(){app.schedule.myScheduleListChanged(true);app.schedule.shownScheduleListChanged();this.save()},save:function(C,E,A,I){this.invalidEmails="";var D=new Af.ObjEditor();var B=D.getChangeXmlForObjList(this.sch.people,["name"],"people");B+=D.getChangeXmlForObjList(this.sch.group,["name"],"group");B+=D.getChangeXmlForObjList(this.sch.people2,["name"],"people2");B+=D.getChangeXmlForObjList(this.sch.group2,["name"],"group2");var G=D.getChangeXmlForObj(this.sch,["name","sharing","published","color","category","notifMessage","communityTitle","city","state","description"],"ObjModify",B);var H=new Af.DataRequest(svcURL,this.saveSuccessful.bind(this),this.saveFailed.bind(this),null,this.saveTimedOut.bind(this));H.addService("WorkspaceService","saveScheduleDetails");if(this.sch.UUID!=null){H.addParameter("UUID",this.sch.UUID)}this.addlAction=C;if(C!=null){H.addParameter("addlAction",C)}if(E!=null){var J=E.split(",");this.emailsArray=new Array();for(var F=0;F<J.length;F++){if(!app.emailValidator.validateEmail(J[F])){if(J[F]!=""){if(this.invalidEmails==""){this.invalidEmails+=J[F]}else{if(this.invalidEmails.indexOf(J[F])==-1){this.invalidEmails+=","+J[F]}}}continue}J[F]=app.emailValidator.extractEmailAddress(J[F]);if(J[F]!=""){this.emailsArray.push(J[F])}}H.addParameter("emails",xmlEncode(E))}if(A!=null){H.addParameter("sendNotifyMailTo",A)}if(I!=null){H.addParameter("allDetails",""+I)}if(this.sharing.value=="private"){H.addParameter("isPrivate","Yes")}H.xmlDoc=G;ajaxEngine.processRequest(H)},saveSuccessful:function(B){var A=new Af.XMLToDataSet(B.responseXML);var G=A.data;if(this.sch.UUID==null){this.sch.UUID=G.UUID;this.parent.schedules.unshift(this.sch);app.schedule.myScheduleListChanged(true);app.db.workspace.schedule.push(this.sch)}var F=G.people;var D=this.sch.people;if(F!=null&&F.length>0){var E=app.workspace.myPeople;for(var C=0;C<F.length;C++){var H;H=findObjById(E,F[C]["UUID"]);if(H==null){H=F[C];H.__parent=E.__parent;E.push(H)}if(findObjById(D,H.UUID)==null){D.push(H)}}app.myPeople.myPeopleListChanged()}F=G.people2;D=this.sch.people2;if(F!=null&&F.length>0){var E=app.workspace.myPeople;for(var C=0;C<F.length;C++){var H;H=findObjById(E,F[C]["UUID"]);if(H==null){H=F[C];H.__parent=E.__parent;E.push(H)}if(findObjById(D,H.UUID)==null){D.push(H)}}app.myPeople.myPeopleListChanged()}this.showPeopleGroups();this.updateSharingState();if(this.addlAction=="notify"){if(this.invalidEmails!=""){showMessageDialog("Your email notification has been sent and these are the invalid emails to which we are unable to send notification.<BR/>"+this.invalidEmails,"Email Delivered",450,150)}else{showMessageDialog("Your email notification has been sent.","Email Delivered",400,150)}}},saveFailed:function(A,B){if(this.addlAction=="notify"){showMessageDialog("We are currently unable to share this Calendar.<br/> Please try again.","Excuse us!",350,130)}else{showMessageDialog("We are currently unable to save this Calendar.<br/> Please try again.","Excuse us!",350,130)}},saveTimedOut:function(A){showMessageDialog("We are currently unable to save this Calendar.<br/> Please try again.","Excuse us!",400,150)},showNotifyDialog:function(A){if(this.shareNotificationEmailDialog==null){this.shareNotificationEmailDialog=new HJ.ShareNotificationEmail("Calendar Sharing Email",this,null);this.shareNotificationEmailDialog.width="370px"}this.shareNotificationEmailDialog.showHTMLTemplate(basePageURL+"ShareNotificationEmail.htm","MainArea","shareNotificationEmail");this.shareNotificationEmailDialog.centerDialog(350,350);this.shareNotificationEmailDialog.setObj(this.sch,A)},publishedClicked:function(A){var B=this.sch.published;if(B=="false"){if(this.dialog==null){this.dialog=new HJ.PublishCalender("Publish Your Calendar",this,null)}var C=new Object();C.city="City";this.dialog.showHTMLTemplate(basePageURL+"PublishYourCalendar.htm","content","publishCalDiv");this.dialog.centerDialog(300,300);this.dialog.setObj(C,true);return true}else{showConfirmDialog("Are you sure you want to unpublish this Calendar? Unpublishing it will make it unavailable to the Jooners community.","Are You Sure?",400,150,this.doUnpublishCalendar.bind(this));return false}},doUnpublishCalendar:function(){hideDialogWin();this.sch.published="false";this.sch.category="";this.sch.communityTitle="";this.sch.description="";this.sch.city="";this.sch.state="";this.save()},showPeopleGroups:function(){var C="";var D="";var A=this.sch.people;for(var B=0;B<A.length;B++){if(C==""){C+="<b><strong>Individuals</b></strong><br/>"+(""==trim(getFullName(A[B]))?A[B]["email"]:getFullName(A[B]))}else{C+="<br/>"+(""==trim(getFullName(A[B]))?A[B]["email"]:getFullName(A[B]))}}A=this.sch.group;for(var B=0;B<A.length;B++){if(D==""){D+="<b><strong>Groups</b></strong><br/>"+A[B].name}else{D+="<br/>"+A[B].name}}this.freeTimeList.innerHTML=C;this.freeTimeListGList.innerHTML=D;C="";D="";var A=this.sch.people2;for(var B=0;B<A.length;B++){if(C==""){C+="<b><strong>Individuals</b></strong><br/>"+(""==trim(getFullName(A[B]))?A[B]["email"]:getFullName(A[B]))}else{C+="<br/>"+(""==trim(getFullName(A[B]))?A[B]["email"]:getFullName(A[B]))}}A=this.sch.group2;for(var B=0;B<A.length;B++){if(D==""){D+="<b><strong>Groups</b></strong><br/>"+A[B].name}else{D+="<br/>"+A[B].name}}this.allTimeList.innerHTML=C;this.allTimeListGList.innerHTML=D},focusOnTextBox:function(A){if("New Calendar"==this.nameComp.value){this.nameComp.value=""}this.nameComp.focus()},focusLostTextBox:function(A){var C=this.nameComp.value;if(C==null){C=""}else{C=trim(C)}var B=trim("New Calendar");if(C==B||C==""){this.nameComp.value=this.sch.name}else{this.sch.name=this.nameComp.value;this.doSave();GATrackEvent("changeName")}consumeEvent(A)}};HJ.GroupSelectorDialog=Class.create();HJ.GroupSelectorDialog.prototype=Object.extend(new Af.HtmlDialog(),{initialize:function(C,A,B){this._initializeDialog(C,A,B);this.groupListTable=null},setDataList:function(A){this.dataTable=new Af.DataTable(this.handler.handler.groupList);this.selectedGroupList=A;if(this.firstTime==false){this.updateView()}},updateView:function(){debugA("firsttime:"+this.firstTime);var A=this.dataTable.getDataList();if(A!=null){for(idx=0;idx<A.length;idx++){var B=findObjIndex(this.selectedGroupList,A[idx]);if(B>-1){A[idx]["isSelected"]=true}else{A[idx]["isSelected"]=false}}}if(this.groupListTable){this.groupListTable.setDataList(A)}},templateLoaded:function(){this.groupListTable=new Af.HtmlTable("groupListTable","isSelected,name");this.groupListTable.listener=this;this.groupListTable.setDataList(this.handler.handler.groupList);var A=new Af.ElementCollection(this.element);this.groupSelectionDone=A.getFirstElementById("groupSelectionDone");this.groupSelectionDone.onclick=this.selectionDone.bind(this);this.armedButton=this.groupSelectionDone},selectionDone:function(){this.selectedGroupList=new Array();var A=this.dataTable.getDataList();debugA("update selected list - groups");for(idx=0;idx<A.length;idx++){if(A[idx]["isSelected"]==true){this.selectedGroupList.push(A[idx])}}debugA(this.selectedGroupList.length);if(this.handler!=null&&this.handler.selectionDone!=null){debugA("callback from groupSelectorDialog selector");this.handler.selectionDone(this)}this.hide()}});HJ.PeopleSelectorDialog=Class.create();HJ.PeopleSelectorDialog.prototype=Object.extend(new Af.HtmlDialog(),{initialize:function(C,A,B){this._initializeDialog(C,A,B);this.myPeopleDataTable=null;this.selectedPeopleList=new Array();this.groupTable=null;this.peopleTable=null},setDataList:function(A,B){this.myPeopleDataTable=new Af.DataTable(myPeople);this.selectedGroupList=selectedGroups;this.selectedPeopleList=B;if(this.myPeopleDataList!=null&&this.myPeopleDataList.length>0){this.myPeopleDataList.sort(sortByLastName)}},updateView:function(){},templateLoaded:function(){this.peopleTable=new Af.HtmlTable("peopleListTable",",fName");this.updateView()}});var pSelector=null;function getPoepleSelector(){if(pSelector==null){pSelector=new HJ.PeopleSelectorDialog("Select a Person",this,null);pSelector.width="100px"}pSelector.showHTMLTemplate(basePageURL+"PeopleSelector.htm","content","peopleListBox");pSelector.centerDialog(400,300);return pSelector}HJ.PeopleGroupSelector=Class.create();HJ.PeopleGroupSelector.prototype=Object.extend(new Af.HtmlDialog(),{initialize:function(C,A,B){this._initializeDialog(C,A,B);this.myPeopleDataList=null;this.myGroupDataList=null;this.selectedGroupList=null;this.selectedPeopleList=null;this.groupTable=null;this.peopleTable=null;this.singleSelectionMode=false;this.tableNormalBackcolor="#f6f6f6";this.displayTextMessage=""},setDataList:function(B,E,A,D,C){this.disableSelected=C;this.myGroupDataList=B;this.myPeopleDataList=new Array();this.selectedGroupList=A;this.selectedPeopleList=D;for(Idx1=0;Idx1<E.length;Idx1++){if(E[Idx1]["email"]!=null||E[Idx1]["email"]!=undefined){if(" "!=getFullName(E[Idx1])){E[Idx1]["name"]=getFullName(E[Idx1])}else{E[Idx1]["name"]=E[Idx1]["email"]}this.myPeopleDataList.push(E[Idx1])}}if(this.myGroupDataList!=null&&this.myGroupDataList.length>0){this.myGroupDataList.sort(sortGroups)}if(this.myPeopleDataList!=null&&this.myPeopleDataList.length>0){this.myPeopleDataList.sort(sortByLastName)}this.updateView()},setGroupDataList:function(B,A,C){this.disableSelected=C;this.myGroupDataList=B;this.myPeopleDataList=null;this.selectedGroupList=A;this.selectedPeopleList=null;if(this.myGroupDataList!=null&&this.myGroupDataList.length>0){this.myGroupDataList.sort(sortGroups)}this.updateView()},setPeopleDataList:function(A,C,B){this.disableSelected=B;this.myPeopleDataList=new Array();this.selectedPeopleList=C;for(Idx2=0;Idx2<A.length;Idx2++){if(A[Idx2]["email"]!=null||A[Idx2]["email"]!=undefined){if(" "!=getFullName(A[Idx2])){A[Idx2]["name"]=getFullName(A[Idx2])}else{A[Idx2]["name"]=A[Idx2]["email"]}this.myPeopleDataList.push(A[Idx2])}}if(this.myPeopleDataList!=null&&this.myPeopleDataList.length>0){this.myPeopleDataList.sort(sortByLastName)}this.updateView()},updateView:function(){if(this.myGroupDataList==null&&this.myPeopleDataList==null){return }if(this.myGroupDataList!=null){for(idx=0;idx<this.myGroupDataList.length;idx++){var D=findObjIndex(this.selectedGroupList,this.myGroupDataList[idx]);if(D!=null&&D>-1){this.myGroupDataList[idx]["isSelected"]=true}else{this.myGroupDataList[idx]["isSelected"]=false}}if(this.groupTable){this.groupTable.setDataList(this.myGroupDataList);if(this.disableSelected){this.groupTable.disableCheckedColumn(0)}}}if(this.myPeopleDataList!=null){for(idx=0;idx<this.myPeopleDataList.length;idx++){var D=findObjIndex(this.selectedPeopleList,this.myPeopleDataList[idx]);if(D!=null&&D>-1){this.myPeopleDataList[idx]["isSelected"]=true}else{this.myPeopleDataList[idx]["isSelected"]=false}}if(this.peopleTable){this.peopleTable.setDataList(this.myPeopleDataList);if(this.disableSelected){this.peopleTable.disableCheckedColumn(0)}}}var C=this.peopleSelectionDiv;var A=this.myPeopleDataList;var B=this.groupSelectionDiv;var F=this.myGroupDataList;if(C!=null&&A!=null&&A.length>=7){this.peopleSelectionDiv.style.overflow="auto";this.peopleSelectionDiv.style.height="130px"}if(B!=null&&F!=null&&F.length>=7){this.groupSelectionDiv.style.overflow="auto";this.groupSelectionDiv.style.height="130px"}var E=0;if(A!=null){E=A.length}if(F!=null){E+=F.lengh}if(this.peopleSelector!=null&&(E>=14)){if(is_ie){this.peopleSelector.style.height="350px"}else{this.peopleSelector.style.height="340px"}}this.setDisplayMessage()},setDisplayMessage:function(){if(this.messageTemplate!=null&&this.displayTextMessage!=""){this.messageTemplate.style.display="block";this.messageTemplate.innerHTML=this.displayTextMessage}},templateLoaded:function(){var A=new Af.ElementCollection(this.element);this.peopleSelectionDiv=A.getFirstElementById("peopleSelectionDiv");this.groupSelectionDiv=A.getFirstElementById("groupSelectionDiv");this.peopleSelector=A.getFirstElementById("peopleSelector");this.messageTemplate=A.getFirstElementById("messageTemplate");if(A.getFirstElementById("groupTable")!=null){this.groupTable=new Af.HtmlTable("groupTable","isSelected,name");this.groupTable.normalBackcolor=this.tableNormalBackcolor}if(A.getFirstElementById("peopleTable")!=null){var B;if(this.singleSelectionMode){B="name"}else{B="isSelected,name"}this.peopleTable=new Af.HtmlTable("peopleTable",B);this.peopleTable.listener=this;this.peopleTable.normalBackcolor=this.tableNormalBackcolor}this.btnDone=A.getFirstElementById("btnDone");this.armedButton=this.btnDone;this.btnDone.onclick=this.selectionDone.bind(this);this.updateView();this.setDisplayMessage();this.element.style.zIndex="500001"},selectionDone:function(){if(this.myGroupDataList!=null){this.selectedGroupList.length=0;for(idx=0;idx<this.myGroupDataList.length;idx++){if(this.myGroupDataList[idx]["isSelected"]==true){this.selectedGroupList.push(this.myGroupDataList[idx])}}}if(this.singleSelectionMode){if(this.myPeopleDataList!=null){this.selectedPeopleList.length=0;this.selectedPeopleList.push(this.myPeopleDataList[this.peopleTable.selectedRowNumber])}}else{if(this.myPeopleDataList!=null){this.selectedPeopleList.length=0;for(idx=0;idx<this.myPeopleDataList.length;idx++){if(this.myPeopleDataList[idx]["isSelected"]==true){this.selectedPeopleList.push(this.myPeopleDataList[idx])}}}}if(this.handler!=null&&this.handler.selectionDone!=null){this.handler.selectionDone(this)}this.hide()}});var pgSelector=null;function getPoepleGroupSelector(A){if(pgSelector==null){pgSelector=new HJ.PeopleGroupSelector("Choose Groups &amp; People",A,null)}else{pgSelector.handler=A}pgSelector.showHTMLTemplate(basePageURL+"PeopleGroupSelector.htm","MainArea","peopleSelector");pgSelector.centerDialog(400,300);return pgSelector}var gSelector=null;function getGroupSelector(A){if(gSelector==null){gSelector=new HJ.PeopleGroupSelector("Select a Group",A,null)}else{gSelector.handler=A}gSelector.showHTMLTemplate(basePageURL+"GroupSelector.htm","MainArea","groupListBox");gSelector.centerDialog(400,300);return gSelector}var pSelector=null;function getPeopleSelector(A){if(pSelector==null){pSelector=new HJ.PeopleGroupSelector("Select persons",A,null)}else{pSelector.handler=A}pSelector.showHTMLTemplate(basePageURL+"PeopleSelector.htm","MainArea","peopleListBox");pSelector.centerDialog(400,300);return pSelector}var pSingleSelector=null;function getPeopleSingleSelector(A){if(pSingleSelector==null){pSingleSelector=new HJ.PeopleGroupSelector("Select a person",A,null);pSingleSelector.singleSelectionMode=true}else{pSingleSelector.handler=A}pSingleSelector.showHTMLTemplate(basePageURL+"PeopleSelector.htm","MainArea","peopleListBox");pSingleSelector.centerDialog(400,300);return pSingleSelector}HJ.AddMyListDialog=Class.create();HJ.AddMyListDialog.prototype=Object.extend(new Af.HtmlDialog(),{initialize:function(C,A,B,D){this.zIndex=D;this._initializeDialog(C,A,B);this.obj=null;this.message=""},templateLoaded:function(){if(this.zIndex!=null){this.element.style.zIndex=this.zIndex}this.ec=new Af.ElementCollection(this.element);this.save=this.ec.getFirstElementById("save");this.armedButton=this.save;this.displayMessage=this.ec.getFirstElementById("displayMessage");this.myListName=this.ec.getFirstElementById("myListName");this.cancel=this.ec.getFirstElementById("cancel");this.cancel.onclick=this.doCancel.bind(this);this.save.onclick=this.doSave.bind(this);this.initializeTemplateData()},setDataObject:function(B,A){this.obj=B;this.message=A;this.initializeTemplateData()},initializeTemplateData:function(){if(this.message!=null&&this.displayMessage!=null){this.displayMessage.innerHTML=this.message}if(this.myListName!=null&&this.obj!=null){this.myListName.value=this.obj.name}if(this.myListName!=null){this.myListName.focus()}return },doSave:function(){if(this.myListName.value==null||trim(this.myListName.value)==""){this.hide();return }var A;if(this.obj!=null){this.obj.name=this.myListName.value;A=this.obj;app.myLists.refreshListDetailView(A)}else{A=app.myLists.dataTable.insertObject("name",this.myListName.value,0,true)}this.hide();this.saveMyList(A)},saveMyList:function(C){var A="<message>";A+="<myListName>"+xmlEncode(this.myListName.value)+"</myListName>";A+="<templateType>default</templateType>";A+="<startDT> </startDT>";A+="<endDT> </endDT>";A+="<repeatType> </repeatType>";A+="<organizerName>"+login.userFullName+"</organizerName>";A+="<phone> </phone>";A+="<notes> </notes>";A+="</message>";var B=new Af.DataRequest(svcURL,this.requestSaveMyListCompletedCommon.bind(this),this.requestFailedCommon.bind(this),null,this.requestTimedoutCommon.bind(this));B.addService("WorkspaceService","saveMyList");if(C.UUID!=null){B.addParameter("UUID",C.UUID)}this.saveObj=C;B.xmlDoc=A;ajaxEngine.processRequest(B)},requestSaveMyListCompletedCommon:function(A){this.myListName.value="";if(this.saveObj.UUID==null){this.saveObj.UUID=A.responseText}app.myLists.myListsTable.setDataList(app.myLists.dataTable.getDataList());if(this.handler.myListCreated!=null){this.handler.myListCreated(this.saveObj.UUID)}},requestFailedCommon:function(){showMessageDialog("We are currently unable to save this list. Please try again.","Excuse us!",350,100)},requestTimedoutCommon:function(){showMessageDialog("We are currently unable to save this list. Please try again.","Excuse us!",350,100)},doCancel:function(){this.hide()}});HJ.EventDetail=Class.create();HJ.EventDetail.prototype=Object.extend(new Af.HtmlDialog(),{initialize:function(C,A,B){this._initializeDialog(C,A,B);this.top=200;this.dateUtil=new Af.DateUtil();this.defaultMessage1="";this.IsInvitationSent=false;this.editing=true;this.saveStartDate=null;this.actualDate=null;this.savedRepeatFlag=null},setWorkspace:function(A){this.workspace=A},templateLoaded:function(){var A=new Af.ElementCollection(this.element);this.save=A.getFirstElementById("save");this.armedButton=this.save;this.save.onclick=this.doSaveStep1.bind(this);this.send=A.getFirstElementById("sendInvitation");this.send.onclick=this.doSend.bind(this);this.deleteB=A.getFirstElementById("delete");this.deleteB.onclick=this.deleteEventConfirm.bind(this);this.previous=A.getFirstElementById("previous");this.previous.onclick=this.doPrevious.bind(this);this.peopleSelectTrigger=A.getFirstElementById("peopleSelectTrigger");this.peopleSelectTrigger.onclick=this.selectPeople.bind(this);this.previewInvitation=A.getFirstElementById("previewInvitation");this.previewInvitation.onclick=this.doPreview.bind(this);this.eventTaskListContainer=A.getFirstElementById("eventTaskListContainer");this.indvslSelectionList=A.getFirstElementById("indvslSelectionList");this.groupSelectionList=A.getFirstElementById("groupSelectionList");this.indvslSelectionList.innerHTML="";this.groupSelectionList.innerHTML="";this.titleCursor=A.getFirstElementById("displayName");if(this.titleCursor!=null){this.titleCursor.onfocus=this.focusOnNameTextBox.bindAsEventListener(this);this.titleCursor.onblur=this.focusLostNameTextBox.bindAsEventListener(this);this.defaultEventName=this.titleCursor.value}this.editor=new Af.ObjEditor();this.startDTBox=A.getFirstElementById("startDT");this.nameComp=this.editor.addTextByEC(A,"displayName");this.scheduleSelect=this.editor.addDynamicSelectByEC(A,"schedule",new Array(),null,"name","UUID");this.date1=this.editor.addDatetByEC(A,"startDT","dateTrigger");this.date2=this.editor.addDatetByEC(A,"startDT","startDT");this.date=this.date1;this.date.errorHandler=new this.DateFormatErrorHandler();this.dateTrigger=A.getFirstElementById("dateTrigger");this.dateTrigger.onmouseover=this.datePickerOpened.bindAsEventListener(this);this.startDTBox.onmouseover=this.datePickerOpened.bindAsEventListener(this);this.taskList=this.editor.addDynamicSelectByEC(A,"taskList",new Array(),null,"name","UUID");this.editor.addTextByEC(A,"locationName");this.addressFlag=this.editor.addCheckBoxByEC(A,"addressFlag");this.city=this.editor.addTextByEC(A,"city");this.street=this.editor.addTextByEC(A,"street");this.state=this.editor.addTextByEC(A,"state");this.zip=this.editor.addTextByEC(A,"zip");var D=this.editor.addCheckBoxByEC(A,"timeFlag");var C=this.editor.addCheckBoxByEC(A,"noTimeFlag");D.behavior.addPeer(C);C.behavior.addPeer(D);this.timeFlag=D;this.noTimeFlag=C;this.editor.addCheckBoxByEC(A,"drivingFlag");this.editor.addCheckBoxByEC(A,"helpAsked");this.driverAssgined=this.editor.addCheckBoxByEC(A,"driverAssgined");this.taskList.addValueChangeListener(this);this.date.addValueChangeListener(this);this.driverAssgined.element.onclick=this.driverAssginedCheckChanged.bind(this);this.minuteBefore1=this.editor.addIntByEC(A,"minuteBefore1");this.minuteBefore2=this.editor.addIntByEC(A,"minuteBefore2");this.repeatFlag=this.editor.addCheckBoxByEC(A,"repeatFlag");this.repeatUntil1=this.editor.addDatetByEC(A,"repeatUntil","repeatUntilTrigger");this.repeatUntil2=this.editor.addDatetByEC(A,"repeatUntil","repeatUntil");this.repeatUntil=this.repeatUntil1;this.repeatUntilBtn=A.getFirstElementById("repeatUntilTrigger");this.repeatUntilBox=A.getFirstElementById("repeatUntil");this.repeatUntilBtn.onmouseover=this.datePickerOpened.bindAsEventListener(this);this.repeatUntilBox.onmouseover=this.datePickerOpened.bindAsEventListener(this);this.reminderFlag=this.editor.addCheckBoxByEC(A,"reminderFlag");this.editor.addIntByEC(A,"reminderWhen");this.editor.addSelectByEC(A,"reminderType");this.emails=document.getElementById("emails");this.inviteeEmails=this.editor.addTextAreaByEC(A,"emails");this.message1=this.editor.addTextAreaByEC(A,"message1");this.defaultMessage1=this.message1.element.value;this.message2=this.editor.addTextAreaByEC(A,"message2");this.createNewList=A.getFirstElementById("createNewList");this.createNewList.onclick=this.doAddNewMyList.bindAsEventListener(this);this.drivingTab=A.getFirstElementById("drivingTab");this.selectDriver1=A.getFirstElementById("selectDriver1");this.selectDriver2=A.getFirstElementById("selectDriver2");this.deleteDriver1=A.getFirstElementById("deleteDriver1");this.deleteDriver2=A.getFirstElementById("deleteDriver2");this.guestTab=A.getFirstElementById("guestTab");this.additionalSchedule=A.getFirstElementById("additionalSchedule");this.additionalScheduleList=A.getFirstElementById("additionalScheduleList");this.eventSpecialMessage=A.getFirstElementById("eventSpecialMessage");this.selectDriver1.onclick=this.doSelectDriver1.bind(this);this.selectDriver2.onclick=this.doSelectDriver2.bind(this);this.deleteDriver1.onclick=this.doDeleteDriver1.bind(this);this.deleteDriver2.onclick=this.doDeleteDriver2.bind(this);this.additionalSchedule.onclick=this.doSelectAddlSchedules.bind(this);this.driver1Name=A.getFirstElementById("driver1Name");this.driver2Name=A.getFirstElementById("driver2Name");this.noResponseId=A.getFirstElementById("noResponseId");this.yesId=A.getFirstElementById("yesId");this.noId=A.getFirstElementById("noId");this.totalId=A.getFirstElementById("totalId");this.listTabEventDetail=A.getFirstElementById("listTabEventDetail");this.drivingTabEventDtTime=A.getFirstElementById("drivingTabEventDtTime");this.myOneList=new HJ.MyOneList(A.getFirstElementById("listTabContent"),this.element);this.inviteesTable=new Af.HtmlTable("inviteesTable","result, fullName",A);this.htmlTab=new Af.HtmlTab("tabMenu","basicTab, drivingTab, guestTab, listTab","basicTabContent, drivingTabContent, guestTabContent, listTabContent");this.htmlTab.validityFlags.listTabContent=false;this.htmlTab.validityFlags.drivingTabContent=false;this.htmlTab.tabSelectionListener=this;this.eventTaskListContainer.style.display="none";this.repeatType=A.getFirstElementById("repeatType");this.repeatType.onchange=this.repeatTypeChanged.bind(this);this.subTypeTable=A.getFirstElementById("subTypeTable");this.fromTime=new Af.TimeDropDown(A.getFirstElementById("fromTime"),A.getFirstElementById("fromTimeSelector"),this,A.getFirstElementById("basicTabContent"),this.element);this.toTime=new Af.TimeDropDown(A.getFirstElementById("toTime"),A.getFirstElementById("toTimeSelector"),this,A.getFirstElementById("basicTabContent"),this.element);this.addressFlag.element.checked=false;this.addressFlag.element.onclick=this.doIncludeAddress.bind(this);this.reminderFlag.element.checked=false;this.reminderFlag.element.onclick=this.doReminderFlagChange.bind(this);this.repeatFlag.element.checked=false;this.repeatFlag.element.onclick=this.doRepeatFlagChange.bind(this);this.repeatBlock=A.getFirstElementById("repeatBlock");this.doIncludeAddress();this.doReminderFlagChange();this.doRepeatFlagChange();this.defaultEmailMessage=this.emails.value;this.emails.onfocus=this.focusOnTextBox.bindAsEventListener(this);this.emails.onblur=this.focusLostTextBox.bindAsEventListener(this);this.rsvpTabs=[A.getFirstElementById("allTab"),A.getFirstElementById("yesTab"),A.getFirstElementById("noTab"),A.getFirstElementById("noResponseTab")];for(var B=0;B<this.rsvpTabs.length;B++){this.rsvpTabs[B].onclick=this.rsvpTabSelected.bind(this,B)}this.rsvpIndex=0;this.rsvpTab0BC=this.rsvpTabs[0].style.backgroundColor;this.rsvpTab1BC=this.rsvpTabs[1].style.backgroundColor;if(this.obj!=null){this.mySetObj()}},DateFormatErrorHandler:function(){this.showError=function(){showMessageDialog("There is an error in the date format, please try again.","Excuse us!",300,100)}},datePickerOpened:function(A){var B=A.target?A.target:A.srcElement;if(B!=null){if("startDT"==B.id){this.date=this.date2}else{if("dateTrigger"==B.id){this.date=this.date1}else{if("repeatUntilTrigger"==B.id){this.repeatUntil=this.repeatUntil1}else{if("repeatUntil"==B.id){this.repeatUntil=this.repeatUntil2}}}}}},setFieldsState:function(){var A;if(this.index_S_Sch==-1&&this.index_C_Sch==-1){A=false}else{if(this.index!=-1){A=false}else{A=true}}if(A||this.isCreateMode){this.deleteB.disabled="true";this.deleteB.style.borderColor="#888888";this.deleteB.style.color="#888888"}},setButtonsDisbaled:function(A){this.save.disabled=A;this.send.disabled=A;this.deleteB.disabled=A||this.isCreateMode},hide:function(){if(this.element!=null){if(this.visible){var A;if(typeof this.container=="string"){A=document.getElementById(this.container)}else{A=container}A.removeChild(this.element)}this.showSelectBoxes();this.fromTime.hide();this.toTime.hide()}this.visible=false},doIncludeAddress:function(){var A="none";if(this.addressFlag.element.checked){A=""}this.city.element.parentNode.style.display=A;this.street.element.style.display=A;this.state.element.parentNode.style.display=A;this.zip.element.parentNode.style.display=A},doReminderFlagChange:function(){var A="none";if(this.reminderFlag.element.checked){A="none"}},doRepeatFlagChange:function(){var A="none";if(this.repeatFlag.element.checked){A="";this.repeatFlag.setValue(true);this.obj.repeatFlag=true}this.repeatBlock.style.display=A},timeChanged:function(D,C,A){if(D==this.fromTime){var C=parseInt(C);var A=parseInt(A);var B=parseInt(this.toTime.getValue());var B=C+(B-A);if(B>=1440){B=B-1440}else{if(B<0){B=1440+B}}this.toTime.setValue(B)}if(this.timeFlag!=null){this.timeFlag.setValue("true");this.obj.timeFlag="true";this.noTimeFlag.setValue("false");this.obj.noTimeFlag="false";this.timeFlag.element.checked}this.setStartEnd()},doNext:function(){this.htmlTab.next()},doPrevious:function(){this.htmlTab.previous()},postCreate:function(A){if(this.timeFlag!=null){this.timeFlag.setValue(true);this.fromTime.setValue("480");this.toTime.setValue("510")}},setObj:function(F,G,D,C,E,B){this.scheduleOn=E;this.savedRepeatFlag=F.repeatFlag;this.actualDate=C;this.saveStartDate=F.startDT;if(C!=null&&C!=-1){var A=new Date(C);F.startDT=C}this.isCreateMode=G;this.obj=F;this.originalSch=D;if(this.editor!=null){this.mySetObj(B)}},close:function(A){if(this.obj!=null){this.obj.startDT=this.saveStartDate}if(this.handler!=null&&this.closeDialog){this.handler.closeDialog(this)}else{this.hide()}},mySetObj:function(C){this.findSelectedScheduleType();this.setFieldsState();var E=true;var A="";if(this.index_S_Sch>-1||this.index_C_Sch>-1){this.additionalSchedule.style.display="none";if(this.index_C_Sch>-1){E=false;A="none"}}else{this.additionalSchedule.style.display=""}this.drivingTab.style.display=A;this.guestTab.style.display=A;this.htmlTab.validityFlags.drivingTab=E;this.htmlTab.validityFlags.guestTab=E;var G;G=this.obj.addnlSchedules;this.referenceSchedules=new Array();if(G!=null){this.addlScheduleList=G.split(",");for(var B=0;B<this.addlScheduleList.length;B++){this.addlScheduleList[B]=trim(this.addlScheduleList[B]);this.referenceSchedules.push(this.addlScheduleList[B])}}else{this.addlScheduleList=new Array()}var D=trim(this.obj.driver1);if(D!=""){this.referenceSchedules.push(D)}D=trim(this.obj.driver2);if(D!=""){this.referenceSchedules.push(D)}if(this.obj.repeatUntil==null){this.obj.repeatUntil=this.obj.endDT}this.htmlTab.showTab(0);this.obj.displayName=inputDisplay(this.obj.displayName);this.obj.message1=inputDisplay(this.obj.message1);this.obj.locationName=inputDisplay(this.obj.locationName);if(this.isCreateMode&&this.obj.displayName==null){this.timeFlag.setValue(true);this.defaultEventName="New Event";this.nameComp.setValue("New Event");this.obj.displayName=this.nameComp.getValue();this.obj.timeFlag=true}else{}if(this.obj.fromTime==null){this.obj.fromTime="480"}if(this.obj.toTime==null){this.obj.toTime="510"}var D=trim(this.obj.message1);if(D!=null&&D==""){this.obj.message1=this.defaultMessage1;this.message1.setValue(this.defaultMessage1)}else{if(D!=null){D=inputDisplay(D);this.obj.message1=D;this.message1.setValue(D)}}D=trim(this.obj.emails);if(D==""||D==undefined){this.obj.emails=this.defaultEmailMessage;this.emails.value=this.defaultEmailMessage}else{}this.fromTime.setValue(this.obj.fromTime);this.toTime.setValue(this.obj.toTime);if(this.obj.people==null){createOneToManyAssoc(this.obj,"people","Person")}if(this.obj.group==null){createOneToManyAssoc(this.obj,"group","Group")}this.setMyListsOptions();this.editor.setValueFromObj(this.obj);if(this.originalSch!=null){this.scheduleSelect.setValue(this.originalSch.UUID)}if((this.obj.driver1==null||this.obj.driver1=="")&&(this.obj.driver2==null||this.obj.driver2=="")){this.driverAssgined.element.checked=false}else{this.driverAssgined.element.checked=true}D="";var F=this.getDriverObject(this.obj.driver1);if(F!=null){if(F.__className=="Person"){D=getFullName(F)}else{D=F.name}}else{D=this.obj.driver1Name;if(D==null){D=""}}this.driver1Name.innerHTML=D;D="";F=this.getDriverObject(this.obj.driver2);if(F!=null){if(F.__className=="Person"){D=getFullName(F)}else{D=F.name}}else{D=this.obj.driver2Name;if(D==null){D=""}}this.driver2Name.innerHTML=D;this.driverAssginedCheckChanged();this.updatePanelState();this.updateRSVPResult();this.doIncludeAddress();this.doReminderFlagChange();this.doRepeatFlagChange();this.updateDueToStDt();this.updateRepeatStat();this.updateInviteesList();this.updateAddlScheduleList();if(!this.driverAssgined.element.checked){var D=this.htmlTab.getSelectedTab();if(D=="drivingTab"){this.htmlTab.showTab(0)}}this.saveCurrentValues();D="";if(this.driver1Name.innerHTML!=""){D=this.driver1Name.innerHTML}if(this.driver2Name.innerHTML!=D){if(D==""){D="schedule "+this.driver2Name.innerHTML}else{D="schedules "+D+" & "+this.driver2Name.innerHTML}}else{if(D==""){D="schedule "+D}}if(this.scheduleOn!=null&&D!=""){var D='There is driving time assigned on "'+D+'" for this event.';showMessageDialog(D,"Driving Calendar!",300,100)}if((C!=null)&&(C==true)){this.htmlTab.showTab(2)}},updateRepeatStat:function(){if(this.obj.repeatType==null){this.obj.repeatType="ED"}var B=new Af.ElementCollection(this.element);for(var C=0;C<=6;C++){D=B.getFirstElementById("subTypeDay"+C);D.checked=false}var A=this.obj.repeatType;this.repeatType.value=A;if(A=="MORE"){var G=this.obj.repeatSubtype;if(G==null){G=""}var F=B.getFirstElementById("subType1Checked");var E=B.getFirstElementById("subType2Checked");var D;F.checked=false;E.checked=false;D=B.getFirstElementById("subType2Value");D.value="";if(G.indexOf("REPEAT")==0){D=B.getFirstElementById("subType2");E.checked=true;D.value=G;D=B.getFirstElementById("subType2Value");D.value=this.obj.repeatNumber;for(var C=0;C<=6;C++){D=B.getFirstElementById("subTypeDay"+C);D.checked=false}}else{if(G!="None"){D=B.getFirstElementById("subType1");F.checked=true;D.value=G;var H=this.obj.repeatNumber;if(H==null){H=0}for(var C=0;C<=6;C++){D=B.getFirstElementById("subTypeDay"+C);D.checked=(H&(1<<C))!=0}}}}this.repeatTypeChanged()},retrieveRepeatState:function(){var B;if(this.index_S_Sch==-1&&this.index_C_Sch==-1){B=this.repeatType.value}else{return }this.obj.repeatType=B;this.editor.addNV("repeatType",B);if(B=="MORE"){var C=new Af.ElementCollection(this.element);var G=C.getFirstElementById("subType1Checked");var F;if(G.checked){F=C.getFirstElementById("subType1");this.editor.addNV("repeatSubtype",F.value);this.obj.repeatSubtype=F.value;var H=0;for(var D=6;D>=0;D--){F=C.getFirstElementById("subTypeDay"+D);if(F.checked){H=H|(1<<D)}}this.obj.repeatNumber=H;this.editor.addNV("repeatNumber",H)}else{var E=C.getFirstElementById("subType2Checked");F=C.getFirstElementById("subType2");if(E.checked){this.obj.repeatSubtype=F.value}else{this.obj.repeatSubtype="None"}this.editor.addNV("repeatSubtype",this.obj.repeatSubtype);F=C.getFirstElementById("subType2Value");var H=1;try{H=parseInt(F.value);if(isNaN(H)){H=1}}catch(A){H=1}this.obj.repeatNumber=H;this.editor.addNV("repeatNumber",H)}}},doPreview:function(){if(this.invitationDialog==null){this.invitationDialog=new HJ.EventInvitation("Invitation to:",this,null)}this.invitationDialog.showHTMLTemplate(basePageURL+"EventInvitation.htm","MainArea","eventInvitation");this.invitationDialog.setObj(this.obj)},doSend:function(){if(!this.isValidOperation()){return }var C=(new Date()).getTime();var E;if(this.obj.repeatFlag+""=="true"&&this.index_S_Sch==-1&&this.index_C_Sch==-1){E=parseInt(this.obj.repeatUntil)}else{E=parseInt(this.obj.startDT)}if(this.obj.noTimeFlag+""=="true"){E=new Date(E);E.setHours(23);E=E.getTime()}if(E<C){showMessageDialog("You cannot invite guests to this event, as its date has passed.","Excuse us!",300,100);return }var F="";this.invalidEmails="";var A=this.emails.value.split(",");if(A.length==1){A=A[0].split(";")}if(this.emails.value!=this.defaultEmailMessage){for(var B=0;B<A.length;B++){var D=trim(A[B]);if(!app.emailValidator.validateEmail(D)){if(D!=""){if(this.invalidEmails==""){this.invalidEmails+=D}else{if(this.invalidEmails.indexOf(D)==-1){this.invalidEmails+=","+D}}}continue}if(D!=""){D=app.emailValidator.extractEmailAddress(D);if(F==""){F+=D}else{if(F.indexOf(D)<0){F+=","+D}}}}}this.inviteeEmails.setValue(F);this.doSave("sendInvitation");this.emails.value=this.defaultEmailMessage;this.obj.emails=this.defaultEmailMessage;GATrackEvent("sendInvitation")},doSaveStep1:function(){if(this.index==-1){var A=this.scheduleSelect.getValue();if(this.originalSch!=null&&A==this.originalSch.UUID){this.isValidOperation();return }}if(this.isPastEvent()){return }if(this.savedRepeatFlag!=null){var B=this.savedRepeatFlag.toString();if(B=="true"){this.editor.addNV("repeatFlag","true");if(this.obj.UUID!=null){this.openRepeatEvtDialog()}else{showMessageDialog("Until Date should be greater than current date.<br/>Please select next comming date.","Request",350,120)}return }}if(this.resendRequired()){if(this.isPastEvent()){return }this.openConfirmDialog()}else{this.doSave()}},openRepeatEvtDialog:function(){if(this.repeatDialog!=null){delete this.repeatDialog}var A={templateLoaded:function(){this.parent.repeatDialogLoaded()},parent:this};if((this.index_S_Sch>-1||this.index_C_Sch>-1)&&this.index==-1){this.repeatDialog=new Af.HtmlDialog("Copy Repeat Event",A,null);this.repeatDialog.showHTMLTemplate(basePageURL+"RepeatEventCopyDialog.htm","MainArea","repeatEventContent");this.copyRepeatEventAction=true}else{this.repeatDialog=new Af.HtmlDialog("Modify Repeat Event",A,null);this.repeatDialog.showHTMLTemplate(basePageURL+"RepeatEventDialog.htm","MainArea","repeatEventContent");this.copyRepeatEventAction=false}this.repeatDialog.centerDialog(350,350)},repeatDialogLoaded:function(){this.modifyThisOnly=document.getElementById("modifyThisOnly");this.modifyThisAndFuture=document.getElementById("modifyThisAndFuture");this.modifyAll=document.getElementById("modifyAll");this.cancelModBtn=document.getElementById("cancelModBtn");this.modifyThisOnly.onclick=this.doModifyThisOnly.bind(this);this.modifyThisAndFuture.onclick=this.doModifyThisAndFuture.bind(this);this.modifyAll.onclick=this.doModifyAll.bind(this);this.cancelModBtn.onclick=this.doCancelModDialog.bind(this)},doModifyThisOnly:function(){this.repeatDialog.hide();if(this.actualDate!=null){this.doSave("modifyInstance")}},doModifyThisAndFuture:function(){this.repeatDialog.hide();if(this.actualDate!=null){this.doSave("modifyThisAndFuture")}},doModifyAll:function(){this.repeatDialog.hide();this.doSave("modifyAll")},doCancelModDialog:function(){this.repeatDialog.hide()},openConfirmDialog:function(){if(this.confDialog!=null){delete this.confDialog}var A={templateLoaded:function(){this.parent.confirmDialogLoaded()},parent:this};this.confDialog=new Af.HtmlDialog("Notify Guests?",A,null);this.confDialog.showHTMLTemplate(basePageURL+"ConfirmDialog.htm","MainArea","confirmHTMLDailog");this.confDialog.centerDialog(350,350)},confirmDialogLoaded:function(){this.messageText=document.getElementById("messageText");this.sendButton=document.getElementById("sendButton");this.dontSendButton=document.getElementById("dontSendButton");this.sendButton.onclick=this.doSendChangeNotification.bind(this);this.dontSendButton.onclick=this.doDontSendChangeNotification.bind(this);this.messageText.innerHTML="Would you like to notify your guests of changes to this event?"},doSendChangeNotification:function(){this.confDialog.hide();this.doSaveStep2()},doDontSendChangeNotification:function(){this.confDialog.hide();this.doSave()},doSaveStep2:function(){this.doSave("resendEmail")},saveCurrentValues:function(){this._startDT=this.obj.startDT;this._endDT=this.obj.endDT;this._displayName=this.obj.displayName;this._locationName=this.obj.locationName;this._city=this.obj.city;this._state=this.obj.state;this._zip=this.obj.zip},resendRequired:function(){var A=this.obj.rsvp;if(A!=null&&A.length>0){if(this._startDT!=this.obj.startDT||this._endDT!=this.obj.endDT||this._displayName!=this.obj.displayName||this._locationName!=this.obj.locationName||this._city!=this.obj.city||this._state!=this.obj.state||this._zip!=this.obj.zip){return true}}return false},doSave:function(B){if(this.obj.repeatFlag+""=="true"&&B!="modifyInstance"){if(parseInt(this.obj.startDT)>=parseInt(this.obj.repeatUntil)){showMessageDialog('The "Until" date should be later than the first date of the repeating event. <BR/> Please select a different date.',"Invalid date selected",350,120);return }}if(this.obj.repeatFlag+""=="true"&&B!="doDelete"&&(this.obj.people.length!=0||this.obj.group.length!=0||this.obj.rsvp.length!=0||this.emails.value!=this.defaultEmailMessage)){showMessageDialog("You cannot invite guests for a repeating event.<BR />Please uncheck 'Repeat Event' checkbox in 'Basic' tab before saving or sending this event","Invalid Action",350,120);return }this.addlAction=B;this.obj.displayName=this.obj.displayName;var K=xmlEncode(this.obj.displayName);K=trim(K);if(K==""){showMessageDialog("Please enter a title for this event.","Request",300,100);return }if(B=="sendInvitation"){this.IsInvitationSent=true}else{this.IsInvitationSent=false}if(this.originalSch!=null){app.deleteEventReferences(this.referenceSchedules,this.originalSch,this.obj)}this.referenceSchedules.length=0;var M="";for(var E=0;E<this.addlScheduleList.length;E++){this.referenceSchedules.push(this.addlScheduleList[E]);if(M==""){M=this.addlScheduleList[E]}else{M+=","+this.addlScheduleList[E]}}this.obj.addnlSchedules=M;this.editor.addNV("addnlSchedules",M);M=trim(this.obj.driver1);if(M!=""){this.referenceSchedules.push(M)}M=trim(this.obj.driver2);if(M!=""){this.referenceSchedules.push(M)}M=this.obj.deletedSeqs;if(M!=null){this.editor.addNV("deletedSeqs",M)}var D=this.workspace.schedule;if(D.length==0){showMessageDialog("Please add a Calendar in My Calendars","Request",300,100);return }var A;A=D[this.scheduleSelect.element.selectedIndex];if(A.event==null){createOneToManyAssoc(A,"event","Event")}if(this.isCreateMode){initializeCreatedObject(A.event,this.obj);A.event.push(this.obj)}else{if(this.originalSch!=null&&A!=this.originalSch){if(this.index_S_Sch==-1&&this.index_C_Sch==-1&&this.originalSch.event!=null){deleteFromArray(this.originalSch.event,this.obj)}A.event.push(this.obj)}}if(B=="sendInvitation"){this.obj.inviteStatus="invited";app.invitation.invitationSent(this.obj)}if(this.obj.driver1!=null){this.editor.addNV("driver1",this.obj.driver1)}if(this.obj.driver2!=null){this.editor.addNV("driver2",this.obj.driver2)}var L=this.repeatUntil.getValue();var C=new Date(L);C.setHours(23,59,59);L=C.getTime();this.editor.addNV("repeatUntil",""+L);this.editor.addNV("timeFlag",this.timeFlag.element.checked);this.editor.addNV("noTimeFlag",this.noTimeFlag.element.checked);this.editor.addNV("displayName",this.obj.displayName);this.retrieveRepeatState();M=this.obj.minuteBefore1;try{var H=parseInt(M);if(isNaN(H)){M="0"}}catch(G){M="0"}this.minuteBefore1.setValue(M);M=this.obj.minuteBefore2;try{var H=parseInt(M);if(isNaN(H)){M="0"}}catch(G){M="0"}this.minuteBefore2.setValue(M);var F=this.editor.getChangeXmlForObjList(this.obj.people,["name"],"people");F+=this.editor.getChangeXmlForObjList(this.obj.group,["name"],"group");var I=this.editor.getChangeXml(this.isCreateMode,F);if(I==null){showMessageDialog("Any changes you have made will be saved.","Informing You",300,100);return }if(this.addlAction!="doDelete"){showMessageDialog("Saving ... please wait ...","Saving",300,120)}this.hide();var J=new Af.DataRequest(svcURL,this.saveSuccessful.bind(this),this.saveFailed.bind(this),null,this.saveTimedOut.bind(this));J.addService("WorkspaceService","saveEventDetails");J.addParameter("parentId",A.UUID);this.obj.scheduleId=A.UUID;if(this.originalSch!=null&&A!=this.originalSch){J.addParameter("oldParent",this.originalSch.UUID)}if(this.obj.UUID!=null){J.addParameter("UUID",this.obj.UUID)}if(B!=null){J.addParameter("addlAction",B)}if(this.actualDate!=null){J.addParameter("actualDate",this.actualDate)}J.xmlDoc=I;this.prevOriginalSch=this.originalSch;this.originalSch=A;ajaxEngine.processRequest(J)},doDontSave:function(){this.editor.clearChanges()},saveSuccessful:function(G){var E=new Af.XMLToDataSet(G.responseXML);var I=E.data;var B=this.originalSch;if(this.originalSch.selected){app.schedule.selectScheduleAndRefresh(this.originalSch)}if(this.prevOriginalSch!=null&&this.prevOriginalSch.selected){app.schedule.selectScheduleAndRefresh(this.prevOriginalSch)}if(this.obj.UUID==null&&I!=null&&I!=undefined){this.obj.UUID=I.UUID}var F=I.people;if(F!=null){var K=this.workspace.myPeople;for(var H=0;H<F.length;H++){var D=F[H];D.__parent=K.__parent;K.push(D)}}app.updateEventReferences(this.originalSch,this.obj);app.schedule.miniCalendar.updateMiniCalendar(this.obj);if(this.IsInvitationSent&&this.addlAction!="doDelete"){if(this.invalidEmails!=""){showMessageDialog("The event details have been saved and invitations to your guests have been sent and these are the emails to whom emails cannot be sent:<BR/>"+this.invalidEmails,"Success !",450,120)}else{showMessageDialog("The event details have been saved and invitations to your guests have been sent.","Success !",300,120)}this.indvslSelectionList.innerHTML="";this.groupSelectionList.innerHTML="";this.emails.value=this.defaultEmailMessage;this.obj.people.length=0;this.obj.group.length=0;var J=I.rsvp;if(J!=null){if(this.obj.rsvp==null){createOneToManyAssoc(this.obj,"rsvp","RSVP")}var C=this.obj.rsvp;for(var H=0;H<J.length;H++){var A=J[H];A.__parent=C.__parent;C.push(A)}this.updateRSVPResult()}}else{if(this.addlAction!="doDelete"){if(this.obj.people.length!=0||this.obj.group.length!=0||this.emails.value!=this.defaultEmailMessage){showMessageDialog("Your event details have been saved.<br/> However, no invitation has been sent to your newly invited guests.<br/>Please click SEND at the bottom of the Guest tab when you would like the invitation sent. ","Request",330,130)}else{if(this.addlAction=="resendEmail"){showMessageDialog("Your event details have been saved.  A notification of the event changes has been sent to your guests.","Success",300,120)}else{showMessageDialog("Your event details have been saved.","Success",300,120)}}}}if(this.addlAction=="doDelete"){showMessageDialog("Event deleted successfully.","Success",300,120)}this.IsInvitationSent=false;this.editor.clearChanges();app.schedule.selectScheduleAndRefresh(this.originalSch);this.saveCurrentValues();app.schedule.eventChanged(this.obj,false);this.obj=null},saveFailed:function(A,B){showMessageDialog("We are currently unable to save these event details.  Please try again.","Excuse us!",400,130)},saveTimedOut:function(A){showMessageDialog("A bit of network congestion has caused a delay.  Nonetheless, be assured that your notification has been sent.","Excuse us!",400,150)},selectPeople:function(){if(!this.isValidOperation()){return false}this.pgSelector=getPoepleGroupSelector(this);this.pgSelector.element.style.zIndex="500001";this.pgSelector.setDataList(app.workspace.myGroup,app.workspace.myPeople,this.obj.group,this.obj.people);return false},setMyListsOptions:function(){var A=this.workspace.myList;A=A.slice(0,A.length);var B=new Object();B.name="------";B.UUID="_separator1";A.unshift(B);B=new Object();B.name="Choose from My Lists";B.UUID="_choose_from_my_lists";A.unshift(B);this.taskList.setData(A)},setDriverOptions:function(D){var B=this.workspace.schedule;B=B.slice(0,B.length);var E=new Object();E.name="------";E.__fullId="_separator1";B.unshift(E);E=new Object();E.name="My Schedule";E.__fullId="_choose_from_my_schedule_2";B.unshift(E);E=new Object();E.name="Choose";E.__fullId="_choose_from_my_schedule_1";B.unshift(E);E=new Object();E.name="-------------";E.__fullId="_separator2";B.push(E);E=new Object();E.name="Choose from My People";E.__fullId="_choose_from_my_people";B.push(E);E=new Object();E.name="------";E.__fullId="_separator3";B.push(E);var A=this.workspace.myPeople;for(var C=0;C<A.length;C++){B.push(A[C])}D.setData(B)},setStartEnd:function(){var D=this.date.getValue();var H=new Date(D);H=this.setTxtBoxEntryDate(H);if(this.timeFlag.getValue()=="false"){H.setHours(0,0,0,0);D=H.getTime();this.obj.startDT=D;this.editor.addNV("startDT",D);H.setHours(24,0,0,0);D=H.getTime();this.obj.endDT=D;if(this.repeatUntil.getValue()<D){}this.editor.addNV("endDT",D);this.updateAllDateTimes();return true}this.obj.fromTime=this.fromTime.getValue();this.obj.toTime=this.toTime.getValue();this.editor.addNV("fromTime",this.obj.fromTime);this.editor.addNV("toTime",this.obj.toTime);var C=parseInt(this.fromTime.getValue());var B=parseInt(this.toTime.getValue());var F=Math.floor(C/60);var A=Math.floor(C%60);H.setHours(F,A,0,0);var G=H.getTime();H=new Date(D);F=Math.floor(B/60);A=Math.floor(B%60);H.setHours(F,A,0,0);var E=H.getTime();if(E<G){E=new Date(E);E.setDate(E.getDate()+1);E=E.getTime()}this.obj.startDT=G;this.obj.endDT=E;this.editor.addNV("startDT",G);this.editor.addNV("endDT",E);if(this.repeatUntil.getValue()<E){this.repeatUntil.setValue(E)}this.updateAllDateTimes();return true},setTxtBoxEntryDate:function(D){var A=this.startDTBox.value;if(A==null){A=""}var C=A.split(" ");var B=(new Date()).getYear();if(C!=null&&C.length>3){B=C[(C.length)-1];D.setYear(B)}for(i=0;i<months.length;i++){if(A.match(months[i])||A.match(monthsShort[i])){D.setMonth(i);return D}}return D},updateAllDateTimes:function(){var B=new Date(this.obj.startDT);var A=months[B.getMonth()]+" "+B.getDate()+" - ";A+=getDisplayTimeFromMins(this.obj.fromTime)+" to "+getDisplayTimeFromMins(this.obj.toTime);this.drivingTabEventDtTime.innerHTML=A;A="<strong>"+this.obj.displayName+"</strong><br/>";A+="Date: "+months[B.getMonth()]+" "+B.getDate()+"<br/>";A+="Time: "+getDisplayTimeFromMins(this.obj.fromTime)+" to "+getDisplayTimeFromMins(this.obj.toTime)+"<br/>";this.listTabEventDetail.innerHTML=A},deleteEventConfirm:function(){if(this.originalSch==null){this.editor.clearChanges();this.hide();return }if(!this.isValidOperation()){return false}var D=(new Date()).getTime();var C=parseInt(this.obj.endDT);if((this.obj.rsvp==null||this.obj.rsvp=="")){var A=this.savedRepeatFlag;if(A!=null){A=A.toString()}if(A=="true"){this.openDelRepeatEvtDialog()}else{showConfirmDialog("Are you sure you want to delete this event?","Are You Sure?",300,100,this.doDeleteEvent.bind(this))}}else{if(this.deleteCnfrmDialog!=null){delete this.deleteCnfrmDialog}var B={templateLoaded:function(){this.parent.deleteCnfrmDialogLoaded()},parent:this};this.deleteCnfrmDialog=new Af.HtmlDialog("Notify Guests?",B,null);this.deleteCnfrmDialog.showHTMLTemplate(basePageURL+"DeleteEventCnfrmDialog.htm","MainArea","DeleteEventCnfrmContent");this.deleteCnfrmDialog.centerDialog(100,100)}return false},openDelRepeatEvtDialog:function(){if(this.delRepeatDialog!=null){delete this.delRepeatDialog}var A={templateLoaded:function(){this.parent.delRepeatDialogLoaded()},parent:this};this.delRepeatDialog=new Af.HtmlDialog("Delete Repeat Event",A,null);this.delRepeatDialog.showHTMLTemplate(basePageURL+"DelRepeatEventDialog.htm","MainArea","delRepeatEventContent");this.delRepeatDialog.centerDialog(350,350)},delRepeatDialogLoaded:function(){this.deleteThisOnly=document.getElementById("deleteThisOnly");this.deleteThisAndFuture=document.getElementById("deleteThisAndFuture");this.deleteAll=document.getElementById("deleteAll");this.cancelDelBtn=document.getElementById("cancelDelBtn");this.deleteThisOnly.onclick=this.doDeleteThisOnly.bind(this);this.deleteThisAndFuture.onclick=this.doDeleteThisAndFuture.bind(this);this.deleteAll.onclick=this.doDeleteAll.bind(this);this.cancelDelBtn.onclick=this.doCancelDelDialog.bind(this)},doDeleteThisOnly:function(){this.delRepeatDialog.hide();if(this.actualDate!=null){appendDeleteSeq(this.obj,this.actualDate);this.date.setValue(parseInt(this.saveStartDate));this.obj.startDT=this.saveStartDate;this.doSave("doDelete")}},doDeleteThisAndFuture:function(){this.delRepeatDialog.hide();if(this.actualDate!=null){var A=new Date(this.actualDate);A.setDate(A.getDate()-1);this.obj.repeatUntil=A.getTime();this.repeatUntil.setValue(A.getTime());this.date.setValue(parseInt(this.saveStartDate));this.obj.startDT=this.saveStartDate;this.doSave("doDelete")}},doDeleteAll:function(){this.delRepeatDialog.hide();deleteFromArray(this.originalSch.event,this.obj);this.deleteEvent()},doCancelDelDialog:function(){this.delRepeatDialog.hide()},deleteCnfrmDialogLoaded:function(){this.dontDeleteBtn=document.getElementById("dontDelete");this.deleteNoNoticeBtn=document.getElementById("deleteNoNotice");this.deleteSendNoticeBtn=document.getElementById("deleteSendNotice");this.dontDeleteBtn.onclick=this.dontDeleteEvent.bind(this);this.deleteNoNoticeBtn.onclick=this.doDelEventNoNotice.bind(this);this.deleteSendNoticeBtn.onclick=this.doDelEventSendNotice.bind(this)},dontDeleteEvent:function(){this.deleteCnfrmDialog.hide()},doDelEventNoNotice:function(){this.deleteCnfrmDialog.hide();deleteFromArray(this.originalSch.event,this.obj);this.deleteEvent()},doDelEventSendNotice:function(){this.deleteCnfrmDialog.hide();deleteFromArray(this.originalSch.event,this.obj);this.deleteEvent("sendNotify")},doDeleteEvent:function(){hideDialogWin();deleteFromArray(this.originalSch.event,this.obj);this.deleteEvent()},deleteEvent:function(B){this.hide();if(this.obj.UUID==null||this.originalSch.UUID==null){return }var A=new Af.DataRequest(svcURL,this.requestDeleteEventCompleted.bind(this),this.requestFailedCommon.bind(this),null,this.requestTimedoutCommon.bind(this));A.addService("WorkspaceService","deleteEvent");A.addParameter("parentId",this.originalSch.UUID);A.addParameter("UUID",this.obj.UUID);if(B!=null){A.addParameter("action",B)}ajaxEngine.processRequest(A)},requestDeleteEventCompleted:function(A){if(this.obj.inviteStatus=="invited"){var B=findObjIndex(this.workspace.invitation,this.obj);if(B>-1){deleteFromArray(this.workspace.invitation,this.obj);app.invitation.setDataList(this.workspace.invitation)}}this.editor.clearChanges();app.schedule.shownScheduleListChanged();app.schedule.eventChanged(this.obj,true)},requestFailedCommon:function(A,B){showMessageDialog("We are currently unable to delete this event.  Please try again.","Excuse us!",350,100)},requestTimedoutCommon:function(A){showMessageDialog("We are currently unable to delete this event.  Please try again.","Excuse us!",350,100)},valueChanged:function(A,C,B,D){if(this.taskList==A){this.updatePanelState()}else{if(this.date==A){this.updateDueToStDt()}}},driverAssginedCheckChanged:function(){if(this.index_C_Sch>-1){return }if(this.driverAssgined.element.checked){this.drivingTab.style.display="";this.htmlTab.validityFlags.drivingTabContent=true}else{this.drivingTab.style.display="none";this.htmlTab.validityFlags.drivingTabContent=false;this.obj.driver1="";this.obj.driver2=""}},updatePanelState:function(){var A=this.workspace.myList;var B=findObjById(A,this.obj.taskList);if(B==null){this.eventTaskListContainer.style.display="none"}else{this.eventTaskListContainer.style.display="";this.myOneList.setMyOneList(B)}},updateDueToStDt:function(){var B=this.repeatType.value;removeAll(this.repeatType);var E=this.date.getValue();E=new Date(E);var A=this.dateUtil.getRepeatList(E);for(var C=0;C<A.length;C++){var D=A[C];var F=document.createElement("option");F.value=D.value;F.label=D.label;F.appendChild(document.createTextNode(D.label));this.repeatType.appendChild(F)}this.repeatType.value=B;this.setStartEnd()},repeatTypeChanged:function(){if(this.repeatType.value=="MORE"){this.subTypeTable.style.display=""}else{this.subTypeTable.style.display="none"}},doAddNewMyList:function(A){if(this.dialog==null){this.dialog=new HJ.AddMyListDialog("New MyList",this,null,"500001")}this.dialog.showHTMLTemplate(basePageURL+"AddMyList.html","content","newMyList");this.dialog.centerDialog(400,280);return false},myListCreated:function(A){this.setMyListsOptions();this.taskList.setValue(A);this.obj.taskList=A;this.updatePanelState()},doSelectDriver1:function(){this.selectInfo=1;this.pSelector=getPoepleScheduleSelector(this);this.pSelector.setDataList(app.workspace.schedule,app.workspace.myPeople,this.obj.driver1);return false},doSelectDriver2:function(){this.selectInfo=2;this.pSelector=getPoepleScheduleSelector(this);this.pSelector.setDataList(app.workspace.schedule,app.workspace.myPeople,this.obj.driver2);return false},doDeleteDriver1:function(){if(this.obj.UUID==null){return }if(this.obj.driver1!=null&&this.obj.driver1!=""){var A=new Af.DataRequest(svcURL,this.deleteDriver1Successful.bind(this),this.deleteDriverFailed.bind(this),null,this.deleteDriverTimedOut.bind(this));A.addService("WorkspaceService","deleteDriver");if(this.obj.UUID!=null){A.addParameter("eventId",this.obj.UUID)}A.addParameter("driverType","driver1");ajaxEngine.processRequest(A)}},setCheckedUncheked:function(){if((this.obj.driver1==null||this.obj.driver1=="")&&(this.obj.driver2==null||this.obj.driver2=="")){this.driverAssgined.element.checked=false}else{this.driverAssgined.element.checked=true}},deleteDriver1Successful:function(){this.minuteBefore1.setValue("0");this.obj.minuteBefore1="0";this.obj.driver1=null;this.driver1Name.innerHTML="";this.setCheckedUncheked();showMessageDialog("The assigned driver has been successfully deleted.","Deletion Successful!",350,100)},deleteDriverFailed:function(){showMessageDialog("We are currently unable to delete this driver.  Please try again.","Excuse us!",350,100)},deleteDriverTimedOut:function(){showMessageDialog("We are currently unable to delete this driver.  Please try again.","Excuse us!",350,100)},deleteDriver2Successful:function(){this.obj.driver2=null;this.minuteBefore2.setValue("0");this.obj.minuteBefore2="0";this.driver2Name.innerHTML="";this.setCheckedUncheked();showMessageDialog("The assigned driver has been successfully deleted.","Deletion Successful!",350,100)},doDeleteDriver2:function(){if(this.obj.UUID==null){return }if(this.obj.driver2!=null&&this.obj.driver2!=""){var A=new Af.DataRequest(svcURL,this.deleteDriver2Successful.bind(this),this.deleteDriverFailed.bind(this),null,this.deleteDriverTimedOut.bind(this));A.addService("WorkspaceService","deleteDriver");if(this.obj.UUID!=null){A.addParameter("eventId",this.obj.UUID)}A.addParameter("driverType","driver2");ajaxEngine.processRequest(A)}},doSelectAddlSchedules:function(){this.selectInfo=2;this.scheduleSelector=getScheduleSelector(this);this.scheduleSelector.setDataList(app.workspace.schedule,this.addlScheduleList);return false},getDriverObject:function(B){if(B==null){return null}var A=findObjById(app.workspace.schedule,B);if(A==null){A=findObjById(app.workspace.myPeople,B)}return A},selectionDone:function(A,D){if(this.pgSelector==A){this.updateInviteesList()}else{if(this.pSelector==A){var C="";var B="";if(D!=null){if(D.__className=="Person"){C=getFullName(D)}else{C=D.name}B=D.UUID}if(this.selectInfo==1){this.obj.driver1=B;this.driver1Name.innerHTML=C}else{if(this.selectInfo==2){this.obj.driver2=B;this.driver2Name.innerHTML=C}}}else{if(this.scheduleSelector==A){this.updateAddlScheduleList()}}}},updateInviteesList:function(){this.indvslSelectionList.innerHTML=getPeopleNames(this.obj.people);this.groupSelectionList.innerHTML=getGroupsPeople(this.obj.group)},updateAddlScheduleList:function(){s="";var A=app.workspace.schedule;for(var B=0;B<this.addlScheduleList.length;B++){var C=findObjById(A,this.addlScheduleList[B]);if(C!=null){if(s==""){s=C.name}else{s+="<br/>"+C.name}}}this.additionalScheduleList.innerHTML=s},rsvpTabSelected:function(A){this.rsvpTabs[this.rsvpIndex].style.backgroundColor=this.rsvpTab1BC;this.rsvpIndex=A;this.rsvpTabs[this.rsvpIndex].style.backgroundColor=this.rsvpTab0BC;this.showRSVPResult()},updateRSVPResult:function(){if(this.obj.rsvp==null){createOneToManyAssoc(this.obj,"rsvp","RSVP")}var D=this.obj.rsvp;var C=new Array();var I=0;var G=0;var B=0;var H=0;if(this.index>-1){for(var E=0;E<D.length;E++){var A=D[E];p=findObjById(app.workspace.myPeople,A.inviteeId);if(p==null){continue}A.fullName=(""==trim(getFullName(p))?p.email:getFullName(p));var F;if(A.type=="yes"){F="("+A.num+")";G+=parseInt(A.num)}else{if(A.type=="no"){F="(No)";B++}else{F="(?)";H++}}A.result=F;C.push(A);I++}}else{for(var E=0;E<D.length;E++){var A=D[E];A.fullName=A.PersonName;var F;if(A.type=="yes"){F="("+A.num+")";G+=parseInt(A.num)}else{if(A.type=="no"){F="(No)";B++}else{F="(?)";H++}}A.result=F;C.push(A);I++}}this.totalId.innerHTML=""+I;this.noResponseId.innerHTML=""+H;this.yesId.innerHTML=""+G;this.noId.innerHTML=""+B;this["__rsvp"]=C;this.showRSVPResult()},showRSVPResult:function(){var B=this["__rsvp"];var A;if(this.rsvpIndex==0){A=B}else{A=new Array();var D=null;if(this.rsvpIndex==1){D="yes"}else{if(this.rsvpIndex==2){D="no"}}for(var C=0;C<B.length;C++){if(B[C].type==D){A.push(B[C])}}}this.inviteesTable.setDataList(A)},tabSelected:function(A,B){if(A==0){this.previous.style.display="none"}else{this.previous.style.display=""}if(B=="guestTab"){this.send.style.display="";this.updateRSVPResult();GATrackEvent("selectInviteGuestsTab")}else{this.send.style.display="none"}if(B=="basicTab"&&!this.titleCursor.disabled){if(this.titleCursor!=null&&this.isCreateMode){this.titleCursor.onfocus=this.focusOnNameTextBox.bindAsEventListener(this);this.titleCursor.onblur=this.focusLostNameTextBox.bindAsEventListener(this);this.defaultEventName=this.titleCursor.value}}else{if(B=="guestTab"){}}},findSelectedScheduleType:function(){if(this.originalSch==null){this.index_S_Sch=-1;this.index_C_Sch=-1;this.index=-1}else{this.index_S_Sch=findObjIndex(this.workspace.sharedSchedule,this.originalSch);this.index_C_Sch=findObjIndex(this.workspace.communitySchedule,this.originalSch);this.index=findObjIndex(this.workspace.schedule,this.originalSch)}if(this.scheduleSelect==null){return }if(this.index==-1){var B=new Array();var D=this.workspace.schedule;for(var A=0;A<D.length;A++){B.push(D[A])}if(this.originalSch!=null&&findObjIndex(B,this.originalSch)==-1){var C=B.push(this.originalSch)}this.scheduleSelect.setData(B)}else{this.scheduleSelect.setData(this.workspace.schedule)}if(this.originalSch!=null){this.scheduleSelect.setValue(this.originalSch.UUID)}},isValidOperation:function(){if(this.index_S_Sch>-1&&this.index==-1){showMessageDialog("This is an event in a shared calendar. You can't modify it.","Excuse us!",350,120);return false}else{if(this.index_C_Sch>-1&&this.index==-1){showMessageDialog("This is an event in a community calendar. You can't modify it.","Excuse us!",350,120);return false}}return true},isPastEvent:function(){if(this.obj==null){return false}var B=(new Date()).getTime();var A=parseInt(this.obj.startDT);if(this.obj.noTimeFlag+""=="true"){A=new Date(A);A.setHours(23);A=A.getTime()}if(A<B){if(this.obj.rsvp!=null&&this.obj.rsvp!=""){showMessageDialog("You are not allowed to move this event to a past date because you have already invited guests to this event.","Excuse us!",350,120);return true}else{if(this.obj.people.length!=0||this.obj.group.length!=0||this.emails.value!=this.defaultEmailMessage){showMessageDialog("You cannot invite guests to this event, as its date has passed.","Excuse us!",300,100);return true}}}return false},focusOnTextBox:function(A){var B=this.emails.value;if(B==null){B=""}else{B=trim(B)}if(B==trim(this.defaultEmailMessage)||B==""){this.emails.value="";consumeEvent(A)}this.emails.focus()},focusLostTextBox:function(A){var B=this.emails.value;if(B==null){B=""}else{B=trim(B)}if(B==trim(this.defaultEmailMessage)||B==""){this.emails.value=this.defaultEmailMessage;consumeEvent(A)}},focusOnNameTextBox:function(A){var B=this.titleCursor.value;if(B==null){B=""}else{B=trim(B)}if(B==trim(this.defaultEventName)||B==""){this.titleCursor.value="";consumeEvent(A)}this.titleCursor.focus()},focusLostNameTextBox:function(A){var B=this.titleCursor.value;if(B==null){B=""}else{B=trim(B)}if(B==trim(this.defaultEventName)||B==""){this.titleCursor.value=this.defaultEventName;consumeEvent(A)}}});HJ.MyLovedOne=Class.create();HJ.MyLovedOne.prototype={initialize:function(){this.targetContainerId="content";this.myLovedOneTable=new Af.HtmlTable("myLovedOneTable",",,fName");this.myLovedOneTable.listener=this;this.currentRow=-1;this.myLovedOneTitle=new Af.HtmlTitlePane2("myLovedOneTable","myLovedOneTitle","boxLink open","boxLink closed",this);this.myLovedOneTitle.listener=this;this.url=basePageURL+"MyLovedOne.html";this.tl=null;this.isCreateMode=true;this.editor=new Af.ObjEditor();this.obj=null;this.isTemplateLoaded=false;this.showInfo=0;this.postSaveMode="edit";this.addNew=false;this.prSelected=false;this.isPreviewClicked=false;this.createNewObjectOfType=""},cleanup:function(){this.myLovedOneTable.cleanup()},viewSelected:function(A){if(calenderTop==null){calenderTop=document.getElementById("calenderTop")}calenderTop.style.display="none";this.postSaveMode="edit";this.addNew=false;if(this.tl==null){var B=this.dataTable.getDataList().length;if(B==0){B=-1}else{B=0}this.cellSelected(B,0,false)}else{this.tl.reAttachElement();app.setCurrentView(this);this.doRefreshTemplate()}return false},setDataList:function(A){this.myLovedOneTable.setDataList(A);this.dataTable=new Af.DataTable(A);this.myLovedOneList=A},cellSelected:function(C,A,B){if(calenderTop==null){calenderTop=document.getElementById("calenderTop")}calenderTop.style.display="none";refreshWidget();this.postSaveMode="edit";this.addNew=false;if(C>=0&&C<this.dataTable.getDataList().length){this.currentRow=C;this.obj=this.dataTable.getDataList()[C]}else{this.currentRow=0;this.obj=new Object();this.obj.fName="New";initializeCreatedObject(this.dataTable.getDataList(),this.obj);this.dataTable.getDataList().push(this.obj);this.myLovedOneTable.setDataList(this.dataTable.getDataList())}this.myLovedOneTable.selectRow(this.currentRow);this.doInitAssociations();if(this.isTemplateLoaded){this.tl.reAttachElement();this.editor.clearChanges();this.editor.setValueFromObj(this.obj);this.doCleanContact();this.TitleName.innerHTML=this.obj.fName;this.setTitleAndValues()}else{this.loadLovedTemplate()}},doAddMyLoved:function(){this.postSaveMode="new";this.addNew=true;this.doCleanContact();this.obj=new Object();this.obj.fName="New";this.doInitAssociations();this.editor.setValueFromObj(this.obj);initializeCreatedObject(this.dataTable.getDataList(),this.obj);this.TitleName.innerHTML=this.obj.fName;this.setTitleAndValues();return false},doSaveMyLovedOne:function(){var A=this.editor.getChangeXmlForObjList(this.obj.contact1,["fName","lName","address","phone1","phone2","phone3","email"],"contact1");A+=this.editor.getChangeXmlForObjList(this.obj.contact2,["fName","lName","address","phone1","phone2","phone3","email"],"contact2");A+=this.editor.getChangeXmlForObjList(this.obj.friendContact1,["fName","lName","address","city","state","zip","phone1","phone2","phone3","email"],"friendContact1");A+=this.editor.getChangeXmlForObjList(this.obj.friendContact2,["fName","lName","address","city","state","zip","phone1","phone2","phone3","email"],"friendContact2");A+=this.editor.getChangeXmlForObjList(this.obj.doctor1,["fName","lName","businessName","phone","mobile","fax","email","address","city","state","zip"],"doctor1");A+=this.editor.getChangeXmlForObjList(this.obj.doctor2,["fName","lName","businessName","phone","mobile","fax","email","address","city","state","zip"],"doctor2");A+=this.editor.getChangeXmlForObjList(this.obj.insuranceCarrier,["fName","lName","businessName","phone","mobile","fax","email","address","city","state","zip"],"insuranceCarrier");this.xmlString=this.editor.getChangeXmlForObj(this.obj,["fName","lName","contact1Relation","contact2Relation","fContact1Relation","fContact2Relation","type1Doctor","type2Doctor","note1","note2","policyNumber"],"ObjModify",A);this.editor.clearChanges();this.myLovedOneTable.setDataList(this.dataTable.getDataList());if(this.isPreviewClicked){this.isPreviewClicked=false;this.showPrintPreviw();return }this.saveMyLovedOne();return },saveMyLovedOne:function(){var A=new Af.DataRequest(svcURL,this.saveSuccessful.bind(this),this.saveFailed.bind(this),null,this.saveTimedOut.bind(this));A.addService("WorkspaceService","saveMyLovedOne");if(this.obj.UUID!=null){A.addParameter("UUID",this.obj.UUID)}A.xmlDoc=this.xmlString;ajaxEngine.processRequest(A)},saveSuccessful:function(A){if(this.obj.UUID==null){this.obj.UUID=A.responseText}this.addNew=false;this.editor.clearChanges();if(this.postSaveMode=="new"){this.postSaveMode="edit";this.dataTable.getDataList().push(this.obj);this.TitleName.innerHTML=this.obj.fName;this.setTitleAndValues();this.currentRow=this.dataTable.getDataList().length-1}this.myLovedOneTable.setDataList(this.myLovedOneList);this.myLovedOneTable.selectRow(this.currentRow);this.viewSelected()},saveFailed:function(){showMessageDialog("We are currently unable to save this record.<br/>Please try again.","Excuse us!",300,100)},saveTimedOut:function(){showMessageDialog("We are currently unable to save this record.<br/>Please try again.","Request",300,100)},paneStateChanged:function(A){},loadLovedTemplate:function(){this.formatNotesParagraph();if(this.tl==null){this.tl=new Af.TemplateLoader(this.url,this.targetContainerId,"MyLovedContent");this.tl.listener=this;this.tl.loadTemplate()}else{this.tl.reAttachElement()}},templateLoaded:function(){this.myLoveNameTable=document.getElementById("myLoveNameTable");this.contact1RelationTable=document.getElementById("contact1RelationTable");this.contact2RelationTable=document.getElementById("contact2RelationTable");this.myLoveFriends1Table=document.getElementById("myLoveFriends1Table");this.myLoveFriends2Table=document.getElementById("myLoveFriends2Table");this.doctor1Table=document.getElementById("doctor1Table");this.doctor2Table=document.getElementById("doctor2Table");this.insuranceCarrierTable=document.getElementById("insuranceCarrierTable");this.notesTable=document.getElementById("notesTable");this.TitleName=document.getElementById("TitleName");this.includePrContact=document.getElementsByName("includePrmryContact");this.include2Contact=document.getElementsByName("include2Contact");this.includeFriend1=document.getElementsByName("includeFriend1");this.includeFriend2=document.getElementsByName("includeFriend2");this.include1Doctor=document.getElementsByName("include1Doctor");this.include2Doctor=document.getElementsByName("include2Doctor");this.includeIncCarrier=document.getElementsByName("includeIncCarrier");this.beforePerSelect=document.getElementById("beforePerSelect");this.afterPerSelect=document.getElementById("afterPerSelect");this.before2PerSelect=document.getElementById("before2PerSelect");this.after2PerSelect=document.getElementById("after2PerSelect");this.firend1Before=document.getElementById("firend1Before");this.firend1After=document.getElementById("firend1After");this.firend2Before=document.getElementById("firend2Before");this.firend2After=document.getElementById("firend2After");this.doctor1Before=document.getElementById("doctor1Before");this.doctor2Before=document.getElementById("doctor2Before");this.doctor1After=document.getElementById("doctor1After");this.doctor2After=document.getElementById("doctor2After");this.incCarrBefore=document.getElementById("incCarrBefore");this.incCarrAfter=document.getElementById("incCarrAfter");this.fullName1=document.getElementById("fullName");this.cont1Info=document.getElementById("cont1Info");this.fullName2=document.getElementById("fullNameSec");this.cont2Info=document.getElementById("cont2Info");this.frnd1Name=document.getElementById("frnd1Name");this.frnd1Info=document.getElementById("frnd1Info");this.frnd2Name=document.getElementById("frnd2Name");this.frnd2Info=document.getElementById("frnd2Info");this.doc1Name=document.getElementById("doc1Name");this.doc1Info=document.getElementById("doc1Info");this.doc2Name=document.getElementById("doc2Name");this.doc2Info=document.getElementById("doc2Info");this.incCarrName=document.getElementById("incCarrName");this.insCarrInfo=document.getElementById("incCarrInfo");var F=new Af.ElementCollection(this.myLoveNameTable);var B=new Af.ElementCollection(this.contact1RelationTable);var A=new Af.ElementCollection(this.contact2RelationTable);var E=new Af.ElementCollection(this.myLoveFriends1Table);var C=new Af.ElementCollection(this.myLoveFriends2Table);var H=new Af.ElementCollection(this.notesTable);var I=new Af.ElementCollection(this.doctor1Table);var G=new Af.ElementCollection(this.doctor2Table);var D=new Af.ElementCollection(this.insuranceCarrierTable);this.save=document.getElementById("save");this.addMyLoved=document.getElementById("addMyLoved");this.deleteMyLoved=document.getElementById("deleteMyLoved");this.printMyLoved=document.getElementById("printMyLoved");this.printMyLoved.onclick=this.printMyLovedOne.bind(this);this.myLovedOnePreview=document.getElementById("myLovedOnePreview");this.myLovedOnePreview.onclick=this.doMyLovedOnePreview.bind(this);this.continue1=document.getElementById("continue1");this.continue2=document.getElementsByName("continue2");this.continue3=document.getElementsByName("continue3");this.continue4=document.getElementsByName("continue4");this.continue1.onclick=this.doContToSecond.bind(this);for(ii=0;ii<this.continue2.length;ii++){this.continue2[ii].onclick=this.doContToThird.bind(this)}for(i_=0;i_<this.continue3.length;i_++){this.continue3[i_].onclick=this.doContToFourth.bind(this)}for(k=0;k<this.continue4.length;k++){this.continue4[k].onclick=this.doContToFifth.bind(this)}this.goBackTo1=document.getElementsByName("goBackTo1");this.goBackTo2=document.getElementsByName("goBackTo2");this.goBackTo3=document.getElementsByName("goBackTo3");this.goBackTo4=document.getElementsByName("goBackTo4");for(g1=0;g1<this.goBackTo1.length;g1++){this.goBackTo1[g1].onclick=this.doGoBackTo1.bind(this)}for(g2=0;g2<this.goBackTo2.length;g2++){this.goBackTo2[g2].onclick=this.doGoBackTo2.bind(this)}for(g3=0;g3<this.goBackTo3.length;g3++){this.goBackTo3[g3].onclick=this.doGoBackTo3.bind(this)}for(g4=0;g4<this.goBackTo4.length;g4++){this.goBackTo4[g4].onclick=this.doGoBackTo4.bind(this)}for(i=0;i<this.includePrContact.length;i++){this.includePrContact[i].onclick=this.doIncludePrContact.bind(this)}for(i2=0;i2<this.include2Contact.length;i2++){this.include2Contact[i2].onclick=this.doInclude2Contact.bind(this)}this.save.onclick=this.doSaveMyLovedOne.bind(this);for(i3=0;i3<this.includeFriend1.length;i3++){this.includeFriend1[i3].onclick=this.doInclFriendOne.bind(this)}for(i4=0;i4<this.includeFriend2.length;i4++){this.includeFriend2[i4].onclick=this.doInclFriendTwo.bind(this)}for(i5=0;i5<this.include1Doctor.length;i5++){this.include1Doctor[i5].onclick=this.doInclOneDoctor.bind(this)}for(i6=0;i6<this.include2Doctor.length;i6++){this.include2Doctor[i6].onclick=this.doInclTwoDoctor.bind(this)}for(i7=0;i7<this.includeIncCarrier.length;i7++){this.includeIncCarrier[i7].onclick=this.doIncludeIncCarrier.bind(this)}this.addMyLoved.onclick=this.doAddMyLoved.bind(this);this.deleteMyLoved.onclick=this.doDeleteMyLoved.bind(this);this.createPerson1=document.getElementById("createPerson1");this.createPerson2=document.getElementById("createPerson2");this.createPerson3=document.getElementById("createPerson3");this.createPerson4=document.getElementById("createPerson4");this.createPerson1.onclick=this.doShowPersonOne.bind(this);this.createPerson2.onclick=this.doShowPersonTwo.bind(this);this.createPerson3.onclick=this.doShowPersonThree.bind(this);this.createPerson4.onclick=this.doShowPersonFour.bind(this);this.createResource1=document.getElementById("createResource1");this.createResource2=document.getElementById("createResource2");this.createResource3=document.getElementById("createResource3");this.createResource1.onclick=this.doShowResourceOne.bind(this);this.createResource2.onclick=this.doShowResourceTwo.bind(this);this.createResource3.onclick=this.doShowResourceThree.bind(this);this.loveTab=new Af.HtmlTab("tabMenu","myLoveName,myLoveContact,myLoveFriends,myLoveMedical,myLoveNotes","myLoveNameTabContent,myLoveContactTabContent,myLoveFriendsTabContent,myLoveMedicalTabContent,myLoveNotesTabContent");this.loveTab.tabSelectionListener=this;this.fName=document.getElementById("fName");this.fName.onfocus=this.focusOnTextBox.bindAsEventListener(this);this.fName.onblur=this.focusLostTextBox.bindAsEventListener(this);this.fName.onkeyup=this.doSetTitleName.bind(this);this.fName.onclick=this.focusOnTextBox.bindAsEventListener(this);this.defaultName=this.fName.value;this.cont1RelFocus=document.getElementById("contact1Relation");this.cont2RelFocus=document.getElementById("contact2Relation");this.fCont1RelFocus=document.getElementById("fContact1Relation");this.fCont2RelFocus=document.getElementById("fContact2Relation");this.doctor1Focus=document.getElementById("type1Doctor");this.doctor2Focus=document.getElementById("type2Doctor");this.policyNoFocus=document.getElementById("policyNumber");this.note1Focus=document.getElementById("note1");this.editor.addTextByEC(F,"fName");this.editor.addTextByEC(F,"lName");this.cont1Relation=this.editor.addTextByEC(B,"contact1Relation");this.cont2Relation=this.editor.addTextByEC(A,"contact2Relation");this.fCont1Relation=this.editor.addTextByEC(E,"fContact1Relation");this.fCont2Relation=this.editor.addTextByEC(C,"fContact2Relation");this.doctor1=this.editor.addTextByEC(I,"type1Doctor");this.doctor2=this.editor.addTextByEC(G,"type2Doctor");this.policyNumber=this.editor.addTextByEC(D,"policyNumber");this.editor.addTextByEC(H,"note1");this.editor.addTextByEC(H,"note2");this.editor.clearChanges();this.editor.setValueFromObj(this.obj);this.doCleanContact();this.isTemplateLoaded=true;if(this.obj.fName==undefined){this.TitleName.innerHTML=""}else{this.TitleName.innerHTML=this.obj.fName}this.setTitleAndValues();this.doInitAssociations()},tabSelected:function(A,B){if(B=="myLoveNotes"){this.note1Focus.focus()}},doSetTitleName:function(){this.TitleName.innerHTML=this.fName.value},doDeleteMyLoved:function(){if(this.currentRow>=0){showConfirmDialog("Are you sure you want to delete this Loved One?","Are You Sure?",330,120,this.deleteMyLovedOne.bind(this))}else{showMessageDialog("Please select a My Loved One to delete. ","Request",330,120)}return false},deleteMyLovedOne:function(){var B=this.dataTable.deleteObjectByIndex(this.currentRow);this.myLovedOneTable.setDataList(this.dataTable.getDataList());this.currentRow=-1;var A=new Af.DataRequest(svcURL,this.requestDeleteCompleted.bind(this),this.requestFailedCommon.bind(this),null,this.requestTimedoutCommon.bind(this));A.addService("WorkspaceService","deleteMyLovedOne");A.addParameter("UUID",B.UUID);ajaxEngine.processRequest(A)},requestDeleteCompleted:function(A){showMessageDialog("The record of your My Loved One was sucessfully deleted.","Deletion Successful",330,100);this.cellSelected(0,0,false)},requestFailedCommon:function(){showMessageDialog("We are currently unable to delete this record. <br/> Please try again.","Excuse us!",330,100)},requestTimedoutCommon:function(){showMessageDialog("We are currently unable to delete this record. <br/> Please try again.","Excuse us!",300,80)},doIncludePrContact:function(){this.showInfo=1;this.doInitAssociations();var A=getPeopleSingleSelector(this,true);A.setPeopleDataList(app.workspace.myPeople,this.obj.contact1);return false},doInclude2Contact:function(){this.showInfo=2;this.doInitAssociations();var A=getPeopleSingleSelector(this,true);A.setPeopleDataList(app.workspace.myPeople,this.obj.contact2);return false},doInclFriendOne:function(){this.showInfo=3;this.doInitAssociations();var A=getPeopleSingleSelector(this,true);A.setPeopleDataList(app.workspace.myPeople,this.obj.friendContact1);return false},doInclFriendTwo:function(){this.showInfo=4;this.doInitAssociations();var A=getPeopleSingleSelector(this,true);A.setPeopleDataList(app.workspace.myPeople,this.obj.friendContact2);return false},doInclOneDoctor:function(){this.showInfo=5;this.doInitAssociations();var A=getResourceSingleSelector(this,true);A.setResourceDataList(app.workspace.myResource,this.obj.doctor1);return false},doInclTwoDoctor:function(){this.showInfo=6;this.doInitAssociations();var A=getResourceSingleSelector(this,true);A.setResourceDataList(app.workspace.myResource,this.obj.doctor2);return false},doIncludeIncCarrier:function(){this.showInfo=7;this.doInitAssociations();var A=getResourceSingleSelector(this,true);A.setResourceDataList(app.workspace.myResource,this.obj.insuranceCarrier);return false},selectionDone:function(B){if(B.selectedPeopleList==null){return }var A=B.selectedPeopleList[0];if(A==null){return }this.prSelected=true;this.showContactInformation(A)},selectionDoneResource:function(B){if(B.selectedResourceList==null){return }var A=B.selectedResourceList[0];if(A==null){return }this.prSelected=true;this.showContactInformation(A)},doInitAssociations:function(){if(this.obj.contact1==null){createOneToManyAssoc(this.obj,"contact1","Person")}if(this.obj.contact2==null){createOneToManyAssoc(this.obj,"contact2","Person")}if(this.obj.friendContact1==null){createOneToManyAssoc(this.obj,"friendContact1","Person")}if(this.obj.friendContact2==null){createOneToManyAssoc(this.obj,"friendContact2","Person")}if(this.obj.doctor1==null){createOneToManyAssoc(this.obj,"doctor1","Resource")}if(this.obj.doctor2==null){createOneToManyAssoc(this.obj,"doctor2","Resource")}if(this.obj.insuranceCarrier==null){createOneToManyAssoc(this.obj,"insuranceCarrier","Resource")}return },setTitleAndValues:function(){if(this.obj.contact1Relation!=undefined){this.beforePerSelect.style.display="none";this.afterPerSelect.style.display="block"}else{this.beforePerSelect.style.display="block";this.afterPerSelect.style.display="none"}if(this.obj.contact2Relation!=undefined){this.before2PerSelect.style.display="none";this.after2PerSelect.style.display="block"}else{this.before2PerSelect.style.display="block";this.after2PerSelect.style.display="none"}if(this.obj.fContact1Relation!=undefined){this.firend1After.style.display="block";this.firend1Before.style.display="none"}else{this.firend1After.style.display="none";this.firend1Before.style.display="block"}if(this.obj.fContact2Relation!=undefined){this.firend2After.style.display="block";this.firend2Before.style.display="none"}else{this.firend2After.style.display="none";this.firend2Before.style.display="block"}if(this.obj.contact1!=undefined){if(this.obj.contact1[0]!=undefined){this.showInfo=1;var D=this.obj.contact1[0];this.showContactInfo(D)}}if(this.obj.contact2!=undefined){if(this.obj.contact2[0]!=undefined){this.showInfo=2;var B=this.obj.contact2[0];this.showContactInfo(B)}}if(this.obj.friendContact1!=undefined){if(this.obj.friendContact1[0]!=undefined){this.showInfo=3;var C=this.obj.friendContact1[0];this.showContactInfo(C)}}if(this.obj.friendContact2!=undefined){if(this.obj.friendContact2[0]!=undefined){this.showInfo=4;var A=this.obj.friendContact2[0];this.showContactInfo(A)}}if(this.obj.doctor1!=undefined){if(this.obj.doctor1[0]!=undefined){this.showInfo=5;var A=this.obj.doctor1[0];this.showContactInfo(A)}}if(this.obj.doctor2!=undefined){if(this.obj.doctor2[0]!=undefined){this.showInfo=6;var A=this.obj.doctor2[0];this.showContactInfo(A)}}if(this.obj.insuranceCarrier!=undefined){if(this.obj.insuranceCarrier[0]!=undefined){this.showInfo=7;var A=this.obj.insuranceCarrier[0];this.showContactInfo(A)}}},showContactInfo:function(A){this.showContactInformation(A)},showContactInformation:function(A){if(A==null){return }var B="";if(A.phone!=undefined){B+="<br/>Phone - "+A.phone}if(A.phone1!=undefined){B="Hom - "+A.phone1}if(A.phone2!=undefined){B+="<br/>Off - "+A.phone2}if(A.phone3!=undefined){B+="<br/>Mob - "+A.phone3}if(A.email!=undefined){B+="<br/>"+A.email}if(A.address!=undefined){B+="<br/><br/>"+A.address}if(A.city!=undefined){B+="<br/>"+A.city}if(A.state!=undefined){B+="  "+A.state}if(A.zip!=undefined){B+="-"+A.zip}switch(this.showInfo){case 1:this.beforePerSelect.style.display="none";this.afterPerSelect.style.display="block";this.fullName1.innerHTML=getFullName(A);this.cont1Info.innerHTML=B;if(this.prSelected){this.prSelected=false;this.cont1Relation.setValue("");this.cont1RelFocus.focus()}break;case 2:this.before2PerSelect.style.display="none";this.after2PerSelect.style.display="block";this.fullName2.innerHTML=getFullName(A);this.cont2Info.innerHTML=B;if(this.prSelected){this.prSelected=false;this.cont2Relation.setValue("");this.cont2RelFocus.focus()}break;case 3:this.firend1Before.style.display="none";this.firend1After.style.display="block";this.frnd1Name.innerHTML=getFullName(A);this.frnd1Info.innerHTML=B;if(this.prSelected){this.prSelected=false;this.fCont1Relation.setValue("");this.fCont1RelFocus.focus()}break;case 4:this.firend2Before.style.display="none";this.firend2After.style.display="block";this.frnd2Name.innerHTML=getFullName(A);this.frnd2Info.innerHTML=B;if(this.prSelected){this.prSelected=false;this.fCont2Relation.setValue("");this.fCont2RelFocus.focus()}break;case 5:this.doctor1Before.style.display="none";this.doctor1After.style.display="block";this.doc1Name.innerHTML=getBusinessName(A);this.doc1Info.innerHTML=B;if(this.prSelected){this.prSelected=false;this.doctor1.setValue("");this.doctor1Focus.focus()}break;case 6:this.doctor2Before.style.display="none";this.doctor2After.style.display="block";this.doc2Name.innerHTML=getBusinessName(A);this.doc2Info.innerHTML=B;if(this.prSelected){this.prSelected=false;this.doctor2.setValue("");this.doctor2Focus.focus()}break;case 7:this.incCarrBefore.style.display="none";this.incCarrAfter.style.display="block";this.incCarrName.innerHTML="<strong>"+getBusinessName(A)+"</strong>";this.insCarrInfo.innerHTML=B;if(this.prSelected){this.prSelected=false;this.policyNumber.setValue("");this.policyNoFocus.focus()}break}},doCleanContact:function(){this.fullName1.innerText="";this.fullName2.innerText="";this.cont1Info.innerText="";this.cont2Info.innerText="";this.frnd1Info.innerHTML="";this.frnd2Info.innerHTML="";this.TitleName.innerHTML="";this.beforePerSelect.style.display="block";this.afterPerSelect.style.display="none";this.before2PerSelect.style.display="block";this.after2PerSelect.style.display="none";this.firend1After.style.display="none";this.firend1Before.style.display="block";this.firend2After.style.display="none";this.firend2Before.style.display="block";this.doctor1After.style.display="none";this.doctor1Before.style.display="block";this.doctor2After.style.display="none";this.doctor2Before.style.display="block";this.incCarrAfter.style.display="none";this.incCarrBefore.style.display="block";this.doRefreshTemplate()},doRefreshTemplate:function(){this.obj=this.dataTable.getDataList()[this.currentRow];this.formatNotesParagraph();this.editor.setValueFromObj(this.obj);this.TitleName.innerHTML=this.obj.fName;this.loveTab._showTab(0);this.loveTab._hideTab(1);this.loveTab._hideTab(2);this.loveTab._hideTab(3);this.loveTab._hideTab(4)},doContToSecond:function(){this.loveTab._hideTab(0);this.loveTab._showTab(1);return false},doContToThird:function(){var B=this.cont1Relation.getValue();var A=this.cont2Relation.getValue();if(B==""||A==""){showMessageDialog("Please enter the relationship of this person to your Loved One. ","Request",400,100);return }this.loveTab._hideTab(1);this.loveTab._showTab(2);return false},doContToFourth:function(){var B=this.fCont1Relation.getValue();var A=this.fCont2Relation.getValue();if(B==""||A==""){showMessageDialog("Please enter the relationship of this person to your Loved One. ","Request",400,100);return }this.loveTab._hideTab(2);this.loveTab._showTab(3);return false},doContToFifth:function(){var B=this.doctor1.getValue();var A=this.doctor2.getValue();if(B==""||A==""){showMessageDialog("Please enter what kind of doctor this is. ","Request",400,100);return }this.loveTab._hideTab(3);this.loveTab._showTab(4);return false},doGoBackTo1:function(){this.loveTab._hideTab(1);this.loveTab._showTab(0);return false},doGoBackTo2:function(){this.loveTab._hideTab(2);this.loveTab._showTab(1);return false},doGoBackTo3:function(){this.loveTab._hideTab(3);this.loveTab._showTab(2);return false},doGoBackTo4:function(){this.loveTab._hideTab(4);this.loveTab._showTab(3);return false},doAddPerson:function(){app.myPeople.IsNewPerson=true;if(this.dialog!=null){delete this.dialog}this.dialog=new HJ.MyPeopleDetail("Person Details",app.myPeople,null);this.dialog.width="520px";var A=new Object();this.dialog.showHTMLTemplate(basePageURL+"MyPeopleDetail.html","content","peopleDetail");this.dialog.centerDialog(520,280);this.dialog.setObj(A,true);this.dialog.isCallFromMyLovedOne=true;return false},doAddResource:function(){app.myResources.addNew=true;if(this.dialog1==null){this.dialog1=new HJ.MyResourcesDetail("My Resources",app.myResources,null);this.dialog1.width="550px"}var A=new Object();this.dialog1.showHTMLTemplate(basePageURL+"MyResourcesDetail.htm","content","resourceDetail");this.dialog1.centerDialog(200,280);this.dialog1.setObj(A,true);this.dialog1.isCallFromMyLovedOne=true;return false},doMyLovedOnePreview:function(){this.isPreviewClicked=true;this.doSaveMyLovedOne()},showPrintPreviw:function(){showModalMessageDialog("Preparing ... please wait",240,40);var A=new Af.DataRequest(svcURL,this.printCompleted.bind(this),this.printFailed.bind(this),null,this.requestTimedout.bind(this));A.addService("WorkspaceService","getPrintPreview");A.addParameter("templateName","getPrintPreview");A.addParameter("xlstFile","MyLovedOne.xsl");A.xmlDoc=this.xmlString;ajaxEngine.processRequest(A);this.isPreviewClicked=false},printMyLovedOne:function(){showModalMessageDialog("Preparing ... please wait",240,40);var A=new Af.DataRequest(svcURL,this.printCompleted.bind(this),this.printFailed.bind(this),null,this.requestTimedout.bind(this));A.addService("WorkspaceService","getPrintHtmlFromXML");A.addParameter("templateName","allAboutMyLovedOne");A.addParameter("xlstFile","MyLovedOne.xsl");if(this.obj.UUID!=null){A.addParameter("UUID",this.obj.UUID)}ajaxEngine.processRequest(A);return false},printCompleted:function(A){hideModalMessageDialog();var B=new Af.PrintUtil();B.listener=this;B.showPrintView(A);return false},printFailed:function(){showMessageDialog("<br/>Printing is currently unavailable.Please try again.","Printing Unavailable",400,150)},printingDone:function(){this.viewSelected();return false},requestTimedout:function(){showMessageDialog("<br/>Printing is currently unavailable.Please try again.","Printing Unavailable",400,150)},doShowPersonOne:function(){this.showInfo=1;this.createNewObjectOfType="contact1";this.doAddPerson()},doShowPersonTwo:function(){this.showInfo=2;this.createNewObjectOfType="contact2";this.doAddPerson()},doShowPersonThree:function(){this.showInfo=3;this.createNewObjectOfType="friendContact1";this.doAddPerson()},doShowPersonFour:function(){this.showInfo=4;this.createNewObjectOfType="friendContact2";this.doAddPerson()},doShowResourceOne:function(){this.showInfo=5;this.createNewObjectOfType="doctor1";this.doAddResource()},doShowResourceTwo:function(){this.showInfo=6;this.createNewObjectOfType="doctor2";this.doAddResource()},doShowResourceThree:function(){this.showInfo=7;this.createNewObjectOfType="insuranceCarrier";this.doAddResource()},focusOnTextBox:function(A){var B=this.fName.value;if(B==null){B=""}else{B=trim(B)}if(B==trim(this.defaultName)||B==""){this.fName.value="";consumeEvent(A)}},focusLostTextBox:function(A){var B=this.fName.value;if(B==null){B=""}else{B=trim(B)}if(B==trim(this.defaultName)||B==""){this.fName.value=this.defaultName;consumeEvent(A)}},replaceAll:function(B,A,E){if((A==E)||(parseInt(E.indexOf(A))>-1)){errmessage="replace function error: \n";errmessage+="Second argument and third argument could be the same ";errmessage+="or third argument contains second argument.\n";errmessage+="This will create an infinite loop as it's replaced globally.";showMessageDialog(errmessage,"Excuse us!",300,100);return false}while(B.indexOf(A)!=-1){var D=B.substring(0,B.indexOf(A));var C=B.substring(B.indexOf(A)+A.length,B.length);B=D+E+C}return B},formatNotesParagraph:function(){if(this.obj.note1!=null){this.obj.note1=this.replaceAll(this.obj.note1,"<BR/>","\n")}if(this.obj.note2!=null){this.obj.note2=this.replaceAll(this.obj.note2,"<BR/>","\n")}return }};HJ.PeopleGroupSelector2=Class.create();HJ.PeopleGroupSelector2.prototype=Object.extend(new Af.HtmlDialog(),{initialize:function(C,A,B){this._initializeDialog(C,A,B);this.myPeopleDataList=null;this.myGroupDataList=null;this.selectedGroupList=null;this.selectedPeopleList=null;this.groupTable=null;this.peopleTable=null},setDataList:function(B,D,A,C){this.myGroupDataList=B;this.myPeopleDataList=new Array();for(Idx1=0;Idx1<D.length;Idx1++){if(D[Idx1]["email"]!=null||D[Idx1]["email"]!=undefined){if(" "!=getFullName(D[Idx1])){D[Idx1]["name"]=getFullName(D[Idx1])}else{D[Idx1]["name"]=D[Idx1]["email"]}this.myPeopleDataList.push(D[Idx1])}}this.selectedGroupList=A;this.selectedPeopleList=C;if(this.myGroupDataList!=null&&this.myGroupDataList.length>0){this.myGroupDataList.sort(sortGroups)}if(this.myPeopleDataList!=null&&this.myPeopleDataList.length>0){this.myPeopleDataList.sort(sortByLastName)}this.updateView()},updateView:function(){if(this.myGroupDataList==null&&this.myPeopleDataList==null){return }if(this.myGroupDataList!=null){for(idx=0;idx<this.myGroupDataList.
