function instanceOf(B,C){if(B!=null){for(var A=B.constructor;A!=null;A=getBaseType(B.constructor,A)){if(A==C){return true}}}return false}function setBaseType(A,B,C){A[B]=C}function getBaseType(A,B){if(B==null){B=A}return A[B]}function extend(B,I,G,F){for(var D=arguments.length-2;D>=0;D--){var E=arguments[D];var A=arguments[D+1];setBaseType(B,E,A);for(var C in A.prototype){copyMember(B,A,C)}copyMember(B,A,"toString");copyMember(B,A,"valueOf")}var J=arguments[arguments.length-1];for(var H=J;H!=null;H=getBaseType(H)){setBaseType(B,H,getBaseType(H))}}function declare(C,A){for(var B in A){C.prototype[B]=A[B]}if(A.toString!=Object.prototype.toString){C.prototype.toString=A.toString}if(A.valueOf!=Object.prototype.valueOf){C.prototype.valueOf=A.valueOf}}function getMethodName(B,D){if(D.declared!=null){B=D.declared}if(B._defined==null){B._defined=true;for(var A in B.prototype){var C=B.prototype[A];C._name=A}}return D._name}function copyMember(B,C,A){var D=C.prototype[A];if(D.declared==null){D.declared=C}B.prototype[A]=D}function base(H,D){var E=H.constructor;var B=base.caller;var A;var F=getMethodName(E,B);if(F==null){A=getBaseType(E,B)}else{var G=B.declared;if(G==null){G=H.constructor}var C=getBaseType(E,G);A=C.prototype[F]}var I=A.call(H,arguments[1],arguments[2],arguments[3],arguments[4],arguments[5],arguments[6],arguments[7],arguments[8],arguments[9],arguments[10]);return I}var root=null;var Safari=navigator.userAgent!=null&&navigator.userAgent.indexOf("Safari")>=0;var Opera=navigator.userAgent!=null&&navigator.userAgent.indexOf("Opera")>=0;var IE=!Opera&&document.all!=null;var IE7=navigator.userAgent!=null&&navigator.userAgent.indexOf("MSIE 7")>=0;var IE6=IE&&!IE7;var Mac=Safari;var Firefox=navigator.userAgent!=null&&navigator.userAgent.indexOf("Firefox")>=0;function canBrowserOpen(A){if(A==null){return false}A=A.toLowerCase();if(endsWith(A,".zip")||endsWith(A,".bin")||endsWith(A,".exe")||endsWith(A,".com")||endsWith(A,".dll")){return false}return true}function getButton(B){if(!B){B=window.event}var A=B.button;if(IE&&A==1){A=0}return A}var onmousewheel=null;function wheel(A){var B=0;if(!A){A=window.event}if(A.wheelDelta){B=A.wheelDelta/120;if(window.opera){B=-B}}else{if(A.detail){B=-A.detail/3}}if(B&&onmousewheel!=null){if(onmousewheel(B,A)){if(A.preventDefault){A.preventDefault()}A.returnValue=false}}}if(window.addEventListener){window.addEventListener("DOMMouseScroll",wheel,false)}else{window.onmousewheel=document.onmousewheel=wheel}function formatMemory(A){if(A<1000){return A}if(A<1000000){return Math.floor(A/1000)+"K"}return Math.floor(A/1000000)+"M"}function getExtension(A){var B=A.lastIndexOf(".");if(B<0){return""}return A.substring(B,A.length)}var windowOnLoad=new List();window.onload=function(){windowOnLoad.invoke()};var windowOnUnload=new List();window.onunload=function(){windowOnUnload.invoke()};var windowOnResize=new List();window.onresize=function(){windowOnResize.invoke()};function dump(B){var D="";for(var A in B){if(D.length>0){D+=", "}D+=A.toString()+" = ";var C=B[A];D+=C==null?"<NULL>":C.toString()}return D}function clone(A){var B=new Object();copyMembers(A,B);return B}function copyMembers(B,C){for(var A in B){C[A]=B[A]}}function getDifferences(E,C,G){var F=null;for(var D in E){if(D[0]==G){continue}var B=E[D];var A=C[D];if(!Equals(B,A)){if(F==null){F=new Object()}F[D]=A}}for(var D in C){if(D[0]==G){continue}var B=E[D];var A=C[D];if(!Equals(B,A)){if(F==null){F=new Object()}F[D]=A}}return F}function isOne(A){return A==1}function isOneOrMore(A){return A>=1}function isTwoOrMore(A){return A>=2}function GetMaximumValue(F,E){if(E==null){return null}var A=-1;for(var D=0;D<F.length;D++){var B=F[D];var C=B[E];if(C>A){A=C}}return A}function parseObjectPropertyString(E){var F=E.split(";");var C=new Array();for(var B=0;B<F.length;B++){C[B]=new Object();var A=F[B].split("`");var D=A.split("=");C[B][D[0]]=D[1]}return C}function getUtcDate(A){if(A==null){return null}return new Date(A.getUTCFullYear(),A.getUTCMonth(),A.getUTCDate(),A.getUTCHours(),A.getUTCMinutes(),A.getUTCSeconds())}function getLocalTimezoneOffset(){var A=new Date();var B=getUtcDate(A);var C=getMinutesDifference(A,B);return C}function formatObjectPropertyString(G){var F="";for(var A=0;A<G.length;A++){var C=G[A];if(F.length>0){F+=";"}var B="";for(var E in C){if(B.length>0){B+="`"}var D=C[E];if(D!=null){if(D.getUTCDate!=null){D=formatDateUniversalSortable(D)}else{D=D.toString();D=D.replace(/`/g," ");D=D.replace(/;/g," ");D=D.replace(/=/g," ")}B+=E+"="+D}}F+=B}return F}function formatDateUniversalSortable(A){var B=A.getFullYear()+"-"+(A.getMonth()+1)+"-"+A.getDate()+" "+A.getHours()+":"+A.getMinutes();return B}function parseDateUniversalSortable(F){var D=F.split(/-| |:/);var E=parseInt(D[0]);var H=parseInt(D[1])-1;var G=parseInt(D[2]);var A=parseInt(D[3]);var C=parseInt(D[4]);var B=new Date();B.setFullYear(E);B.setMonth(H);B.setDate(G);B.setHours(A);B.setMinutes(C);return B}function setUserData(A,B,C){return setData(A+"_"+user.Id,B,C)}function getUserData(B,A){return getData(B+"_"+user.Id,A)}function setData(C,D,E){if(E==null){E=365*10}if(E){var B=new Date();B.setTime(B.getTime()+(E*24*60*60*1000));var A="; expires="+B.toGMTString()}else{var A=""}document.cookie=C+"="+D+A+"; path=/"}function getData(C,B){if(C!=null){var E=C+"=";var A=document.cookie.split(";");for(var D=0;D<A.length;D++){var F=A[D];while(F.charAt(0)==" "){F=F.substring(1,F.length)}if(F.indexOf(E)==0){return F.substring(E.length,F.length)}}}return B}function eraseCookie(A){createCookie(A,"",-1)}function toPropertyString(B,D){var C=null;for(var A in B){if(C==null){C=""}else{C+=", "}C+=A;if(D){C+=" = "+B[A]}}return C}var SAFECHARS="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_.!~*'()";var HEX="0123456789ABCDEF";function UrlEncode(D){var E="";for(var B=0;B<D.length;B++){var C=D.charAt(B);if(C==" "){E+="+"}else{if(SAFECHARS.indexOf(C)!=-1){E+=C}else{var A=C.charCodeAt(0);if(A>255){alert("Unicode Character '"+C+"' cannot be encoded using standard URL encoding.\n(URL encoding only supports 8-bit characters.)\nA space (+) will be substituted.");E+="+"}else{E+="%";E+=HEX.charAt((A>>4)&15);E+=HEX.charAt(A&15)}}}}return E}function compare(C,A){if(C==null&&A==null||(C==A)){return 0}if(C==null){return -1}if(A==null){return +1}if(isDate(C)&&isDate(A)){return C.getTime()-A.getTime()}if(isNumber(C)&&isNumber(A)){return C-A}var B=C.toString();var D=A.toString();if(B.localeCompare){return B.localeCompare(D)}if(B.compare){return B.compare(D)}return -1}function endsWith(A,B){return A.length>=B.length&&A.substring(A.length-B.length)==B}var _digits="1234567890";function isDigit(A){return A!=null&&A.length==1&&_digits.indexOf(A)>=0}var _numberParts="1234567890-.";function isNumberPart(A){return A!=null&&A.length==1&&_numberParts.indexOf(A)>=0}function toLocalTime(A){if(A==null){return null}var B=Date.UTC(A.getFullYear(),A.getMonth(),A.getDate(),A.getHours(),A.getMinutes(),A.getSeconds(),A.getMilliseconds());return new Date(B)}function clamp(C,B,A){if(B==null){B=0}if(A==null){A=1}if(C<B){return B}if(C>A){return A}return C}function interpolateDates(B,A,D){if(B==null){return A}if(A==null){return B}var C=Math.round(B.getTime()*(1-D)+A.getTime()*D);return new Date(C)}function startOfQuarter(A){var A=setDate(A,1);A=setMonth(A,Math.floor(A.getMonth()/3)*3);return A}function getTomorrow(B){if(!isDate(B)){B=new Date()}var A=addDays(B,1);A.setHours(0,0,0,0);return A}function getMinutesDifference(B,A){if(B==null||A==null){return 0}var C=B.getTime()-A.getTime();return Math.floor(C/60000)}function getDaysDifference(C,A){if(C==null||A==null){return 0}C=setMinutesOfDay(C,12*60);A=setMinutesOfDay(A,12*60);var B=C.getTime()-A.getTime();return Math.round(B/(24*60*60*1000))}function addSeconds(B,C){var A=B.getTime()+C*1000;return new Date(A)}function addMinutes(A,B){return addSeconds(A,B*60)}function addHours(A,B){return addMinutes(A,B*60)}function addDays(A,C){var B=getMinutesOfDay(A);A=setMinutesOfDay(A,12*60);A=addHours(A,C*24);A=setMinutesOfDay(A,B);return A}function sign(A){if(A<0){return -1}if(A>0){return +1}return 0}function addMonths(C,A){var E=C.getMonth()+A;var D=C.getFullYear();D+=sign(E)*Math.floor(Math.abs(E)/12);E=E%12;if(E<0){E+=12;D-=1}var B=new Date(C.getTime());B.setFullYear(D);B.setMonth(E);return B}function setMonth(B,C){var A=new Date(B.getTime());A.setMonth(C);return A}function getNextDay(C,B){var A=C.getDay();var D=B-A;if(D<=0){D+=7}return addDays(C,D)}function addYears(B,C){var A=new Date(B.getTime());A.setFullYear(B.getFullYear()+C);return A}function isSameDay(B,A){if(B==null||A==null){return false}return B.getFullYear()==A.getFullYear()&&B.getMonth()==A.getMonth()&&B.getDate()==A.getDate()}function getMinutesOfDay(A){return A.getHours()*60+A.getMinutes()}function setMinutesOfDay(B,C){var A=new Date(B.getTime());A.setHours(C/60,C%60,0,0);return A}function setDay(C,A,B){var D=C.getDay();var E=A-D;if(B&&E<0){E+=7}else{if(!B&&E>0){E-=7}}return addDays(C,E)}function setDate(A,B){var A=new Date(A.getTime());A.setDate(B);return A}function formatHex(C,B){if(C==null){C=0}var A=C.toString(16);for(;B!=null&&A.length<B;){A="0"+A}return A.toUpperCase()}function getBrightness(A){if(A[0]=="#"){A=A.substring(1)}var D=0;for(var B=0;B<A.length;B+=2){var C=A.substr(B,2);D+=parseInt(C,16)}return D}function parseColor(A){if(A==null){return null}if(A.substring(0,1)=="#"){A=A.substring(1)}var B=parseInt(A,16);if(!isNumber(B)){B=0}return B}function getOriginalElement(A){return A.originalTarget||A.srcElement}function getTarget(B){var A=B.target;if(A==null){A=B.srcElement}return A}function isInput(B){if(B==null){return false}var A=B.tagName;if(A==null){return false}var A=A.toLowerCase();return A=="input"||A=="button"||A=="textarea"}function _disabletext(A){if(!A){A=window.event}return isInput(getTarget(A))}function _reEnable(A){if(!A){A=window.event}return true}function _disableshift(A){if(!A){A=window.event}return isInput(getTarget(A))||!A.shiftKey}function disableTextSelection(){document.onselectstart=_disabletext;document.ondragstart=function(){return false};if(window.sidebar){document.onmousedown=_disabletext;document.onclick=_reEnable;document.onkeydown=_disableshift}}var _generatedIdCount=0;function getUniqueId(){return"id"+_generatedIdCount++}function parseNumber(A){if(A==null){return null}return 0+new Number(A).valueOf()}function significantDigits(C,B){if(C==null||C==Math.floor(C)){return C}if(B==null){B=2}var D=C.toString();var A=D.indexOf(".");D=D.substring(0,Math.min(D.length,A+1+B));return parseNumber(D)}function formatDuration(C){if(C==null||C==0){return""}var A=C/60;var B=A<1;if(B){return C==1?"1 min":(C+" mins")}if(A==1){return"1 hr"}A=significantDigits(A);return A+" hrs"}function formatDurationHoursColonMinutes(B){if(B==null||B==0){return""}var A=Math.floor(B/60);var C=B%60;if(C<10){C="0"+C}return A+":"+C}function formatDurationSeconds(E){if(E==null){return""}var C=Math.floor(E/60);var A=Math.floor(C/60);var D=C%60;var B=E%60;if(A<10){A="0"+A}if(D<10){D="0"+D}if(B<10){B="0"+B}return A+":"+D+":"+B}function formatTimeFromDate(A){return formatTime(getMinutesOfDay(A))}function formatTimeShort(C){var A=Math.floor(C/60)%24;var D=C%60;var B="";if(A>=12){B="p"}if(A>12){A-=12}if(A==0){A=12}if(D<10){D="0"+D}return A+":"+D+B}function formatTime(C){var A=Math.floor(C/60)%24;var D=C%60;var B="am";if(A>=12){B="pm"}if(A>12){A-=12}if(A==0){A=12}if(D<10){D="0"+D}return A+":"+D+" "+B}function formatDateVeryShort(B){if(B==null){return null}var A=B.getDate();var D=B.getMonth();var C=B.getFullYear();return C+"-"+(D+1)+"-"+A}function formatDayShort(B){if(B==null){return null}var A=B.getDay();return days[A]}function formatWeek(A){var D=A.getDate();var C=A.getMonth();var B=A.getFullYear();return months[C]+" "+D+", "+B}function formatDateShort(B){if(B==null){return null}var A=B.getDate();var D=B.getMonth();var C=B.getFullYear();return months[D]+" "+A+", "+C}function formatDateLong(B){if(B==null){return null}var A=B.getDay();var D=B.getMonth();var C=B.getFullYear();return daysLong[A]+" "+monthsLong[D]+" "+B.getDate()+", "+C}function formatDateLongTime(B){if(B==null){return null}var A=B.getDay();var D=B.getMonth();var C=B.getFullYear();return daysLong[A]+" "+monthsLong[D]+" "+B.getDate()+", "+C+" "+formatTime(B.getHours()*60+B.getMinutes())}function formatMonthYear(A){var C=A.getMonth();var B=A.getFullYear();return monthsLong[C]+" "+B}function formatQuarter(B){var A=Math.floor(B.getMonth()/3)+1;return"Q"+A+" "+B.getFullYear()}function toDateRangeString(B,H,E){var C=new Date();var J="";var G=B.getFullYear();var A="";var I=H.getFullYear();if(E||G!=C.getFullYear()||I!=C.getFullYear()||G!=I){J+=G+" "}J+=monthsLong[B.getMonth()]+" ";J+=B.getDate();if(I!=G){A+=I+" "}if(I!=G||H.getMonth()!=B.getMonth()){A+=monthsLong[H.getMonth()]+" "}if(I!=G||H.getMonth()!=B.getMonth()||H.getDate()!=B.getDate()){A+=H.getDate()}if(A.length==0||E){var D=formatTime(B.getHours()*60+B.getMinutes());var F=formatTime(H.getHours()*60+H.getMinutes());if(A.length>0){D="("+D+")";F="("+F+")"}J+=" "+D;if(A.length>0||D!=F||E){A+=" "+F}}if(A.length>0){return J+" - "+trim(A)}else{return J}}function formatNumber(D,E){var F=D.toString();var B=0;for(var C=E.length-1;C>=0&&F.length>0;C--){var A=E[C];if(A=="0"){E=E.substring(0,C)+F[F.length-1]+E.substring(C+1,E.length);F=F.substring(0,F.length-1)}}return E}function parseTime(E){if(E==null||E==""){return 0}E=E.toLowerCase();var D=false;if(E.indexOf("am")>=0){E=E.replace("am","")}if(E.indexOf("pm")>=0){D=true;E=E.replace("pm","")}E=trim(E);var A=0;var C=0;if(E.indexOf(":")>=0){var B=E.indexOf(":");var A=B>0?parseInt(E.substr(0,B)):0;var C=parseInt(E.substr(B+1))}else{C=Math.floor(parseNumber(E)*60)}if(D){if(A<12){A+=12}}if(!isNumber(A)){A=0}if(!isNumber(C)){C=0}return A*60+C}function format(E,D,C,B){for(var A=1;A<arguments.length;A++){E=E.replace("{"+(A-1)+"}",arguments[A])}return E}function isArray(A){return A!=null&&A.constructor==Array}function isDate(A){return A!=null&&A.constructor==Date}function isObject(A){return A!=null&&A.constructor==Object}function isNumber(B){if(B==null){return false}if(B>=0||B<=0){return true}var A=parseInt(B);return A>=0||A<=0}function arrayContains(C,B){for(var A=0;A<C.length;A++){if(Equals(C[A],B)){return true}}return false}Array.prototype.contains=function(A){return arrayContains(this,A)};Array.prototype.allTrue=function(A){for(var B=0;B<this.length;B++){var C=this[B];if(!A(C)){return false}}return true};Array.prototype.allFieldsEqual=function(D,C){for(var A=0;A<this.length;A++){var B=this[A];if(B==null||B[D]!=C){return false}}return true};Array.prototype.max=function(F,D){var B=null;var A=null;for(var C=0;C<this.length;C++){var E=this[C];var G=F!=null?E[F]:E;if(G==null){if(D===undefined){continue}G=D}if(A==null||G>A){A=G;B=E}}return B};Array.prototype.min=function(F,D){var B=null;var A=null;for(var C=0;C<this.length;C++){var E=this[C];var G=F!=null?E[F]:E;if(G==null){if(D===undefined){continue}G=D}if(A==null||G<A){A=G;B=E}}return B};Array.prototype.minValue=function(B){var A=this.min(B);return A!=null?A[B]:null};Array.prototype.maxValue=function(B){var A=this.max(B);return A!=null?A[B]:null};function copyFields(B,C){for(var A in B){C[A]=B[A]}}function isNotEmpty(A){return !isEmpty(A)}function isEmpty(A){if(A==null){return true}if(isString(A)){return isEmptyString(A)}return false}function isString(A){return A!=null&&A.constructor==String}function isFunction(A){return A!=null&&A.constructor==Function}function isEmptyString(B){if(B==null){return true}for(var A=B.length-1;A>=0;A--){if(!isWhite(B.charAt(A))){return false}}return true}function isWhite(A){return((A=="\t")||(A==" "))}function trim(C){if(C==null){return null}if(!isString(C)){C=C.toString()}var B,A=C.length;for(B=0;isWhite(C.charAt(B))&&(B<A);B++){}if(B==A){return""}for(;isWhite(C.charAt(A-1));A--){}return C.substring(B,A)}function removeAllChildren(B){for(var A=B.childNodes.length-1;A>=0;A--){B.removeChild(B.childNodes[A])}}function navigate(A){document.location.href=A}function Equals(B,A){if(B===A){return true}if(B==null||A==null){return false}if(B==A){return true}if(isDate(B)&&isDate(A)){return B.getTime()==A.getTime()}if(B.Equals!=null){return B.Equals(A)}if(A.Equals!=null){return A.Equals(B)}return false}Array.prototype.copy=function(){var B=[];for(var A=0;A<this.length;A++){B[A]=this[A]}return B};Array.prototype.add=function(A){this[this.length]=A};function indexOf(C,B){for(var A=0;A<C.length;A++){if(Equals(C[A],B)){return A}}return -1}function contains(B,A){return indexOf(B,A)>=0}function reverse(D){for(var C=0;C<D.length/2;C++){var B=D.length-1-C;var A=D[C];D[C]=D[B];D[B]=A}}function getScrollTotal(B){var D=0;var C=0;for(var A=B;A!=null;A=A.parentNode){if(A.scrollLeft!=null){D+=A.scrollLeft}if(A.scrollTop!=null){C+=A.scrollTop}}return new Point(D,C)}function getClientRectangle(D){var B,C,H,E;if(D.getBoundingClientRect){var F=D.getBoundingClientRect();B=F.left;C=F.right-F.left;H=F.top;E=F.bottom-F.top}else{if(document.getBoxObjectFor){var G=document.getBoxObjectFor(D);B=G.x;C=G.width;H=G.y;E=G.height;var A=getScrollTotal(D);B-=A.x;H-=A.y}else{B=0;H=0;width=D.offsetWidth;height=D.offsetHeight;while(D){B+=D.offsetLeft;H+=D.offsetTop;D=D.offsetParent}}}return new Rectangle(B,H,C,E)}function getLocalPoint(A,C){if(!C){C=window.event}var B=getClientRectangle(A);return new Point(C.clientX-B.x,C.clientY-B.y)}function max(B,A){if(!isNumber(B)){return A}if(!isNumber(A)){return B}return Math.max(B,A)}function Size(B,A){this.width=B;this.height=A}Point.prototype.toString=function(){return this.width+","+this.height};function Point(A,B){this.x=A;this.y=B}Point.prototype.toString=function(){return this.x+","+this.y};function Rectangle(B,D,C,A){this.x=B;this.y=D;this.width=C;this.height=A}Rectangle.prototype.toString=function(){return this.x+","+this.y+","+this.width+","+this.height};Rectangle.prototype.getLeft=function(){return this.x};Rectangle.prototype.getTop=function(){return this.y};Rectangle.prototype.getRight=function(){return this.x+this.width};Rectangle.prototype.getBottom=function(){return this.y+this.height};Rectangle.prototype.contains=function(A,D){var C=this.x+this.width;var B=this.y+this.height;return A>=this.x&&D>=this.y&&A<=C&&D<=B};Rectangle.prototype.subtractBorder=function(A){if(A!=null){this.x+=A.left;this.width-=A.left+A.right;this.y+=A.top;this.height-=A.top+A.bottom}};Rectangle.prototype.addBorder=function(A){if(A!=null){this.x-=A.left;this.width+=A.left+A.right;this.y-=A.top;this.height+=A.top+A.bottom}};Rectangle.prototype.isEmpty=function(){return this.width<=0||this.height<=0};function intersectRectangle(C,B){if(C==null){return B}if(B==null){return C}var H=Math.max(C.getLeft(),B.getLeft());var G=Math.max(C.getTop(),B.getTop());var E=Math.min(C.getRight(),B.getRight());var D=Math.min(C.getBottom(),B.getBottom());var F=Math.max(0,E-H);var A=Math.max(0,D-G);return new Rectangle(H,G,F,A)}function Border(D,C,B,A){this.left=D;this.top=C!=null?C:D;this.right=B!=null?B:D;this.bottom=A!=null?A:this.top}Border.prototype.setColor=function(C,B,D,A){this.leftColor=C;this.topColor=B!=null?B:C;this.rightColor=D!=null?D:C;this.bottomColor=A!=null?A:this.topColor;return this};Border.prototype.getLeft=function(){return this.left};Border.prototype.getTop=function(){return this.top};Border.prototype.getRight=function(){return this.right};Border.prototype.getBottom=function(){return this.bottom};Border.prototype.getLeftStyle=function(){return this.left!=0?"solid":"none"};Border.prototype.getTopStyle=function(){return this.top!=0?"solid":"none"};Border.prototype.getRightStyle=function(){return this.right!=0?"solid":"none"};Border.prototype.getBottomStyle=function(){return this.bottom!=0?"solid":"none"};Border.prototype.getLeftColor=function(){return this.leftColor};Border.prototype.getTopColor=function(){return this.topColor};Border.prototype.getRightColor=function(){return this.rightColor};Border.prototype.getBottomColor=function(){return this.bottomColor};Border.prototype.getHorizontal=function(){return this.left+this.right};Border.prototype.getVertical=function(){return this.top+this.bottom};Border.prototype.toString=function(){return this.left+","+this.top+","+this.right+","+this.bottom};function addBorders(B,A){if(B==null&&A==null){return null}if(B==null){return A}if(A==null){return B}return new Border(B.left+A.left,B.top+A.top,B.right+A.right,B.bottom+A.bottom)}function getScreenPosition(A){return getRelativePosition(A,null)}function getRelativePosition(D,C){var A=new Point(0,0);for(var B=D;B!=null&&B!=C;B=B.offsetParent){A.x+=B.offsetLeft;A.y+=B.offsetTop}return A}function getScreenCenter(A){return getRelativeCenter(A,null)}function getRelativeCenter(C,B){var A=getRelativePosition(C,B);A.x+=Math.floor(GetWidth(C)/2);A.y+=Math.floor(GetHeight(C)/2);return A}var attributes=new Object();function Attribute(A,B,C){this.name=A;this.style=B;if(C==null){C=A}if(isFunction(C)){this.func=C}else{this.property=C}attributes[A]=this}Attribute.prototype.setValue=function Attribute_setValue(A,C){if(A!=null){var B=this.func;if(B!=null){B(A,C);return }var D=this.style?A.style:A;if(D!=null){D[this.property]=C}}};new Attribute("color",true);new Attribute("background",true,"backgroundColor");new Attribute("background.image",true,"backgroundImage");new Attribute("background.position",true,"backgroundPosition");new Attribute("position",true);new Attribute("overflow",true);new Attribute("display",true);new Attribute("float",true,function(A,B){if(IE){A.style.styleFloat=B}else{A.style.align=B}});new Attribute("visibility",true);new Attribute("style.width",true,"width");new Attribute("style.height",true,"height");new Attribute("style.left",true,"left");new Attribute("style.top",true,"top");new Attribute("border.color",true,"borderColor");new Attribute("border.top",true,"borderTop");new Attribute("border.left",true,"borderLeft");new Attribute("border.right",true,"borderRight");new Attribute("border.bottom",true,"borderBottom");new Attribute("text-align",true,"textAlign");new Attribute("text.decoration",true,"textDecoration");new Attribute("cursor",true);new Attribute("filter",true);new Attribute("font.weight",true,"fontWeight");new Attribute("font.size",true,function(A,B){A.style.fontSize=B+"pt"});new Attribute("z-index",true,"zIndex");new Attribute("value",false);new Attribute("class",false,"className");new Attribute("disabled",false,function(A,B){A.disabled=(B=="true")});new Attribute("style",false,function(A,B){if(IE){A.style.cssText=B}else{A.setAttribute("style",B)}});function isStyleAttribute(B){var A=attributes[B];if(A!=null){return A.style}return false}var setCounts={};function setAttributeOnElement(C,B,E){var D=setCounts[B];D=D!=null?D+1:1;setCounts[B]=D;var A=attributes[B];if(A!=null){if(A.style&&E==null){E=""}A.setValue(C,E);return }else{C.setAttribute(B,E)}}function List(){this.items=new Array();this.size=0}extend(List,Object);List.prototype.getItem=function(A){return this.items[A]};List.prototype.toArray=function(){var B=new Array();for(var A=0;A<this.size;A++){B[A]=this.items[A]}return B};List.prototype.getCount=function(){return this.size};List.prototype.addIfUnique=function(B){var A=this.indexOf(B);if(A>=0){this.items[A]=B}else{this.add(B)}};List.prototype.push=function(A){this.add(A)};List.prototype.pop=function(A){var B=this.getItem(this.size-1);if(!Equals(A,B)){var C="Pop '"+A+"' != top '"+B+"'";error(C);throw C}this.size--;this.items[this.size]=null};List.prototype.add=function(A){this.insert(A,this.size)};List.prototype.insert=function(C,A){for(var B=this.size;B>A;B--){this.items[B]=this.items[B-1]}this.items[A]=C;this.size++};List.prototype.remove=function(B){var A=this.indexOf(B);if(A<0){return }this.removeAt(A)};List.prototype.removeAt=function(A){for(var B=A;B<this.size;B++){this.items[B]=this.items[B+1]}this.size--};List.prototype.move=function(B,A){this.remove(B);this.insert(B,A)};List.prototype.contains=function(A){return this.indexOf(A)>=0};List.prototype.indexOf=function(B){for(var A=0;A<this.size;A++){if(Equals(this.items[A],B)){return A}}return -1};List.prototype.clear=function(B){for(var A=0;A<this.size;A++){this.items[A]=null}this.size=0};List.prototype.invoke=function(){var A=null;for(var B=0;B<this.size;B++){var C=this.items[B];A=C(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5],arguments[6],arguments[7],arguments[8])}return A};List.prototype.toArray=function(){var B=new Array();for(var A=0;A<this.size;A++){B[A]=this.items[A]}return B};List.prototype.toString=function(){return this.items.join()};var MessageType=new Object();MessageType.Error="Error";MessageType.Warning="Warning";MessageType.Message="Message";MessageType.Trace="Trace";function trace(C){var A=new Date();var B=A.getSeconds()+":"+A.getMilliseconds();message(B+" "+C,MessageType.Trace)}function error(A){message(A,MessageType.Error)}function warning(A){message(A,MessageType.Warning)}function message(B,A){if(isEmpty(B)){return }if(A==null){A=MessageType.Message}if(onMessage.getCount()>0){onMessage.invoke(B,A)}else{alert(B)}}var onMessage=new List();function Clock(A){if(A==null){A=1}this.interval=A;this.OnTick=new List();this.count=0;this.SetTimeout()}Clock.prototype.SetTimeout=function(){var A=this;if(this.handler==null){this.handler=function(){A.count++;A.OnTick.invoke(A.count);A.SetTimeout()}}setTimeout(this.handler,this.interval*1000)};function Animation(A,B,C,D){this.item=A;this.property=B;this.target=C;this.interval=0.01;this.callback=D;this.start()}Animation.prototype.start=function(){if(!this.isRunning()){var A=this;var B=function(){A.run()};this.timeoutId=setInterval(B,this.interval*1000)}};Animation.prototype.stop=function(){if(this.isRunning()){clearInterval(this.timeoutId);this.timeoutId=null}};Animation.prototype.getElapsedSeconds=function(){var C=new Date().getTime()/1000;var B=this.lastTime;var A=(B!=null)?Math.max(this.interval,C-B):this.interval;this.lastTime=C;return C};Animation.prototype.run=function(){var F=this.getElapsedSeconds();var A=this.item[this.property];var B=this.target;var E=0.5;var D=A*(1-E)+B*E;var C=1;if(Math.abs(D-A)<C){this.item[this.property]=B;this.stop()}else{this.item[this.property]=D}if(this.callback!=null){this.callback()}};Animation.prototype.isRunning=function(){return this.timeoutId!=null};Animation.prototype.getTarget=function(){return this.target};Animation.prototype.setTarget=function(A){this.target=A;this.start()};function getImageUrl(A){if(A==null){return null}if(A.indexOf(".")<0){A+=".png"}return applicationRoot+"Include/Images/"+A}function getCursorCss(A){if(A==null){return null}if(A.indexOf(".")<0){A+=".cur"}return"url("+applicationRoot+"Include/Cursors/"+A+")"}function formatCurrency(C){if(C==null){return""}var A=Math.floor(C/100);var B=Math.floor(C%100);if(B<10){B="0"+B}return"$"+A+"."+B}function localizeTimezone(B,A){return A}var months=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");var monthsLong=new Array("January","February","March","April","May","June","July","August","September","October","November","December");var dayLetters=new Array("S","M","T","W","T","F","S");var days=new Array("Sun","Mon","Tue","Wed","Thr","Fri","Sat");var daysLong=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");var daysLongPlural=new Array("Sundays","Mondays","Tuesdays","Wednesdays","Thursdays","Fridays","Saturdays");var ordinals=new Array("0th","1st","2nd","3rd","4th","5th","6th","7th","8th","9th","10th");function getOrdinal(A){if(A<ordinals.length){return ordinals[A]}var C=A.toString();var B=C.substring(C.length-1);if(B=="1"){return C+"st"}if(B=="2"){return C+"nd"}if(B=="3"){return C+"rd"}return C+"th"}var hoursOfDay=new Array();for(var i=0;i<24;i++){var hour=i%12;if(hour==0){hour=12}var m=i>=12?"pm":"am";hoursOfDay[i]=hour+" "+m}var Resources=new Object();Resources.DeletingMemberAccessDenied='No permission to remove member "{0}".';Resources.DeletingTaskAccessDenied='No permission to delete task "{0}".';Resources.DeletingDependencyAccessDenied="No permission to delete dependency.";Resources.DeletingDependencyNotFound="Dependency to delete not found.";Resources.MemberAlreadyExistsWarning='"{0}" is already a member.';Resources.ValidationSummary="Please fix the following errors and resubmit.";Resources.RequiredFieldValidator="Field is required.";Resources.EmailInvalid="Invalid email address.";Resources.Ok="Ok";Resources.Submit="Submit";Resources.Cancel="Cancel";Resources.ScrollUp="Up";Resources.ScrollDown="Down";Resources.CircularDependencyRemoved="Circular dependency detected and removed.";Resources.Name="Name";Resources.Priority="!";Resources.PriorityDescription="Priority";Resources.Location="Location";Resources.LocationDescription="The location of this activity.";Resources.Description="Description";Resources.DescriptionDescription="Detailed activity information.";Resources.Start="Start";Resources.StartDescription="Scheduled start date";Resources.Finish="Finish";Resources.FinishDescription="Scheduled finish date";Resources.LagFinish="Lag Finish";Resources.LagFinishDescription="Finished date plus lag time";Resources.Modified="Modified";Resources.ModifiedDescription="Date of most recent modification";Resources.Created="Created";Resources.CreatedDescription="Date item was created";Resources.Completed="Completed";Resources.CompletedDescription="Date item was marked complete";Resources.Complete="%";Resources.CompleteDescription="Percent Complete";Resources.Notes="Notes";Resources.NotesDescription="Attached Notes";Resources.Assigned="Assigned";Resources.AssignedDescription="Assigned Members";Resources.Documents="Documents";Resources.DocumentsDescription="Attached Documents";Resources.Work="Work";Resources.Duration="Duration";Resources.DurationDescription="Length required to complete task in days.";Resources.Time="Time";Resources.WorkDescription="Estimated amount of work in hours.";Resources.Schedule="Schedule";Resources.Date="Date";Resources.ScheduleEditorTimeFromTo=" - ";Resources.ScheduleEditorInvalidHours="Invalid hours.";Resources.TeamTabName="Teams";Resources.SelectText="Select...";Resources.NewTeam="<New Team>";Resources.Projects="Projects";Resources.Members="Members";Resources.NewTask="&New...";Resources.Settings="Settings";Resources.EditTask="&Edit";Resources.DeleteTask="Delete";Resources.ArchiveTask="Archive";Resources.CutTask="Cut";Resources.CopyTask="Copy";Resources.PasteTask="Paste";Resources.IndentTask="Indent";Resources.OutdentTask="Outdent";Resources.MoveUpTask="Move up";Resources.MoveDownTask="Move down";Resources.LinkTasks="Link tasks";Resources.LinkTasksReverse="Link tasks bottom to top";Resources.BreakLinkTasks="Break task dependency links";Resources.Members="Members";Resources.NewMember="New";Resources.EditMember="Edit";Resources.DeleteMember="&Remove";Resources.TaskTypeFolder="Folder";Resources.TaskTypeTemplate="Template";Resources.TaskTypeProject="Project";Resources.TaskTypeTask="Task";Resources.TaskTypeIssue="Issue";Resources.TaskTypeEvent="Event";Resources.TaskTypeMilestone="Milestone";Resources.TaskTypeTemplate="Template";Resources.TaskTypeTask="Task";Resources.TaskCreateTitle="New {0}";Resources.TaskEditTitle="Edit {0}";Resources.TaskEditTitleMultiple="Edit Items";Resources.TaskEditSummary="Summary";Resources.TaskEditConstraints="Constraints";Resources.TaskEditName="&Name";Resources.TaskEditLocation="&Location";Resources.TaskEditDescription="&Description";Resources.TaskEditComplete="&Complete";Resources.TaskEditWork="&Work";Resources.TaskEditSchedule="&Schedule";Resources.TaskEditDates="Date(s)";Resources.TaskEditSnet="Start no earlier than";Resources.TaskEditSnlt="Start no later than";Resources.TaskEditFnet="Finish no earlier than";Resources.TaskEditFnlt="Finish no later than";Resources.TaskEditAsap="Automatic";Resources.TaskEditManually="Manually";Resources.TaskEditNameFormatInvalid="Name contains invalid characters.";Resources.TaskEditCompleteInvalid="Must be 0-100.";Resources.TaskEditWorkInvalid="Must be >= 0.";Resources.MemberEditDialogTitle="Edit Member";Resources.MemberEditCreateTitle="Add Member";Resources.MemberEditTitle="&Title";Resources.MemberEditName="&Name";Resources.MemberEditEmail="&Email";Resources.MemberEditType="T&ype";Resources.MemberEditTitleRequired="Title required if Email not specified.";Resources.MemberTitle="Title";Resources.MemberName="Name";Resources.MemberEmail="Email";Resources.MemberType="Type";Resources.MemberNotes="Comments";Resources.Contact="Contact";Resources.Observer="Observer";Resources.Guest="Guest";Resources.Member="Associate";Resources.Admin="Admin";Resources.CreateTeamTitle="Create New Team";Resources.CreateTeamName="&Name";Resources.CreateTeamType="&Type";Resources.CreateTeamTimeZone="Time &Zone";Resources.CreateTeamSchedule="&Schedule";Resources.CreateTeamNameFormatInvalid="Name contains invalid characters.";Resources.CreateTeamAlreadyExists="You already created a Team with that name.";Resources.CreateTeamPersonal="Personal";Resources.CreateTeamBusiness="Business";Resources.CreateTeamHoursRequired="No Hours specified";Resources.GanttZoomDay="Day";Resources.GanttZoomWeek="Week";Resources.GanttZoomMonth="Month";Resources.GanttZoomQuarter="Quarter";Resources.GanttFinishToStartDescription="'{1}' can't start until '{0}' finishes.";Resources.GanttFinishToStartLagDescription="'{1}' can't start until {2} after '{0}' finishes.";Resources.GanttStartToStartDescription="'{1}' can't start until '{0}' starts.";Resources.GanttStartToStartLagDescription="'{1}' can't start until {2} after '{0}' starts.";Resources.GanttFinishToFinishDescription="'{1}' can't finish until '{0}' finishes.";Resources.GanttFinishToFinishLagDescription="'{1}' can't finish until {2} after '{0}' finishes.";Resources.GanttStartToFinishDescription="'{1}' can't finish until '{0}' starts.";Resources.GanttStartToFinishLagDescription="'{1}' can't finish until {2} after '{0}' starts.";Resources.DateDialogTitle="Date";Resources.ActionAddNotesText="Add or view notes...";Resources.ActionAddNotesIcon="OldIcons/note_icon";Resources.ActionAttachDocumentsText="Upload new documents...";Resources.ActionAttachDocumentsIcon="Documents/New";Resources.ActionAddBookmarkText="Add new document link...";Resources.ActionAddBookmarkIcon="Documents/NewLink";Resources.ActionDownloadCurrentText="Open";Resources.ActionDownloadCurrentSaveText="Save";Resources.ActionDownloadPreviousText="Older versions";Resources.ActionUploadNewText="Upload new version";Resources.ActionUpdateDocumentLocationText="Change location";Resources.ActionDeleteDocumentText='Delete "{0}"';Resources.ActionDeleteAllDocumentsText="Delete all documents";Resources.DeleteAllDocumentsConfirm="Are you sure you want to delete all this tasks documents?";Resources.ActionRestoreDocumentsText="Restore documents";Resources.ActionRestoreAllDocumentsText="Restore all deleted documents";Resources.ActionRenameDocumentText="Rename";Resources.RenameDocumentPrompt="Enter new name:";Resources.RenameDocumentFailedNameInUse='Rename failed. Another document is already named "{0}".';Resources.RenameDocumentFailedInvalidName='Rename failed. Invalid filename "{0}".';Resources.ActionNewMemberIcon="NewPerson";Resources.ActionNewMemberDescription="Adds a new member to this team.";Resources.ActionOutdentMemberText="Outdent";Resources.ActionOutdentMemberIcon="Outdent";Resources.ActionOutdentMemberDescription="Promotes the selected members to be peers of their current manager.";Resources.ActionIndentMemberText="Indent";Resources.ActionIndentMemberIcon="Indent";Resources.ActionIndentMemberDescription="Subordinates the selected members to the member above them.";Resources.ActionEditMemberIcon="EditTask";Resources.ActionEditMemberDescription="Edits the selected Member";Resources.ActionNewTaskText="New Task";Resources.ActionNewTaskIcon="TaskIcons/Task-New";Resources.ActionNewTaskDescription="Creates a new Task";Resources.ActionNewTaskIEWidth=111;Resources.ActionNewIssueText="New Issue";Resources.ActionNewIssueIcon="TaskIcons/Issue-New";Resources.ActionNewIssueDescription="Creates a new Issue";Resources.ActionNewIssueIEWidth=93;Resources.ActionEditTaskText="Edit";Resources.ActionEditTaskIcon="EditTask";Resources.ActionEditTaskDescription="Edits the selected item";Resources.ActionEditTaskIEWidth=56;Resources.ActionTimerText="Timer";Resources.ActionTimerIcon="ClockPlay";Resources.ActionTimerSelected="ClockStop";Resources.ActionTimerDescription="Starts or stops the activity timer.";Resources.ActionTimerIEWidth=66;Resources.ActionUpdateText="Update";Resources.ActionUpdateIcon="ClockEdit";Resources.ActionUpdateDescription="Logs progress and time worked on an activity.";Resources.ActionUpdateIEWidth=75;Resources.ActionTaskMarkCompleteText="Complete";Resources.ActionTaskMarkCompleteIcon="MarkComplete";Resources.ActionTaskMarkCompleteDescription="Mark the active task complete.";Resources.ActionTaskMarkCompleteIEWidth=90;Resources.ActionViewIcon="Display";Resources.ActionViewText="View";Resources.ActionViewIEWidth=78;Resources.ActionZoomInText="Zoom In";Resources.ActionZoomInIcon="ZoomIn";Resources.ActionZoomInDescription="Zoom in on the displayed view.";Resources.ActionZoomOutText="Zoom Out";Resources.ActionZoomOutIcon="ZoomOut";Resources.ActionZoomOutDescription="Zoom out on the displayed view.";Resources.ActionRefreshText="Refresh";Resources.ActionRefreshIcon="Refresh";Resources.ActionRefreshDescription="Refreshes the displayed list.";Resources.ActionRefreshIEWidth=75;Resources.ActionNewFolderText="New Folder";Resources.ActionNewFolderIcon="TaskIcons/Folder-New";Resources.ActionNewFolderDescription="Creates a new Folder";Resources.ActionNewProjectText="New Project";Resources.ActionNewProjectIcon="TaskIcons/Project-New";Resources.ActionNewProjectDescription="Creates a new Project";Resources.ActionNewTemplateText="New Template";Resources.ActionNewTemplateIcon="TaskIcons/Template-New";Resources.ActionNewTemplateDescription="Creates a new Template";Resources.ActionNewEventText="New Event";Resources.ActionNewEventIcon="TaskIcons/Event-New";Resources.ActionNewEventDescription="Creates a new Event";Resources.ActionNewEventIEWidth=95;Resources.ActionLockTaskText="Lock/Unlock Tasks";Resources.ActionLockTaskIcon="Lock";Resources.ActionLockTaskDescription="Locks or unlocks the selected Tasks";Resources.ActionCutTaskText="Cut";Resources.ActionCutTaskIcon="Cut";Resources.ActionCutTaskDescription="Cuts the selected items. Use Paste to move them somewhere else.";Resources.ActionCopyTaskText="Copy";Resources.ActionCopyTaskIcon="Copy";Resources.ActionCopyTaskDescription="Copies the selected items. Use Paste to duplicate them somewhere else.";Resources.ActionPasteTaskText="Paste";Resources.ActionPasteTaskIcon="Paste";Resources.ActionPasteTaskDescription="Pastes the previously cut or copied items to the selected locations.";Resources.ActionDeleteTaskText="Delete selected items";Resources.ActionDeleteTaskIcon="Trash";Resources.ActionDeleteTaskDescription="Deletes the selected items.";Resources.ActionDeleteEventText="Delete";Resources.ActionDeleteEventIcon="Trash";Resources.ActionDeleteEventDescription="Deletes the selected item.";Resources.ActionArchiveTaskText="Archive selected items";Resources.ActionArchiveTaskIcon="Archive";Resources.ActionArchiveTaskDescription="Archives the items, removing them from display but not deleting them.";Resources.ActionUnarchiveTaskText="Restore selected items";Resources.ActionUnarchiveTaskIcon="Unarchive";Resources.ActionUnarchiveTaskDescription="Restores the previously archived items";Resources.ActionShowArchivedTaskText="Show archived items";Resources.ActionUndeleteTaskText="Restore selected items";Resources.ActionUndeleteTaskIcon="Undelete";Resources.ActionUndeleteTaskDescription="Restores the previously deleted items.";Resources.ActionShowDeletedTaskText="Show deleted items";Resources.ActionOutdentTaskText="Outdent";Resources.ActionOutdentTaskIcon="Outdent";Resources.ActionOutdentTaskDescription="Shifts the selected tasks to the left.";Resources.ActionIndentTaskText="Indent";Resources.ActionIndentTaskIcon="Indent";Resources.ActionIndentTaskDescription="Shifts the selected tasks to the right.";Resources.ActionMoveUpTaskText="MoveUp";Resources.ActionMoveUpTaskIcon="MoveUp";Resources.ActionMoveUpTaskDescription="Moves the selected tasks up.";Resources.ActionMoveDownTaskText="MoveDown";Resources.ActionMoveDownTaskIcon="MoveDown";Resources.ActionMoveDownTaskDescription="Moves the selected tasks down.";Resources.ActionLinkDescendingTaskText="Link tasks top to bottom";Resources.ActionLinkDescendingTaskIcon="LinkDown";Resources.ActionLinkDescendingTaskDescription="Creates dependencies between selected tasks from top to bottom.";Resources.ActionLinkAscendingTaskText="Link tasks bottom to top";Resources.ActionLinkAscendingTaskIcon="LinkUp";Resources.ActionLinkAscendingTaskDescription="Creates dependencies between selected tasks from bottom to top.";Resources.ActionLinkBreakTaskText="Unlink tasks";Resources.ActionLinkBreakTaskIcon="LinkBreak";Resources.ActionLinkBreakTaskDescription="Removes dependencies between selected tasks.";Resources.ActionShowCompletedTaskText="Completed items";Resources.ActionPrintTaskText="Print...";Resources.ActionPrintTaskDescription="Print a project";Resources.ActionDeleteTagIcon="Delete";Resources.ActionDeleteTagDescription="Delete the selected tags.";Resources.ActionCreateTagIcon="NewTag";Resources.ActionCreateTagDescription="Create a new custom tag.";Resources.ActionCreateTimeEntryIcon="TaskIcons/Task-New";Resources.ActionCreateTimeEntryDescription="Create a new entry.";Resources.ActionShowBlockedTaskText="Blocked";Resources.ActionShowCompletedTaskText="Completed";Resources.ActionShowCompletedNoneText="None";Resources.ActionShowCompletedTodayText="Today";Resources.ActionShowCompletedYesterdayText="Yesterday";Resources.ActionShowCompletedLast7DaysText="Last 7 days";Resources.ActionShowCompletedLast30DaysText="Last 30 days";Resources.ActionShowUpcomingTaskText="Upcoming";Resources.ActionShowUpcomingTodayText="None";Resources.ActionShowUpcomingTomorrowText="Tomorrow";Resources.ActionShowUpcomingNext7DaysText="Next 7 days";Resources.ActionShowUpcomingNext30DaysText="Next 30 days";Resources.ActionOpenTeamTabText="Team";Resources.ActionOpenTeamTabIcon="AddTab";Resources.ActionOpenTeamTabDescription="Opens a new team tab.";Resources.ActionOpenTeamTabIEWidth=78;Resources.ActionLeftIcon="Left";Resources.ActionLeftDescription="Scroll to the left";Resources.ActionRightIcon="Right";Resources.ActionRightDescription="Scroll to the right";Resources.UpgradeMessage="Activate this feature with upgrade. Learn more in our Edition Comparison.";Resources.Tips=new Array();Resources.Tips.add("Use 'Preference' tab (on 'My Viewpath') to change your login password.");Resources.Tips.add("Add or Remove columns in the display area by right-clicking on column header and then choosing from menu options.");Resources.Tips.add("Utilize keyboard shortcuts (indicated in parentheses in drop-down menus) to quickly perform routine commands.");Resources.Tips.add("Use 'Lock' function to prevent unintended schedule changes to an activity's start and finish date.");Resources.Tips.add("Resize column widths by clicking the header lines separating column names and then dragging to left or right.");Resources.Tips.add("Create a Folder for an ongoing to-do-list of 'Unscheduled' activities that aren't currently part of a Project.");Resources.Tips.add("Adjust the Gantt Chart timescale (in Projects section) by using icon group on the far right side of the toolbar.");Resources.Tips.add("To only view a timeline for a selected Project (in Project section) use right-click menu to 'Open new Tab'.");Resources.Tips.add("Include 'C' (for calendar days) in Duration field to enable activity scheduling on weekends.");Resources.Tips.add("Use 'Templates' to develop best-practices on recurring projects and initiatives.");Resources.Tips.add("Type a job skill or role in the 'Assigned' field as a temporary placeholder for resource planning.");Resources.Tips.add("Select activity and use right-click menu to 'Send Notification' email with optional personalized message.");Resources.Tips.add("Use 'Work Hours' field (on activities) to track estimated hours and use 'Timesheets' to track actual hours.");Resources.Tips.add("View an activity's Timeline context from 'Today' or 'Search' by right-clicking and choosing 'Find Within Project'.");Resources.Tips.add("Add or Remove the Gantt Chart in Project view by using the 'Display' icon's drop-down menu list.");Resources.Tips.add("Mark activities 'Complete' by selecting item and then typing 'C' as a keyboard shortcut.");Resources.Tips.add("Create a custom Tag (in Team Settings) to track 'unplanned' activities vs planned activities.");Resources.Tips.add("View Deleted or Archived activities (in Projects section) from the drop-down menu on the 'Display' icon.");Resources.Tips.add("Use 'Send Notification' on Search results to email customized notifications or reminders to Team Members.");Resources.Tips.add("Create a Team's reporting hierarchy (in Members section) by selecting a Member and using 'tab' key to indent.");Resources.Tips.add("Add an existing Member to another Team by Using Copy and Paste icons in Members section.");Resources.Tips.add("Research reveals that it typically takes 7-21 days to develop efficient habits in using a new productivity tool.");function request(D,C,E,F,A){var B=true;if(B){waitingRequests.add(new Request(D,C,E,F,A));processNextRequest()}else{processRequest(new Request(D,C,E,F,A))}}function processNextRequest(){if(currentRequest!=null){return }var A=waitingRequests.getItem(0);if(A==null){return }waitingRequests.remove(A);processRequest(A)}function isSoapProcessingRequests(){return currentRequest!=null||waitingRequests.getCount()>0}var waitingRequests=new List();var currentRequest=null;var totalResponseLength=0;function processRequest(C){currentRequest=C;var D=C.handler;var B=C.url;var F=C.content;var G=C.contentType;var A=C.requestType;if(A==null){A="POST"}var E;if(window.XMLHttpRequest){E=new XMLHttpRequest()}else{if(window.ActiveXObject){E=new ActiveXObject("Microsoft.XMLHTTP")}else{throw"Ajax not supported on this browser"}}E.open(A,B,true);if(G!=null){E.setRequestHeader("Content-Type",G)}E.onreadystatechange=function(){if(E.readyState==4){currentRequest=null;D(E);processNextRequest()}};E.send(F)}function Request(C,B,D,E,A){this.handler=C;this.url=B;this.content=D;this.contentType=E;this.requestType=A}function Response(C,A,B){this.request=C;this.result=A;this.error=B}var _debugMethod=null;function debugSoap(A){_debugMethod=A}function invoke(L,K,G,D,A,F){var I='<?xml version="1.0" encoding="utf-8"?><soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope"><soap12:Body><'+A+' xmlns="'+D+'">';for(var E=0;E+1<F.length;E+=2){var B=F[E];var J=F[E+1];var H=J==null?' xsi:nil="true"':"";I+="<"+B+H+">"+toSoapXml(J)+"</"+B+">"}I+="</"+A+"></soap12:Body></soap12:Envelope>";if(A==_debugMethod){prompt("debug",I)}var C=function(P){var O=null;var M=P.responseText;if(M!=null){if(A==_debugMethod){alert(M)}var Q=getElementContent(M,"soap:Fault");if(Q!=null){O=getElementContent(Q,"soap:Text")}}var N=new Response(P,M,O);L(N)};request(C,G,I,"application/soap+xml; charset=utf-8","POST")}function getElementContent(A,C){var B=getElement(A,C);if(B==null){return null}var D=getContent(B);return D}function getElement(B,C){var D=new RegExp("<[^>]*"+C+"[\\w\\W]*?>[\\w\\W]*?"+C+">");var E=B.match(D);var A=E!=null&&E.length>0?E[0]:null;return A}function getElementContentOrNull(D,C){var F=D.indexOf("<"+C+">");var A;if(F<0){F=D.indexOf("<"+C+" ");A=D.indexOf(">",F);var B=D.substring(F,A);if(B.indexOf('xsi:nil="true"')>=0){return null}}else{A=F+C.length+2}var G=D.indexOf("</"+C+">",A);var E=D.substring(A,G);return E}function getContent(B){var D=B.indexOf(">");var A=B.lastIndexOf("<");if(D<0||A<0||D>=A){if(B.indexOf("xsi:nil")>0){return null}return""}var C=B.substring(D+1,A);return C}function getSoapResult(B){var A=getElementContent(B.result,"Result");if(A!=null){B.result=A}else{B.error=getElementContent(B.result,"soap:Text");B.result=null}}function parseBoolean(A){if(A=="true"){return true}return false}function toSoapXmlElement(A,B){if(B==null){return"<"+A+' xsi:nil="true" />'}return"<"+A+">"+toSoapXml(B)+"</"+A+">"}function toSoapXml(B){if(B==null){return""}if(B.getUTCDate!=null){return toSoapDate(B)}var A;if(isString(B)){A=B.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}else{A=B.toString()}return A}function parseString(A){if(A==null){return null}return A.replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">")}function parseSoapDate(B){var C=/(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})/;B.match(C);var A=new Date(RegExp.$1,RegExp.$2-1,RegExp.$3,RegExp.$4,RegExp.$5,RegExp.$6);return A}function toSoapDate(A){return A.getFullYear()+"-"+toString(A.getMonth()+1,2)+"-"+toString(A.getDate(),2)+"T"+toString(A.getHours(),2)+":"+toString(A.getMinutes(),2)+":"+toString(A.getSeconds(),2)}function toString(A,B){var C=A.toString();while(C.length<B){C="0"+C}return C}function GetInsideString(D,E,C){var B=D.indexOf(E)+1;var A=D.lastIndexOf(C);return D.substring(B,A)}function ParseNextElement(F,I){var B=F.indexOf(">");if(B<=0){return null}var D=F.substring(0,B+1);var A=GetInsideString(D,"<",">").split(" ")[0];F=F.substring(B+1);var G="/"==D[D.length-2];if(!G){var C="</"+A+">";var E=F.indexOf(C);if(E<0){alert("error parsing xml "+C+" not found in: "+F)}var H=F.substring(0,E);I[A]=H;F=F.substring(E+C.length)}return F}function ParseXmlFields(A){A=GetInsideString(A,">","<");var C=A.split("<");var B=new Object();while(A!=null){A=ParseNextElement(A,B)}return B}function GetAssociates(C,B,D){var E=new Array(4);E[0]="token";E[1]=B;E[2]="teamId";E[3]=D;var A=function(F){getSoapResult(F);if(F.error==null){F.result=ParsePublicMemberArray(F.result)}if(C!=null){C(F)}};invoke(A,null,"Services/MemberService.asmx","http://viewpath.com/services","GetAssociates",E)}function SetDefaultTeam(C,B,D){var E=new Array(4);E[0]="token";E[1]=B;E[2]="teamId";E[3]=D;var A=function(F){getSoapResult(F);if(F.error==null){F.result=(F.result)}if(C!=null){C(F)}};invoke(A,null,"Services/MemberService.asmx","http://viewpath.com/services","SetDefaultTeam",E)}function CreateMember(M,D,J,A,H,E,K,I,C,L,G){var F=new Array(20);F[0]="token";F[1]=D;F[2]="title";F[3]=J;F[4]="name";F[5]=A;F[6]="email";F[7]=H;F[8]="teamId";F[9]=E;F[10]="managerId";F[11]=K;F[12]="type";F[13]=I;F[14]="initials";F[15]=C;F[16]="accountingAccess";F[17]=L;F[18]="notes";F[19]=G;var B=function(N){getSoapResult(N);if(N.error==null){N.result=ParsePublicMember(N.result)}if(M!=null){M(N)}};invoke(B,null,"Services/MemberService.asmx","http://viewpath.com/services","CreateMember",F)}function UpdateMember(L,D,J,I,A,G,H,C,K,F){var E=new Array(18);E[0]="token";E[1]=D;E[2]="memberId";E[3]=J;E[4]="title";E[5]=I;E[6]="name";E[7]=A;E[8]="email";E[9]=G;E[10]="type";E[11]=H;E[12]="initials";E[13]=C;E[14]="accountingAccess";E[15]=K;E[16]="notes";E[17]=F;var B=function(M){getSoapResult(M);if(M.error==null){M.result=ParsePublicMember(M.result)}if(L!=null){L(M)}};invoke(B,null,"Services/MemberService.asmx","http://viewpath.com/services","UpdateMember",E)}function DeleteMember(D,C,A){var E=new Array(4);E[0]="token";E[1]=C;E[2]="memberId";E[3]=A;var B=function(F){getSoapResult(F);if(F.error==null){F.result=parseNumber(F.result)}if(D!=null){D(F)}};invoke(B,null,"Services/MemberService.asmx","http://viewpath.com/services","DeleteMember",E)}function MoveMember(D,C,A,E){var F=new Array(6);F[0]="token";F[1]=C;F[2]="memberId";F[3]=A;F[4]="managerId";F[5]=E;var B=function(G){getSoapResult(G);if(G.error==null){G.result=parseNumber(G.result)}if(D!=null){D(G)}};invoke(B,null,"Services/MemberService.asmx","http://viewpath.com/services","MoveMember",F)}function GetSubMembers(I,B,C,H,F,E,G){var D=new Array(12);D[0]="token";D[1]=B;D[2]="teamId";D[3]=C;D[4]="managerId";D[5]=H;D[6]="year";D[7]=F;D[8]="month";D[9]=E;D[10]="day";D[11]=G;var A=function(J){getSoapResult(J);if(J.error==null){J.result=ParsePublicMemberArray(J.result)}if(I!=null){I(J)}};invoke(A,null,"Services/MemberService.asmx","http://viewpath.com/services","GetSubMembers",D)}function FindMember(D,C,E,B){var F=new Array(6);F[0]="token";F[1]=C;F[2]="teamId";F[3]=E;F[4]="name";F[5]=B;var A=function(G){getSoapResult(G);if(G.error==null){G.result=ParsePublicMember(G.result)}if(D!=null){D(G)}};invoke(A,null,"Services/MemberService.asmx","http://viewpath.com/services","FindMember",F)}function DeleteTeam(C,B,D){var E=new Array(4);E[0]="token";E[1]=B;E[2]="teamId";E[3]=D;var A=function(F){getSoapResult(F);if(F.error==null){F.result=parseNumber(F.result)}if(C!=null){C(F)}};invoke(A,null,"Services/TeamService.asmx","http://viewpath.com/services","DeleteTeam",E)}function UpdateTeam(I,C,D,A,J,E,H,G){var F=new Array(14);F[0]="token";F[1]=C;F[2]="teamId";F[3]=D;F[4]="name";F[5]=A;F[6]="message";F[7]=J;F[8]="timeSheetsEnabled";F[9]=E;F[10]="timezone";F[11]=H;F[12]="schedule";F[13]=G;var B=function(K){getSoapResult(K);if(K.error==null){K.result=ParsePublicTeam(K.result)}if(I!=null){I(K)}};invoke(B,null,"Services/TeamService.asmx","http://viewpath.com/services","UpdateTeam",F)}function CreateTeam(H,C,A,I,D,G,E){var F=new Array(12);F[0]="token";F[1]=C;F[2]="name";F[3]=A;F[4]="message";F[5]=I;F[6]="timeSheetsEnabled";F[7]=D;F[8]="timezone";F[9]=G;F[10]="schedule";F[11]=E;var B=function(J){getSoapResult(J);if(J.error==null){J.result=ParsePublicTeam(J.result)}if(H!=null){H(J)}};invoke(B,null,"Services/TeamService.asmx","http://viewpath.com/services","CreateTeam",F)}function GetTeam(C,B,D){var E=new Array(4);E[0]="token";E[1]=B;E[2]="teamId";E[3]=D;var A=function(F){getSoapResult(F);if(F.error==null){F.result=ParsePublicTeam(F.result)}if(C!=null){C(F)}};invoke(A,null,"Services/TeamService.asmx","http://viewpath.com/services","GetTeam",E)}function GetTeams(C,B){var D=new Array(2);D[0]="token";D[1]=B;var A=function(E){getSoapResult(E);if(E.error==null){E.result=ParsePublicTeamArray(E.result)}if(C!=null){C(E)}};invoke(A,null,"Services/TeamService.asmx","http://viewpath.com/services","GetTeams",D)}function GetAge(D,B,A){var E=new Array(4);E[0]="a";E[1]=B;E[2]="b";E[3]=A;var C=function(F){getSoapResult(F);if(F.error==null){F.result=parseNumber(F.result)}if(D!=null){D(F)}};invoke(C,null,"Services/CustomFieldService.asmx","http://viewpath.com/services","GetAge",E)}function GetTeamTags(C,B,D){var E=new Array(4);E[0]="token";E[1]=B;E[2]="teamId";E[3]=D;var A=function(F){getSoapResult(F);if(F.error==null){F.result=ParseTagArray(F.result)}if(C!=null){C(F)}};invoke(A,null,"Services/CustomFieldService.asmx","http://viewpath.com/services","GetTeamTags",E)}function CreateTag(E,D,F,C,B){var G=new Array(8);G[0]="token";G[1]=D;G[2]="teamId";G[3]=F;G[4]="name";G[5]=C;G[6]="color";G[7]=B;var A=function(H){getSoapResult(H);if(H.error==null){H.result=ParseTag(H.result)}if(E!=null){E(H)}};invoke(A,null,"Services/CustomFieldService.asmx","http://viewpath.com/services","CreateTag",G)}function UpdateTag(F,D,E,C,B){var G=new Array(8);G[0]="token";G[1]=D;G[2]="tagId";G[3]=E;G[4]="name";G[5]=C;G[6]="color";G[7]=B;var A=function(H){getSoapResult(H);if(H.error==null){H.result=ParseTag(H.result)}if(F!=null){F(H)}};invoke(A,null,"Services/CustomFieldService.asmx","http://viewpath.com/services","UpdateTag",G)}function DeleteTag(D,B,C){var E=new Array(4);E[0]="token";E[1]=B;E[2]="tagId";E[3]=C;var A=function(F){getSoapResult(F);if(F.error==null){F.result=parseNumber(F.result)}if(D!=null){D(F)}};invoke(A,null,"Services/CustomFieldService.asmx","http://viewpath.com/services","DeleteTag",E)}function SubmitTimeSheet(D,C,B,E){var F=new Array(6);F[0]="token";F[1]=C;F[2]="timeSheetId";F[3]=B;F[4]="submit";F[5]=E;var A=function(G){getSoapResult(G);if(G.error==null){G.result=ParsePublicTimeSheet(G.result)}if(D!=null){D(G)}};invoke(A,null,"Services/TimeSheetService.asmx","http://viewpath.com/services","SubmitTimeSheet",F)}function ApproveTimeSheet(D,C,B,E){var F=new Array(6);F[0]="token";F[1]=C;F[2]="timeSheetId";F[3]=B;F[4]="approve";F[5]=E;var A=function(G){getSoapResult(G);if(G.error==null){G.result=ParsePublicTimeSheet(G.result)}if(D!=null){D(G)}};invoke(A,null,"Services/TimeSheetService.asmx","http://viewpath.com/services","ApproveTimeSheet",F)}function StartWorking(D,C,B){var E=new Array(4);E[0]="token";E[1]=C;E[2]="taskId";E[3]=B;var A=function(F){getSoapResult(F);if(F.error==null){F.result=parseNumber(F.result)}if(D!=null){D(F)}};invoke(A,null,"Services/TimeSheetService.asmx","http://viewpath.com/services","StartWorking",E)}function FinishWorking(D,C,B){var E=new Array(4);E[0]="token";E[1]=C;E[2]="taskId";E[3]=B;var A=function(F){getSoapResult(F);if(F.error==null){F.result=(F.result)}if(D!=null){D(F)}};invoke(A,null,"Services/TimeSheetService.asmx","http://viewpath.com/services","FinishWorking",E)}function GetTimeSheet(F,D,A,E,G,C){var H=new Array(10);H[0]="token";H[1]=D;H[2]="memberId";H[3]=A;H[4]="year";H[5]=E;H[6]="month";H[7]=G;H[8]="day";H[9]=C;var B=function(I){getSoapResult(I);if(I.error==null){I.result=ParsePublicTimeSheet(I.result)}if(F!=null){F(I)}};invoke(B,null,"Services/TimeSheetService.asmx","http://viewpath.com/services","GetTimeSheet",H)}function GetTimeEntries(C,B,E){var D=new Array(4);D[0]="token";D[1]=B;D[2]="id";D[3]=E;var A=function(F){getSoapResult(F);if(F.error==null){F.result=ParsePublicTimeEntryArray(F.result)}if(C!=null){C(F)}};invoke(A,null,"Services/TimeSheetService.asmx","http://viewpath.com/services","GetTimeEntries",D)}function PopulateTimeSheet(C,B,E){var D=new Array(4);D[0]="token";D[1]=B;D[2]="id";D[3]=E;var A=function(F){getSoapResult(F);if(F.error==null){F.result=ParsePublicTimeEntryArray(F.result)}if(C!=null){C(F)}};invoke(A,null,"Services/TimeSheetService.asmx","http://viewpath.com/services","PopulateTimeSheet",D)}function AddTimeEntries(D,C,B,F){var E=new Array(6);E[0]="token";E[1]=C;E[2]="timeSheetId";E[3]=B;E[4]="taskIds";E[5]=F;var A=function(G){getSoapResult(G);if(G.error==null){G.result=ParsePublicTimeEntryArray(G.result)}if(D!=null){D(G)}};invoke(A,null,"Services/TimeSheetService.asmx","http://viewpath.com/services","AddTimeEntries",E)}function CreateTimeEntry(B,I,O,M,A,F,P,N,H,L,R,C,K,J,D,Q){var G=new Array(30);G[0]="token";G[1]=I;G[2]="timeSheetId";G[3]=O;G[4]="timeTypeId";G[5]=M;G[6]="taskName";G[7]=A;G[8]="projectName";G[9]=F;G[10]="billable";G[11]=P;G[12]="tags";G[13]=N;G[14]="comments";G[15]=H;G[16]="sunday";G[17]=L;G[18]="monday";G[19]=R;G[20]="tuesday";G[21]=C;G[22]="wednesday";G[23]=K;G[24]="thursday";G[25]=J;G[26]="friday";G[27]=D;G[28]="saturday";G[29]=Q;var E=function(S){getSoapResult(S);if(S.error==null){S.result=ParsePublicTimeEntry(S.result)}if(B!=null){B(S)}};invoke(E,null,"Services/TimeSheetService.asmx","http://viewpath.com/services","CreateTimeEntry",G)}function UpdateTimeEntry(B,J,E,N,A,G,P,O,I,M,R,C,L,K,D,Q){var H=new Array(30);H[0]="token";H[1]=J;H[2]="timeEntryId";H[3]=E;H[4]="timeTypeId";H[5]=N;H[6]="taskName";H[7]=A;H[8]="projectName";H[9]=G;H[10]="billable";H[11]=P;H[12]="tags";H[13]=O;H[14]="comments";H[15]=I;H[16]="sunday";H[17]=M;H[18]="monday";H[19]=R;H[20]="tuesday";H[21]=C;H[22]="wednesday";H[23]=L;H[24]="thursday";H[25]=K;H[26]="friday";H[27]=D;H[28]="saturday";H[29]=Q;var F=function(S){getSoapResult(S);if(S.error==null){S.result=ParsePublicTimeEntry(S.result)}if(B!=null){B(S)}};invoke(F,null,"Services/TimeSheetService.asmx","http://viewpath.com/services","UpdateTimeEntry",H)}function DeleteTimeEntry(C,B,E){var D=new Array(4);D[0]="token";D[1]=B;D[2]="timeEntryId";D[3]=E;var A=function(F){getSoapResult(F);if(F.error==null){F.result=parseBoolean(F.result)}if(C!=null){C(F)}};invoke(A,null,"Services/TimeSheetService.asmx","http://viewpath.com/services","DeleteTimeEntry",D)}function UpdateTaskSchedules(C,B,D){var E=new Array(4);E[0]="token";E[1]=B;E[2]="data";E[3]=D;var A=function(F){getSoapResult(F);if(F.error==null){F.result=(F.result)}if(C!=null){C(F)}};invoke(A,null,"Services/TaskService.asmx","http://viewpath.com/services","UpdateTaskSchedules",E)}function ReassignTasks(E,D,G,A,C){var F=new Array(8);F[0]="token";F[1]=D;F[2]="taskIds";F[3]=G;F[4]="owner";F[5]=A;F[6]="assigned";F[7]=C;var B=function(H){getSoapResult(H);if(H.error==null){H.result=ParsePublicTaskArray(H.result)}if(E!=null){E(H)}};invoke(B,null,"Services/TaskService.asmx","http://viewpath.com/services","ReassignTasks",F)}function SetTasksLocked(D,C,F,B){var E=new Array(6);E[0]="token";E[1]=C;E[2]="taskIds";E[3]=F;E[4]="locked";E[5]=B;var A=function(G){getSoapResult(G);if(G.error==null){G.result=(G.result)}if(D!=null){D(G)}};invoke(A,null,"Services/TaskService.asmx","http://viewpath.com/services","SetTasksLocked",E)}function SetTaskStatus(D,C,F,A){var E=new Array(6);E[0]="token";E[1]=C;E[2]="taskIds";E[3]=F;E[4]="status";E[5]=A;var B=function(G){getSoapResult(G);if(G.error==null){G.result=(G.result)}if(D!=null){D(G)}};invoke(B,null,"Services/TaskService.asmx","http://viewpath.com/services","SetTaskStatus",E)}function GetTodoTasks(E,D,G,F,C,A){var H=new Array(10);H[0]="token";H[1]=D;H[2]="teamId";H[3]=G;H[4]="showBlocked";H[5]=F;H[6]="showCompletedFrom";H[7]=C;H[8]="showUpcomingTill";H[9]=A;var B=function(I){getSoapResult(I);if(I.error==null){I.result=ParsePublicTaskArray(I.result)}if(E!=null){E(I)}};invoke(B,null,"Services/TaskService.asmx","http://viewpath.com/services","GetTodoTasks",H)}function CreateTask(D,M,C,V,H,d,T,a,I,U,R,B,Y,S,P,b,N,A,J,Q,c,Z,G,O,F,E,X,W){var L=new Array(54);L[0]="token";L[1]=M;L[2]="teamId";L[3]=C;L[4]="parentTaskId";L[5]=V;L[6]="typeId";L[7]=H;L[8]="name";L[9]=d;L[10]="work";L[11]=T;L[12]="sort";L[13]=a;L[14]="start";L[15]=I;L[16]="finish";L[17]=U;L[18]="assignments";L[19]=R;L[20]="location";L[21]=B;L[22]="description";L[23]=Y;L[24]="priorityId";L[25]=S;L[26]="complete";L[27]=P;L[28]="locked";L[29]=b;L[30]="scheduled";L[31]=N;L[32]="duration";L[33]=A;L[34]="durationUnitId";L[35]=J;L[36]="lag";L[37]=Q;L[38]="lagUnitId";L[39]=c;L[40]="lagFinish";L[41]=Z;L[42]="milestone";L[43]=G;L[44]="tags";L[45]=O;L[46]="ownerId";L[47]=F;L[48]="ownerName";L[49]=E;L[50]="templateId";L[51]=X;L[52]="sendAssignmentEmails";L[53]=W;var K=function(e){getSoapResult(e);if(e.error==null){e.result=ParsePublicTask(e.result)}if(D!=null){D(e)}};invoke(K,null,"Services/TaskService.asmx","http://viewpath.com/services","CreateTask",L)}function UpdateTask(C,L,E,f,X,O,U,c,H,V,T,B,Q,d,M,Z,R,S,b,A,I,P,e,a,G,N,F,D,Y,W){var K=new Array(58);K[0]="token";K[1]=L;K[2]="taskId";K[3]=E;K[4]="name";K[5]=f;K[6]="description";K[7]=X;K[8]="complete";K[9]=O;K[10]="work";K[11]=U;K[12]="sort";K[13]=c;K[14]="start";K[15]=H;K[16]="finish";K[17]=V;K[18]="priorityId";K[19]=T;K[20]="location";K[21]=B;K[22]="assignments";K[23]=Q;K[24]="locked";K[25]=d;K[26]="scheduled";K[27]=M;K[28]="totalCost";K[29]=Z;K[30]="laborCost";K[31]=R;K[32]="materialCost";K[33]=S;K[34]="otherCost";K[35]=b;K[36]="duration";K[37]=A;K[38]="durationUnitId";K[39]=I;K[40]="lag";K[41]=P;K[42]="lagUnitId";K[43]=e;K[44]="lagFinish";K[45]=a;K[46]="milestone";K[47]=G;K[48]="tags";K[49]=N;K[50]="ownerId";K[51]=F;K[52]="ownerName";K[53]=D;K[54]="hours";K[55]=Y;K[56]="sendAssignmentEmails";K[57]=W;var J=function(g){getSoapResult(g);if(g.error==null){g.result=ParsePublicTask(g.result)}if(C!=null){C(g)}};invoke(J,null,"Services/TaskService.asmx","http://viewpath.com/services","UpdateTask",K)}function GetChildTasks(D,C,G,F,E,A){var H=new Array(10);H[0]="token";H[1]=C;H[2]="teamId";H[3]=G;H[4]="parentTaskId";H[5]=F;H[6]="archived";H[7]=E;H[8]="deleted";H[9]=A;var B=function(I){getSoapResult(I);if(I.error==null){I.result=ParsePublicTaskArray(I.result)}if(D!=null){D(I)}};invoke(B,null,"Services/TaskService.asmx","http://viewpath.com/services","GetChildTasks",H)}function GetTemplates(C,B,D){var E=new Array(4);E[0]="token";E[1]=B;E[2]="teamId";E[3]=D;var A=function(F){getSoapResult(F);if(F.error==null){F.result=ParsePublicTaskArray(F.result)}if(C!=null){C(F)}};invoke(A,null,"Services/TaskService.asmx","http://viewpath.com/services","GetTemplates",E)}function GetHiddenTasks(D,C,F,E,A){var G=new Array(8);G[0]="token";G[1]=C;G[2]="teamId";G[3]=F;G[4]="archived";G[5]=E;G[6]="deleted";G[7]=A;var B=function(H){getSoapResult(H);if(H.error==null){H.result=ParsePublicTaskArray(H.result)}if(D!=null){D(H)}};invoke(B,null,"Services/TaskService.asmx","http://viewpath.com/services","GetHiddenTasks",G)}function CopyTasks(E,D,H,G,C,A){var F=new Array(10);F[0]="token";F[1]=D;F[2]="taskIds";F[3]=H;F[4]="newTeamId";F[5]=G;F[6]="newParentTaskId";F[7]=C;F[8]="insertBeforeId";F[9]=A;var B=function(I){getSoapResult(I);if(I.error==null){I.result=ParsePublicTask(I.result)}if(E!=null){E(I)}};invoke(B,null,"Services/TaskService.asmx","http://viewpath.com/services","CopyTasks",F)}function MoveTasks(E,D,H,G,C,A){var F=new Array(10);F[0]="token";F[1]=D;F[2]="taskIds";F[3]=H;F[4]="newTeamId";F[5]=G;F[6]="newParentTaskId";F[7]=C;F[8]="insertBeforeId";F[9]=A;var B=function(I){getSoapResult(I);if(I.error==null){I.result=(I.result)}if(E!=null){E(I)}};invoke(B,null,"Services/TaskService.asmx","http://viewpath.com/services","MoveTasks",F)}function IndentTasks(C,B,E){var D=new Array(4);D[0]="token";D[1]=B;D[2]="taskIds";D[3]=E;var A=function(F){getSoapResult(F);if(F.error==null){F.result=(F.result)}if(C!=null){C(F)}};invoke(A,null,"Services/TaskService.asmx","http://viewpath.com/services","IndentTasks",D)}function OutdentTasks(C,B,E){var D=new Array(4);D[0]="token";D[1]=B;D[2]="taskIds";D[3]=E;var A=function(F){getSoapResult(F);if(F.error==null){F.result=(F.result)}if(C!=null){C(F)}};invoke(A,null,"Services/TaskService.asmx","http://viewpath.com/services","OutdentTasks",D)}function UpdateTaskSort(D,C,B){var E=new Array(4);E[0]="token";E[1]=C;E[2]="idSortPairs";E[3]=B;var A=function(F){getSoapResult(F);if(F.error==null){F.result=parseBoolean(F.result)}if(D!=null){D(F)}};invoke(A,null,"Services/TaskService.asmx","http://viewpath.com/services","UpdateTaskSort",E)}function DeleteTask(D,C,B){var E=new Array(4);E[0]="token";E[1]=C;E[2]="taskId";E[3]=B;var A=function(F){getSoapResult(F);if(F.error==null){F.result=parseNumber(F.result)}if(D!=null){D(F)}};invoke(A,null,"Services/TaskService.asmx","http://viewpath.com/services","DeleteTask",E)}function GetTaskAncestors(D,C,B){var E=new Array(4);E[0]="token";E[1]=C;E[2]="taskId";E[3]=B;var A=function(F){getSoapResult(F);if(F.error==null){F.result=ParsePublicTaskArray(F.result)}if(D!=null){D(F)}};invoke(A,null,"Services/TaskService.asmx","http://viewpath.com/services","GetTaskAncestors",E)}function GetTask(D,C,B){var E=new Array(4);E[0]="token";E[1]=C;E[2]="taskId";E[3]=B;var A=function(F){getSoapResult(F);if(F.error==null){F.result=ParsePublicTask(F.result)}if(D!=null){D(F)}};invoke(A,null,"Services/TaskService.asmx","http://viewpath.com/services","GetTask",E)}function GetChildDependencies(C,B,E,D){var F=new Array(6);F[0]="token";F[1]=B;F[2]="teamId";F[3]=E;F[4]="parentTaskId";F[5]=D;var A=function(G){getSoapResult(G);if(G.error==null){G.result=ParsePublicDependencyArray(G.result)}if(C!=null){C(G)}};invoke(A,null,"Services/TaskService.asmx","http://viewpath.com/services","GetChildDependencies",F)}function CreateDependency(I,F,B,A,C,E,H){var G=new Array(12);G[0]="token";G[1]=F;G[2]="blockingTaskId";G[3]=B;G[4]="waitingTaskId";G[5]=A;G[6]="blockingEnd";G[7]=C;G[8]="waitingEnd";G[9]=E;G[10]="lagTime";G[11]=H;var D=function(J){getSoapResult(J);if(J.error==null){J.result=ParsePublicDependency(J.result)}if(I!=null){I(J)}};invoke(D,null,"Services/TaskService.asmx","http://viewpath.com/services","CreateDependency",G)}function DeleteDependency(C,B,D,F){var E=new Array(6);E[0]="token";E[1]=B;E[2]="blockingTaskId";E[3]=D;E[4]="waitingTaskId";E[5]=F;var A=function(G){getSoapResult(G);if(G.error==null){G.result=parseNumber(G.result)}if(C!=null){C(G)}};invoke(A,null,"Services/TaskService.asmx","http://viewpath.com/services","DeleteDependency",E)}function GetEvents(D,C,G,B,E){var F=new Array(8);F[0]="token";F[1]=C;F[2]="start";F[3]=G;F[4]="finish";F[5]=B;F[6]="teamId";F[7]=E;var A=function(H){getSoapResult(H);if(H.error==null){H.result=ParsePublicTaskArray(H.result)}if(D!=null){D(H)}};invoke(A,null,"Services/TaskService.asmx","http://viewpath.com/services","GetEvents",F)}function CountEvents(D,B,C,E){var F=new Array(6);F[0]="token";F[1]=B;F[2]="year";F[3]=C;F[4]="teamId";F[5]=E;var A=function(G){getSoapResult(G);if(G.error==null){G.result=ParseEventCountArray(G.result)}if(D!=null){D(G)}};invoke(A,null,"Services/TaskService.asmx","http://viewpath.com/services","CountEvents",F)}function SendNotificationEmails(D,C,H,B,E,G){var F=new Array(10);F[0]="token";F[1]=C;F[2]="emails";F[3]=H;F[4]="subject";F[5]=B;F[6]="message";F[7]=E;F[8]="taskIds";F[9]=G;var A=function(I){getSoapResult(I);if(I.error==null){I.result=(I.result)}if(D!=null){D(I)}};invoke(A,null,"Services/TaskService.asmx","http://viewpath.com/services","SendNotificationEmails",F)}function GetOwnerAssigneeEmails(C,B,E){var D=new Array(4);D[0]="token";D[1]=B;D[2]="taskIds";D[3]=E;var A=function(F){getSoapResult(F);if(F.error==null){F.result=parseString(F.result)}if(C!=null){C(F)}};invoke(A,null,"Services/TaskService.asmx","http://viewpath.com/services","GetOwnerAssigneeEmails",D)}function Login(D,C,B){var E=new Array(4);E[0]="email";E[1]=C;E[2]="password";E[3]=B;var A=function(F){getSoapResult(F);if(F.error==null){F.result=parseString(F.result)}if(D!=null){D(F)}};invoke(A,null,"Services/PersonService.asmx","http://viewpath.com/services","Login",E)}function CreatePerson(E,D,C,B){var F=new Array(6);F[0]="name";F[1]=D;F[2]="email";F[3]=C;F[4]="password";F[5]=B;var A=function(G){getSoapResult(G);if(G.error==null){G.result=parseString(G.result)}if(E!=null){E(G)}};invoke(A,null,"Services/PersonService.asmx","http://viewpath.com/services","CreatePerson",F)}function UpdatePerson(B,Q,S,J,A,R,M,O,F,D,C,P,N,L,I,E,K){var H=new Array(32);H[0]="personId";H[1]=Q;H[2]="name";H[3]=S;H[4]="email";H[5]=J;H[6]="password";H[7]=A;H[8]="title";H[9]=R;H[10]="companyname";H[11]=M;H[12]="department";H[13]=O;H[14]="workphone";H[15]=F;H[16]="cellphone";H[17]=D;H[18]="homephone";H[19]=C;H[20]="address1";H[21]=P;H[22]="address2";H[23]=N;H[24]="city";H[25]=L;H[26]="stateId";H[27]=I;H[28]="zipcode";H[29]=E;H[30]="countryId";H[31]=K;var G=function(T){getSoapResult(T);if(T.error==null){T.result=ParsePublicPerson(T.result)}if(B!=null){B(T)}};invoke(G,null,"Services/PersonService.asmx","http://viewpath.com/services","UpdatePerson",H)}function CreateOrUpdateBookmark(G,F,E,D,C,B){var H=new Array(10);H[0]="token";H[1]=F;H[2]="docId";H[3]=E;H[4]="taskId";H[5]=D;H[6]="name";H[7]=C;H[8]="url";H[9]=B;var A=function(I){getSoapResult(I);if(I.error==null){I.result=parseNumber(I.result)}if(G!=null){G(I)}};invoke(A,null,"Services/DocumentService.asmx","http://viewpath.com/services","CreateOrUpdateBookmark",H)}function GetDocuments(E,D,C,A){var F=new Array(6);F[0]="token";F[1]=D;F[2]="taskId";F[3]=C;F[4]="deleted";F[5]=A;var B=function(G){getSoapResult(G);if(G.error==null){G.result=ParsePublicDocumentArray(G.result)}if(E!=null){E(G)}};invoke(B,null,"Services/DocumentService.asmx","http://viewpath.com/services","GetDocuments",F)}function GetDocumentVersions(D,B,C){var E=new Array(4);E[0]="token";E[1]=B;E[2]="documentId";E[3]=C;var A=function(F){getSoapResult(F);if(F.error==null){F.result=ParsePublicDocumentVersionArray(F.result)}if(D!=null){D(F)}};invoke(A,null,"Services/DocumentService.asmx","http://viewpath.com/services","GetDocumentVersions",E)}function SetDeletedDocument(F,D,C,E,A){var G=new Array(8);G[0]="token";G[1]=D;G[2]="taskId";G[3]=C;G[4]="documentId";G[5]=E;G[6]="deleted";G[7]=A;var B=function(H){getSoapResult(H);if(H.error==null){H.result=parseBoolean(H.result)}if(F!=null){F(H)}};invoke(B,null,"Services/DocumentService.asmx","http://viewpath.com/services","SetDeletedDocument",G)}function RenameDocument(E,C,D,B){var F=new Array(6);F[0]="token";F[1]=C;F[2]="documentId";F[3]=D;F[4]="name";F[5]=B;var A=function(G){getSoapResult(G);if(G.error==null){G.result=parseNumber(G.result)}if(E!=null){E(G)}};invoke(A,null,"Services/DocumentService.asmx","http://viewpath.com/services","RenameDocument",F)}function UpdateDocumentUrl(E,C,D,B){var F=new Array(6);F[0]="token";F[1]=C;F[2]="documentId";F[3]=D;F[4]="url";F[5]=B;var A=function(G){getSoapResult(G);if(G.error==null){G.result=parseNumber(G.result)}if(E!=null){E(G)}};invoke(A,null,"Services/DocumentService.asmx","http://viewpath.com/services","UpdateDocumentUrl",F)}function DeleteNote(D,B,C){var E=new Array(4);E[0]="token";E[1]=B;E[2]="noteId";E[3]=C;var A=function(F){getSoapResult(F);if(F.error==null){F.result=parseBoolean(F.result)}if(D!=null){D(F)}};invoke(A,null,"Services/DocumentService.asmx","http://viewpath.com/services","DeleteNote",E)}function CreateOrUpdateNote(E,C,D,B,G){var F=new Array(8);F[0]="token";F[1]=C;F[2]="noteId";F[3]=D;F[4]="taskId";F[5]=B;F[6]="text";F[7]=G;var A=function(H){getSoapResult(H);if(H.error==null){H.result=parseBoolean(H.result)}if(E!=null){E(H)}};invoke(A,null,"Services/DocumentService.asmx","http://viewpath.com/services","CreateOrUpdateNote",F)}function GetNotes(D,C,B){var E=new Array(4);E[0]="token";E[1]=C;E[2]="taskId";E[3]=B;var A=function(F){getSoapResult(F);if(F.error==null){F.result=ParsePublicNoteArray(F.result)}if(D!=null){D(F)}};invoke(A,null,"Services/DocumentService.asmx","http://viewpath.com/services","GetNotes",E)}function FindMember(D,C,B){var E=new Array(4);E[0]="token";E[1]=C;E[2]="name";E[3]=B;var A=function(F){getSoapResult(F);if(F.error==null){F.result=ParsePublicMember(F.result)}if(D!=null){D(F)}};invoke(A,null,"Services/SearchService.asmx","http://viewpath.com/services","FindMember",E)}function CreateOrUpdateSearch(D,C,B,E){var F=new Array(6);F[0]="token";F[1]=C;F[2]="name";F[3]=B;F[4]="value";F[5]=E;var A=function(G){getSoapResult(G);if(G.error==null){G.result=(G.result)}if(D!=null){D(G)}};invoke(A,null,"Services/SearchService.asmx","http://viewpath.com/services","CreateOrUpdateSearch",F)}function DeleteSearch(C,B,E){var D=new Array(4);D[0]="token";D[1]=B;D[2]="id";D[3]=E;var A=function(F){getSoapResult(F);if(F.error==null){F.result=parseBoolean(F.result)}if(C!=null){C(F)}};invoke(A,null,"Services/SearchService.asmx","http://viewpath.com/services","DeleteSearch",D)}function GetSearches(C,B){var D=new Array(2);D[0]="token";D[1]=B;var A=function(E){getSoapResult(E);if(E.error==null){E.result=ParsePublicSearchArray(E.result)}if(C!=null){C(E)}};invoke(A,null,"Services/SearchService.asmx","http://viewpath.com/services","GetSearches",D)}function Search(D,C,B){var E=new Array(4);E[0]="token";E[1]=C;E[2]="search";E[3]=B;var A=function(F){getSoapResult(F);if(F.error==null){F.result=ParsePublicTaskArray(F.result)}if(D!=null){D(F)}};invoke(A,null,"Services/SearchService.asmx","http://viewpath.com/services","Search",E)}function Schedule(L,V,S,E,U,T,J,C,D,I,R,B,H,N,M,G,P,K,Q,F,O,A){this.Id=L;this.PersonId=V;this.TeamId=S;this.TimeZoneId=E;this.SundayStart=U;this.MondayStart=T;this.TuesdayStart=J;this.WednesdayStart=C;this.ThursdayStart=D;this.FridayStart=I;this.SaturdayStart=R;this.SundayFinish=B;this.MondayFinish=H;this.TuesdayFinish=N;this.WednesdayFinish=M;this.ThursdayFinish=G;this.FridayFinish=P;this.SaturdayFinish=K;this.Created=Q;this.Modified=F;this.CreatedBy=O;this.ModifiedBy=A;this.toString=Schedule_toString}function Schedule_toString(A){var B="";B+=toSoapXmlElement("I32",this.Id);B+=toSoapXmlElement("P19",this.PersonId);B+=toSoapXmlElement("T38",this.TeamId);B+=toSoapXmlElement("T39",this.TimeZoneId);B+=toSoapXmlElement("S29",this.SundayStart);B+=toSoapXmlElement("M40",this.MondayStart);B+=toSoapXmlElement("T40",this.TuesdayStart);B+=toSoapXmlElement("W9",this.WednesdayStart);B+=toSoapXmlElement("T41",this.ThursdayStart);B+=toSoapXmlElement("F6",this.FridayStart);B+=toSoapXmlElement("S30",this.SaturdayStart);B+=toSoapXmlElement("S31",this.SundayFinish);B+=toSoapXmlElement("M41",this.MondayFinish);B+=toSoapXmlElement("T42",this.TuesdayFinish);B+=toSoapXmlElement("W10",this.WednesdayFinish);B+=toSoapXmlElement("T43",this.ThursdayFinish);B+=toSoapXmlElement("F7",this.FridayFinish);B+=toSoapXmlElement("S32",this.SaturdayFinish);B+=toSoapXmlElement("C61",this.Created);B+=toSoapXmlElement("M42",this.Modified);B+=toSoapXmlElement("C62",this.CreatedBy);B+=toSoapXmlElement("M43",this.ModifiedBy);return B}var regex_Schedule_Id=/(<I32>)([\w\W]*?)<\/I32>/;var regex_Schedule_PersonId=/(<P19>)([\w\W]*?)<\/P19>/;var regex_Schedule_TeamId=/(<T38>)([\w\W]*?)<\/T38>/;var regex_Schedule_TimeZoneId=/(<T39>)([\w\W]*?)<\/T39>/;var regex_Schedule_SundayStart=/(<S29>)([\w\W]*?)<\/S29>/;var regex_Schedule_MondayStart=/(<M40>)([\w\W]*?)<\/M40>/;var regex_Schedule_TuesdayStart=/(<T40>)([\w\W]*?)<\/T40>/;var regex_Schedule_WednesdayStart=/(<W9>)([\w\W]*?)<\/W9>/;var regex_Schedule_ThursdayStart=/(<T41>)([\w\W]*?)<\/T41>/;var regex_Schedule_FridayStart=/(<F6>)([\w\W]*?)<\/F6>/;var regex_Schedule_SaturdayStart=/(<S30>)([\w\W]*?)<\/S30>/;var regex_Schedule_SundayFinish=/(<S31>)([\w\W]*?)<\/S31>/;var regex_Schedule_MondayFinish=/(<M41>)([\w\W]*?)<\/M41>/;var regex_Schedule_TuesdayFinish=/(<T42>)([\w\W]*?)<\/T42>/;var regex_Schedule_WednesdayFinish=/(<W10>)([\w\W]*?)<\/W10>/;var regex_Schedule_ThursdayFinish=/(<T43>)([\w\W]*?)<\/T43>/;var regex_Schedule_FridayFinish=/(<F7>)([\w\W]*?)<\/F7>/;var regex_Schedule_SaturdayFinish=/(<S32>)([\w\W]*?)<\/S32>/;var regex_Schedule_Created=/(<C61>)([\w\W]*?)<\/C61>/;var regex_Schedule_Modified=/(<M42>)([\w\W]*?)<\/M42>/;var regex_Schedule_CreatedBy=/(<C62>)([\w\W]*?)<\/C62>/;var regex_Schedule_ModifiedBy=/(<M43>)([\w\W]*?)<\/M43>/;function ParseSchedule(A){if(A==null){return null}var B=new Schedule();if(A.match(regex_Schedule_Id)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Id=parseNumber(RegExp.$2)}if(A.match(regex_Schedule_PersonId)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.PersonId=parseNumber(RegExp.$2)}if(A.match(regex_Schedule_TeamId)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.TeamId=parseNumber(RegExp.$2)}if(A.match(regex_Schedule_TimeZoneId)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.TimeZoneId=parseNumber(RegExp.$2)}if(A.match(regex_Schedule_SundayStart)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.SundayStart=parseNumber(RegExp.$2)}if(A.match(regex_Schedule_MondayStart)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.MondayStart=parseNumber(RegExp.$2)}if(A.match(regex_Schedule_TuesdayStart)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.TuesdayStart=parseNumber(RegExp.$2)}if(A.match(regex_Schedule_WednesdayStart)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.WednesdayStart=parseNumber(RegExp.$2)}if(A.match(regex_Schedule_ThursdayStart)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.ThursdayStart=parseNumber(RegExp.$2)}if(A.match(regex_Schedule_FridayStart)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.FridayStart=parseNumber(RegExp.$2)}if(A.match(regex_Schedule_SaturdayStart)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.SaturdayStart=parseNumber(RegExp.$2)}if(A.match(regex_Schedule_SundayFinish)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.SundayFinish=parseNumber(RegExp.$2)}if(A.match(regex_Schedule_MondayFinish)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.MondayFinish=parseNumber(RegExp.$2)}if(A.match(regex_Schedule_TuesdayFinish)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.TuesdayFinish=parseNumber(RegExp.$2)}if(A.match(regex_Schedule_WednesdayFinish)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.WednesdayFinish=parseNumber(RegExp.$2)}if(A.match(regex_Schedule_ThursdayFinish)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.ThursdayFinish=parseNumber(RegExp.$2)}if(A.match(regex_Schedule_FridayFinish)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.FridayFinish=parseNumber(RegExp.$2)}if(A.match(regex_Schedule_SaturdayFinish)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.SaturdayFinish=parseNumber(RegExp.$2)}if(A.match(regex_Schedule_Created)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Created=parseSoapDate(RegExp.$2)}if(A.match(regex_Schedule_Modified)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Modified=parseSoapDate(RegExp.$2)}if(A.match(regex_Schedule_CreatedBy)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.CreatedBy=parseNumber(RegExp.$2)}if(A.match(regex_Schedule_ModifiedBy)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.ModifiedBy=parseNumber(RegExp.$2)}return B}function ParseScheduleArray(A){if(A==null){return null}var D=/<S28>([\w\W]*?)<\/S28>/g;var C=A.match(D);if(C!=null){for(var B=0;B<C.length;B++){C[B]=ParseSchedule(C[B])}}return C}function ScheduleData(J,I,L,C,M,G,D,E,K,A,H,N,F,B){this.SundayStart=J;this.MondayStart=I;this.TuesdayStart=L;this.WednesdayStart=C;this.ThursdayStart=M;this.FridayStart=G;this.SaturdayStart=D;this.SundayFinish=E;this.MondayFinish=K;this.TuesdayFinish=A;this.WednesdayFinish=H;this.ThursdayFinish=N;this.FridayFinish=F;this.SaturdayFinish=B;this.toString=ScheduleData_toString}function ScheduleData_toString(A){var B="";B+=toSoapXmlElement("SundayStart",this.SundayStart);B+=toSoapXmlElement("MondayStart",this.MondayStart);B+=toSoapXmlElement("TuesdayStart",this.TuesdayStart);B+=toSoapXmlElement("WednesdayStart",this.WednesdayStart);B+=toSoapXmlElement("ThursdayStart",this.ThursdayStart);B+=toSoapXmlElement("FridayStart",this.FridayStart);B+=toSoapXmlElement("SaturdayStart",this.SaturdayStart);B+=toSoapXmlElement("SundayFinish",this.SundayFinish);B+=toSoapXmlElement("MondayFinish",this.MondayFinish);B+=toSoapXmlElement("TuesdayFinish",this.TuesdayFinish);B+=toSoapXmlElement("WednesdayFinish",this.WednesdayFinish);B+=toSoapXmlElement("ThursdayFinish",this.ThursdayFinish);B+=toSoapXmlElement("FridayFinish",this.FridayFinish);B+=toSoapXmlElement("SaturdayFinish",this.SaturdayFinish);return B}var regex_ScheduleData_SundayStart=/(<SundayStart>)([\w\W]*?)<\/SundayStart>/;var regex_ScheduleData_MondayStart=/(<MondayStart>)([\w\W]*?)<\/MondayStart>/;var regex_ScheduleData_TuesdayStart=/(<TuesdayStart>)([\w\W]*?)<\/TuesdayStart>/;var regex_ScheduleData_WednesdayStart=/(<WednesdayStart>)([\w\W]*?)<\/WednesdayStart>/;var regex_ScheduleData_ThursdayStart=/(<ThursdayStart>)([\w\W]*?)<\/ThursdayStart>/;var regex_ScheduleData_FridayStart=/(<FridayStart>)([\w\W]*?)<\/FridayStart>/;var regex_ScheduleData_SaturdayStart=/(<SaturdayStart>)([\w\W]*?)<\/SaturdayStart>/;var regex_ScheduleData_SundayFinish=/(<SundayFinish>)([\w\W]*?)<\/SundayFinish>/;var regex_ScheduleData_MondayFinish=/(<MondayFinish>)([\w\W]*?)<\/MondayFinish>/;var regex_ScheduleData_TuesdayFinish=/(<TuesdayFinish>)([\w\W]*?)<\/TuesdayFinish>/;var regex_ScheduleData_WednesdayFinish=/(<WednesdayFinish>)([\w\W]*?)<\/WednesdayFinish>/;var regex_ScheduleData_ThursdayFinish=/(<ThursdayFinish>)([\w\W]*?)<\/ThursdayFinish>/;var regex_ScheduleData_FridayFinish=/(<FridayFinish>)([\w\W]*?)<\/FridayFinish>/;var regex_ScheduleData_SaturdayFinish=/(<SaturdayFinish>)([\w\W]*?)<\/SaturdayFinish>/;function ParseScheduleData(A){if(A==null){return null}var B=new ScheduleData();if(A.match(regex_ScheduleData_SundayStart)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.SundayStart=parseNumber(RegExp.$2)}if(A.match(regex_ScheduleData_MondayStart)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.MondayStart=parseNumber(RegExp.$2)}if(A.match(regex_ScheduleData_TuesdayStart)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.TuesdayStart=parseNumber(RegExp.$2)}if(A.match(regex_ScheduleData_WednesdayStart)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.WednesdayStart=parseNumber(RegExp.$2)}if(A.match(regex_ScheduleData_ThursdayStart)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.ThursdayStart=parseNumber(RegExp.$2)}if(A.match(regex_ScheduleData_FridayStart)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.FridayStart=parseNumber(RegExp.$2)}if(A.match(regex_ScheduleData_SaturdayStart)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.SaturdayStart=parseNumber(RegExp.$2)}if(A.match(regex_ScheduleData_SundayFinish)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.SundayFinish=parseNumber(RegExp.$2)}if(A.match(regex_ScheduleData_MondayFinish)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.MondayFinish=parseNumber(RegExp.$2)}if(A.match(regex_ScheduleData_TuesdayFinish)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.TuesdayFinish=parseNumber(RegExp.$2)}if(A.match(regex_ScheduleData_WednesdayFinish)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.WednesdayFinish=parseNumber(RegExp.$2)}if(A.match(regex_ScheduleData_ThursdayFinish)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.ThursdayFinish=parseNumber(RegExp.$2)}if(A.match(regex_ScheduleData_FridayFinish)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.FridayFinish=parseNumber(RegExp.$2)}if(A.match(regex_ScheduleData_SaturdayFinish)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.SaturdayFinish=parseNumber(RegExp.$2)}return B}function ParseScheduleDataArray(B){if(B==null){return null}var A=/<ScheduleData>([\w\W]*?)<\/ScheduleData>/g;var D=B.match(A);if(D!=null){for(var C=0;C<D.length;C++){D[C]=ParseScheduleData(D[C])}}return D}function PublicTeam(E,G,K,B,I,A,H,C,L,D,J,F){this.Id=E;this.Name=G;this.Message=K;this.Type=B;this.TimeSheetsEnabled=I;this.Created=A;this.Modified=H;this.CreatedBy=C;this.ModifiedBy=L;this.Schedule=D;this.Member=J;this.Tags=F;this.toString=PublicTeam_toString}function PublicTeam_toString(A){var B="";B+=toSoapXmlElement("I53",this.Id);B+=toSoapXmlElement("N35",this.Name);B+=toSoapXmlElement("M56",this.Message);B+=toSoapXmlElement("T56",this.Type);B+=toSoapXmlElement("T57",this.TimeSheetsEnabled);B+=toSoapXmlElement("C85",this.Created);B+=toSoapXmlElement("M57",this.Modified);B+=toSoapXmlElement("C86",this.CreatedBy);B+=toSoapXmlElement("M58",this.ModifiedBy);B+=toSoapXmlElement("Schedule",this.Schedule);B+=toSoapXmlElement("Member",this.Member);B+=toSoapXmlElement("Tags",this.Tags);return B}var regex_PublicTeam_Id=/(<I53>)([\w\W]*?)<\/I53>/;var regex_PublicTeam_Name=/(<N35>)([\w\W]*?)<\/N35>/;var regex_PublicTeam_Message=/(<M56>)([\w\W]*?)<\/M56>/;var regex_PublicTeam_Type=/(<T56>)([\w\W]*?)<\/T56>/;var regex_PublicTeam_TimeSheetsEnabled=/(<T57>)([\w\W]*?)<\/T57>/;var regex_PublicTeam_Created=/(<C85>)([\w\W]*?)<\/C85>/;var regex_PublicTeam_Modified=/(<M57>)([\w\W]*?)<\/M57>/;var regex_PublicTeam_CreatedBy=/(<C86>)([\w\W]*?)<\/C86>/;var regex_PublicTeam_ModifiedBy=/(<M58>)([\w\W]*?)<\/M58>/;var regex_PublicTeam_Schedule=/(<Schedule>)([\w\W]*?)<\/Schedule>/;var regex_PublicTeam_Member=/(<Member>)([\w\W]*?)<\/Member>/;var regex_PublicTeam_Tags=/(<Tags>)([\w\W]*?)<\/Tags>/;function ParsePublicTeam(A){if(A==null){return null}var B=new PublicTeam();if(A.match(regex_PublicTeam_Id)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Id=parseNumber(RegExp.$2)}if(A.match(regex_PublicTeam_Name)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Name=parseString(RegExp.$2)}if(A.match(regex_PublicTeam_Message)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Message=parseString(RegExp.$2)}if(A.match(regex_PublicTeam_Type)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Type=parseNumber(RegExp.$2)}if(A.match(regex_PublicTeam_TimeSheetsEnabled)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.TimeSheetsEnabled=parseBoolean(RegExp.$2)}if(A.match(regex_PublicTeam_Created)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Created=parseSoapDate(RegExp.$2)}if(A.match(regex_PublicTeam_Modified)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Modified=parseSoapDate(RegExp.$2)}if(A.match(regex_PublicTeam_CreatedBy)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.CreatedBy=parseNumber(RegExp.$2)}if(A.match(regex_PublicTeam_ModifiedBy)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.ModifiedBy=parseNumber(RegExp.$2)}if(A.match(regex_PublicTeam_Schedule)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Schedule=ParseSchedule(RegExp.$2)}if(A.match(regex_PublicTeam_Member)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Member=ParsePublicMember(RegExp.$2)}if(A.match(regex_PublicTeam_Tags)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Tags=ParseTagArray(RegExp.$2)}return B}function ParsePublicTeamArray(A){if(A==null){return null}var C=/<P33>([\w\W]*?)<\/P33>/g;var D=A.match(C);if(D!=null){for(var B=0;B<D.length;B++){D[B]=ParsePublicTeam(D[B])}}return D}function PublicTask(F,A,T,Y,Z,G,L,W,N,l,S,R,q,V,a,B,o,n,r,C,v,b,Q,h,j,D,e,P,f,E,O,u,J,s,t,M,X,K,d,c,p,g,H,I,U,k){this.Id=F;this.TeamId=A;this.ParentId=T;this.TypeId=Y;this.ProjectId=Z;this.Name=G;this.Description=L;this.Template=W;this.Assignments=N;this.Complete=l;this.Work=S;this.PriorityId=R;this.ChildCount=q;this.ChildDeletedCount=V;this.ChildArchiveCount=a;this.DocumentCount=B;this.DocumentDeletedCount=o;this.Location=n;this.NoteCount=r;this.Locked=C;this.Duration=v;this.DurationUnitId=b;this.Lag=Q;this.LagUnitId=h;this.Sort=j;this.Status=D;this.Milestone=e;this.Tags=P;this.Blocked=f;this.CreatedBy=E;this.ModifiedBy=O;this.ProjectName=u;this.TeamName=J;this.OwnerId=s;this.OwnerInitials=t;this.OwnerName=M;this.Scheduled=X;this.Start=K;this.Finish=d;this.Created=c;this.Modified=p;this.Completed=g;this.TotalCost=H;this.LaborCost=I;this.MaterialCost=U;this.OtherCost=k;this.toString=PublicTask_toString}function PublicTask_toString(A){var B="";B+=toSoapXmlElement("I54",this.Id);B+=toSoapXmlElement("T58",this.TeamId);B+=toSoapXmlElement("P35",this.ParentId);B+=toSoapXmlElement("T59",this.TypeId);B+=toSoapXmlElement("P36",this.ProjectId);B+=toSoapXmlElement("N36",this.Name);B+=toSoapXmlElement("D41",this.Description);B+=toSoapXmlElement("T60",this.Template);B+=toSoapXmlElement("A51",this.Assignments);B+=toSoapXmlElement("C87",this.Complete);B+=toSoapXmlElement("W12",this.Work);B+=toSoapXmlElement("P37",this.PriorityId);B+=toSoapXmlElement("C88",this.ChildCount);B+=toSoapXmlElement("C89",this.ChildDeletedCount);B+=toSoapXmlElement("C90",this.ChildArchiveCount);B+=toSoapXmlElement("D42",this.DocumentCount);B+=toSoapXmlElement("D43",this.DocumentDeletedCount);B+=toSoapXmlElement("L12",this.Location);B+=toSoapXmlElement("N37",this.NoteCount);B+=toSoapXmlElement("L13",this.Locked);B+=toSoapXmlElement("D44",this.Duration);B+=toSoapXmlElement("D45",this.DurationUnitId);B+=toSoapXmlElement("L14",this.Lag);B+=toSoapXmlElement("L15",this.LagUnitId);B+=toSoapXmlElement("S42",this.Sort);B+=toSoapXmlElement("S43",this.Status);B+=toSoapXmlElement("M59",this.Milestone);B+=toSoapXmlElement("T61",this.Tags);B+=toSoapXmlElement("B21",this.Blocked);B+=toSoapXmlElement("C91",this.CreatedBy);B+=toSoapXmlElement("M60",this.ModifiedBy);B+=toSoapXmlElement("P38",this.ProjectName);B+=toSoapXmlElement("T62",this.TeamName);B+=toSoapXmlElement("O11",this.OwnerId);B+=toSoapXmlElement("O12",this.OwnerInitials);B+=toSoapXmlElement("O13",this.OwnerName);B+=toSoapXmlElement("S44",this.Scheduled);B+=toSoapXmlElement("S45",this.Start);B+=toSoapXmlElement("F13",this.Finish);B+=toSoapXmlElement("C92",this.Created);B+=toSoapXmlElement("M61",this.Modified);B+=toSoapXmlElement("C93",this.Completed);B+=toSoapXmlElement("T63",this.TotalCost);B+=toSoapXmlElement("L16",this.LaborCost);B+=toSoapXmlElement("M62",this.MaterialCost);B+=toSoapXmlElement("O14",this.OtherCost);return B}var regex_PublicTask_Id=/(<I54>)([\w\W]*?)<\/I54>/;var regex_PublicTask_TeamId=/(<T58>)([\w\W]*?)<\/T58>/;var regex_PublicTask_ParentId=/(<P35>)([\w\W]*?)<\/P35>/;var regex_PublicTask_TypeId=/(<T59>)([\w\W]*?)<\/T59>/;var regex_PublicTask_ProjectId=/(<P36>)([\w\W]*?)<\/P36>/;var regex_PublicTask_Name=/(<N36>)([\w\W]*?)<\/N36>/;var regex_PublicTask_Description=/(<D41>)([\w\W]*?)<\/D41>/;var regex_PublicTask_Template=/(<T60>)([\w\W]*?)<\/T60>/;var regex_PublicTask_Assignments=/(<A51>)([\w\W]*?)<\/A51>/;var regex_PublicTask_Complete=/(<C87>)([\w\W]*?)<\/C87>/;var regex_PublicTask_Work=/(<W12>)([\w\W]*?)<\/W12>/;var regex_PublicTask_PriorityId=/(<P37>)([\w\W]*?)<\/P37>/;var regex_PublicTask_ChildCount=/(<C88>)([\w\W]*?)<\/C88>/;var regex_PublicTask_ChildDeletedCount=/(<C89>)([\w\W]*?)<\/C89>/;var regex_PublicTask_ChildArchiveCount=/(<C90>)([\w\W]*?)<\/C90>/;var regex_PublicTask_DocumentCount=/(<D42>)([\w\W]*?)<\/D42>/;var regex_PublicTask_DocumentDeletedCount=/(<D43>)([\w\W]*?)<\/D43>/;var regex_PublicTask_Location=/(<L12>)([\w\W]*?)<\/L12>/;var regex_PublicTask_NoteCount=/(<N37>)([\w\W]*?)<\/N37>/;var regex_PublicTask_Locked=/(<L13>)([\w\W]*?)<\/L13>/;var regex_PublicTask_Duration=/(<D44>)([\w\W]*?)<\/D44>/;var regex_PublicTask_DurationUnitId=/(<D45>)([\w\W]*?)<\/D45>/;var regex_PublicTask_Lag=/(<L14>)([\w\W]*?)<\/L14>/;var regex_PublicTask_LagUnitId=/(<L15>)([\w\W]*?)<\/L15>/;var regex_PublicTask_Sort=/(<S42>)([\w\W]*?)<\/S42>/;var regex_PublicTask_Status=/(<S43>)([\w\W]*?)<\/S43>/;var regex_PublicTask_Milestone=/(<M59>)([\w\W]*?)<\/M59>/;var regex_PublicTask_Tags=/(<T61>)([\w\W]*?)<\/T61>/;var regex_PublicTask_Blocked=/(<B21>)([\w\W]*?)<\/B21>/;var regex_PublicTask_CreatedBy=/(<C91>)([\w\W]*?)<\/C91>/;var regex_PublicTask_ModifiedBy=/(<M60>)([\w\W]*?)<\/M60>/;var regex_PublicTask_ProjectName=/(<P38>)([\w\W]*?)<\/P38>/;var regex_PublicTask_TeamName=/(<T62>)([\w\W]*?)<\/T62>/;var regex_PublicTask_OwnerId=/(<O11>)([\w\W]*?)<\/O11>/;var regex_PublicTask_OwnerInitials=/(<O12>)([\w\W]*?)<\/O12>/;var regex_PublicTask_OwnerName=/(<O13>)([\w\W]*?)<\/O13>/;var regex_PublicTask_Scheduled=/(<S44>)([\w\W]*?)<\/S44>/;var regex_PublicTask_Start=/(<S45>)([\w\W]*?)<\/S45>/;var regex_PublicTask_Finish=/(<F13>)([\w\W]*?)<\/F13>/;var regex_PublicTask_Created=/(<C92>)([\w\W]*?)<\/C92>/;var regex_PublicTask_Modified=/(<M61>)([\w\W]*?)<\/M61>/;var regex_PublicTask_Completed=/(<C93>)([\w\W]*?)<\/C93>/;var regex_PublicTask_TotalCost=/(<T63>)([\w\W]*?)<\/T63>/;var regex_PublicTask_LaborCost=/(<L16>)([\w\W]*?)<\/L16>/;var regex_PublicTask_MaterialCost=/(<M62>)([\w\W]*?)<\/M62>/;var regex_PublicTask_OtherCost=/(<O14>)([\w\W]*?)<\/O14>/;function ParsePublicTask(A){if(A==null){return null}var B=new PublicTask();if(A.match(regex_PublicTask_Id)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Id=parseNumber(RegExp.$2)}if(A.match(regex_PublicTask_TeamId)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.TeamId=parseNumber(RegExp.$2)}if(A.match(regex_PublicTask_ParentId)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.ParentId=parseNumber(RegExp.$2)}if(A.match(regex_PublicTask_TypeId)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.TypeId=parseNumber(RegExp.$2)}if(A.match(regex_PublicTask_ProjectId)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.ProjectId=parseNumber(RegExp.$2)}if(A.match(regex_PublicTask_Name)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Name=parseString(RegExp.$2)}if(A.match(regex_PublicTask_Description)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Description=parseString(RegExp.$2)}if(A.match(regex_PublicTask_Template)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Template=parseBoolean(RegExp.$2)}if(A.match(regex_PublicTask_Assignments)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Assignments=parseString(RegExp.$2)}if(A.match(regex_PublicTask_Complete)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Complete=parseNumber(RegExp.$2)}if(A.match(regex_PublicTask_Work)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Work=parseNumber(RegExp.$2)}if(A.match(regex_PublicTask_PriorityId)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.PriorityId=parseNumber(RegExp.$2)}if(A.match(regex_PublicTask_ChildCount)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.ChildCount=parseNumber(RegExp.$2)}if(A.match(regex_PublicTask_ChildDeletedCount)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.ChildDeletedCount=parseNumber(RegExp.$2)}if(A.match(regex_PublicTask_ChildArchiveCount)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.ChildArchiveCount=parseNumber(RegExp.$2)}if(A.match(regex_PublicTask_DocumentCount)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.DocumentCount=parseNumber(RegExp.$2)}if(A.match(regex_PublicTask_DocumentDeletedCount)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.DocumentDeletedCount=parseNumber(RegExp.$2)}if(A.match(regex_PublicTask_Location)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Location=parseString(RegExp.$2)}if(A.match(regex_PublicTask_NoteCount)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.NoteCount=parseNumber(RegExp.$2)}if(A.match(regex_PublicTask_Locked)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Locked=parseBoolean(RegExp.$2)}if(A.match(regex_PublicTask_Duration)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Duration=parseNumber(RegExp.$2)}if(A.match(regex_PublicTask_DurationUnitId)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.DurationUnitId=parseNumber(RegExp.$2)}if(A.match(regex_PublicTask_Lag)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Lag=parseNumber(RegExp.$2)}if(A.match(regex_PublicTask_LagUnitId)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.LagUnitId=parseNumber(RegExp.$2)}if(A.match(regex_PublicTask_Sort)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Sort=parseNumber(RegExp.$2)}if(A.match(regex_PublicTask_Status)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Status=parseNumber(RegExp.$2)}if(A.match(regex_PublicTask_Milestone)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Milestone=parseBoolean(RegExp.$2)}if(A.match(regex_PublicTask_Tags)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Tags=parseNumber(RegExp.$2)}if(A.match(regex_PublicTask_Blocked)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Blocked=parseBoolean(RegExp.$2)}if(A.match(regex_PublicTask_CreatedBy)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.CreatedBy=parseNumber(RegExp.$2)}if(A.match(regex_PublicTask_ModifiedBy)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.ModifiedBy=parseNumber(RegExp.$2)}if(A.match(regex_PublicTask_ProjectName)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.ProjectName=parseString(RegExp.$2)}if(A.match(regex_PublicTask_TeamName)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.TeamName=parseString(RegExp.$2)}if(A.match(regex_PublicTask_OwnerId)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.OwnerId=parseNumber(RegExp.$2)}if(A.match(regex_PublicTask_OwnerInitials)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.OwnerInitials=parseString(RegExp.$2)}if(A.match(regex_PublicTask_OwnerName)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.OwnerName=parseString(RegExp.$2)}if(A.match(regex_PublicTask_Scheduled)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Scheduled=parseBoolean(RegExp.$2)}if(A.match(regex_PublicTask_Start)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Start=parseSoapDate(RegExp.$2)}if(A.match(regex_PublicTask_Finish)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Finish=parseSoapDate(RegExp.$2)}if(A.match(regex_PublicTask_Created)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Created=parseSoapDate(RegExp.$2)}if(A.match(regex_PublicTask_Modified)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Modified=parseSoapDate(RegExp.$2)}if(A.match(regex_PublicTask_Completed)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Completed=parseSoapDate(RegExp.$2)}if(A.match(regex_PublicTask_TotalCost)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.TotalCost=parseNumber(RegExp.$2)}if(A.match(regex_PublicTask_LaborCost)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.LaborCost=parseNumber(RegExp.$2)}if(A.match(regex_PublicTask_MaterialCost)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.MaterialCost=parseNumber(RegExp.$2)}if(A.match(regex_PublicTask_OtherCost)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.OtherCost=parseNumber(RegExp.$2)}return B}function ParsePublicTaskArray(A){if(A==null){return null}var C=/<P34>([\w\W]*?)<\/P34>/g;var D=A.match(C);if(D!=null){for(var B=0;B<D.length;B++){D[B]=ParsePublicTask(D[B])}}return D}function PublicNote(D,C,H,B,A,I,G,F,E){this.Id=D;this.Text=C;this.TaskId=H;this.CreatedBy=B;this.Created=A;this.ModifiedBy=I;this.Modified=G;this.CreatedByName=F;this.ModifiedByName=E;this.toString=PublicNote_toString}function PublicNote_toString(A){var B="";B+=toSoapXmlElement("I62",this.Id);B+=toSoapXmlElement("T98",this.Text);B+=toSoapXmlElement("T99",this.TaskId);B+=toSoapXmlElement("C123",this.CreatedBy);B+=toSoapXmlElement("C124",this.Created);B+=toSoapXmlElement("M87",this.ModifiedBy);B+=toSoapXmlElement("M88",this.Modified);B+=toSoapXmlElement("C125",this.CreatedByName);B+=toSoapXmlElement("M89",this.ModifiedByName);return B}var regex_PublicNote_Id=/(<I62>)([\w\W]*?)<\/I62>/;var regex_PublicNote_Text=/(<T98>)([\w\W]*?)<\/T98>/;var regex_PublicNote_TaskId=/(<T99>)([\w\W]*?)<\/T99>/;var regex_PublicNote_CreatedBy=/(<C123>)([\w\W]*?)<\/C123>/;var regex_PublicNote_Created=/(<C124>)([\w\W]*?)<\/C124>/;var regex_PublicNote_ModifiedBy=/(<M87>)([\w\W]*?)<\/M87>/;var regex_PublicNote_Modified=/(<M88>)([\w\W]*?)<\/M88>/;var regex_PublicNote_CreatedByName=/(<C125>)([\w\W]*?)<\/C125>/;var regex_PublicNote_ModifiedByName=/(<M89>)([\w\W]*?)<\/M89>/;function ParsePublicNote(A){if(A==null){return null}var B=new PublicNote();if(A.match(regex_PublicNote_Id)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Id=parseNumber(RegExp.$2)}if(A.match(regex_PublicNote_Text)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Text=parseString(RegExp.$2)}if(A.match(regex_PublicNote_TaskId)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.TaskId=parseNumber(RegExp.$2)}if(A.match(regex_PublicNote_CreatedBy)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.CreatedBy=parseNumber(RegExp.$2)}if(A.match(regex_PublicNote_Created)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Created=parseSoapDate(RegExp.$2)}if(A.match(regex_PublicNote_ModifiedBy)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.ModifiedBy=parseNumber(RegExp.$2)}if(A.match(regex_PublicNote_Modified)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Modified=parseSoapDate(RegExp.$2)}if(A.match(regex_PublicNote_CreatedByName)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.CreatedByName=parseString(RegExp.$2)}if(A.match(regex_PublicNote_ModifiedByName)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.ModifiedByName=parseString(RegExp.$2)}return B}function ParsePublicNoteArray(A){if(A==null){return null}var C=/<P56>([\w\W]*?)<\/P56>/g;var D=A.match(C);if(D!=null){for(var B=0;B<D.length;B++){D[B]=ParsePublicNote(D[B])}}return D}function Tag(D,H,F,E,B,I,A,G,C,J){this.Id=D;this.TeamId=H;this.Name=F;this.Mask=E;this.Color=B;this.Deleted=I;this.Created=A;this.Modified=G;this.CreatedBy=C;this.ModifiedBy=J;this.toString=Tag_toString}function Tag_toString(A){var B="";B+=toSoapXmlElement("I26",this.Id);B+=toSoapXmlElement("T33",this.TeamId);B+=toSoapXmlElement("N19",this.Name);B+=toSoapXmlElement("M30",this.Mask);B+=toSoapXmlElement("C49",this.Color);B+=toSoapXmlElement("D21",this.Deleted);B+=toSoapXmlElement("C50",this.Created);B+=toSoapXmlElement("M31",this.Modified);B+=toSoapXmlElement("C51",this.CreatedBy);B+=toSoapXmlElement("M32",this.ModifiedBy);return B}var regex_Tag_Id=/(<I26>)([\w\W]*?)<\/I26>/;var regex_Tag_TeamId=/(<T33>)([\w\W]*?)<\/T33>/;var regex_Tag_Name=/(<N19>)([\w\W]*?)<\/N19>/;var regex_Tag_Mask=/(<M30>)([\w\W]*?)<\/M30>/;var regex_Tag_Color=/(<C49>)([\w\W]*?)<\/C49>/;var regex_Tag_Deleted=/(<D21>)([\w\W]*?)<\/D21>/;var regex_Tag_Created=/(<C50>)([\w\W]*?)<\/C50>/;var regex_Tag_Modified=/(<M31>)([\w\W]*?)<\/M31>/;var regex_Tag_CreatedBy=/(<C51>)([\w\W]*?)<\/C51>/;var regex_Tag_ModifiedBy=/(<M32>)([\w\W]*?)<\/M32>/;function ParseTag(A){if(A==null){return null}var B=new Tag();if(A.match(regex_Tag_Id)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Id=parseNumber(RegExp.$2)}if(A.match(regex_Tag_TeamId)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.TeamId=parseNumber(RegExp.$2)}if(A.match(regex_Tag_Name)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Name=parseString(RegExp.$2)}if(A.match(regex_Tag_Mask)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Mask=parseNumber(RegExp.$2)}if(A.match(regex_Tag_Color)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Color=parseNumber(RegExp.$2)}if(A.match(regex_Tag_Deleted)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Deleted=parseBoolean(RegExp.$2)}if(A.match(regex_Tag_Created)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Created=parseSoapDate(RegExp.$2)}if(A.match(regex_Tag_Modified)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Modified=parseSoapDate(RegExp.$2)}if(A.match(regex_Tag_CreatedBy)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.CreatedBy=parseNumber(RegExp.$2)}if(A.match(regex_Tag_ModifiedBy)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.ModifiedBy=parseNumber(RegExp.$2)}return B}function ParseTagArray(B){if(B==null){return null}var A=/<T32>([\w\W]*?)<\/T32>/g;var D=B.match(A);if(D!=null){for(var C=0;C<D.length;C++){D[C]=ParseTag(D[C])}}return D}function PublicDocumentVersion(C,H,G,L,K,I,B,F,J,D,A,E){this.DocumentId=C;this.Name=H;this.Mime=G;this.TaskId=L;this.Deleted=K;this.Revision=I;this.Description=B;this.Size=F;this.DownloadCount=J;this.CreatedBy=D;this.Created=A;this.CreatedByName=E;this.toString=PublicDocumentVersion_toString}function PublicDocumentVersion_toString(A){var B="";B+=toSoapXmlElement("D57",this.DocumentId);B+=toSoapXmlElement("N43",this.Name);B+=toSoapXmlElement("M81",this.Mime);B+=toSoapXmlElement("T96",this.TaskId);B+=toSoapXmlElement("D58",this.Deleted);B+=toSoapXmlElement("R5",this.Revision);B+=toSoapXmlElement("D59",this.Description);B+=toSoapXmlElement("S64",this.Size);B+=toSoapXmlElement("D60",this.DownloadCount);B+=toSoapXmlElement("C117",this.CreatedBy);B+=toSoapXmlElement("C118",this.Created);B+=toSoapXmlElement("C119",this.CreatedByName);return B}var regex_PublicDocumentVersion_DocumentId=/(<D57>)([\w\W]*?)<\/D57>/;var regex_PublicDocumentVersion_Name=/(<N43>)([\w\W]*?)<\/N43>/;var regex_PublicDocumentVersion_Mime=/(<M81>)([\w\W]*?)<\/M81>/;var regex_PublicDocumentVersion_TaskId=/(<T96>)([\w\W]*?)<\/T96>/;var regex_PublicDocumentVersion_Deleted=/(<D58>)([\w\W]*?)<\/D58>/;var regex_PublicDocumentVersion_Revision=/(<R5>)([\w\W]*?)<\/R5>/;var regex_PublicDocumentVersion_Description=/(<D59>)([\w\W]*?)<\/D59>/;var regex_PublicDocumentVersion_Size=/(<S64>)([\w\W]*?)<\/S64>/;var regex_PublicDocumentVersion_DownloadCount=/(<D60>)([\w\W]*?)<\/D60>/;var regex_PublicDocumentVersion_CreatedBy=/(<C117>)([\w\W]*?)<\/C117>/;var regex_PublicDocumentVersion_Created=/(<C118>)([\w\W]*?)<\/C118>/;var regex_PublicDocumentVersion_CreatedByName=/(<C119>)([\w\W]*?)<\/C119>/;function ParsePublicDocumentVersion(A){if(A==null){return null}var B=new PublicDocumentVersion();if(A.match(regex_PublicDocumentVersion_DocumentId)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.DocumentId=parseNumber(RegExp.$2)}if(A.match(regex_PublicDocumentVersion_Name)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Name=parseString(RegExp.$2)}if(A.match(regex_PublicDocumentVersion_Mime)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Mime=parseString(RegExp.$2)}if(A.match(regex_PublicDocumentVersion_TaskId)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.TaskId=parseNumber(RegExp.$2)}if(A.match(regex_PublicDocumentVersion_Deleted)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Deleted=parseBoolean(RegExp.$2)}if(A.match(regex_PublicDocumentVersion_Revision)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Revision=parseNumber(RegExp.$2)}if(A.match(regex_PublicDocumentVersion_Description)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Description=parseString(RegExp.$2)}if(A.match(regex_PublicDocumentVersion_Size)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Size=parseNumber(RegExp.$2)}if(A.match(regex_PublicDocumentVersion_DownloadCount)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.DownloadCount=parseNumber(RegExp.$2)}if(A.match(regex_PublicDocumentVersion_CreatedBy)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.CreatedBy=parseNumber(RegExp.$2)}if(A.match(regex_PublicDocumentVersion_Created)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Created=parseSoapDate(RegExp.$2)}if(A.match(regex_PublicDocumentVersion_CreatedByName)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.CreatedByName=parseString(RegExp.$2)}return B}function ParsePublicDocumentVersionArray(A){if(A==null){return null}var C=/<P54>([\w\W]*?)<\/P54>/g;var D=A.match(C);if(D!=null){for(var B=0;B<D.length;B++){D[B]=ParsePublicDocumentVersion(D[B])}}return D}function PublicMember(K,E,M,L,T,S,B,C,H,P,F,O,A,R,G,N,I,D,Q,J){this.Id=K;this.Title=E;this.Notes=M;this.BillRate=L;this.PersonId=T;this.TeamId=S;this.ManagerId=B;this.TypeId=C;this.SubordinateCount=H;this.Created=P;this.Modified=F;this.CreatedBy=O;this.ModifiedBy=A;this.AccountingAccess=R;this.Initials=G;this.Active=N;this.InactiveSubordinateCount=I;this.Name=D;this.Email=Q;this.TimeSheet=J;this.toString=PublicMember_toString}function PublicMember_toString(A){var B="";B+=toSoapXmlElement("I43",this.Id);B+=toSoapXmlElement("T47",this.Title);B+=toSoapXmlElement("N31",this.Notes);B+=toSoapXmlElement("B18",this.BillRate);B+=toSoapXmlElement("P30",this.PersonId);B+=toSoapXmlElement("T48",this.TeamId);B+=toSoapXmlElement("M47",this.ManagerId);B+=toSoapXmlElement("T49",this.TypeId);B+=toSoapXmlElement("S37",this.SubordinateCount);B+=toSoapXmlElement("C79",this.Created);B+=toSoapXmlElement("M48",this.Modified);B+=toSoapXmlElement("C80",this.CreatedBy);B+=toSoapXmlElement("M49",this.ModifiedBy);B+=toSoapXmlElement("A44",this.AccountingAccess);B+=toSoapXmlElement("I44",this.Initials);B+=toSoapXmlElement("A45",this.Active);B+=toSoapXmlElement("I45",this.InactiveSubordinateCount);B+=toSoapXmlElement("N32",this.Name);B+=toSoapXmlElement("E7",this.Email);B+=toSoapXmlElement("TimeSheet",this.TimeSheet);return B}var regex_PublicMember_Id=/(<I43>)([\w\W]*?)<\/I43>/;var regex_PublicMember_Title=/(<T47>)([\w\W]*?)<\/T47>/;var regex_PublicMember_Notes=/(<N31>)([\w\W]*?)<\/N31>/;var regex_PublicMember_BillRate=/(<B18>)([\w\W]*?)<\/B18>/;var regex_PublicMember_PersonId=/(<P30>)([\w\W]*?)<\/P30>/;var regex_PublicMember_TeamId=/(<T48>)([\w\W]*?)<\/T48>/;var regex_PublicMember_ManagerId=/(<M47>)([\w\W]*?)<\/M47>/;var regex_PublicMember_TypeId=/(<T49>)([\w\W]*?)<\/T49>/;var regex_PublicMember_SubordinateCount=/(<S37>)([\w\W]*?)<\/S37>/;var regex_PublicMember_Created=/(<C79>)([\w\W]*?)<\/C79>/;var regex_PublicMember_Modified=/(<M48>)([\w\W]*?)<\/M48>/;var regex_PublicMember_CreatedBy=/(<C80>)([\w\W]*?)<\/C80>/;var regex_PublicMember_ModifiedBy=/(<M49>)([\w\W]*?)<\/M49>/;var regex_PublicMember_AccountingAccess=/(<A44>)([\w\W]*?)<\/A44>/;var regex_PublicMember_Initials=/(<I44>)([\w\W]*?)<\/I44>/;var regex_PublicMember_Active=/(<A45>)([\w\W]*?)<\/A45>/;var regex_PublicMember_InactiveSubordinateCount=/(<I45>)([\w\W]*?)<\/I45>/;var regex_PublicMember_Name=/(<N32>)([\w\W]*?)<\/N32>/;var regex_PublicMember_Email=/(<E7>)([\w\W]*?)<\/E7>/;var regex_PublicMember_TimeSheet=/(<TimeSheet>)([\w\W]*?)<\/TimeSheet>/;function ParsePublicMember(A){if(A==null){return null}var B=new PublicMember();if(A.match(regex_PublicMember_Id)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Id=parseNumber(RegExp.$2)}if(A.match(regex_PublicMember_Title)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Title=parseString(RegExp.$2)}if(A.match(regex_PublicMember_Notes)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Notes=parseString(RegExp.$2)}if(A.match(regex_PublicMember_BillRate)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.BillRate=parseNumber(RegExp.$2)}if(A.match(regex_PublicMember_PersonId)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.PersonId=parseNumber(RegExp.$2)}if(A.match(regex_PublicMember_TeamId)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.TeamId=parseNumber(RegExp.$2)}if(A.match(regex_PublicMember_ManagerId)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.ManagerId=parseNumber(RegExp.$2)}if(A.match(regex_PublicMember_TypeId)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.TypeId=parseNumber(RegExp.$2)}if(A.match(regex_PublicMember_SubordinateCount)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.SubordinateCount=parseNumber(RegExp.$2)}if(A.match(regex_PublicMember_Created)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Created=parseSoapDate(RegExp.$2)}if(A.match(regex_PublicMember_Modified)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Modified=parseSoapDate(RegExp.$2)}if(A.match(regex_PublicMember_CreatedBy)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.CreatedBy=parseNumber(RegExp.$2)}if(A.match(regex_PublicMember_ModifiedBy)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.ModifiedBy=parseNumber(RegExp.$2)}if(A.match(regex_PublicMember_AccountingAccess)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.AccountingAccess=parseNumber(RegExp.$2)}if(A.match(regex_PublicMember_Initials)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Initials=parseString(RegExp.$2)}if(A.match(regex_PublicMember_Active)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Active=parseBoolean(RegExp.$2)}if(A.match(regex_PublicMember_InactiveSubordinateCount)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.InactiveSubordinateCount=parseNumber(RegExp.$2)}if(A.match(regex_PublicMember_Name)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Name=parseString(RegExp.$2)}if(A.match(regex_PublicMember_Email)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Email=parseString(RegExp.$2)}if(A.match(regex_PublicMember_TimeSheet)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.TimeSheet=ParsePublicTimeSheet(RegExp.$2)}return B}function ParsePublicMemberArray(A){if(A==null){return null}var C=/<P29>([\w\W]*?)<\/P29>/g;var D=A.match(C);if(D!=null){for(var B=0;B<D.length;B++){D[B]=ParsePublicMember(D[B])}}return D}function PublicTimeSheet(R,V,K,I,Q,T,W,S,E,A,B,F,J,Y,O,N,H,P,U,D,X,M,C,G,L,Z){this.Id=R;this.Submitted=V;this.SubmittedBy=K;this.Approved=I;this.ApprovedBy=Q;this.CreatedBy=T;this.Created=W;this.Year=S;this.Month=E;this.Day=A;this.MemberId=B;this.TimeSheetId=F;this.Sunday=J;this.Monday=Y;this.Tuesday=O;this.Wednesday=N;this.Thursday=H;this.Friday=P;this.Saturday=U;this.TotalMinutes=D;this.BillValue=X;this.Start=M;this.Finish=C;this.SubmittedByName=G;this.ApprovedByName=L;this.TeamId=Z;this.toString=PublicTimeSheet_toString}function PublicTimeSheet_toString(A){var B="";B+=toSoapXmlElement("I58",this.Id);B+=toSoapXmlElement("S58",this.Submitted);B+=toSoapXmlElement("S59",this.SubmittedBy);B+=toSoapXmlElement("A56",this.Approved);B+=toSoapXmlElement("A57",this.ApprovedBy);B+=toSoapXmlElement("C111",this.CreatedBy);B+=toSoapXmlElement("C112",this.Created);B+=toSoapXmlElement("Y2",this.Year);B+=toSoapXmlElement("M74",this.Month);B+=toSoapXmlElement("D56",this.Day);B+=toSoapXmlElement("M75",this.MemberId);B+=toSoapXmlElement("T91",this.TimeSheetId);B+=toSoapXmlElement("S60",this.Sunday);B+=toSoapXmlElement("M76",this.Monday);B+=toSoapXmlElement("T92",this.Tuesday);B+=toSoapXmlElement("W17",this.Wednesday);B+=toSoapXmlElement("T93",this.Thursday);B+=toSoapXmlElement("F18",this.Friday);B+=toSoapXmlElement("S61",this.Saturday);B+=toSoapXmlElement("T94",this.TotalMinutes);B+=toSoapXmlElement("B29",this.BillValue);B+=toSoapXmlElement("S62",this.Start);B+=toSoapXmlElement("F19",this.Finish);B+=toSoapXmlElement("S63",this.SubmittedByName);B+=toSoapXmlElement("A58",this.ApprovedByName);B+=toSoapXmlElement("T95",this.TeamId);return B}var regex_PublicTimeSheet_Id=/(<I58>)([\w\W]*?)<\/I58>/;var regex_PublicTimeSheet_Submitted=/(<S58>)([\w\W]*?)<\/S58>/;var regex_PublicTimeSheet_SubmittedBy=/(<S59>)([\w\W]*?)<\/S59>/;var regex_PublicTimeSheet_Approved=/(<A56>)([\w\W]*?)<\/A56>/;var regex_PublicTimeSheet_ApprovedBy=/(<A57>)([\w\W]*?)<\/A57>/;var regex_PublicTimeSheet_CreatedBy=/(<C111>)([\w\W]*?)<\/C111>/;var regex_PublicTimeSheet_Created=/(<C112>)([\w\W]*?)<\/C112>/;var regex_PublicTimeSheet_Year=/(<Y2>)([\w\W]*?)<\/Y2>/;var regex_PublicTimeSheet_Month=/(<M74>)([\w\W]*?)<\/M74>/;var regex_PublicTimeSheet_Day=/(<D56>)([\w\W]*?)<\/D56>/;var regex_PublicTimeSheet_MemberId=/(<M75>)([\w\W]*?)<\/M75>/;var regex_PublicTimeSheet_TimeSheetId=/(<T91>)([\w\W]*?)<\/T91>/;var regex_PublicTimeSheet_Sunday=/(<S60>)([\w\W]*?)<\/S60>/;var regex_PublicTimeSheet_Monday=/(<M76>)([\w\W]*?)<\/M76>/;var regex_PublicTimeSheet_Tuesday=/(<T92>)([\w\W]*?)<\/T92>/;var regex_PublicTimeSheet_Wednesday=/(<W17>)([\w\W]*?)<\/W17>/;var regex_PublicTimeSheet_Thursday=/(<T93>)([\w\W]*?)<\/T93>/;var regex_PublicTimeSheet_Friday=/(<F18>)([\w\W]*?)<\/F18>/;var regex_PublicTimeSheet_Saturday=/(<S61>)([\w\W]*?)<\/S61>/;var regex_PublicTimeSheet_TotalMinutes=/(<T94>)([\w\W]*?)<\/T94>/;var regex_PublicTimeSheet_BillValue=/(<B29>)([\w\W]*?)<\/B29>/;var regex_PublicTimeSheet_Start=/(<S62>)([\w\W]*?)<\/S62>/;var regex_PublicTimeSheet_Finish=/(<F19>)([\w\W]*?)<\/F19>/;var regex_PublicTimeSheet_SubmittedByName=/(<S63>)([\w\W]*?)<\/S63>/;var regex_PublicTimeSheet_ApprovedByName=/(<A58>)([\w\W]*?)<\/A58>/;var regex_PublicTimeSheet_TeamId=/(<T95>)([\w\W]*?)<\/T95>/;function ParsePublicTimeSheet(A){if(A==null){return null}var B=new PublicTimeSheet();if(A.match(regex_PublicTimeSheet_Id)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Id=parseNumber(RegExp.$2)}if(A.match(regex_PublicTimeSheet_Submitted)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Submitted=parseSoapDate(RegExp.$2)}if(A.match(regex_PublicTimeSheet_SubmittedBy)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.SubmittedBy=parseNumber(RegExp.$2)}if(A.match(regex_PublicTimeSheet_Approved)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Approved=parseSoapDate(RegExp.$2)}if(A.match(regex_PublicTimeSheet_ApprovedBy)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.ApprovedBy=parseNumber(RegExp.$2)}if(A.match(regex_PublicTimeSheet_CreatedBy)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.CreatedBy=parseNumber(RegExp.$2)}if(A.match(regex_PublicTimeSheet_Created)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Created=parseSoapDate(RegExp.$2)}if(A.match(regex_PublicTimeSheet_Year)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Year=parseNumber(RegExp.$2)}if(A.match(regex_PublicTimeSheet_Month)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Month=parseNumber(RegExp.$2)}if(A.match(regex_PublicTimeSheet_Day)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Day=parseNumber(RegExp.$2)}if(A.match(regex_PublicTimeSheet_MemberId)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.MemberId=parseNumber(RegExp.$2)}if(A.match(regex_PublicTimeSheet_TimeSheetId)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.TimeSheetId=parseNumber(RegExp.$2)}if(A.match(regex_PublicTimeSheet_Sunday)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Sunday=parseNumber(RegExp.$2)}if(A.match(regex_PublicTimeSheet_Monday)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Monday=parseNumber(RegExp.$2)}if(A.match(regex_PublicTimeSheet_Tuesday)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Tuesday=parseNumber(RegExp.$2)}if(A.match(regex_PublicTimeSheet_Wednesday)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Wednesday=parseNumber(RegExp.$2)}if(A.match(regex_PublicTimeSheet_Thursday)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Thursday=parseNumber(RegExp.$2)}if(A.match(regex_PublicTimeSheet_Friday)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Friday=parseNumber(RegExp.$2)}if(A.match(regex_PublicTimeSheet_Saturday)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Saturday=parseNumber(RegExp.$2)}if(A.match(regex_PublicTimeSheet_TotalMinutes)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.TotalMinutes=parseNumber(RegExp.$2)}if(A.match(regex_PublicTimeSheet_BillValue)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.BillValue=parseNumber(RegExp.$2)}if(A.match(regex_PublicTimeSheet_Start)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Start=parseSoapDate(RegExp.$2)}if(A.match(regex_PublicTimeSheet_Finish)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Finish=parseSoapDate(RegExp.$2)}if(A.match(regex_PublicTimeSheet_SubmittedByName)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.SubmittedByName=parseString(RegExp.$2)}if(A.match(regex_PublicTimeSheet_ApprovedByName)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.ApprovedByName=parseString(RegExp.$2)}if(A.match(regex_PublicTimeSheet_TeamId)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.TeamId=parseNumber(RegExp.$2)}return B}function ParsePublicTimeSheetArray(A){if(A==null){return null}var D=/<P52>([\w\W]*?)<\/P52>/g;var C=A.match(D);if(C!=null){for(var B=0;B<C.length;B++){C[B]=ParsePublicTimeSheet(C[B])}}return C}function PublicSearch(B,A,C,F,E,D){this.Id=B;this.Name=A;this.Value=C;this.OwnerId=F;this.Created=E;this.Modified=D;this.toString=PublicSearch_toString}function PublicSearch_toString(A){var B="";B+=toSoapXmlElement("I41",this.Id);B+=toSoapXmlElement("N29",this.Name);B+=toSoapXmlElement("V4",this.Value);B+=toSoapXmlElement("O10",this.OwnerId);B+=toSoapXmlElement("C72",this.Created);B+=toSoapXmlElement("M44",this.Modified);return B}var regex_PublicSearch_Id=/(<I41>)([\w\W]*?)<\/I41>/;var regex_PublicSearch_Name=/(<N29>)([\w\W]*?)<\/N29>/;var regex_PublicSearch_Value=/(<V4>)([\w\W]*?)<\/V4>/;var regex_PublicSearch_OwnerId=/(<O10>)([\w\W]*?)<\/O10>/;var regex_PublicSearch_Created=/(<C72>)([\w\W]*?)<\/C72>/;var regex_PublicSearch_Modified=/(<M44>)([\w\W]*?)<\/M44>/;function ParsePublicSearch(A){if(A==null){return null}var B=new PublicSearch();if(A.match(regex_PublicSearch_Id)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Id=parseNumber(RegExp.$2)}if(A.match(regex_PublicSearch_Name)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Name=parseString(RegExp.$2)}if(A.match(regex_PublicSearch_Value)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Value=parseString(RegExp.$2)}if(A.match(regex_PublicSearch_OwnerId)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.OwnerId=parseNumber(RegExp.$2)}if(A.match(regex_PublicSearch_Created)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Created=parseSoapDate(RegExp.$2)}if(A.match(regex_PublicSearch_Modified)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Modified=parseSoapDate(RegExp.$2)}return B}function ParsePublicSearchArray(B){if(B==null){return null}var A=/<P26>([\w\W]*?)<\/P26>/g;var D=B.match(A);if(D!=null){for(var C=0;C<D.length;C++){D[C]=ParsePublicSearch(D[C])}}return D}function PublicDocument(F,K,J,N,E,B,O,L,M,D,C,I,A,H,G){this.Id=F;this.Name=K;this.Mime=J;this.TaskId=N;this.CreatedBy=E;this.Created=B;this.ModifiedBy=O;this.Modified=L;this.Deleted=M;this.LatestRevision=D;this.Url=C;this.Size=I;this.Description=A;this.CreatedByName=H;this.ModifiedByName=G;this.toString=PublicDocument_toString}function PublicDocument_toString(A){var B="";B+=toSoapXmlElement("I61",this.Id);B+=toSoapXmlElement("N44",this.Name);B+=toSoapXmlElement("M82",this.Mime);B+=toSoapXmlElement("T97",this.TaskId);B+=toSoapXmlElement("C120",this.CreatedBy);B+=toSoapXmlElement("C121",this.Created);B+=toSoapXmlElement("M83",this.ModifiedBy);B+=toSoapXmlElement("M84",this.Modified);B+=toSoapXmlElement("D61",this.Deleted);B+=toSoapXmlElement("L30",this.LatestRevision);B+=toSoapXmlElement("U4",this.Url);B+=toSoapXmlElement("S65",this.Size);B+=toSoapXmlElement("D62",this.Description);B+=toSoapXmlElement("C122",this.CreatedByName);B+=toSoapXmlElement("M85",this.ModifiedByName);return B}var regex_PublicDocument_Id=/(<I61>)([\w\W]*?)<\/I61>/;var regex_PublicDocument_Name=/(<N44>)([\w\W]*?)<\/N44>/;var regex_PublicDocument_Mime=/(<M82>)([\w\W]*?)<\/M82>/;var regex_PublicDocument_TaskId=/(<T97>)([\w\W]*?)<\/T97>/;var regex_PublicDocument_CreatedBy=/(<C120>)([\w\W]*?)<\/C120>/;var regex_PublicDocument_Created=/(<C121>)([\w\W]*?)<\/C121>/;var regex_PublicDocument_ModifiedBy=/(<M83>)([\w\W]*?)<\/M83>/;var regex_PublicDocument_Modified=/(<M84>)([\w\W]*?)<\/M84>/;var regex_PublicDocument_Deleted=/(<D61>)([\w\W]*?)<\/D61>/;var regex_PublicDocument_LatestRevision=/(<L30>)([\w\W]*?)<\/L30>/;var regex_PublicDocument_Url=/(<U4>)([\w\W]*?)<\/U4>/;var regex_PublicDocument_Size=/(<S65>)([\w\W]*?)<\/S65>/;var regex_PublicDocument_Description=/(<D62>)([\w\W]*?)<\/D62>/;var regex_PublicDocument_CreatedByName=/(<C122>)([\w\W]*?)<\/C122>/;var regex_PublicDocument_ModifiedByName=/(<M85>)([\w\W]*?)<\/M85>/;function ParsePublicDocument(A){if(A==null){return null}var B=new PublicDocument();if(A.match(regex_PublicDocument_Id)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Id=parseNumber(RegExp.$2)}if(A.match(regex_PublicDocument_Name)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Name=parseString(RegExp.$2)}if(A.match(regex_PublicDocument_Mime)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Mime=parseString(RegExp.$2)}if(A.match(regex_PublicDocument_TaskId)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.TaskId=parseNumber(RegExp.$2)}if(A.match(regex_PublicDocument_CreatedBy)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.CreatedBy=parseNumber(RegExp.$2)}if(A.match(regex_PublicDocument_Created)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Created=parseSoapDate(RegExp.$2)}if(A.match(regex_PublicDocument_ModifiedBy)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.ModifiedBy=parseNumber(RegExp.$2)}if(A.match(regex_PublicDocument_Modified)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Modified=parseSoapDate(RegExp.$2)}if(A.match(regex_PublicDocument_Deleted)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Deleted=parseBoolean(RegExp.$2)}if(A.match(regex_PublicDocument_LatestRevision)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.LatestRevision=parseNumber(RegExp.$2)}if(A.match(regex_PublicDocument_Url)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Url=parseString(RegExp.$2)}if(A.match(regex_PublicDocument_Size)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Size=parseNumber(RegExp.$2)}if(A.match(regex_PublicDocument_Description)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Description=parseString(RegExp.$2)}if(A.match(regex_PublicDocument_CreatedByName)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.CreatedByName=parseString(RegExp.$2)}if(A.match(regex_PublicDocument_ModifiedByName)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.ModifiedByName=parseString(RegExp.$2)}return B}function ParsePublicDocumentArray(A){if(A==null){return null}var C=/<P55>([\w\W]*?)<\/P55>/g;var D=A.match(C);if(D!=null){for(var B=0;B<D.length;B++){D[B]=ParsePublicDocument(D[B])}}return D}function PublicTimeEntry(L,E,B,C,U,M,H,S,J,I,F,K,P,O,A,N,G,R,D,Q,T){this.Id=L;this.TimeSheetId=E;this.TaskId=B;this.TaskName=C;this.ProjectName=U;this.BillRate=M;this.Sunday=H;this.Monday=S;this.Tuesday=J;this.Wednesday=I;this.Thursday=F;this.Friday=K;this.Saturday=P;this.Billable=O;this.Generated=A;this.Tags=N;this.Comments=G;this.TimeTypeId=R;this.TotalMinutes=D;this.BillValue=Q;this.TeamId=T;this.toString=PublicTimeEntry_toString}function PublicTimeEntry_toString(A){var B="";B+=toSoapXmlElement("I57",this.Id);B+=toSoapXmlElement("T77",this.TimeSheetId);B+=toSoapXmlElement("T78",this.TaskId);B+=toSoapXmlElement("T79",this.TaskName);B+=toSoapXmlElement("P51",this.ProjectName);B+=toSoapXmlElement("B25",this.BillRate);B+=toSoapXmlElement("S54",this.Sunday);B+=toSoapXmlElement("M72",this.Monday);B+=toSoapXmlElement("T80",this.Tuesday);B+=toSoapXmlElement("W15",this.Wednesday);B+=toSoapXmlElement("T81",this.Thursday);B+=toSoapXmlElement("F16",this.Friday);B+=toSoapXmlElement("S55",this.Saturday);B+=toSoapXmlElement("B26",this.Billable);B+=toSoapXmlElement("G2",this.Generated);B+=toSoapXmlElement("T82",this.Tags);B+=toSoapXmlElement("C110",this.Comments);B+=toSoapXmlElement("T83",this.TimeTypeId);B+=toSoapXmlElement("T84",this.TotalMinutes);B+=toSoapXmlElement("B27",this.BillValue);B+=toSoapXmlElement("T85",this.TeamId);return B}var regex_PublicTimeEntry_Id=/(<I57>)([\w\W]*?)<\/I57>/;var regex_PublicTimeEntry_TimeSheetId=/(<T77>)([\w\W]*?)<\/T77>/;var regex_PublicTimeEntry_TaskId=/(<T78>)([\w\W]*?)<\/T78>/;var regex_PublicTimeEntry_TaskName=/(<T79>)([\w\W]*?)<\/T79>/;var regex_PublicTimeEntry_ProjectName=/(<P51>)([\w\W]*?)<\/P51>/;var regex_PublicTimeEntry_BillRate=/(<B25>)([\w\W]*?)<\/B25>/;var regex_PublicTimeEntry_Sunday=/(<S54>)([\w\W]*?)<\/S54>/;var regex_PublicTimeEntry_Monday=/(<M72>)([\w\W]*?)<\/M72>/;var regex_PublicTimeEntry_Tuesday=/(<T80>)([\w\W]*?)<\/T80>/;var regex_PublicTimeEntry_Wednesday=/(<W15>)([\w\W]*?)<\/W15>/;var regex_PublicTimeEntry_Thursday=/(<T81>)([\w\W]*?)<\/T81>/;var regex_PublicTimeEntry_Friday=/(<F16>)([\w\W]*?)<\/F16>/;var regex_PublicTimeEntry_Saturday=/(<S55>)([\w\W]*?)<\/S55>/;var regex_PublicTimeEntry_Billable=/(<B26>)([\w\W]*?)<\/B26>/;var regex_PublicTimeEntry_Generated=/(<G2>)([\w\W]*?)<\/G2>/;var regex_PublicTimeEntry_Tags=/(<T82>)([\w\W]*?)<\/T82>/;var regex_PublicTimeEntry_Comments=/(<C110>)([\w\W]*?)<\/C110>/;var regex_PublicTimeEntry_TimeTypeId=/(<T83>)([\w\W]*?)<\/T83>/;var regex_PublicTimeEntry_TotalMinutes=/(<T84>)([\w\W]*?)<\/T84>/;var regex_PublicTimeEntry_BillValue=/(<B27>)([\w\W]*?)<\/B27>/;var regex_PublicTimeEntry_TeamId=/(<T85>)([\w\W]*?)<\/T85>/;function ParsePublicTimeEntry(A){if(A==null){return null}var B=new PublicTimeEntry();if(A.match(regex_PublicTimeEntry_Id)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Id=parseNumber(RegExp.$2)}if(A.match(regex_PublicTimeEntry_TimeSheetId)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.TimeSheetId=parseNumber(RegExp.$2)}if(A.match(regex_PublicTimeEntry_TaskId)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.TaskId=parseNumber(RegExp.$2)}if(A.match(regex_PublicTimeEntry_TaskName)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.TaskName=parseString(RegExp.$2)}if(A.match(regex_PublicTimeEntry_ProjectName)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.ProjectName=parseString(RegExp.$2)}if(A.match(regex_PublicTimeEntry_BillRate)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.BillRate=parseNumber(RegExp.$2)}if(A.match(regex_PublicTimeEntry_Sunday)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Sunday=parseNumber(RegExp.$2)}if(A.match(regex_PublicTimeEntry_Monday)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Monday=parseNumber(RegExp.$2)}if(A.match(regex_PublicTimeEntry_Tuesday)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Tuesday=parseNumber(RegExp.$2)}if(A.match(regex_PublicTimeEntry_Wednesday)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Wednesday=parseNumber(RegExp.$2)}if(A.match(regex_PublicTimeEntry_Thursday)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Thursday=parseNumber(RegExp.$2)}if(A.match(regex_PublicTimeEntry_Friday)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Friday=parseNumber(RegExp.$2)}if(A.match(regex_PublicTimeEntry_Saturday)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Saturday=parseNumber(RegExp.$2)}if(A.match(regex_PublicTimeEntry_Billable)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Billable=parseBoolean(RegExp.$2)}if(A.match(regex_PublicTimeEntry_Generated)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Generated=parseBoolean(RegExp.$2)}if(A.match(regex_PublicTimeEntry_Tags)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Tags=parseNumber(RegExp.$2)}if(A.match(regex_PublicTimeEntry_Comments)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Comments=parseString(RegExp.$2)}if(A.match(regex_PublicTimeEntry_TimeTypeId)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.TimeTypeId=parseNumber(RegExp.$2)}if(A.match(regex_PublicTimeEntry_TotalMinutes)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.TotalMinutes=parseNumber(RegExp.$2)}if(A.match(regex_PublicTimeEntry_BillValue)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.BillValue=parseNumber(RegExp.$2)}if(A.match(regex_PublicTimeEntry_TeamId)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.TeamId=parseNumber(RegExp.$2)}return B}function ParsePublicTimeEntryArray(B){if(B==null){return null}var A=/<P50>([\w\W]*?)<\/P50>/g;var D=B.match(A);if(D!=null){for(var C=0;C<D.length;C++){D[C]=ParsePublicTimeEntry(D[C])}}return D}function PublicDependency(E,C,B,H,K,I,D,O,A,J,N,G,M,F,L){this.Id=E;this.BlockingTaskId=C;this.WaitingTaskId=B;this.BlockingEnd=H;this.WaitingEnd=K;this.LagTime=I;this.CreatedBy=D;this.ModifiedBy=O;this.Created=A;this.Modified=J;this.BlockingTaskName=N;this.WaitingTaskName=G;this.BlockingComplete=M;this.BlockingTaskTypeId=F;this.BlockingTaskLagFinish=L;this.toString=PublicDependency_toString}function PublicDependency_toString(A){var B="";B+=toSoapXmlElement("I59",this.Id);B+=toSoapXmlElement("B30",this.BlockingTaskId);B+=toSoapXmlElement("W18",this.WaitingTaskId);B+=toSoapXmlElement("B31",this.BlockingEnd);B+=toSoapXmlElement("W19",this.WaitingEnd);B+=toSoapXmlElement("L28",this.LagTime);B+=toSoapXmlElement("C113",this.CreatedBy);B+=toSoapXmlElement("M77",this.ModifiedBy);B+=toSoapXmlElement("C114",this.Created);B+=toSoapXmlElement("M78",this.Modified);B+=toSoapXmlElement("B32",this.BlockingTaskName);B+=toSoapXmlElement("W20",this.WaitingTaskName);B+=toSoapXmlElement("B33",this.BlockingComplete);B+=toSoapXmlElement("B34",this.BlockingTaskTypeId);B+=toSoapXmlElement("B35",this.BlockingTaskLagFinish);return B}var regex_PublicDependency_Id=/(<I59>)([\w\W]*?)<\/I59>/;var regex_PublicDependency_BlockingTaskId=/(<B30>)([\w\W]*?)<\/B30>/;var regex_PublicDependency_WaitingTaskId=/(<W18>)([\w\W]*?)<\/W18>/;var regex_PublicDependency_BlockingEnd=/(<B31>)([\w\W]*?)<\/B31>/;var regex_PublicDependency_WaitingEnd=/(<W19>)([\w\W]*?)<\/W19>/;var regex_PublicDependency_LagTime=/(<L28>)([\w\W]*?)<\/L28>/;var regex_PublicDependency_CreatedBy=/(<C113>)([\w\W]*?)<\/C113>/;var regex_PublicDependency_ModifiedBy=/(<M77>)([\w\W]*?)<\/M77>/;var regex_PublicDependency_Created=/(<C114>)([\w\W]*?)<\/C114>/;var regex_PublicDependency_Modified=/(<M78>)([\w\W]*?)<\/M78>/;var regex_PublicDependency_BlockingTaskName=/(<B32>)([\w\W]*?)<\/B32>/;var regex_PublicDependency_WaitingTaskName=/(<W20>)([\w\W]*?)<\/W20>/;var regex_PublicDependency_BlockingComplete=/(<B33>)([\w\W]*?)<\/B33>/;var regex_PublicDependency_BlockingTaskTypeId=/(<B34>)([\w\W]*?)<\/B34>/;var regex_PublicDependency_BlockingTaskLagFinish=/(<B35>)([\w\W]*?)<\/B35>/;function ParsePublicDependency(A){if(A==null){return null}var B=new PublicDependency();if(A.match(regex_PublicDependency_Id)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Id=parseNumber(RegExp.$2)}if(A.match(regex_PublicDependency_BlockingTaskId)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.BlockingTaskId=parseNumber(RegExp.$2)}if(A.match(regex_PublicDependency_WaitingTaskId)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.WaitingTaskId=parseNumber(RegExp.$2)}if(A.match(regex_PublicDependency_BlockingEnd)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.BlockingEnd=parseBoolean(RegExp.$2)}if(A.match(regex_PublicDependency_WaitingEnd)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.WaitingEnd=parseBoolean(RegExp.$2)}if(A.match(regex_PublicDependency_LagTime)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.LagTime=parseNumber(RegExp.$2)}if(A.match(regex_PublicDependency_CreatedBy)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.CreatedBy=parseNumber(RegExp.$2)}if(A.match(regex_PublicDependency_ModifiedBy)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.ModifiedBy=parseNumber(RegExp.$2)}if(A.match(regex_PublicDependency_Created)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Created=parseSoapDate(RegExp.$2)}if(A.match(regex_PublicDependency_Modified)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Modified=parseSoapDate(RegExp.$2)}if(A.match(regex_PublicDependency_BlockingTaskName)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.BlockingTaskName=parseString(RegExp.$2)}if(A.match(regex_PublicDependency_WaitingTaskName)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.WaitingTaskName=parseString(RegExp.$2)}if(A.match(regex_PublicDependency_BlockingComplete)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.BlockingComplete=parseNumber(RegExp.$2)}if(A.match(regex_PublicDependency_BlockingTaskTypeId)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.BlockingTaskTypeId=parseNumber(RegExp.$2)}if(A.match(regex_PublicDependency_BlockingTaskLagFinish)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.BlockingTaskLagFinish=parseSoapDate(RegExp.$2)}return B}function ParsePublicDependencyArray(B){if(B==null){return null}var A=/<P53>([\w\W]*?)<\/P53>/g;var D=B.match(A);if(D!=null){for(var C=0;C<D.length;C++){D[C]=ParsePublicDependency(D[C])}}return D}function EventCount(B,A){this.Month=B;this.Count=A;this.toString=EventCount_toString}function EventCount_toString(A){var B="";B+=toSoapXmlElement("M45",this.Month);B+=toSoapXmlElement("C73",this.Count);return B}var regex_EventCount_Month=/(<M45>)([\w\W]*?)<\/M45>/;var regex_EventCount_Count=/(<C73>)([\w\W]*?)<\/C73>/;function ParseEventCount(A){if(A==null){return null}var B=new EventCount();if(A.match(regex_EventCount_Month)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Month=parseNumber(RegExp.$2)}if(A.match(regex_EventCount_Count)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Count=parseNumber(RegExp.$2)}return B}function ParseEventCountArray(B){if(B==null){return null}var A=/<E5>([\w\W]*?)<\/E5>/g;var D=B.match(A);if(D!=null){for(var C=0;C<D.length;C++){D[C]=ParseEventCount(D[C])}}return D}function PublicPerson(L,B,R,D,T,H,G,F,P,O,S,J,K,N,C,I,A,M,Q,E){this.Id=L;this.Name=B;this.Email=R;this.Validated=D;this.DefaultTeamId=T;this.WorkPhone=H;this.CellPhone=G;this.HomePhone=F;this.Address1=P;this.Address2=O;this.City=S;this.StateId=J;this.Zipcode=K;this.CountryId=N;this.Title=C;this.CompanyName=I;this.Department=A;this.ProductId=M;this.Created=Q;this.Modified=E;this.toString=PublicPerson_toString}function PublicPerson_toString(A){var B="";B+=toSoapXmlElement("I42",this.Id);B+=toSoapXmlElement("N30",this.Name);B+=toSoapXmlElement("E6",this.Email);B+=toSoapXmlElement("V5",this.Validated);B+=toSoapXmlElement("D39",this.DefaultTeamId);B+=toSoapXmlElement("W11",this.WorkPhone);B+=toSoapXmlElement("C74",this.CellPhone);B+=toSoapXmlElement("H3",this.HomePhone);B+=toSoapXmlElement("A42",this.Address1);B+=toSoapXmlElement("A43",this.Address2);B+=toSoapXmlElement("C75",this.City);B+=toSoapXmlElement("S36",this.StateId);B+=toSoapXmlElement("Z2",this.Zipcode);B+=toSoapXmlElement("C76",this.CountryId);B+=toSoapXmlElement("T46",this.Title);B+=toSoapXmlElement("C77",this.CompanyName);B+=toSoapXmlElement("D40",this.Department);B+=toSoapXmlElement("P28",this.ProductId);B+=toSoapXmlElement("C78",this.Created);B+=toSoapXmlElement("M46",this.Modified);return B}var regex_PublicPerson_Id=/(<I42>)([\w\W]*?)<\/I42>/;var regex_PublicPerson_Name=/(<N30>)([\w\W]*?)<\/N30>/;var regex_PublicPerson_Email=/(<E6>)([\w\W]*?)<\/E6>/;var regex_PublicPerson_Validated=/(<V5>)([\w\W]*?)<\/V5>/;var regex_PublicPerson_DefaultTeamId=/(<D39>)([\w\W]*?)<\/D39>/;var regex_PublicPerson_WorkPhone=/(<W11>)([\w\W]*?)<\/W11>/;var regex_PublicPerson_CellPhone=/(<C74>)([\w\W]*?)<\/C74>/;var regex_PublicPerson_HomePhone=/(<H3>)([\w\W]*?)<\/H3>/;var regex_PublicPerson_Address1=/(<A42>)([\w\W]*?)<\/A42>/;var regex_PublicPerson_Address2=/(<A43>)([\w\W]*?)<\/A43>/;var regex_PublicPerson_City=/(<C75>)([\w\W]*?)<\/C75>/;var regex_PublicPerson_StateId=/(<S36>)([\w\W]*?)<\/S36>/;var regex_PublicPerson_Zipcode=/(<Z2>)([\w\W]*?)<\/Z2>/;var regex_PublicPerson_CountryId=/(<C76>)([\w\W]*?)<\/C76>/;var regex_PublicPerson_Title=/(<T46>)([\w\W]*?)<\/T46>/;var regex_PublicPerson_CompanyName=/(<C77>)([\w\W]*?)<\/C77>/;var regex_PublicPerson_Department=/(<D40>)([\w\W]*?)<\/D40>/;var regex_PublicPerson_ProductId=/(<P28>)([\w\W]*?)<\/P28>/;var regex_PublicPerson_Created=/(<C78>)([\w\W]*?)<\/C78>/;var regex_PublicPerson_Modified=/(<M46>)([\w\W]*?)<\/M46>/;function ParsePublicPerson(A){if(A==null){return null}var B=new PublicPerson();if(A.match(regex_PublicPerson_Id)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Id=parseNumber(RegExp.$2)}if(A.match(regex_PublicPerson_Name)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Name=parseString(RegExp.$2)}if(A.match(regex_PublicPerson_Email)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Email=parseString(RegExp.$2)}if(A.match(regex_PublicPerson_Validated)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Validated=parseBoolean(RegExp.$2)}if(A.match(regex_PublicPerson_DefaultTeamId)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.DefaultTeamId=parseNumber(RegExp.$2)}if(A.match(regex_PublicPerson_WorkPhone)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.WorkPhone=parseString(RegExp.$2)}if(A.match(regex_PublicPerson_CellPhone)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.CellPhone=parseString(RegExp.$2)}if(A.match(regex_PublicPerson_HomePhone)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.HomePhone=parseString(RegExp.$2)}if(A.match(regex_PublicPerson_Address1)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Address1=parseString(RegExp.$2)}if(A.match(regex_PublicPerson_Address2)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Address2=parseString(RegExp.$2)}if(A.match(regex_PublicPerson_City)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.City=parseString(RegExp.$2)}if(A.match(regex_PublicPerson_StateId)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.StateId=parseNumber(RegExp.$2)}if(A.match(regex_PublicPerson_Zipcode)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Zipcode=parseString(RegExp.$2)}if(A.match(regex_PublicPerson_CountryId)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.CountryId=parseNumber(RegExp.$2)}if(A.match(regex_PublicPerson_Title)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Title=parseString(RegExp.$2)}if(A.match(regex_PublicPerson_CompanyName)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.CompanyName=parseString(RegExp.$2)}if(A.match(regex_PublicPerson_Department)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Department=parseString(RegExp.$2)}if(A.match(regex_PublicPerson_ProductId)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.ProductId=parseNumber(RegExp.$2)}if(A.match(regex_PublicPerson_Created)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Created=parseSoapDate(RegExp.$2)}if(A.match(regex_PublicPerson_Modified)&&RegExp.$1.indexOf('xsi:nil="true"')<0){B.Modified=parseSoapDate(RegExp.$2)}return B}function ParsePublicPersonArray(B){if(B==null){return null}var A=/<P27>([\w\W]*?)<\/P27>/g;var D=B.match(A);if(D!=null){for(var C=0;C<D.length;C++){D[C]=ParsePublicPerson(D[C])}}return D}function DurationUnit(D,H,I,F,E,G,A,C,B){this.Id=D;this.Name=H;this.ShortName=I;this.ShortNamePlural=F;this.Abbreviation=E;this.Synonyms=G;this.Minutes=A;this.Days=C;this.Work=B}var DurationUnits=new Array();DurationUnits[0]=new DurationUnit(1,"minutes","min","mins","m","m,mn,mns,min,minute,minutes,mins,minut,minuts",1,null,true);DurationUnits[1]=new DurationUnit(2,"hours","hr","hrs","h","h,hr,hrs,hs,hours,hour",60,null,true);DurationUnits[2]=new DurationUnit(3,"days","day","day","d","d,dy,dys,ds,day,days",480,1,true);DurationUnits[3]=new DurationUnit(4,"calendar days","cday","cdays","cd","c,cd,cal,caldays,cal days,calendar days,e,ed,elapsed days",480,1,false);DurationUnits[4]=new DurationUnit(5,"weeks","week","weeks","w","w,wk,wks,week,weeks",2400,7,true);function TimeZone(B,F,G,C,D,A,E){this.Id=B;this.Offset=F;this.DefaultZone=G;this.Code=C;this.StandardName=D;this.DaylightName=A;this.Description=E}var TimeZones=new Array();TimeZones[0]=new TimeZone(26,-720,true,"-12","-12",null,"(GMT -12:00) International Date Line West");TimeZones[1]=new TimeZone(27,-660,true,"-11","-11",null,"(GMT -11:00) Midway Island, Samoa");TimeZones[2]=new TimeZone(1,-600,true,"HAST","HAST","HADT","(GMT -10:00) Hawaii");TimeZones[3]=new TimeZone(2,-540,true,"AKST","AKST","AKDT","(GMT -09:00) Alaska");TimeZones[4]=new TimeZone(3,-480,true,"PST","PST","PDT","(GMT -08:00) Pacific Time");TimeZones[5]=new TimeZone(5,-420,false,"AMST","MST",null,"(GMT -07:00) Arizona");TimeZones[6]=new TimeZone(4,-420,true,"MST","MST","MDT","(GMT -07:00) Mountain Time");TimeZones[7]=new TimeZone(6,-360,true,"CST","CST","CDT","(GMT -06:00) Central Time");TimeZones[8]=new TimeZone(7,-360,false,"SCST","CST",null,"(GMT -06:00) Saskatchewan");TimeZones[9]=new TimeZone(8,-300,true,"EST","EST","EDT","(GMT -05:00) Eastern Time");TimeZones[10]=new TimeZone(9,-240,true,"AST","AST",null,"(GMT -04:00) Atlantic Time");TimeZones[11]=new TimeZone(10,-180,true,"-3","-3",null,"(GMT -03:00) Greenland Time");TimeZones[12]=new TimeZone(11,-120,true,"-2","-2",null,"(GMT -02:00) Mid-Atlantic");TimeZones[13]=new TimeZone(12,-60,true,"-1","-1",null,"(GMT -01:00) Azores");TimeZones[14]=new TimeZone(13,0,true,"WET","WET",null,"(GMT) Western European Time");TimeZones[15]=new TimeZone(14,60,true,"CET","CET",null,"(GMT +01:00) Central European Time");TimeZones[16]=new TimeZone(15,120,true,"EET","EET",null,"(GMT +02:00) Eastern European Time");TimeZones[17]=new TimeZone(16,180,true,"MSK","MSK",null,"(GMT +03:00) Moscow Time");TimeZones[18]=new TimeZone(17,240,true,"+4","+4",null,"(GMT +04:00) Caucasus Time");TimeZones[19]=new TimeZone(18,300,true,"+5","+5",null,"(GMT +05:00) Karachi, Islamabad");TimeZones[20]=new TimeZone(28,330,true,"IST","IST",null,"(GMT +05:30) Indian Standard Time");TimeZones[21]=new TimeZone(19,360,true,"+6","+6",null,"(GMT +06:00) Dhaka, Novosibirsk");TimeZones[22]=new TimeZone(20,420,true,"+7","+7",null,"(GMT +07:00) Bangkock, Hanoi, Jakarta");TimeZones[23]=new TimeZone(21,480,true,"+8","+8",null,"(GMT +08:00) Beijing, Hong Kong, Perth");TimeZones[24]=new TimeZone(22,540,true,"+9","+9",null,"(GMT +09:00) Tokyo, Seoul, Yakutsk");TimeZones[25]=new TimeZone(23,600,true,"+10","+10",null,"(GMT +10:00) Sydney, Melbourne, Guam");TimeZones[26]=new TimeZone(24,660,true,"+11","+11",null,"(GMT +11:00) Solomon Islands");TimeZones[27]=new TimeZone(25,720,true,"+12","+12",null,"(GMT +12:00) Wellington, Auckland, Fiji");function MemberType(C,B,E,A,D){this.Id=C;this.Name=B;this.TaskAccess=E;this.MemberAccess=A;this.TeamAccess=D}var MemberTypes=new Array();MemberTypes[0]=new MemberType(0,"Guest",0,0,1);MemberTypes[1]=new MemberType(1,"Observer",1,1,1);MemberTypes[2]=new MemberType(2,"Member",2,1,1);MemberTypes[3]=new MemberType(3,"Admin",2,2,2);function TaskType(B,A,C){this.Id=B;this.Name=A;this.DefaultMinutes=C}var TaskTypes=new Array();TaskTypes[0]=new TaskType(1,"Task",480);TaskTypes[1]=new TaskType(2,"Project",480);TaskTypes[2]=new TaskType(3,"Issue",480);TaskTypes[3]=new TaskType(4,"Event",60);TaskTypes[4]=new TaskType(5,"Milestone",480);TaskTypes[5]=new TaskType(6,"Template",480);TaskTypes[6]=new TaskType(7,"Folder",0);function Priority(B,A){this.Id=B;this.Name=A}var Priorities=new Array();Priorities[0]=new Priority(0,"");Priorities[1]=new Priority(1,"C");Priorities[2]=new Priority(2,"B");Priorities[3]=new Priority(3,"A");function TimeType(B,A,D,C){this.Id=B;this.Name=A;this.Paid=D;this.Billable=C}var TimeTypes=new Array();TimeTypes[0]=new TimeType(5,"Meeting",true,true);TimeTypes[1]=new TimeType(6,"Travel",true,false);TimeTypes[2]=new TimeType(7,"Training",true,false);TimeTypes[3]=new TimeType(8,"Sick",true,false);TimeTypes[4]=new TimeType(9,"Holiday",true,false);TimeTypes[5]=new TimeType(10,"Vacation",true,false);TimeTypes[6]=new TimeType(11,"Time Off",false,false);function Country(B,A,C){this.Id=B;this.Name=A;this.Code=C}var Countries=new Array();Countries[0]=new Country(1,"Canada","CAN");Countries[1]=new Country(2,"United States of America","USA");function State(B,A,D,C){this.Id=B;this.Name=A;this.CountryId=D;this.Code=C}var States=new Array();States[0]=new State(11,"Alabama",2,"AL");States[1]=new State(12,"Alaska",2,"AK");States[2]=new State(69,"Alberta",1,"AB");States[3]=new State(62,"American Samoa",2,"AS");States[4]=new State(13,"Arizona",2,"AZ");States[5]=new State(14,"Arkansas",2,"AR");States[6]=new State(2,"British Columnbia",1,"BC");States[7]=new State(15,"California",2,"CA");States[8]=new State(16,"Colorado",2,"CO");States[9]=new State(17,"Connecticut",2,"CT");States[10]=new State(18,"Delaware",2,"DE");States[11]=new State(19,"District of Columbia",2,"DC");States[12]=new State(20,"Florida",2,"FL");States[13]=new State(21,"Georgia",2,"GA");States[14]=new State(63,"Guam",2,"GU");States[15]=new State(22,"Hawaii",2,"HI");States[16]=new State(23,"Idaho",2,"ID");States[17]=new State(24,"Illinois",2,"IL");States[18]=new State(25,"Indiana",2,"IN");States[19]=new State(26,"Iowa",2,"IA");States[20]=new State(27,"Kansas",2,"KS");States[21]=new State(28,"Kentucky",2,"KY");States[22]=new State(29,"Louisiana",2,"LA");States[23]=new State(30,"Maine",2,"ME");States[24]=new State(3,"Manitoba",1,"MB");States[25]=new State(31,"Maryland",2,"MD");States[26]=new State(32,"Massachusetts",2,"MA");States[27]=new State(33,"Michigan",2,"MI");States[28]=new State(34,"Minnesota",2,"MN");States[29]=new State(35,"Mississippi",2,"MS");States[30]=new State(36,"Missouri",2,"MO");States[31]=new State(37,"Montana",2,"MT");States[32]=new State(38,"Nebraska",2,"NE");States[33]=new State(39,"Nevada",2,"NV");States[34]=new State(4,"New Brunswick",1,"NB");States[35]=new State(40,"New Hampshire",2,"NH");States[36]=new State(41,"New Jersey",2,"NJ");States[37]=new State(42,"New Mexico",2,"NM");States[38]=new State(43,"New York",2,"NY");States[39]=new State(5,"Newfoundland",1,"NF");States[40]=new State(44,"North Carolina",2,"NC");States[41]=new State(45,"North Dakota",2,"ND");States[42]=new State(64,"Northern Mariana Islands",2,"CM");States[43]=new State(6,"Nova Scotia",1,"NS");States[44]=new State(46,"Ohio",2,"OH");States[45]=new State(47,"Oklahoma",2,"OK");States[46]=new State(7,"Ontario",1,"ON");States[47]=new State(48,"Oregon",2,"OR");States[48]=new State(49,"Pennsylvania",2,"PA");States[49]=new State(8,"Prince Edward Island",1,"PE");States[50]=new State(65,"Puerto Rico",2,"PR");States[51]=new State(10,"Quebec",1,"QC");States[52]=new State(50,"Rhode Island",2,"RI");States[53]=new State(9,"Saskatchewan",1,"SK");States[54]=new State(51,"South Carolina",2,"SC");States[55]=new State(52,"South Dakota",2,"SD");States[56]=new State(53,"Tennessee",2,"TN");States[57]=new State(54,"Texas",2,"TX");States[58]=new State(66,"Trust Territories",2,"TT");States[59]=new State(1,"Unknown",2,"UK");States[60]=new State(55,"Utah",2,"UT");States[61]=new State(56,"Vermont",2,"VT");States[62]=new State(67,"Virgin Islands",2,"VI");States[63]=new State(57,"Virgina",2,"VA");States[64]=new State(58,"Washington",2,"WA");States[65]=new State(59,"West Virginia",2,"WV");States[66]=new State(60,"Wisconsin",2,"WI");States[67]=new State(61,"Wyoming",2,"WY");function ProductType(A,E,F,H,D,G,B,C){this.ID=A;this.NameBrief=E;this.NameFull=F;this.Description=H;this.Active=D;this.IsBaseProduct=G;this.IsRecurringProduct=B;this.Advertising=C}var ProductTypes=new Array();ProductTypes[0]=new ProductType(1,"Express Edition","Viewpath membership Express Edition","Express Edition has no monthly fee as it is funded by advertisements",true,true,true,true);ProductTypes[1]=new ProductType(2,"Standard Edition","Viewpath membership Standard Edition","Standard Edition has a montly fee and adds these features; Saved Searches, Import Project Tasks and Cost Tracking Columns.",true,true,true,false);ProductTypes[2]=new ProductType(3,"Professional Edition","Viewpath membership Professional Edition","Professional Edition adds the following features on top of those in the Standard Edition;",false,true,true,false);ProductTypes[3]=new ProductType(4,"future 1","future 1 - like Earned Value Edition","future 1 - Earned Value version",false,false,false,false);ProductTypes[4]=new ProductType(5,"future 2","future 2","future 2",false,false,false,false);ProductTypes[5]=new ProductType(6,"Support Service","Support Service","Support Service",true,false,true,false);ProductTypes[6]=new ProductType(7,"Management Service","Management Service for Account","Account Management Service",true,false,true,false);var clock=new Clock(0.1);function ServerAction(A){}windowOnLoad.add(function(){document.body.refreshTask=function(A){taskManager.GetEntity(null,A)}});function GetMemberType(A){return GetRecord(MemberTypes,A,"member type not found: ")}function GetTimeType(A){return GetRecord(TimeTypes,A)}function GetRecord(E,D,A){for(var C=0;C<E.length;C++){var B=E[C];if(B.Id==D){return B}}if(A!=null){throw A+D}return null}var TaskTypeTask=TaskTypes[0];var TaskTypeProject=TaskTypes[1];var TaskTypeIssue=TaskTypes[2];var TaskTypeEvent=TaskTypes[3];var TaskTypeMilestone=TaskTypes[4];var TaskTypeTemplate=TaskTypes[5];var TaskTypeFolder=TaskTypes[6];function GetTaskType(A){return TaskTypes[A-1]}var Transaction_Current=null;var Transaction_OnCommit=null;function BeginTransaction(A){if(Transaction_Current!=null){throw"Transaction already active."}Transaction_Current=new EntitySet()}function EndTransaction(){var A=Transaction_Current;if(A!=null){Transaction_Current=null;if(Transaction_OnCommit!=null){Transaction_OnCommit(A)}A.commitChanges()}}function EntityManager(A){this.Initialize(A)}EntityManager.prototype.toString=function(){return this._name};EntityManager.prototype.Initialize=function(A){this._name=A;this.OnPreCreate=new List();this.OnPreUpdate=new List();this.OnPreDelete=new List();this.OnPostCreate=new List();this.OnPostUpdate=new List();this.OnPostDelete=new List();this.OnCreated=new List();this.OnUpdated=new List();this.OnDeleted=new List();this.OnModified=new List();this.OnLoading=new List();this.OnLoaded=new List()};EntityManager.prototype.UpdateChildCount=function(A,B){};EntityManager.prototype.Clone=function(A){return clone(A)};EntityManager.prototype.FireInternal=function(D,B){if(isArray(D)){var C=D;for(i=0;i<C.length;i++){B.invoke(C[i])}}else{var A=D;B.invoke(A)}};EntityManager.prototype.FireLoading=function(A){if(A!=null){this.FireInternal(A,this.OnLoading)}};EntityManager.prototype.FireLoaded=function(A){if(A!=null){this.FireInternal(A,this.OnLoaded)}};EntityManager.prototype.GetEntity=function(B,A){throw"GetEntity Not Implemented"};EntityManager.prototype.GetAncestors=function(B,A){throw"GetAncestors Not Implemented"};EntityManager.prototype.IsValidPaste=function(A,D,C,B){throw"IsValidPaste Not Implemented"};EntityManager.prototype.IsValid=function(A){throw"IsValid Not Implemented"};EntityManager.prototype.Construct=function(B,A){throw"Construct Not Implemented."};EntityManager.prototype.GetPrimaryProperty=function(){return null};EntityManager.prototype.GetSortProperty=function(){return"Sort"};EntityManager.prototype.UpdateSort=function(A){};EntityManager.prototype.Exists=function(A){throw"Exists Not Implemented"};EntityManager.prototype.CreateOrUpdate=function(A){if(!this.Exists(A)){return this.Create(A)}else{return this.Update(A)}};EntityManager.prototype.Indent=function(A){throw"Indent Not Implemented"};EntityManager.prototype.Outdent=function(A){throw"Outdent Not Implemented"};EntityManager.prototype.Copy=function(C,A,B,D,E){throw"Copy Not Implemented"};EntityManager.prototype.CanSort=function(A){return true};EntityManager.prototype.CanMove=function(A){return true};EntityManager.prototype.Move=function(C,A,B,D,E){throw"Move Not Implemented"};EntityManager.prototype.UpdateBatch=function(C){for(var B=0;B<C.length;B++){var A=C[B];if(A!=null){this.Update(A)}}};EntityManager.prototype.Create=function(B,C){if(Transaction_Current!=null&&B._manager!=null){return Transaction_Current.add(B,EntityOperation.Create,C)}this.OnPreCreate.invoke(B);var A=this.CreateInternal(B,C);this.OnPostCreate.invoke(B);return A};EntityManager.prototype.PreUpdate=function(A){this.OnPreUpdate.invoke(A)};EntityManager.prototype.Update=function(B){if(Transaction_Current!=null&&B._manager!=null){return Transaction_Current.add(B,EntityOperation.Update)}this.PreUpdate(B);var A=this.UpdateInternal(B);this.PostUpdate(B,A);return A};EntityManager.prototype.PostUpdate=function(B,A){this.OnPostUpdate.invoke(B)};EntityManager.prototype.Delete=function(B){if(Transaction_Current!=null&&B._manager!=null){return Transaction_Current.add(B,EntityOperation.Delete)}this.OnPreDelete.invoke(B);var A=this.DeleteInternal(B);this.OnPostDelete.invoke(B);return A};EntityManager.prototype.CreateInternal=function(A,B){};EntityManager.prototype.UpdateInternal=function(A){};EntityManager.prototype.DeleteInternal=function(A){};EntityManager.prototype.GetChildren=function(C,B,A){};EntityManager.prototype.IsDeleted=function(A){return false};EntityManager.prototype.Filter=function(A,B){if(B!=null&&isFunction(B.Filter)){return B.Filter(A)}return true};EntityManager.prototype.Compare=function(B,A,C){throw"Compare Not Implemented"};EntityManager.prototype.HasChildren=function(A,B){return false};EntityManager.prototype.GetIdentity=function(A){return A.Id};EntityManager.prototype.GetParentIdentity=function(A){return A.ParentId};EntityManager.prototype.GetParent=function(A){return null};EntityManager.prototype.SetParent=function(B,A){};EntityManager.prototype.CanCreate=function(A){return true};EntityManager.prototype.HandleError=function(A,B){if(A.error!=null){alert(A.error)}error(B)};function CachingEntityManager(){base(this);this.entityCache=new Object();this.childCache=new Object();this.OnCacheAdded=new List();this.OnCacheUpdated=new List();var A=this;var B=this.loadHandler=function(E){if(E!=null){if(isArray(E)){var D=E;for(var C=0;C<D.length;C++){A.SetCachedVersion(D[C])}}else{A.SetCachedVersion(E)}}};this.OnCreated.add(B);this.OnLoaded.add(B);this.OnUpdated.add(B);this.OnModified.add(B)}CachingEntityManager.prototype.IsCachedFieldDifferent=function(B,A,H,F){var G=this.GetIdentity(B);var D=this.entityCache[G];if(D==null){return true}for(var C=1;C<arguments.length;C++){var E=arguments[C];if(!Equals(B[E],D[E])){return true}}return false};CachingEntityManager.prototype.GetCachedDifferences=function(A){var D=this.GetIdentity(A);var B=this.entityCache[D];var C=B==null?A:getDifferences(B,A,"_");return C};CachingEntityManager.prototype.GetCachedField=function(C,B){if(C==null){return null}var A=this.entityCache[C];return(A!=null)?A[B]:null};CachingEntityManager.prototype.GetCachedEntity=function(B){if(B==null){return null}var A=this.entityCache[B];if(A!=null){A=clone(A)}return A};CachingEntityManager.prototype.SetCachedVersion=function(A){var D=this.GetIdentity(A);if(D==null){return }var B=this.entityCache[D];if(B!=null){var C=getDifferences(A,B);copyMembers(A,B);this.UpdateChildCache(D,B);if(C!=null){this.OnCacheUpdated.invoke(A,C)}}else{this.entityCache[D]=B=clone(A);this.UpdateChildCache(D,B);this.OnCacheAdded.invoke(A,null)}return B};CachingEntityManager.prototype.UpdateChildCache=function(D,A){var C=this.GetParentIdentity(A);if(C==null){return }var B=this.childCache[C];if(B==null){this.childCache[C]=B=new Object()}B[D]=A};CachingEntityManager.prototype.GetCachedChildren=function(F,B){var E=new Array();var C=this.childCache[F];if(C!=null){for(var A in C){var D=C[A];if(this.GetParentIdentity(D)==F&&(B==null||B(D))){E.add(clone(D))}else{delete C[A]}}}return E};CachingEntityManager.prototype.CreateInternal=function(A,B){return base(this,A,B)};CachingEntityManager.prototype.UpdateInternal=function(A){var B=this.GetCachedDifferences(A);if(B==null){return }base(this,A);this.SetCachedVersion(A)};CachingEntityManager.prototype.DeleteInternal=function(A){base(this,A)};CachingEntityManager.prototype.GetChildren=function(C,B,A){base(this,C,B,A)};function TaskManager(){this.Initialize("TaskManager");this.OnStartWorking=new List();this.OnFinishWorking=new List();var A=this;clock.OnTick.add(function(B){A.FlushUpdateQ()})}extend(TaskManager,EntityManager);TaskManager.prototype.Search=function(D,B){var A=this;var C=function(E){if(E.error){A.HandleError(E,"Error in Search")}else{D(E.result)}ServerAction("Search")};Search(C,token,B)};TaskManager.prototype.GetEntity=function(D,C){var A=this;var B=function(F){if(F.error){A.HandleError(F,"Error in GetTask")}else{if(F.result!=null){var E=F.result;A.FireLoading(E);if(D!=null){D(E)}A.FireLoaded(E);A.OnUpdated.invoke(E)}}ServerAction("GetTask")};GetTask(B,token,C)};TaskManager.prototype.GetAncestors=function(D,C){var A=this;var B=function(E){if(E.error){A.HandleError(E,"Error in GetTaskAncestors")}else{D(E.result)}ServerAction("GetTaskAncestors")};GetTaskAncestors(B,token,C)};TaskManager.prototype.IsDeleted=function(A){if(A==null){return false}return isTaskDeleted(A)};TaskManager.prototype.CanSort=function(A){if(A==null){return true}if(A.Deleted!=false||A.Archive!=false){return false}return true};TaskManager.prototype.CanMove=function(A){return this.CanSort(A)};TaskManager.prototype.GetTemplates=function(D,C){var A=this;var B=function(E){if(E.error){A.HandleError(E,"Error in GetTemplates")}else{var F=E.result;A.FireLoading(F);D(F);A.FireLoaded(F)}ServerAction("GetTemplates")};GetTemplates(B,token,C)};TaskManager.prototype.GetEvents=function(F,E,B,D){var A=this;var C=function(G){if(G.error){A.HandleError(G,"Error in GetEvents")}else{var H=G.result;A.FireLoading(H);F(H);A.FireLoaded(H)}ServerAction("GetEvents")};GetEvents(C,token,E,B,D)};TaskManager.prototype.CountEvents=function(E,C,D){var A=this;var B=function(F){if(F.error){A.HandleError(F,"Error in CountEvents")}else{var G=F.result;E(G)}ServerAction("CountEvents")};CountEvents(B,token,C,D)};TaskManager.prototype.GetTodoTasks=function(G,F,E,C,A){var B=this;var D=function(H){if(H.error){B.HandleError(H,"Error in GetTodoTasks")}else{var I=H.result;B.FireLoading(I);G(I);B.FireLoaded(I)}ServerAction("GetTodoTasks")};C=getUtcDate(C);A=getUtcDate(A);GetTodoTasks(D,token,F,E,C,A)};TaskManager.prototype.GetOpenIssues=function(D,C){var A=this;var B=function(E){if(E.error){A.HandleError(E,"Error in GetOpenIssues")}else{var F=E.result;A.FireLoading(F);D(F);A.FireLoaded(F)}ServerAction("GetOpenIssues")};GetOpenIssues(B,token,C)};TaskManager.prototype.GetCurrentEvents=function(D,C){var A=this;var B=function(E){if(E.error){A.HandleError(E,"Error in GetCurrentEvents")}else{var F=E.result;A.FireLoading(F);D(F);A.FireLoaded(F)}ServerAction("GetCurrentEvents")};GetCurrentEvents(B,token,C)};TaskManager.prototype.IsValid=function(A){return !isEmpty(A.Name)};TaskManager.prototype.IsValidPaste=function(A,C,B){if(B.TypeId!=null&&A.TypeId!=B.TypeId){return false}return true};TaskManager.prototype.Indent=function(A){if(A==null||A.length==0){return }var C=this;var F=function(G){if(G.error){C.HandleError(G,"Error indenting tasks "+A)}ServerAction("Indent Tasks")};for(var D=0;D<A.length;D++){var B=A[D];C.OnUpdated.invoke(B)}var E=ToIdString(A);IndentTasks(F,token,E)};TaskManager.prototype.Outdent=function(A){if(A==null||A.length==0){return }var C=this;var F=function(G){if(G.error){C.HandleError(G,"Error outdenting tasks "+A)}ServerAction("Outdent Tasks")};for(var D=0;D<A.length;D++){var B=A[D];C.OnUpdated.invoke(B)}var E=ToIdString(A);OutdentTasks(F,token,E)};TaskManager.prototype.Construct=function(D,C){var A=new PublicTask();if(C!=null){C=this.GetCachedEntity(C.Id);this.SetParent(A,C)}if(D!=null){A.TeamId=D.TeamId;if(D.CreateTypeId!=null){A.TypeId=D.CreateTypeId}else{A.TypeId=TaskTypeTask.Id}}if(A.TeamId==null){A.TeamId=teamManager.GetDefaultTeamId();A.Assignments=user.Name}A.ChildCount=0;var B=teamManager.GetTeam(A.TeamId);if(B!=null){A.OwnerId=B.Member.Id;A.OwnerInitials=B.Member.Initials}A.Scheduled=true;A.Duration=-1;A.DurationUnitId=GetDurationUnit("d").Id;A.Lag=0;A.LagUnitId=A.DurationUnitId;A.Locked=false;A.Complete=0;var E=GetNewTaskStartTime(GetSchedule(A.TeamId));if(C!=null){E=C.Start}A.Start=E;A.Constructed=new Date();return A};TaskManager.prototype.IsTask=function(A){return A!=null&&A.constructor==PublicTask};TaskManager.prototype.Exists=function(A){return A.Id!=null};TaskManager.prototype.GetPrimaryProperty=function(){return"Name"};TaskManager.prototype.SetTaskStatus=function(E,A){var C=this;var D=function(H){if(H.error){C.HandleError(H,"Error at SetTaskStatus "+A)}else{var G=new EntitySet();for(var I=0;I<E.length;I++){var F=E[I];F.Status=A;G.add(F)}C.OnModified.invoke(E);var J=new SchedulingEngine(G);J.calculateSchedule()}ServerAction("SetTaskStatus")};var B=ToIdString(E);SetTaskStatus(D,token,B,A)};TaskManager.prototype.SetTasksLocked=function(G,D){var C=this;if(D==null){D=false;for(var E=0;E<G.length;E++){var B=G[E];if(!B.Locked){D=true;break}}}var F=function(I){if(I.error){C.HandleError(I,"Error at SetTasksLocked")}else{for(var J=0;J<G.length;J++){var H=G[J];H.Locked=D}C.OnModified.invoke(G)}ServerAction("SetTasksLocked")};var A=ToIdString(G);SetTasksLocked(F,token,A,D)};TaskManager.prototype.UpdateSort=function(F){var E=null;var B=new Array();for(var C=0;C<F.length;C++){var A=F[C];if(A.Sort!=C){B.add(A);A.Sort=C;this.OnUpdated.invoke(A);if(this.Exists(A)){var D=A.Id+"="+C;if(E==null){E=D}else{E+=","+D}}}}if(E!=null){UpdateTaskSort(null,token,E)}return B};function ToPropertyValueString(C,A){var D="";for(var B=0;B<C.length;B++){if(D.length>0){D+=","}D+=C[B][A]}return D}function ToIdString(A){return ToPropertyValueString(A,"Id")}TaskManager.prototype.Copy=function(B,H,D,I,G){var K=this;var J=function(L){if(L.error){K.HandleError(L,"Error copying tasks "+B)}else{var M=L.result;if(M!=null){K.OnUpdated.invoke(M)}var N=function(O){K.OnModified.invoke(O);if(M!=null){RollupSummaryFields(M.Id)}};K.GetChildren(N,I,M)}if(G!=null){G()}ServerAction("Copy Tasks")};var A=ToIdString(B);var C=H!=null?H.TeamId:I.TeamId;var E=H!=null?H.Id:null;var F=D!=null?D.Id:null;CopyTasks(J,token,A,C,E,F)};TaskManager.prototype.Move=function(D,J,F,K,I){var M=this;var L=function(N){if(N.error){M.HandleError(N,"Error moving tasks "+D)}if(I!=null){I()}ServerAction("Move Tasks")};for(var C=0;C<D.length;C++){var B=D[C];B.ParentId=J!=null?J.Id:null;M.OnUpdated.invoke(B)}var A=ToIdString(D);var E=J!=null?J.TeamId:K.TeamId;var G=J!=null?J.Id:null;var H=F!=null?F.Id:null;MoveTasks(L,token,A,E,G,H)};TaskManager.prototype.CanCreate=function(A){if(isEmpty(A.TeamId)){alert("You must create a new Team or be invited to an existing Team before you can create new items.");return false}var B=teamManager.GetTeam(A.TeamId);var C=GetMemberType(B.Member.TypeId);if(C.TaskAccess<2){alert("You don't have permission to create items on team '"+B.Name+"'.");return false}return true};TaskManager.prototype.CreateInternal=function(B,E){if(!this.CanCreate(B)){return false}var A=this;var C=function(G){if(G.error){A.HandleError(G,"Error creating task "+B.Name)}else{var F=G.result;A.FireLoading(F);A.OnCreated.invoke(F,B);A.FireLoaded(F);if(E!=null){E(F,B)}}ServerAction("CreateInternal Task")};var D=B.SendEmails;B.SendEmails=null;CreateTask(C,token,B.TeamId,B.ParentId,B.TypeId,B.Name,B.Work,B.Sort,B.Start,B.Finish,B.Assignments,B.Location,B.Description,B.PriorityId,B.Complete,B.Locked,B.Scheduled,B.Duration,B.DurationUnitId,B.Lag,B.LagUnitId,B.LagFinish,B.Milestone,B.Tags,B.OwnerId,B.OwnerName,B.TemplateId,D);return true};var TaskManager_UpdateQ=new Object();var TaskManager_ScheduleFields=new Object();TaskManager_ScheduleFields.Start=true;TaskManager_ScheduleFields.Finish=true;TaskManager_ScheduleFields.LagFinish=true;TaskManager.prototype.IsScheduleOnlyUpdate=function(B){for(var A in B){if(TaskManager_ScheduleFields[A]!=true){return false}}return true};TaskManager.prototype.GetScheduleOnlyUpdates=function(){var B=TaskManager_UpdateQ;var D=new Array();for(var A in B){var C=B[A];if(this.IsScheduleOnlyUpdate(C)){D.add(A);delete B[A]}}return D};TaskManager.prototype.DoBatchUpdate=function(){var L=this;var A=TaskManager_UpdateQ;var H=this.GetScheduleOnlyUpdates();if(H==null||H.length==0){return }var F="";for(var G=0;G<H.length;G++){var I=H[G];var E=this.GetCachedEntity(I);var D=E.Id;var C=encodeTimeYMDHM(E.Start);var J=encodeTimeYMDHM(E.Finish);var B=encodeTimeYMDHM(E.LagFinish);if(F.length>0){F+=";"}F+=D+","+C+","+J+","+B}var K=function(M){if(M.error){L.HandleError(M,"Error Doing Batch Update.")}};UpdateTaskSchedules(K,token,F)};function encodeTimeYMDHM(A){var B=A.getFullYear()+":"+(A.getMonth()+1)+":"+A.getDate()+":"+A.getHours()+":"+A.getMinutes();return B}TaskManager.prototype.UpdateInternal=function(A){var D=this.GetCachedDifferences(A);if(D==null){return }var B=TaskManager_UpdateQ;var C=B[A.Id];if(C!=null){copyMembers(D,C)}else{B[A.Id]=D}this.OnUpdated.invoke(A,A)};TaskManager.prototype.FlushUpdateQ=function(){var C=this;var F=TaskManager_UpdateQ;this.DoBatchUpdate();var D=null;for(var A in F){D=A;break}if(D==null){return }var H=F[D];delete F[D];var B=this.GetCachedEntity(D);var E=function(J){if(J.error){C.HandleError(J,"Error updating task "+B.Name)}else{var I=J.result;if(I!=null){C.FireLoading(I);C.FireLoaded(I);C.OnUpdated.invoke(I)}}ServerAction("UpdateInternal Task")};var G=B.SendEmails;B.SendEmails=null;UpdateTask(E,token,B.Id,B.Name,B.Description,B.Complete,B.Work,B.Sort,B.Start,B.Finish,B.PriorityId,B.Location,B.Assignments,B.Locked,B.Scheduled,B.TotalCost,B.LaborCost,B.MaterialCost,B.OtherCost,B.Duration,B.DurationUnitId,B.Lag,B.LagUnitId,B.LagFinish,B.Milestone,B.Tags,B.OwnerId,B.OwnerName,B.Hours,G);B.Hours=null};TaskManager.prototype.DeleteInternal=function(B){var A=this;var C=function(D){if(D.error){A.HandleError(D,"Error deleting task "+B.Name)}else{if(D.result==-1){warning(format(Resources.DeletingTaskAccessDenied,B.Name))}else{if(D.result==1){B.Status=TaskStatusDeleted;A.OnDeleted.invoke(B)}else{A.HandleError("Unrecognized response from DeleteTask: "+D.result)}}}ServerAction("DeleteInternal Task")};DeleteTask(C,token,B.Id)};TaskManager.prototype.GetOwnerAssigneeEmails=function(E,A){var B=this;var D=function(F){if(F.error){B.HandleError(F,"Error getting owner assignee emails "+A)}if(E!=null){E(F.result)}ServerAction("GetOwnerAssigneeEmails")};var C=ToIdString(A);GetOwnerAssigneeEmails(D,token,C)};TaskManager.prototype.SendNotificationEmails=function(G,B,E,F){var A=this;var D=function(H){if(H.error){A.HandleError(H,"Error sending notification emails")}ServerAction("SendNotificationEmails")};var C=ToIdString(F);SendNotificationEmails(D,token,G,B,E,C)};TaskManager.prototype.Reassign=function(F,A,C){var B=this;var D=function(G){if(G.error){B.HandleError(G,"Error reassigning tasks.")}else{var H=G.result;if(H!=null){B.OnModified.invoke(H)}}ServerAction("Reassign Tasks")};var E=ToIdString(F);ReassignTasks(D,token,E,A,C)};function toBoolean(A){if(A==null||A==0||A==""){return false}return true}var TaskStatusDeleted=2;var TaskStatusArchived=1;var TaskStatusActive=0;function isTaskActive(A){return A.Status==TaskStatusActive}function isTaskDeleted(A){return A.Status==TaskStatusDeleted}function isTaskArchived(A){return A.Status==TaskStatusArchived}TaskManager.prototype.Filter=function(B,D){if(!EntityManager.prototype.Filter.call(this,B,D)){return false}if(D.ProjectId!=null&&B.Id!=D.ProjectId&&B.ParentId==null){return false}if(D.TypeId!=null&&B.TypeId!=D.TypeId){return false}if(D.TeamId!=null&&(D.AnyTeamId!=true&&B.TeamId!=D.TeamId)){return false}var C=isTaskArchived(B);var A=isTaskDeleted(B);if(A&&D.Deleted==false){return false}if(C&&D.Archive==false){return false}return true};TaskManager.prototype.Compare=function(B,A,C){if(B==A||(B==null&&A==null)){return 0}if(B==null){return -1}if(A==null){return +1}if(B.Id!=null&&A.Id!=null&&B.Id==A.Id){return 0}var D=0;if(B.ParentId==A.ParentId){if(C!=null&&(C.Deleted!=false||C.Archive!=false)){D=B.Status-A.Status}if(D==0&&(B.Sort!=null&&A.Sort!=null)){D=B.Sort-A.Sort}}if(D==0){if(B.Id==null&&A.Id==null){D=(B.Constructed<A.Constructed)?-1:+1}else{if(B.Created!=null&&A.Created!=null){D=B.Created.getTime()-A.Created.getTime()}else{if(B.Created==null){D=1}else{if(A.Created==null){D=-1}}}}}if(D>0){return +1}return -1};TaskManager.prototype.ToggleComplete=function(D){if(D==null){return }var A=false;for(var C=0;C<D.length;C++){var B=D[C];if(B.ChildCount>0){continue}if(B.Complete<100){A=true;break}}for(var C=0;C<D.length;C++){var B=D[C];if(B.ChildCount>0){continue}B.Complete=A?100:0;this.Update(B)}};TaskManager.prototype.HasChildren=function(A,B){if(A==null){return false}if(A.ChildCount>0){return true}if(B==null){return false}if(B.Deleted!=false&&A.ChildDeletedCount>0){return true}if(B.Archive!=false&&A.ChildArchiveCount>0){return true}return false};TaskManager.prototype.GetHiddenTasks=function(E,D,A){var B=this;var C=function(F){if(F.error){B.HandleError(F,"Error getting hidden tasks.")}else{var G=F.result;if(G!=null){B.OnModified.invoke(G)}}};GetHiddenTasks(C,token,E,D,A)};TaskManager.prototype.GetChildren=function(H,E,C){var B=this;var D=function(I){var J=I.result;B.FireLoading(J);if(H!=null){H(J)}B.FireLoaded(J)};var F=C!=null?C.TeamId:E.TeamId;var A=C!=null?C.ProjectId:E.ProjectId;var G=C!=null?C.Id:A;GetChildTasks(D,token,F,G,E.Archive,E.Deleted)};TaskManager.prototype.GetParent=function(A){var C=A.ParentId;if(C==null){return null}var B=this.Construct();B.Id=C;return B};TaskManager.prototype.SetParent=function(D,C){var A=D.ParentId;var B=C!=null?C.Id:null;if(A!=B){D.ParentId=B;this.UpdateChildCount(A,-1);this.UpdateChildCount(B,+1)}};TaskManager.prototype.UpdateChildCount=function(D,A){if(D==null){return }var C=this.GetCachedEntity(D);if(C==null){return }var B=C.ChildCount;if(B==null){B=0}B+=A;C.ChildCount=B;this.OnUpdated.invoke(C,C)};TaskManager.prototype.StartWorking=function(B){var A=this;var C=function(D){if(D.error){A.HandleError(D,"Error deleting task "+B.Name)}else{A.OnStartWorking.invoke(B,D.result)}ServerAction("Start Working")};StartWorking(C,token,B.Id)};TaskManager.prototype.FinishWorking=function(B){var A=this;var C=function(D){if(D.error){A.HandleError(D,"Error deleting task "+B)}else{A.OnFinishWorking.invoke(B)}ServerAction("Finish Working")};FinishWorking(C,token,B!=null?B.Id:null)};function CachingTaskManager(){base(this)}extend(CachingTaskManager,CachingEntityManager,TaskManager);CachingTaskManager.prototype.GetActiveCachedChildren=function(C){var A=function(D){return isTaskActive(D)};var B=this.GetCachedChildren(C,A);return B};var taskManager=PublicTask.prototype._manager=new CachingTaskManager();function DependencyManager(){this.Initialize("DependencyManager");this.OnAdded=new List();this.OnRemoved=new List();var A=this;taskManager.OnUpdated.add(function(B){A.taskModified(B)});taskManager.OnDeleted.add(function(B){A.taskModified(B)});taskManager.OnModified.add(function(C){if(C!=null){for(var B=0;B<C.length;B++){A.taskModified(C[B])}}})}extend(DependencyManager,EntityManager);DependencyManager.prototype.CreateInternal=function(C){var A=this;var B=function(E){if(E.error){A.HandleError(E,"Error creating dependency "+C)}else{var D=E.result;if(D!=null){A.addDependency(D);A.FireLoading(D);A.OnCreated.invoke(E.result,C);A.FireLoaded(D)}else{error("Cannot create a dependency between an ancestor and a descendant.")}}ServerAction("CreateInternal Dependency")};CreateDependency(B,token,C.BlockingTaskId,C.WaitingTaskId,C.BlockingEnd,C.WaitingEnd,C.LagTime);return true};DependencyManager.prototype.fireModified=function(C){for(var A=0;C!=null&&A<C.length;A++){var B=C[A];if(B.Deleted){this.removeDependency(B)}else{this.addDependency(B)}}this.OnModified.invoke(C)};DependencyManager.prototype.UpdateInternal=function(C){var A=this;var B=function(D){if(D.error){A.HandleError(D,"Error updating dependency "+C)}else{A.addDependency(C);A.OnUpdated.invoke(D.result,C)}ServerAction("UpdateInternal Dependency")};CreateDependency(B,token,C.BlockingTaskId,C.WaitingTaskId,C.BlockingEnd,C.WaitingEnd,C.LagTime)};DependencyManager.prototype.DeleteInternal=function(C){var A=this;A.removeDependency(C);A.OnDeleted.invoke(C);var B=function(D){if(D.error){A.HandleError(D,"Error deleting dependency "+C)}else{if(D.result==-1){warning(Resources.DeletingDependencyAccessDenied)}else{if(D.result==0){warning(Resources.DeletingDependencyNotFound)}else{if(D.result==1){A.removeDependency(C);A.OnDeleted.invoke(C)}else{A.HandleError("Unrecognized response from DeleteDependency: "+D.result)}}}}ServerAction("DeleteInternal Dependency")};DeleteDependency(B,token,C.BlockingTaskId,C.WaitingTaskId)};DependencyManager.prototype.Compare=function(B,A,C){if(B==A||B.Id==A.Id){return 0}return -1};DependencyManager.prototype.LinkTasks=function(G,E){BeginTransaction("Link Tasks");for(var D=1;D<G.length;D++){var A=G[D-1];var B=G[D];if(E){var C=B;B=A;A=C}var F=new PublicDependency();F.BlockingTaskName=A.Name;F.WaitingTaskName=B.Name;F.BlockingTaskId=A.Id;F.WaitingTaskId=B.Id;F.BlockingEnd=1;F.WaitingEnd=0;F.LagTime=0;this.Create(F)}EndTransaction()};DependencyManager.prototype.UnlinkTasks=function(E){BeginTransaction("Unlink Tasks");for(var C=1;C<E.length;C++){var A=E[C-1];var B=E[C];var D=new PublicDependency();D.BlockingTaskId=A.Id;D.WaitingTaskId=B.Id;this.Delete(D)}EndTransaction()};DependencyManager.prototype.GetChildren=function(E,D,B){var A=this;var C=function(F){var H=F.result;A.FireLoading(H);for(var G=0;H!=null&&G<H.length;G++){A.addDependency(H[G])}A.FireLoaded(H);if(E!=null){E(H)}};GetChildDependencies(C,token,D.TeamId,B!=null?B.Id:null)};PublicDependency.prototype.Equals=function(A){return A!=null&&this.BlockingTaskId==A.BlockingTaskId&&this.WaitingTaskId==A.WaitingTaskId};PublicDependency.prototype.toString=function(){return this.BlockingTaskName};DependencyManager.prototype.getActiveBlockingDependencies=function(D){var E=new Array();var B=this.getDependencyList(D);for(var A=0;A<B.getCount();A++){var C=B.getItem(A);if(C.Deleted){continue}if(C.WaitingTaskId==D){E.add(C)}}return E};DependencyManager.prototype.getActiveWaitingDependencies=function(C){var E=new Array();var B=this.getDependencyList(C);for(var A=0;A<B.getCount();A++){var D=B.getItem(A);if(D.Deleted){continue}if(D.BlockingTaskId==C){E.add(D)}}return E};DependencyManager.prototype.getDependencyList=function(A){if(this.dependencyLookup==null){this.dependencyLookup=new Object()}var B=this.dependencyLookup[A];if(B==null){this.dependencyLookup[A]=B=new List()}return B};DependencyManager.prototype.addDependency=function(D){if(D==null){return }var A=new PublicDependency();A.BlockingTaskId=D.WaitingTaskId;A.WaitingTaskId=D.BlockingTaskId;this.removeDependency(A);var B=this.getDependencyList(D.BlockingTaskId);B.addIfUnique(D);var C=this.getDependencyList(D.WaitingTaskId);C[D.BlockingTaskId]=D;C.addIfUnique(D);this.OnAdded.invoke(D)};DependencyManager.prototype.removeDependency=function(B){B.Deleted=true;this.removeDependencyInternal(B);var A=new PublicDependency();A.BlockingTaskId=B.WaitingTaskId;A.WaitingTaskId=B.BlockingTaskId;this.removeDependencyInternal(A)};DependencyManager.prototype.removeDependencyInternal=function(C){var A=this.getDependencyList(C.BlockingTaskId);A.remove(C);var B=this.getDependencyList(C.WaitingTaskId);B[C.BlockingTaskId]=null;B.remove(C);this.OnRemoved.invoke(C)};DependencyManager.prototype.isBlockingTask=function(B,A){return this.isBlockingTaskById(B.Id,A.Id)};DependencyManager.prototype.isBlockingTaskById=function(C,B){var A=this.getDependencyList(C);return A[B]!=null};DependencyManager.prototype.taskModified=function(B){var A=taskManager.IsDeleted(B);var D=this.getDependencyList(B.Id);for(var C=0;C<D.getCount();C++){var E=D.getItem(C);if(A){this.removeDependency(E)}else{if(E.BlockingTaskId==B.Id){if(E.BlockingTaskName!=B.Name||E.BlockingComplete!=B.Complete){E.BlockingTaskName=B.Name;E.BlockingComplete=B.Complete;this.addDependency(E)}}else{if(E.WaitingTaskName!=B.Name||E.WaitingComplete!=B.Complete){E.WaitingTaskName=B.Name;E.WaitingComplete=B.Complete;this.addDependency(E)}}}}};var dependencyManager=PublicDependency.prototype._manager=new DependencyManager();function TeamManager(){this.Initialize("TeamManager");this.OnChanged=new List()}extend(TeamManager,EntityManager);TeamManager.prototype.Construct=function(){return new PublicTeam()};TeamManager.prototype.DeleteInternal=function(B){var A=this;var C=function(D){if(D.error){A.HandleError(D,"Error deleting team: "+B.Name)}else{if(D.result==-1){error("Access denied editing team: "+B.Name)}else{if(D.result==1){alert("Team has been deleted.  The application will now reload.");reload()}else{alert("Unrecognized response from delete team: "+D.result)}}}ServerAction("DeleteInternal Team")};DeleteTeam(C,token,B.Id)};TeamManager.prototype.UpdateInternal=function(B){var A=this;var C=function(E){if(E.error){A.HandleError(E,"Error updating team: "+B.Name)}else{if(E.result==null){error("Access denied editing team: "+B.Name)}else{var D=E.result;B.Name=D.Name;B.Message=D.Message;B.Schedule=D.Schedule;B.TimeZoneId=D.TimeZoneId;A.OnUpdated.invoke(D,B);A.OnChanged.invoke()}}ServerAction("UpdateInternal Team")};UpdateTeam(C,token,B.Id,B.Name,B.Message,B.TimeSheetsEnabled,B.Schedule.TimeZoneId,B.Schedule)};TeamManager.prototype.CreateInternal=function(B,D){var A=this;var C=function(F){if(F.error){A.HandleError(F,"Error creating team "+B.Name)}else{if(F.result==null){error("You've already created a team with that name: "+B.Name)}else{var E=F.result;A.OnCreated.invoke(E,B);if(A.teams==null){A.teams=new Array()}A.teams[A.teams.length]=E;A.OnChanged.invoke();if(D!=null){D(E,B)}}}ServerAction("CreateInternal Team")};CreateTeam(C,token,B.Name,B.Message,B.TimeSheetsEnabled,B.Schedule.TimeZoneId,B.Schedule);return true};TeamManager.prototype.GetTeam=function(C){for(var B=0;this.teams!=null&&B<this.teams.length;B++){var A=this.teams[B];if(A.Id==C){return A}}return null};TeamManager.prototype.HasAccountingAccess=function(A){if(this.teams==null){return A}for(var C=0;C<this.teams.length;C++){var B=this.teams[C];var D=B.Member;if(D.AccountingAccess>=1){return true}}return false};TeamManager.prototype.GetTeams=function(){return this.teams};TeamManager.prototype.LoadTeams=function(C){var A=this;var B=function(D){if(D.error){alert("error loading teams: "+D.error)}else{var E=D.result;if(E==null){E=new Array()}A.teams=E;C(A.teams);A.OnChanged.invoke();A.OnLoaded.invoke()}};GetTeams(B,token)};TeamManager.prototype.LoadTeam=function(D,B){var A=this;var C=function(F){var E=A.GetTeam(B);D(E)};this.LoadTeams(C)};TeamManager.prototype.SetDefaultTeamId=function(B){var A=function(C){if(C.error){alert("error setting default team: "+C.error)}else{user.DefaultTeamId=B}};SetDefaultTeam(A,token,B)};TeamManager.prototype.GetDefaultTeamId=function(){var A=user.DefaultTeamId;if(A==null){var B=this.GetTeams();if(B!=null&&B.length>0){A=B[0].Id}}return A};var teamManager=new TeamManager();function MemberManager(){this.Initialize("MemberManager")}extend(MemberManager,EntityManager);MemberManager.prototype.CanMove=function(A){return false};MemberManager.prototype.IsValidPaste=function(A,D,C,B){if(A.TeamId!=C){B.setCut(false)}return true};MemberManager.prototype.IsValid=function(A){if(isEmpty(A.Email)&&!isEmpty(A.Title)){return true}if(isEmpty(A.Email)){return false}if(!IsValidEmail(A.Email)){alert("'"+A.Email+"' is not a valid email address.");return false}return true};MemberManager.prototype.Construct=function(B){var A=new PublicMember();A.TypeId=MemberTypes[2].Id;if(B!=null){A.TeamId=B}return A};MemberManager.prototype.Exists=function(A){return A.Id!=null};MemberManager.prototype.GetPrimaryProperty=function(){return"Email"};MemberManager.prototype.Compare=function(B,A,C){if(B==A||(B==null&&A==null)){return 0}if(B==null){return -1}if(A==null){return +1}if(B.Id!=null&&A.Id!=null&&B.Id==A.Id){return 0}var D=compare(B.Name,A.Name);if(D==0){D=compare(B.Title,A.Title)}if(D==0){D=compare(B.Email,A.Email)}if(D==0){D=B.Type-A.Type}return D};MemberManager.prototype.Copy=function(A,B,E,I,H){var G=B!=null?B.Id:null;for(var C=0;C<A.length;C++){var F=A[C];var D=this.Construct(I);D.Title=F.Title;D.Initials=F.Initials;D.Name=F.Name;D.Email=F.Email;D.ManagerId=G;this.CreateInternal(D)}};MemberManager.prototype.Move=function(A,G,B,E,F){if(!isArray(A)){A=new Array(A)}if(A.length==0){return }var D=A[0].TeamId;if(D!=E){this.Copy(A,G,B,E,F)}else{for(var C=0;C<A.length;C++){this.MoveInternal(A[C],G,B,E,F)}}};MemberManager.prototype.MoveInternal=function(H,G,C,E,F){var A=this;var B=G!=null?G.Id:null;if(H.ManagerId==B){return }var D=function(I){if(I.error){A.HandleError(I,"Error moving member "+H.Name)}else{if(I.result==-1){A.HandleError(I,"Permission denied to move "+H.Name)}else{if(I.result==0){A.HandleError(I,"Move failed "+H.Name)}else{if(I.result==1){H.ManagerId=B;A.OnUpdated.invoke(H)}else{A.HandleError(I,"Unrecognized response moving "+H.Name+" "+I.result)}}}}ServerAction("Move Members")};MoveMember(D,token,H.Id,B)};MemberManager.prototype.CreateInternal=function(C){var A=this;var B=function(D){if(D.error){A.HandleError(D,"Error creating member "+C.Name)}else{if(D.result==null){C.Deleted=true;warning(format(Resources.MemberAlreadyExistsWarning,C.Email));A.OnDeleted.invoke(C)}else{A.OnCreated.invoke(D.result,C)}}ServerAction("CreateInternal Member")};CreateMember(B,token,C.Title,C.Name,C.Email,C.TeamId,C.ManagerId,C.TypeId,C.Initials,C.AccountingAccess,C.Notes);return true};MemberManager.prototype.UpdateInternal=function(C){var A=this;var B=function(D){if(D.error){A.HandleError(D,"Error updating member "+C.Name)}else{if(D.result==null){A.HandleError(D,"Permission denied to update member "+C.Name)}else{A.OnUpdated.invoke(D.result,C)}}};UpdateMember(B,token,C.Id,C.Title,C.Name,C.Email,C.TypeId,C.Initials,C.AccountingAccess,C.Notes)};MemberManager.prototype.DeleteInternal=function(C){var A=this;var B=function(D){if(D.error){A.HandleError(D,"Error deleting member "+C.Name)}else{if(D.result==-1){warning(format(Resources.DeletingMemberAccessDenied,C.Name))}else{if(D.result==1){C.Deleted=true;A.OnDeleted.invoke(C)}else{A.HandleError("Unrecognized response from DeleteMember: "+D.result)}}}ServerAction("DeleteInternal Member")};DeleteMember(B,token,C.Id)};MemberManager.prototype.Filter=function(B,A){if(B.Deleted==true){return false}return B.TeamId==A};MemberManager.prototype.HasChildren=function(B,A){return B!=null&&B.SubordinateCount>0};MemberManager.prototype.GetChildren=function(G,I,A,D,C,E){var J=this;var B=I;var H=function(L){if(L.error){J.HandleError(L,"Error getting members")}else{var K=L.result;G(K)}};var F=A!=null?(A.Id!=null?A.Id:A):null;GetSubMembers(H,token,B,F,D,C,E)};MemberManager.prototype.GetParent=function(C){var B=C.ManagerId;if(B==null){return null}var A=this.Construct();A.Id=B;return A};MemberManager.prototype.SetParent=function(B,A){B.ManagerId=A!=null?A.Id:null};MemberManager.prototype.GetAssociates=function(D,C){var A=this;var B=function(E){if(E.error){A.HandleError(E,"Error getting associates.")}else{D(E.result)}};GetAssociates(B,token,C)};MemberManager.prototype.GetAssociateId=function(A){return null};var memberManager=new MemberManager();function DocumentManager(){this.Initialize("DocumentManager")}extend(DocumentManager,EntityManager);DocumentManager.prototype.GetDocuments=function(D,B){var A=this;var C=function(G){if(G.error){A.HandleError(G,"Error getting documents "+B)}else{var I=G.result;var J=new Array();var F=new Array();for(var H=0;I!=null&&H<I.length;H++){var E=I[H];if(E.Deleted){F.add(E)}else{J.add(E)}}D(J,F)}ServerAction("Get documents")};GetDocuments(C,token,B,null)};DocumentManager.prototype.SetDeletedDocument=function(C,E,A){var B=this;var D=function(F){if(F.error){B.HandleError(F,"Error getting setting documents deleted.")}if(C!=null){taskManager.GetEntity(null,C)}ServerAction("Set deleted documents")};SetDeletedDocument(D,token,C,E,A)};DocumentManager.prototype.RenameDocument=function(E,D,B){var A=this;var C=function(F){if(F.error){A.HandleError(F,"Error getting renaming document: "+B)}else{if(E!=null){E(F.result)}}ServerAction("Rename document")};RenameDocument(C,token,D,B)};DocumentManager.prototype.UpdateDocumentUrl=function(E,D,B){var A=this;var C=function(F){if(F.error){A.HandleError(F,"Error changing document url: "+B)}else{if(E!=null){E(F.result)}}ServerAction("UpdateDocumentUrl")};UpdateDocumentUrl(C,token,D,B)};DocumentManager.prototype.CreateOrUpdateBookmark=function(G,F,D,C,B){var A=this;var E=function(H){if(H.error){A.HandleError(H,"Error in CreateOrUpdateBookmark: "+C)}else{if(G!=null){G(H.result)}}if(D!=null){taskManager.GetEntity(null,D)}ServerAction("CreateOrUpdateBookmark")};CreateOrUpdateBookmark(E,token,F,D,C,B)};DocumentManager.prototype.GetDownloadUrl=function(D,B,C){var A;if(D.Url!=null){A=D.Url;if(A.indexOf("//")<0){A="//"+A}if(A.indexOf(":")<0){A="http:"+A}return A}A="download.ashx/"+escape(D.Name)+"?token="+UrlEncode(token)+"&doc="+D.Id;if(B!=null){A+="&rev="+B}if(C){A+="&save=1"}return A};DocumentManager.prototype.GetDocumentVersions=function(D,C){var A=this;var B=function(E){if(E.error){A.HandleError(E,"Error getting getting document versions.")}else{D(E.result)}ServerAction("Get document versions")};GetDocumentVersions(B,token,C)};var documentManager=new DocumentManager();function TagManager(){this.Initialize("TagManager");this.OnChanged=new List()}extend(TagManager,EntityManager);TagManager.prototype.FireOnChanged=function(){this.OnChanged.invoke()};TagManager.prototype.Compare=function(B,A,C){var D=compare(B.Name,A.Name);if(D==0){D=-1}return D};TagManager.prototype.CanMove=function(A){return false};TagManager.prototype.IsValid=function(A){if(isEmpty(A.Name)){return false}return true};TagManager.prototype.Construct=function(B){var A=new Tag();A.Color=0;A.PropagateToParent=0;A.PropagateToChild=false;if(B!=null){A.TeamId=B}return A};TagManager.prototype.Exists=function(A){return A.Id!=null};TagManager.prototype.GetPrimaryProperty=function(){return"Name"};TagManager.prototype.CreateInternal=function(A){var B=this;var C=function(D){if(D.error){B.HandleError(D,"Error creating tag "+A.Name);return }var E=D.result;if(E.Id<=0){A.Deleted=true;if(E.Id==-2){message('Tag with name "'+A.Name+'" already exists.')}else{if(E.Id==-1){message("Permission to create tag denied.")}else{if(E.Id==0){message("Maximum number of tags already created.")}}}B.OnDeleted.invoke(A)}else{B.OnCreated.invoke(D.result,A)}ServerAction("CreateInternal Tag");B.TagChanged(A.TeamId)};CreateTag(C,token,A.TeamId,A.Name,A.Color);return true};TagManager.prototype.UpdateInternal=function(A){var B=this;var C=function(D){if(D.error){B.HandleError(D,"Error updating tag: "+A.Name)}else{if(D.result!=null){var E=D.result;if(E.Id==-2){message('Tag with name "'+A.Name+'" already exists.')}E.Id=A.Id;B.OnUpdated.invoke(E,A);B.TagChanged(A.TeamId)}}ServerAction("UpdateInternal Tag")};UpdateTag(C,token,A.Id,A.Name,A.Color);return true};TagManager.prototype.DeleteInternal=function(A){var B=this;var C=function(D){if(D.error||D.result<1){B.HandleError(D,"Error deleting tag "+A.Name)}else{A.Deleted=1;B.OnDeleted.invoke(A)}ServerAction("DeleteInternal Tag");B.TagChanged(A.TeamId)};DeleteTag(C,token,A.Id)};TagManager.prototype.Filter=function(A,B){return A.TeamId==B&&!A.Deleted};TagManager.prototype.TagChanged=function(C){var A=this;var B=function(){A.FireOnChanged()};this.GetChildren(B,C)};TagManager.prototype.GetChildren=function(F,D,A){var B=this;var E=D;var C=function(G){var I=G.result;var H=teamManager.GetTeam(E);if(H!=null){H.Tags=I}if(F!=null){F(I)}};GetTeamTags(C,token,E)};TagManager.prototype.GetTeamTags=function(B){var A=teamManager.GetTeam(B);if(A==null){return null}return A.Tags};var tagManager=new TagManager();function PersonManager(){this.Initialize("PersonManager");this.OnChanged=new List()}extend(PersonManager,EntityManager);PersonManager.prototype.Construct=function(){return new PublicPerson()};PersonManager.prototype.UpdateInternal=function(B){var A=this;var C=function(D){if(D.error){A.HandleError(D,"Error updating person: "+B.Name)}else{if(D.result==null){error("Access denied editing person: "+B.Name)}else{var E=D.result;copyFields(E,B);A.OnUpdated.invoke(E,B)}}ServerAction("UpdateInternal Person")};UpdatePerson(C,B.Id,B.Name,B.Email,B.Password,B.Title,B.CompanyName,B.Department,B.WorkPhone,B.CellPhone,B.HomePhone,B.Address1,B.Address2,B.City,B.StateId,B.Zipcode,B.CountryId)};var personManager=new PersonManager();Transaction_OnCommit=function(A){var B=new SchedulingEngine(A);B.calculateSchedule()};function SchedulingEngine(B){this.entitySet=B;this.taskTable=B.getTable(taskManager);this.depTable=B.getTable(dependencyManager);var J=this.originalDeps=this.depTable.getEntities();var C=this.originalTasks=this.taskTable.getEntities();for(var D=0;D<C.length;D++){var A=C[D];CalculateTaskFields(A);var F=taskManager.IsCachedFieldDifferent(A,"Start","Finish");A._scheduleValid=F;A._summaryValid=false}for(var D=0;D<J.length;D++){var H=J[D];var A=taskManager.GetCachedEntity(H.WaitingTaskId);if(A!=null){this.addTaskAndRelations(A)}}for(var D=0;D<C.length;D++){var A=C[D];var I=taskManager.GetCachedDifferences(A);var G=taskManager.IsCachedFieldDifferent(A,"LagFinish");var K=A.Id==null||ContainsSummaryField(I)||I==null||this.taskTable.isDeleted(A);var E=taskManager.IsCachedFieldDifferent(A,"Start");this.addRelations(A,K,E,G,A)}}SchedulingEngine.prototype.addTaskAndRelations=function(B,A){if(A==null){A=B}if(!this.taskTable.contains(B)){B._scheduleValid=B.Locked||(B.Scheduled===false);B._summaryValid=false;this.taskTable.add(B,EntityOperation.Nothing);this.addRelations(B,true,true,true,A)}};SchedulingEngine.prototype.deleteYoungestDependency=function(){var C=this.depTable.select(function(D){return D._operation!=EntityOperation.Delete});var B=addYears(new Date(),1000);var A=C.max("Created",B);this.entitySet.deleteEntity(A);message("Break Circle")};SchedulingEngine.prototype.addRelations=function(C,L,H,K,D){if(K){var G=dependencyManager.getActiveWaitingDependencies(C.Id);for(var E=0;E<G.length;E++){var J=G[E];if(this.depTable.contains(J)){continue}if(this.containsEquivalentDependency(this.originalDeps,J)){continue}this.entitySet.add(J,EntityOperation.Nothing);if(J.WaitingTaskId==D.Id){this.deleteYoungestDependency();continue}var I=taskManager.GetCachedEntity(J.WaitingTaskId);if(I!=null){this.addTaskAndRelations(I,D)}}}if(H){var B=taskManager.GetCachedChildren(C.Id);for(var E=0;E<B.length;E++){var A=B[E];this.addTaskAndRelations(A)}}if(L){var F=C;while(F.ParentId!=null){if(this.taskTable.getEntity(F.ParentId)!=null){break}F=taskManager.GetCachedEntity(F.ParentId);if(F==null){break}this.addTaskAndRelations(F)}}};SchedulingEngine.prototype.containsEquivalentDependency=function(C,D){for(var B=0;B<C.length;B++){var A=C[B];if((D.BlockingTaskId==A.BlockingTaskId&&D.WaitingTaskId==A.WaitingTaskId)||(D.BlockingTaskId==A.WaitingTaskId&&D.WaitingTaskId==A.BlockingTaskId)){return true}}return false};SchedulingEngine.prototype.getAllPredecessors=function(B,F,E){if(F==null){F=new Array()}var J=this.taskTable.getEntity(B.ParentId);if(J!=null){this.getAllPredecessors(J,F)}var G=this.depTable.selectByField("WaitingTaskId",B.Id,G);if(E){var A=dependencyManager.getActiveBlockingDependencies(B.Id);for(var C=0;C<A.length;C++){var H=A[C];var D=false;if(this.containsEquivalentDependency(G,H)){continue}if(!G.contains(H)){G.add(H)}}}for(var C=0;C<G.length;C++){var H=G[C];if(this.depTable.isDeleted(H)){continue}var I=H.BlockingTaskId;var K=this.taskTable.getEntity(I);if(K==null&&E){K=taskManager.GetCachedEntity(I)}if(this.taskTable.isDeleted(K)){continue}if(K!=null&&!F.contains(K)){F.add(K)}}return F};SchedulingEngine.prototype.getAllValidChildTasks=function(D,A){var G=[];if(D.Id!=null){var C=this.taskTable.selectByField("ParentId",D.Id);for(var B=0;B<C.length;B++){var F=C[B];if(!this.taskTable.isDeleted(F)&&!isTaskDeleted(F)){G.push(F)}}if(A){var E=taskManager.GetCachedChildren(D.Id);for(var B=0;B<E.length;B++){var F=E[B];if(!taskManager.IsDeleted(F)&&!isTaskDeleted(F)&&!this.taskTable.contains(F)){G.push(F)}}}}return G};SchedulingEngine.prototype.calculateSchedule=function(){var C=this.taskTable.select();for(var B=1;B<100;B++){var A=this.calculateTasksWithValidPredecessorsSinglePass(C);if(A==0){break}if(A==-1){this.deleteYoungestDependency();continue}}for(var B=1;B<100;B++){var A=this.calculateTasksWithValidChildSummariesSinglePass(C);if(A==0){break}if(A==-1){message("Cannot finish summary calculations.");break}}};SchedulingEngine.prototype.calculateTasksWithValidPredecessorsSinglePass=function(G){var E=0;var A=0;for(var C=0;C<G.length;C++){var B=G[C];if(B._scheduleValid){continue}var F=this.getAllPredecessors(B,null,false);var D=this.getAllValidChildTasks(B,false);if(F.allFieldsEqual("_scheduleValid",true)&&D.allFieldsEqual("_scheduleValid",true)){A++;this.calculateTaskSchedule(B);B._scheduleValid=true}else{E++}}if(A>0){return A}if(E>0){return -1}return 0};SchedulingEngine.prototype.calculateTaskSchedule=function(A){this.calculateCount=this.calculateCount!=null?this.calculateCount+1:1;var G;var C;var B=(A.ChildCount>0)?this.getAllValidChildTasks(A,true):null;if(B!=null){if(B.length==0){return }G=B.minValue("Start");C=B.maxValue("Finish")}else{var F=this.getAllPredecessors(A,null,true);var E=F.maxValue("LagFinish");var D=GetSchedule(A.TeamId);if(E==null){return }G=CalculateEarliestTaskStart(A,E);C=CalculateFinish(G,A.Duration,A.DurationUnitId,D)}if(!Equals(G,A.Start)||!Equals(C,A.Finish)){A.Start=G;A.Finish=C;CalculateTaskLagFinish(A);this.entitySet.update(A)}};SchedulingEngine.prototype.calculateTasksWithValidChildSummariesSinglePass=function(F){var E=0;var A=0;for(var C=0;C<F.length;C++){var B=F[C];if(B._summaryValid){continue}var D=this.getAllValidChildTasks(B,false);if(D.allFieldsEqual("_summaryValid",true)){A++;this.calculateTaskSummary(B);B._summaryValid=true}else{E++}}if(A>0){return A}if(E>0){return -1}return 0};SchedulingEngine.prototype.calculateTaskSummary=function(A){this.calculateCount=this.calculateCount!=null?this.calculateCount+1:1;var B=this.getAllValidChildTasks(A,true);if(B.length==0){if(A.ChildCount>0){var C=taskManager.GetCachedChildren(A.Id);if(C!=null&&C.length>0){D=true;A.ChildCount=0;taskManager.OnUpdated.invoke(A,A)}}return }var D=false;D|=SummarizeDuration(A,B);D|=SummarizeWork(A,B);D|=SummarizeComplete(A,B);D|=SummarizeScheduled(A,B);D|=SummarizeCost(A,B,"LaborCost");D|=SummarizeCost(A,B,"MaterialCost");D|=SummarizeCost(A,B,"OtherCost");D|=SummarizeCost(A,B,"TotalCost");D|=SummarizeChildCount(A,B);if(D){this.entitySet.update(A)}};function CalculateTaskFields(A){ConstrainTaskFields(A);if(A.Finish==null||(taskManager.IsCachedFieldDifferent(A,"Duration","DurationId")&&!taskManager.IsCachedFieldDifferent(A,"Finish"))){CalculateTaskFinish(A)}if(A.LagFinish==null||taskManager.IsCachedFieldDifferent(A,"Finish","Lag","LagUnitId")){CalculateTaskLagFinish(A)}}function ConstrainTaskFields(A){A.Complete=Math.max(0,Math.min(100,A.Complete));CalculateTaskTotalCost(A);if(A.Complete==100&&A.Completed==null){A.Completed=getUtcDate(new Date())}else{if(A.Complete!=100){A.Completed=null}}if(A.Lag==null){A.Lag=0}if(A.Duration==null){A.Duration=-1}}function OnTaskPreCreate(A){ConstrainTaskFields(A);if(A.Finish==null){CalculateTaskFinish(A)}CalculateTaskLagFinish(A)}function OnTaskCreated(A){}function OnTaskPreUpdate(A){}function OnTaskPostUpdate(A){}function OnTaskPreLoad(A){CalculateTaskLagFinish(A)}function OnTaskPostLoad(A){}function OnTaskCacheUpdated(A,B){}function OnDependencyAdded(A){}taskManager.OnPreCreate.add(OnTaskPreCreate);taskManager.OnCreated.add(OnTaskCreated);taskManager.OnPreUpdate.add(OnTaskPreUpdate);taskManager.OnPostUpdate.add(OnTaskPostUpdate);taskManager.OnLoading.add(OnTaskPreLoad);taskManager.OnLoaded.add(OnTaskPostLoad);taskManager.OnCacheUpdated.add(OnTaskCacheUpdated);dependencyManager.OnCreated.add(OnDependencyAdded);function CalculateDependentTasks(B){var E=dependencyManager.getActiveWaitingDependencies(B.Id);for(var C=0;C<E.length;C++){var D=E[C];var A=taskManager.GetCachedEntity(D.WaitingTaskId);if(A!=null){CalculateTaskSchedule(A,D,true)}}}function CalculateTaskDependentStart(B){var H=null;var G=dependencyManager.getActiveBlockingDependencies(B.Id);if(G!=null&&G.length>0){for(var C=0;C<G.length;C++){var E=G[C];var A=GetBlockingTaskLagFinish(E);if(A!=null&&(H==null||A>H)){H=A}}}var D=taskManager.GetCachedEntity(B.ParentId);if(D!=null){var F=CalculateTaskDependentStart(D);if(F!=null&&(H==null||F>H)){H=F}}return H}var calculateStack=new List();function StartCircularDependencyCheck(A,B){}function FinishCircularDependencyCheck(A,B){}var OnCalculateTaskSchedule;function CalculateTaskSchedule(C,E,G){if(OnCalculateTaskSchedule!=null){OnCalculateTaskSchedule(C)}var A=CalculateTaskDependentStart(C);if(C.ChildCount>0){var B=taskManager.GetActiveCachedChildren(C.Id);if(B!=null&&B.length>0){for(var H=0;H<B.length;H++){CalculateTaskSchedule(B[H],null,true)}}}else{if(!C.Locked){var J=GetSchedule(C.TeamId);var I=CalculateEarliestTaskStart(C,A);var M=!Equals(I,C.Start);var F=C.Start;var L=C.Finish;var N=CalculateFinish(I,C.Duration,C.DurationUnitId,J);var K=!Equals(N,C.Finish);if(M||K){var D=StartCircularDependencyCheck(C,E);if(!D){C.Start=I;C.Finish=N;if(G){taskManager.Update(C)}}FinishCircularDependencyCheck(C,E)}}}}function GetBlockingTaskLagFinish(B){if(B.Deleted){return null}var A=taskManager.GetCachedEntity(B.BlockingTaskId);if(A!=null){return A.LagFinish}return B.BlockingTaskLagFinish}function CalculateTaskFinish(A){var C=GetSchedule(A.TeamId);var B=CalculateFinish(A.Start,A.Duration,A.DurationUnitId,C);A.Finish=B}function CalculateTaskLagFinish(A){var C=GetSchedule(A.TeamId);var B=CalculateFinish(A.Finish,A.Lag,A.LagUnitId,C);A.LagFinish=B}function CalculateTaskTotalCost(B){var E=null;var D=B.LaborCost;var C=B.MaterialCost;var A=B.OtherCost;if(D!=null){if(E==null){E=0}E+=D}if(C!=null){if(E==null){E=0}E+=C}if(A!=null){if(E==null){E=0}E+=A}B.TotalCost=E}var summaryFields=new Object();summaryFields.Start=true;summaryFields.Finish=true;summaryFields.Complete=true;summaryFields.Work=true;summaryFields.Scheduled=true;summaryFields.Status=true;summaryFields.ParentId=true;summaryFields.TotalCost=true;summaryFields.LaborCost=true;summaryFields.MaterialCost=true;summaryFields.OtherCost=true;function ContainsSummaryField(A){return ContainsField(A,summaryFields)}function ContainsField(C,B){if(C!=null){for(var A in C){if(B[A]){return true}}}return false}function RollupSummaryFields(C){if(C==null){return }var B=taskManager.GetCachedEntity(C);if(B==null){return }var A=taskManager.GetActiveCachedChildren(C);if(A.length>0){if(!B.Locked){SummarizeDuration(B,A)}SummarizeWork(B,A);SummarizeComplete(B,A);SummarizeScheduled(B,A);SummarizeCost(B,A,"LaborCost");SummarizeCost(B,A,"MaterialCost");SummarizeCost(B,A,"OtherCost");SummarizeCost(B,A,"TotalCost")}SummarizeChildCount(B,A);taskManager.Update(B)}function SummarizeCost(C,B,F){var D=null;for(var A=0;A<B.length;A++){var E=B[A][F];if(E!=null){if(D==null){D=0}D+=E}}if(C[F]!=D){C[F]=D;return true}return false}function SummarizeDuration(D,C){var B=true;for(var A=0;A<C.length;A++){if(C[A].Duration<0){B=false;break}}var G=GetSchedule(D.TeamId);var F=GetScheduleDurationUnit(D.Start,D.Finish);var E=GetScheduleDuration(G,D.Start,D.Finish,F.Id);if(!B){E=-E}if(D.DurationUnitId!=F.Id||D.Duration!=E){D.DurationUnitId=F.Id;D.Duration=E;return true}return false}function SummarizeChildCount(B,A){return B.ChildCount!=(B.ChildCount=A.length)}function SummarizeScheduled(C,B){var D=false;for(var A=0;A<B.length;A++){if(B[A].Scheduled){D=true}}return C.Scheduled!=(C.Scheduled=D)}function SummarizeComplete(I,C){var J=true;for(var E=0;E<C.length;E++){var B=C[E];if(B.Work==null||B.Work==0){J=false;break}}var H=0;var D=0;var G=GetDurationUnit("d");for(var E=0;E<C.length;E++){var B=C[E];var F;if(J){F=B.Work}else{F=Math.max(1,GetScheduleDuration(GetSchedule(B.TeamId),B.Start,B.Finish,G.Id))}H+=B.Complete*F;D+=F}var A=Math.round(H/D);if(H<D){A=Math.min(99,A)}if(H>0){A=Math.max(1,A)}return I.Complete!=(I.Complete=A)}function SummarizeWork(C,B){var D=0;for(var A=0;A<B.length;A++){var E=B[A];if(E.Work!=null){D+=E.Work}}return C.Work!=(C.Work=D)}function SummarizeStartFinish(D,C){var F=null,B=null;for(var A=0;A<C.length;A++){var E=C[A];if(F==null||E.Start<F){F=E.Start}if(B==null||E.Finish>B){B=E.Finish}}D.Start=F;D.Finish=B}function CalculateEarliestTaskStart(A,B){if(B==null){return A.Start}var D=GetSchedule(A.TeamId);var C=CalculateFinish(B,A.Duration,A.DurationUnitId,D);if(isSameDay(B,C)){return B}return GetNextWorkDay(D,B)}function CalculateFinishDays(C,M,I,K){if(M==null||M==0){return C}var L=C;var F=I?7:GetWorkDaysPerWeek(K);var G=Math.floor(M/F)-1;if(G>0){L=addDays(L,G*7);M-=G*F}for(var J=0;J<15;J++){var B=getMinutesOfDay(L);var D=GetStart(K,L);var H=GetFinish(K,L);var E=H-B;var A=1-(B-D)/(H-D);if(I||(E>0&&(A>=1||A>=M))){M--}if(M<=0){if(D==0){D=GetStandardWorkDayStart(K)}if(H==0){H=GetStandardWorkDayFinish(K)}var H=B+(H-D)*(1+M);L=setMinutesOfDay(L,H);break}L=addDays(L,1);L=setMinutesOfDay(L,GetStart(K,L))}return L}function CalculateFinishMinutes(B,E,H,J){if(E==null||E==0){return B}if(H){return addMinutes(B,E)}var K=B;var G=GetWorkMinutesPerWeek(J);var D=Math.floor(E/G)-1;if(D>0){K=addDays(K,D*7);E-=D*G}for(var I=0;I<15;I++){var A=getMinutesOfDay(K);var F=GetFinish(J,K);var C=F-A;if(E>C){K=addDays(K,1);K=setMinutesOfDay(K,GetStart(J,K));if(C>0){E-=C}}else{K=addMinutes(K,E);E=0;break}}return K}function CalculateFinish(A,C,F,E){if(C==null){C=-1}if(C==0){return A}C=Math.abs(C);var G=GetById(DurationUnits,F);var D=!G.Work;if(G.Days!=null){var H;if(G.Days>=7){var I=GetWorkDaysPerWeek(E);H=C*I*(G.Days/7);D=false}else{H=C*G.Days}return CalculateFinishDays(A,H,D,E)}else{var B=Math.ceil(C*G.Minutes);return CalculateFinishMinutes(A,B,D,E)}}function CalculateTaskDuration(A){var B=GetScheduleDurationUnit(A.Start,A.Finish);A.DurationUnitId=B.Id;var D=GetSchedule(A.TeamId);var C=GetScheduleDuration(D,A.Start,A.Finish,B.Id);A.Duration=C}function GetScheduleDurationUnit(B,C){var A=getMinutesDifference(C,B);if(!isSameDay(B,C)||A==60*8){return GetDurationUnit("d")}if(A<60){return GetDurationUnit("m")}return GetDurationUnit("h")}function GetScheduleDuration(E,C,A,G){if(E==null){E=GetDefaultSchedule()}var H=null;if(G==null){H=GetScheduleDurationUnit(C,A)}else{H=GetById(DurationUnits,G)}var I=!H.Work;var F;if(C!=null&&A!=null&&H.Days!=null){F=1;C=setMinutesOfDay(C,12*60);A=setMinutesOfDay(A,12*60);for(var D=0;D<1000;D++){if(isSameDay(C,A)){break}if(I||GetDuration(E,C)>0){F++}C=addDays(C,1)}}else{var B=getMinutesDifference(A,C);F=B/H.Minutes;F=significantDigits(F)}return F}function GetTaskFinish(D,E,A,C,B){return CalculateFinish(E,C,B,D)}function GetScheduleWorkMinutes(E,C,D){var B=0;for(var A=0;A<1000;A++){B+=GetDuration(E,C);C=addDays(C,1);if(isSameDay(C,D)){break}}return B}function GetDefaultSchedule(){return GetSchedule(null)}function GetSchedule(B){if(B!=null){var A=teamManager.GetTeam(B);if(A!=null){return A.Schedule}}if(schedule==null){schedule=new ScheduleData(0,540,540,540,540,540,0,0,1020,1020,1020,1020,1020,0)}return schedule}function IsWorkday(B,A){return GetFinish(B,A)>GetStart(B,A)}function GetRelativePointInDay(G,B){var F=24*60;var D=getMinutesOfDay(B);var H=GetStart(G,B);var C=GetFinish(G,B);if(C<=H){H=GetStandardWorkDayStart(G);C=GetStandardWorkDayFinish(G)}var E=C-H;var A=(D-H)/(C-H);if(A<0){A=0}if(A>1){A=1}return A}function GetNextWorkDay(E,A){if(A==null){A=new Date()}var D=A;for(var C=0;C<7;C++){A=addDays(A,1);var F=GetStart(E,A);var B=GetFinish(E,A);if(F<B){A=setMinutesOfDay(A,F);return A}}return addDays(D,1)}function GetNewTaskStartTime(E,A){if(A==null){A=new Date()}var D=A;for(var C=0;C<7;C++){var F=GetStart(E,A);var B=GetFinish(E,A);if(F<B){A=setMinutesOfDay(A,F);return A}A=addDays(A,1)}return D}function GetWorkDaysPerWeek(A){if(A==null){A=schedule}var B=0;if(A.SundayFinish>0){B++}if(A.MondayFinish>0){B++}if(A.TuesdayFinish>0){B++}if(A.WednesdayFinish>0){B++}if(A.ThursdayFinish>0){B++}if(A.FridayFinish>0){B++}if(A.SaturdayFinish>0){B++}return B}function GetWorkMinutesPerWeek(A){if(A==null){A=schedule}var B=A;var C=(B.SundayFinish-B.SundayStart)+(B.MondayFinish-B.MondayStart)+(B.TuesdayFinish-B.TuesdayStart)+(B.WednesdayFinish-B.WednesdayStart)+(B.ThursdayFinish-B.ThursdayStart)+(B.FridayFinish-B.FridayStart)+(B.SaturdayFinish-B.SaturdayStart);return C}function GetStartOrStandard(A,B){var C=GetStart(A,B);if(C==0){C=GetStandardWorkDayStart(A)}return C}function GetFinishOrStandard(A,B){var C=GetFinish(A,B);if(C==0){C=GetStandardWorkDayFinish(A)}return C}function GetStart(A,B){return GetStartByDay(A,B.getDay())}function GetStartByDay(A,B){if(A==null){A=schedule}if(B==0){return A.SundayStart}if(B==1){return A.MondayStart}if(B==2){return A.TuesdayStart}if(B==3){return A.WednesdayStart}if(B==4){return A.ThursdayStart}if(B==5){return A.FridayStart}if(B==6){return A.SaturdayStart}}function GetFinish(A,B){return GetFinishByDay(A,B.getDay())}function GetFinishByDay(A,B){if(A==null){A=schedule}if(B==0){return A.SundayFinish}if(B==1){return A.MondayFinish}if(B==2){return A.TuesdayFinish}if(B==3){return A.WednesdayFinish}if(B==4){return A.ThursdayFinish}if(B==5){return A.FridayFinish}if(B==6){return A.SaturdayFinish}}function GetWorkMinutesByDay(A,B){var D=GetStartByDay(A,B);var C=GetFinishByDay(A,B);return C-D}function GetDuration(A,B){return GetDurationByDay(A,B.getDay())}function GetDurationByDay(A,B){return GetFinishByDay(A,B)-GetStartByDay(A,B)}function GetStandardWorkDayLength(D){for(var B=0;B<7;B++){var E=GetStartByDay(D,B);var A=GetFinishByDay(D,B);var C=A-E;if(C>0){return C}}return 8*60}function GetStandardWorkDayStart(C){for(var A=0;A<7;A++){var B=GetStartByDay(C,A);if(B>0){return B}}return 60*9}function GetStandardWorkDayFinish(C){for(var A=0;A<7;A++){var B=GetFinishByDay(C,A);if(B>0){return B}}return 60*(12+5)}function InvalidateLayout(){Layout()}function IsContentBoxSizing(){return !IE}function ToPixels(A){if(A!=null&&A!=""){A=A.toLowerCase();if(A.substring(A.length-2)=="px"){A=A.substring(0,A.length-2)}A=parseNumber(A)}return A}function GetTop(A){var B=ToPixels(A.style.top);return B!=null&&B!=""?B:0}function GetLeft(A){var B=ToPixels(A.style.left);return B!=null&&B!=""?B:0}function GetWidth(A){if(A==null){alert("element is null")}var B=ToPixels(A.style.width);return B!=null&&B!=""?B:A.clientWidth}function GetHeight(A){if(A==null){alert("element is null")}var B=ToPixels(A.style.height);return B!=null&&B!=""?B:A.clientHeight}function SetWidth(A,B){if(B!=null){A.style.width=B}}function SetHeight(A,B){if(B!=null){A.style.height=Math.max(0,B)}}function FindElementWithAttribute(A,G,F){if(F==null){F=document.body}for(var D=0;D<F.childNodes.length;D++){var C=F.childNodes[D];var B=C.tagName;if(B!=null){if(B.toLowerCase()==A&&C.getAttribute(G)!=null){return C}var E=FindElementWithAttribute(A,G,C);if(E!=null){return E}}}return null}function Layout(I,A,M,L){if(I==null){I=FindElementWithAttribute("div","height");if(I==null){return }}if(A==null){A=GetWindowWidth()}if(M==null){M=GetWindowHeight()}var E=I.getAttribute("height");var F=GetAmount(E,M,L);var D=GetAddFixedAmount(E);var C=F;if(F==null){F=I.clientHeight}var J=I.component!=null?I.component.getWidth():I.getAttribute("width");var K=GetAmount(J,A,A);var H=GetAddFixedAmount(J);if(K!=null){SetWidth(I,K+H)}if(D!=0){C+=D}SetHeight(I,C);if(I.onlayout!=null){I.onlayout(K,C)}if(E!=null){var L=F;for(var G=0;G<I.childNodes.length;G++){var B=I.childNodes[G];if(IsLayoutNode(B)){L-=Layout(B,K,F,L)}}}if(E=="*"){return 0}return F}function GetWindowHeight(){if(self.innerHeight){return self.innerHeight}if(document.documentElement&&document.documentElement.clientHeight){return document.documentElement.clientHeight}if(document.body){return document.body.clientHeight}throw"Can't determine window height on this browser."}function GetWindowWidth(){if(self.innerHeight){return self.innerWidth}if(document.documentElement&&document.documentElement.clientHeight){return document.documentElement.clientWidth}if(document.body){return document.body.clientWidth}throw"Can't determine window width on this browser."}function IsLayoutNode(B){var A=B.tagName;return A!=null&&A.toLowerCase()=="div"}function GetAddFixedAmount(D){var B=0;if(D!=null&&D.indexOf!=null&&(D.indexOf("-")>=0||D.indexOf("+")>=0)){var A;var C=D.indexOf("-");if(C<0){A=1;C=D.indexOf("+")}else{A=-1}B=parseNumber(trim(D.substring(C+1)))*A}return B}function GetAmount(F,G,C){if(F==null){return null}if(F=="*"){return C}if(F.indexOf!=null){if(F.indexOf("-")>=0||F.indexOf("+")>=0){var B=F.indexOf("-");if(B<0){B=F.indexOf("+")}F=trim(F.substring(0,B))}var A;var E=F.indexOf("%")>=0;if(E){var D=parseNumber(F.substring(0,F.length-1));A=Math.floor(G*D/100)}else{A=parseNumber(F)}}else{A=F}return A}function centerElementInWindow(A){A.style.position="absolute";A.style.left=Math.max(0,(GetWindowWidth()-GetWidth(A))/2);A.style.top=Math.max(0,(GetWindowHeight()-GetHeight(A))/2)}function centerComponent(A){var B=A.parent;A.setStylePosition("absolute");A.setStyleLeft(Math.max(0,(B.getStyleWidth()-A.getStyleWidth())/2));A.setStyleTop(Math.max(0,(B.getStyleHeight()-A.getStyleHeight())/2))}function ensureElementInWindow(C){var F=GetLeft(C);var E=GetTop(C);var D=GetWidth(C);var A=GetHeight(C);var B=GetWindowWidth();var G=GetWindowHeight();if((F+D)>B){F=B-D}if(F<0){F=0}if((E+A)>G){E=G-A}if(E<0){E=0}C.style.left=F;C.style.top=E}function Clipboard(){this.data=null}Clipboard.prototype.setSource=function(A){this.source=A};Clipboard.prototype.getSource=function(){return this.source};Clipboard.prototype.setUserData=function(A){this.userData=A};Clipboard.prototype.getUserData=function(){return this.userData};Clipboard.prototype.setSourceX=function(A){this.sourceX=A};Clipboard.prototype.setSourceY=function(A){this.sourceY=A};Clipboard.prototype.getSourceX=function(){return this.sourceX};Clipboard.prototype.getSourceY=function(){return this.sourceY};Clipboard.prototype.setData=function(C,A,B){this.data=C;this.cutCallback=A;this.setCut(A!=null);this.setSource(B)};Clipboard.prototype.getData=function(){return this.data};Clipboard.prototype.clearCut=function(B,C){var A=this.cutCallback;if(A!=null){if(B){A(this.data,C)}this.cutCallback=null;this.data=null}this.setCut(false)};Clipboard.prototype.isCut=function(){return this.cut};Clipboard.prototype.setCut=function(A){this.cut=A};var clipboard=new Clipboard();function DragDropManager(){this.dragStartDistance=10;this.dropTargets=new List()}extend(DragDropManager,Clipboard);DragDropManager.prototype.ensureListening=function(){var A=this;if(!this.listening){this.listening=true;document.body.onmouseup=function(C){if(!C){C=window.event}var B=getTarget(C);if(A.isDragging()){var D=A.getCurrentDropTarget(C.clientX,C.clientY);if(D!=null){A.finishDrop(C,D);return true}else{A.cancel();return false}}else{A.cancel()}};if(IE){document.body.onmouseleave=function(B){if(!B){B=window.event}A.cancel()}}document.body.onmousemove=function(E){if(!E){E=window.event}if(A.startX==null){return }var B=A.currentX=E.clientX;var G=A.currentY=E.clientY;if(!A.isDragging()){var D=A.currentX-A.startX;var C=A.currentY-A.startY;var F=Math.sqrt(D*D+C*C);if(F>=A.dragStartDistance){A.start(E)}}A.updateDragDropComponents(E)}}};DragDropManager.prototype.start=function(A){this.dragging=true;this.sourceComponent.setDragData(this,A);this.registerDropTargets();this.updateDropComponent(A);this.updateDragComponent(A)};DragDropManager.prototype.registerDropTargets=function(){this.clearDropTargets();var A=this.sourceComponent.getRoot();A.registerDropTargets(this)};DragDropManager.prototype.updateDragDropComponents=function(B){var A=false;if(this.isDragging()){var C=this.getCurrentDropTarget(B.clientX,B.clientY);this.updateDragComponent(B,C);this.updateDropComponent(B,C)}};DragDropManager.prototype.updateDragComponent=function(D,F){if(this.dragComponent==null){var E=new Component("span");this.dragComponent=E}if(this.dragComponent.parent==null){root.add(this.dragComponent)}var C=false;if(F!=null){var B=D.clientX-F.bounds.x;var A=D.clientY-F.bounds.y;C=F.component.isValidDrop(this,B,A)}this.dragComponent.setClass(C?"DragComponent":"DragComponent-Invalid");if(D.clientX){this.dragComponent.setStyleLeft(D.clientX+12);this.dragComponent.setStyleTop(D.clientY+12)}};DragDropManager.prototype.updateDropComponent=function(E,H){if(this.dropComponent==null){var G=new Component();G.add(G.text=new Text());G.setClass("DropComponent");this.dropComponent=G}if(this.dropComponent.parent==null){root.add(this.dropComponent)}if(E.clientX){if(H==null){this.dropComponent.setVisible(false)}else{var C=E.clientX-H.bounds.x;var B=E.clientY-H.bounds.y;var D=H.component.getDropInsertBounds(C,B,H.element,this);this.dropComponent.setVisible(D!=null);if(D!=null){D.x+=H.bounds.x;D.y+=H.bounds.y;this.dropComponent.setStyleBounds(D.x,D.y,D.width,D.height);var A=H.component;var F=A.getDropText!=null?A.getDropText(this,C,B,D.width,D.height):"";this.dropComponent.text.setValue(F)}}}};DragDropManager.prototype.setCustomDragging=function(A){this.customDragging=A};DragDropManager.prototype.isDragging=function(A){if(this.dragging){return true}if(A&&this.customDragging){return true}return false};DragDropManager.prototype.isPossibleDragStart=function(){return !this.isDragging()&&this.sourceComponent!=null};DragDropManager.prototype.cancel=function(){var A=this.sourceComponent;if(A!=null&&this.dragging){A.cancelDrop(this)}this.reset()};DragDropManager.prototype.reset=function(){this.dragging=false;this.startX=null;this.startY=null;if(this.dragComponent!=null){this.dragComponent.removeSelf()}if(this.dropComponent!=null){this.dropComponent.removeSelf()}this.sourceComponent=null};DragDropManager.prototype.finishDrop=function(E,F){var C=this;var B=E.clientX-F.bounds.x;var A=E.clientY-F.bounds.y;var D=function(){if(F.component.isValidDrop(C,B,A)){F.component.dropData(C,B,A,F.component,F.element)}E.cancelBubble=true;C.reset();return true};if(Firefox){setTimeout(D,10)}else{D()}};DragDropManager.prototype.possibleDragStart=function(F,C,B,E,D,A){if(!F){F=window.event}this.startX=F.clientX;this.startY=F.clientY;this.sourceComponent=C;this.sourceData=B;this.setUserData(A);this.setSourceX(E);this.setSourceY(D);this.ensureListening()};DragDropManager.prototype.getSourceComponent=function(){return this.sourceComponent};DragDropManager.prototype.getSourceData=function(){return this.sourceData};DragDropManager.prototype.getCurrentDropTarget=function(A,D){this.currentDropTarget=null;for(var B=0;B<this.dropTargets.getCount();B++){var C=this.dropTargets.getItem(B);if(C.bounds.contains(A,D)){this.currentDropTarget=C;return C}}return null};DragDropManager.prototype.clearDropTargets=function(){this.currentDropTarget=null;this.dropTargets.clear()};DragDropManager.prototype.registerDropTarget=function(A,B,C){if(C==null){C=getClientRectangle(B)}this.dropTargets.add(new DropTarget(A,B,C))};function DropTarget(A,B,C){this.component=A;this.element=B;this.bounds=C}var dragDropManager=new DragDropManager();var NoValue=new Object();function createElement(C,A,E){var D;if(IE){var G="<"+C;if(A!=null){for(var C in A){if(!isStyleAttribute(C)){var F=A[C];if(F==NoValue){G+=" "+C}else{if(F!=null){G+=" "+C+'="'+F+'"'}}}}}G+=">";D=document.createElement(G);if(A!=null){for(var B in A){if(isStyleAttribute(B)){var F=A[B];if(F!=null){setAttributeOnElement(D,B,F)}}}}}else{D=document.createElement(C);if(A!=null){for(var B in A){var F=A[B];if(F!=null){setAttributeOnElement(D,B,F)}}}}if(E!=null){appendText(D,E)}return D}function hasParent(A){if(IE){return A.parentElement!=null}return A.parentNode!=null}function appendText(A,B){A.appendChild(document.createTextNode(B))}function insertChildFirst(A,C){var B=A.firstChild;if(B==null){A.appendChild(C)}else{A.insertBefore(C,B)}}function insertElement(C,D,A){if(A!=null){var B=C.childNodes[A];if(B!=null){C.insertBefore(D,B);return }}C.appendChild(D)}function isComponent(A){return instanceOf(A,Component)}function Component(A,B){if(A!=null){this.tag=A}if(B!=null){this.content=B}}extend(Component,Object);Component.prototype.tag="div";Component.prototype.setTag=function(A){this.tag=A};Component.prototype.getLocalPoint=function(A){return getLocalPoint(this.getElement(),A)};Component.prototype.validateChildren=function(B){if(this.children!=null){for(var A=0;A<this.children.size;A++){this.children.items[A].validate(B)}}};Component.prototype.validate=function(){if(this.validationFunction!=null&&!this.validationFunction(this.getValue(),this)){return this}for(var B=0;B<this.getChildCount();B++){var C=this.getChild(B);var A=C.validate();if(A!=null){return A}}return null};Component.prototype.setValidation=function(A,B){this.validationFunction=A;this.setValidationText(B);return this};Component.prototype.setValidationText=function(A){this.validationText=A};Component.prototype.getValidationText=function(){return this.validationText};Component.prototype.bind=function(A){this.bound=A;return this};Component.prototype.readBoundValue=function(B){if(this.bound!=null&&B!=null){var A=B[this.bound];this.setValue(A)}};Component.prototype.writeBoundValue=function(B){if(this.bound!=null&&B!=null){var A=this.getValue();B[this.bound]=A}};Component.prototype.ensureInWindow=function(){var E=this.getStyleLeft();var D=this.getStyleTop();var C=this.getActualWidth();var A=this.getActualHeight();var B=GetWindowWidth();var F=GetWindowHeight();if((E+C)>B){E=B-C}if(E<0){E=0}if((D+A)>F){D=F-A}if(D<0){D=0}this.setStyleLeft(E);this.setStyleTop(D)};Component.prototype.setEditable=function(A){};Component.prototype.registerService=function(B,A){B="_action_"+B;this[B]=A};Component.prototype.getService=function(C){C="_action_"+C;for(var B=this;B!=null;B=B.parent){var A=B[C];if(A!=null){return A}}return null};Component.prototype.registerDropTargets=function(C,A){if(this.isVisible()&&this.children!=null){for(var B=0;B<this.children.size;B++){this.children.items[B].registerDropTargets(C,A)}}};Component.prototype.setDragData=function(A,B){};Component.prototype.isValidDrop=function(B,A,C){return false};Component.prototype.dropData=function(A){};Component.prototype.cancelDrop=function(A){};Component.prototype.getDropInsertBounds=function(B,A,D,C){};Component.prototype._getEventHandlerList=function(B,A){var C=this[B];if(C==null&&A){C=this[B]=new List()}return C};Component.prototype.addEventHandler=function(A,B){this._getEventHandlerList(A,true).add(B)};Component.prototype.removeEventHandler=function(A,B){var C=this._getEventHandlerList(A);if(C!=null){C.remove(B)}};Component.prototype.fireEvent=function(E,D,C,B,A){var F=this._getEventHandlerList(E);if(F!=null){F.invoke(D,C,B,A)}};Component.prototype.childAddedEvent="_childAddedEvent";Component.prototype.addChildAddedEventHandler=function(A){this.addEventHandler(this.childAddedEvent,A)};Component.prototype.removeChildAddedEventHandler=function(A){this.removeEventHandler(this.childAddedEvent,A)};Component.prototype.childRemovedEvent="_childRemovedEvent";Component.prototype.addChildRemovedEventHandler=function(A){this.addEventHandler(this.childRemovedEvent,A)};Component.prototype.removeChildRemovedEventHandler=function(A){this.removeEventHandler(this.childRemovedEvent,A)};Component.prototype.setImageSource=function(C,B,A){this._imageSource=C;var D=endsWith(C.toLowerCase(),".gif");if(IE6&&!D){if(B==null){B=this.getStyleWidth()}if(A==null){A=this.getStyleHeight()}if(B!=null&&A!=null){this.setFilter("progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+getImageUrl(C)+"', sizingMethod='scale')")}else{this.setFilter("progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+getImageUrl(C)+"')")}this.setAttribute("src",getImageUrl("null.gif"))}else{this.setAttribute("src",getImageUrl(C))}};Component.prototype.getImageSource=function(){return this._imageSource};Component.prototype.updateImageSource=function(B,A){if(this._imageSource!=null){this.setImageSource(this._imageSource,B,A)}};Component.prototype.getActionManager=function(){return this.getService(ActionManager.prototype.getServiceName())};Component.prototype.setAttribute=function(B,E){var A=this.attributes;if(A==null){this.attributes=A=new Object()}var D=A[B];if(E!=D){A[B]=E;var C=this.element;if(C!=null){setAttributeOnElement(C,B,E)}}return this};Component.prototype.getAttribute=function(B){var C=this.element;if(C!=null){var D=C[B];if(D!=null){return D}}var A=this.attributes;return A!=null?A[B]:null};Component.prototype.getElement=function Component_getElement(){var D=this.element;if(D==null){if(this.tag==null){this.element=D=document.createTextNode(this.content)}else{this.ensureInitialized();this.element=D=this.createElement();var E=this.onmousedown;if(E!=null){D.onmousedown=E}E=this.onmouseup;if(E!=null){D.onmouseup=E}E=this.onmousemove;if(E!=null){D.onmousemove=E}E=this.onclick;if(E!=null){D.onclick=E}E=this.ondblclick;if(E!=null){D.ondblclick=E}E=this.onmouseover;if(E!=null){D.onmouseover=E}E=this.onmouseout;if(E!=null){D.onmouseout=E}this.addEvents(D);if(D.nodeType==1){D.component=this}this.updateBorder();var C=this.children;if(C!=null){var F=C.size;var A=C.items;for(var B=0;B<F;B++){this.addChildElement(A[B].getElement())}}}}return D};Component.prototype.createElement=function Component_createElement(){var A=createElement(this.tag,this.attributes,this.content);return A};Component.prototype.addEvents=function(A){};Component.prototype.removeEvents=function(A){};Component.prototype.fire_onmousedown=function(A){if(this.onmousedown!=null){return this.onmousedown(A,this)}};Component.prototype.fire_onmouseup=function(A){if(this.onmouseup!=null){return this.onmouseup(A,this)}};Component.prototype.fire_onclick=function(A){if(this.onclick!=null){return this.onclick(A,this)}};Component.prototype.fire_ondblclick=function(A){if(this.ondblclick!=null){return this.ondblclick(A,this)}};Component.prototype.addChildElement=function(B,A){insertElement(this.element,B,A)};Component.prototype.removeChildElement=function(A){if(A.parentNode!=null){A.parentNode.removeChild(A)}};Component.prototype.removeAllChildren=function(){if(this.children!=null){for(var A=this.children.size-1;A>=0;A--){this.remove(this.children.items[A])}}};Component.prototype.setContent=function(B){this.removeAllChildren();var A=this.getElement();removeAllChildren(A);if(B!=null){this.add(B)}};Component.prototype.setInternalLocation=function(A){var B=this.getChild(0);if(B!=null){B.setInternalLocation(A)}};Component.prototype.select=function(){};Component.prototype.focus=function(C){if(C==null){C=false}if(this.needsFocus()||(this.isFocusable()&&C)){var A=this.getInputElement();if(!A.disabled){try{A.focus();A.focus()}catch(B){}return true}}return this.focusChildren(C)};Component.prototype.needsFocus=function(){return false};Component.prototype.hasFocus=function(){return false};Component.prototype.focusChildren=function(A){if(this.children!=null){return Component_focusChildren(this.children.items,A)}return false};function Component_focusChildren(B,C){if(B!=null){for(var A=0;A<B.length;A++){var D=B[A];if(D!=null&&D.focus(C)){return true}}}return false}Component.prototype.addAll=function(B){for(var A=0;B!=null&&A<B.length;A++){this.add(B[A])}};Component.prototype.add=function(B,A){if(B==null){throw"Cannot add a null child."}if(!isComponent(B)){B=new Component(null,B);B.setTag(null)}if(B.parent!=null){B.removeSelf()}if(this.children==null){this.children=new List()}if(A==null){this.children.add(B)}else{this.children.insert(B,A)}B.parent=this;if(this.element!=null){this.addChildElement(B.getElement(),A)}if(this._active){B.setActive(true)}B.onAdded(this);this.fireEvent(this.childAddedEvent,B);return B};Component.prototype.remove=function(A){A.parent=null;if(this.children!=null){this.children.remove(A)}if(this.element!=null&&A.element!=null){this.removeChildElement(A.element)}if(A._active){A.setActive(false)}A.onRemoved(this);this.fireEvent(this.childRemovedEvent,A)};Component.prototype.move=function(C,A){this.children.move(C,A);var B=C.getElement();this.removeChildElement(B);this.addChildElement(B,A)};Component.prototype.onAdded=function(A){};Component.prototype.onRemoved=function(A){};Component.prototype.removeSelf=function(){var A=this.parent;if(A!=null){A.remove(this)}};Component.prototype.getRoot=function(){if(root!=null){return root}var A=this.parent;return A==null?this:A.getRoot()};Component.prototype.onNameChanged=function(A){};Component.prototype.isInput=function(){return false};Component.prototype.getName=function(){return this.name!=null?this.name:this.type};Component.prototype.setName=function(A){if(this.name==A){return false}this.name=A;this.onNameChanged(A);return true};Component.prototype.setValue=function(A){this.setAttribute("value",A!=null?A:"")};Component.prototype.getValue=function(){return this.getAttribute("value")};Component.prototype.setWidth=function(A){this.setAttribute("width",A)};Component.prototype.getWidth=function(){return this.getAttribute("width")};Component.prototype.setHeight=function(A){this.setAttribute("height",A)};Component.prototype.getHeight=function(){return this.getAttribute("height")};Component.prototype.setCursor=function(A){this.setAttribute("cursor",A)};Component.prototype.getCursor=function(){return this.getAttribute("cursor")};Component.prototype.setColor=function(A){this.setAttribute("color",A)};Component.prototype.setColor=function(A){this.setAttribute("color",A)};Component.prototype.setFontWeight=function(A){this.setAttribute("font.weight",A)};Component.prototype.setFontSize=function(A){this.setAttribute("font.size",A)};Component.prototype.setTextDecoration=function(A){this.setAttribute("text.decoration",A)};Component.prototype.setStyleOverflow=function(A){this.setAttribute("overflow",A)};Component.prototype.setStyleBorderTop=function(A){this.setAttribute("border.top",A)};Component.prototype.setStyleBorderLeft=function(A){this.setAttribute("border.left",A)};Component.prototype.setStyleBorderRight=function(A){this.setAttribute("border.right",A)};Component.prototype.setStyleBorderBottom=function(A){this.setAttribute("border.bottom",A)};Component.prototype.setStyleLeft=function(A){this.setAttribute("style.left",A)};Component.prototype.getStyleLeft=function(){return this.getAttribute("style.left")};Component.prototype.setStyleTop=function(A){this.setAttribute("style.top",A)};Component.prototype.getStyleTop=function(){return this.getAttribute("style.top")};Component.prototype.setStylePosition=function(A){this.setAttribute("position",A)};Component.prototype.getStylePosition=function(){return this.getAttribute("position")};Component.prototype.setStyleDisplay=function(A){this.setAttribute("display",A)};Component.prototype.getStyleDisplay=function(){return this.getAttribute("display")};Component.prototype.setStyleFloat=function(A){this.setAttribute("float",A)};Component.prototype.getStyleFloat=function(){return this.getAttribute("float")};Component.prototype.setZIndex=function(A){this.setAttribute("z-index",A)};Component.prototype.setTextAlign=function(A){this.setAttribute("text-align",A)};Component.prototype.getActualWidth=function(){var A;if(A==null){A=this.getStyleWidth()}if(A==null){A=this.getWidth()}if(A=="100%"){A=GetWindowWidth()}return A};Component.prototype.getActualHeight=function(){var A;if(A==null){A=this.getStyleHeight()}if(A==null){A=this.getHeight()}if(A=="100%"){A=GetWindowHeight()}return A};Component.prototype.containsEvent=function(C){var B=getLocalPoint(this.getElement(),C);var A=B.x;var D=B.y;return A>=0&&A<this.getActualWidth()&&D>=0&&D<=this.getActualHeight()};Component.prototype.setTitle=function(A){this.setAttribute("title",A)};Component.prototype.getTitle=function(){return this.getAttribute("title")};Component.prototype.setBackground=function(A){this.setAttribute("background",A)};Component.prototype.setBackgroundColor=function(A){this.setAttribute("background.color",A)};Component.prototype.setFilter=function(A){this.setAttribute("filter",A)};Component.prototype.setBackgroundImage=function(A){if(A!=null&&A.indexOf("\\")<0&&A.indexOf("/")<0){A=getImageUrl(A)}this.setAttribute("background.image",A!=null?"url("+A+")":null)};Component.prototype.setBackgroundPosition=function(A){this.setAttribute("background.position",A)};Component.prototype.setBorderColor=function(A){if(this.border!=null){this.border.setColor(A)}this.setAttribute("border.color",A)};Component.prototype.getBorderColor=function(){this.getAttribute("border.color")};var _minComponentSize=IE?1:0;Component.prototype.setStyleWidth=function(B,C){if(!isNumber(B)){B=null}else{if(B<_minComponentSize){B=_minComponentSize}}var A=this.getStyleWidth();this.setAttribute("style.width",B);if(B!=A&&(C==null||C==true)){this.fireStyleSizeChanged()}return this};Component.prototype.setStyleHeight=function(B,C){if(!isNumber(B)){B=null}else{if(B<_minComponentSize){B=_minComponentSize}}var A=this.getStyleHeight();this.setAttribute("style.height",B);if(B!=A&&(C==null||C==true)){this.fireStyleSizeChanged()}return this};Component.prototype.getStyleWidth=function(){return this.getAttribute("style.width")};Component.prototype.getStyleHeight=function(){return this.getAttribute("style.height")};Component.prototype.fireStyleSizeChanged=function(B,A){if(!isNumber(B)){B=this.getActualWidth()}if(!isNumber(A)){A=this.getActualHeight()}if(B!=null&&A!=null){this.onStyleSizeChanged(B,A)}};Component.prototype.onStyleSizeChanged=function(B,A){if(isNumber(B)&&isNumber(A)){this.updateImageSource(B,A);this.onLayout(B,A);if(this.styleSizeChangedHandler!=null){this.styleSizeChangedHandler(B,A,this)}}};Component.prototype.getStyleSizeChanged=function(){return this.styleSizeChangedHandler};Component.prototype.setStyleSizeChanged=function(A){this.styleSizeChangedHandler=A};Component.prototype.doLayout=function(){this.fireStyleSizeChanged()};Component.prototype.onLayout=function(B,A){};Component.prototype.setStyleSize=function(C,A){var B=this.getStyleWidth();this.setStyleWidth(C,false);var D=this.getStyleHeight();this.setStyleHeight(A,false);if(C!=B||A!=D){this.fireStyleSizeChanged()}};Component.prototype.setStyleBounds=function(B,D,C,A){this.setStyleLeft(B);this.setStyleTop(D);this.setStyleSize(C,A)};Component.prototype.getStyleBounds=function(){return new Rectangle(this.getStyleLeft(),this.getStyleTop(),this.getStyleWidth(),this.getStyleHeight())};Component.prototype.getId=function(){var A=this.getAttribute("id");if(A==null||A==""){this.setId(this.id=getUniqueId())}return this.id};Component.prototype.isFocusable=function(){return this.isInput()};Component.prototype.getInputId=function(){return this.getId()};Component.prototype.getInputElement=function(){return this.getElement()};Component.prototype.setId=function(A){this.setAttribute("id",A)};Component.prototype.getClass=function(){return this._cssClass};Component.prototype.setClass=function(B){this._cssClass=B;var A=this.element;if(A!=null){A.className=B}else{this.setAttribute("class",B)}};Component.prototype.toString=function(){return this.constructor.name};Component.prototype.getSelectedValues=function(){for(var B=0;B<this.getChildCount();B++){var C=this.getChild(B);if(!C.isVisible()){continue}var A=C.getSelectedValues();if(A!=null){return A}}return null};Component.prototype.getSelectedValue=function(){for(var A=0;A<this.getChildCount();A++){var C=this.getChild(A);if(!C.isVisible()){continue}var B=C.getSelectedValue();if(B!=null){return B}}return null};Component.prototype.indexOfSelf=function(){var A=this.parent;return A!=null?A.indexOf(this):-1};Component.prototype.indexOf=function(A){return this.children!=null?this.children.indexOf(A):-1};Component.prototype.getChildCount=function(){return this.children!=null?this.children.size:0};Component.prototype.getChild=function(A){return this.children!=null?this.children.items[A]:null};Component.prototype.getPreviousSibling=function(){return this.getSibling(-1)};Component.prototype.getNextSibling=function(){return this.getSibling(+1)};Component.prototype.getSibling=function(C){var B=this.parent;if(B==null){return null}var A=B.children.indexOf(this);return B.children.items[A+C]};Component.prototype.getFirstChild=function(){return(this.children!=null)?this.children.items[0]:null};Component.prototype.getLastChild=function(){return(this.children!=null)?this.children.items[this.children.size-1]:null};Component.prototype.findNext=function(B){if(B==null||B(this)){return this}var E=this.getFirstChild();if(E!=null){return E.findNext(B)}for(var C=this.getNextSibling();C!=null;C=C.getNextSibling()){var A=C.findNext(B);if(A!=null){return A}}if(this.parent==null){return null}var D=this.parent.getNextSibling();return D!=null?D.findNext(B):null};Component.prototype.findPrevious=function(B){if(B==null||B(this)){return this}var E=this.getLastChild();if(E!=null){return E.findPrevious(B)}for(var C=this.getPreviousSibling();C!=null;C=C.getPreviousSibling()){var A=C.findPrevious(B);if(A!=null){return A}}if(this.parent==null){return null}var D=this.parent.getPreviousSibling();return D!=null?D.findPrevious(B):null};Component.prototype.isAncestorOf=function(B){for(var A=B.parent;A!=null;A=A.parent){if(this==A){return true}}return false};Component.prototype.findAncestorOfType=function(A){var B=function(C){return instanceOf(C,A)};return this.findAncestor(B)};Component.prototype.findAncestor=function Component_findAncestor(B){for(var A=this.parent;A!=null;A=A.parent){if(B(A)){return A}}return null};Component.prototype.findDescendant=function(D){if(this.children!=null){for(var B=0;B<this.children.size;B++){var C=this.children.items[B];if(D(C)){return C}var A=C.findDescendant(D);if(A!=null){return A}}}return null};Component.prototype.ensureInitialized=function(){if(!this.initialized){this.initialized=true;this.initialize();if(this.oninitialized!=null){this.oninitialized(this)}}};Component.prototype.initialize=function(){this.initializeChildren()};Component.prototype.initializeChildren=function(){if(this.children!=null){for(var A=0;A<this.children.size;A++){this.children.items[A].ensureInitialized()}}};Component.prototype.isActive=function(){return this._active===true};Component.prototype.setActive=function(B){if(this._active!=B){this._active=B;if(this.children!=null){for(var A=0;A<this.children.size;A++){this.children.items[A].setActive(B)}}}};Component.prototype.isDisposed=function(){return this._disposed};Component.prototype.dispose=function(){this._disposed=true;this.removeSelf();this.removeEvents();this.disposeChildren()};Component.prototype.disposeChildren=function(){if(this.children!=null){for(var A=0;A<this.children.size;A++){this.children.items[A].dispose()}}};Component.prototype.unload=function(){if(this.children!=null){for(var A=0;A<this.children.size;A++){this.children.items[A].unload()}}};Component.prototype.setBehindDialog=function(A){this.setBehindDialogChildren(A)};Component.prototype.setBehindDialogChildren=function(B){if(this.children!=null){for(var A=0;A<this.children.size;A++){this.children.items[A].setBehindDialog(B)}}};Component.prototype.getNextPeer=function(){return this.getPeer(+1)};Component.prototype.getPreviousPeer=function(){return this.getPeer(-1)};Component.prototype.getPeer=function(C){var B=this.parent;if(B==null){return null}var A=this.parent.indexOf(this);return this.parent.getChild(A+C)};Component.prototype.getPeers=function(){var A=this.parent;if(A==null||A.children==null){return new Array(this)}return A.children.toArray()};Component.prototype.isVisible=function(){var A=this.getAttribute("visibility");var B=this.getAttribute("display");return(A==null||A=="")&&(B==null||B=="")};Component.prototype.setVisible=function(A){this.__visible=A;this.setAttribute("display",A?"":"none");this.setAttribute("visibility","")};Component.prototype.setHidden=function(A){if(A==null){A=true}this.setAttribute("visibility",A?"hidden":"")};Component.prototype.setEnabled=function(A){this.setAttribute("disabled",A?null:"true")};Component.prototype.isEnabled=function(){var A=this.getAttribute("disabled");if(A==null){return true}if(A.toString()=="true"){return false}return true};Component.prototype.getForm=function(){return this.findAncestor(function(A){return instanceOf(A,Form)})};var Dock=new Object();Dock.Top="Top";Dock.Left="Left";Dock.Right="Right";Dock.Bottom="Bottom";Dock.Fill="Fill";Dock.Center="Center";Dock.None="None";Component.prototype.setDockLayoutRoot=function(){this.setDockLayout();var A=this;var B=function(){var D=GetWindowWidth();var C=GetWindowHeight();A.setStyleSize(D,C)};windowOnLoad.add(B);windowOnResize.add(B)};Component.prototype.setDockLayout=function(){this.dockLayout=true;if(this.getStylePosition()==null){this.setStylePosition("relative")}};Component.prototype.getDock=function(){return this.dock};Component.prototype.setDock=function(A){this.dock=A;if(A!=null){this.setStylePosition("absolute");this.setDockLayout()}};Component.prototype.getDock=function(){return this.dock};Component.prototype.setPadding=function(A){this.padding=A};Component.prototype.getPadding=function(){return this.padding};Component.prototype.setMargin=function(A){this.margin=A};Component.prototype.getMargin=function(){return this.margin};Component.prototype.getBorder=function(){return this.border};Component.prototype.setBorder=function(B){var A=this.border!=null&&B==null;this.border=B;this.updateBorder(A)};var Component_EmptyBorder=new Border(0);Component.prototype.updateBorder=function(A){var B=this.border;var C=this.element;if(A){B=Component_EmptyBorder}if(B==null||C==null){return }C.style.borderLeftWidth=B.getLeft();if(B.getLeftColor()!=null){C.style.borderLeftColor=B.getLeftColor();C.style.borderLeftStyle=B.getLeftStyle()}C.style.borderTopWidth=B.getTop();if(B.getTopColor()!=null){C.style.borderTopColor=B.getTopColor();C.style.borderTopStyle=B.getTopStyle()}C.style.borderRightWidth=B.getRight();if(B.getRightColor()!=null){C.style.borderRightColor=B.getRightColor();C.style.borderRightStyle=B.getRightStyle()}C.style.borderBottomWidth=B.getBottom();if(B.getBottomColor()!=null){C.style.borderBottomColor=B.getBottomColor();C.style.borderBottomStyle=B.getBottomStyle()}};Component.prototype.setOptimumWidth=function(A){this._optimumWidth=A};Component.prototype.getOptimumWidth=function(A){var B=this._optimumWidth;if(B==null){return this.getActualWidth()}if(B>0&&B<1&&A!=null){B*=A}return B};Component.prototype.setOptimumHeight=function(A){this._optimumHeight=A};Component.prototype.getOptimumHeight=function(B){var A=this._optimumHeight;if(A==null){return this.getActualHeight()}if(A>0&&A<1&&B!=null){A*=B}return A};Component.prototype.setMinimumWidth=function(A){this._minWidth=A};Component.prototype.getMinimumWidth=function(){return this._minWidth!=null?this._minWidth:1};Component.prototype.setMinimumHeight=function(A){this._minHeight=A};Component.prototype.getMinimumHeight=function(){return this._minHeight!=null?this._minHeight:1};Component.prototype.getChildTotalWidth=function(){var C=0;for(var B=0;B<this.getChildCount();B++){var D=this.getChild(B);C+=D.getOptimumSizePlusMargin().width}var A=this.border;if(A!=null){C+=A.getHorizontal()}return C};Component.prototype.getChildTotalHeight=function(){var C=0;for(var B=0;B<this.getChildCount();B++){var D=this.getChild(B);C+=D.getOptimumSizePlusMargin().height}var A=this.border;if(A!=null){C+=A.getVertical()}return C};Component.prototype.getOptimumSizePlusMargin=function(){var B=this.getOptimumWidth();var A=this.getOptimumHeight();var C=this.margin;if(C!=null){B+=C.getHorizontal();A+=C.getVertical()}return new Size(B,A)};Component.prototype.getLayoutBounds=function(C,A){if(C==null){C=this.getActualWidth()}if(A==null){A=this.getActualHeight()}var D=new Rectangle(0,0,C,A);D.subtractBorder(this.getPadding());if(IE){var B=this.getBorder();if(B!=null){D.width-=B.getHorizontal();D.height-=B.getVertical()}}return D};Component.prototype.setLayoutSize=function(B,A){this.setLayoutBounds(null,null,B,A)};Component.prototype.setLayoutBounds=function(B,E,D,A){if(!IE){var C=this.getBorder();if(C!=null){D-=C.getHorizontal();A-=C.getVertical()}}if(D<1){D=1}if(A<1){A=1}if(this.canLayoutResize()){if(B!=null||E!=null){this.setStyleBounds(B,E,D,A)}else{this.setStyleSize(D,A)}}else{if(B!=null){this.setStyleLeft(B)}if(E!=null){this.setStyleTop(E)}if(this.canLayoutResizeWidth()){this.setStyleWidth(D)}if(this.canLayoutResizeHeight()){this.setStyleHeight(A)}}};Component.prototype.setLayoutResize=function(B,A){this.layoutResizeWidth=B;this.layoutResizeHeight=A!=null?A:B};Component.prototype.canLayoutResize=function(){return this.canLayoutResizeWidth()&&this.canLayoutResizeHeight()};Component.prototype.canLayoutResizeWidth=function(){return(this.layoutResizeWidth==null||this.layoutResizeWidth)};Component.prototype.canLayoutResizeHeight=function(){return(this.layoutResizeHeight==null||this.layoutResizeHeight)};Component.prototype.onLayout=function(B,H){if(!this.dockLayout||this.children==null){return }if(!isNumber(B)||!isNumber(H)){return }var A=this.getLayoutBounds(B,H);for(var G=0;G<this.getChildCount();G++){var C=this.getChild(G);var I=C.getDock();if(I==null||I==Dock.None||C.__visible===false){continue}var J=max(C.getMinimumWidth(),C.getOptimumWidth(A.width));var D=max(C.getMinimumHeight(),C.getOptimumHeight(A.height));var F=new Rectangle(A.x,A.y,J,D);var E=C.getMargin();if(E!=null){F.width+=E.getHorizontal();F.height+=E.getVertical()}if(I==Dock.Fill){F=A}else{if(I==Dock.Left){F.height=A.height;A.x+=F.width;A.width-=F.width}else{if(I==Dock.Right){F.x+=A.width-F.width;F.height=A.height;A.width-=F.width}else{if(I==Dock.Top){F.width=A.width;A.y+=F.height;A.height-=F.height}else{if(I==Dock.Bottom){F.y+=A.height-F.height;F.width=A.width;A.height-=F.height}else{if(I==Dock.Center){F.x=Math.max(0,(A.width-F.width)/2);F.y=Math.max(0,(A.height-F.height)/2)}}}}}}if(E!=null){F.subtractBorder(E)}C.setLayoutBounds(F.x,F.y,F.width,F.height)}};function RoundedContainer(B,F,A,I){this.setDockLayout();var C=this.topOuter=this.add(this.createEdge(Dock.Top,2,B));var E=this.topInner=this.add(this.createEdge(Dock.Top,1,null,B));var G=this.bottomOuter=this.add(this.createEdge(Dock.Bottom,2,B));var H=this.bottomInner=this.add(this.createEdge(Dock.Bottom,1,null,B));var D=this.body=this.add(new Component());D.setDock(Dock.Fill);D.setStyleOverflow("hidden");D.setBorder(this.bodyBorder=new Border(1,0,1,0).setColor(B));if(F!=null){this.setBackground(F)}if(A!=null&&I!=null){this.setStyleSize(A,I)}}extend(RoundedContainer,Component);RoundedContainer.prototype.add=function(A){return(this.body!=null)?this.body.add(A):base(this,A)};RoundedContainer.prototype.createEdge=function(C,D,A,E){var B=new Component();B.setStyleHeight(1);B.setStyleOverflow("hidden");B.setDock(C);B.setMargin(new Border(D,0,D,0));if(A!=null){B.setBackground(A)}if(E!=null){B.setBorder(new Border(1,0,1,0).setColor(E))}return B};RoundedContainer.prototype.setBorderColor=function(A){this.topOuter.setBackground(A);this.topInner.setBorderColor(A);this.bottomOuter.setBackground(A);this.bottomInner.setBorderColor(A);this.body.setBorderColor(A)};RoundedContainer.prototype.isBorderVisible=function(){return this.borderVisible!==false};RoundedContainer.prototype.setBorderVisible=function(A){this.borderVisible=A;this.topOuter.setVisible(A);this.topInner.setVisible(A);this.bottomInner.setVisible(A);this.bottomOuter.setVisible(A);this.body.setBorder(A?this.bodyBorder:null);this.doLayout()};RoundedContainer.prototype.setBackground=function(A){this.body.setBackground(A);this.setTopBackground(A);this.setBottomBackground(A)};RoundedContainer.prototype.setTopBackground=function(A){this.topInner.setBackground(A)};RoundedContainer.prototype.setBottomBackground=function(A){this.bottomInner.setBackground(A)};function IFrameComponent(A){base(this,"IFrame");this.setAttribute("src",A);this.setAttribute("scrolling","no");if(IE){this.setAttribute("frameborder",0)}}extend(IFrameComponent,Component);function TextNode(A){this.value=A}extend(TextNode,Component);TextNode.prototype.createElement=function(){return document.createTextNode(this.value||"")};TextNode.prototype.setValue=function(B){this.value=B;var A=this.getElement();A.nodeValue=B||""};TextNode.prototype.getValue=function(){return this.value};function Text(A){this.tag="span";this.value=A}extend(Text,Component);Text.prototype.initialize=function(){Component.prototype.initialize.call(this);this.setValue(this.value)};Text.prototype.setValue=function(B){this.value=B;var D=B!=null?B:"";var A=this.getElement();var C=A.firstChild;if(C==null){A.appendChild(document.createTextNode(D))}else{C.nodeValue=D}};Text.prototype.getValue=function(){return this.value};function Label(C,B){base(this,C);this.tag="label";this.setClass("Label");this.setCursor("pointer");this.text=C;if(B!=null){this.setAttribute("for",B.getId())}var A=this.extractAccessKey(C);if(A!=null){this.setAttribute("accesskey",A)}}extend(Label,Text);Label.prototype.extractAccessKey=function(B){if(B==null){return null}var A=B.indexOf("&");return A>=0?B.charAt(A+1):null};Label.prototype.initialize=function(){this.initializeChildren();if(this.getAttribute("for")==null){var A=this.findNext(function(B){return B.isInput()});if(A!=null){this.setAttribute("for",A.getInputId())}}};Label.prototype.createElement=function(){var A=createElement(this.tag,this.attributes);appendAcceleratorText(A,this.text,"Label-Accelerator");return A};function appendAcceleratorText(C,D,E){if(D==null){return }if(D.indexOf("&")>=0){D.match(/([^&]*)&(\w)([^&]*)/);var A=RegExp.$2;var B=document.createElement("span");C.appendChild(document.createTextNode(RegExp.$1));B.className=E;B.appendChild(document.createTextNode(A));C.appendChild(B);C.appendChild(document.createTextNode(RegExp.$3))}else{C.appendChild(document.createTextNode(D))}}function FieldSet(A){this.tag="fieldset";this.add(new Component("legend",A))}extend(FieldSet,Component);function TextField(B,C,A){this.tag="input";this.setAttribute("type","text");this.setClass(A!=null?A:"TextField");if(B!=null){this.setAttribute("size",B)}if(C!=null){this.setValue(C)}}extend(TextField,Component);TextField.prototype.fireOnKeyUp=function(){if(this.onkeyup!=null){this.onkeyup(this)}};TextField.prototype.setOnKeyUp=function(A){this.getElement().onkeyup=this.onkeyup=A};TextField.prototype.select=function(){this.getElement().select()};TextField.prototype.isInput=function(){return true};TextField.prototype.getValue=function(){var A=this.getAttribute("value");return A!=null?trim(A):A};TextField.prototype.setValue=function(A){if(A==null){A=""}this.setAttribute("value",A);if(this.element!=null){this.element.value=A}};TextField.prototype.isFocusable=function(){return true};function PasswordField(B,C,A){base(this,B,C,A);this.setAttribute("type","password")}extend(PasswordField,TextField);function TextArea(B,C,A){this.tag="textarea";this.setClass("TextArea");if(B==null){B=3}this.setAttribute("rows",B);if(C==null){C=IE?17:15}this.setAttribute("cols",C);if(A!=null){this.setValue(A)}}extend(TextArea,Component);TextArea.prototype.select=function(){this.getElement().select()};TextArea.prototype.isInput=function(){return true};TextArea.prototype.setValue=function(A){base(this,A);if(IE&&this.element==null&&!isEmpty(A)){this.add(A)}if(isEmpty(A)){this.removeAllChildren()}};TextArea.prototype.getValue=function(){var A=this.getAttribute("value");return A!=null?trim(A):A};TextArea.prototype.isFocusable=function(){return true};function NumberField(A,B){this.attributes=new Object();this.tag="input";this.setAttribute("type","text");this.setClass("TextField");this.setAttribute("size",4);this.showZeroAsNull=A;this.defaultValue=B}extend(NumberField,TextField);NumberField.prototype.setValue=function(A){if(this.showZeroAsNull&&A==0){A=null}return TextField.prototype.setValue.call(this,A)};NumberField.prototype.getValue=function(A){var A=TextField.prototype.getValue.call(this);if(A==null||A==""){A=this.defaultValue}if(A!=null){A=A-0}if(!isNumber(A)){A=null}return A};function DateField(){this.tag="input";this.setAttribute("type","text");this.setClass("DateField");this.setAttribute("size",10)}extend(DateField,TextField);DateField.prototype.getTextValue=function(){return TextField.prototype.getValue.call(this)};DateField.prototype.setValue=function(C){if(isDate(C)){var D=C.getMonth()+1;var A=C.getDate();var B=C.getFullYear();C=D+"/"+A+"/"+B}Component.prototype.setValue.call(this,C)};DateField.prototype.getValue=function(){var D=this.getTextValue(this);if(D==null||D==""){return null}var C=Date.parse(D);if(!isNumber(C)){var B=new Date();C=Date.parse(D+" "+B.getFullYear());if(!isNumber(C)){return null}if(C<B.getTime()){C=Date.parse(D+" "+(B.getFullYear()+1))}}var A=new Date();A.setTime(C);return A};function Break(){this.tag="br"}extend(Break,Component);function TimeField(A){this.dayTime=A;this.tag="input";this.setAttribute("type","text");this.setClass("TimeField");this.setAttribute("size",6)}extend(TimeField,TextField);TimeField.prototype.addEvents=function(B){var A=this;TextField.prototype.addEvents.call(this,B);B.onblur=function(D){var C=A.getValue();if(A.value!=C){A.value=C;A.fireOnvaluechanged()}}};TimeField.prototype.setOnvaluechanged=function(A){this.onvaluechanged=A};TimeField.prototype.fireOnvaluechanged=function(){if(this.onvaluechanged!=null){this.onvaluechanged(this,this.getValue())}};TimeField.prototype.getTextValue=function(){return TextField.prototype.getValue.call(this)};TimeField.prototype.setValue=function(A){if(isNumber(A)){if(this.dayTime){A=formatTime(A)}else{A=formatDurationHoursColonMinutes(A)}}else{A=""}base(this,A);this.value=this.getValue()};TimeField.prototype.getValue=function(){var B=this.getTextValue(this);if(B==null||B==""){return null}var A;if(B.indexOf(":")>=0){A=parseTime(B)}else{A=ParseDurationMinutes(B)}if(this.dayTime){A=A%(24*60)}return A};function Checkbox(B){this.tag="input";this.setAttribute("type","checkbox");this.setClass("Checkbox");this.getId();this.setValue(B);var A=this;A.onclick=function(C){if(A.onvaluechanged!=null){A.onvaluechanged(C,A)}}}extend(Checkbox,Component);Checkbox.prototype.isInput=function(){return true};Checkbox.prototype.getValue=function(){if(this.element!=null){return this.element.checked}return this.checked};Checkbox.prototype.setValue=function(A){if(isString(A)){A=parseBoolean(A)}this.checked=A;if(this.element!=null){this.element.checked=this.element.defaultChecked=A}else{if(A){this.setAttribute("checked",NoValue)}else{this.setAttribute("checked",null)}}};function HiddenField(A){this.tag="input";this.setAttribute("type","hidden");this.setAttribute("name",A)}extend(HiddenField,Component);function Button(D,C){this.setClass("Button");this.setLayoutResize(false);this.tag=Safari?"input":"button";if(isFunction(C)){this.onclick=C}var A=Label.prototype.extractAccessKey(D);if(A!=null){this.setAttribute("accesskey",A)}this.text=D;this.setAttribute("value",D);var B=isString(C)?C:"button";this.setAttribute("type",B)}extend(Button,Component);Button.prototype.setValue=function(B){if(Safari){this.setAttribute("value",B)}else{var A=this.getElement();removeAllChildren(A);appendAcceleratorText(A,B,"Label-Accelerator")}};Button.prototype.createElement=function(){if(Safari&&this.text!=null){this.setAttribute("value",this.text.replace("&",""))}var A=createElement(this.tag,this.attributes);if(!Safari&&this.text!=null){appendAcceleratorText(A,this.text,"Label-Accelerator")}return A};function Form(){this.tag="form";this.setClass("Form")}extend(Form,Component);Form.prototype.getSubmitButton=function(){return this.findDescendant(function(A){return instanceOf(A,Button)&&A.getAttribute("type")=="submit"})};Form.prototype.addEvents=function(A){A.onsubmit=function(){this.component.onsubmit();return false}};Form.prototype.onsubmit=function(){var B=this.getSubmitButton();if(B!=null&&!B.isEnabled()){return }var A=new List();this.validate(A);this.fireOnValidated(A);if(A.size==0){if(this.oncomplete!=null){this.oncomplete(this)}}};Form.prototype.fireOnValidated=function(A){if(this.onvalidated!=null){this.onvalidated(A)}};Form.prototype.post=function(A){var B=this.getElement();B.action=A;B.method="POST";B.onsubmit=null;B.submit()};function Table(B,A){if(B!=null){this.setCellPadding(B)}if(A!=null){this.setCellSpacing(A)}}extend(Table,Component);Table.prototype.setCellPadding=function(A){this.setAttribute("cellpadding",A)};Table.prototype.setCellSpacing=function(A){this.setAttribute("cellspacing",A)};Table.prototype.createElement=function(){var A=createElement("table",this.attributes);var B=this.bodyElement=document.createElement("tbody");A.appendChild(B);return A};Table.prototype.addChildElement=function(A){if(A.tagName.toLowerCase()!="tr"){var B=document.createElement("tr");B.appendChild(A);A=B}this.bodyElement.appendChild(A)};Table.prototype.addRowsTo=function(B){for(var A=this.getChildCount()-1;A>=0;A--){var C=this.getChild(0);B.add(C)}};function Cell(B){var C=isArray(B)?B:arguments;for(var A=0;A<C.length;A++){if(C[A]!=null){this.add(C[A])}}this.tag="td"}extend(Cell,Component);Cell.prototype.setAlign=function(A){this.setAttribute("align",A);return this};Cell.prototype.setVAlign=function(A){this.setAttribute("valign",A);return this};Cell.prototype.setSpan=function(A){this.setAttribute("colspan",A);return this};Cell.prototype.setRowSpan=function(A){this.setAttribute("rowspan",A);return this};function isRow(A){return instanceOf(A,Row)}function Row(B){this.tag="tr";if(B!=null){for(var C=0;C<arguments.length;C++){var A=arguments[C];if(A!=null){this.add(A)}}}}extend(Row,Component);Row.prototype.addChildElement=function(B){var C=B.tagName;if(C==null||C.toLowerCase()!="td"){var A=document.createElement("td");A.appendChild(B);B=A}this.element.appendChild(B)};Row.prototype.removeChildElement=function(B){var A=B;if(A.tagName.toLowerCase()!="td"){A=A.parentNode}A.parentNode.removeChild(A)};function Spacer(B,A){if(B==null){B=10}if(A==null){A=10}this.tag="span";this.setClass("Spacer");this.setStyleWidth(B);this.setStyleHeight(A)}extend(Spacer,Component);function Validator(A){if(A!=null){this.ValidatorConstructor(A,null)}}extend(Validator,Component);Validator.prototype.ValidatorConstructor=function(B,A){this.tag="label";this.setClass("Validator");this.content=B!=null?B:"Invalid field.";this.setVisible(false);this.control=A};Validator.prototype.validate=function(A,B){if(A==null){this.setVisible(false);return }this.validateChildren(A);if(B==null){B=this.getControl()}if(!this.validateControl(B)){this.setVisible(true);A.add(this.content)}else{this.setVisible(false)}};Validator.prototype.setInvalidManually=function(){this.setVisible(true);var B=this.getForm();var A=new List();A.add(this.content);if(B!=null){B.fireOnValidated(A)}};Validator.prototype.validateControl=function(A){return true};Validator.prototype.getControl=function(){if(this.control==null){this.control=this.findPrevious(function(A){return A.isInput()})}return this.control};Validator.prototype.initialize=function(){this.initializeChildren();var A=this.getControl();this.setAttribute("for",A.getId())};function Validate(D,C){var E=new List();for(var B=0;B<D.length;B++){var A=D[B];A.validate(E,C)}return E.size>0?E.getItem(0):null}function RequiredFieldValidator(B,A){if(B==null){B="Field is required."}this.ValidatorConstructor(B,A)}extend(RequiredFieldValidator,Validator);RequiredFieldValidator.prototype.validateControl=function(B){var A=B.getValue();if(A==null){return false}if(isString(A)){return A!=""}return true};function RangeValidator(A,C,D,B){this.minValue=A;this.maxValue=C;if(D==null){D="Value must be >= "+A+" and <= "+C+"."}this.ValidatorConstructor(D,B)}extend(RangeValidator,Validator);RangeValidator.prototype.validateControl=function(C){var B=C.getValue();if(B==null){return true}var A=parseInt(B);if(this.minValue!=null&&A<this.minValue){return false}if(this.maxValue!=null&&A>this.maxValue){return false}return true};function NumberValidator(B,A){if(B==null){B="Invalid number format."}this.ValidatorConstructor(B,A)}extend(NumberValidator,Validator);NumberValidator.prototype.validateControl=function(B){var A=B.getValue();if(A==null||A==""){return true}return isNumber(A)};function DateValidator(B,A){if(B==null){B="Invalid format. Use MM/DD/YY."}this.ValidatorConstructor(B,A)}extend(DateValidator,Validator);DateValidator.prototype.validateControl=function(B){var A=B.getTextValue();if(A==null||A==""){return true}return B.getValue()!=null};function CompareValidator(C,B,A){if(C==null){C="Fields are not the same."}this.ValidatorConstructor(C,B);this.compare=A}extend(CompareValidator,Validator);CompareValidator.prototype.getCompare=function(){if(this.compare==null){var A=this.getControl();this.compare=A.findPrevious(function(B){return B!=A&&B.isInput()})}return this.compare};CompareValidator.prototype.validateControl=function(D){var C=this.getCompare();var B=D.getValue();var A=C.getValue();if(B==null||B==""||A==null||A==""){return true}return B==A};function RegExpValidator(C,B,A){this.expression=C;this.ValidatorConstructor(B,A)}extend(RegExpValidator,Validator);RegExpValidator.prototype.validateControl=function(B){var A=B.getValue();if(A==null||A==""){return true}return this.expression.test(A)};var emailValidationExpression=/^[\w|\.|\-|'|`]+@[\w|\.|\-]+\.[\w|\.|\-]+$/;function EmailValidator(B,A){this.expression=emailValidationExpression;if(B==null){B="Invalid email format."}this.ValidatorConstructor(B,A)}extend(EmailValidator,RegExpValidator);function IsValidEmail(A){if(isEmpty(A)){return false}return emailValidationExpression.test(A)}function ValidationSummary(A){this.tag="div";if(A==null){A="Please fix the following issues and resubmit."}this.content=A;this.setClass("ValidationSummary");this.setHidden()}extend(ValidationSummary,Component);ValidationSummary.prototype.initialize=function(){this.initializeChildren();var B=this.getForm();if(B==null){throw"ValidationSummary was expecting to find a form ancestor to validate."}var A=this;B.onvalidated=function(C){A.onvalidated(C)}};ValidationSummary.prototype.validate=function(A){Component.prototype.validate.call(this,A);if(A==null){this.setHidden()}};ValidationSummary.prototype.onvalidated=function(A){if(A==null||A.size==0){this.setHidden();return }this.setVisible(true)};function RadioOption(C,B,A){this.tag="span";this.title=C;this.value=B;this.selected=A;this.inputId=getUniqueId();this.setClass("RadioOption")}extend(RadioOption,Component);RadioOption.prototype.getInputId=function(){return this.inputId};RadioOption.prototype.getInputElement=function(){return this.input};RadioOption.prototype.getValue=function(){return this.value};RadioOption.prototype.setEnabled=function(A){if(this.input!=null){this.input.disabled=!A}};RadioOption.prototype.setSelected=function(A){this.selected=A;if(this.input!=null){this.input.checked=A;this.input.defaultChecked=A}};RadioOption.prototype.createElement=function(){var C=this;var F=createElement(this.tag,this.attributes,this.content);var B=new Object();B.type="radio";B.value=this.value;B.name=this.parent.getId();B.id=this.inputId;if(this.selected){B.checked="checked"}var A=createElement("input",B);this.input=A;F.appendChild(A);var E=new Object();E["for"]=this.inputId;var D=this.label=createElement("label",E,this.title);setAttributeOnElement(D,"class","RadioOption-Label");F.appendChild(D);A.onclick=function(G){if(C.onvaluechanged!=null){C.onvaluechanged(G,C)}};return F};function RadioList(B){this.setClass("RadioList");this.tag="span";for(var A=0;A+1<arguments.length;A+=2){this.add(new RadioOption(arguments[A],arguments[A+1]))}this.getId()}extend(RadioList,Component);RadioList.prototype.setEnabled=function(A){for(var B=0;B<this.getChildCount();B++){var C=this.getChild(B);C.setEnabled(A)}};RadioList.prototype.isInput=function(){return true};RadioList.prototype.getFirstChild=function(){var A=this.getChild(0);if(A==null){throw"There must be at least one option"}return A};RadioList.prototype.getInputId=function(){return this.getFirstChild().getInputId()};RadioList.prototype.getInputElement=function(){return this.getFirstChild().getInputElement()};RadioList.prototype.initialize=function(){var A=this;this.initializeChildren();for(var B=0;B<this.getChildCount();B++){var C=this.getChild(B);C.onvaluechanged=function(E,D){A.fire_onvaluechanged(E,D)}}};RadioList.prototype.fire_onvaluechanged=function(B,A){this.value=A.getValue();if(this.onvaluechanged!=null){this.onvaluechanged(B,A,this.value)}};RadioList.prototype.getValue=function(){return this.value};RadioList.prototype.setValue=function(C){this.value=C;for(var B=0;B<this.getChildCount();B++){var D=this.getChild(B);var A=D.value;D.setSelected(A==C)}};function SelectList(C,A){var B=this;this.tag="select";if(C!=null){this.setAttribute("size",C)}if(A==true){this.setAttribute("multiple",A)}this.setClass("SelectList");this.setLayoutResize(true,false)}extend(SelectList,Component);SelectList.prototype.setExtensionGroupName=function(A){this.exGroupName=A};SelectList.prototype.maybeAddToExtensionGroup=function(A,C){if(this.exGroupName==null){return }var B=this.getOptionByValue(C);if(B!=null){return }if(this.exGroup==null){this.add(this.exGroup=new SelectOptionGroup(this.exGroupName))}this.exGroup.add(new SelectOption(A,C))};SelectList.prototype.isInput=function(){return true};SelectList.prototype.addEvents=function(A){A.onchange=function(){this.component.fire_onchange()};A.onkeydown=function(B){if(!B){B=window.event}if(B.keyCode==38||B.keyCode==40){B.cancelBubble=true}}};SelectList.prototype.setOnChange=function(A){this.onchange=A};SelectList.prototype.fire_onchange=function(){if(this.onchange!=null){this.onchange(this)}};SelectList.prototype.setBehindDialog=function(A){if(IE){if(A){this.setHidden()}else{this.setVisible(true)}}};SelectList.prototype.getValue=function(){var C=Component.prototype.getValue.call(this);if(isEmpty(C)){for(var A=0;A<this.getChildCount();A++){var B=this.getChild(A);C=B.getSelectedValue();if(C!=null){break}}}if(isEmpty(C)){C=null}return C};SelectList.prototype.setValue=function(D,A){if(A!=null){this.maybeAddToExtensionGroup(A,D)}if(this.element!=null){this.element.value=D}else{for(var B=0;B<this.getChildCount();B++){var C=this.getChild(B);C.setSelectedValue(D)}}};SelectList.prototype.getOptionByValue=function(D){for(var B=0;B<this.getChildCount();B++){var C=this.getChild(B);var A=C.getOptionByValue(D);if(A!=null){return A}}};SelectList.prototype.isFocusable=function(){return true};SelectList.prototype.getInputElement=function(){return this.getElement()};function SelectOptionGroup(A){this.tag="optgroup";this.setAttribute("label",A)}extend(SelectOptionGroup,Component);SelectOptionGroup.prototype.getTitle=function(){return this.getAttribute("label")};SelectOptionGroup.prototype.setSelectedValue=function(C){for(var A=0;A<this.getChildCount();A++){var B=this.getChild(A);B.setSelectedValue(C)}};SelectOptionGroup.prototype.getSelectedValue=function(){for(var A=0;A<this.getChildCount();A++){var B=this.getChild(A);var C=B.getSelectedValue();if(C!=null){return C}}};SelectOptionGroup.prototype.getOptionByValue=function(D){for(var B=0;B<this.getChildCount();B++){var C=this.getChild(B);var A=C.getOptionByValue(D);if(A!=null){return A}}return null};function SelectOption(D,C,B,A){this.tag="option";this.content=D;if(C==null){C=D}this.text=D;this.value=C;this.setValue(C);this.setColor(A);this.selected=B}extend(SelectOption,Component);SelectOption.prototype.getOptionByValue=function(A){return this.value==A?this:null};SelectOption.prototype.setSelectedValue=function(A){this.setSelected(A==this.value)};SelectOption.prototype.getSelectedValue=function(){if(this.isSelected()){return this.getValue()}};SelectOption.prototype.setData=function(A){this.data=A};SelectOption.prototype.getData=function(){return this.data};SelectOption.prototype.setColor=function(A){this.color=A};SelectOption.prototype.getColor=function(){return this.color};SelectOption.prototype.setTitle=function(A){this.title=A};SelectOption.prototype.getTitle=function(){return this.title};SelectOption.prototype.isSelected=function(){var A=this.element;return A!=null?A.selected:this.selected};SelectOption.prototype.getValue=function(){return this.value};SelectOption.prototype.getText=function(){return this.text};SelectOption.prototype.setSelected=function(A){this.selected=A;if(A){this.setAttribute("selected","selected")}};SelectOption.prototype.initialize=function(){Component.prototype.initialize.call(this);if(this.selected){this.setSelected(true)}};function createSelectOptionsFromNameValuePairs(C,F,A){if(F==null){F="="}if(A==null){A=","}var I=new Array();if(C!=null){var E=C.split(A);for(var D=0;D<E.length;D++){var B=E[D].split(F);var G=B[0];var H=B.length>1?B[1]:G;I.add(new SelectOption(H,G))}}return I}function Link(C,B,A){base(this,C);this.tag="a";this.setClass("Link");if(A!=null){this.setAttribute("target",A)}if(isString(B)){this.setAttribute("href",B)}else{if(isFunction(B)){this.onclick=B}}}extend(Link,Text);function ImageComponent(B,A){this.tag="img";this.setSource(B);if(A!=null){this.onclick=A}}extend(ImageComponent,Component);ImageComponent.prototype.setSource=function(A){if(A==null){this.setHidden(true)}else{this.setVisible(true)}if(A!=null){this.setImageSource(A)}};function ImageButton(B,A){this.tag="img";this.image=B;this.over=B+"-over";this.down=B+"-down";this.ismouseover=false;this.ismousedown=false;this.updateImage();this.setClass("ImageButton");if(A!=null){this.onclick=A}}extend(ImageButton,Component);ImageButton.prototype.updateImage=function(){var A=!this.ismouseover?this.image:this.ismousedown?this.down:this.over;this.setImageSource(A)};ImageButton.prototype.addEvents=function(B){var A=this;B.onmouseover=function(C){if(!C){C=window.event}C.cancelBubble=true;A.ismouseover=true;A.updateImage()};B.onmouseout=function(C){if(!C){C=window.event}C.cancelBubble=true;A.ismouseover=A.ismousedown=false;A.updateImage()};B.onmousedown=function(C){if(!C){C=window.event}C.cancelBubble=true;A.ismousedown=true;A.updateImage()};B.onmouseup=function(C){if(!C){C=window.event}C.cancelBubble=true;A.ismousedown=false;A.updateImage()}};function ToolbarButton(C,B,A){this.attributes=new Object();this.tag="Button";this.onclick=A;this.setTitle(B);this.add(new ImageComponent(C));this.setClass("ToolbarButton")}extend(ToolbarButton,Button);function Dialog(C,B,A){this.construct(C,B,A)}extend(Dialog,Component);Dialog.prototype.construct=function(C,B,A){this.title=C;this.tag="div";this.setClass("Dialog");this.width=B;this.height=A;this.setDockLayout()};Dialog.prototype.getFrameElement=function(){this.getElement();return this.frameElement};Dialog.prototype.getFramePosition=function(){return getScreenPosition(this.frameElement)};Dialog.prototype.setFramePosition=function(A){var B=this.getFrameElement();B.style.left=A.x;B.style.top=A.y};Dialog.prototype.createElement=function(){var I=this;var D=createElement(this.tag,this.attributes,this.content);var A=createElement("div");setAttributeOnElement(A,"height","100%");setAttributeOnElement(A,"class",this.getClass()+"-Background");D.appendChild(A);var B=this.frameElement=createElement("span");setAttributeOnElement(B,"class",this.getClass()+"-Frame");if(this.width!=null){B.style.width=this.width}if(this.height!=null){B.style.height=this.height}var E=createElement("span");setAttributeOnElement(E,"class",this.getClass()+"-Header");var C=createElement("span");var I=this;var H=new ImageButton("close-button",function(){I.removeSelf()});H.setAttribute("class",this.getClass()+"-Closer");C.appendChild(H.getElement());E.appendChild(C);var G=this.titleElement=createElement("span");setAttributeOnElement(G,"class",this.getClass()+"-Title");appendText(G,this.title);E.appendChild(G);B.appendChild(E);B.style.position="absolute";var F=createElement("span");setAttributeOnElement(F,"class",this.getClass()+"-Body");B.appendChild(F);D.onkeypress=function(J){if(!J){J=window.event}if(J.keyCode==27){I.removeSelf()}};this.body=F;this.frame=B;D.appendChild(B);return D};Dialog.prototype.setTitle=function(A){this.title=A;if(this.titleElement!=null){removeAllChildren(this.titleElement);appendText(this.titleElement,A)}};Dialog.prototype.getTitle=function(){return this.title};Dialog.prototype.onAdded=function(A){A.setBehindDialog(true);if(!this.dontCenter){centerElementInWindow(this.frame)}InvalidateLayout();this.focus(true)};Dialog.prototype.onRemoved=function(A){A.setBehindDialog(false);A.focus(false)};Dialog.prototype.setBehindDialog=function(A){};Dialog.prototype.addChildElement=function(B,A){insertElement(this.body,B,A)};function EditField(A){this.tag="span";this.value=A;this.setClass("EditField");this.add(A)}extend(EditField,Component);EditField.prototype.addEvents=function(B){var A=this;B.ondblclick=function(){A.beginEdit()}};EditField.prototype.beginEdit=function(){var B=this;this.removeAllChildren();var A=new TextField();A.setClass(this.getClass()+"-TextField");A.setValue(this.value);this.textField=A;var C=A.getElement();C.onblur=function(){B.endEdit(true)};this.add(A);C.onkeydown=function(D){if(!D){D=window.event}if(D.keyCode==27){B.endEdit(false)}if(D.keyCode==13){B.endEdit(true)}};C.select()};EditField.prototype.endEdit=function(B){var A=this.textField;this.textField=null;if(A==null){return }if(B){this.value=A.getValue()}this.removeAllChildren();this.add(this.value)};function Toolbar(){this.tag="div";this.setClass("Toolbar");this.setOptimumHeight(24);this.setDock(Dock.Top);this.setMargin(new Border(4,IE?2:4,3,IE?3:1))}extend(Toolbar,Component);Toolbar.prototype.addSeparator=function(){this.add(new ToolbarSeparator())};function ToolbarSeparator(){this.tag="span";this.setClass("ToolbarSeparator");var A=new ImageComponent("ToolbarSeparator");A.setClass("ToolbarSeparator-Image");this.add(A)}extend(ToolbarSeparator,Component);function NineWaySplitImage(C,B,A){this.setStylePosition("relative");this.imageWidth=B;this.imageHeight=A;this.image=C}extend(NineWaySplitImage,Component);NineWaySplitImage.prototype.createElement=function(){var C=Component.prototype.createElement.call(this);var A=this.images=new Array();for(var B=0;B<9;B++){var D=A[B]=createElement("div");D.style.position="absolute";D.style.width=this.imageWidth;D.style.height=this.imageHeight;D.style.backgroundImage="url("+getImageUrl(this.image+B)+")";C.appendChild(D)}return C};NineWaySplitImage.prototype.addEvents=function(B){var A=this;B.onlayout=function(D,C){A.fireStyleSizeChanged()}};NineWaySplitImage.prototype.setImageStyleBounds=function(C,B,E,D,A){C.style.top=E;C.style.left=B;C.style.width=D;C.style.height=A};NineWaySplitImage.prototype.onStyleSizeChanged=function(F,A){Component.prototype.onStyleSizeChanged.call(this,F,A);this.getElement();var C=this.imageWidth;var E=this.imageHeight;var B=Math.max(C,F-C);var D=Math.max(E,A-E);this.setImageStyleBounds(this.images[0],0,0,C,E);this.setImageStyleBounds(this.images[1],C,0,B-C,E);this.setImageStyleBounds(this.images[2],B,0,C,E);this.setImageStyleBounds(this.images[3],0,C,C,D-E);this.setImageStyleBounds(this.images[4],C,E,B-C,D-E);this.setImageStyleBounds(this.images[5],B,E,C,D-E);this.setImageStyleBounds(this.images[6],0,D,C,E);this.setImageStyleBounds(this.images[7],C,D,B-C,E);this.setImageStyleBounds(this.images[8],B,D,C,E)};function EditLabel(C,B){var A=this;this.emptyText="<Click to edit>";this.rowCount=B!=null?B:1;this.onclick=function(D){if(!D){D=window.event}D.cancelBubble=true;A.enterEditMode();return true};this.updateClass();this.setText(C)}extend(EditLabel,Component);EditLabel.prototype.addEvents=function(B){var A=this;Component.prototype.addEvents.call(this,B);B.onmouseover=function(){A.mouseOver=true;A.updateClass()};B.onmouseout=function(){A.mouseOver=false;A.updateClass()}};EditLabel.prototype.setText=function(A){this.text=A;if(!this.editMode){this.removeAllChildren();if(!isEmpty(A)){this.add(A)}else{if(this.isEditable()){this.add(this.emptyText)}}}};EditLabel.prototype.setEditable=function(A){this.editable=A;this.setText(this.text)};EditLabel.prototype.isEditable=function(){if(this.editable==null){return true}return this.editable};EditLabel.prototype.getValue=function(){return this.text};EditLabel.prototype.setValue=function(A){this.setText(A)};EditLabel.prototype.updateClass=function(){var A=(this.editMode||!this.mouseOver)?"EditLabel":"EditLabel-Hover";this.setClass(A)};EditLabel.prototype.onStyleSizeChanged=function(B,A){if(this.editMode){var C=this.field;C.setStyleWidth(B);this.updateClass()}};EditLabel.prototype.listenForExternalClick=function(){var A=this;this.listenRoot=this.getRoot();if(this.listenFunction==null){this.listenFunction=function(B){if(!B){B=window.event}A.exitEditMode()}}this.listenRoot.onmousedown=this.listenFunction};EditLabel.prototype.stopListenForExternalClick=function(){if(this.listenRoot!=null&&this.listenRoot.onclick==this.listenFunction){this.listenRoot.onmousedown=null}};EditLabel.prototype.exitEditMode=function(){if(this.editMode){this.editMode=false;this.stopListenForExternalClick();var B=this.field.getValue();var A=this.text;this.setText(B);if(A!=B&&this.oneditfinish!=null){this.oneditfinish(this,this.text)}this.updateClass()}};EditLabel.prototype.enterEditMode=function(){if(this.editMode){this.focus()}else{var A=this;this.editMode=true;this.listenForExternalClick();if(this.oneditstart!=null){this.oneditstart(this)}this.removeAllChildren();var C=this.rowCount>1?new TextArea(this.rowCount):new TextField();C.setValue(this.text);this.field=C;var B=C.getElement();B.onblur=function(){A.exitEditMode()};this.fireStyleSizeChanged();this.add(C);C.select();C.focus()}};function SeparatorPanel(C,B,A,E,F){var D=this;this.persistName=F;this.hideLines=E;this.a=C;this.b=B;var G=this.divider=new Component();G.setOptimumWidth(5);A=this.getASize(A);this.a.setStyleWidth(A);this.a.setOptimumWidth(A);this.a.setDock(Dock.Left);this.b.setDock(Dock.Fill);this.setDock(Dock.Fill);G.setDock(Dock.Left);this.updateDividerClass(false);this.add(C);this.add(G);this.add(B)}extend(SeparatorPanel,Component);SeparatorPanel.prototype.getASize=function(A){var B;if(this.persistName!=null){B=getData(this.persistName,A)}else{B=A}if(B==null){B=this.a.getOptimumWidth()}else{B=parseNumber(B)}return B};SeparatorPanel.prototype.setASize=function(A){this.a.setStyleWidth(A);this.a.setOptimumWidth(A);this.doLayout();this.updateDividerClass(false);if(this.persistName!=null){setData(this.persistName,A)}};SeparatorPanel.prototype.updateDividerClass=function(A){this.divider.setClass((this.hideLines&&!A)?"SeparatorPanel-Divider-NoLines":"SeparatorPanel-Divider")};SeparatorPanel.prototype.addEvents=function(C){var B=this;var A=this.divider.getElement();A.onmousedown=function(D){B.onDividerMouseDown(D)};C.onmousemove=function(D){B.onDividerMouseMove(D)};C.onmouseup=function(D){B.onDividerMouseUp(D)}};SeparatorPanel.prototype.onDividerMouseDown=function(B){if(!B){B=window.event}var A=this.dividerPoint=getLocalPoint(this.divider.getElement(),B);this.divider.setZIndex(1);this.updateDividerClass(true);this.down=true;dragDropManager.setCustomDragging(true)};SeparatorPanel.prototype.onDividerMouseUp=function(B){if(!B){B=window.event}if(this.down){this.down=null;dragDropManager.setCustomDragging(false);this.divider.setZIndex(null);var A=this.divider.getStyleLeft();this.setASize(A)}};SeparatorPanel.prototype.onDividerMouseMove=function(D){if(!D){D=window.event}if(this.down){var C=getLocalPoint(this.getElement(),D);var B=C.x-this.dividerPoint.x;if(this.a.getSnapWidth){var A=this.a.getSnapWidth();if(A!=null){var E=16;var F=Math.abs(B-A);if(F<E){B=A}}}this.divider.setStyleLeft(B)}};function LoadingPanel(C){if(C==null){C=false}var A=this;this.setStylePosition("absolute");this.setStyleLeft(0);this.setStyleTop(0);this.setDock(Dock.Fill);if(C){var B=this.background=new Component();B.setClass("LoadingPanel");B.setStylePosition("absolute");B.setStyleLeft(0);B.setStyleTop(0);B.setDock(Dock.Fill);this.add(B)}var D=this.image=new ImageComponent(C?"loading.gif":"loading_white.gif");D.setStyleWidth(42);D.setStyleHeight(42);D.setDock(Dock.Center);this.add(D)}extend(LoadingPanel,Component);LoadingPanel.prototype.onAdded=function(A){A.doLayout()};var debugComponent=null;function debug(A){if(!isdebug){return }if(document.body.debug==null){if(document.body.debugWindow==null){document.body.debugWindow=window.open("Debug.aspx","debugWindow","status=0,width=800,height=600,scrollbars=1")}if(document.body.debugList==null){document.body.debugList=[]}document.body.debugList.push(A)}else{document.body.debug(A)}}var Tree_DefaultCellHeight=19;var Tree_DefaultColumnHeight=24;function Tree(A,D){var C=this;this.cellHeight=A!=null?A:Tree_DefaultCellHeight;this.columnHeight=D!=null?D:Tree_DefaultColumnHeight;this.identityLookup=new Object();this.setCursor("default");this.tag="div";this.setClass("Tree");this.setDock(Dock.Fill);this.top=new Component("div");this.top.setClass("Tree-Top");this.top.setDock(Dock.Top);this.top.setOptimumHeight(this.columnHeight+(IE?0:2));this.add(this.top);this.header=new Component("div");this.header.setStyleHeight(this.columnHeight);this.header.setStylePosition("absolute");this.header.setClass("Tree-Header");this.header.setBackgroundImage("pnavgradient.png");this.top.add(this.header);this.body=new Component("div");this.setBackgroundImage("Column-Background");this.body.setClass("Tree-Body");this.body.setDock(Dock.Fill);this.add(this.body);var B=this.root=new TreeItem(null,this);B._root=true;this.root.onclick=function(E){C.focus()};this.root.ondblclick=function(E){if(!C.isEditMode()){if(C.isEditable(null)){C.enterInsertMode(null)}}};this.root.setClass("Tree-Root");this.underlay=new Component("div");this.underlay.setClass("Tree-Underlay");this.overlay=new Component("div");this.overlay.setClass("Tree-Overlay");this.body.add(this.underlay);this.body.add(this.root);this.body.add(this.overlay)}extend(Tree,Component);Tree.prototype.unload=function(){};Tree.prototype.toggleColumnSort=function(A){var B;var C=this._lastColumnSort;if(C!=A){this._lastColumnSort=A;B=true}else{B=this.getColumnSort(A);if(B==null){B=true}else{B=!B}}this.setColumnSort(A,B)};Tree.prototype.setColumnSort=function(C,B){var A=this;C._sort=B;var D=this.sortColumns;if(D==null){D=this.sortColumns=new List()}D.remove(C);if(B!=null){D.add(C)}var E=3;while(D.getCount()>E){D.removeAt(0)}this.sorter=function(G,F){return A.compareColumnSort(G,F)};this.root.sort()};Tree.prototype.compareColumnSort=function(C,B){var H=this.sortColumns;if(H==null){return 0}for(var D=H.getCount()-1;D>=0;D--){var F=H.getItem(D);var G=F.getSortValue(C);var E=F.getSortValue(B);var A=compare(G,E);if(this.getColumnSort(F)==false){A*=-1}if(A!=0){return A}}return 0};Tree.prototype.getColumnSort=function(A){return A._sort};Tree.prototype.getSortColumnString=function(){var D=this.sortColumns;if(D==null){return""}var E="";for(var A=0;A<D.getCount();A++){var B=D.getItem(A);var C=this.getColumnSort(B)==true;if(E.length>0){E+=","}E+=(C?"+":"-")+B.getName()}return E};Tree.prototype.setColumnSortable=function(A){this.columnSortable=A};Tree.prototype.isColumnSortable=function(){return this.columnSortable};Tree.prototype.getOpenItemIds=function(){var A=this;var C=new Array();var B=function(D,E){if(D.isExpanded()&&E!=null){var F=A.getIdentityInternal(E);C.add(F)}};this.foreachItem(B,true,true);return C};Tree.prototype.setOnLoadingHandler=function(A){this.onLoadingHandler=A};Tree.prototype.isLoading=function(){return this.loadingPanel!=null};Tree.prototype.beginLoading=function(A){if(this.loadingPanel==null){this.body.add(this.loadingPanel=new LoadingPanel(A));if(this.onLoadingHandler!=null){this.onLoadingHandler(true)}}};Tree.prototype.endLoading=function(){if(this.loadingPanel!=null){this.body.remove(this.loadingPanel);this.loadingPanel=null;if(this.onLoadingHandler!=null){this.onLoadingHandler(false)}}};Tree.prototype.displayValueById=function(E){var A=this;var C=this.getItem(E);if(C!=null){C.setSelected(true);C.focus()}else{var D=function(F){A.loadAncestorsRecursive(F)};var B=this.entityManager.GetAncestors(D,E)}};Tree.prototype.setContextMenuItems=function(A){this.contextMenuItems=A};Tree.prototype.getContextMenuItems=function(){return this.contextMenuItems};Tree.prototype.loadAncestorsRecursive=function(C,B){var A=this;if(B==null){B=0}var D=C[B];B=B+1;if(B>=C.length){A.setSelected(D,true)}else{var E=function(){A.loadAncestorsRecursive(C,B)};this.setExpanded(D,true,E)}};Tree.prototype.setMouseOverItem=function(A){if(this.mouseOverItem!=A){if(this.mouseOverItem!=null){this.mouseOverItem.setMouseOver(false)}this.mouseOverItem=A;if(this.mouseOverItem!=null){this.mouseOverItem.setMouseOver(true)}if(this.mouseOverItemChanged!=null){this.mouseOverItemChanged(A)}}};Tree.prototype.addMouseOverItemChanged=function(A){this.mouseOverItemChanged=A};Tree.prototype.updateOutlineNumbers=function(){this.root.setOutlineNumber(null)};Tree.prototype.getOutlineRootFunction=function(){return this.outlineRootFunction};Tree.prototype.setOutlineRootFunction=function(A){this.outlineRootFunction=A};Tree.prototype.isOutlineRoot=function(A){return(this.outlineRootFunction!=null)?this.outlineRootFunction(A):false};Tree.prototype.addSummaryRow=function(){if(this.summaryRow==null){var A=this.summaryRow=new TreeItem(null,this);A.setSummary();this.root.add(A)}};Tree.prototype.updateSummaryRow=function(){if(this.summaryRow==null){return }var A=this.getAllValues();this.summaryRow.setValue(A)};Tree.prototype.isEditable=function(A){if(this.isEditableFunction!=null){return this.isEditableFunction(A)}return true};Tree.prototype.setIsEditable=function(A){this.isEditableFunction=A};Tree.prototype.setName=function(A){this.name=A};Tree.prototype.getName=function(){return this.name};Tree.prototype.filterAll=function(){this.root.filterRecursive(this)};Tree.prototype.setOnlyUpdate=function(A){this.onlyUpdate=A};Tree.prototype.setRootQuery=function(B,C,A){this.rootGetChildren=B;this.rootFilter=C;this.rootSorter=A;if(C==null){this.setOnlyUpdate(true)}};Tree.prototype.hasRootQuery=function(){return this.rootGetChildren!=null};Tree.prototype.setAutoOpenDepth=function(A){this.autoOpenDepth=A};Tree.prototype.getChildrenFunction=function(A){if(A.isRoot()&&this.rootGetChildren!=null){return this.rootGetChildren}return this.getChildren};Tree.prototype.getSorter=function(A){if(A.isRoot()&&this.rootSorter!=null){return this.rootSorter}return this.sorter};Tree.prototype.checkFilter=function(C,A){var B=(A&&this.rootFilter!=null)?this.rootFilter:this.filter;return B==null||B(C,this.entityContext)};Tree.prototype.setBehindDialog=function(A){if(Firefox){if(A){this.root.setClass("Tree-Root-DialogFix")}else{this.root.setClass(this.isLeftSide?"Tree-Root-Left":"Tree-Root")}}Component.prototype.setBehindDialog.call(this,A)};Tree.prototype.disableVerticalScrolling=function(){this.isLeftSide=true;this.root.setClass("Tree-Root-Left")};Tree.prototype.setScrollTop=function(D){var A=this.root.getElement();var B=this.underlay.getElement();var C=this.overlay.getElement();A.scrollTop=D;C.style.top=-D+"px"};Tree.prototype.updateScroll=function(){var A=this.root.getElement();var B=this.header.getElement();var C=this.underlay.getElement();var D=this.overlay.getElement();B.style.left=C.style.left=D.style.left=-A.scrollLeft+"px";this.setScrollTop(A.scrollTop)};Tree.prototype.addEvents=function(D){var B=this;var A=this.root.getElement();A.onscroll=function(){B.updateScroll();if(B.onscroll!=null){B.onscroll(A.scrollLeft,A.scrollTop)}};var C=this.entityManager;if(C!=null){this.createHandler=function(F,E){if(B.onlyUpdate){B.updateItem(F,E)}else{B.addOrUpdateItem(F,E)}};this.updateHandler=function(F,E){B.updateItem(F,E)};this.deleteHandler=function(E){B.updateItem(E)};this.modifiedHandler=function(H){var F=B.getSelectedValue()!=null;for(var E=0;E<H.length;E++){var G=H[E];if(B.onlyUpdate){B.updateItem(G)}else{if(!B.checkFilter(G)){B.removeItem(G)}else{B.addOrUpdateItem(G)}}}if(F){B.ensureSelection()}B.root.maybeSort()};C.OnCreated.add(this.createHandler);C.OnUpdated.add(this.updateHandler);C.OnDeleted.add(this.deleteHandler);C.OnModified.add(this.modifiedHandler)}};Tree.prototype.removeEvents=function(){var A=this.entityManager;if(A!=null){A.OnCreated.remove(this.createHandler);A.OnUpdated.remove(this.updateHandler);A.OnDeleted.remove(this.deleteHandler);A.OnModified.remove(this.modifiedHandler)}};Tree.prototype.setCellBackgroundImage=function(A){this.cellBackgroundImage=A};Tree.prototype.getCellBackgroundImage=function(){return this.cellBackgroundImage};Tree.prototype.registerDropTargets=function(B,A){A=intersectRectangle(A,getClientRectangle(this.element));var C=this.getStyleWidth();if(this.entityManager!=null){this.header.registerDropTargets(B,A);this.root.registerDropTargets(B,A);this.underlay.registerDropTargets(B,A);this.overlay.registerDropTargets(B,A)}};Tree.prototype.setCanMove=function(A){this._canMove=A};Tree.prototype.canMove=function(){if(this._canMove!=null){return this._canMove}return this.entityManager!=null&&this.entityManager.CanMove(this.entityContext)};Tree.prototype.canSort=function(){return this.entityManager==null||this.entityManager.CanSort(this.entityContext)};Tree.prototype.indent=function(){var A=this.entityManager;if(!this.canMove()){return }BeginTransaction("Indent");var G=new List();var I=new List();var J=this.getSelectedValues();for(var D=0;D<J.length;D++){var H=J[D];var K=this.findItem(H);var B=K.parent;if(!I.contains(B)){I.add(B)}var E=B.indexOf(K);if(E==0){continue}G.add(H);var C=B.getChild(E-1);C.setExpanded(true);if(A!=null){A.SetParent(H,C.value);if(!I.contains(C)){I.add(C)}}this.addOrUpdateItem(H)}if(A!=null){if(G.getCount()>0){A.Indent(G.toArray())}for(var D=0;D<I.getCount();D++){var B=I.getItem(D);var F=B.value;if(F!=null){A.Update(F)}}}this.focusFirstSelected();EndTransaction()};Tree.prototype.outdent=function(){var B=this.entityManager;if(!this.canMove()){return }BeginTransaction("Outdent");var J=new List();var L=new List();var M=this.getSelectedValues();for(var F=M.length-1;F>=0;F--){var K=M[F];var O=this.findItem(K);if(O==null){throw"Item is null."}var C=O.parent;if(C.value==null){continue}J.add(K);if(!L.contains(C)){L.add(C)}var H=O.indexOfSelf();var E=C.getChildValues();for(var G=H+1;G<E.length;G++){this.moveItem(E[G],K)}var N=C.getNextPeer();var A=N!=null?N.value:null;this.moveItem(K,C.parent.value,A)}if(B!=null){var D=J.toArray();if(D.length>0){reverse(D);B.Outdent(D)}for(var G=0;G<L.getCount();G++){var C=L.getItem(G);C.updateSort();var I=C.value;if(I!=null){B.Update(I)}}}this.focusFirstSelected();EndTransaction()};Tree.prototype.GetSortAtEndValue=function(B){if(B==null){B=this.root}var A=B.getChildValues();var D=this.entityManager.GetSortProperty();if(D==null){return null}var C=GetMaximumValue(A,D)+1;return C};Tree.prototype.GetSortValue=function(B){if(B==null){return null}var A=this.entityManager.GetSortProperty();if(A==null){return null}return B[A]};Tree.prototype.SetSortValue=function(C,A){var B=this.entityManager.GetSortProperty();if(B==null){return null}C[B]=A};Tree.prototype.moveItem=function(F,C,D){if(!this.canMove()){return }var B=this.findItem(F);var E=C!=null?this.findItem(C):this.root;if(B!=null&&E==B.parent&&F==D){return }var A=D!=null?this.findItem(D):null;if(this.entityManager!=null){this.entityManager.SetParent(F,C)}this.addOrUpdateItem(F,F,D,true)};Tree.prototype.moveUp=function(){this.internalMoveUpDown(true);this.focusFirstSelected()};Tree.prototype.moveDown=function(){this.internalMoveUpDown(false);this.focusFirstSelected()};Tree.prototype.internalMoveUpDown=function(B){if(!this.canMove()){return }var E=new List();var C=this.getSelectedValues();if(B){for(var D=0;D<C.length;D++){var A=this.internalMoveValue(C[D],-1,C);if(A!=null){E.addIfUnique(A)}}}else{for(var D=C.length-1;D>=0;D--){var A=this.internalMoveValue(C[D],+1,C);if(A!=null){E.addIfUnique(A)}}}for(var D=0;D<E.getCount();D++){var A=E.getItem(D);A.updateSort()}};Tree.prototype.internalMoveValue=function(F,B,C){var I=this.findItem(F);if(I==null){return }var G=I.parent;var D=G.indexOf(I);var H=D+B;if(H>=0&&H<G.getChildCount()){var A=G.getChild(H);var E=A.value;if(!contains(C,E)){G.move(I,H);return G}}return null};Tree.prototype.copy=function(A){if(A==null){A=clipboard}A.setData(this.getSelectedValues(),null,this)};Tree.prototype.cut=function(B){if(B==null){B=clipboard}var A=this;B.setData(this.getSelectedValues(),function(D,C){if(A!=C){A.removeItems(D)}},this)};Tree.prototype.paste=function(E,J,B){if(E==null){E=clipboard}var D=E.getData();if(!isArray(D)||D.length==0){return }if(J==null){J=this.getSelectedValues()}var I=B!=null;var A=this.isValidPaste(D,J,F,I,E);if(A<1){if(A==-1){warning("Cannot paste item to the same parent.")}else{if(A==-2){warning("Cannot paste item to one of its descendants.")}else{warning("Cannot paste item here.")}}return false}var F=E.isCut()&&J.length<=1;E.clearCut(F,this);if(J==null||J.length<=1||F){var H=J[0];this.pasteToLocation(D,H,F,B);if(F){var C=H!=null?this.findItem(H):this.root;C.updateSort()}}else{for(var G=0;G<J.length;G++){this.pasteToLocation(D,J[G],F,B)}}this.focusFirstSelected();this.updateOutlineNumbers();return 1};Tree.prototype.pasteToLocation=function(F,E,A,D,G){if(A){this.entityManager.Move(F,E,D,this.entityContext,G);for(var C=0;C<F.length;C++){var B=F[C];this.moveItem(B,E,D)}}else{this.entityManager.Copy(F,E,D,this.entityContext,G)}};Tree.prototype.isValidPaste=function(I,F,B,E,A){if(F==null||F.length==0){F=new Array(null)}for(var C=0;C<F.length;C++){var G=F[C];for(var D=0;D<I.length;D++){var H=I[D];if(!this.entityManager.IsValidPaste(H,G,this.entityContext,A)){return -3}if(this.isAncestorOrSelf(H,G)){return -2}}}return 1};Tree.prototype.setAutoFocus=function(A){this.autoFocus=A};Tree.prototype.isAutoFocus=function(){return this.autoFocus!=false};Tree.prototype.focusFirstSelected=function(){if(this.isAutoFocus()){var B=this.getSelectedValue();if(B!=null){var A=this.findItem(B);if(A!=null){A.focus()}}}};Tree.prototype.isAncestorOrSelf=function(A,B){for(var C=this.findItem(B);C!=null;C=C.parent){var D=C.value;if(D==null){break}if(this.isEqual(D,A)){return true}}return false};Tree.prototype.isEqual=function(B,A){if(B==A){return true}if(B==null&&A==null){return true}if(B==null||A==null){return false}if(this.comparer!=null){return this.comparer(B,A)==0}return false};Tree.prototype.stopScrollAnimation=function(A){if(this.scrollXAnimation!=null&&this.scrollXAnimation.isRunning()){this.setScrollX(this.scrollXAnimation.getTarget(),false);this.scrollXAnimation.stop()}};Tree.prototype.getScrollX=function(){if(this.scrollXAnimation!=null&&this.scrollXAnimation.isRunning()){return this.scrollXAnimation.getTarget()}return this.root.getElement().scrollLeft};Tree.prototype.setScrollX=function(E,B){if(E==this.getScrollX()){return }var D=this.root.getElement();var G=this.getStyleWidth();var C=this.totalColumnWidth;E=clamp(E,0,C-G);if(B){if(this.scrollXAnimation==null){var A=this;var F=function(){A.updateScroll()};this.scrollXAnimation=new Animation(D,"scrollLeft",E,F)}else{this.scrollXAnimation.setTarget(E)}}else{D.scrollLeft=E;this.updateScroll()}};Tree.prototype.getScrollY=function(){return this.root.getElement().scrollTop};Tree.prototype.setScrollY=function(A){this.root.getElement().scrollTop=A};Tree.prototype.sort=function(){this.root.sort();this.updateOutlineNumbers()};Tree.prototype.construct=function(A){return this.entityManager.Construct(this.entityContext,A)};Tree.prototype.setCanEnterInsertMode=function(A){this.canEnterInsertMode=A};Tree.prototype.setInsertParent=function(A){this.insertParent=A};Tree.prototype.enterInsertMode=function(A,D){if(this.canEnterInsertMode!=null&&this.canEnterInsertMode==false){return }var L=this;var F=L.entityManager;if(F==null){return }var I=F.GetPrimaryProperty();if(I==null){return }var J=A!=null?F.GetParent(A.value):this.insertParent;var G=L.construct(J);var C=J!=null?this.findItem(J):this.root;var E=D;if(E==null){E=L.getColumnByProperty(I)}if(E==null){throw"Column not found "+E}if(!E.hasEditor()){return }var H=A!=null?C.indexOf(A)+1:null;var B=L.addItem(G,null,null,null,null,H);var K=B.getCell(E.getIndex());K.launchEditor()};Tree.prototype.setEntityContext=function(A){this.entityContext=A};Tree.prototype.setEntityManager=function(A){this.entityManager=A};Tree.prototype.exitEditMode=function(){this.setEditItem(null,null)};Tree.prototype.onEnterEditMode=function(){BeginTransaction("TreeEdit")};Tree.prototype.onExitEditMode=function(){EndTransaction()};Tree.prototype.setEditItem=function(A,B){if(this.editItem==null&&A!=null){this.onEnterEditMode()}else{if(this.editItem!=null&&A==null){this.onExitEditMode()}}if(this.editCell!=null&&this.editCell.finishFunction!=null){this.editCell.finishFunction(null,A!=null,null,this.editItem!=A)}this.editItem=A;this.editCell=B};Tree.prototype.getEditItem=function(){return this.editItem};Tree.prototype.getEditCell=function(){return this.editCell};Tree.prototype.isEditMode=function(){return this.editItem!=null};Tree.prototype.isInsertMode=function(){return this.editItem!=null&&!this.exists(this.editItem.value)};Tree.prototype.getColumnByProperty=function(A){var D=this.header.getChildCount();for(var B=0;B<D;B++){var C=this.header.getChild(B);if(C.property==A){return C}}return C};Tree.prototype.addColumn=function(C,A){if(C.RequiredProductId!=null&&ShowUpgradeRequiredDialog(C.RequiredProductId)){return null}C.setStyleHeight(this.columnHeight);C.setTree(this);C.cellHeight=this.cellHeight;if(A==null){A=this.header.getChildCount()}this.header.add(C,A);C.addLayers(false,this.underlay);C.addLayers(true,this.overlay);var D=this.root.getChildCount();for(var B=0;B<D;B++){this.root.getChild(B).columnAdded(C,A)}this.columnWidthChanged()};Tree.prototype.removeColumn=function(C){var A=this.header.indexOf(C);this.header.remove(C);C.removeLayers(false,this.underlay);C.removeLayers(true,this.overlay);var D=this.root.getChildCount();for(var B=0;B<D;B++){this.root.getChild(B).columnRemoved(C,A)}this.columnWidthChanged()};Tree.prototype.removeAllColumns=function(){for(var A=this.header.getChildCount()-1;A>=0;A--){this.removeColumn(this.header.getChild(A))}};Tree.prototype.getColumnIndex=function(A){return this.header.indexOf(A)};Tree.prototype.exists=function(A){return this.entityManager==null||this.entityManager.Exists(A)};Tree.prototype.insertModeSupported=function(){return this.entityManager!=null&&this.entityManager.GetPrimaryProperty()!=null};Tree.prototype.setItems=function(A){this.removeAllItems();this.addItems(A)};Tree.prototype.getColumns=function(){var D=new Array();var C=this.header.getChildCount();for(var A=0;A<C;A++){var B=this.header.getChild(A);D.add(B)}return D};Tree.prototype.updateOutlineColumns=function(D){var C=this.header.getChildCount();for(var A=0;A<C;A++){var B=this.header.getChild(A);if(B.hasOutline()){D.updateColumn(B)}}};Tree.prototype.isFlatList=function(){return this.flatList==true};Tree.prototype.setFlatList=function(A){if(A==null){A=true}this.flatList=A};Tree.prototype.addItems=function(A){for(var B=0;A!=null&&B<A.length;B++){this.addItem(A[B])}};Tree.prototype.addItem=function(K,J,A,F,N,I){if(this.exists(K)&&!this.checkFilter(K)){return null}var B;if(!this.flatList){if(J==null){J=this.getParent!=null?this.getParent(K):null}if(J!=null){B=this.findItem(J)}}if(B==null){if(!this.flatList&&this.exists(K)){if(J!=null){if(this.rootGetChildren==null){return }}if(!this.checkFilter(K,true)){return }}B=this.root}var D=false;var H=false;var M;if(N==null){M=new TreeItem(K,this)}else{M=N;M.removeSelf();D=N.isSelected();H=N.isExpanded()}if(A!=null){var L=this.findItem(A);if(L!=null){I=L.indexOfSelf()}}if(B==this.root&&I==null&&this.summaryRow!=null){I=B.getChildCount()-1}B.add(M,I);if(N!=null){M.setSelected(D);M.setExpanded(H)}if(F){B.setExpanded(true)}if(M==N){M.setValue(K);var G=this.header.getChildCount();for(var E=0;E<G;E++){var C=this.header.getChild(E);if(C.hasIndent()){M.updateColumn(C)}}}else{var G=this.header.getChildCount();for(var E=0;E<G;E++){M.columnAdded(this.header.getChild(E),E)}if(!M.isSummary()){this.updateSummaryRow()}}M.setStyleWidth(this.header.getStyleWidth());M.setCellHeight(this.cellHeight);this.addToLookup(K,M);this.invalidatePositionY();this.fireEvent(this.itemAddedEvent,M,K,J,A,F);this.fireEvent(this.itemModifiedEvent,K,null,M);this.updateOutlineNumbers();return M};Tree.prototype.updateItem=function(B,A){this.addOrUpdateItem(B,A,null,null,true)};Tree.prototype.addOrUpdateItem=function(D,A,B,F,E){if(A==null){A=D}var C=null;var G=false;var M=this.findItem(A);if(M==null){if(E){return }}else{if(!this.checkFilter(D)){this.removeItem(A);return }var I=this.flatList?null:M.parent.value;var K=this.flatList?null:this.getParent(D);if(this.isEqual(I,K)&&B==null&&!F){M.setValue(D);if(B!=null){var H=M.indexOfSelf();var J=B.indexOfSelf();var L=(H<J)?J-1:J;M.parent.move(M,L)}this.addToLookup(D,M);C=M}else{this.removeItem(A,M);G=true}}if(C==null){C=this.addItem(D,null,B,G,M)}else{this.fireEvent(this.itemUpdatedEvent,D,A);this.fireEvent(this.itemModifiedEvent,D,A,C)}return C};Tree.prototype.removeItems=function(B){for(var A=0;B!=null&&A<B.length;A++){this.removeItem(B[A])}};Tree.prototype.removeItem=function(C,B){if(B==null){B=this.findItem(C)}if(B!=null){var A=null;if(B==this.getFocusItem()||B==this.getEditItem()){A=this.getNextItem(B);if(A==null){A=this.getPreviousItem(B)}if(A!=null&&!A.isSummary()){A.focus()}}B.removeSelf();this.removeFromLookup(C);this.invalidatePositionY();this.fireEvent(this.itemRemovedEvent,B,C)}this.updateSummaryRow();this.updateOutlineNumbers();return B};Tree.prototype.ensureSelection=function(){if(this.getSelectedValue()!=null){return }this.focus();var A=this.getFocusItem();if(A!=null){A.setSelected(true);this.updateSelectedCount();this.onSelectedChanged()}};Tree.prototype.updateSelectedCount=function(){var A=this.selectedCount;var B=this.getSelectedCount();if(B!=A){this.selectedCount=B;this.onSelectedCountChanged(B)}};Tree.prototype.getItem=function(A){return this.identityLookup[A]};Tree.prototype.addToLookup=function(C,B){if(this.getIdentity!=null){var A=this.getIdentity(C);if(A!=null){this.identityLookup[A]=B}}};Tree.prototype.removeFromLookup=function(B){if(this.getIdentity!=null){var A=this.getIdentity(B);if(A!=null){this.identityLookup[A]=null}}};Tree.prototype.getIdentityInternal=function(A){if(this.getIdentity!=null){return this.getIdentity(A)}return A!=null?A.Id:null};Tree.prototype.setAnchorItem=function(A){this.anchorItem=A};Tree.prototype.getAnchorItem=function(){return this.anchorItem};Tree.prototype.needsFocus=function(){var A=this.getFocusItem();return A!=null};Tree.prototype.focus=function(){if(this.isEditMode()){return }var A=this.getFocusItem();if(A==null){A=this.root.getChild(0)}if(A!=null){A.focus(false);return true}};Tree.prototype.setFocusItem=function(A){this.focusItem=A};Tree.prototype.getFocusItem=function(){if(this.focusItem!=null){if(this.isItemVisible(this.focusItem)){return this.focusItem}this.focusItem=null}return null};Tree.prototype.isItemVisible=function(B){for(var A=B.parent;A!=null;A=A.parent){if(A.isExpanded==null){return true}if(!A.isExpanded()){return false}}return false};Tree.prototype.itemModifiedEvent="_itemModifiedEvent";Tree.prototype.addItemModifiedEventHandler=function(A){this.addEventHandler(this.itemModifiedEvent,A)};Tree.prototype.removeItemModifiedEventHandler=function(A){this.removeEventHandler(this.itemModifiedEvent,A)};Tree.prototype.itemUpdatedEvent="_itemUpdatedEvent";Tree.prototype.addItemUpdatedEventHandler=function(A){this.addEventHandler(this.itemUpdatedEvent,A)};Tree.prototype.removeItemUpdatedEventHandler=function(A){this.removeEventHandler(this.itemUpdatedEvent,A)};Tree.prototype.itemSortedEvent="_itemSortedEvent";Tree.prototype.addItemSortedEventHandler=function(A){this.addEventHandler(this.itemSortedEvent,A)};Tree.prototype.removeItemSortedEventHandler=function(A){this.removeEventHandler(this.itemSortedEvent,A)};Tree.prototype.itemAddedEvent="_itemAddedEvent";Tree.prototype.addItemAddedEventHandler=function(A){this.addEventHandler(this.itemAddedEvent,A)};Tree.prototype.removeItemAddedEventHandler=function(A){this.removeEventHandler(this.itemAddedEvent,A)};Tree.prototype.itemRemovedEvent="_itemRemovedEvent";Tree.prototype.addItemRemovedEventHandler=function(A){this.addEventHandler(this.itemRemovedEvent,A)};Tree.prototype.removeItemRemovedEventHandler=function(A){this.removeEventHandler(this.itemRemovedEvent,A)};Tree.prototype.itemExpandedChangedEvent="_itemExpandedChangedEvent";Tree.prototype.addItemExpandedChangedEventHandler=function(A){this.addEventHandler(this.itemExpandedChangedEvent,A)};Tree.prototype.removeItemExpandedChangedEventHandler=function(A){this.removeEventHandler(this.itemExpandedChangedEvent,A)};Tree.prototype.onExpandedChanged=function(B,A){this.invalidatePositionY();this.fireEvent(this.itemExpandedChangedEvent,B,A)};Tree.prototype.itemLoadChildrenEvent="_itemLoadChildrenEvent";Tree.prototype.addItemLoadChildrenEventHandler=function(A){this.addEventHandler(this.itemLoadChildrenEvent,A)};Tree.prototype.removeItemLoadChildrenEventHandler=function(A){this.removeEventHandler(this.itemLoadChildrenEvent,A)};Tree.prototype.onItemLoadChildren=function(A){this.fireEvent(this.itemLoadChildrenEvent,A,A.value)};Tree.prototype.selectedChangedEvent="_selectedChangedEvent";Tree.prototype.addSelectedChangedEventHandler=function(A){this.addEventHandler(this.selectedChangedEvent,A)};Tree.prototype.removeSelectedChangedEventHandler=function(A){this.removeEventHandler(this.selectedChangedEvent,A)};Tree.prototype.onSelectedChanged=function(C,B,A){if(B&&C!=null){this.setFocusItem(C)}this.fireEvent(this.selectedChangedEvent,C,C!=null?C.value:null,B,A)};Tree.prototype.selectedCountChangedEvent="_selectedCountChangedEvent";Tree.prototype.addSelectedCountChangedEventHandler=function(A){this.addEventHandler(this.selectedCountChangedEvent,A)};Tree.prototype.removeSelectedCountChangedEventHandler=function(A){this.removeEventHandler(this.selectedCountChangedEvent,A)};Tree.prototype.onSelectedCountChanged=function(A){if(A==null){A=this.getSelectedCount()}this.fireEvent(this.selectedCountChangedEvent,A)};Tree.prototype.getNextItem=function(B,A){return this.getAdjacentItem(B,true,A)};Tree.prototype.getPreviousItem=function(B,A){return this.getAdjacentItem(B,false,A)};Tree.prototype.getAdjacentItem=function(E,C,B){var F=false;var A=null;var D=function(G){if(A==null){if(F&&(B==null||B(G))){A=G}else{if(G==E){F=true}}}};this.foreachItem(D,C,true);return A};Tree.prototype.foreachItem=function(D,A,C){if(A){for(var B=0;B<this.root.getChildCount();B++){this.root.getChild(B).foreachItem(D,A,C)}}else{for(var B=this.root.getChildCount()-1;B>=0;B--){this.root.getChild(B).foreachItem(D,A,C)}}};Tree.prototype.selectRange=function(D,C){var A=false;var B=function(G){var E=A;if(G==D||G==C){A=!A}if(A||E){var F=A||!E;G.setSelected(true,null,F)}};this.foreachItem(B,true,true)};Tree.prototype.deleteSelectedValues=function(){var A=this.getSelectedValues();if(A!=null&&A.length>0){BeginTransaction("Tree Delete");for(var B=0;B<A.length;B++){var C=A[B];if(this.entityManager!=null){this.entityManager.Delete(C)}else{this.removeItem(C)}}this.ensureSelection();EndTransaction()}};Tree.prototype.initialize=function(){Component.prototype.initialize.call(this);this.header.initialize();this.root.initialize();var A=this.entityManager;if(A!=null){if(this.filter==null){this.filter=function(C,B){return A.Filter.call(A,C,B)}}if(this.comparer==null){this.comparer=function(D,C,E){var B=A.Compare.call(A,D,C,E);return B}}if(this.sorter==null){this.sorter=this.comparer}if(this.hasChildren==null){this.hasChildren=function(C,B){return A.HasChildren.call(A,C,B)}}if(this.getChildren==null){this.getChildren=function(C,B,D){return A.GetChildren.call(A,C,B,D)}}if(this.getParent==null){this.getParent=function(B){return A.GetParent.call(A,B)}}if(this.getIdentity==null){this.getIdentity=function(B){return A.GetIdentity.call(A,B)}}}if(this.getChildren!=null){this.loadRootItems()}this.onExpandedChanged(this.root,true)};Tree.prototype.updateValue=function(A){if(this.entityManager!=null){this.entityManager.Update(A)}};Tree.prototype.onStyleSizeChanged=function(B,A){base(this,B,A);this.updateScroll()};Tree.prototype.removeAllItems=function(){for(var A=this.root.getChildCount()-1;A>=0;A--){var B=this.root.getChild(A);if(B!=null&&!B.isSummary()){this.removeItem(B.value)}}};Tree.prototype.reload=function(){this.reloadSelected=this.getSelectedValues();this.removeAllItems();this.loadRootItems()};Tree.prototype.loadRootItems=function(){this.root.loadChildren()};Tree.prototype.columnWidthChanged=function(A){var D=0;var E=this.header.getChildCount();for(var B=0;B<E;B++){var C=this.header.getChild(B);var F=C.getStyleWidth();C.updateLayers(D,F);D+=F}this.totalColumnWidth=D;this.header.setStyleWidth(D);this.underlay.setStyleSize(D,this.root.getActualHeight());E=this.root.getChildCount();for(var B=0;B<E;B++){this.root.getChild(B).setStyleWidth(D)}this.setBackgroundPosition(D+" 0")};Tree.prototype.getSnapWidth=function(){return this.totalColumnWidth};Tree.prototype.ensureLastColumnFillsSpace=function(B,A){};Tree.prototype.setExpanded=function(C,A,D){if(A==null){A=true}var B=this.findItem(C);if(B!=null){B.setExpanded(A,D)}};Tree.prototype.containsItems=function(A){return this.root.isAncestorOf(A)};Tree.prototype.findItem=function(E,C){if(E==null){return null}var A=this.getIdentity!=null?this.getIdentity(E):null;if(A!=null){var D=this.getItem(A);if(D!=null&&this.containsItems(D)){return D}}if(C==null){C=this.comparer}for(var B=this.root.getChildCount()-1;B>=0;B--){D=this.root.getChild(B).findItem(E,C);if(D!=null){return D}}};Tree.prototype.findItemByProperty=function(B,A){return this.root.findItemByProperty(B,A)};Tree.prototype.selectAll=function(B){for(var A=this.root.getChildCount()-1;A>=0;A--){this.root.getChild(A).setSelected(B,true)}};Tree.prototype.setSelected=function(D,B,A){var C=this.findItem(D);if(C!=null){C.setSelected(B,null,A)}};Tree.prototype.setSelectedValues=function(A){this.selectAll(false);for(var B=0;A!=null&&B<A.length;B++){this.setSelected(A[B],true)}};Tree.prototype.setAllExpanded=function(C,B){if(B==null){B=this.root}else{if(B.hasChildren()){B.setExpanded(C)}}for(var A=B.getChildCount()-1;A>=0;A--){this.setAllExpanded(C,B.getChild(A))}};Tree.prototype.invalidatePositionY=function(){this.yPosValid=false};Tree.prototype.getAbsolutePositionY=function(A){if(!this.yPosValid){this.yPosValid=true;this.calculateAbsolutePositionY(0,this.root)}return A.absolutePositionY};Tree.prototype.calculateAbsolutePositionY=function(D,C){C.absolutePositionY=D;var B=C!=this.root?this.cellHeight:0;if(C.isExpanded()){for(var A=0;A<C.getChildCount();A++){B+=this.calculateAbsolutePositionY(D+B,C.getChild(A))}}return B};Tree.prototype.onValueChanged=function(B,C){var A=this.findItem(B);if(A!=null){A.valueChanged(null,C)}};Tree.prototype.getSelectedCount=function(){var A=new List();this.root.getSelectedValues(A);return A.getCount()};Tree.prototype.getAllValues=function(){var B=new List();var A=function(C,D){B.add(D)};this.root.foreachItem(A);return B.toArray()};Tree.prototype.getSelectedItems=function(){var A=new Array();this.root.getSelectedItems(A);return A};Tree.prototype.getSelectedValues=function(B,A){var C=new Array();this.root.getSelectedValues(C,B,A);return C};Tree.prototype.getSelectedValue=function(){return this.root.getSelectedValues(null)};function TreeItem(D,A){var B=this;this.tag="div";this.tree=A;this.setClass("TreeItem");this.setValue(D);this.expanded=false;var C=this.cells=createElement("div");setAttributeOnElement(this.cells,"class","TreeCells");this.subitems=createElement("div");if(D!=null){setAttributeOnElement(this.subitems,"display","none")}this.ondblclick=function(E){if(!E){E=window.event}if(!B.isSummary()){E.cancelBubble=true}};if(D!=null){C.onmouseover=function(E){if(!E){E=window.event}B.setMouseOver(true)};C.onmouseout=function(E){if(!E){E=window.event}B.setMouseOver(false)};C.onmousedown=function(G){if(!G){G=window.event}var E=getButton(G);if(E==2){G.cancelBubble=true;if(!B.isSelected()){A.selectAll(false);B.setSelected(true)}var F=A.getContextMenuItems();if(F!=null){A.setEditItem();ShowContextMenu(B,G,F)}return true}}}}extend(TreeItem,Component);TreeItem.prototype.setMouseOver=function(B){if(B!=this.ismouseover){this.ismouseover=B;var A=this.getTree();if(A!=null){A.setMouseOverItem(B?this:null)}this.updateStyle()}};TreeItem.prototype.isMouseOver=function(){return this.ismouseover};TreeItem.prototype.getOutlineNumber=function(){return this.outlineNumber};TreeItem.prototype.setOutlineNumber=function(D,E){var A=this.getTree();if(D===undefined){D=this.number;E=D!=null}if(D!=null&&A.isOutlineRoot(this.value)){D=null;E=true}if(E&&this.outlineNumber!=D){this.outlineNumber=D;if(A!=null){A.updateOutlineColumns(this)}}for(var B=0;B<this.getChildCount();B++){var F=this.getChild(B);var C=D!=null?D+"."+(B+1):(B+1);F.setOutlineNumber(C,E)}};TreeItem.prototype.setColor=function(A){this.cells.style.color=A};TreeItem.prototype.createElement=function(){var A=createElement(this.tag,this.attributes,this.content);A.appendChild(this.cells);A.appendChild(this.subitems);return A};TreeItem.prototype.getCellBackgroundImage=function(){var A=this.getTree();return A!=null?A.getCellBackgroundImage():null};TreeItem.prototype.getAbsolutePositionY=function(){var A=this.getTree();return A!=null?A.getAbsolutePositionY(this):0};TreeItem.prototype.getPreviousItem=function(){return this.getTree().getPreviousItem(this)};TreeItem.prototype.getNextItem=function(){return this.getTree().getNextItem(this)};TreeItem.prototype.getTree=function(){return this.tree};TreeItem.prototype.setCellHeight=function(A){this.cellHeight=this.cells.style.height=A};TreeItem.prototype.getCellHeight=function(){return this.cellHeight};TreeItem.prototype.setSelected=function(D,C,B){if(this.selected==null){this.selected=false}if(this.selected!=D){this.selected=D;this.updateStyle();if(this.onselectedchanged!=null){this.onselectedchanged()}var A=this.getTree();if(A!=null){A.onSelectedChanged(this,D,B);A.updateSelectedCount()}}if(C&&this.isExpanded()){this.setSelectedChildren(D,true)}};TreeItem.prototype.setSelectedChildren=function(C,B){for(var A=this.getChildCount()-1;A>=0;A--){this.getChild(A).setSelected(C,B)}};TreeItem.prototype.updateColumn=function(C){var A=C.getCell(this);C.updateCellInternal(this,A);for(var B=0;B<this.getChildCount();B++){this.getChild(B).updateColumn(C)}};TreeItem.prototype.filterRecursive=function(A){if(A==null){A=this.getTree()}for(var B=this.getChildCount()-1;B>=0;B--){var D=this.getChild(B);var C=D.value;if(!A.checkFilter(C)){A.removeItem(C)}else{D.filterRecursive(A)}}};TreeItem.prototype.isSelected=function(){return this.selected==true};TreeItem.prototype.containsSelections=function(){if(this.isSelected()){return true}for(var A=this.getChildCount()-1;A>=0;A--){if(this.getChild(A).containsSelections()){return true}}return false};TreeItem.prototype.getSelectedItems=function(A){return this.getSelectedValues(A,"this")};TreeItem.prototype.getSelectedValues=function(G,F,B){if(F==null){F="value"}if(this.isSelected()){var E=(F=="this")?this:this[F];if(B==null||B(E)){if(G!=null){G.add(E)}else{return E}}}var D=this.getChildCount();for(var C=0;C<D;C++){var A=this.getChild(C).getSelectedValues(G,F,B);if(A!=null){return A}}};TreeItem.prototype.foreachItem=function(D,A,C){if(this.isSummary()){return }if(A){if(!this.isRoot()){D(this,this.value)}if(!C||this.isExpanded()){for(var B=0;B<this.getChildCount();B++){this.getChild(B).foreachItem(D,A,C)}}}else{if(!C||this.isExpanded()){for(var B=this.getChildCount()-1;B>=0;B--){this.getChild(B).foreachItem(D,A,C)}}if(!this.isRoot()){D(this,this.value)}}};TreeItem.prototype.addChildElement=function(B,A){insertElement(this.subitems,B,A)};TreeItem.prototype.initialize=function(){Component.prototype.initialize.call(this);this.updateStyle()};TreeItem.prototype.updateStyle=function(){var B=this.isSelected();var C=this.ismouseover&&!dragDropManager.isDragging(true);var A="TreeCells";if(B){A+="-Selected"}if(C){A+="-MouseOver"}if(A!=this.lastStyle){this.lastStyle=A;setAttributeOnElement(this.cells,"class",A)}};TreeItem.prototype.updateCellStyle=function(B){var C=this.getCellBackgroundImage();if(C!=null){var A=this.getTree();B.setBackgroundImage(C);B.setBackgroundPosition("bottom left")}};TreeItem.prototype.hasChildren=function(){var C=this.children;if(this.value==null){return false}var A=this.getTree();var B=A.hasChildren;return this.getChildCount()>0||(B!=null&&B(this.value,A.entityContext))};TreeItem.prototype.setExpanded=function(B,C){if(this.expanded!=B){if(this.expanded!=null||!B){setAttributeOnElement(this.subitems,"display",B?"":"none")}this.expanded=B;if(B&&this.getChildCount()==0){this.loadChildren(C);C=null}if(!B){this.setSelectedChildren(false,true)}var A=this.getTree();if(A!=null){A.setEditItem(null,null);A.onExpandedChanged(this,B)}if(this.onexpandedchanged!=null){this.onexpandedchanged()}}if(C!=null){C()}};Tree.prototype.setUpdateSortEnabled=function(A){this.updateSortEnabled=A};TreeItem.prototype.updateSort=function(){var A=this.getTree();var C=A.entityManager;var D;if(C!=null&&A.updateSortEnabled){var B=this.getChildValues();D=C.UpdateSort(B)}A.fireEvent(A.itemSortedEvent,this);return D};TreeItem.prototype.maybeSort=function(){var A=this.getTree();if(A!=null&&(A.autoSort==null||A.autoSort==true)){this.sort()}};TreeItem.prototype.sort=function(K){var L=this.getTree();if(K!=null&&!L.canSort()){return }if(K==null){K=L.getSorter(this)}var J=L.entityContext;if(K==null){return }var B=this.children;if(B==null){return }for(var G=0;G<B.size;G++){var C=true;for(var E=0;E+1<B.size;E++){var I=B.items[E];var H=B.items[E+1];if(K(I.value,H.value,J)>0){C=false;B.move(I,E+1);if(!I.flaggedForRemoval){I.flaggedForRemoval=true}}}if(C){break}}for(var E=0;E<B.size;E++){var A=B.items[E];if(A.flaggedForRemoval){var D=A.getElement();var F=D.parentNode;F.removeChild(D)}}for(var E=0;E<B.size;E++){var A=B.items[E];if(A.flaggedForRemoval){A.flaggedForRemoval=null;var D=A.getElement();this.addChildElement(D,E)}}this.sortChildren()};TreeItem.prototype.sortChildren=function(){var B=this.children;for(var A=0;B!=null&&A<B.size;A++){B.items[A].sort()}};TreeItem.prototype.getChildValues=function(){var C=new Array();var B=this.children;for(var A=0;B!=null&&A<B.size;A++){C[A]=B.items[A].value}return C};TreeItem.prototype.loadChildren=function(F){var B=this;var A=this.getTree();var E=A.getChildrenFunction(this);if(E==null){return }A.beginLoading(B.isRoot());var D=function(I){var J=A.autoOpenDepth!=null&&B.getDepth()<=A.autoOpenDepth;var G=A.reloadSelected!=null?A.reloadSelected:A.getSelectedValues();for(var H=0;I!=null&&H<I.length;H++){var K=I[H];A.addOrUpdateItem(K);if(J){A.setExpanded(K)}}if(G!=null){A.setSelectedValues(G);A.reloadSelected=null}B.maybeSort();if(B.isRoot()&&A.isAutoFocus()){A.focus()}if(A!=null){A.onItemLoadChildren(B)}if(F!=null){F(I)}A.endLoading()};var C=A.entityContext;E(D,C,this.value)};TreeItem.prototype.isExpanded=function(){if(this.isRoot()){return true}return this.expanded!=false};TreeItem.prototype.isVisible=function(){for(var A=this.parent;A!=null;A=A.parent){if(A.isExpanded==null){break}if(!A.isExpanded()){return false}}return true};TreeItem.prototype.ensureVisible=function(){for(var A=this.parent;A!=null;A=A.parent){if(A.isExpanded==null){break}A.setExpanded(true)}};TreeItem.prototype.fireChildrenChanged=function(){if(this.onchildrenchanged!=null){this.onchildrenchanged()}};TreeItem.prototype.add=function(B,A){Component.prototype.add.call(this,B,A);this.fireChildrenChanged();this.updateStyle()};TreeItem.prototype.setSummary=function(){this.setClass("TreeItem-Summary");this._summary=true};TreeItem.prototype.isSummary=function(){return this._summary==true};TreeItem.prototype.isRoot=function(){return this._root==true};TreeItem.prototype.remove=function(A){Component.prototype.remove.call(this,A);if(!this.isRoot()&&this.getChildCount()==0){this.setExpanded(false)}this.fireChildrenChanged();this.updateStyle()};TreeItem.prototype.setValue=function(B){var A=this.oldValue;this.value=B;if(A!=null){this.valueChanged(A);this.sorted=false}this.oldValue=clone(B)};TreeItem.prototype.valueChanged=function(C,G){var B=this.getTree();if(B==null){return }var F=B.header.getChildCount();this.updateStyle();for(var D=0;D<F;D++){var E=B.header.getChild(D);var A=this.getCell(D);if(A!=null){E.updateCell(this,A,C,G)}}if(!this.isSummary()){B.updateSummaryRow()}};TreeItem.prototype.columnAdded=function TreeItem_columnAdded(F,D){var A=F.createCellInternal(this);this.updateCellStyle(A);var B=A.getElement();var C=this.cells;var G=C.childNodes[D];if(G!=null){C.insertBefore(B,G)}else{C.appendChild(B)}for(var E=this.getChildCount()-1;E>=0;E--){this.getChild(E).columnAdded(F,D)}};TreeItem.prototype.columnRemoved=function(D,B){var A=this.cells.childNodes[B];this.cells.removeChild(A);for(var C=this.getChildCount()-1;C>=0;C--){this.getChild(C).columnRemoved(D,B)}};TreeItem.prototype.setStyleWidth=function(B){Component.prototype.setStyleWidth.call(this,B);for(var A=this.getChildCount()-1;A>=0;A--){this.getChild(A).setStyleWidth(B)}};TreeItem.prototype.findItem=function(D,B){if(this.isSummary()){return null}if(this.value==D||(B!=null&&(B(this.value,D)==0))){return this}for(var A=this.getChildCount()-1;A>=0;A--){var C=this.getChild(A).findItem(D,B);if(C!=null){return C}}return null};TreeItem.prototype.findItemByProperty=function(D,C){if(this.value!=null&&this.value[D]==C){return this}for(var A=this.getChildCount()-1;A>=0;A--){var B=this.getChild(A).findItemByProperty(D,C);if(B!=null){return B}}return null};TreeItem.prototype.getDepth=function(){var B=0;for(var A=this.parent;A!=null&&A.getDepth!=null;A=A.parent){B++}return B};TreeItem.prototype.getCells=function(){var C=new Array();var A=this.cells.childNodes;for(var B=0;B<A.length;B++){C[B]=A[B].component}return C};TreeItem.prototype.getCell=function(B){var A=this.cells.childNodes;if(B<0||B>=A.length){return null}return A[B].component};TreeItem.prototype.focus=function TreeItem_focus(){var D=this.cells.scrollTop;if(this.parent==null){return }this.ensureVisible();var B=this.getTree();if(!IE){var E=B.getScrollX();var C=B.getScrollY();Component_focusChildren(this.getCells(),true);B.setScrollX(E);if(B.getScrollY()<4){B.setScrollY(0)}}else{var A=B.getScrollX();if(A<10){Component_focusChildren(this.getCells(),true)}}B.setFocusItem(this)};TreeItem.prototype.enterInsertMode=function(B){var A=this.getTree();if(A!=null){A.enterInsertMode(this,B)}};TreeItem.prototype.clickHandler=function(E){var C=this;if(!E){E=window.event}var A=C.getTree();var B=A.getSelectedValues();if(A.isEditMode()){return }A.setEditItem(null,null);if(C.isSelected()&&B.length==1){C.setSelected(false)}else{if(!E.ctrlKey){A.selectAll(false)}if(E.shiftKey){var D=A.getAnchorItem();if(D!=C){A.selectRange(D,C)}}else{C.setSelected(true);A.setAnchorItem(C)}}A.updateSelectedCount();C.focus()};TreeItem.prototype.registerDropTargets=function(C,B){var A=this.getTree();if(!this.isValidDrop(C)||!A.canMove()){return }Component.prototype.registerDropTargets.call(this,C,B);var E=this.value;if(E!=null){var D=intersectRectangle(B,getClientRectangle(this.element));if(!D.isEmpty()){D.height=this.getCellHeight();C.registerDropTarget(this,this.element,D)}}};TreeItem.prototype.setDragData=function(B){var A=this.getTree();A.cut(B);mouseDownItem=null};TreeItem.prototype.isValidDrop=function(A){var B=A.getData();if(B==null||isComponent(B)){return false}return !this.isSelected()};TreeItem.prototype.dropData=function(E,C,B){var G=E.getSource();var A=this.getTree();if(A!=G){E.setCut(false)}var D;if(this.isDropAbove(C,B)){D=this}else{for(D=this.getNextPeer();D!=null&&D.isSelected();D=D.getNextPeer()){}}var F=D!=null?D.value:null;A.paste(E,new Array(this.parent.value),F)};TreeItem.prototype.isDropAbove=function(C,B){var A=this.getCellHeight();return B<(A/2)};TreeItem.prototype.getDropInsertBounds=function(C,B){var A=2;var F=this.isDropAbove(C,B)?A:this.getCellHeight()-A;var D=2000;var E=6;return new Rectangle(0,F-(E/2)-1,D,E)};TreeItem.prototype.isEditItem=function(){var A=this.getTree();var B=A.getEditItem();return B!=null&&(B==this||this.isAncestorOf(B))};var mouseDownItem;TreeItem.prototype.addEvents=function(B){var A=this;if(this.value==null){return }B.onmousedown=function(D){if(!D){D=window.event}var C=A.getTree();if(A.isEditItem()){D.cancelBubble=true;return true}mouseDownItem=A;D.cancelBubble=true;A.firedOnDown=!A.isSelected();if(A.firedOnDown){A.clickHandler(D)}if(C.canMove()){dragDropManager.possibleDragStart(D,A,A.value)}return false};B.onclick=function(D){if(!D){D=window.event}var C=A.getTree();if(!C.isEditMode()){D.cancelBubble=true;if(mouseDownItem==A&&!A.firedOnDown){A.clickHandler(D)}return true}};B.onkeyup=function(D){if(!D){D=window.event}var C=A.getTree();if(!C.isEditMode()){if(D.keyCode==32){D.cancelBubble=true;return false}}};B.onkeydown=function(I){if(!I){I=window.event}var E=A.getTree();if(I.keyCode==27){E.selectAll(false);I.cancelBubble=true;return false}else{if(I.keyCode==65&&I.ctrlKey){var D=A.getPeers();for(var G=0;G<D.length;G++){D[G].setSelected(true)}I.cancelBubble=true;E.updateSelectedCount();return false}else{if((I.keyCode==13||I.keyCode==45)&&E.insertModeSupported()){I.cancelBubble=true;A.enterInsertMode()}else{if(I.keyCode==32&&!E.isEditMode()){I.cancelBubble=true;if(A.hasChildren()){A.setExpanded(!A.isExpanded())}A.focus();return false}else{if((I.keyCode==38||I.keyCode==40)&&!E.isEditMode()){I.cancelBubble=true;var F=E.getFocusItem();var H=null;if(I.keyCode==38){H=E.getPreviousItem(F)}else{if(I.keyCode==40){H=E.getNextItem(F)}}if(!I.shiftKey){E.selectAll(false)}var C=H!=null?H:A;E.setAnchorItem(C);C.setSelected(true);C.focus();E.updateSelectedCount();return false}}}}}}};function TreeCell(E,D,C,A,F){this.tag="span";this.column=D;this.item=E;this.setClass("TreeCell");this.setStyleWidth(C);this.setStyleHeight(A);if(F!=null){this.setAttribute("text-align",F)}var B=this;this.onmouseover=function(G){B.handleMouseover(G)};this.onmouseout=function(G){B.handleMouseout(G)}}extend(TreeCell,Component);TreeCell.prototype.handleMouseover=function(A){if(!dragDropManager.isDragging(true)){this.ismouseover=true;if(this.isEditable()){this.setBackground(HoverEditColor)}if(this.column.isSingleClickEditable(this.getValue(),this.item)){this.setCursor("pointer")}}};TreeCell.prototype.handleMouseout=function(A){this.ismouseover=false;if(this.isEditable()){this.setBackground(null)}if(this.column.isSingleClickEditable(this.getValue(),this.item)){this.setCursor(null)}};TreeCell.prototype.getRoot=function(){return this.item.getRoot()};TreeCell.prototype.shouldLaunchEditor=function(A){if(A!=null&&this.shouldLaunchEditorFunction!=null){return this.shouldLaunchEditorFunction(A)}return true};TreeCell.prototype.setShouldLaunchEditorFunction=function(A){this.shouldLaunchEditorFunction=A};TreeCell.prototype.launchEditor=function(){this.column.launchEditor(this)};TreeCell.prototype.getValue=function(){var A=this.item;if(A!=null){return A.value}return null};TreeCell.prototype.getItem=function(){return this.item};TreeCell.prototype.isEditable=function(){if(this.item.isSummary()){return false}return this.column.isEditable(this.getValue())};TreeCell.prototype.hasEditor=function(){return this.column.hasEditor()};TreeCell.prototype.getRightCell=function(){return this.item.getCell(this.column.getIndex()+1)};TreeCell.prototype.getLeftCell=function(){return this.item.getCell(this.column.getIndex()-1)};TreeCell.prototype.getAboveCell=function(){var A=this.item.getPreviousItem();if(A!=null){return A.getCell(this.column.getIndex())}};TreeCell.prototype.getBeneathCell=function(){var A=this.item.getNextItem();if(A!=null){return A.getCell(this.column.getIndex())}};TreeCell.prototype.setSelected=function(A){};Tree.prototype.setDefaultColumns=function(A,B){this.defaultColumns=A;this.persistName=B;var C=getData(B,A);this.createColumns(C)};Tree.prototype.resetColumns=function(){if(this.defaultColumns!=null){this.removeAllColumns();this.createColumns(this.defaultColumns);this.saveColumns()}};Tree.prototype.saveColumns=function(){if(this.persistName==null){message("tree.persistName not set, cannot save columns");return }var A=this.getColumnSaveString();setData(this.persistName,A)};Tree.prototype.getColumnSaveString=function(A){var G="";var C=this.getColumns();for(var B=0;B<C.length;B++){if(B>0){G+=","}var E=C[B];G+=E.getId();var D=E.getStyleWidth();var F=E.getDefaultWidth();if(D!=F||A){G+=":"+D}}return G};Tree.prototype.createColumns=function(A){var D=A.split(";")[0].split(",");for(var C=0;C<D.length;C++){var B=D[C];var F=null;var G=B.indexOf(":");if(G>0){F=parseNumber(B.substring(G+1));B=B.substring(0,G)}var E=CreateColumn(B);if(E!=null){if(F!=null){E.setStyleWidth(F)}this.addColumn(E)}}};Tree.prototype.getAllPossibleColumnIds=function(){var A=this.getDefaultColumns();if(A==null){return null}var C=A.replace(";",",").split(",");for(var B=0;B<C.length;B++){C[B]=C[B].split(":")[0]}return C};Tree.prototype.getDefaultColumns=function(){return this.defaultColumns};Tree.prototype.containsColumnId=function(C){var B=this.getColumns();for(var A=0;A<B.length;A++){if(B[A].getId()==C){return true}}return false};Tree.prototype.getAvailableColumns=function(){var D=new Array();var B=this.getAllPossibleColumnIds();for(var A=0;B!=null&&A<B.length;A++){var C=B[A];if(!this.containsColumnId(C)){D.add(CreateColumn(C))}}D.sort();return D};function Column(C,D,F,E,B,A){this.construct(C,D,F,E,B,A)}extend(Column,Component);Column.prototype.construct=function(C,D,F,E,B,A){this.tag="span";this.setClass("Column");this.name=C;if(C!=null){this.addContent(C)}if(F==null){F=C}this.setDefaultWidth(D);this.setStyleWidth(D);if(isFunction(F)){this.valueFunction=F}else{this.property=F}this.formatFunction=B;this.contentAlign=E;this.indent=A};Column.prototype.initialize=function(){base(this);var A=this;if(this.isMovable()){var B=this.getElement();if(B.onmousedown==null){this.onmousedown=B.onmousedown=function(H){if(!H){H=window.event}var F=A.getTree();if(F.getDefaultColumns()!=null){var G=getButton(H);if(G==0){var E=A.getLocalPoint(H);var D=A.isResizer(null,E.x,E.y)?A.resizer:null;dragDropManager.possibleDragStart(H,A,A.resizer,E.x,E.y,D)}else{if(G==2){A.showContextMenu(H)}}}return true}}if(B.onmouseup==null){this.onmouseup=B.onmouseup=function(E){if(!E){E=window.event}var D=A.getTree();if(D.isColumnSortable()&&!dragDropManager.isDragging(true)){D.toggleColumnSort(A)}}}B.onmouseover=function(D){A.mouseoverChanged(true)};B.onmouseout=function(D){A.mouseoverChanged(false)}}if(this.isResizable()){this.setStylePosition("relative");var C=this.resizer=new Component("div");C.setClass("Column-Resizer");C.setStyleWidth(6);C.setStylePosition("absolute");C.setStyleTop(0);C.setCursor("col-resize");this.add(C);this.fireStyleSizeChanged()}};Column.prototype.mouseoverChanged=function(B){var A=this.getTree();if(A!=null&&A.isColumnSortable()){if(B&&!dragDropManager.isDragging(true)){this.setBackgroundImage("Column-Background-Hover")}else{this.setBackgroundImage(null)}}};Column.prototype.onStyleSizeChanged=function(B,A){base(this,B,A);if(this.resizer!=null){this.resizer.setStyleLeft(this.getStyleWidth()-this.resizer.getStyleWidth());this.resizer.setStyleHeight(this.getStyleHeight())}};Column.prototype.toString=function(){return this.getName()};Column.prototype.setDragData=function(A,B){A.setData(this)};Column.prototype.registerDropTargets=function(C,A){if(!this.isValidDrop(C)){return }if(this.isResizer(C)){var B=this.getElement();var D=getClientRectangle(B);D.width=2000;C.registerDropTarget(this,B,D)}else{var B=this.getElement();var D=intersectRectangle(A,getClientRectangle(B));C.registerDropTarget(this,B,D)}};Column.prototype.getDropInsertBounds=function(E,C,G,F){var D=9;var H=this.getStyleWidth();var B=this.getStyleHeight();var A;if(this.isResizer(F)){A=Math.min(this.maxWidth,Math.max(this.minWidth,E))}else{if(this.isDropLeft(E,C)){A=-1}else{A=H-1}}return new Rectangle(A-D/2,IE?-2:0,D,B)};Column.prototype.isResizer=function(B,A,E){if(B!=null){return this.resizer!=null&&(B.getUserData()==this.resizer)}if(this.resizer==null){return false}var D=this.resizer.getStyleWidth();var C=this.getStyleWidth();return A>=(C-D)};Column.prototype.isDropLeft=function(A,C){var B=this.getStyleWidth();return A<B/2};Column.prototype.dropData=function(H,E,C){var B=this.getTree();var G=H.getData();if(this.isResizer(H)){var F=Math.min(this.maxWidth,Math.max(this.minWidth,E));this.setStyleWidth(F);B.saveColumns()}else{var A=G.getIndex();var D=this.getIndex();if(A<D){D--}if(!this.isDropLeft(E,C)){D++}if(D!=A){B.removeColumn(G);B.addColumn(G,D);B.saveColumns()}}};Column.prototype.isValidDrop=function(B){var A=B.getUserData();if(A!=null){return A==this.resizer}if(!this.isMovable()){return false}var C=B.getData();return C!=this&&instanceOf(C,Column)};Column.prototype.isMovable=function(){return(this.movable!=null)?this.movable:true};Column.prototype.setMovable=function(A){this.movable=A};Column.prototype.isResizable=function(){return this.minWidth!=null&&this.maxWidth!=null};Column.prototype.getMinWidth=function(){return this.minWidth};Column.prototype.getMaxWidth=function(){return this.maxWidth};Column.prototype.setResizable=function(A,B){if(A==null){A=20}this.minWidth=A;if(B==null){B=800}this.maxWidth=B};Column.prototype.isRequired=function(){return(this.required!=null)?this.required:false};Column.prototype.setRequired=function(A){if(A==null){A=true}this.required=A};Column.prototype.createColumnAddMenuItem=function(F,G){if(F==null){return null}var B=this;var A=this.getTree();var D=this.getLocalPoint(G);var C=new Action(F.getName(),null,function(){var H=B.getIndex();if(!B.isDropLeft(D.x,D.y)){H++}A.addColumn(F,H);A.saveColumns()});var E=new MenuItem(C);E.setTitle(F.getDescription());return E};Column.prototype.showContextMenu=function(J){if(!J){J=window.event}var N=J.clientX;var M=J.clientY;var O=this;var P=this.getTree();var B=new Array();var E=P.getAvailableColumns();if(E!=null&&E.length>0){Resources.ActionAddColumnText="Add column";Resources.ActionAddColumnIcon="Column-Add";var K=new Action("AddColumn",null,function(){message("add column")});var L=new Array();for(var G=0;G<E.length;G++){var D=E[G];var A=this.createColumnAddMenuItem(D,J);if(A!=null){L.add(A)}}if(L.length>0){B.add(new MenuItem(K,L))}}if(!this.isRequired()){Resources.ActionRemoveColumnText="Remove column";Resources.ActionRemoveColumnIcon="Column-Remove";var F=new Action("RemoveColumn",null,function(){P.removeColumn(O);P.saveColumns();P.ensureLastColumnFillsSpace()});B.add(new MenuItem(F))}Resources.ActionRestoreColumnsText="Restore default columns";Resources.ActionRestoreColumnsIcon="Column-Restore";var C=new Action("RestoreColumns",null,function(){P.resetColumns()});B.add(new MenuItem(C));if(P.isColumnSortable()){Resources.ActionSortAscendingText="Sort '{0}' column A to Z";Resources.ActionSortAscendingIcon="SortAscending";var H=new Action("SortAscending",null,function(){P.setColumnSort(O,true)});H.setText(format(Resources.ActionSortAscendingText,O.getName()));B.add(new MenuItem(H));Resources.ActionSortDescendingText="Sort '{0}' column Z to A";Resources.ActionSortDescendingIcon="SortDescending";var I=new Action("SortDescending",null,function(){P.setColumnSort(O,false)});I.setText(format(Resources.ActionSortDescendingText,O.getName()));B.add(new MenuItem(I))}if(B.length>0){Menu_OpenMenu(O,B,null,null,N,M)}};Column.prototype.setId=function(A){this.id=A};Column.prototype.getId=function(){return this.id};Column.prototype.createFooter=function(){var A=new Column(this.name,this.width);return A};Column.prototype.setTitleFunction=function(A){this.titleFunction=A};Column.prototype.setDefaultWidth=function(A){this.defaultWidth=A};Column.prototype.getDefaultWidth=function(){if(this.defaultWidth!=null){return this.defaultWidth}return this.getStyleWidth()};Column.prototype.setEditable=function(A){this.canEdit=A};Column.prototype.isEditable=function(C,B){if(C==null||(B!=null&&B.isSummary())){return false}var A=this.getTree();if(A!=null&&!A.isEditable(C)){return false}if(this.canEdit!=null){if(isFunction(this.canEdit)){return this.canEdit(C)}return this.canEdit}return this.hasEditor()};Column.prototype.canInlineEdit=function(B,A){return this.hasEditor()&&this.isEditable(B,A)};Column.prototype.isSingleClickEditable=function(B,A){return !this.hasEditor()&&this.isEditable(B,A)};Column.prototype.addContent=function(B){var A=this.columnContent=new Component("span");A.add(B);A.setClass("Column-Content");this.add(A)};Column.prototype.getName=function(){if(this.name!=null){return this.name}return this.getTitle()};Column.prototype.setDescription=function(A){this.description=A;this.setTitle(A)};Column.prototype.getDescription=function(){return this.description};Column.prototype.setTree=function(A){this.tree=A};Column.prototype.getTree=function(){return this.tree};Column.prototype.getIndex=function(){var A=this.getTree();return A.getColumnIndex(this)};Column.prototype.setStyleHeight=function(A){Component.prototype.setStyleHeight.call(this,A);var B=this.columnContent;if(B!=null){if(IE){B.setStyleTop(A-23);B.setStyleLeft(1)}else{B.setStyleTop(A-21);B.setStyleLeft(0)}}};Column.prototype.setStyleWidth=function(D){Component.prototype.setStyleWidth.call(this,D);var A=this.getTree();if(A!=null){A.columnWidthChanged(this)}var A=this.getTree();if(A!=null){var B=this;var C=this.getIndex();A.foreachItem(function(F){var E=F.getCell(C);E.setStyleWidth(D)})}};Column.prototype.createUnderlays=function(){return new Array()};Column.prototype.getUnderlays=function(){return(this.underlays==null)?this.underlays=this.createUnderlays():this.underlays};Column.prototype.createOverlays=function(){return new Array()};Column.prototype.getOverlays=function(){return(this.overlays==null)?this.overlays=this.createOverlays():this.overlays};Column.prototype.removeLayers=function(C,B,A){this.addLayers(C,B,true)};Column.prototype.addLayers=function(F,B,A){var E=F?this.getOverlays():this.getUnderlays();for(var D=0;D<E.length;D++){var C=E[D];if(A){B.remove(C)}else{C.setStylePosition("absolute");C.setHeight("100%");B.add(C)}}};Column.prototype.updateLayers=function(A,B){this.updateLayersInternal(A,B,this.getUnderlays());this.updateLayersInternal(A,B,this.getOverlays())};Column.prototype.updateLayersInternal=function(A,D,E){for(var C=0;C<E.length;C++){var B=E[C];B.setStyleLeft(A);B.setStyleWidth(D)}};Column.prototype.hasOutline=function(){return false};Column.prototype.hasIndent=function(){return this.indent!=null};Column.prototype.createIndent=function(C){var D="\u00A0";var A="";var E=C.getDepth()-1;for(var B=this.indent*E;B>0;B--){A+=D}return A.length>0?A:null};Column.prototype.getCell=function(A){return A.getCell(this.getIndex())};Column.prototype.updateAllCells=function(D){var B=this;var C=this.getIndex();var A=this.getTree();A.foreachItem(function(F){if(D==null||D(F)){var E=F.getCell(C);B.updateCellInternal(F,E)}})};Column.prototype.updateCell=function(D,A,C,E){var B;if(D.isSummary()){B=true}else{if(E!=null){B=this.property==E}else{B=this.requiresUpdate(D.value,C,A)}}if(B){this.updateCellInternal(D,A)}};Column.prototype.updateCellInternal=function(D,B){B.removeAllChildren();var A=this.createIndent(D);if(A!=null){B.add(A)}var C=this.createContentInternal(D,B);if(C!=null){if(C.getDock!=null&&C.getDock()!=null){B.setDockLayout()}var F=B.add(C)}if(this.titleFunction!=null){var E=this.titleFunction(D.value);B.setTitle(E)}return C};Column.prototype.createCellInternal=function(A){return A.isSummary()?this.createSummaryCell(A):this.createCell(A)};Column.prototype.createSummaryCell=function(A){return this.createCell(A)};Column.prototype.createCell=function(D){var B=this;var A=new TreeCell(D,this,this.getStyleWidth(),this.cellHeight,this.contentAlign);this.updateCellInternal(D,A);var C=A.getElement();if(this.createEditor!=null){C.onclick=function(F){var E=B.getTree();if(E.isEditMode()){E.exitEditMode()}};C.ondblclick=function(E){if(B.isEditable(D.value,D)){B.launchEditor(A,E)}}}return A};Column.prototype.hasEditor=function(){return this.createEditor!=null};Column.prototype.launchEditor=function(K,H){if(!H){H=window.event}var O=this.getTree();if(this.createEditor==null||O.getEditCell()==K||!K.shouldLaunchEditor(H)){H.cancelBubble=true;return }var N=this;var M=K.item;O.setEditItem(M,K);var G=this.createEditor(M.value,O.entityContext);if(G==null){return }G.setValue(this.getValue(M.value,true));G.setStylePosition("absolute");G.setStyleLeft(0);var E=G.getElement();var B=this.isEditable(M.value,M);G.setEditable(B);if(this.contentAlign!=null){G.setAttribute("text-align",this.contentAlign)}var D=this.getEditFrame(K);O.selectAll(false);var C=false;var F=K.finishFunction=function(V,P,a,U){if(C){return }C=true;if(J.element.onmousedown=K.rootmousedown){J.element.onmousedown=null}var X=false;if(B){var S=O.entityManager;var W=S!=null&&!S.Exists(M.value);var Y=G.getValue();if(Y==null){Y=N.defaultValue}var T;if(U&&N.validators!=null){T=Validate(N.validators,G)}if(T!=null){if(Y!=null&&Y!=""){error(T)}if(W){X=true}}else{var Z=N.setValue(M.value,Y,K,G);if(U||((Z||W)&&!P)){if(W){if(!S.IsValid(M.value)){X=true}else{M.parent.updateSort();var R=false;var Q=M._triedToCreate;if(!Q){M._triedToCreate=true;R=S.Create(M.value)}else{R=true;if(S.Exists(M.value)){S.Update(M.value)}}if(R){M.valueChanged()}else{X=true}}}else{if(Z){S.Update(M.value)}}}}}if(X){O.removeItem(M.value)}else{N.updateCellInternal(M,K)}if(!P||X){O.setEditItem(null,null)}if(a){M.setSelected(true);M.focus()}return !X};var J=this.getRoot();K.rootmousedown=function(P){if(!P){P=window.event}if(!D.containsEvent(P)){F(P);P.cancelBubble=true;return false}};J.element.onmousedown=K.rootmousedown;E.onclick=function(P){if(!P){P=window.event}P.cancelBubble=true};E.onkeypress=E.onkeyup=function(P){if(!P){P=window.event}if(P.keyCode==9){P.cancelBubble=true;return false}};var I=E.onkeydown;E.onkeydown=function(S){if(!S){S=window.event}if(I!=null){I(S)}if(S.cancelBubble){return }if(S.keyCode==27){F(S,false,true);return false}if(S.keyCode==9||S.keyCode==13||S.keyCode==38||S.keyCode==40){var R=null;if(S.keyCode==9&&S.shiftKey){R=K.getLeftCell()}else{if(S.keyCode==38||(S.keyCode==13&&S.shiftKey)){R=K.getAboveCell()}else{if(S.keyCode==9&&!S.shiftKey){R=K.getRightCell()}else{if(S.keyCode==40||(S.keyCode==13&&!S.shiftKey)){R=K.getBeneathCell()}}}}if(R!=null&&!R.hasEditor()){R=null}if(R!=null||S.keyCode==13){var P=O.isInsertMode();var T=R==null||R.item!=M;var Q=F(S,R!=null||P,false,T);if(S.keyCode==13&&P){if(Q){M.enterInsertMode(N)}}else{if(R!=null){R.launchEditor()}}S.cancelBubble=true;return false}}S.cancelBubble=true};var A=D.getStyleWidth();var L=D.getStyleHeight();G.setStyleWidth(A-(IE?8:0));G.setStyleHeight(L-(IE?0:0));D.removeAllChildren();D.add(G);G.focus(true);G.select()};Column.prototype.getEditFrame=function(A){return A};Column.prototype.setDependentFields=function(){var B=new Array(arguments.length);for(var A=0;A<arguments.length;A++){B[A]=arguments[A]}this.dependentFields=B};Column.prototype.requiresUpdate=function(G,D,B){if(G==null||D==null){return true}if(this.dependentFields!=null){for(var E=0;E<this.dependentFields.length;E++){var F=this.dependentFields[E];if(!Equals(G[F],D[F])){return true}}return false}else{var C=this.getValue(G);var A=B._lastValue;return C!=A}};Column.prototype.setDisplayZero=function(A){this.displayZero=A};Column.prototype.getDisplayZero=function(){return(this.displayZero==null)?true:this.displayZero};Column.prototype.createContentInternal=function(C,A,B){if(C.isSummary()){return this.createSummaryContent(C,A,C.value)}return this.createContent(C,A)};Column.prototype.setSummaryFunction=function(A){this.summaryFunction=A;this.setSummarize(true)};Column.prototype.setSummarize=function(A){this.summarize=A};Column.prototype.createSummaryContent=function(F,A,C){if(this.summarize!=true||C==null||C.length==0){return null}if(this.summaryFunction!=null){return this.summaryFunction(C)}var E=0;for(var D=0;D<C.length;D++){var G=C[D];var B=this.getValue(G);if(isNumber(B)){E+=B}}return this.createContent(F,A,E)};Column.prototype.createContent=function(C,A,B){var D=C.value;if(B==null){B=this.getValue(D)}A._lastValue=B;if(this.formatFunction!=null){B=this.formatFunction(B,D)}if(B==0&&!this.getDisplayZero()){B=null}return B};Column.prototype.getValue=function(B,A){if(this.valueFunction!=null){return this.valueFunction(B)}else{if(this.property!=null){return B[this.property]}}return null};Column.prototype.getSortValue=function(A){var B=this.getValue(A,false);if(!isDate(B)&&this.formatFunction!=null){B=this.formatFunction(B,A)}return B};Column.prototype.setValue=function(F,E,C,D){var B=null;if(this.setValueFunction!=null){B=this.setValueFunction(F,E,C,D)}else{if(this.property!=null){if(F[this.property]!=E){F[this.property]=E;B=true}else{B=false}}}if(B==null){throw"Neither valueFunction nor property was specified."}if(B==true){var A=this.getTree();if(A!=null){A.updateSummaryRow()}}return B};Column.prototype.setSetValueFunction=function(A){this.setValueFunction=A};function SelectColumn(){this.tag="span";this.setClass("Column");this.setSummarize(false);var B=new Checkbox();B.setClass(null);var A=this;B.onclick=function(D){if(!D){D=window.event}D.cancelBubble=true;var C=A.getTree();C.selectAll(B.getValue())};this.addContent(B);this.setStyleWidth(28);this.contentAlign="center";this.setMovable(false);this.setRequired(true)}extend(SelectColumn,Column);SelectColumn.prototype.createContent=function(C,A){var D=A.checkbox=new Checkbox();D.setClass(null);D.onclick=function(E){if(!E){E=window.event}E.cancelBubble=true;C.setSelected(D.getValue());return true};var B=A.getElement();B.onmousedown=D.onmouseup=function(E){if(!E){E=window.event}E.cancelBubble=true;return true};B.onclick=function(E){if(!E){E=window.event}C.setSelected(!C.isSelected());C.focus();return true};C.onselectedchanged=function(){D.setValue(C.isSelected())};return D};SelectColumn.prototype.requiresUpdate=function(D,B,A){var C=A.item;A.checkbox.setValue(C.isSelected());return false};function ExpandColumn(){this.tag="span";this.setClass("Column");this.setStyleWidth(28);this.contentAlign="center";var A=this;A.close=true;var B=new ImageComponent("close");B.setClass("ExpandImage");this.addContent(B);this.setAttribute("title","Expands or collapses all parents.");this.onclick=function(D){if(!D){D=window.event}var C=A.getTree();C.setAllExpanded(A.close?false:true);A.close=!A.close;B.setSource(A.close?"close":"open");D.cancelBubble=true;return true}}extend(ExpandColumn,Column);ExpandColumn.prototype.updateImage=function(B,A){B.setSource(A.hasChildren()?A.isExpanded()?"close":"open":null)};ExpandColumn.prototype.requiresUpdate=function(C,B,A){return true};ExpandColumn.prototype.createContent=function(C,A){var B=this;var D=new ImageComponent(null);D.setClass("ExpandImage");A.onclick=function(E){if(C.hasChildren()){C.setExpanded(!C.isExpanded());C.focus()}};this.updateImage(D,C);C.onchildrenchanged=function(){B.updateImage(D,C)};C.onexpandedchanged=function(){B.updateImage(D,C)};return D};function DateColumn(B,E,A){var C=90;var D="center";if(A==null){A=formatDateVeryShort}this.construct(B,C,E,D,A)}extend(DateColumn,Column);DateColumn.prototype.setUniversalTime=function(A){this.universal=A};DateColumn.prototype.createContent=function(E,A){var B=this;var D=Column.prototype.createContent.call(this,E,A);var C=B.getValue(E.value);if(this.universal){C=toLocalTime(C)}A.setTitle(formatDateLong(C));A.onclick=function(I){if(!I){I=window.event}if(B.isEditable(E.value)){var G=B.getValue(E.value);var F=B.getTree();var H=new MiniCalendarDialog();H.setValue(G);H.setOnSubmit(function(){B.setValue(E.value,H.getValue(),A);var J=B.getValue(E.value);F.updateValue(E.value)});H.showRelativeTo(A);I.cancelBubble=true;return false}};return D};function DateRangeColumn(B,A,E){var C=120;var D="center";this.construct(B,C,null,D);this.startProperty=A;this.finishProperty=E;this.setDependentFields(A,E)}extend(DateRangeColumn,Column);DateRangeColumn.prototype.canModify=function(A){return false};DateRangeColumn.prototype.createContent=function(E,A){var B=this;var F=E.value;var G=F[this.startProperty];var C=F[this.finishProperty];var D=toDateRangeString(G,C);return D};function TreeColumn(A,D,E,B){this.iconFunction=E;if(B==null){B=200}var C="left";this.construct(A,B,D,C)}extend(TreeColumn,Column);TreeColumn.prototype.setFlatListMessage=function(A){this.flatListMessage=A};TreeColumn.prototype.updateImage=function(B,F){var G=B.plusMinusImage;if(G==null){return }if(F==null){F=true}var E=B.item;var C=E.hasChildren();if(F||B._hasChildren!=C){B._hasChildren=C;if(C){var A=this.getTree();var D=A.isFlatList()?"open-disabled":(E.isExpanded()?"close":"open");G.setSource(D);G.setVisible(true);return true}else{G.setVisible(false);return false}}};TreeColumn.prototype.requiresUpdate=function(G,B,A){var F=A.item;var E=Column.prototype.createContent.call(this,F,A);var C=this.iconFunction!=null?this.iconFunction(G,F):null;var D=F.getOutlineNumber();if(A._icon!=C||A._content!=E||(this.hasOutline()&&A._number!=D)){return true}this.updateImage(A,false);return false};TreeColumn.prototype.setExpandable=function(A){this.expandable=A};TreeColumn.prototype.isExpandable=function(){return this.expandable!=null?this.expandable:true};TreeColumn.prototype.hasIndent=function(){return true};TreeColumn.prototype.hasOutline=function(){var A=this.getTree();return A!=null&&A.getOutlineRootFunction()!=null};TreeColumn.prototype.getEditFrame=function(A){return A.editFrame};TreeColumn.prototype.createContent=function(Q,A){var M=this;var O=Column.prototype.createContent.call(this,Q,A);var J=this.getTree();var N=Q.value;var S=Q.getDepth();var E=(S-1)*12;var M=this;var H=new Component("span");H.setStylePosition("relative");var G=E;var B=null;if(this.hasOutline()){G+=10;B=Q.getOutlineNumber();if(B!=null){var D=new Component();D.setClass("TreeColumn-Outline");if(B!=null){D.add(B)}D.setStyleWidth(10);D.setColor(InactiveTextColor);H.add(D)}}if(this.isExpandable()){var F=A.plusMinusImage=new ImageComponent(null);F.setStylePosition("absolute");F.setStyleLeft(G);F.setStyleTop(4);G+=12;var R=G+4;F.setClass("TreeColumn-ExpandImage");var I=function(W){var U=getLocalPoint(A.getElement(),W);var T=U.x;var V=T<=R;return !V};A.getElement().onmousedown=function(T){if(!T){T=window.event}if(Q.hasChildren()&&!I(T)){if(J.isFlatList()){if(M.flatListMessage!=null){alert(M.flatListMessage)}}else{T.cancelBubble=true;Q.setExpanded(!Q.isExpanded());return false}}};A.setShouldLaunchEditorFunction(I);Q.onchildrenchanged=function(){M.updateImage(A)};Q.onexpandedchanged=function(){M.updateImage(A)};H.add(F);this.updateImage(A)}var P=this.iconFunction!=null?this.iconFunction(N,Q):null;var K=new ImageComponent(P);K.setClass("TreeColumn-Icon");K.setStylePosition("absolute");K.setStyleLeft(G+2);K.setStyleTop(1);G+=20;H.add(K);var C=A.editFrame=new Component("span");C.setStylePosition("absolute");C.setClass("TreeCell");C.setStyleLeft(G);C.setStyleHeight(this.cellHeight);this.sizeEditFrame(A);if(A.getStyleSizeChanged()==null){A.setStyleSizeChanged(function(U,T){M.sizeEditFrame(A)})}H.add(C);if(O!=null){var L=C.add(O)}A._icon=P;A._content=O;A._number=B;return H};TreeColumn.prototype.sizeEditFrame=function(C){var D=C.editFrame;var B=D.getStyleLeft();var A=C.getStyleWidth();var E=A-B-4;D.setStyleWidth(E)};function BondTrees(B,A){B.disableVerticalScrolling();A.entityContext=B.entityContext;B.oninitialized=function(){A.setName(B.getName()+"-right");A.entityContext=B.entityContext;A.filter=B.filter;A.getParent=B.getParent;A.comparer=B.comparer;A.sorter=B.sorter;A.getIdentity=B.getIdentity;A.hasChildren=B.hasChildren};A.onscroll=function(C,D){B.setScrollTop(D)};B.onscroll=function(C,D){A.setScrollTop(D)};B.addItemUpdatedEventHandler(function(D,C){A.addOrUpdateItem(D,C)});B.addItemLoadChildrenEventHandler(function(C,D){A.onItemLoadChildren(C)});B.addItemSortedEventHandler(function(D){var E=D.value;if(E==null){A.sort()}else{var C=A.findItem(E);if(C!=null){C.sort()}}});B.addItemAddedEventHandler(function(J,I,G,C,E){A.addItem(I,G,C,E);if(J.isSelected()){A.setSelected(I,true)}if(J.isExpanded()){A.setExpanded(I,true)}var F=J.getChildCount();for(var D=0;D<F;D++){var K=J.getChild(D);var H=K.value;A.addOrUpdateItem(H)}});B.addItemRemovedEventHandler(function(C,D){A.removeItem(D)});B.addItemExpandedChangedEventHandler(function(D,C){A.setExpanded(D.value,C)});B.addSelectedChangedEventHandler(function(E,F,D,C){if(E!=null){A.setSelected(E.value,D,C)}});A.addSelectedChangedEventHandler(function(E,F,D,C){if(E!=null){B.setSelected(F,D,C);var E=B.findItem(F);if(E!=null&&D){E.focus()}}});B.addMouseOverItemChanged(function(C){var D=C!=null?C.value:null;A.setMouseOverItem(D!=null?A.findItem(D):null)});A.addMouseOverItemChanged(function(C){var D=C!=null?C.value:null;B.setMouseOverItem(D!=null?B.findItem(D):null)})}function OutlineColumn(A){var B=40;var C="left";this.construct(A,B,null,C)}extend(OutlineColumn,Column);OutlineColumn.prototype.hasOutline=function(){return true};OutlineColumn.prototype.createContent=function(B,A){return B.getOutlineNumber()};function ActionManager(B){this.actions=new List();var C=B.getElement();var A=this;C.onkeydown=function(D){return A.findAndExecuteAction(D,!IE,"keyDown")};C.onkeyup=function(D){return A.findAndExecuteAction(D,IE,"keyUp")};C.onkeypress=function(D){return A.findAndExecuteAction(D,!IE,"keyPress")}}ActionManager.prototype.isTextInput=function(B){if(B==null){return false}var C=B.nodeName;var A=B.type;if(C==null||A==null){return false}C=C.toLowerCase();A=A.toLowerCase();if(C=="input"&&A=="text"){return true}if(C=="textarea"){return true}return false};ActionManager.prototype.findAndExecuteAction=function(G,E,D){if(!G){G=window.event}var F=getOriginalElement(G);if(this.isTextInput(F)){return }for(var B=0;B<this.actions.getCount();B++){var C=this.actions.getItem(B);if(!C.hasFunction()||!C.isEnabled()){continue}var A=C.getShortcut();if(A!=null&&A.isValid(G)){if(!IE){if(C._source==null){C._source=D}else{if(C._source!=D){return }}}if(E){C.execute(null,G)}G.cancelBubble=true;return false}}};ActionManager.prototype.getServiceName=function(){return"ActionManager"};ActionManager.prototype.addAction=function(A){this.actions.add(A);this[A.getName()]=A;return A};ActionManager.prototype.getAction=function(A){return this[A]};ActionManager.prototype.contextChanged=function(A){for(var B=0;B<this.actions.getCount();B++){var C=this.actions.getItem(B);C.contextChanged(A)}};Resources.Keys=new Object();Resources.Keys[9]="Tab";Resources.Keys[36]="Home";Resources.Keys[35]="End";Resources.Keys[46]="Delete";Resources.Keys[45]="Insert";Resources.Keys[219]=" [ ";Resources.Keys[221]=" ] ";Resources.Keys[188]=" < ";Resources.Keys[190]=" > ";var MinusKeyCode=IE?189:109;var PlusKeyCode=IE?187:61;Resources.Keys[MinusKeyCode]=" - ";Resources.Keys[PlusKeyCode]=" + ";function Shortcut(B,C,A,D){if(isString(B)){this.key=B.toUpperCase()}else{this.code=B}this.alt=D==null?false:D;this.ctrl=C==null?false:C;this.shift=A==null?false:A}Shortcut.prototype.isSupported=function(){return true};Shortcut.prototype.isValid=function(B){if(!B){B=window.event}if(this.alt!=B.altKey){return false}if(this.ctrl!=B.ctrlKey){return false}if(this.shift!=B.shiftKey){return false}if(this.code!=null){return this.code==B.keyCode}var A=String.fromCharCode(IE?B.keyCode:B.charCode);if(A==null||A.length==0){return false}return A.toUpperCase()==this.key};Shortcut.prototype.toString=function(){var A="(";if(this.ctrl){A+=(Mac?"Command":"Ctrl")+"+"}if(this.shift){A+="Shift+"}if(this.key!=null){A+=this.key}else{A+=Resources.Keys[this.code]}A+=")";return A};function Action(B,A,C,E,D){this.initialize(B,A,C,E,D)}Action.prototype.initialize=function(B,A,C,E,D){this.name=B;this.shortcut=A;this.setHandler(C);this.isEnabledFunction=E;this.isSelectedFunction=D;this.enabledChanged=new List();this.propertyChanged=new List()};Action.prototype.getShortcut=function(){return this.shortcut};Action.prototype.getName=function(){return this.name};Action.prototype.setName=function(A){if(this.name!=A){this.name=A;this.firePropertyChanged()}};Action.prototype.setHandler=function(A){if(isString(A)){this.link=A}else{this.handler=A}};Action.prototype.setShowWhenDisabled=function(A){this.showWhenDisabled=A};Action.prototype.getShowWhenDisabled=function(){};Action.prototype.getLink=function(){return this.link};Action.prototype.setLink=function(A){if(this.link!=A){this.link=A;this.firePropertyChanged()}};Action.prototype.getTarget=function(){return this.target};Action.prototype.setTarget=function(A){if(this.target!=A){this.target=A;this.firePropertyChanged()}};Action.prototype.contextChanged=function(A){this.isEnabled(A)};Action.prototype.addEnabledChanged=function(A){this.enabledChanged.add(A)};Action.prototype.removeEnabledChanged=function(A){this.enabledChanged.remove(A)};Action.prototype.addPropertyChanged=function(A){this.propertyChanged.add(A)};Action.prototype.removePropertyChanged=function(A){this.propertyChanged.remove(A)};Action.prototype.firePropertyChanged=function(){this.propertyChanged.invoke()};Action.prototype.isEnabled=function(B){if(B==null){B=this.lastSelectedCount}var A=this.lastIsEnabledValue;var C=(this.isEnabledFunction!=null)?this.isEnabledFunction(B):true;if(C!=A){this.enabledChanged.invoke(C)}this.lastIsEnabledValue=C;this.lastSelectedCount=B;return C};Action.prototype.hasFunction=function(){return this.handler!=null};Action.prototype.execute=function(C,B,A){if(this.handler!=null){this.handler(C,B,A)}};Action.prototype.isOption=function(){return this.isSelectedFunction!=null};Action.prototype.isSelected=function(){return(this.isSelectedFunction!=null)?this.isSelectedFunction():true};Action.prototype.setText=function(A){if(this.text!=A){this.text=A;this.firePropertyChanged()}};Action.prototype.getText=function(){var A=this.text;if(A==null){A=Resources["Action"+this.name+"Text"];if(A==null){A=""}this.text=A}return A!=""?A:this.name};Action.prototype.setIcon=function(A){this.icon=A};Action.prototype.getIcon=function(){var A=this.icon;if(A==null){A=Resources["Action"+this.name+"Icon"];if(A==null){A=""}this.icon=A}return A!=""?A:null};Action.prototype.setDescription=function(A){this.description=A};Action.prototype.getDescription=function(){var A=this.description;if(A==null){A=Resources["Action"+this.name+"Description"];if(A==null){A=""}this.description=A}return A!=""?A:null};Action.prototype.getIEWidth=function(){var A=this.ieWidth;if(A==null){A=Resources["Action"+this.name+"IEWidth"];if(A==null){A=""}this.ieWidth=A}return A!=""?A:null};function MenuButton(D,C,B){var A=this;this.tag="button";this.setAttribute("type","button");this.showIconAndText=B;this.action=D;this.menuItem=C;this.setClass("MenuButton");if(D!=null){this.setEnabled(D.isEnabled());D.addEnabledChanged(function(E){A.setEnabled(E)});D.addPropertyChanged(function(){A.updateUI()})}this.onclick=function(E){return A.ondownOrClick(E,true)};this.onmousedown=function(E){return A.ondownOrClick(E,false)}}extend(MenuButton,Component);MenuButton.prototype.setShowIconAndText=function(A){this.showIconAndText=A};MenuButton.prototype.setDrawDownArrow=function(A){this.drawDownArrow=A};MenuButton.prototype.setFlat=function(A){this.flat=A;this.setClass(this.isFlat()?"MenuButton":"MenuButton-Over")};MenuButton.prototype.isFlat=function(){return this.flat!=null?this.flat:true};MenuButton.prototype.initialize=function(){var A=this;base(this);var B=this.getElement();B.onmouseover=function(C){if(!C){C=window.event}A.updateStyle(true)};B.onmouseout=function(C){if(!C){C=window.event}A.updateStyle(false)};this.updateUI()};MenuButton.prototype.updateStyle=function(B){if(this.isFlat()){var A=B?"MenuButton-Over":"MenuButton";this.setClass(A);if(IE&&this.textComponent!=null){this.setStyleTop(B?0:1)}if(this.divider!=null){if(B){this.divider.setVisible(true)}else{this.divider.setHidden()}}}};MenuButton.prototype.isFocusable=function(){return true};MenuButton.prototype.hasFocus=function(){return Menu_IsOpen(this)};MenuButton.prototype.setIcon=function(A){if(this.icon!=A){this.icon=A;if(this.element!=null){this.updateUI()}}};MenuButton.prototype.execute=function(A){if(this.action!=null){this.action.execute(this,A)}};MenuButton.prototype.getIcon=function(A){if(this.icon!=null){return this.icon}return A.getIcon()};MenuButton.prototype.updateUI=function(){this.removeAllChildren();var A=this.menuItem;var D=this.action!=null?this.action:A.getAction();if(D!=null){var L=D.getText();var H=this.getIcon(D);var G=D.getDescription();var E=D.getShortcut()}if(E!=null&&E.isSupported()){G+=" "+E.toString()}if(G!=null&&isEmpty(this.getTitle())){this.setTitle(G)}this.textComponent=null;if(H!=null){var I=new ImageComponent(H);I.setClass("MenuButtonIcon");if(IE){}this.add(I);if(this.showIconAndText){var K=this.textComponent=new Component("span",L);this.add(K);K.setClass("MenuButtonText");if(IE){this.setStylePosition("relative");this.setStyleTop(1);I.setStylePosition("relative");I.setStyleTop(1);var B=D.getIEWidth();if(B!=null){this.setStyleWidth(B)}}}}else{if(L!=null){this.add(L)}}if(A!=null&&A.hasChildren()&&(this.drawDownArrow!=false)){if(this.action!=null&&this.action.hasFunction()){var F=this.divider=new ImageComponent("MenuButtonDivider");F.setClass("MenuButtonDivider"+(H!=null?"-Icon":""));this.add(F);F.setHidden()}var J=new ImageComponent("MenuButtonArrow");var C=(H!=null?"-Icon":(L!=null?"":"-Bare"));J.setClass("MenuButtonArrow"+C);this.add(J)}else{if(IE&&H!=null&&K==null){this.setStyleWidth(26)}}};MenuButton.prototype.addOnOpenHandler=function(A){if(this.onOpen==null){this.onOpen=new List()}this.onOpen.add(A)};MenuButton.prototype.fireOnOpen=function(){if(this.onOpen!=null){this.onOpen.invoke(this)}};MenuButton.prototype.addOnCloseHandler=function(A){if(this.onClose==null){this.onClose=new List()}this.onClose.add(A)};MenuButton.prototype.fireOnClose=function(){if(this.onClose!=null){this.onClose.invoke(this)}};MenuButton.prototype.hasDivider=function(){return this.menuItem!=null&&this.menuItem.hasChildren()&&this.action!=null&&this.action.hasFunction()};MenuButton.prototype.ondownOrClick=function(G,F){if(!G){G=window.event}G.cancelBubble=true;var C=this;var E;if(this.hasDivider()){var B=getLocalPoint(this.element,G);var A=B.x;var D=GetWidth(this.element);E=A>(D-16)}else{E=this.action==null||!this.action.hasFunction()}if(E){if(!F){if(this.menuItem!=null){this.menuItem.getChildren(function(I){if(I!=null&&I.length>0){var H=null;if(C.onClose!=null){H=function(){C.fireOnClose()}}C.fireOnOpen();Menu_OpenMenu(C,I,null,H)}})}return true}}else{if(F){this.action.execute(G,this);return true}}};function MenuItem(C,B,A,D){if(isString(C)){C=new Action(C)}this.action=C;if(isArray(B)){this.children=B}else{if(isFunction(B)){this.childrenFunction=B}}this.setColor(A);if(D==null){D=false}this.setMultiSelect(D)}MenuItem.prototype.type="MenuItem";MenuItem.prototype.getMinWidth=function(){return this.minWidth};MenuItem.prototype.setMinWidth=function(A){this.minWidth=A;return this};MenuItem.prototype.setMultiSelect=function(A){this.multiSelect=A;return this};MenuItem.prototype.isMultiSelect=function(){return this.multiSelect};MenuItem.prototype.setCustomContentFunction=function(A){this.customContentFunction=A};MenuItem.prototype.getCustomContent=function(){if(this.customContentFunction!=null){return this.customContentFunction(this)}return null};MenuItem.prototype.isDivider=function(){return this.action==null&&this.children==null};MenuItem.prototype.setColor=function(A){this.color=A};MenuItem.prototype.getColor=function(){return this.color};MenuItem.prototype.setTitle=function(A){this.title=A};MenuItem.prototype.getTitle=function(){return this.title};MenuItem.prototype.execute=function(A,B){if(this.action!=null&&this.action.hasFunction()&&this.action.isEnabled()){this.action.execute(A,B)}};MenuItem.prototype.getAction=function(){return this.action};MenuItem.prototype.hasChildren=function(){return this.childrenFunction!=null||(this.children!=null&&this.children.length>0)};MenuItem.prototype.getChildren=function(B){var A=this;if(this.childrenFunction!=null){this.childrenFunction(function(C){A.children=C;B(C)})}else{if(this.children!=null){B(this.children)}}};function Shadow(B){this.tag="span";if(!IE){this.setClass("Shadow-Container");var A=new Component("span");A.setClass("Shadow");this.add(A);B.setStylePosition("relative")}this.add(B)}extend(Shadow,Component);var Menu_backdrop;var Menu_pullClick;var Menu_openMenus=new List();function Menu_IsOpen(A){if(A!=null){return Menu_GetMenu(A)!=null}else{return Menu_openMenus.getCount()>0}}function Menu_GetMenu(C){var B=Menu_openMenus;for(var A=0;A<B.getCount();A++){var D=B.getItem(A);if(D.getSource()==C){return D}}}var rootMenu=null;function Menu_OpenMenu(A,D,I,L,Q,P){var H=GetWindowWidth();var E=400;if(H-Q<E){Q=H-E}var O=getClientRectangle(A.getElement());var N=A.getRoot();var G=new Menu(D,L);if(menuZIndex!=null){G.setZIndex(menuZIndex)}G.setSource(A);if(I!=null){var K=I.getDepth()+1;G.setDepth(K);Menu_CloseMenus(K)}else{}Menu_openMenus.add(G);var C=new Shadow(G);var M=Menu_backdrop!=null;var B=G.getMinWidth();var Q=Q!=null?Q+2:(O.x+(M?O.width+(IE?-2:0):-2));var P=P!=null?P+2:(O.y+ +(M?0:O.height-3));if((H-Q)<B){Q=H-B}C.setStyleTop(P);C.setStyleLeft(Q);C.setStylePosition("absolute");if(Menu_backdrop==null){Menu_pullClick=false;var F=new Component("div");F.setClass("Menu-Backdrop");if(menuZIndex!=null){F.setZIndex(menuZIndex)}N.add(F);Menu_backdrop=F;var J=F.getElement();J.onmouseout=function(R){if(!R){R=window.event}Menu_pullClick=true};J.onmousedown=function(R){if(!R){R=window.event}Menu_CloseMenu(null,true)};J.onmouseup=function(R){if(!R){R=window.event}if(Menu_pullClick){Menu_CloseMenu(null,true)}}}N.add(C);ensureElementInWindow(C.getElement())}var menuZIndex=IE?0:2;function Menu_CloseMenu(D,B){if(D==null){var A=Menu_backdrop;var C=A.parent;if(C==null){return }A.removeSelf();Menu_backdrop=null;Menu_CloseMenus(0,B)}else{var F=Menu_GetMenu(D);if(F!=null){var E=F.getDepth();Menu_CloseMenus(F.getDepth(),B)}}}function Menu_CloseMenus(E,A){if(E==null){E=0}var C=Menu_openMenus;for(var B=C.getCount()-1;B>=0;B--){var D=C.getItem(B);if(D.getDepth()>=E){if(A){D.setCancel(A)}D.removeSelf();C.remove(D)}}}function Menu(C,A){this.tag="span";this.setClass("Menu");this.items=C;this.onCloseHandler=A;var E=new Table();E.setAttribute("cellpadding",0);E.setAttribute("cellspacing",0);E.setClass("Menu-Table");for(var B=0;B<C.length;B++){var D=C[B];var F=this.createMenuRow(D);E.add(F)}this.onmousedown=function(G){if(!G){G=window.event}G.cancelBubble=true};this.add(E)}extend(Menu,Component);Menu.prototype.getMinWidth=function(){var B=0;for(var A=0;A<this.items.length;A++){var C=this.items[A];if(C.getMinWidth!=null){var D=C.getMinWidth();if(D>B){B=D}}}return B};Menu.prototype.createMenuRow=function(B){if(isComponent(B)){if(!isRow(B)){var A=new Cell(B).setSpan(4);A.setClass("MenuCell-1");B=new Row(A)}return B}return new MenuRow(this,B)};Menu.prototype.setCancel=function(A){this.cancel=A};Menu.prototype.isCancel=function(){return this.cancel};Menu.prototype.setSource=function(A){this.source=A};Menu.prototype.getSource=function(){return this.source};Menu.prototype.onRemoved=function(A){Component.prototype.onRemoved.call(this,A);if(this.onCloseHandler!=null){this.onCloseHandler(this,this.isCancel())}};Menu.prototype.getDepth=function(){return this.depth!=null?this.depth:0};Menu.prototype.setDepth=function(A){this.depth=A};function MenuRow(N,C){base(this);var P=this.menuItem=C;if(P.isDivider()){this.add(new Cell(" "));var A=new Cell(" ");A.setAttribute("colspan",3);A.setClass("MenuRow-Divider");this.add(A)}else{var L=P.getAction();var H=L.getShortcut();var O=L.getIcon();var E=L.isEnabled();var D=L.getLink();var Q=L.getTarget();var M=P.getColor();this.setClass("MenuRow");if(!E){M="#CCCCCC"}var A=null;var J=null;var F=null;if(L.isOption()){F=new Checkbox();F.setClass("MenuRow-Checkbox");F.setValue(L.isSelected());F.setEnabled(E);J=F}else{J=O!=null?J=new ImageComponent(O):""}this.add(A=new Cell(J));A.setClass("MenuCell-1");var K=P.getCustomContent();if(K==null){K=L.getText();if(D!=null){K=new Link(K,D,Q)}if(K==null){throw"content is null: "+P}}this.add(A=new Cell(K));A.setClass("MenuCell-2");if(M!=null){A.setColor(M)}J=H!=null?J=H.toString():"";if(J==""){var R=P.getTitle();if(R!=null){J=R}}this.add(A=new Cell(J));A.setClass("MenuCell-3");J=" ";if(P.hasChildren()){var I=new ImageComponent("MenuRightArrow");I.setClass("MenuRightArrow");J=I}this.add(A=new Cell(J));A.setClass("MenuCell-4");if(E){var B=this.getElement();var G=this;B.onmouseover=function(S){if(!S){S=window.event}G.setClass("MenuRow-Selected")};B.onmouseout=function(S){if(!S){S=window.event}G.setClass("MenuRow")};B.onclick=function(S){if(!S){S=window.event}if(C.hasChildren()){if(Menu_IsOpen(G)){Menu_CloseMenu(G)}else{C.getChildren(function(U){var V=getClientRectangle(G.element);var T=V.x+Math.min(200,V.width);var W=V.y;Menu_OpenMenu(G,U,N,null,T,W)})}}else{C.execute(G,S);if(L.isOption()){F.setValue(L.isSelected())}if(!L.isOption()||!C.isMultiSelect()){Menu_CloseMenu()}}}}}}extend(MenuRow,Row);function ComboBox(A,B){if(A!=null){this.construct(A)}this.setMultiSelect(B)}extend(ComboBox,Component);ComboBox.prototype.setMultiSelect=function(A){this.multiSelect=A};ComboBox.prototype.isMultiSelect=function(){return this.multiSelect};ComboBox.prototype.construct=function(A){var B=this;this.setClass("ComboBox");var F=this.textfield=new TextField();F.setClass("ComboBox-TextField");this.add(F);if(isFunction(A)){this.setGetOptionsFunction(A)}var D=function(G){B.getMenuItems(G)};var E=this.menuItem=new MenuItem(null,D);var C=this.menuButton=new MenuButton(null,E);C.setFlat(false);C.setClass("ComboBox-MenuButton");C.addOnCloseHandler(function(G){B.onMenuClosed(G)});C.addOnOpenHandler(function(G){B.onMenuOpen(G)});this.add(C);if(isArray(A)){this.createMenuItems(A)}};ComboBox.prototype.createMenuItems=function(M){var L=this;this.options=M;var A=this.menuItems=new Array();for(var C=0;M!=null&&C<M.length;C++){var D=M[C];var B=this.createAction(D);var K=new MenuItem(B,null,D.getColor(),this.multiSelect);K.setTitle(D.getTitle());A.add(K)}if(this.isMultiSelect()){L.ok=null;var E=new Component();var H=new SimpleButton("Ok",null,function(){L.ok=true;Menu_CloseMenu()});H.setFlat(false);var J=new SimpleButton("Cancel",null,function(){L.ok=false;Menu_CloseMenu()});J.setFlat(false);var G=IE?80:"50%";H.setStyleWidth(G);J.setStyleWidth(G);E.add(H);E.add(J);var I=new Cell(E).setSpan(4);I.setClass("MenuCell-1");var F=new Row(I);F.setBackground("white");A.add(F)}return A};ComboBox.prototype.getMenuItems=function(C){var B=this;if(this.optionsFunction!=null){var A=function(D){B.options=D;B.createMenuItems(D);if(B.menuItemCallback!=null){B.menuItemCallback(B.menuItems)}};this.menuItemCallback=C;this.optionsFunction(A)}else{C(this.menuItems)}};ComboBox.prototype.setEnabled=function(A){this.textfield.setEnabled(A);this.menuButton.setEnabled(A)};ComboBox.prototype.setGetOptionsFunction=function(A){this.optionsFunction=A};ComboBox.prototype.getValue=function(){return this.textfield.getValue()};ComboBox.prototype.setValue=function(A){this.textfield.setValue(A)};ComboBox.prototype.isInput=function(){return true};ComboBox.prototype.select=function(){this.textfield.select()};ComboBox.prototype.focus=function(A){this.textfield.focus(true)};ComboBox.prototype.hasFocus=function(){return this.menuButton.hasFocus()};ComboBox.prototype.setStyleWidth=function(A){Component.prototype.setStyleWidth.call(this,A);var B=this.getMenuButtonWidth();this.textfield.setStyleWidth(A-B)};ComboBox.prototype.setStyleHeight=function(A){Component.prototype.setStyleHeight.call(this,A);this.textfield.setStyleHeight(A);this.menuButton.setStyleHeight(A)};ComboBox.prototype.getMenuButtonWidth=function(){return 18};ComboBox.prototype.getInputElement=function(){return this.textfield.getElement()};ComboBox.prototype.onMenuClosed=function(){if(!this.isMultiSelect()||this.ok){var C=this.getSelectedOptions();if(C.length!=0){var D="";for(var A=0;A<C.length;A++){var B=C[A];if(D.length>0){D+=this.getDelimiter()}D+=B.getText()}this.textfield.setTitle(C.length>1?D:null);this.textfield.setValue(D)}}this.focus(true)};ComboBox.prototype.getSelectedOption=function(){if(this.options==null){return null}for(var A=0;A<this.options.length;A++){var B=this.options[A];if(B.isSelected()){return B}}};ComboBox.prototype.getSelectedOptions=function(){var C=new Array();for(var A=0;A<this.options.length;A++){var B=this.options[A];if(B.isSelected()){C[C.length]=B}}return C};ComboBox.prototype.onMenuOpen=function(){if(this.options!=null){for(var A=0;A<this.options.length;A++){this.options[A].setSelected(false)}}};ComboBox.prototype.createAction=function(A){var B=new Action(null,null,function(){A.setSelected(!A.isSelected())},null,function(){return A.isSelected()});B.setText(A.getText());return B};ComboBox.prototype.setDelimiter=function(A){this.delimiter=A};ComboBox.prototype.getDelimiter=function(){return this.delimiter!=null?this.delimiter:","};function SimpleButton(D,E,C,A,G,B){var F=new Action(D,A,C);F.setIcon(E);if(G!=null){G.addAction(F)}base(this,F,null,B)}extend(SimpleButton,MenuButton);var TaskContextMenuItems="OpenProject,AutoSchedule,-,ViewTask,EditTask,TaskMarkComplete,Reassign,SendNotification,LockTask,-,CopyTask,PasteTask";function ShowContextMenu(K,H,E){var L=H.clientX;var J=H.clientY;var G=K.getActionManager();var C=new Array();var I=E.split(",");for(var F=0;F<I.length;F++){var M=I[F];if(M=="-"){if(C.length>0&&!C[C.length-1].isDivider()){C.add(new MenuItem())}continue}var D=G.getAction(M);if(D==null){continue}var A=new MenuItem(D);C.add(A)}if(C.length>0&&C[C.length-1].isDivider()){C.length=C.length-1}if(C.length>0){var B=function(N,O){if(O){K.focus()}};Menu_OpenMenu(K,C,null,B,L,J)}}function MenuSelectList(C){this.options=C;var B=null;var A=[];for(var D=0;D<C.length;D++){var E=C[D];if(E.isSelected()){B=E}A[D]=this.createMenuItem(E)}if(B==null){B=C[0]}var F=this.action=new Action(B.getText());base(this,F,new MenuItem(null,A));this.setFlat(false)}extend(MenuSelectList,MenuButton);declare(MenuSelectList,{createMenuItem:function(B){var A=this;var E=B.getValue();var D=new Action(B.getText(),null,function(){A.setValue(E,true)});var C=new MenuItem(D);return C},setOnChange:function(A){this.onChange=A},setValue:function(B,A){this._value=B;this.action.setName(this.getText(B));if(A&&this.onChange!=null){this.onChange(this,B)}},getValue:function(){return this._value},getText:function(C){for(var A=0;A<this.options.length;A++){var B=this.options[A];if(B.getValue()==C){return B.getText()}}return C}});function Zoom(B,A,G,N,F,C,K,M,I,E,D,P,J,H,O,L){this.id=B;this.name=A;this.cellSizePerDay=G;this.smallStepFunction=N;this.smallTextFunction=F;this.smallAlignment=C;this.bigStepFunction=K;this.bigTextFunction=M;this.bigAlignment=I;this.showWeekends=E;this.roundUp=D;this.roundDown=P;this.scrollForward=J;this.scrollBackward=H;this.canResizeTasks=O;this.smallBackground=L}Zoom.prototype.getDaysFromSize=function(A){var B=Math.round(A/this.cellSizePerDay);return B};var zoomDay=new Zoom(1,Resources.GanttZoomDay,60,function(A){return addDays(A,1)},formatDayShort,"center",function(A){return addDays(A,7)},function(A){return"Week of "+formatWeek(A)},"center",true,function(A){return setDay(A,6,true)},function(A){return setDay(A,0,false)},function(A){return addDays(A,7)},function(A){return addDays(A,-7)},true);var zoomWeek=new Zoom(2,Resources.GanttZoomWeek,14,function(A){return addDays(A,7)},function(A){return null},"center",function(A){return addDays(A,7)},formatWeek,"center",true,function(A){return setDay(A,6,true)},function(A){A=addDays(A,-7);return setDay(A,0,false)},function(A){return addMonths(A,1)},function(A){return addMonths(A,-1)},false,"ZoomBackgroundWeek");var zoomMonth=new Zoom(3,Resources.GanttZoomMonth,4,function(A){return getNextDay(A,0)},function(A){return A.getDate()},"center",function(A){return addMonths(A,1)},formatMonthYear,"center",false,function(A){return setDate(A,1)},function(A){return setDate(addMonths(A,-1),1)},function(A){return addMonths(A,4)},function(A){return addMonths(A,-2)},false);var zoomQuarter=new Zoom(4,Resources.GanttZoomQuarter,1,function(A){return addMonths(A,1)},function(A){return months[A.getMonth()]},"center",function(A){return addMonths(A,3)},formatQuarter,"center",false,function(A){return startOfQuarter(addMonths(A,+3))},function(A){return startOfQuarter(A)},function(A){return addYears(A,1)},function(A){return addYears(A,-1)},false);var zooms=new Array(zoomDay,zoomWeek,zoomMonth,zoomQuarter);function GanttColumn(B){this.schedule=B;this.attributes=new Object();this.tag="span";this.content="Gantt";this.setClass("GanttHeader");this.setStyleWidth(200);var A=new Date();A.setHours(0,0,0,0);this.setZoomLevel(zooms[0],addDays(A,-1),addDays(A,+15),false);this.weekends=new GanttWeekendUnderlay(this);this.dependencies=new GanttDependencyUnderlay(this);this.setDependentFields("Scheduled","Name","Start","Finish","Complete","LagFinish","Locked","Milestone","ChildCount")}extend(GanttColumn,Column);GanttColumn.prototype.maximumColumns=1000;GanttColumn.prototype.setStyleHeight=function(A){if(IE){A-=1}base(this,A)};GanttColumn.prototype.setOffline=function(A){this.offline=A};GanttColumn.prototype.isOffline=function(){return this.offline!=null?this.offline:false};GanttColumn.prototype.createUnderlays=function(){return new Array(this.weekends)};GanttColumn.prototype.createOverlays=function(){return new Array(this.dependencies)};GanttColumn.prototype.getScrollSpeed=function(){var A=this.getTree();if(A==null){return 100}return A.getStyleWidth()/3};GanttColumn.prototype.scrollLeft=function(){this.scroll(-this.getScrollSpeed())};GanttColumn.prototype.scrollRight=function(){this.scroll(+this.getScrollSpeed())};GanttColumn.prototype.scroll=function(D){var C=this.zoom.getDaysFromSize(D);var A=this.getCenterDate();var B=addDays(A,C);this.setCenterDate(B,null,null,null,true)};GanttColumn.prototype.getPositionFromDate=function(B){var C=this.zoom;var D=getDaysDifference(B,this.start);var A=C.cellSizePerDay*D;return A};GanttColumn.prototype.getCenterDate=function(C){if(C==null){C=0.5}var B=this.getTree();if(B==null){return null}var D=B.getScrollX();var E=B.getStyleWidth();var A=D+E*C;return this.getDateFromPosition(A)};GanttColumn.prototype.setDelayedCenterDate=function(B,E,D){var A=this;var C=function(){A.setCenterDate(B,E,D)};this.centerTimeoutId=setTimeout(C,500)};GanttColumn.prototype.clearDelayedTimeout=function(){if(this.centerTimeoutId!=null){clearTimeout(this.centerTimeoutId);this.centerTimeoutId=null}};GanttColumn.prototype.setCenterDate=function(U,L,B,E,G){this.clearDelayedTimeout();if(E==null){E=false}if(B==null){B=0.5}if(G==null){G=true}var M=this.getTree();if(M==null){return null}var V=M.getStyleWidth();var F=this.getStyleWidth();var I=this.getPositionFromDate(U);var C=I-V*B;var R=(C<0)||((C+V)>F);if(E&&R){this.setDelayedCenterDate(U,L,B);return }if(R||(L!=null&&L!=this.zoom)){var J=L!=null?L:this.zoom;var P=this.getCenterDate(B);var T=P>U;var N=J.getDaysFromSize(V);var Q=J.getDaysFromSize(this.getScrollSpeed());var S=N/2+8*Q;var H=N/2+16*Q;var A=addDays(U,-(T?H:S));var O=addDays(U,+(T?S:H));this.setZoomLevel(L,A,O);var D=this.getPositionFromDate(P);M.setScrollX(D-V*B);var K=this.getPositionFromDate(U);C=K-V*B}M.setScrollX(C,G)};GanttColumn.prototype.getDateFromPosition=function(A){if(this.start==null){return null}var C=this.zoom.getDaysFromSize(A);var B=addDays(this.start,C);return B};GanttColumn.prototype.setAutoZoom=function(A){this.autoZoom=A};GanttColumn.prototype.isAutoZoom=function(){return this.autoZoom};GanttColumn.prototype.zoomIn=function(){var A=indexOf(zooms,this.zoom);if(A>0){this.setZoomLevel(zooms[A-1])}};GanttColumn.prototype.zoomOut=function(){var A=indexOf(zooms,this.zoom);if(A+1<zooms.length){this.setZoomLevel(zooms[A+1])}};GanttColumn.prototype.getBestZoom=function(B){var A=this.getTree();if(A==null){return zooms[0]}var G=A.getStyleWidth();var F=Math.floor(0.6*G);for(var C=0;C<zooms.length;C++){var D=zooms[C];var E=D.cellSizePerDay*B;if(E<F){return D}}return zooms[D.length-1]};GanttColumn.prototype.getDateAlpha=function(C){var B=this.getTree();if(B==null){return null}var F=B.getStyleWidth();var A=this.getPositionFromDate(C);var E=B.getScrollX();var D=(A-E)/F;return D};GanttColumn.prototype.smartZoom=function(C){var J=this.getVisibleTaskRange(true);if(J==null){return }var O=null;var H=this.getCenterDate(this.contextViewSize);var B=this.getCenterDate(1-this.contextViewSize);var N=getDaysDifference(B,H);var F,K;var A=getDaysDifference(H,addDays(J.start,0));var I=getDaysDifference(B,addDays(J.finish,1));var L=A*I;if(L>0){var G=sign(A)*Math.min(Math.abs(A),Math.abs(I));var D=this.getCenterDate();var M=addDays(D,-G);var E=true;this.setCenterDate(M,null,null,E,C)}else{this.clearDelayedTimeout()}};GanttColumn.prototype.zoomToSelected=function(){var A=this.getVisibleTaskRange(true);if(A==null){A=this.getVisibleTaskRange(false)}if(A==null){return }var D=Math.abs(getDaysDifference(A.finish,A.start));var C=this.getBestZoom(D);var B=A.getMiddle();this.setCenterDate(B,C,null,null,false)};GanttColumn.prototype.contextViewSize=0.15;GanttColumn.prototype.autoZoom=function(){this.zoomToSelected()};GanttColumn.prototype.setVisibleDateRange=function(B,A){this.setZoomLevel(null,B,A)};GanttColumn.prototype.getVisibleTaskRange=function(A){return getVisibleTaskRangeStatic(this.getTree(),A)};function getVisibleTaskRangeStatic(B,D){if(B==null){return null}var C=null;var A=null;B.foreachItem(function(E,F){if(!D||E.isSelected()){if(C==null||F.Start<C){C=F.Start}if(A==null||F.Finish>A){A=F.Finish}}},true,true);if(C!=null&&A!=null){return new Range(new Date(C.getTime()),new Date(A.getTime()))}return null}GanttColumn.prototype.getFocusDate=function(){};GanttColumn.prototype.setZoomLevel=function(L,C,J){if(L==null){L=this.zoom}var M=this.getTree();var H=this.getVisibleTaskRange(true);var D=H!=null?this.getDateAlpha(H.getMiddle()):null;var E=this.getCenterDate();var I=0.5;var F=false;this.zoom=L;var A=false;if(C==null||J==null){F=true;if(H!=null){E=H.getMiddle();I=clamp(D,this.contextViewSize,1-this.contextViewSize);A=true;if(M!=null){M.stopScrollAnimation(true)}}else{H=this.getVisibleTaskRange(false)}if(E==null){E=addDays(H.start,daysDifference(H.start,H.finish))}else{if(E<H.start){E=H.start}else{if(E>H.finish){E=H.finish}}}var G=M.getStyleWidth();var K=this.zoom.getDaysFromSize(G);C=addDays(E,-K);J=addDays(E,+K)}this.start=L.roundDown(C);this.stop=L.roundUp(J);if(M!=null){M.beginLoading(true);try{this.updateColumns();this.updateAllCells();this.dependencies.updateDependencies()}finally{M.endLoading()}}if(F&&E!=null){var B=false;this.setCenterDate(E,null,I,null,B)}if(A){this.smartZoom(false)}};GanttColumn.prototype.onVisibleDatesChanged=function(){this.updateColumns()};GanttColumn.prototype.getSchedule=function(){return this.schedule};GanttColumn.prototype.updateColumns=function(){var C=this.getTree();if(C==null){return }var E=this.getElement();removeAllChildren(E);var G=this.zoom;var H=this.start;var D=this.stop;var B=this.getStyleHeight()/2;var F=C!=null?C.getStyleWidth():null;this.weekends.clearWeekends();var A=this.createColumns(G,H,D,G.smallStepFunction,G.smallTextFunction,G.smallAlignment,false,B,B,null,F,G.smallBackground);if(G.showWeekends){this.createColumns(G,H,D,zoomDay.smallStepFunction,G.smallTextFunction,G.smallAlignment,true,B,B,null,F)}this.createColumns(G,H,D,G.bigStepFunction,G.bigTextFunction,G.bigAlignment,false,0,B,null,F);this.setStyleWidth(A)};GanttColumn.prototype.createColumns=function(B,H,U,L,P,N,K,R,S,Y,Q,D){H=new Date(H.getTime());H.setHours(12);var E=this.getElement();var I=K?this.weekends:null;var Z=this.getSchedule();var F=0;for(var X=0;X<this.maximumColumns;X++){var V=L(H);var J=getDaysDifference(V,H);var T=J*B.cellSizePerDay;var G=F;if(Y!=null&&F+T>Y){T=Y-F}if(!K){var a=D!=null?getImageUrl(D):null;var A=a!=null?";background-image:url("+a+")":"";var b=P(H);var M=new Object();M["class"]=(X==0)?"Column-Left":"Column";var C=N!="center"?"text-align:"+N+";":"";if(N=="left"){C+="padding-left:8px;"}M.style="width:"+T+"px;height:"+S+"px;position:absolute;overflow:visible;top:"+R+"px;left:"+G+"px;"+C+A;var W=createElement("span",M,b);E.appendChild(W)}else{if(Z!=null&&!IsWorkday(Z,H)){var O=F;I.addWeekend(O,T)}}F+=T;if((Q==null||F>=Q)&&(V.getTime()>U.getTime()||(Y!=null&&F>=Y))){break}H=V}return F};GanttColumn.prototype.includeDate=function(A){};GanttColumn.prototype.initialize=function(){var B=this;var A=this.tree=this.getTree();this.onTaskModified=function(C){for(var D=0;D<C.length;D++){B.updateTaskDependencies(C[D])}};this.onTaskUpdated=function(C,D){B.updateTaskDependencies(C)};this.onDependencyAdded=function(C){B.dependencies.dependencyAdded(C)};this.onDependencyRemoved=function(C){B.dependencies.dependencyRemoved(C)};this.onTreeItemAdded=function(C,D){B.includeDate(D.Start);B.includeDate(D.Finish);B.dependencies.taskAdded(D,B.getDependencyList(D.Id).toArray());B.dependencies.updateDependencies()};this.onTreeItemRemoved=function(C,D){B.dependencies.taskRemoved(D,B.getDependencyList(D.Id).toArray());B.dependencies.updateDependencies()};this.onTreeItemExpandedChanged=function(E,D){B.dependencies.updateDependencies();if(!D){return }var C=E.value;if(!B.isOffline()){dependencyManager.GetChildren(B.onDependenciesLoaded,A.entityContext,C)}};this.onTreeItemLoadChildren=function(C,D){if(D==null){B.zoomToSelected()}};this.onTreeSelectedChanged=function(E,F,D,C){if(C||(D!=null&&D==false)){return }if(B.isAutoZoom()){B.smartZoom()}};Component.prototype.initialize.call(this);A.addSelectedChangedEventHandler(this.onTreeSelectedChanged);A.addItemAddedEventHandler(this.onTreeItemAdded);A.addItemRemovedEventHandler(this.onTreeItemRemoved);A.addItemExpandedChangedEventHandler(this.onTreeItemExpandedChanged);A.addItemLoadChildrenEventHandler(this.onTreeItemLoadChildren);dependencyManager.OnAdded.add(this.onDependencyAdded);dependencyManager.OnRemoved.add(this.onDependencyRemoved);taskManager.OnPostUpdate.add(this.onTaskUpdated);taskManager.OnModified.add(this.onTaskModified);this.onVisibleDatesChanged()};GanttColumn.prototype.dispose=function(){Component.prototype.dispose.call(this);var A=this.tree;if(A!=null){A.removeSelectedChangedEventHandler(this.onTreeSelectedChanged);A.removeItemAddedEventHandler(this.onTreeItemAdded);A.removeItemRemovedEventHandler(this.onTreeItemRemoved);A.removeItemExpandedChangedEventHandler(this.onTreeItemExpandedChanged);A.removeItemLoadChildrenEventHandler(this.onTreeItemLoadChildren)}dependencyManager.OnAdded.remove(this.onDependencyAdded);dependencyManager.OnRemoved.remove(this.onDependencyRemoved);taskManager.OnPostUpdate.remove(this.onTaskUpdated);taskManager.OnModified.remove(this.onTaskModified)};GanttColumn.prototype.onLayout=function(B,A){this.updateColumns()};GanttColumn.prototype.updateTaskDependencies=function(B){var A=this.getTree();if(A.checkFilter(B)){this.dependencies.updateDependencies(this.getDependencyList(B.Id).toArray())}};GanttColumn.prototype.getDependencyList=function(A){return dependencyManager.getDependencyList(A)};function Range(B,A){this.start=B;this.finish=A}Range.prototype.toString=function(){return this.start+" -> "+this.finish};Range.prototype.getMiddle=function(){return interpolateDates(this.start,this.finish,0.5)};GanttColumn.prototype.getRange=function(D,I){var K=this.zoom;var H=this.start;var G=this.getSchedule();var E=GetRelativePointInDay(G,D);var B=GetRelativePointInDay(G,I);var J=getDaysDifference(D,H);var A=getDaysDifference(I,H);var F=K.cellSizePerDay*(Math.floor(J)+E);var C=K.cellSizePerDay*(Math.floor(A)+B);return new Range(F,C)};GanttColumn.prototype.createContent=function(B,A){throw"This should never be called."};GanttColumn.prototype.updateCellInternal=function(B,A){A.update(B)};GanttColumn.prototype.createCell=function(A){return new GanttTaskCell(this,A,this.cellHeight)};function ThreeWayImage(D,E,H,G,B){if(G==null){G=0}if(B==null){B=0}var F=new Border(0,G,0,B);this.setStyleOverflow("hidden");this.setDockLayout();this.setStylePosition("absolute");var C=this.left=new ImageComponent();C.setMargin(F);C.setStyleWidth(E);C.setDock(Dock.Left);this.add(C);var I=this.right=new ImageComponent();I.setMargin(F);I.setStyleWidth(H);I.setDock(Dock.Right);this.add(I);var A=this.center=new ImageComponent();A.setMargin(F);A.setDock(Dock.Fill);this.add(A);this.setImage(D)}extend(ThreeWayImage,Component);ThreeWayImage.prototype.setImage=function(A){this.left.setSource(A!=null?A+"Left":null);this.center.setSource(A!=null?A+"Center":null);this.right.setSource(A!=null?A+"Right":null)};ThreeWayImage.prototype.getLeft=function(){return this.left};ThreeWayImage.prototype.getRight=function(){return this.right};ThreeWayImage.prototype.getCenter=function(){return this.center};function GanttTaskCell(D,G,A){this.column=D;this.item=G;G.ganttCell=this;this.setStyleHeight(A);var B=G.value;this.tag="div";this.setClass("GanttTaskCell");var H=this.text=new Text();H.setClass("GanttTaskText");this.add(H);var C=this.background=new Component();C.setStylePosition("absolute");C.setFontSize(1);this.add(C);var F=this.box=new ThreeWayImage("Gantt/TaskFrame",8,8,5,1);F.setDockLayout();var E=this.bar=new Component();E.setBackground("black");E.setFontSize(1);E.setDock(Dock.None);E.setStyleLeft(2);E.setStyleTop(2);E.setStyleWidth(10);E.setStyleHeight(5);F.add(E);this.add(F);this.update(G)}extend(GanttTaskCell,Component);GanttTaskCell.prototype.visibleBoxHeight=9;GanttTaskCell.prototype.addEvents=function GanttTaskCell_addEvents(C){var A=this;var D=this.box;var B=D.getElement();B.onmousemove=function(H){if(!H){H=window.event}var G=A.item.value;if(canResizeTask(G)){var F=A.getBoxLocalPoint(H);var E=F.x;var I=(A.canDragEdges()&&(A.isLeftEdge(E)||A.isRightEdge(E)))?"col-resize":"e-resize";D.setCursor(I)}};B.onmousedown=function(F){if(!F){F=window.event}var E=getButton(F);if(E==0&&A.canDrag()){F.cancelBubble=true;A.dragStart(F);return false}}};GanttTaskCell.prototype.canDrag=function(){var A=this.item.value;return canResizeTask(A)};GanttTaskCell.prototype.canDragEdges=function(){return this.box.getStyleWidth()>10};GanttTaskCell.prototype.canResize=function(){return this.column.zoom.canResizeTasks};function canResizeTask(A){return(A.Locked==false)&&(A.ChildCount==0||A.ChildCount==null)&&CanEditTask(A,"Finish")}GanttTaskCell.prototype.dragStart=function(H){if(!H){H=window.event}var L=this;var M=this.getTree();var J=this.getRoot();var B=J.getElement();this.mouseDown=true;var E=this.box.getStyleLeft();var K=E+this.box.getStyleWidth();var D=this.getBoxLocalPoint(H);var F,A;if(this.canDragEdges()){F=this.isLeftEdge(D.x);A=this.isRightEdge(D.x)}var C=this.resize=F||A;this.dragDate=null;M.setCursor(this.box.getCursor());var I;if(!C&&this.item.isSelected()){I=M.getSelectedValues("ganttCell",function(N){return N.canDrag()})}else{I=new Array(this)}for(var G=0;G<I.length;G++){I[G].startDragBox(H)}B.onmouseup=function(N){if(!N){N=window.event}N.cancelBubble=true;if(L.mouseDown){L.finishDrag(N,I)}M.setCursor(null);B.onmouseup=null;B.onmousemove=null};B.onmousemove=function(U){if(!U){U=window.event}U.cancelBubble=true;var Q=L.getLocalPoint(U);var P=Q.x;if(F||A){var T=F?P:E;var O=A?P:K;if(T>O){var R=T;T=O;O=R}L.minDrag=T;L.maxDrag=O;L.box.setStyleLeft(T);L.box.setStyleWidth(O-T)}else{var N=P-D.x;for(var S=0;S<I.length;S++){I[S].updateDragBox(P)}}return false}};GanttTaskCell.prototype.startDragBox=function(B){var A=this.getBoxLocalPoint(B);this.startDragX=A.x};GanttTaskCell.prototype.updateDragBox=function(A){this.dragDate=this.column.getDateFromPosition(A-this.startDragX);this.box.setStyleLeft(A-this.startDragX)};GanttTaskCell.prototype.finishDrag=function(F,E){var A=new Object();OnCalculateTaskSchedule=function(H){A[H.Id]=true};BeginTransaction("Gantt Drag");try{for(var D=0;D<E.length;D++){var C=E[D].item.value;if(!A[C.Id]){E[D].finishDragBox(F,true)}else{E[D].update()}var G=dependencyManager.getActiveWaitingDependencies(C.Id);for(var B=0;G!=null&&B<G.length;B++){A[G[B].WaitingTaskId]=true}}}finally{EndTransaction()}OnCalculateTaskSchedule=null};GanttTaskCell.prototype.finishDragBox=function(I,O){var N=this;var C=N.dragDate;var B=N.item.value;if(this.resize){var F=N.column.getDateFromPosition(N.minDrag);var K=N.column.getDateFromPosition(N.maxDrag);if(F>K){var M=F;F=K;K=M}K=addDays(K,-1);var G=GetSchedule(B.TeamId);var H=GetById(DurationUnits,B.DurationUnitId);if(H.Work){if(!IsWorkday(G,F)){F=GetNextWorkDay(G,F)}if(!IsWorkday(G,K)){K=GetNextWorkDay(G,K)}}var E=getMinutesOfDay(B.Finish);B.Start=setMinutesOfDay(F,GetStart(G,F));var A=GetFinish(G,K);if(A>0){E=A}B.Finish=setMinutesOfDay(K,E);if(B.Finish<B.Start){B.Finish=B.Start;B.Duration=0}else{var L=GetScheduleDurationUnit(B.Start,B.Finish);B.DurationUnitId=L.Id;B.Duration=GetScheduleDuration(G,B.Start,B.Finish,B.DurationUnitId)}taskManager.Update(B)}else{if(C!=null&&!isSameDay(C,B.Start)){var D=getMinutesOfDay(B.Start);var G=GetSchedule(B.TeamId);var H=GetById(DurationUnits,B.DurationUnitId);if(H.Work&&!IsWorkday(G,C)){C=GetNextWorkDay(G,C)}var J=getMinutesDifference(B.Finish,B.Start);B.Start=setMinutesOfDay(C,D);if(B.ChildCount==0){B.Finish=GetTaskFinish(G,B.Start,B.Work,B.Duration,B.DurationUnitId)}else{B.Finish=addMinutes(B.Start,J)}taskManager.Update(B)}}N.update()};GanttTaskCell.prototype.getTree=function(){return this.column.getTree()};GanttTaskCell.prototype.getBoxLocalPoint=function(A){if(!A){A=window.event}return this.getLocalPoint(A,this.box.getElement())};GanttTaskCell.prototype.getLocalPoint=function(B,A){if(!B){B=window.event}if(A==null){A=this.getElement()}return getLocalPoint(A,B)};GanttTaskCell.prototype.isLeftEdge=function(A){var B=this.item.value;return this.canResize()&&!B.Locked&&A<=4};GanttTaskCell.prototype.isRightEdge=function(A){return this.canResize()&&A>=this.background.getStyleWidth()-4};GanttTaskCell.prototype.getDependencyInputPoint=function(){var A=this.background.getStyleLeft();var B=this.item.getAbsolutePositionY()+this.background.getStyleTop()+this.background.getStyleHeight()/2;return new Point(A,B-1)};GanttTaskCell.prototype.getDependencyOutputRectangle=function(){var A=this.background.getStyleBounds();A.x+=4;A.width-=8;A.y+=this.item.getAbsolutePositionY();return A};GanttTaskCell.prototype.getDependencyOutputOffsetY=function(B,F){var D=0;if(F&&this.item.value.ChildCount>0){var A=this.background.getStyleLeft();var C=this.background.getStyleWidth();if(B>A&&B<=(A+C)){var E=Math.min(B-A,A+C-B);if(E<8){D=5-Math.abs(E-4)}}}return D};function isBoxVisible(A){if(A.Duration!=null&&A.Duration==0&&A.Milestone){return false}return true}GanttTaskCell.prototype.updateImages=function(B){var E=this.box;var C=this.background;var D=this.bar;if(B.Locked){if(this.locked==null){this.add(this.locked=new ImageComponent("Gantt/Lock"))}this.locked.setVisible(true);this.locked.setStylePosition("absolute");this.locked.setStyleLeft(E.getStyleLeft()+E.getStyleWidth()+1);this.locked.setStyleTop(4)}else{if(this.locked!=null){this.locked.setVisible(false)}}var F=isBoxVisible(B);if(F){E.setImage(B.ChildCount>0?"Gantt/ParentFrame":"Gantt/TaskFrame");E.setVisible(true)}else{E.setImage(null);E.setClass(null);D.setVisible(false)}C.setVisible(B.ChildCount==null||(B.ChildCount==0&&F));if(B.Milestone){if(this.milestone==null){this.box.add(this.milestone=new ImageComponent("Gantt/Milestone"))}var A=11;this.milestone.setVisible(true);this.milestone.setStylePosition("absolute");this.milestone.setStyleLeft(-1);this.milestone.setStyleTop((this.getStyleHeight()-A)/2)}else{if(this.milestone!=null){this.milestone.setVisible(false)}}};GanttTaskCell.prototype.update=function(S){if(S==null){S=this.item}var D=this.column;var M=S.getTree();var R=S.value;var F=R.Start;var P=R.Finish;if(F==null||P==null||(R.Scheduled==false)){this.setVisible(false);return }this.setVisible(true);var W=!isBoxVisible(R);var T=R.ChildCount>0;this.setStyleWidth(D.getStyleWidth());var K=D.getRange(F,P);var G=K.start;var O=Math.max(K.finish-K.start,W?9:(T?16:9));var B=this.getStyleHeight();var V=13;var J=this.visibleBoxHeight;var H=this.box;H.setStyleLeft(G);H.setStyleWidth(O);H.setStyleTop(0);H.setStyleHeight(B);var E=12;var I=this.text;I.setValue(R.Name);I.setStyleLeft(G+O+E);var Q=this.bar;if(R.Complete==0){Q.setVisible(false)}else{Q.setVisible(true);var U=O-4;var L=Math.floor(U*R.Complete/100);Q.setStyleWidth(L);Q.setStyleTop((B-Q.getStyleHeight())/2)}var C=R.Finish.getTime()<new Date().getTime();var N=R.Blocked;this.background.setStyleLeft(G);this.background.setStyleTop((B-J)/2);this.background.setStyleWidth(O);this.background.setStyleHeight(J);var A=(R.Complete<100&&C)?"GanttTaskBackground-Late":"GanttTaskBackground";this.background.setClass(A);H.setCursor(canResizeTask(R)?"w-resize":null);this.updateImages(R)};function GanttWeekendUnderlay(A){this.column=A;this.tag="div";this.setClass("GanttWeekendUnderlay")}extend(GanttWeekendUnderlay,Component);GanttWeekendUnderlay.prototype.addWeekend=function(A,B){var C=new Component("div");C.setClass("GanttWeekend");C.setStyleLeft(A);C.setStyleWidth(B);C.setStyleHeight(4000);this.add(C)};GanttWeekendUnderlay.prototype.clearWeekends=function(){this.removeAllChildren()};GanttWeekendUnderlay.prototype.getSchedule=function(){return this.column.getSchedule()};function GanttDependencyUnderlay(A){this.column=A;this.tag="div";this.setClass("GanttDependencyUnderlay");this.dependencyLines=new List();this.dependencyLookup=new Object()}extend(GanttDependencyUnderlay,Component);GanttDependencyUnderlay.prototype.setStyleWidth=function(A){Component.prototype.setStyleWidth.call(this,A)};GanttDependencyUnderlay.prototype.getTree=function(){return this.column.getTree()};GanttDependencyUnderlay.prototype.getKey=function(A){return A.BlockingTaskId+"-"+A.WaitingTaskId};GanttDependencyUnderlay.prototype.getDependencyLine=function(B){var A=this.getKey(B);return this.dependencyLookup[A]};GanttDependencyUnderlay.prototype.updateDependencies=function(D){if(D!=null){for(var A=0;A<D.length;A++){var C=D[A];if(C==null){continue}var B=this.getDependencyLine(C);if(B!=null){B.update()}}}else{for(var A=0;A<this.dependencyLines.getCount();A++){var B=this.dependencyLines.getItem(A);B.update()}}};GanttDependencyUnderlay.prototype.taskAdded=function(A,C){for(var B=0;B<C.length;B++){this.dependencyAdded(C[B])}this.updateDependencies()};GanttDependencyUnderlay.prototype.taskRemoved=function(A,C){for(var B=0;B<C.length;B++){this.dependencyRemoved(C[B])}this.updateDependencies()};GanttDependencyUnderlay.prototype.dependencyAdded=function(E){var B=this.getDependencyLine(E);if(B!=null){B.setDependency(E);return }var A=this.getTree();var D=A.getItem(E.BlockingTaskId);var C=A.getItem(E.WaitingTaskId);if(D!=null&&C!=null){this.addDependencyLine(new DependencyLine(this.column,E))}};GanttDependencyUnderlay.prototype.dependencyRemoved=function(B){var A=this.getDependencyLine(B);if(A!=null){if(B.Circular){warning(Resources.CircularDependencyRemoved)}this.removeDependencyLine(A)}};GanttDependencyUnderlay.prototype.addDependencyLine=function(B){this.dependencyLines.add(B);B.addChildrenTo(this);var A=this.getKey(B.getDependency());this.dependencyLookup[A]=B};GanttDependencyUnderlay.prototype.removeDependencyLine=function(B){this.dependencyLines.remove(B);B.removeChildrenFrom(this);var A=this.getKey(B.getDependency());this.dependencyLookup[A]=null};function DependencyLine(A,B){this.column=A;this.dep=B;this.vertical=this.createLine(true);this.horizontal=this.createLine(false);this.arrow=new ImageComponent("Gantt/ArrowRight");this.arrow.setStylePosition("absolute");this.arrow.setStyleWidth(5);this.arrow.setStyleHeight(5);this.update()}extend(DependencyLine,Component);DependencyLine.prototype.getDependency=function(){return this.dep};DependencyLine.prototype.setDependency=function(A){this.dep=A;this.update()};DependencyLine.prototype.lineWidth=1;DependencyLine.prototype.lineBuffer=4;DependencyLine.prototype.getTree=function(){return this.column.getTree()};DependencyLine.prototype.setVisible=function(A){this.vertical.setVisible(A);this.horizontal.setVisible(A);this.arrow.setVisible(A)};DependencyLine.prototype.addChildrenTo=function(A){A.add(this.vertical);A.add(this.horizontal);A.add(this.arrow)};DependencyLine.prototype.removeChildrenFrom=function(A){A.remove(this.vertical);A.remove(this.horizontal);A.remove(this.arrow)};DependencyLine.prototype.getCell=function(A){return this.column.getCell(A)};DependencyLine.prototype.createLine=function(B){var C=new Component("div");C.setClass("DependencyWrapper");var A=new Component("div");A.setClass("DependencyLine"+(B?"Vertical":"Horizontal"));if(B){A.setStyleLeft(this.lineBuffer)}else{A.setStyleTop(this.lineBuffer)}C.add(A);C.line=A;return C};DependencyLine.prototype.setBroken=function(A){this.vertical.line.setClass("DependencyLineVertical"+(A?"-Broken":""));this.horizontal.line.setClass("DependencyLineHorizontal"+(A?"-Broken":""))};DependencyLine.prototype.update=function(){var a=5;var R=this.getTree();var M=this.dep;var h=R.getItem(M.BlockingTaskId);var S=R.getItem(M.WaitingTaskId);if(h==null||S==null){return }if(!h.isVisible()||!S.isVisible()){this.setVisible(false);return }this.setVisible(true);var d=h.value;var P=S.value;var j=this.getTitle(d,P);this.vertical.setTitle(j);this.horizontal.setTitle(j);var f=this.getCell(h);var Q=this.getCell(S);var c=f.getDependencyOutputRectangle();var B=Q.getDependencyOutputRectangle();var U=Q.getDependencyInputPoint();var T=c.x>(B.x+B.width);var A=P.Start<d.LagFinish;this.setBroken(A);if(T){var b=c;c=B;B=b;U=f.getDependencyInputPoint()}var g=Math.max(c.x,B.x);var e=Math.min(c.x+c.width,B.x+B.width)-1;var D=g<=e;var L=Math.floor((g+e)/2);var E=3;var Y=(U.x-c.x)<E;var V=c.y<B.y;var Z=Y?L:U.x;var X=(Y?(B.y+(V?0:B.height)):U.y);var O=Y?L:(T?c.x:Math.min(c.x+c.width,Math.max(c.x,Z-E))-1);var N=c.y+(V?c.height:0)+f.getDependencyOutputOffsetY(O,V);var K=Math.min(O,Z);var J=Math.max(O,Z);var I=Math.min(N,X);var G=Math.max(N,X)+(IE?1:0);var W=this.lineWidth+(this.lineBuffer*2);this.vertical.setStyleBounds(K-this.lineBuffer,I,W,G-I);this.horizontal.setVisible(J>K);this.horizontal.setStyleBounds(K,(V?G:I)-this.lineBuffer,J-K,W);if(T){var b=O;O=Z;Z=b;b=N;N=X;X=b;Y=!Y;V=!V}var C=A?"Gantt/Red":"Gantt/";var H,F;if(Y){this.arrow.setSource(C+(V?"ArrowDown":"ArrowUp"));H=Z-a/2+(IE?1:0);F=X-(V?a:0)}else{this.arrow.setSource(C+"ArrowRight");H=Z-a+1;F=X-a/2+1}this.arrow.setStyleLeft(H);this.arrow.setStyleTop(F)};DependencyLine.prototype.getTitle=function(C,B){var F=this.dep;var D="Gantt"+(F.BlockingEnd==0?"Start":"Finish")+"To"+(F.WaitingEnd==0?"Start":"Finish")+(F.LagTime==0?"":"Lag")+"Description";var A=Resources[D];var E=formatDuration(F.LagTime);return format(A,C.Name,B.Name,E)};
