Type.registerNamespace("AjaxControlToolkit");AjaxControlToolkit.BoxSide=function(){};
AjaxControlToolkit.BoxSide.prototype={Top:0,Right:1,Bottom:2,Left:3};AjaxControlToolkit.BoxSide.registerEnum("AjaxControlToolkit.BoxSide",false);
AjaxControlToolkit._CommonToolkitScripts=function(){this._borderThicknesses={};var A=document.createElement("div");
var C=document.createElement("div");A.style.visibility="hidden";A.style.position="absolute";
A.style.fontSize="1px";C.style.height="0px";C.style.overflow="hidden";document.body.appendChild(A).appendChild(C);
var B=A.offsetHeight;C.style.borderTop="solid black";C.style.borderTopWidth="thin";
this._borderThicknesses["thin"]=A.offsetHeight-B;C.style.borderTopWidth="medium";
this._borderThicknesses["medium"]=A.offsetHeight-B;C.style.borderTopWidth="thick";
this._borderThicknesses["thick"]=A.offsetHeight-B;A.removeChild(C);document.body.removeChild(A);
A=null;C=null;};AjaxControlToolkit._CommonToolkitScripts.prototype={_borderStyleNames:["borderTopStyle","borderRightStyle","borderBottomStyle","borderLeftStyle"],_borderWidthNames:["borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth"],_paddingWidthNames:["paddingTop","paddingRight","paddingBottom","paddingLeft"],_marginWidthNames:["marginTop","marginRight","marginBottom","marginLeft"],getCurrentStyle:function(C,A,E){var D=null;
if(C){if(C.currentStyle){D=C.currentStyle[A];}else{if(document.defaultView&&document.defaultView.getComputedStyle){var B=document.defaultView.getComputedStyle(C,null);
if(B){D=B[A];}}}if(!D&&C.style.getPropertyValue){D=C.style.getPropertyValue(A);}else{if(!D&&C.style.getAttribute){D=C.style.getAttribute(A);
}}}if((!D||D==""||typeof(D)==="undefined")){if(typeof(E)!="undefined"){D=E;}else{D=null;
}}return D;},getInheritedBackgroundColor:function(B){if(!B){return"#FFFFFF";}var A=this.getCurrentStyle(B,"backgroundColor");
try{while(!A||A==""||A=="transparent"||A=="rgba(0, 0, 0, 0)"){B=B.parentNode;if(!B){A="#FFFFFF";
}else{A=this.getCurrentStyle(B,"backgroundColor");}}}catch(C){A="#FFFFFF";}return A;
},getLocation:function(C){if(C===document.documentElement){return new Sys.UI.Point(0,0);
}if(Sys.Browser.agent==Sys.Browser.InternetExplorer&&Sys.Browser.version<7){if(C.window===C||C.nodeType===9||!C.getClientRects||!C.getBoundingClientRect){return new Sys.UI.Point(0,0);
}var H=C.getClientRects();if(!H||!H.length){return new Sys.UI.Point(0,0);}var M=H[0];
var A=0;var E=0;var I=false;try{I=C.ownerDocument.parentWindow.frameElement;}catch(G){I=true;
}if(I){var B=C.getBoundingClientRect();if(!B){return new Sys.UI.Point(0,0);}var F=M.left;
var D=M.top;for(var J=1;J<H.length;J++){var L=H[J];if(L.left<F){F=L.left;}if(L.top<D){D=L.top;
}}A=F-B.left;E=D-B.top;}var K=C.document.documentElement;return new Sys.UI.Point(M.left-2-A+K.scrollLeft,M.top-2-E+K.scrollTop);
}return Sys.UI.DomElement.getLocation(C);},setLocation:function(A,B){Sys.UI.DomElement.setLocation(A,B.x,B.y);
},getContentSize:function(C){if(!C){throw Error.argumentNull("element");}var A=this.getSize(C);
var B=this.getBorderBox(C);var D=this.getPaddingBox(C);return{width:A.width-B.horizontal-D.horizontal,height:A.height-B.vertical-D.vertical};
},getSize:function(A){if(!A){throw Error.argumentNull("element");}return{width:A.offsetWidth,height:A.offsetHeight};
},setContentSize:function(C,A){if(!C){throw Error.argumentNull("element");}if(!A){throw Error.argumentNull("size");
}if(this.getCurrentStyle(C,"MozBoxSizing")=="border-box"||this.getCurrentStyle(C,"BoxSizing")=="border-box"){var B=this.getBorderBox(C);
var D=this.getPaddingBox(C);A={width:A.width+B.horizontal+D.horizontal,height:A.height+B.vertical+D.vertical};
}C.style.width=A.width.toString()+"px";C.style.height=A.height.toString()+"px";},setSize:function(D,A){if(!D){throw Error.argumentNull("element");
}if(!A){throw Error.argumentNull("size");}var C=this.getBorderBox(D);var E=this.getPaddingBox(D);
var B={width:A.width-C.horizontal-E.horizontal,height:A.height-C.vertical-E.vertical};
this.setContentSize(D,B);},getBounds:function(A){var B=$common.getLocation(A);return new Sys.UI.Bounds(B.x,B.y,A.offsetWidth||0,A.offsetHeight||0);
},setBounds:function(B,A){if(!B){throw Error.argumentNull("element");}if(!A){throw Error.argumentNull("bounds");
}this.setSize(B,A);$common.setLocation(B,A);},getClientBounds:function(){var B;var A;
switch(Sys.Browser.agent){case Sys.Browser.InternetExplorer:B=document.documentElement.clientWidth;
A=document.documentElement.clientHeight;break;case Sys.Browser.Safari:B=window.innerWidth;
A=window.innerHeight;break;case Sys.Browser.Opera:B=Math.min(window.innerWidth,document.body.clientWidth);
A=Math.min(window.innerHeight,document.body.clientHeight);break;default:B=Math.min(window.innerWidth,document.documentElement.clientWidth);
A=Math.min(window.innerHeight,document.documentElement.clientHeight);break;}return new Sys.UI.Bounds(0,0,B,A);
},getMarginBox:function(B){if(!B){throw Error.argumentNull("element");}var A={top:this.getMargin(B,AjaxControlToolkit.BoxSide.Top),right:this.getMargin(B,AjaxControlToolkit.BoxSide.Right),bottom:this.getMargin(B,AjaxControlToolkit.BoxSide.Bottom),left:this.getMargin(B,AjaxControlToolkit.BoxSide.Left)};
A.horizontal=A.left+A.right;A.vertical=A.top+A.bottom;return A;},getBorderBox:function(B){if(!B){throw Error.argumentNull("element");
}var A={top:this.getBorderWidth(B,AjaxControlToolkit.BoxSide.Top),right:this.getBorderWidth(B,AjaxControlToolkit.BoxSide.Right),bottom:this.getBorderWidth(B,AjaxControlToolkit.BoxSide.Bottom),left:this.getBorderWidth(B,AjaxControlToolkit.BoxSide.Left)};
A.horizontal=A.left+A.right;A.vertical=A.top+A.bottom;return A;},getPaddingBox:function(B){if(!B){throw Error.argumentNull("element");
}var A={top:this.getPadding(B,AjaxControlToolkit.BoxSide.Top),right:this.getPadding(B,AjaxControlToolkit.BoxSide.Right),bottom:this.getPadding(B,AjaxControlToolkit.BoxSide.Bottom),left:this.getPadding(B,AjaxControlToolkit.BoxSide.Left)};
A.horizontal=A.left+A.right;A.vertical=A.top+A.bottom;return A;},isBorderVisible:function(C,D){if(!C){throw Error.argumentNull("element");
}if(D<AjaxControlToolkit.BoxSide.Top||D>AjaxControlToolkit.BoxSide.Left){throw Error.argumentOutOfRange(String.format(Sys.Res.enumInvalidValue,D,"AjaxControlToolkit.BoxSide"));
}var B=this._borderStyleNames[D];var A=this.getCurrentStyle(C,B);return A!="none";
},getMargin:function(C,D){if(!C){throw Error.argumentNull("element");}if(D<AjaxControlToolkit.BoxSide.Top||D>AjaxControlToolkit.BoxSide.Left){throw Error.argumentOutOfRange(String.format(Sys.Res.enumInvalidValue,D,"AjaxControlToolkit.BoxSide"));
}var B=this._marginWidthNames[D];var A=this.getCurrentStyle(C,B);try{return this.parsePadding(A);
}catch(E){return 0;}},getBorderWidth:function(C,D){if(!C){throw Error.argumentNull("element");
}if(D<AjaxControlToolkit.BoxSide.Top||D>AjaxControlToolkit.BoxSide.Left){throw Error.argumentOutOfRange(String.format(Sys.Res.enumInvalidValue,D,"AjaxControlToolkit.BoxSide"));
}if(!this.isBorderVisible(C,D)){return 0;}var B=this._borderWidthNames[D];var A=this.getCurrentStyle(C,B);
return this.parseBorderWidth(A);},getPadding:function(C,D){if(!C){throw Error.argumentNull("element");
}if(D<AjaxControlToolkit.BoxSide.Top||D>AjaxControlToolkit.BoxSide.Left){throw Error.argumentOutOfRange(String.format(Sys.Res.enumInvalidValue,D,"AjaxControlToolkit.BoxSide"));
}var B=this._paddingWidthNames[D];var A=this.getCurrentStyle(C,B);return this.parsePadding(A);
},parseBorderWidth:function(B){if(B){switch(B){case"thin":case"medium":case"thick":return this._borderThicknesses[B];
case"inherit":return 0;}var A=this.parseUnit(B);Sys.Debug.assert(A.type=="px",String.format(AjaxControlToolkit.Resources.Common_InvalidBorderWidthUnit,A.type));
return A.size;}return 0;},parsePadding:function(A){if(A){if(A=="inherit"){return 0;
}var B=this.parseUnit(A);Sys.Debug.assert(B.type=="px",String.format(AjaxControlToolkit.Resources.Common_InvalidPaddingUnit,B.type));
return B.size;}return 0;},parseUnit:function(B){if(!B){throw Error.argumentNull("value");
}B=B.trim().toLowerCase();var G=B.length;var E=-1;for(var D=0;D<G;D++){var F=B.substr(D,1);
if((F<"0"||F>"9")&&F!="-"&&F!="."&&F!=","){break;}E=D;}if(E==-1){throw Error.create(AjaxControlToolkit.Resources.Common_UnitHasNoDigits);
}var C;var A;if(E<(G-1)){C=B.substring(E+1).trim();}else{C="px";}A=parseFloat(B.substr(0,E+1));
if(C=="px"){A=Math.floor(A);}return{size:A,type:C};},getElementOpacity:function(C){if(!C){throw Error.argumentNull("element");
}var A=false;var B;if(C.filters){var E=C.filters;if(E.length!==0){var D=E["DXImageTransform.Microsoft.Alpha"];
if(D){B=D.opacity/100;A=true;}}}else{B=this.getCurrentStyle(C,"opacity",1);A=true;
}if(A===false){return 1;}return parseFloat(B);},setElementOpacity:function(C,A){if(!C){throw Error.argumentNull("element");
}if(C.filters){var E=C.filters;var B=true;if(E.length!==0){var D=E["DXImageTransform.Microsoft.Alpha"];
if(D){B=false;D.opacity=A*100;}}if(B){C.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity="+(A*100)+")";
}}else{C.style.opacity=A;}},getVisible:function(A){return(A&&("none"!=$common.getCurrentStyle(A,"display"))&&("hidden"!=$common.getCurrentStyle(A,"visibility")));
},setVisible:function(B,A){if(B&&A!=$common.getVisible(B)){if(A){if(B.style.removeAttribute){B.style.removeAttribute("display");
}else{B.style.removeProperty("display");}}else{B.style.display="none";}B.style.visibility=A?"visible":"hidden";
}},resolveFunction:function(value){if(value){if(value instanceof Function){return value;
}else{if(String.isInstanceOfType(value)&&value.length>0){var func;if((func=window[value]) instanceof Function){return func;
}else{if((func=eval(value)) instanceof Function){return func;}}}}}return null;},addCssClasses:function(B,C){for(var A=0;
A<C.length;A++){Sys.UI.DomElement.addCssClass(B,C[A]);}},removeCssClasses:function(B,C){for(var A=0;
A<C.length;A++){Sys.UI.DomElement.removeCssClass(B,C[A]);}},setStyle:function(B,A){$common.applyProperties(B.style,A);
},removeHandlers:function(C,B){for(var A in B){$removeHandler(C,A,B[A]);}},overlaps:function(D,G){var H=(D.x>=G.x&&D.x<=(G.x+G.width));
var F=((D.x+D.width)>=G.x&&(D.x+D.width)<=G.x+G.width);var A=((D.x<G.x)&&((D.x+D.width)>(G.x+G.width)));
var B=(D.y>=G.y&&D.y<=(G.y+G.height));var C=((D.y+D.height)>=G.y&&(D.y+D.height)<=G.y+G.height);
var E=((D.y<G.y)&&((D.y+D.height)>(G.y+G.height)));return(H||F||A)&&(B||C||E);},containsPoint:function(A,C,B){return C>=A.x&&C<=(A.x+A.width)&&B>=A.y&&B<=(A.y+A.width);
},isKeyDigit:function(A){return(48<=A&&A<=57);},isKeyNavigation:function(A){return(Sys.UI.Key.left<=A&&A<=Sys.UI.Key.down);
},padLeft:function(D,A,C,B){return $common._pad(D,A||2,C||" ","l",B||false);},padRight:function(D,A,C,B){return $common._pad(D,A||2,C||" ","r",B||false);
},_pad:function(D,C,F,B,G){D=D.toString();var E=D.length;var H=new Sys.StringBuilder();
if(B=="r"){H.append(D);}while(E<C){H.append(F);E++;}if(B=="l"){H.append(D);}var A=H.toString();
if(G&&A.length>C){if(B=="l"){A=A.substr(A.length-C,C);}else{A=A.substr(0,C);}}return A;
},__DOMEvents:{focusin:{eventGroup:"UIEvents",init:function(A,B){A.initUIEvent("focusin",true,false,window,1);
}},focusout:{eventGroup:"UIEvents",init:function(A,B){A.initUIEvent("focusout",true,false,window,1);
}},activate:{eventGroup:"UIEvents",init:function(A,B){A.initUIEvent("activate",true,true,window,1);
}},focus:{eventGroup:"UIEvents",init:function(A,B){A.initUIEvent("focus",false,false,window,1);
}},blur:{eventGroup:"UIEvents",init:function(A,B){A.initUIEvent("blur",false,false,window,1);
}},click:{eventGroup:"MouseEvents",init:function(A,B){A.initMouseEvent("click",true,true,window,1,B.screenX||0,B.screenY||0,B.clientX||0,B.clientY||0,B.ctrlKey||false,B.altKey||false,B.shiftKey||false,B.metaKey||false,B.button||0,B.relatedTarget||null);
}},dblclick:{eventGroup:"MouseEvents",init:function(A,B){A.initMouseEvent("click",true,true,window,2,B.screenX||0,B.screenY||0,B.clientX||0,B.clientY||0,B.ctrlKey||false,B.altKey||false,B.shiftKey||false,B.metaKey||false,B.button||0,B.relatedTarget||null);
}},mousedown:{eventGroup:"MouseEvents",init:function(A,B){A.initMouseEvent("mousedown",true,true,window,1,B.screenX||0,B.screenY||0,B.clientX||0,B.clientY||0,B.ctrlKey||false,B.altKey||false,B.shiftKey||false,B.metaKey||false,B.button||0,B.relatedTarget||null);
}},mouseup:{eventGroup:"MouseEvents",init:function(A,B){A.initMouseEvent("mouseup",true,true,window,1,B.screenX||0,B.screenY||0,B.clientX||0,B.clientY||0,B.ctrlKey||false,B.altKey||false,B.shiftKey||false,B.metaKey||false,B.button||0,B.relatedTarget||null);
}},mouseover:{eventGroup:"MouseEvents",init:function(A,B){A.initMouseEvent("mouseover",true,true,window,1,B.screenX||0,B.screenY||0,B.clientX||0,B.clientY||0,B.ctrlKey||false,B.altKey||false,B.shiftKey||false,B.metaKey||false,B.button||0,B.relatedTarget||null);
}},mousemove:{eventGroup:"MouseEvents",init:function(A,B){A.initMouseEvent("mousemove",true,true,window,1,B.screenX||0,B.screenY||0,B.clientX||0,B.clientY||0,B.ctrlKey||false,B.altKey||false,B.shiftKey||false,B.metaKey||false,B.button||0,B.relatedTarget||null);
}},mouseout:{eventGroup:"MouseEvents",init:function(A,B){A.initMouseEvent("mousemove",true,true,window,1,B.screenX||0,B.screenY||0,B.clientX||0,B.clientY||0,B.ctrlKey||false,B.altKey||false,B.shiftKey||false,B.metaKey||false,B.button||0,B.relatedTarget||null);
}},load:{eventGroup:"HTMLEvents",init:function(A,B){A.initEvent("load",false,false);
}},unload:{eventGroup:"HTMLEvents",init:function(A,B){A.initEvent("unload",false,false);
}},select:{eventGroup:"HTMLEvents",init:function(A,B){A.initEvent("select",true,false);
}},change:{eventGroup:"HTMLEvents",init:function(A,B){A.initEvent("change",true,false);
}},submit:{eventGroup:"HTMLEvents",init:function(A,B){A.initEvent("submit",true,true);
}},reset:{eventGroup:"HTMLEvents",init:function(A,B){A.initEvent("reset",true,false);
}},resize:{eventGroup:"HTMLEvents",init:function(A,B){A.initEvent("resize",true,false);
}},scroll:{eventGroup:"HTMLEvents",init:function(A,B){A.initEvent("scroll",true,false);
}}},tryFireRawEvent:function(B,A){try{if(B.fireEvent){B.fireEvent("on"+A.type,A);
return true;}else{if(B.dispatchEvent){B.dispatchEvent(A);return true;}}}catch(C){}return false;
},tryFireEvent:function(C,D,B){try{if(document.createEventObject){var A=document.createEventObject();
$common.applyProperties(A,B||{});C.fireEvent("on"+D,A);return true;}else{if(document.createEvent){var E=$common.__DOMEvents[D];
if(E){var A=document.createEvent(E.eventGroup);E.init(A,B||{});C.dispatchEvent(A);
return true;}}}}catch(A){}return false;},wrapElement:function(A,D,C){var B=A.parentNode;
B.replaceChild(D,A);(C||D).appendChild(A);},unwrapElement:function(A,C){var B=C.parentNode;
if(B!=null){$common.removeElement(A);B.replaceChild(A,C);}},removeElement:function(B){var A=B.parentNode;
if(A!=null){A.removeChild(B);}},applyProperties:function(B,A){for(var D in A){var C=A[D];
if(C!=null&&Object.getType(C)===Object){var E=B[D];$common.applyProperties(E,C);}else{B[D]=C;
}}},createElementFromTemplate:function(B,I,C){if(typeof(B.nameTable)!="undefined"){var F=B.nameTable;
if(String.isInstanceOfType(F)){F=C[F];}if(F!=null){C=F;}}var G=null;if(typeof(B.name)!=="undefined"){G=B.name;
}var E=document.createElement(B.nodeName);if(typeof(B.name)!=="undefined"&&C){C[B.name]=E;
}if(typeof(B.parent)!=="undefined"&&I==null){var H=B.parent;if(String.isInstanceOfType(H)){H=C[H];
}if(H!=null){I=H;}}if(typeof(B.properties)!=="undefined"&&B.properties!=null){$common.applyProperties(E,B.properties);
}if(typeof(B.cssClasses)!=="undefined"&&B.cssClasses!=null){$common.addCssClasses(E,B.cssClasses);
}if(typeof(B.events)!=="undefined"&&B.events!=null){$addHandlers(E,B.events);}if(typeof(B.visible)!=="undefined"&&B.visible!=null){this.setVisible(E,B.visible);
}if(I){I.appendChild(E);}if(typeof(B.opacity)!=="undefined"&&B.opacity!=null){$common.setElementOpacity(E,B.opacity);
}if(typeof(B.children)!=="undefined"&&B.children!=null){for(var A=0;A<B.children.length;
A++){var D=B.children[A];$common.createElementFromTemplate(D,E,C);}}var K=E;if(typeof(B.contentPresenter)!=="undefined"&&B.contentPresenter!=null){K=C[K];
}if(typeof(B.content)!=="undefined"&&B.content!=null){var J=B.content;if(String.isInstanceOfType(J)){J=C[J];
}if(J.parentNode){$common.wrapElement(J,E,K);}else{K.appendChild(J);}}return E;},prepareHiddenElementForATDeviceUpdate:function(){var A=document.getElementById("hiddenInputToUpdateATBuffer_CommonToolkitScripts");
if(!A){var A=document.createElement("input");A.setAttribute("type","hidden");A.setAttribute("value","1");
A.setAttribute("id","hiddenInputToUpdateATBuffer_CommonToolkitScripts");A.setAttribute("name","hiddenInputToUpdateATBuffer_CommonToolkitScripts");
if(document.forms[0]){document.forms[0].appendChild(A);}}},updateFormToRefreshATDeviceBuffer:function(){var A=document.getElementById("hiddenInputToUpdateATBuffer_CommonToolkitScripts");
if(A){if(A.getAttribute("value")=="1"){A.setAttribute("value","0");}else{A.setAttribute("value","1");
}}}};var CommonToolkitScripts=AjaxControlToolkit.CommonToolkitScripts=new AjaxControlToolkit._CommonToolkitScripts();
var $common=CommonToolkitScripts;Sys.UI.DomElement.getVisible=$common.getVisible;
Sys.UI.DomElement.setVisible=$common.setVisible;Sys.UI.Control.overlaps=$common.overlaps;
AjaxControlToolkit._DomUtility=function(){};AjaxControlToolkit._DomUtility.prototype={isDescendant:function(C,B){for(var A=B.parentNode;
A!=null;A=A.parentNode){if(A==C){return true;}}return false;},isDescendantOrSelf:function(B,A){if(B===A){return true;
}return AjaxControlToolkit.DomUtility.isDescendant(B,A);},isAncestor:function(A,B){return AjaxControlToolkit.DomUtility.isDescendant(B,A);
},isAncestorOrSelf:function(A,B){if(A===B){return true;}return AjaxControlToolkit.DomUtility.isDescendant(B,A);
},isSibling:function(C,D){var B=C.parentNode;for(var A=0;A<B.childNodes.length;A++){if(B.childNodes[A]==D){return true;
}}return false;}};AjaxControlToolkit._DomUtility.registerClass("AjaxControlToolkit._DomUtility");
AjaxControlToolkit.DomUtility=new AjaxControlToolkit._DomUtility();AjaxControlToolkit.TextBoxWrapper=function(A){AjaxControlToolkit.TextBoxWrapper.initializeBase(this,[A]);
this._current=A.value;this._watermark=null;this._isWatermarked=false;};AjaxControlToolkit.TextBoxWrapper.prototype={dispose:function(){this.get_element().AjaxControlToolkitTextBoxWrapper=null;
AjaxControlToolkit.TextBoxWrapper.callBaseMethod(this,"dispose");},get_Current:function(){this._current=this.get_element().value;
return this._current;},set_Current:function(A){this._current=A;this._updateElement();
},get_Value:function(){if(this.get_IsWatermarked()){return"";}else{return this.get_Current();
}},set_Value:function(A){this.set_Current(A);if(!A||(0==A.length)){if(null!=this._watermark){this.set_IsWatermarked(true);
}}else{this.set_IsWatermarked(false);}},get_Watermark:function(){return this._watermark;
},set_Watermark:function(A){this._watermark=A;this._updateElement();},get_IsWatermarked:function(){return this._isWatermarked;
},set_IsWatermarked:function(A){if(this._isWatermarked!=A){this._isWatermarked=A;
this._updateElement();this._raiseWatermarkChanged();}},_updateElement:function(){var A=this.get_element();
if(this._isWatermarked){if(A.value!=this._watermark){A.value=this._watermark;}}else{if(A.value!=this._current){A.value=this._current;
}}},add_WatermarkChanged:function(A){this.get_events().addHandler("WatermarkChanged",A);
},remove_WatermarkChanged:function(A){this.get_events().removeHandler("WatermarkChanged",A);
},_raiseWatermarkChanged:function(){var A=this.get_events().getHandler("WatermarkChanged");
if(A){A(this,Sys.EventArgs.Empty);}}};AjaxControlToolkit.TextBoxWrapper.get_Wrapper=function(A){if(null==A.AjaxControlToolkitTextBoxWrapper){A.AjaxControlToolkitTextBoxWrapper=new AjaxControlToolkit.TextBoxWrapper(A);
}return A.AjaxControlToolkitTextBoxWrapper;};AjaxControlToolkit.TextBoxWrapper.registerClass("AjaxControlToolkit.TextBoxWrapper",Sys.UI.Behavior);
AjaxControlToolkit.TextBoxWrapper.validatorGetValue=function(B){var A=$get(B);if(A&&A.AjaxControlToolkitTextBoxWrapper){return A.AjaxControlToolkitTextBoxWrapper.get_Value();
}return AjaxControlToolkit.TextBoxWrapper._originalValidatorGetValue(B);};if(typeof(ValidatorGetValue)=="function"){AjaxControlToolkit.TextBoxWrapper._originalValidatorGetValue=ValidatorGetValue;
ValidatorGetValue=AjaxControlToolkit.TextBoxWrapper.validatorGetValue;}if(Sys.CultureInfo.prototype._getAbbrMonthIndex){try{Sys.CultureInfo.prototype._getAbbrMonthIndex("");
}catch(ex){Sys.CultureInfo.prototype._getAbbrMonthIndex=function(A){if(!this._upperAbbrMonths){this._upperAbbrMonths=this._toUpperArray(this.dateTimeFormat.AbbreviatedMonthNames);
}return Array.indexOf(this._upperAbbrMonths,this._toUpper(A));};Sys.CultureInfo.CurrentCulture._getAbbrMonthIndex=Sys.CultureInfo.prototype._getAbbrMonthIndex;
Sys.CultureInfo.InvariantCulture._getAbbrMonthIndex=Sys.CultureInfo.prototype._getAbbrMonthIndex;
}}Type.registerNamespace("AjaxControlToolkit");AjaxControlToolkit.BehaviorBase=function(A){AjaxControlToolkit.BehaviorBase.initializeBase(this,[A]);
this._clientStateFieldID=null;this._pageRequestManager=null;this._partialUpdateBeginRequestHandler=null;
this._partialUpdateEndRequestHandler=null;};AjaxControlToolkit.BehaviorBase.prototype={initialize:function(){AjaxControlToolkit.BehaviorBase.callBaseMethod(this,"initialize");
},dispose:function(){AjaxControlToolkit.BehaviorBase.callBaseMethod(this,"dispose");
if(this._pageRequestManager){if(this._partialUpdateBeginRequestHandler){this._pageRequestManager.remove_beginRequest(this._partialUpdateBeginRequestHandler);
this._partialUpdateBeginRequestHandler=null;}if(this._partialUpdateEndRequestHandler){this._pageRequestManager.remove_endRequest(this._partialUpdateEndRequestHandler);
this._partialUpdateEndRequestHandler=null;}this._pageRequestManager=null;}},get_ClientStateFieldID:function(){return this._clientStateFieldID;
},set_ClientStateFieldID:function(A){if(this._clientStateFieldID!=A){this._clientStateFieldID=A;
this.raisePropertyChanged("ClientStateFieldID");}},get_ClientState:function(){if(this._clientStateFieldID){var A=document.getElementById(this._clientStateFieldID);
if(A){return A.value;}}return null;},set_ClientState:function(A){if(this._clientStateFieldID){var B=document.getElementById(this._clientStateFieldID);
if(B){B.value=A;}}},registerPartialUpdateEvents:function(){if(Sys&&Sys.WebForms&&Sys.WebForms.PageRequestManager){this._pageRequestManager=Sys.WebForms.PageRequestManager.getInstance();
if(this._pageRequestManager){this._partialUpdateBeginRequestHandler=Function.createDelegate(this,this._partialUpdateBeginRequest);
this._pageRequestManager.add_beginRequest(this._partialUpdateBeginRequestHandler);
this._partialUpdateEndRequestHandler=Function.createDelegate(this,this._partialUpdateEndRequest);
this._pageRequestManager.add_endRequest(this._partialUpdateEndRequestHandler);}}},_partialUpdateBeginRequest:function(A,B){},_partialUpdateEndRequest:function(A,B){}};
AjaxControlToolkit.BehaviorBase.registerClass("AjaxControlToolkit.BehaviorBase",Sys.UI.Behavior);
AjaxControlToolkit.DynamicPopulateBehaviorBase=function(A){AjaxControlToolkit.DynamicPopulateBehaviorBase.initializeBase(this,[A]);
this._DynamicControlID=null;this._DynamicContextKey=null;this._DynamicServicePath=null;
this._DynamicServiceMethod=null;this._cacheDynamicResults=false;this._dynamicPopulateBehavior=null;
this._populatingHandler=null;this._populatedHandler=null;};AjaxControlToolkit.DynamicPopulateBehaviorBase.prototype={initialize:function(){AjaxControlToolkit.DynamicPopulateBehaviorBase.callBaseMethod(this,"initialize");
this._populatingHandler=Function.createDelegate(this,this._onPopulating);this._populatedHandler=Function.createDelegate(this,this._onPopulated);
},dispose:function(){if(this._populatedHandler){if(this._dynamicPopulateBehavior){this._dynamicPopulateBehavior.remove_populated(this._populatedHandler);
}this._populatedHandler=null;}if(this._populatingHandler){if(this._dynamicPopulateBehavior){this._dynamicPopulateBehavior.remove_populating(this._populatingHandler);
}this._populatingHandler=null;}if(this._dynamicPopulateBehavior){this._dynamicPopulateBehavior.dispose();
this._dynamicPopulateBehavior=null;}AjaxControlToolkit.DynamicPopulateBehaviorBase.callBaseMethod(this,"dispose");
},populate:function(A){if(this._dynamicPopulateBehavior&&(this._dynamicPopulateBehavior.get_element()!=$get(this._DynamicControlID))){this._dynamicPopulateBehavior.dispose();
this._dynamicPopulateBehavior=null;}if(!this._dynamicPopulateBehavior&&this._DynamicControlID&&this._DynamicServiceMethod){this._dynamicPopulateBehavior=$create(AjaxControlToolkit.DynamicPopulateBehavior,{"id":this.get_id()+"_DynamicPopulateBehavior","ContextKey":this._DynamicContextKey,"ServicePath":this._DynamicServicePath,"ServiceMethod":this._DynamicServiceMethod,"cacheDynamicResults":this._cacheDynamicResults},null,null,$get(this._DynamicControlID));
this._dynamicPopulateBehavior.add_populating(this._populatingHandler);this._dynamicPopulateBehavior.add_populated(this._populatedHandler);
}if(this._dynamicPopulateBehavior){this._dynamicPopulateBehavior.populate(A?A:this._DynamicContextKey);
}},_onPopulating:function(A,B){this.raisePopulating(B);},_onPopulated:function(A,B){this.raisePopulated(B);
},get_dynamicControlID:function(){return this._DynamicControlID;},get_DynamicControlID:this.get_dynamicControlID,set_dynamicControlID:function(A){if(this._DynamicControlID!=A){this._DynamicControlID=A;
this.raisePropertyChanged("dynamicControlID");this.raisePropertyChanged("DynamicControlID");
}},set_DynamicControlID:this.set_dynamicControlID,get_dynamicContextKey:function(){return this._DynamicContextKey;
},get_DynamicContextKey:this.get_dynamicContextKey,set_dynamicContextKey:function(A){if(this._DynamicContextKey!=A){this._DynamicContextKey=A;
this.raisePropertyChanged("dynamicContextKey");this.raisePropertyChanged("DynamicContextKey");
}},set_DynamicContextKey:this.set_dynamicContextKey,get_dynamicServicePath:function(){return this._DynamicServicePath;
},get_DynamicServicePath:this.get_dynamicServicePath,set_dynamicServicePath:function(A){if(this._DynamicServicePath!=A){this._DynamicServicePath=A;
this.raisePropertyChanged("dynamicServicePath");this.raisePropertyChanged("DynamicServicePath");
}},set_DynamicServicePath:this.set_dynamicServicePath,get_dynamicServiceMethod:function(){return this._DynamicServiceMethod;
},get_DynamicServiceMethod:this.get_dynamicServiceMethod,set_dynamicServiceMethod:function(A){if(this._DynamicServiceMethod!=A){this._DynamicServiceMethod=A;
this.raisePropertyChanged("dynamicServiceMethod");this.raisePropertyChanged("DynamicServiceMethod");
}},set_DynamicServiceMethod:this.set_dynamicServiceMethod,get_cacheDynamicResults:function(){return this._cacheDynamicResults;
},set_cacheDynamicResults:function(A){if(this._cacheDynamicResults!=A){this._cacheDynamicResults=A;
this.raisePropertyChanged("cacheDynamicResults");}},add_populated:function(A){this.get_events().addHandler("populated",A);
},remove_populated:function(A){this.get_events().removeHandler("populated",A);},raisePopulated:function(A){var B=this.get_events().getHandler("populated");
if(B){B(this,A);}},add_populating:function(A){this.get_events().addHandler("populating",A);
},remove_populating:function(A){this.get_events().removeHandler("populating",A);},raisePopulating:function(B){var A=this.get_events().getHandler("populating");
if(A){A(this,B);}}};AjaxControlToolkit.DynamicPopulateBehaviorBase.registerClass("AjaxControlToolkit.DynamicPopulateBehaviorBase",AjaxControlToolkit.BehaviorBase);
AjaxControlToolkit.ControlBase=function(A){AjaxControlToolkit.ControlBase.initializeBase(this,[A]);
this._clientStateField=null;this._callbackTarget=null;this._onsubmit$delegate=Function.createDelegate(this,this._onsubmit);
this._oncomplete$delegate=Function.createDelegate(this,this._oncomplete);this._onerror$delegate=Function.createDelegate(this,this._onerror);
};AjaxControlToolkit.ControlBase.prototype={initialize:function(){AjaxControlToolkit.ControlBase.callBaseMethod(this,"initialize");
if(this._clientStateField){this.loadClientState(this._clientStateField.value);}if(typeof(Sys.WebForms)!=="undefined"&&typeof(Sys.WebForms.PageRequestManager)!=="undefined"){Array.add(Sys.WebForms.PageRequestManager.getInstance()._onSubmitStatements,this._onsubmit$delegate);
}else{$addHandler(document.forms[0],"submit",this._onsubmit$delegate);}},dispose:function(){if(typeof(Sys.WebForms)!=="undefined"&&typeof(Sys.WebForms.PageRequestManager)!=="undefined"){Array.remove(Sys.WebForms.PageRequestManager.getInstance()._onSubmitStatements,this._onsubmit$delegate);
}else{$removeHandler(document.forms[0],"submit",this._onsubmit$delegate);}AjaxControlToolkit.ControlBase.callBaseMethod(this,"dispose");
},findElement:function(A){return $get(this.get_id()+"_"+A.split(":").join("_"));},get_clientStateField:function(){return this._clientStateField;
},set_clientStateField:function(A){if(this.get_isInitialized()){throw Error.invalidOperation(AjaxControlToolkit.Resources.ExtenderBase_CannotSetClientStateField);
}if(this._clientStateField!=A){this._clientStateField=A;this.raisePropertyChanged("clientStateField");
}},loadClientState:function(A){},saveClientState:function(){return null;},_invoke:function(B,C,A){if(!this._callbackTarget){throw Error.invalidOperation(AjaxControlToolkit.Resources.ExtenderBase_ControlNotRegisteredForCallbacks);
}if(typeof(WebForm_DoCallback)==="undefined"){throw Error.invalidOperation(AjaxControlToolkit.Resources.ExtenderBase_PageNotRegisteredForCallbacks);
}var F=[];for(var E=0;E<C.length;E++){F[E]=C[E];}var G=this.saveClientState();if(G!=null&&!String.isInstanceOfType(G)){throw Error.invalidOperation(AjaxControlToolkit.Resources.ExtenderBase_InvalidClientStateType);
}var D=Sys.Serialization.JavaScriptSerializer.serialize({name:B,args:F,state:this.saveClientState()});
WebForm_DoCallback(this._callbackTarget,D,this._oncomplete$delegate,A,this._onerror$delegate,true);
},_oncomplete:function(A,B){A=Sys.Serialization.JavaScriptSerializer.deserialize(A);
if(A.error){throw Error.create(A.error);}this.loadClientState(A.state);B(A.result);
},_onerror:function(A,B){throw Error.create(A);},_onsubmit:function(){if(this._clientStateField){this._clientStateField.value=this.saveClientState();
}return true;}};AjaxControlToolkit.ControlBase.registerClass("AjaxControlToolkit.ControlBase",Sys.UI.Control);
AjaxControlToolkit.Resources={"PasswordStrength_InvalidWeightingRatios":"Strength Weighting ratios must have 4 elements","Animation_ChildrenNotAllowed":'AjaxControlToolkit.Animation.createAnimation cannot add child animations to type "{0}" that does not derive from AjaxControlToolkit.Animation.ParentAnimation',"PasswordStrength_RemainingSymbols":"{0} symbol characters","ExtenderBase_CannotSetClientStateField":"clientStateField can only be set before initialization","Animation_TargetNotFound":'AjaxControlToolkit.Animation.Animation.set_animationTarget requires the ID of a Sys.UI.DomElement or Sys.UI.Control.  No element or control could be found corresponding to "{0}"',"Common_InvalidBorderWidthUnit":'A unit type of "{0}"\' is invalid for parseBorderWidth',"Tabs_PropertySetBeforeInitialization":"{0} cannot be changed before initialization","ReorderList_DropWatcherBehavior_NoChild":'Could not find child of list with id "{0}"',"CascadingDropDown_MethodTimeout":"[Method timeout]","ExtenderBase_PageNotRegisteredForCallbacks":"This Page has not been registered for callbacks","Animation_NoDynamicPropertyFound":'AjaxControlToolkit.Animation.createAnimation found no property corresponding to "{0}" or "{1}"',"Animation_InvalidBaseType":"AjaxControlToolkit.Animation.registerAnimation can only register types that inherit from AjaxControlToolkit.Animation.Animation","ResizableControlBehavior_InvalidHandler":"{0} handler not a function, function name, or function text","Animation_InvalidColor":'Color must be a 7-character hex representation (e.g. #246ACF), not "{0}"',"PasswordStrength_RemainingMixedCase":"Mixed case characters","CascadingDropDown_NoParentElement":'Failed to find parent element "{0}"',"ValidatorCallout_DefaultErrorMessage":"This control is invalid","ReorderList_DropWatcherBehavior_CallbackError":"Reorder failed, see details below.\\r\\n\\r\\n{0}","PopupControl_NoDefaultProperty":'No default property supported for control "{0}" of type "{1}"',"PopupExtender_NoParentElement":'Couldn\'t find parent element "{0}"',"PasswordStrength_RemainingNumbers":"{0} more numbers","ResizableControlBehavior_CannotChangeProperty":"Changes to {0} not supported","Common_InvalidPaddingUnit":'A unit type of "{0}" is invalid for parsePadding',"ExtenderBase_ControlNotRegisteredForCallbacks":"This Control has not been registered for callbacks","Calendar_Today":"Today: {0}","Common_DateTime_InvalidFormat":"Invalid format","ListSearch_DefaultPrompt":"Type to search","CollapsiblePanel_NoControlID":'Failed to find element "{0}"',"PasswordStrength_DefaultStrengthDescriptions":"NonExistent;Very Weak;Weak;Poor;Almost OK;Barely Acceptable;Average;Good;Strong;Excellent;Unbreakable!","Animation_UknownAnimationName":'AjaxControlToolkit.Animation.createAnimation could not find an Animation corresponding to the name "{0}"',"ExtenderBase_InvalidClientStateType":"saveClientState must return a value of type String","Rating_CallbackError":"An unhandled exception has occurred:\\r\\n{0}","Tabs_OwnerExpected":"owner must be set before initialize","DynamicPopulate_WebServiceTimeout":"Web service call timed out","Animation_MissingAnimationName":"AjaxControlToolkit.Animation.createAnimation requires an object with an AnimationName property","Tabs_ActiveTabArgumentOutOfRange":"Argument is not a member of the tabs collection","AlwaysVisible_ElementRequired":"AjaxControlToolkit.AlwaysVisibleControlBehavior must have an element","Slider_NoSizeProvided":"Please set valid values for the height and width attributes in the slider's CSS classes","DynamicPopulate_WebServiceError":"Web Service call failed: {0}","PasswordStrength_StrengthPrompt":"Strength: ","PasswordStrength_RemainingCharacters":"{0} more characters","PasswordStrength_Satisfied":"Nothing more required","Animation_NoPropertyFound":'AjaxControlToolkit.Animation.createAnimation found no property corresponding to "{0}"',"PasswordStrength_InvalidStrengthDescriptionStyles":"Text Strength description style classes must match the number of text descriptions.","PasswordStrength_GetHelpRequirements":"Get help on password requirements","PasswordStrength_InvalidStrengthDescriptions":"Invalid number of text strength descriptions specified","Tabs_PropertySetAfterInitialization":"{0} cannot be changed after initialization","CascadingDropDown_MethodError":"[Method error {0}]","Common_UnitHasNoDigits":"No digits","Common_DateTime_InvalidTimeSpan":'"{0}" is not a valid TimeSpan format',"Animation_CannotNestSequence":"AjaxControlToolkit.Animation.SequenceAnimation cannot be nested inside AjaxControlToolkit.Animation.ParallelAnimation","Shared_BrowserSecurityPreventsPaste":"Your browser security settings don't permit the automatic execution of paste operations. Please use the keyboard shortcut Ctrl+V instead."};
Type.registerNamespace("AjaxControlToolkit");AjaxControlToolkit.ScrollBars=function(){};
AjaxControlToolkit.ScrollBars.prototype={None:0,Horizontal:1,Vertical:2,Both:3,Auto:4};
AjaxControlToolkit.ScrollBars.registerEnum("AjaxControlToolkit.ScrollBars",true);
AjaxControlToolkit.TabContainer=function(A){AjaxControlToolkit.TabContainer.initializeBase(this,[A]);
this._cachedActiveTabIndex=-1;this._activeTabIndex=-1;this._scrollBars=AjaxControlToolkit.ScrollBars.None;
this._tabs=null;this._header=null;this._body=null;this._loaded=false;this._autoPostBackId=null;
this._app_onload$delegate=Function.createDelegate(this,this._app_onload);};AjaxControlToolkit.TabContainer.prototype={add_activeTabChanged:function(A){this.get_events().addHandler("activeTabChanged",A);
},remove_activeTabChanged:function(A){this.get_events().removeHandler("activeTabChanged",A);
},raiseActiveTabChanged:function(){var A=this.get_events().getHandler("activeTabChanged");
if(A){A(this,Sys.EventArgs.Empty);}if(this._autoPostBackId){__doPostBack(this._autoPostBackId,"activeTabChanged:"+this.get_activeTabIndex());
}},get_activeTabIndex:function(){if(this._cachedActiveTabIndex>-1){return this._cachedActiveTabIndex;
}return this._activeTabIndex;},set_activeTabIndex:function(A){if(!this.get_isInitialized()){this._cachedActiveTabIndex=A;
}else{if(A<-1||A>=this.get_tabs().length){throw Error.argumentOutOfRange("value");
}if(this._activeTabIndex!=-1){this.get_tabs()[this._activeTabIndex]._set_active(false);
}this._activeTabIndex=A;if(this._activeTabIndex!=-1){this.get_tabs()[this._activeTabIndex]._set_active(true);
}if(this._loaded){this.raiseActiveTabChanged();}this.raisePropertyChanged("activeTabIndex");
}},get_tabs:function(){if(this._tabs==null){this._tabs=[];}return this._tabs;},get_activeTab:function(){if(this._activeTabIndex>-1){return this.get_tabs()[this._activeTabIndex];
}return null;},set_activeTab:function(A){var B=Array.indexOf(this.get_tabs(),A);if(B==-1){throw Error.argument("value",AjaxControlToolkit.Resources.Tabs_ActiveTabArgumentOutOfRange);
}this.set_activeTabIndex(B);},get_autoPostBackId:function(){return this._autoPostBackId;
},set_autoPostBackId:function(A){this._autoPostBackId=A;},get_scrollBars:function(){return this._scrollBars;
},set_scrollBars:function(A){if(this._scrollBars!=A){this._scrollBars=A;this._invalidate();
this.raisePropertyChanged("scrollBars");}},initialize:function(){AjaxControlToolkit.TabContainer.callBaseMethod(this,"initialize");
var B=this.get_element();var C=this._header=$get(this.get_id()+"_header");var A=this._body=$get(this.get_id()+"_body");
$common.addCssClasses(B,["ajax__tab_container","ajax__tab_default"]);Sys.UI.DomElement.addCssClass(C,"ajax__tab_header");
Sys.UI.DomElement.addCssClass(A,"ajax__tab_body");this._invalidate();Sys.Application.add_load(this._app_onload$delegate);
},dispose:function(){Sys.Application.remove_load(this._app_onload$delegate);AjaxControlToolkit.TabContainer.callBaseMethod(this,"dispose");
},getFirstTab:function(C){var A=this.get_tabs();for(var B=0;B<A.length;B++){if(C||A[B].get_enabled()){return A[B];
}}return null;},getLastTab:function(C){var A=this.get_tabs();for(var B=A.length-1;
B>=0;B--){if(C||A[B].get_enabled()){return A[B];}}return null;},getNextTab:function(E){var A=this.get_tabs();
var B=this.get_activeTabIndex();for(var D=1;D<A.length;D++){var C=(B+D)%A.length;
var F=A[C];if(E||F.get_enabled()){return F;}}return null;},getPreviousTab:function(E){var A=this.get_tabs();
var B=this.get_activeTabIndex();for(var D=1;D<A.length;D++){var C=(A.length+(B-D))%A.length;
var F=A[C];if(E||F.get_enabled()){return F;}}return null;},getNearestTab:function(){var A=this.getPreviousTab(false);
var B=this.getNextTab(false);if(A&&A.get_tabIndex()<this._activeTabIndex){return A;
}else{if(B&&B.get_tabIndex()>this._activeTabIndex){return B;}}return null;},saveClientState:function(){var A=this.get_tabs();
var B=[];for(var C=0;C<A.length;C++){Array.add(B,A[C].get_enabled());}var D={ActiveTabIndex:this._activeTabIndex,TabState:B};
return Sys.Serialization.JavaScriptSerializer.serialize(D);},_invalidate:function(){if(this.get_isInitialized()){$common.removeCssClasses(this._body,["ajax__scroll_horiz","ajax__scroll_vert","ajax__scroll_both","ajax__scroll_auto"]);
switch(this._scrollBars){case AjaxControlToolkit.ScrollBars.Horizontal:Sys.UI.DomElement.addCssClass(this._body,"ajax__scroll_horiz");
break;case AjaxControlToolkit.ScrollBars.Vertical:Sys.UI.DomElement.addCssClass(this._body,"ajax__scroll_vert");
break;case AjaxControlToolkit.ScrollBars.Both:Sys.UI.DomElement.addCssClass(this._body,"ajax__scroll_both");
break;case AjaxControlToolkit.ScrollBars.Auto:Sys.UI.DomElement.addCssClass(this._body,"ajax__scroll_auto");
break;}}},_app_onload:function(A,B){if(this._cachedActiveTabIndex!=-1){this.set_activeTabIndex(this._cachedActiveTabIndex);
this._cachedActiveTabIndex=-1;}this._loaded=true;}};AjaxControlToolkit.TabContainer.registerClass("AjaxControlToolkit.TabContainer",AjaxControlToolkit.ControlBase);
AjaxControlToolkit.TabPanel=function(A){AjaxControlToolkit.TabPanel.initializeBase(this,[A]);
this._active=false;this._tab=null;this._headerOuter=null;this._headerInner=null;this._header=null;
this._owner=null;this._enabled=true;this._tabIndex=-1;this._dynamicContextKey=null;
this._dynamicServicePath=null;this._dynamicServiceMethod=null;this._dynamicPopulateBehavior=null;
this._scrollBars=AjaxControlToolkit.ScrollBars.None;this._header_onclick$delegate=Function.createDelegate(this,this._header_onclick);
this._header_onmouseover$delegate=Function.createDelegate(this,this._header_onmouseover);
this._header_onmouseout$delegate=Function.createDelegate(this,this._header_onmouseout);
this._header_onmousedown$delegate=Function.createDelegate(this,this._header_onmousedown);
this._dynamicPopulate_onpopulated$delegate=Function.createDelegate(this,this._dynamicPopulate_onpopulated);
this._oncancel$delegate=Function.createDelegate(this,this._oncancel);};AjaxControlToolkit.TabPanel.prototype={add_click:function(A){this.get_events().addHandler("click",A);
},remove_click:function(A){this.get_events().removeHandler("click",A);},raiseClick:function(){var A=this.get_events().getHandler("click");
if(A){A(this,Sys.EventArgs.Empty);}},add_populating:function(A){this.get_events().addHandler("populating",A);
},remove_populating:function(A){this.get_events().removeHandler("populating",A);},raisePopulating:function(){var A=this.get_events().getHandler("populating");
if(A){A(this,Sys.EventArgs.Empty);}},add_populated:function(A){this.get_events().addHandler("populated",A);
},remove_populated:function(A){this.get_events().removeHandler("populated",A);},raisePopulated:function(){var A=this.get_events().getHandler("populated");
if(A){A(this,Sys.EventArgs.Empty);}},get_headerText:function(){if(this.get_isInitialized()){return this._header.innerHTML;
}return"";},set_headerText:function(A){if(!this.get_isInitialized()){throw Error.invalidOperation(String.format(AjaxControlToolkit.Resources.Tabs_PropertySetBeforeInitialization,"headerText"));
}if(this._headerText!=A){this._headerTab.innerHTML=A;this.raisePropertyChanged("headerText");
}},get_headerTab:function(){return this._header;},set_headerTab:function(A){if(this._header!=A){if(this.get_isInitialized()){throw Error.invalidOperation(String.format(AjaxControlToolkit.Resources.Tabs_PropertySetAfterInitialization,"headerTab"));
}this._header=A;this.raisePropertyChanged("value");}},get_enabled:function(){return this._enabled;
},set_enabled:function(A){if(A!=this._enabled){this._enabled=A;if(this.get_isInitialized()){if(!this._enabled){this._hide();
}else{this._show();}}this.raisePropertyChanged("enabled");}},get_owner:function(){return this._owner;
},set_owner:function(A){if(this._owner!=A){if(this.get_isInitialized()){throw Error.invalidOperation(String.format(AjaxControlToolkit.Resources.Tabs_PropertySetAfterInitialization,"owner"));
}this._owner=A;this.raisePropertyChanged("owner");}},get_scrollBars:function(){return this._scrollBars;
},set_scrollBars:function(A){if(this._scrollBars!=A){this._scrollBars=A;this.raisePropertyChanged("scrollBars");
}},get_tabIndex:function(){return this._tabIndex;},get_dynamicContextKey:function(){return this._dynamicContextKey;
},set_dynamicContextKey:function(A){if(this._dynamicContextKey!=A){this._dynamicContextKey=A;
this.raisePropertyChanged("dynamicContextKey");}},get_dynamicServicePath:function(){return this._dynamicServicePath;
},set_dynamicServicePath:function(A){if(this._dynamicServicePath!=A){this._dynamicServicePath=A;
this.raisePropertyChanged("dynamicServicePath");}},get_dynamicServiceMethod:function(){return this._dynamicServiceMethod;
},set_dynamicServiceMethod:function(A){if(this._dynamicServiceMethod!=A){this._dynamicServiceMethod=A;
this.raisePropertyChanged("dynamicServiceMethod");}},_get_active:function(){return this._active;
},_set_active:function(A){this._active=A;if(A){this._activate();}else{this._deactivate();
}},initialize:function(){AjaxControlToolkit.TabPanel.callBaseMethod(this,"initialize");
var A=this.get_owner();if(!A){throw Error.invalidOperation(AjaxControlToolkit.Resources.Tabs_OwnerExpected);
}this._tabIndex=A.get_tabs().length;Array.add(A.get_tabs(),this);this._headerOuterWrapper=document.createElement("span");
this._headerInnerWrapper=document.createElement("span");this._tab=document.createElement("span");
this._header.parentNode.replaceChild(this._tab,this._header);this._tab.appendChild(this._headerOuterWrapper);
this._headerOuterWrapper.appendChild(this._headerInnerWrapper);this._headerInnerWrapper.appendChild(this._header);
$addHandlers(this._header,{click:this._header_onclick$delegate,mouseover:this._header_onmouseover$delegate,mouseout:this._header_onmouseout$delegate,mousedown:this._header_onmousedown$delegate,dragstart:this._oncancel$delegate,selectstart:this._oncancel$delegate,select:this._oncancel$delegate});
Sys.UI.DomElement.addCssClass(this._headerOuterWrapper,"ajax__tab_outer");Sys.UI.DomElement.addCssClass(this._headerInnerWrapper,"ajax__tab_inner");
Sys.UI.DomElement.addCssClass(this._header,"ajax__tab_tab");Sys.UI.DomElement.addCssClass(this.get_element(),"ajax__tab_panel");
if(!this._enabled){this._hide();}},dispose:function(){if(this._dynamicPopulateBehavior){this._dynamicPopulateBehavior.dispose();
this._dynamicPopulateBehavior=null;}$common.removeHandlers(this._header,{click:this._header_onclick$delegate,mouseover:this._header_onmouseover$delegate,mouseout:this._header_onmouseout$delegate,mousedown:this._header_onmousedown$delegate,dragstart:this._oncancel$delegate,selectstart:this._oncancel$delegate,select:this._oncancel$delegate});
AjaxControlToolkit.TabPanel.callBaseMethod(this,"dispose");},populate:function(A){if(this._dynamicPopulateBehavior&&(this._dynamicPopulateBehavior.get_element()!=this.get_element())){this._dynamicPopulateBehavior.dispose();
this._dynamicPopulateBehavior=null;}if(!this._dynamicPopulateBehavior&&this._dynamicServiceMethod){this._dynamicPopulateBehavior=$create(AjaxControlToolkit.DynamicPopulateBehavior,{"ContextKey":this._dynamicContextKey,"ServicePath":this._dynamicServicePath,"ServiceMethod":this._dynamicServiceMethod},{"populated":this._dynamicPopulate_onpopulated$delegate},null,this.get_element());
}if(this._dynamicPopulateBehavior){this.raisePopulating();this._dynamicPopulateBehavior.populate(A?A:this._dynamicContextKey);
}},_activate:function(){var A=this.get_element();$common.setVisible(A,true);Sys.UI.DomElement.addCssClass(this._tab,"ajax__tab_active");
this.populate();this._show();this._owner.get_element().style.visibility="visible";
},_deactivate:function(){var A=this.get_element();$common.setVisible(A,false);Sys.UI.DomElement.removeCssClass(this._tab,"ajax__tab_active");
},_show:function(){this._tab.style.display="";},_hide:function(){this._tab.style.display="none";
if(this._get_active()){var A=this._owner.getNearestTab(false);if(!!A){this._owner.set_activeTab(A);
}}this._deactivate();},_header_onclick:function(A){this.raiseClick();this.get_owner().set_activeTab(this);
},_header_onmouseover:function(A){Sys.UI.DomElement.addCssClass(this._tab,"ajax__tab_hover");
},_header_onmouseout:function(A){Sys.UI.DomElement.removeCssClass(this._tab,"ajax__tab_hover");
},_header_onmousedown:function(A){A.preventDefault();},_oncancel:function(A){A.stopPropagation();
A.preventDefault();},_dynamicPopulate_onpopulated:function(A,B){this.raisePopulated();
}};AjaxControlToolkit.TabPanel.registerClass("AjaxControlToolkit.TabPanel",Sys.UI.Control);
Sys.Timer=function(){Sys.Timer.initializeBase(this);this._interval=1000;this._enabled=false;
this._timer=null;};Sys.Timer.prototype={get_interval:function(){return this._interval;
},set_interval:function(A){if(this._interval!==A){this._interval=A;this.raisePropertyChanged("interval");
if(!this.get_isUpdating()&&(this._timer!==null)){this._stopTimer();this._startTimer();
}}},get_enabled:function(){return this._enabled;},set_enabled:function(A){if(A!==this.get_enabled()){this._enabled=A;
this.raisePropertyChanged("enabled");if(!this.get_isUpdating()){if(A){this._startTimer();
}else{this._stopTimer();}}}},add_tick:function(A){this.get_events().addHandler("tick",A);
},remove_tick:function(A){this.get_events().removeHandler("tick",A);},dispose:function(){this.set_enabled(false);
this._stopTimer();Sys.Timer.callBaseMethod(this,"dispose");},updated:function(){Sys.Timer.callBaseMethod(this,"updated");
if(this._enabled){this._stopTimer();this._startTimer();}},_timerCallback:function(){var A=this.get_events().getHandler("tick");
if(A){A(this,Sys.EventArgs.Empty);}},_startTimer:function(){this._timer=window.setInterval(Function.createDelegate(this,this._timerCallback),this._interval);
},_stopTimer:function(){window.clearInterval(this._timer);this._timer=null;}};Sys.Timer.descriptor={properties:[{name:"interval",type:Number},{name:"enabled",type:Boolean}],events:[{name:"tick"}]};
Sys.Timer.registerClass("Sys.Timer",Sys.Component);Type.registerNamespace("AjaxControlToolkit.Animation");
var $AA=AjaxControlToolkit.Animation;$AA.registerAnimation=function(A,B){if(B&&((B===$AA.Animation)||(B.inheritsFrom&&B.inheritsFrom($AA.Animation)))){if(!$AA.__animations){$AA.__animations={};
}$AA.__animations[A.toLowerCase()]=B;B.play=function(){var D=new B();B.apply(D,arguments);
D.initialize();var C=Function.createDelegate(D,function(){D.remove_ended(C);C=null;
D.dispose();});D.add_ended(C);D.play();};}else{throw Error.argumentType("type",B,$AA.Animation,AjaxControlToolkit.Resources.Animation_InvalidBaseType);
}};$AA.buildAnimation=function(A,C){if(!A||A===""){return null;}var D;A="("+A+")";
if(!Sys.Debug.isDebug){try{D=Sys.Serialization.JavaScriptSerializer.deserialize(A);
}catch(B){}}else{D=Sys.Serialization.JavaScriptSerializer.deserialize(A);}return $AA.createAnimation(D,C);
};$AA.createAnimation=function(A,G){if(!A||!A.AnimationName){throw Error.argument("obj",AjaxControlToolkit.Resources.Animation_MissingAnimationName);
}var D=$AA.__animations[A.AnimationName.toLowerCase()];if(!D){throw Error.argument("type",String.format(AjaxControlToolkit.Resources.Animation_UknownAnimationName,A.AnimationName));
}var M=new D();if(G){M.set_target(G);}if(A.AnimationChildren&&A.AnimationChildren.length){if($AA.ParentAnimation.isInstanceOfType(M)){for(var K=0;
K<A.AnimationChildren.length;K++){var L=$AA.createAnimation(A.AnimationChildren[K]);
if(L){M.add(L);}}}else{throw Error.argument("obj",String.format(AjaxControlToolkit.Resources.Animation_ChildrenNotAllowed,D.getName()));
}}var E=D.__animationProperties;if(!E){D.__animationProperties={};D.resolveInheritance();
for(var H in D.prototype){if(H.startsWith("set_")){D.__animationProperties[H.substr(4).toLowerCase()]=H;
}}delete D.__animationProperties["id"];E=D.__animationProperties;}for(var I in A){var B=I.toLowerCase();
if(B=="animationname"||B=="animationchildren"){continue;}var C=A[I];var F=E[B];if(F&&String.isInstanceOfType(F)&&M[F]){if(!Sys.Debug.isDebug){try{M[F](C);
}catch(J){}}else{M[F](C);}}else{if(B.endsWith("script")){F=E[B.substr(0,I.length-6)];
if(F&&String.isInstanceOfType(F)&&M[F]){M.DynamicProperties[F]=C;}else{if(Sys.Debug.isDebug){throw Error.argument("obj",String.format(AjaxControlToolkit.Resources.Animation_NoDynamicPropertyFound,I,I.substr(0,I.length-5)));
}}}else{if(Sys.Debug.isDebug){throw Error.argument("obj",String.format(AjaxControlToolkit.Resources.Animation_NoPropertyFound,I));
}}}}return M;};$AA.Animation=function(B,C,A){$AA.Animation.initializeBase(this);this._duration=1;
this._fps=25;this._target=null;this._tickHandler=null;this._timer=null;this._percentComplete=0;
this._percentDelta=null;this._owner=null;this._parentAnimation=null;this.DynamicProperties={};
if(B){this.set_target(B);}if(C){this.set_duration(C);}if(A){this.set_fps(A);}};$AA.Animation.prototype={dispose:function(){if(this._timer){this._timer.dispose();
this._timer=null;}this._tickHandler=null;this._target=null;$AA.Animation.callBaseMethod(this,"dispose");
},play:function(){if(!this._owner){var A=true;if(!this._timer){A=false;if(!this._tickHandler){this._tickHandler=Function.createDelegate(this,this._onTimerTick);
}this._timer=new Sys.Timer();this._timer.add_tick(this._tickHandler);this.onStart();
this._timer.set_interval(1000/this._fps);this._percentDelta=100/(this._duration*this._fps);
this._updatePercentComplete(0,true);}this._timer.set_enabled(true);this.raisePropertyChanged("isPlaying");
if(!A){this.raisePropertyChanged("isActive");}}},pause:function(){if(!this._owner){if(this._timer){this._timer.set_enabled(false);
this.raisePropertyChanged("isPlaying");}}},stop:function(B){if(!this._owner){var A=this._timer;
this._timer=null;if(A){A.dispose();if(this._percentComplete!==100){this._percentComplete=100;
this.raisePropertyChanged("percentComplete");if(B||B===undefined){this.onStep(100);
}}this.onEnd();this.raisePropertyChanged("isPlaying");this.raisePropertyChanged("isActive");
}}},onStart:function(){this.raiseStarted();for(var property in this.DynamicProperties){try{this[property](eval(this.DynamicProperties[property]));
}catch(ex){if(Sys.Debug.isDebug){throw ex;}}}},onStep:function(A){this.setValue(this.getAnimatedValue(A));
},onEnd:function(){this.raiseEnded();},getAnimatedValue:function(A){throw Error.notImplemented();
},setValue:function(A){throw Error.notImplemented();},interpolate:function(A,B,C){return A+(B-A)*(C/100);
},_onTimerTick:function(){this._updatePercentComplete(this._percentComplete+this._percentDelta,true);
},_updatePercentComplete:function(A,B){if(A>100){A=100;}this._percentComplete=A;this.raisePropertyChanged("percentComplete");
if(B){this.onStep(A);}if(A===100){this.stop(false);}},setOwner:function(A){this._owner=A;
},raiseStarted:function(){var A=this.get_events().getHandler("started");if(A){A(this,Sys.EventArgs.Empty);
}},add_started:function(A){this.get_events().addHandler("started",A);},remove_started:function(A){this.get_events().removeHandler("started",A);
},raiseEnded:function(){var A=this.get_events().getHandler("ended");if(A){A(this,Sys.EventArgs.Empty);
}},add_ended:function(A){this.get_events().addHandler("ended",A);},remove_ended:function(A){this.get_events().removeHandler("ended",A);
},get_target:function(){if(!this._target&&this._parentAnimation){return this._parentAnimation.get_target();
}return this._target;},set_target:function(A){if(this._target!=A){this._target=A;
this.raisePropertyChanged("target");}},set_animationTarget:function(D){var B=null;
var C=$get(D);if(C){B=C;}else{var A=$find(D);if(A){C=A.get_element();if(C){B=C;}}}if(B){this.set_target(B);
}else{throw Error.argument("id",String.format(AjaxControlToolkit.Resources.Animation_TargetNotFound,D));
}},get_duration:function(){return this._duration;},set_duration:function(A){A=this._getFloat(A);
if(this._duration!=A){this._duration=A;this.raisePropertyChanged("duration");}},get_fps:function(){return this._fps;
},set_fps:function(A){A=this._getInteger(A);if(this.fps!=A){this._fps=A;this.raisePropertyChanged("fps");
}},get_isActive:function(){return(this._timer!==null);},get_isPlaying:function(){return(this._timer!==null)&&this._timer.get_enabled();
},get_percentComplete:function(){return this._percentComplete;},_getBoolean:function(A){if(String.isInstanceOfType(A)){return Boolean.parse(A);
}return A;},_getInteger:function(A){if(String.isInstanceOfType(A)){return parseInt(A);
}return A;},_getFloat:function(A){if(String.isInstanceOfType(A)){return parseFloat(A);
}return A;},_getEnum:function(A,B){if(String.isInstanceOfType(A)&&B&&B.parse){return B.parse(A);
}return A;}};$AA.Animation.registerClass("AjaxControlToolkit.Animation.Animation",Sys.Component);
$AA.registerAnimation("animation",$AA.Animation);$AA.ParentAnimation=function(C,E,B,A){$AA.ParentAnimation.initializeBase(this,[C,E,B]);
this._animations=[];if(A&&A.length){for(var D=0;D<A.length;D++){this.add(A[D]);}}};
$AA.ParentAnimation.prototype={initialize:function(){$AA.ParentAnimation.callBaseMethod(this,"initialize");
if(this._animations){for(var A=0;A<this._animations.length;A++){var B=this._animations[A];
if(B&&!B.get_isInitialized){B.initialize();}}}},dispose:function(){this.clear();this._animations=null;
$AA.ParentAnimation.callBaseMethod(this,"dispose");},get_animations:function(){return this._animations;
},add:function(A){if(this._animations){if(A){A._parentAnimation=this;}Array.add(this._animations,A);
this.raisePropertyChanged("animations");}},remove:function(A){if(this._animations){if(A){A.dispose();
}Array.remove(this._animations,A);this.raisePropertyChanged("animations");}},removeAt:function(B){if(this._animations){var A=this._animations[B];
if(A){A.dispose();}Array.removeAt(this._animations,B);this.raisePropertyChanged("animations");
}},clear:function(){if(this._animations){for(var A=this._animations.length-1;A>=0;
A--){this._animations[A].dispose();this._animations[A]=null;}Array.clear(this._animations);
this._animations=[];this.raisePropertyChanged("animations");}}};$AA.ParentAnimation.registerClass("AjaxControlToolkit.Animation.ParentAnimation",$AA.Animation);
$AA.registerAnimation("parent",$AA.ParentAnimation);$AA.ParallelAnimation=function(C,D,B,A){$AA.ParallelAnimation.initializeBase(this,[C,D,B,A]);
};$AA.ParallelAnimation.prototype={add:function(A){$AA.ParallelAnimation.callBaseMethod(this,"add",[A]);
A.setOwner(this);},onStart:function(){$AA.ParallelAnimation.callBaseMethod(this,"onStart");
var A=this.get_animations();for(var B=0;B<A.length;B++){A[B].onStart();}},onStep:function(C){var A=this.get_animations();
for(var B=0;B<A.length;B++){A[B].onStep(C);}},onEnd:function(){var A=this.get_animations();
for(var B=0;B<A.length;B++){A[B].onEnd();}$AA.ParallelAnimation.callBaseMethod(this,"onEnd");
}};$AA.ParallelAnimation.registerClass("AjaxControlToolkit.Animation.ParallelAnimation",$AA.ParentAnimation);
$AA.registerAnimation("parallel",$AA.ParallelAnimation);$AA.SequenceAnimation=function(C,E,B,A,D){$AA.SequenceAnimation.initializeBase(this,[C,E,B,A]);
this._handler=null;this._paused=false;this._playing=false;this._index=0;this._remainingIterations=0;
this._iterations=(D!==undefined)?D:1;};$AA.SequenceAnimation.prototype={dispose:function(){this._handler=null;
$AA.SequenceAnimation.callBaseMethod(this,"dispose");},stop:function(){if(this._playing){var A=this.get_animations();
if(this._index<A.length){A[this._index].remove_ended(this._handler);for(var B=this._index;
B<A.length;B++){A[B].stop();}}this._playing=false;this._paused=false;this.raisePropertyChanged("isPlaying");
this.onEnd();}},pause:function(){if(this.get_isPlaying()){var A=this.get_animations()[this._index];
if(A!=null){A.pause();}this._paused=true;this.raisePropertyChanged("isPlaying");}},play:function(){var A=this.get_animations();
if(!this._playing){this._playing=true;if(this._paused){this._paused=false;var B=A[this._index];
if(B!=null){B.play();this.raisePropertyChanged("isPlaying");}}else{this.onStart();
this._index=0;var C=A[this._index];if(C){C.add_ended(this._handler);C.play();this.raisePropertyChanged("isPlaying");
}else{this.stop();}}}},onStart:function(){$AA.SequenceAnimation.callBaseMethod(this,"onStart");
this._remainingIterations=this._iterations-1;if(!this._handler){this._handler=Function.createDelegate(this,this._onEndAnimation);
}},_onEndAnimation:function(){var A=this.get_animations();var B=A[this._index++];
if(B){B.remove_ended(this._handler);}if(this._index<A.length){var D=A[this._index];
D.add_ended(this._handler);D.play();}else{if(this._remainingIterations>=1||this._iterations<=0){this._remainingIterations--;
this._index=0;var C=A[0];C.add_ended(this._handler);C.play();}else{this.stop();}}},onStep:function(A){throw Error.invalidOperation(AjaxControlToolkit.Resources.Animation_CannotNestSequence);
},onEnd:function(){this._remainingIterations=0;$AA.SequenceAnimation.callBaseMethod(this,"onEnd");
},get_isActive:function(){return true;},get_isPlaying:function(){return this._playing&&!this._paused;
},get_iterations:function(){return this._iterations;},set_iterations:function(A){A=this._getInteger(A);
if(this._iterations!=A){this._iterations=A;this.raisePropertyChanged("iterations");
}},get_isInfinite:function(){return this._iterations<=0;}};$AA.SequenceAnimation.registerClass("AjaxControlToolkit.Animation.SequenceAnimation",$AA.ParentAnimation);
$AA.registerAnimation("sequence",$AA.SequenceAnimation);$AA.SelectionAnimation=function(C,D,B,A){$AA.SelectionAnimation.initializeBase(this,[C,D,B,A]);
this._selectedIndex=-1;this._selected=null;};$AA.SelectionAnimation.prototype={getSelectedIndex:function(){throw Error.notImplemented();
},onStart:function(){$AA.SelectionAnimation.callBaseMethod(this,"onStart");var A=this.get_animations();
this._selectedIndex=this.getSelectedIndex();if(this._selectedIndex>=0&&this._selectedIndex<A.length){this._selected=A[this._selectedIndex];
if(this._selected){this._selected.setOwner(this);this._selected.onStart();}}},onStep:function(A){if(this._selected){this._selected.onStep(A);
}},onEnd:function(){if(this._selected){this._selected.onEnd();this._selected.setOwner(null);
}this._selected=null;this._selectedIndex=null;$AA.SelectionAnimation.callBaseMethod(this,"onEnd");
}};$AA.SelectionAnimation.registerClass("AjaxControlToolkit.Animation.SelectionAnimation",$AA.ParentAnimation);
$AA.registerAnimation("selection",$AA.SelectionAnimation);$AA.ConditionAnimation=function(D,E,B,A,C){$AA.ConditionAnimation.initializeBase(this,[D,E,B,A]);
this._conditionScript=C;};$AA.ConditionAnimation.prototype={getSelectedIndex:function(){var selected=-1;
if(this._conditionScript&&this._conditionScript.length>0){try{selected=eval(this._conditionScript)?0:1;
}catch(ex){}}return selected;},get_conditionScript:function(){return this._conditionScript;
},set_conditionScript:function(A){if(this._conditionScript!=A){this._conditionScript=A;
this.raisePropertyChanged("conditionScript");}}};$AA.ConditionAnimation.registerClass("AjaxControlToolkit.Animation.ConditionAnimation",$AA.SelectionAnimation);
$AA.registerAnimation("condition",$AA.ConditionAnimation);$AA.CaseAnimation=function(D,E,B,A,C){$AA.CaseAnimation.initializeBase(this,[D,E,B,A]);
this._selectScript=C;};$AA.CaseAnimation.prototype={getSelectedIndex:function(){var selected=-1;
if(this._selectScript&&this._selectScript.length>0){try{var result=eval(this._selectScript);
if(result!==undefined){selected=result;}}catch(ex){}}return selected;},get_selectScript:function(){return this._selectScript;
},set_selectScript:function(A){if(this._selectScript!=A){this._selectScript=A;this.raisePropertyChanged("selectScript");
}}};$AA.CaseAnimation.registerClass("AjaxControlToolkit.Animation.CaseAnimation",$AA.SelectionAnimation);
$AA.registerAnimation("case",$AA.CaseAnimation);$AA.FadeEffect=function(){throw Error.invalidOperation();
};$AA.FadeEffect.prototype={FadeIn:0,FadeOut:1};$AA.FadeEffect.registerEnum("AjaxControlToolkit.Animation.FadeEffect",false);
$AA.FadeAnimation=function(D,G,B,F,A,E,C){$AA.FadeAnimation.initializeBase(this,[D,G,B]);
this._effect=(F!==undefined)?F:$AA.FadeEffect.FadeIn;this._max=(E!==undefined)?E:1;
this._min=(A!==undefined)?A:0;this._start=this._min;this._end=this._max;this._layoutCreated=false;
this._forceLayoutInIE=(C===undefined||C===null)?true:C;this._currentTarget=null;this._resetOpacities();
};$AA.FadeAnimation.prototype={_resetOpacities:function(){if(this._effect==$AA.FadeEffect.FadeIn){this._start=this._min;
this._end=this._max;}else{this._start=this._max;this._end=this._min;}},_createLayout:function(){var C=this._currentTarget;
if(C){var B=$common.getCurrentStyle(C,"width");var A=$common.getCurrentStyle(C,"height");
var D=$common.getCurrentStyle(C,"backgroundColor");if((!B||B==""||B=="auto")&&(!A||A==""||A=="auto")){C.style.width=C.offsetWidth+"px";
}if(!D||D==""||D=="transparent"||D=="rgba(0, 0, 0, 0)"){C.style.backgroundColor=$common.getInheritedBackgroundColor(C);
}this._layoutCreated=true;}},onStart:function(){$AA.FadeAnimation.callBaseMethod(this,"onStart");
this._currentTarget=this.get_target();this.setValue(this._start);if(this._forceLayoutInIE&&!this._layoutCreated&&Sys.Browser.agent==Sys.Browser.InternetExplorer){this._createLayout();
}},getAnimatedValue:function(A){return this.interpolate(this._start,this._end,A);
},setValue:function(A){if(this._currentTarget){$common.setElementOpacity(this._currentTarget,A);
}},get_effect:function(){return this._effect;},set_effect:function(A){A=this._getEnum(A,$AA.FadeEffect);
if(this._effect!=A){this._effect=A;this._resetOpacities();this.raisePropertyChanged("effect");
}},get_minimumOpacity:function(){return this._min;},set_minimumOpacity:function(A){A=this._getFloat(A);
if(this._min!=A){this._min=A;this._resetOpacities();this.raisePropertyChanged("minimumOpacity");
}},get_maximumOpacity:function(){return this._max;},set_maximumOpacity:function(A){A=this._getFloat(A);
if(this._max!=A){this._max=A;this._resetOpacities();this.raisePropertyChanged("maximumOpacity");
}},get_forceLayoutInIE:function(){return this._forceLayoutInIE;},set_forceLayoutInIE:function(A){A=this._getBoolean(A);
if(this._forceLayoutInIE!=A){this._forceLayoutInIE=A;this.raisePropertyChanged("forceLayoutInIE");
}},set_startValue:function(A){A=this._getFloat(A);this._start=A;}};$AA.FadeAnimation.registerClass("AjaxControlToolkit.Animation.FadeAnimation",$AA.Animation);
$AA.registerAnimation("fade",$AA.FadeAnimation);$AA.FadeInAnimation=function(C,F,A,E,D,B){$AA.FadeInAnimation.initializeBase(this,[C,F,A,$AA.FadeEffect.FadeIn,E,D,B]);
};$AA.FadeInAnimation.prototype={onStart:function(){$AA.FadeInAnimation.callBaseMethod(this,"onStart");
if(this._currentTarget){this.set_startValue($common.getElementOpacity(this._currentTarget));
}}};$AA.FadeInAnimation.registerClass("AjaxControlToolkit.Animation.FadeInAnimation",$AA.FadeAnimation);
$AA.registerAnimation("fadeIn",$AA.FadeInAnimation);$AA.FadeOutAnimation=function(C,F,A,E,D,B){$AA.FadeOutAnimation.initializeBase(this,[C,F,A,$AA.FadeEffect.FadeOut,E,D,B]);
};$AA.FadeOutAnimation.prototype={onStart:function(){$AA.FadeOutAnimation.callBaseMethod(this,"onStart");
if(this._currentTarget){this.set_startValue($common.getElementOpacity(this._currentTarget));
}}};$AA.FadeOutAnimation.registerClass("AjaxControlToolkit.Animation.FadeOutAnimation",$AA.FadeAnimation);
$AA.registerAnimation("fadeOut",$AA.FadeOutAnimation);$AA.PulseAnimation=function(D,G,B,A,F,E,C){$AA.PulseAnimation.initializeBase(this,[D,G,B,null,((A!==undefined)?A:3)]);
this._out=new $AA.FadeOutAnimation(D,G,B,F,E,C);this.add(this._out);this._in=new $AA.FadeInAnimation(D,G,B,F,E,C);
this.add(this._in);};$AA.PulseAnimation.prototype={get_minimumOpacity:function(){return this._out.get_minimumOpacity();
},set_minimumOpacity:function(A){A=this._getFloat(A);this._out.set_minimumOpacity(A);
this._in.set_minimumOpacity(A);this.raisePropertyChanged("minimumOpacity");},get_maximumOpacity:function(){return this._out.get_maximumOpacity();
},set_maximumOpacity:function(A){A=this._getFloat(A);this._out.set_maximumOpacity(A);
this._in.set_maximumOpacity(A);this.raisePropertyChanged("maximumOpacity");},get_forceLayoutInIE:function(){return this._out.get_forceLayoutInIE();
},set_forceLayoutInIE:function(A){A=this._getBoolean(A);this._out.set_forceLayoutInIE(A);
this._in.set_forceLayoutInIE(A);this.raisePropertyChanged("forceLayoutInIE");},set_duration:function(A){A=this._getFloat(A);
$AA.PulseAnimation.callBaseMethod(this,"set_duration",[A]);this._in.set_duration(A);
this._out.set_duration(A);},set_fps:function(A){A=this._getInteger(A);$AA.PulseAnimation.callBaseMethod(this,"set_fps",[A]);
this._in.set_fps(A);this._out.set_fps(A);}};$AA.PulseAnimation.registerClass("AjaxControlToolkit.Animation.PulseAnimation",$AA.SequenceAnimation);
$AA.registerAnimation("pulse",$AA.PulseAnimation);$AA.PropertyAnimation=function(C,E,A,B,D){$AA.PropertyAnimation.initializeBase(this,[C,E,A]);
this._property=B;this._propertyKey=D;this._currentTarget=null;};$AA.PropertyAnimation.prototype={onStart:function(){$AA.PropertyAnimation.callBaseMethod(this,"onStart");
this._currentTarget=this.get_target();},setValue:function(A){var B=this._currentTarget;
if(B&&this._property&&this._property.length>0){if(this._propertyKey&&this._propertyKey.length>0&&B[this._property]){B[this._property][this._propertyKey]=A;
}else{B[this._property]=A;}}},getValue:function(){var B=this.get_target();if(B&&this._property&&this._property.length>0){var A=B[this._property];
if(A){if(this._propertyKey&&this._propertyKey.length>0){return A[this._propertyKey];
}return A;}}return null;},get_property:function(){return this._property;},set_property:function(A){if(this._property!=A){this._property=A;
this.raisePropertyChanged("property");}},get_propertyKey:function(){return this._propertyKey;
},set_propertyKey:function(A){if(this._propertyKey!=A){this._propertyKey=A;this.raisePropertyChanged("propertyKey");
}}};$AA.PropertyAnimation.registerClass("AjaxControlToolkit.Animation.PropertyAnimation",$AA.Animation);
$AA.registerAnimation("property",$AA.PropertyAnimation);$AA.DiscreteAnimation=function(C,F,A,B,D,E){$AA.DiscreteAnimation.initializeBase(this,[C,F,A,B,D]);
this._values=(E&&E.length)?E:[];};$AA.DiscreteAnimation.prototype={getAnimatedValue:function(B){var A=Math.floor(this.interpolate(0,this._values.length-1,B));
return this._values[A];},get_values:function(){return this._values;},set_values:function(A){if(this._values!=A){this._values=A;
this.raisePropertyChanged("values");}}};$AA.DiscreteAnimation.registerClass("AjaxControlToolkit.Animation.DiscreteAnimation",$AA.PropertyAnimation);
$AA.registerAnimation("discrete",$AA.DiscreteAnimation);$AA.InterpolatedAnimation=function(E,G,C,D,F,B,A){$AA.InterpolatedAnimation.initializeBase(this,[E,G,C,((D!==undefined)?D:"style"),F]);
this._startValue=B;this._endValue=A;};$AA.InterpolatedAnimation.prototype={get_startValue:function(){return this._startValue;
},set_startValue:function(A){A=this._getFloat(A);if(this._startValue!=A){this._startValue=A;
this.raisePropertyChanged("startValue");}},get_endValue:function(){return this._endValue;
},set_endValue:function(A){A=this._getFloat(A);if(this._endValue!=A){this._endValue=A;
this.raisePropertyChanged("endValue");}}};$AA.InterpolatedAnimation.registerClass("AjaxControlToolkit.Animation.InterpolatedAnimation",$AA.PropertyAnimation);
$AA.registerAnimation("interpolated",$AA.InterpolatedAnimation);$AA.ColorAnimation=function(E,G,C,D,F,B,A){$AA.ColorAnimation.initializeBase(this,[E,G,C,D,F,B,A]);
this._start=null;this._end=null;this._interpolateRed=false;this._interpolateGreen=false;
this._interpolateBlue=false;};$AA.ColorAnimation.prototype={onStart:function(){$AA.ColorAnimation.callBaseMethod(this,"onStart");
this._start=$AA.ColorAnimation.getRGB(this.get_startValue());this._end=$AA.ColorAnimation.getRGB(this.get_endValue());
this._interpolateRed=(this._start.Red!=this._end.Red);this._interpolateGreen=(this._start.Green!=this._end.Green);
this._interpolateBlue=(this._start.Blue!=this._end.Blue);},getAnimatedValue:function(C){var A=this._start.Red;
var D=this._start.Green;var B=this._start.Blue;if(this._interpolateRed){A=Math.round(this.interpolate(A,this._end.Red,C));
}if(this._interpolateGreen){D=Math.round(this.interpolate(D,this._end.Green,C));}if(this._interpolateBlue){B=Math.round(this.interpolate(B,this._end.Blue,C));
}return $AA.ColorAnimation.toColor(A,D,B);},set_startValue:function(A){if(this._startValue!=A){this._startValue=A;
this.raisePropertyChanged("startValue");}},set_endValue:function(A){if(this._endValue!=A){this._endValue=A;
this.raisePropertyChanged("endValue");}}};$AA.ColorAnimation.getRGB=function(A){if(!A||A.length!=7){throw String.format(AjaxControlToolkit.Resources.Animation_InvalidColor,A);
}return{"Red":parseInt(A.substr(1,2),16),"Green":parseInt(A.substr(3,2),16),"Blue":parseInt(A.substr(5,2),16)};
};$AA.ColorAnimation.toColor=function(D,E,B){var A=D.toString(16);var F=E.toString(16);
var C=B.toString(16);if(A.length==1){A="0"+A;}if(F.length==1){F="0"+F;}if(C.length==1){C="0"+C;
}return"#"+A+F+C;};$AA.ColorAnimation.registerClass("AjaxControlToolkit.Animation.ColorAnimation",$AA.InterpolatedAnimation);
$AA.registerAnimation("color",$AA.ColorAnimation);$AA.LengthAnimation=function(G,H,F,D,C,E,A,B){$AA.LengthAnimation.initializeBase(this,[G,H,F,D,C,E,A]);
this._unit=(B!=null)?B:"px";};$AA.LengthAnimation.prototype={getAnimatedValue:function(B){var A=this.interpolate(this.get_startValue(),this.get_endValue(),B);
return Math.round(A)+this._unit;},get_unit:function(){return this._unit;},set_unit:function(A){if(this._unit!=A){this._unit=A;
this.raisePropertyChanged("unit");}}};$AA.LengthAnimation.registerClass("AjaxControlToolkit.Animation.LengthAnimation",$AA.InterpolatedAnimation);
$AA.registerAnimation("length",$AA.LengthAnimation);$AA.MoveAnimation=function(E,G,B,A,D,F,C){$AA.MoveAnimation.initializeBase(this,[E,G,B,null]);
this._horizontal=A?A:0;this._vertical=D?D:0;this._relative=(F===undefined)?true:F;
this._horizontalAnimation=new $AA.LengthAnimation(E,G,B,"style","left",null,null,C);
this._verticalAnimation=new $AA.LengthAnimation(E,G,B,"style","top",null,null,C);
this.add(this._verticalAnimation);this.add(this._horizontalAnimation);};$AA.MoveAnimation.prototype={onStart:function(){$AA.MoveAnimation.callBaseMethod(this,"onStart");
var A=this.get_target();this._horizontalAnimation.set_startValue(A.offsetLeft);this._horizontalAnimation.set_endValue(this._relative?A.offsetLeft+this._horizontal:this._horizontal);
this._verticalAnimation.set_startValue(A.offsetTop);this._verticalAnimation.set_endValue(this._relative?A.offsetTop+this._vertical:this._vertical);
},get_horizontal:function(){return this._horizontal;},set_horizontal:function(A){A=this._getFloat(A);
if(this._horizontal!=A){this._horizontal=A;this.raisePropertyChanged("horizontal");
}},get_vertical:function(){return this._vertical;},set_vertical:function(A){A=this._getFloat(A);
if(this._vertical!=A){this._vertical=A;this.raisePropertyChanged("vertical");}},get_relative:function(){return this._relative;
},set_relative:function(A){A=this._getBoolean(A);if(this._relative!=A){this._relative=A;
this.raisePropertyChanged("relative");}},get_unit:function(){this._horizontalAnimation.get_unit();
},set_unit:function(A){var B=this._horizontalAnimation.get_unit();if(B!=A){this._horizontalAnimation.set_unit(A);
this._verticalAnimation.set_unit(A);this.raisePropertyChanged("unit");}}};$AA.MoveAnimation.registerClass("AjaxControlToolkit.Animation.MoveAnimation",$AA.ParallelAnimation);
$AA.registerAnimation("move",$AA.MoveAnimation);$AA.ResizeAnimation=function(D,F,B,C,A,E){$AA.ResizeAnimation.initializeBase(this,[D,F,B,null]);
this._width=C;this._height=A;this._horizontalAnimation=new $AA.LengthAnimation(D,F,B,"style","width",null,null,E);
this._verticalAnimation=new $AA.LengthAnimation(D,F,B,"style","height",null,null,E);
this.add(this._horizontalAnimation);this.add(this._verticalAnimation);};$AA.ResizeAnimation.prototype={onStart:function(){$AA.ResizeAnimation.callBaseMethod(this,"onStart");
var A=this.get_target();this._horizontalAnimation.set_startValue(A.offsetWidth);this._verticalAnimation.set_startValue(A.offsetHeight);
this._horizontalAnimation.set_endValue((this._width!==null&&this._width!==undefined)?this._width:A.offsetWidth);
this._verticalAnimation.set_endValue((this._height!==null&&this._height!==undefined)?this._height:A.offsetHeight);
},get_width:function(){return this._width;},set_width:function(A){A=this._getFloat(A);
if(this._width!=A){this._width=A;this.raisePropertyChanged("width");}},get_height:function(){return this._height;
},set_height:function(A){A=this._getFloat(A);if(this._height!=A){this._height=A;this.raisePropertyChanged("height");
}},get_unit:function(){this._horizontalAnimation.get_unit();},set_unit:function(A){var B=this._horizontalAnimation.get_unit();
if(B!=A){this._horizontalAnimation.set_unit(A);this._verticalAnimation.set_unit(A);
this.raisePropertyChanged("unit");}}};$AA.ResizeAnimation.registerClass("AjaxControlToolkit.Animation.ResizeAnimation",$AA.ParallelAnimation);
$AA.registerAnimation("resize",$AA.ResizeAnimation);$AA.ScaleAnimation=function(G,H,E,B,F,A,D,C){$AA.ScaleAnimation.initializeBase(this,[G,H,E]);
this._scaleFactor=(B!==undefined)?B:1;this._unit=(F!==undefined)?F:"px";this._center=A;
this._scaleFont=D;this._fontUnit=(C!==undefined)?C:"pt";this._element=null;this._initialHeight=null;
this._initialWidth=null;this._initialTop=null;this._initialLeft=null;this._initialFontSize=null;
};$AA.ScaleAnimation.prototype={getAnimatedValue:function(A){return this.interpolate(1,this._scaleFactor,A);
},onStart:function(){$AA.ScaleAnimation.callBaseMethod(this,"onStart");this._element=this.get_target();
if(this._element){this._initialHeight=this._element.offsetHeight;this._initialWidth=this._element.offsetWidth;
if(this._center){this._initialTop=this._element.offsetTop;this._initialLeft=this._element.offsetLeft;
}if(this._scaleFont){this._initialFontSize=parseFloat($common.getCurrentStyle(this._element,"fontSize"));
}}},setValue:function(D){if(this._element){var C=Math.round(this._initialWidth*D);
var B=Math.round(this._initialHeight*D);this._element.style.width=C+this._unit;this._element.style.height=B+this._unit;
if(this._center){this._element.style.top=(this._initialTop+Math.round((this._initialHeight-B)/2))+this._unit;
this._element.style.left=(this._initialLeft+Math.round((this._initialWidth-C)/2))+this._unit;
}if(this._scaleFont){var A=this._initialFontSize*D;if(this._fontUnit=="px"||this._fontUnit=="pt"){A=Math.round(A);
}this._element.style.fontSize=A+this._fontUnit;}}},onEnd:function(){this._element=null;
this._initialHeight=null;this._initialWidth=null;this._initialTop=null;this._initialLeft=null;
this._initialFontSize=null;$AA.ScaleAnimation.callBaseMethod(this,"onEnd");},get_scaleFactor:function(){return this._scaleFactor;
},set_scaleFactor:function(A){A=this._getFloat(A);if(this._scaleFactor!=A){this._scaleFactor=A;
this.raisePropertyChanged("scaleFactor");}},get_unit:function(){return this._unit;
},set_unit:function(A){if(this._unit!=A){this._unit=A;this.raisePropertyChanged("unit");
}},get_center:function(){return this._center;},set_center:function(A){A=this._getBoolean(A);
if(this._center!=A){this._center=A;this.raisePropertyChanged("center");}},get_scaleFont:function(){return this._scaleFont;
},set_scaleFont:function(A){A=this._getBoolean(A);if(this._scaleFont!=A){this._scaleFont=A;
this.raisePropertyChanged("scaleFont");}},get_fontUnit:function(){return this._fontUnit;
},set_fontUnit:function(A){if(this._fontUnit!=A){this._fontUnit=A;this.raisePropertyChanged("fontUnit");
}}};$AA.ScaleAnimation.registerClass("AjaxControlToolkit.Animation.ScaleAnimation",$AA.Animation);
$AA.registerAnimation("scale",$AA.ScaleAnimation);$AA.Action=function(B,C,A){$AA.Action.initializeBase(this,[B,C,A]);
if(C===undefined){this.set_duration(0);}};$AA.Action.prototype={onEnd:function(){this.doAction();
$AA.Action.callBaseMethod(this,"onEnd");},doAction:function(){throw Error.notImplemented();
},getAnimatedValue:function(){},setValue:function(){}};$AA.Action.registerClass("AjaxControlToolkit.Animation.Action",$AA.Animation);
$AA.registerAnimation("action",$AA.Action);$AA.EnableAction=function(C,D,A,B){$AA.EnableAction.initializeBase(this,[C,D,A]);
this._enabled=(B!==undefined)?B:true;};$AA.EnableAction.prototype={doAction:function(){var A=this.get_target();
if(A){A.disabled=!this._enabled;}},get_enabled:function(){return this._enabled;},set_enabled:function(A){A=this._getBoolean(A);
if(this._enabled!=A){this._enabled=A;this.raisePropertyChanged("enabled");}}};$AA.EnableAction.registerClass("AjaxControlToolkit.Animation.EnableAction",$AA.Action);
$AA.registerAnimation("enableAction",$AA.EnableAction);$AA.HideAction=function(C,D,B,A){$AA.HideAction.initializeBase(this,[C,D,B]);
this._visible=A;};$AA.HideAction.prototype={doAction:function(){var A=this.get_target();
if(A){$common.setVisible(A,this._visible);}},get_visible:function(){return this._visible;
},set_visible:function(A){if(this._visible!=A){this._visible=A;this.raisePropertyChanged("visible");
}}};$AA.HideAction.registerClass("AjaxControlToolkit.Animation.HideAction",$AA.Action);
$AA.registerAnimation("hideAction",$AA.HideAction);$AA.StyleAction=function(C,E,B,A,D){$AA.StyleAction.initializeBase(this,[C,E,B]);
this._attribute=A;this._value=D;};$AA.StyleAction.prototype={doAction:function(){var A=this.get_target();
if(A){A.style[this._attribute]=this._value;}},get_attribute:function(){return this._attribute;
},set_attribute:function(A){if(this._attribute!=A){this._attribute=A;this.raisePropertyChanged("attribute");
}},get_value:function(){return this._value;},set_value:function(A){if(this._value!=A){this._value=A;
this.raisePropertyChanged("value");}}};$AA.StyleAction.registerClass("AjaxControlToolkit.Animation.StyleAction",$AA.Action);
$AA.registerAnimation("styleAction",$AA.StyleAction);$AA.OpacityAction=function(C,D,A,B){$AA.OpacityAction.initializeBase(this,[C,D,A]);
this._opacity=B;};$AA.OpacityAction.prototype={doAction:function(){var A=this.get_target();
if(A){$common.setElementOpacity(A,this._opacity);}},get_opacity:function(){return this._opacity;
},set_opacity:function(A){A=this._getFloat(A);if(this._opacity!=A){this._opacity=A;
this.raisePropertyChanged("opacity");}}};$AA.OpacityAction.registerClass("AjaxControlToolkit.Animation.OpacityAction",$AA.Action);
$AA.registerAnimation("opacityAction",$AA.OpacityAction);$AA.ScriptAction=function(B,D,A,C){$AA.ScriptAction.initializeBase(this,[B,D,A]);
this._script=C;};$AA.ScriptAction.prototype={doAction:function(){try{eval(this._script);
}catch(ex){}},get_script:function(){return this._script;},set_script:function(A){if(this._script!=A){this._script=A;
this.raisePropertyChanged("script");}}};$AA.ScriptAction.registerClass("AjaxControlToolkit.Animation.ScriptAction",$AA.Action);
$AA.registerAnimation("scriptAction",$AA.ScriptAction);Type.registerNamespace("AjaxControlToolkit.Animation");
AjaxControlToolkit.Animation.AnimationBehavior=function(A){AjaxControlToolkit.Animation.AnimationBehavior.initializeBase(this,[A]);
this._onLoad=null;this._onClick=null;this._onMouseOver=null;this._onMouseOut=null;
this._onHoverOver=null;this._onHoverOut=null;this._onClickHandler=null;this._onMouseOverHandler=null;
this._onMouseOutHandler=null;};AjaxControlToolkit.Animation.AnimationBehavior.prototype={initialize:function(){AjaxControlToolkit.Animation.AnimationBehavior.callBaseMethod(this,"initialize");
var A=this.get_element();if(A){this._onClickHandler=Function.createDelegate(this,this.OnClick);
$addHandler(A,"click",this._onClickHandler);this._onMouseOverHandler=Function.createDelegate(this,this.OnMouseOver);
$addHandler(A,"mouseover",this._onMouseOverHandler);this._onMouseOutHandler=Function.createDelegate(this,this.OnMouseOut);
$addHandler(A,"mouseout",this._onMouseOutHandler);}},dispose:function(){var A=this.get_element();
if(A){if(this._onClickHandler){$removeHandler(A,"click",this._onClickHandler);this._onClickHandler=null;
}if(this._onMouseOverHandler){$removeHandler(A,"mouseover",this._onMouseOverHandler);
this._onMouseOverHandler=null;}if(this._onMouseOutHandler){$removeHandler(A,"mouseout",this._onMouseOutHandler);
this._onMouseOutHandler=null;}}this._onLoad=null;this._onClick=null;this._onMouseOver=null;
this._onMouseOut=null;this._onHoverOver=null;this._onHoverOut=null;AjaxControlToolkit.Animation.AnimationBehavior.callBaseMethod(this,"dispose");
},get_OnLoad:function(){return this._onLoad?this._onLoad.get_json():null;},set_OnLoad:function(A){if(!this._onLoad){this._onLoad=new AjaxControlToolkit.Animation.GenericAnimationBehavior(this.get_element());
this._onLoad.initialize();}this._onLoad.set_json(A);this.raisePropertyChanged("OnLoad");
this._onLoad.play();},get_OnLoadBehavior:function(){return this._onLoad;},get_OnClick:function(){return this._onClick?this._onClick.get_json():null;
},set_OnClick:function(A){if(!this._onClick){this._onClick=new AjaxControlToolkit.Animation.GenericAnimationBehavior(this.get_element());
this._onClick.initialize();}this._onClick.set_json(A);this.raisePropertyChanged("OnClick");
},get_OnClickBehavior:function(){return this._onClick;},OnClick:function(){if(this._onClick){this._onClick.play();
}},get_OnMouseOver:function(){return this._onMouseOver?this._onMouseOver.get_json():null;
},set_OnMouseOver:function(A){if(!this._onMouseOver){this._onMouseOver=new AjaxControlToolkit.Animation.GenericAnimationBehavior(this.get_element());
this._onMouseOver.initialize();}this._onMouseOver.set_json(A);this.raisePropertyChanged("OnMouseOver");
},get_OnMouseOverBehavior:function(){return this._onMouseOver;},OnMouseOver:function(){if(this._onMouseOver){this._onMouseOver.play();
}if(this._onHoverOver){if(this._onHoverOut){this._onHoverOut.quit();}this._onHoverOver.play();
}},get_OnMouseOut:function(){return this._onMouseOut?this._onMouseOut.get_json():null;
},set_OnMouseOut:function(A){if(!this._onMouseOut){this._onMouseOut=new AjaxControlToolkit.Animation.GenericAnimationBehavior(this.get_element());
this._onMouseOut.initialize();}this._onMouseOut.set_json(A);this.raisePropertyChanged("OnMouseOut");
},get_OnMouseOutBehavior:function(){return this._onMouseOut;},OnMouseOut:function(){if(this._onMouseOut){this._onMouseOut.play();
}if(this._onHoverOut){if(this._onHoverOver){this._onHoverOver.quit();}this._onHoverOut.play();
}},get_OnHoverOver:function(){return this._onHoverOver?this._onHoverOver.get_json():null;
},set_OnHoverOver:function(A){if(!this._onHoverOver){this._onHoverOver=new AjaxControlToolkit.Animation.GenericAnimationBehavior(this.get_element());
this._onHoverOver.initialize();}this._onHoverOver.set_json(A);this.raisePropertyChanged("OnHoverOver");
},get_OnHoverOverBehavior:function(){return this._onHoverOver;},get_OnHoverOut:function(){return this._onHoverOut?this._onHoverOut.get_json():null;
},set_OnHoverOut:function(A){if(!this._onHoverOut){this._onHoverOut=new AjaxControlToolkit.Animation.GenericAnimationBehavior(this.get_element());
this._onHoverOut.initialize();}this._onHoverOut.set_json(A);this.raisePropertyChanged("OnHoverOut");
},get_OnHoverOutBehavior:function(){return this._onHoverOut;}};AjaxControlToolkit.Animation.AnimationBehavior.registerClass("AjaxControlToolkit.Animation.AnimationBehavior",AjaxControlToolkit.BehaviorBase);
AjaxControlToolkit.Animation.GenericAnimationBehavior=function(A){AjaxControlToolkit.Animation.GenericAnimationBehavior.initializeBase(this,[A]);
this._json=null;this._animation=null;};AjaxControlToolkit.Animation.GenericAnimationBehavior.prototype={dispose:function(){this.disposeAnimation();
AjaxControlToolkit.Animation.GenericAnimationBehavior.callBaseMethod(this,"dispose");
},disposeAnimation:function(){if(this._animation){this._animation.dispose();}this._animation=null;
},play:function(){if(this._animation&&!this._animation.get_isPlaying()){this.stop();
this._animation.play();}},stop:function(){if(this._animation){if(this._animation.get_isPlaying()){this._animation.stop(true);
}}},quit:function(){if(this._animation){if(this._animation.get_isPlaying()){this._animation.stop(false);
}}},get_json:function(){return this._json;},set_json:function(A){if(this._json!=A){this._json=A;
this.raisePropertyChanged("json");this.disposeAnimation();var B=this.get_element();
if(B){this._animation=AjaxControlToolkit.Animation.buildAnimation(this._json,B);if(this._animation){this._animation.initialize();
}this.raisePropertyChanged("animation");}}},get_animation:function(){return this._animation;
}};AjaxControlToolkit.Animation.GenericAnimationBehavior.registerClass("AjaxControlToolkit.Animation.GenericAnimationBehavior",AjaxControlToolkit.BehaviorBase);
Type.registerNamespace("AjaxControlToolkit");AjaxControlToolkit.TimeSpan=function(){if(arguments.length==0){this._ctor$0.apply(this,arguments);
}else{if(arguments.length==1){this._ctor$1.apply(this,arguments);}else{if(arguments.length==3){this._ctor$2.apply(this,arguments);
}else{if(arguments.length==4){this._ctor$3.apply(this,arguments);}else{if(arguments.length==5){this._ctor$4.apply(this,arguments);
}else{throw Error.parameterCount();}}}}}};AjaxControlToolkit.TimeSpan.prototype={_ctor$0:function(){this._ticks=0;
},_ctor$1:function(A){this._ctor$0();this._ticks=A;},_ctor$2:function(A,C,B){this._ctor$0();
this._ticks=(A*AjaxControlToolkit.TimeSpan.TicksPerHour)+(C*AjaxControlToolkit.TimeSpan.TicksPerMinute)+(B*AjaxControlToolkit.TimeSpan.TicksPerSecond);
},_ctor$3:function(D,A,C,B){this._ctor$0();this._ticks=(D*AjaxControlToolkit.TimeSpan.TicksPerDay)+(A*AjaxControlToolkit.TimeSpan.TicksPerHour)+(C*AjaxControlToolkit.TimeSpan.TicksPerMinute)+(B*AjaxControlToolkit.TimeSpan.TicksPerSecond);
},_ctor$4:function(E,A,D,B,C){this._ctor$0();this._ticks=(E*AjaxControlToolkit.TimeSpan.TicksPerDay)+(A*AjaxControlToolkit.TimeSpan.TicksPerHour)+(D*AjaxControlToolkit.TimeSpan.TicksPerMinute)+(B*AjaxControlToolkit.TimeSpan.TicksPerSecond)+(C*AjaxControlToolkit.TimeSpan.TicksPerMillisecond);
},getDays:function(){return Math.floor(this._ticks/AjaxControlToolkit.TimeSpan.TicksPerDay);
},getHours:function(){return Math.floor(this._ticks/AjaxControlToolkit.TimeSpan.TicksPerHour)%24;
},getMinutes:function(){return Math.floor(this._ticks/AjaxControlToolkit.TimeSpan.TicksPerMinute)%60;
},getSeconds:function(){return Math.floor(this._ticks/AjaxControlToolkit.TimeSpan.TicksPerSecond)%60;
},getMilliseconds:function(){return Math.floor(this._ticks/AjaxControlToolkit.TimeSpan.TicksPerMillisecond)%1000;
},getDuration:function(){return new AjaxControlToolkit.TimeSpan(Math.abs(this._ticks));
},getTicks:function(){return this._ticks;},getTotalDays:function(){Math.floor(this._ticks/AjaxControlToolkit.TimeSpan.TicksPerDay);
},getTotalHours:function(){return Math.floor(this._ticks/AjaxControlToolkit.TimeSpan.TicksPerHour);
},getTotalMinutes:function(){return Math.floor(this._ticks/AjaxControlToolkit.TimeSpan.TicksPerMinute);
},getTotalSeconds:function(){return Math.floor(this._ticks/AjaxControlToolkit.TimeSpan.TicksPerSecond);
},getTotalMilliseconds:function(){return Math.floor(this._ticks/AjaxControlToolkit.TimeSpan.TicksPerMillisecond);
},add:function(A){return new AjaxControlToolkit.TimeSpan(this._ticks+A.getTicks());
},subtract:function(A){return new AjaxControlToolkit.TimeSpan(this._ticks-A.getTicks());
},negate:function(){return new AjaxControlToolkit.TimeSpan(-this._ticks);},equals:function(A){return this._ticks==A.getTicks();
},compareTo:function(A){if(this._ticks>A.getTicks()){return 1;}else{if(this._ticks<A.getTicks()){return -1;
}else{return 0;}}},toString:function(){return this.format("F");},format:function(B){if(!B){B="F";
}if(B.length==1){switch(B){case"t":B=AjaxControlToolkit.TimeSpan.ShortTimeSpanPattern;
break;case"T":B=AjaxControlToolkit.TimeSpan.LongTimeSpanPattern;break;case"F":B=AjaxControlToolkit.TimeSpan.FullTimeSpanPattern;
break;default:throw Error.createError(String.format(AjaxControlToolkit.Resources.Common_DateTime_InvalidTimeSpan,B));
}}var C=/dd|d|hh|h|mm|m|ss|s|nnnn|nnn|nn|n/g;var A=new Sys.StringBuilder();var E=this._ticks;
if(E<0){A.append("-");E=-E;}for(;;){var F=C.lastIndex;var D=C.exec(B);A.append(B.slice(F,D?D.index:B.length));
if(!D){break;}switch(D[0]){case"dd":case"d":A.append($common.padLeft(Math.floor(E/AjaxControlToolkit.TimeSpan.TicksPerDay,D[0].length,"0")));
break;case"hh":case"h":A.append($common.padLeft(Math.floor(E/AjaxControlToolkit.TimeSpan.TicksPerHour)%24,D[0].length,"0"));
break;case"mm":case"m":A.append($common.padLeft(Math.floor(E/AjaxControlToolkit.TimeSpan.TicksPerMinute)%60,D[0].length,"0"));
break;case"ss":case"s":A.append($common.padLeft(Math.floor(E/AjaxControlToolkit.TimeSpan.TicksPerSecond)%60,D[0].length,"0"));
break;case"nnnn":case"nnn":case"nn":case"n":A.append($common.padRight(Math.floor(E/AjaxControlToolkit.TimeSpan.TicksPerMillisecond)%1000,D[0].length,"0",true));
break;default:Sys.Debug.assert(false);}}return A.toString();}};AjaxControlToolkit.TimeSpan.parse=function(G){var E=G.split(":");
var C=0;var I=0;var A=0;var H=0;var B=0;var F=0;switch(E.length){case 1:if(E[0].indexOf(".")!=-1){var D=E[0].split(".");
H=parseInt(D[0]);B=parseInt(D[1]);}else{F=parseInt(E[0]);}break;case 2:I=parseInt(E[0]);
A=parseInt(E[1]);break;case 3:I=parseInt(E[0]);A=parseInt(E[1]);if(E[2].indexOf(".")!=-1){var D=E[2].split(".");
H=parseInt(D[0]);B=parseInt(D[1]);}else{H=parseInt(E[2]);}break;case 4:C=parseInt(E[0]);
I=parseInt(E[1]);A=parseInt(E[2]);if(E[3].indexOf(".")!=-1){var D=E[3].split(".");
H=parseInt(D[0]);B=parseInt(D[1]);}else{H=parseInt(E[3]);}break;}F+=(C*AjaxControlToolkit.TimeSpan.TicksPerDay)+(I*AjaxControlToolkit.TimeSpan.TicksPerHour)+(A*AjaxControlToolkit.TimeSpan.TicksPerMinute)+(H*AjaxControlToolkit.TimeSpan.TicksPerSecond)+(B*AjaxControlToolkit.TimeSpan.TicksPerMillisecond);
if(!isNaN(F)){return new AjaxControlToolkit.TimeSpan(F);}throw Error.create(AjaxControlToolkit.Resources.Common_DateTime_InvalidFormat);
};AjaxControlToolkit.TimeSpan.fromTicks=function(A){return new AjaxControlToolkit.TimeSpan(A);
};AjaxControlToolkit.TimeSpan.fromDays=function(A){return new AjaxControlToolkit.TimeSpan(A*AjaxControlToolkit.TimeSpan.TicksPerDay);
};AjaxControlToolkit.TimeSpan.fromHours=function(A){return new AjaxControlToolkit.TimeSpan(A*AjaxControlToolkit.TimeSpan.TicksPerHour);
};AjaxControlToolkit.TimeSpan.fromMinutes=function(A){return new AjaxControlToolkit.TimeSpan(A*AjaxControlToolkit.TimeSpan.TicksPerMinute);
};AjaxControlToolkit.TimeSpan.fromSeconds=function(A){return new AjaxControlToolkit.TimeSpan(minutes*AjaxControlToolkit.TimeSpan.TicksPerSecond);
};AjaxControlToolkit.TimeSpan.fromMilliseconds=function(A){return new AjaxControlToolkit.TimeSpan(minutes*AjaxControlToolkit.TimeSpan.TicksPerMillisecond);
};AjaxControlToolkit.TimeSpan.TicksPerDay=864000000000;AjaxControlToolkit.TimeSpan.TicksPerHour=36000000000;
AjaxControlToolkit.TimeSpan.TicksPerMinute=600000000;AjaxControlToolkit.TimeSpan.TicksPerSecond=10000000;
AjaxControlToolkit.TimeSpan.TicksPerMillisecond=10000;AjaxControlToolkit.TimeSpan.FullTimeSpanPattern="dd:hh:mm:ss.nnnn";
AjaxControlToolkit.TimeSpan.ShortTimeSpanPattern="hh:mm";AjaxControlToolkit.TimeSpan.LongTimeSpanPattern="hh:mm:ss";
Date.prototype.getTimeOfDay=function Date$getTimeOfDay(){return new AjaxControlToolkit.TimeSpan(0,this.getHours(),this.getMinutes(),this.getSeconds(),this.getMilliseconds());
};Date.prototype.getDateOnly=function Date$getDateOnly(){return new Date(this.getFullYear(),this.getMonth(),this.getDate());
};Date.prototype.add=function Date$add(A){return new Date(this.getTime()+A.getTotalMilliseconds());
};Date.prototype.subtract=function Date$subtract(A){return this.add(A.negate());};
Date.prototype.getTicks=function Date$getTicks(){return this.getTime()*AjaxControlToolkit.TimeSpan.TicksPerMillisecond;
};AjaxControlToolkit.FirstDayOfWeek=function(){};AjaxControlToolkit.FirstDayOfWeek.prototype={Sunday:0,Monday:1,Tuesday:2,Wednesday:3,Thursday:4,Friday:5,Saturday:6,Default:7};
AjaxControlToolkit.FirstDayOfWeek.registerEnum("AjaxControlToolkit.FirstDayOfWeek");
Type.registerNamespace("AjaxControlToolkit");AjaxControlToolkit.PopupBehavior=function(A){AjaxControlToolkit.PopupBehavior.initializeBase(this,[A]);
this._x=0;this._y=0;this._positioningMode=AjaxControlToolkit.PositioningMode.Absolute;
this._parentElement=null;this._parentElementID=null;this._moveHandler=null;this._firstPopup=true;
this._originalParent=null;this._visible=false;this._onShow=null;this._onShowEndedHandler=null;
this._onHide=null;this._onHideEndedHandler=null;};AjaxControlToolkit.PopupBehavior.prototype={initialize:function(){AjaxControlToolkit.PopupBehavior.callBaseMethod(this,"initialize");
this._hidePopup();this.get_element().style.position="absolute";this._onShowEndedHandler=Function.createDelegate(this,this._onShowEnded);
this._onHideEndedHandler=Function.createDelegate(this,this._onHideEnded);},dispose:function(){var A=this.get_element();
if(A){if(this._visible){this.hide();}if(this._originalParent){A.parentNode.removeChild(A);
this._originalParent.appendChild(A);this._originalParent=null;}A._hideWindowedElementsIFrame=null;
}this._parentElement=null;if(this._onShow&&this._onShow.get_animation()&&this._onShowEndedHandler){this._onShow.get_animation().remove_ended(this._onShowEndedHandler);
}this._onShowEndedHandler=null;this._onShow=null;if(this._onHide&&this._onHide.get_animation()&&this._onHideEndedHandler){this._onHide.get_animation().remove_ended(this._onHideEndedHandler);
}this._onHideEndedHandler=null;this._onHide=null;AjaxControlToolkit.PopupBehavior.callBaseMethod(this,"dispose");
},show:function(){if(this._visible){return;}var B=new Sys.CancelEventArgs();this.raiseShowing(B);
if(B.get_cancel()){return;}this._visible=true;var A=this.get_element();$common.setVisible(A,true);
this.setupPopup();if(this._onShow){$common.setVisible(A,false);this.onShow();}else{this.raiseShown(Sys.EventArgs.Empty);
}},hide:function(){if(!this._visible){return;}var A=new Sys.CancelEventArgs();this.raiseHiding(A);
if(A.get_cancel()){return;}this._visible=false;if(this._onHide){this.onHide();}else{this._hidePopup();
this._hideCleanup();}},getBounds:function(){var C=this.get_element();var G=C.offsetParent||document.documentElement;
var D;var E;if(this._parentElement){E=$common.getBounds(this._parentElement);var F=$common.getLocation(G);
D={x:E.x-F.x,y:E.y-F.y};}else{E=$common.getBounds(G);D={x:0,y:0};}var A=C.offsetWidth-(C.clientLeft?C.clientLeft*2:0);
var H=C.offsetHeight-(C.clientTop?C.clientTop*2:0);var B;switch(this._positioningMode){case AjaxControlToolkit.PositioningMode.Center:B={x:Math.round(E.width/2-A/2),y:Math.round(E.height/2-H/2)};
break;case AjaxControlToolkit.PositioningMode.BottomLeft:B={x:0,y:E.height};break;
case AjaxControlToolkit.PositioningMode.BottomRight:B={x:E.width-A,y:E.height};break;
case AjaxControlToolkit.PositioningMode.TopLeft:B={x:0,y:-C.offsetHeight};break;case AjaxControlToolkit.PositioningMode.TopRight:B={x:E.width-A,y:-C.offsetHeight};
break;default:B={x:0,y:0};}B.x+=this._x+D.x;B.y+=this._y+D.y;return new Sys.UI.Bounds(B.x,B.y,A,H);
},adjustPopupPosition:function(B){var E=this.get_element();if(!B){B=this.getBounds();
}if(this._firstPopup){E.style.width=B.width+"px";this._firstPopup=false;}var A=$common.getBounds(E);
var C=false;var D=self.innerWidth?self.innerWidth:document.documentElement.clientWidth;
if(!D){D=document.body.clientWidth;}if(A.x+A.width>D-5){B.x-=A.x+A.width-D+5;C=true;
}if(A.x<0){B.x-=A.x;C=true;}if(A.y<0){B.y-=A.y;C=true;}if(C){$common.setLocation(E,B);
}},addBackgroundIFrame:function(){var B=this.get_element();if((Sys.Browser.agent===Sys.Browser.InternetExplorer)&&(Sys.Browser.version<7)){var A=B._hideWindowedElementsIFrame;
if(!A){A=document.createElement("iframe");A.src="javascript:'<html></html>';";A.style.position="absolute";
A.style.display="none";A.scrolling="no";A.frameBorder="0";A.tabIndex="-1";A.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)";
B.parentNode.insertBefore(A,B);B._hideWindowedElementsIFrame=A;this._moveHandler=Function.createDelegate(this,this._onMove);
Sys.UI.DomEvent.addHandler(B,"move",this._moveHandler);}$common.setBounds(A,$common.getBounds(B));
A.style.display=B.style.display;if(B.currentStyle&&B.currentStyle.zIndex){A.style.zIndex=B.currentStyle.zIndex;
}else{if(B.style.zIndex){A.style.zIndex=B.style.zIndex;}}}},setupPopup:function(){var B=this.get_element();
var A=this.getBounds();$common.setLocation(B,A);this.adjustPopupPosition(A);B.zIndex=1000;
this.addBackgroundIFrame();},_hidePopup:function(){var A=this.get_element();$common.setVisible(A,false);
if(A.originalWidth){A.style.width=A.originalWidth+"px";A.originalWidth=null;}},_hideCleanup:function(){var B=this.get_element();
if(this._moveHandler){Sys.UI.DomEvent.removeHandler(B,"move",this._moveHandler);this._moveHandler=null;
}if(Sys.Browser.agent===Sys.Browser.InternetExplorer){var A=B._hideWindowedElementsIFrame;
if(A){A.style.display="none";}}this.raiseHidden(Sys.EventArgs.Empty);},_onMove:function(){var A=this.get_element();
if(A._hideWindowedElementsIFrame){A.parentNode.insertBefore(A._hideWindowedElementsIFrame,A);
A._hideWindowedElementsIFrame.style.top=A.style.top;A._hideWindowedElementsIFrame.style.left=A.style.left;
}},get_onShow:function(){return this._onShow?this._onShow.get_json():null;},set_onShow:function(A){if(!this._onShow){this._onShow=new AjaxControlToolkit.Animation.GenericAnimationBehavior(this.get_element());
this._onShow.initialize();}this._onShow.set_json(A);var B=this._onShow.get_animation();
if(B){B.add_ended(this._onShowEndedHandler);}this.raisePropertyChanged("onShow");
},get_onShowBehavior:function(){return this._onShow;},onShow:function(){if(this._onShow){if(this._onHide){this._onHide.quit();
}this._onShow.play();}},_onShowEnded:function(){this.adjustPopupPosition();this.addBackgroundIFrame();
this.raiseShown(Sys.EventArgs.Empty);},get_onHide:function(){return this._onHide?this._onHide.get_json():null;
},set_onHide:function(A){if(!this._onHide){this._onHide=new AjaxControlToolkit.Animation.GenericAnimationBehavior(this.get_element());
this._onHide.initialize();}this._onHide.set_json(A);var B=this._onHide.get_animation();
if(B){B.add_ended(this._onHideEndedHandler);}this.raisePropertyChanged("onHide");
},get_onHideBehavior:function(){return this._onHide;},onHide:function(){if(this._onHide){if(this._onShow){this._onShow.quit();
}this._onHide.play();}},_onHideEnded:function(){this._hideCleanup();},get_parentElement:function(){if(!this._parentElement&&this._parentElementID){this.set_parentElement($get(this._parentElementID));
Sys.Debug.assert(this._parentElement!=null,String.format(AjaxControlToolkit.Resources.PopupExtender_NoParentElement,this._parentElementID));
}return this._parentElement;},set_parentElement:function(A){this._parentElement=A;
this.raisePropertyChanged("parentElement");},get_parentElementID:function(){if(this._parentElement){return this._parentElement.id;
}return this._parentElementID;},set_parentElementID:function(A){this._parentElementID=A;
if(this.get_isInitialized()){this.set_parentElement($get(A));}},get_positioningMode:function(){return this._positioningMode;
},set_positioningMode:function(A){this._positioningMode=A;this.raisePropertyChanged("positioningMode");
},get_x:function(){return this._x;},set_x:function(A){if(A!=this._x){this._x=A;if(this._visible){this.setupPopup();
}this.raisePropertyChanged("x");}},get_y:function(){return this._y;},set_y:function(A){if(A!=this._y){this._y=A;
if(this._visible){this.setupPopup();}this.raisePropertyChanged("y");}},get_visible:function(){return this._visible;
},add_showing:function(A){this.get_events().addHandler("showing",A);},remove_showing:function(A){this.get_events().removeHandler("showing",A);
},raiseShowing:function(B){var A=this.get_events().getHandler("showing");if(A){A(this,B);
}},add_shown:function(A){this.get_events().addHandler("shown",A);},remove_shown:function(A){this.get_events().removeHandler("shown",A);
},raiseShown:function(B){var A=this.get_events().getHandler("shown");if(A){A(this,B);
}},add_hiding:function(A){this.get_events().addHandler("hiding",A);},remove_hiding:function(A){this.get_events().removeHandler("hiding",A);
},raiseHiding:function(B){var A=this.get_events().getHandler("hiding");if(A){A(this,B);
}},add_hidden:function(A){this.get_events().addHandler("hidden",A);},remove_hidden:function(A){this.get_events().removeHandler("hidden",A);
},raiseHidden:function(B){var A=this.get_events().getHandler("hidden");if(A){A(this,B);
}}};AjaxControlToolkit.PopupBehavior.registerClass("AjaxControlToolkit.PopupBehavior",AjaxControlToolkit.BehaviorBase);
AjaxControlToolkit.PositioningMode=function(){throw Error.invalidOperation();};AjaxControlToolkit.PositioningMode.prototype={Absolute:0,Center:1,BottomLeft:2,BottomRight:3,TopLeft:4,TopRight:5};
AjaxControlToolkit.PositioningMode.registerEnum("AjaxControlToolkit.PositioningMode");
Type.registerNamespace("AjaxControlToolkit.Threading");AjaxControlToolkit.DeferredOperation=function(C,B,A){this._delay=C;
this._context=B;this._callback=A;this._completeCallback=null;this._errorCallback=null;
this._timer=null;this._callArgs=null;this._isComplete=false;this._completedSynchronously=false;
this._asyncResult=null;this._exception=null;this._throwExceptions=true;this._oncomplete$delegate=Function.createDelegate(this,this._oncomplete);
this.post=Function.createDelegate(this,this.post);};AjaxControlToolkit.DeferredOperation.prototype={get_isPending:function(){return(this._timer!=null);
},get_isComplete:function(){return this._isComplete;},get_completedSynchronously:function(){return this._completedSynchronously;
},get_exception:function(){return this._exception;},get_throwExceptions:function(){return this._throwExceptions;
},set_throwExceptions:function(A){this._throwExceptions=A;},get_delay:function(){return this._delay;
},set_delay:function(A){this._delay=A;},post:function(A){var C=[];for(var B=0;B<arguments.length;
B++){C[B]=arguments[B];}this.beginPost(C,null,null);},beginPost:function(B,C,A){this.cancel();
this._callArgs=Array.clone(B||[]);this._completeCallback=C;this._errorCallback=A;
if(this._delay==-1){this._oncomplete();this._completedSynchronously=true;}else{this._timer=setTimeout(this._oncomplete$delegate,this._delay);
}},cancel:function(){if(this._timer){clearTimeout(this._timer);this._timer=null;}this._callArgs=null;
this._isComplete=false;this._asyncResult=null;this._completeCallback=null;this._errorCallback=null;
this._exception=null;this._completedSynchronously=false;},complete:function(){if(this._timer){try{this._oncomplete();
}finally{this._completedSynchronously=true;}return this._asyncResult;}else{if(this._isComplete){return this._asyncResult;
}}},_oncomplete:function(){var B=this._callArgs;var C=this._completeCallback;var A=this._errorCallback;
this.cancel();try{if(B){this._asyncResult=this._callback.apply(this._context,B);}else{this._asyncResult=this._callback.call(this._context);
}this._isComplete=true;this._completedSynchronously=false;if(C){C(this);}}catch(D){this._isComplete=true;
this._completedSynchronously=false;this._exception=D;if(A){if(A(this)){return;}}if(this._throwExceptions){throw D;
}}}};AjaxControlToolkit.DeferredOperation.registerClass("AjaxControlToolkit.DeferredOperation");
Type.registerNamespace("AjaxControlToolkit");AjaxControlToolkit.CalendarBehavior=function(A){AjaxControlToolkit.CalendarBehavior.initializeBase(this,[A]);
this._format="d";this._cssClass="ajax__calendar";this._enabled=true;this._animated=true;
this._buttonID=null;this._layoutRequested=0;this._layoutSuspended=false;this._selectedDate=null;
this._visibleDate=null;this._todaysDate=null;this._firstDayOfWeek=AjaxControlToolkit.FirstDayOfWeek.Default;
this._popupDiv=null;this._prevArrow=null;this._prevArrowImage=null;this._nextArrow=null;
this._nextArrowImage=null;this._title=null;this._today=null;this._daysRow=null;this._monthsRow=null;
this._yearsRow=null;this._daysBody=null;this._monthsBody=null;this._yearsBody=null;
this._button=null;this._popupBehavior=null;this._modeChangeAnimation=null;this._modeChangeMoveTopOrLeftAnimation=null;
this._modeChangeMoveBottomOrRightAnimation=null;this._mode="days";this._selectedDateChanging=false;
this._isOpen=false;this._isAnimating=false;this._width=170;this._height=139;this._modes={"days":null,"months":null,"years":null};
this._modeOrder={"days":0,"months":1,"years":2};this._blur=new AjaxControlToolkit.DeferredOperation(((Sys.Browser.agent===Sys.Browser.Safari)?1000:1),this,this._onblur);
this._focus=new AjaxControlToolkit.DeferredOperation(((Sys.Browser.agent===Sys.Browser.Safari)?1000:1),this,this._onfocus);
this._button$delegates={click:Function.createDelegate(this,this._button_onclick)};
this._element$delegates={focus:Function.createDelegate(this,this._element_onfocus),focusout:Function.createDelegate(this,this._element_onblur),blur:Function.createDelegate(this,this._element_onblur),change:Function.createDelegate(this,this._element_onchange)};
this._popup$delegates={activate:Function.createDelegate(this,this._popup_onfocus),focus:Function.createDelegate(this,this._popup_onfocus),dragstart:Function.createDelegate(this,this._popup_ondragstart),select:Function.createDelegate(this,this._popup_onselect)};
this._cell$delegates={mouseover:Function.createDelegate(this,this._cell_onmouseover),mouseout:Function.createDelegate(this,this._cell_onmouseout),click:Function.createDelegate(this,this._cell_onclick)};
};AjaxControlToolkit.CalendarBehavior.prototype={get_animated:function(){return this._animated;
},set_animated:function(A){if(this._animated!=A){this._animated=A;this.raisePropertyChanged("animated");
}},get_enabled:function(){return this._enabled;},set_enabled:function(A){if(this._enabled!=A){this._enabled=A;
this.raisePropertyChanged("enabled");}},get_button:function(){return this._button;
},set_button:function(A){if(this._button!=A){if(this._button&&this.get_isInitialized()){$common.removeHandlers(this._button,this._button$delegates);
}this._button=A;if(this._button&&this.get_isInitialized()){$addHandlers(this._button,this._button$delegates);
}this.raisePropertyChanged("button");}},get_format:function(){return this._format;
},set_format:function(A){if(this._format!=A){this._format=A;this.raisePropertyChanged("format");
}},get_selectedDate:function(){if(this._selectedDate==null){var B=this.get_element();
var C=AjaxControlToolkit.TextBoxWrapper.get_Wrapper(B);var A=C.get_Value();if(A){this._selectedDate=this._parseTextValue(A);
}}return this._selectedDate;},set_selectedDate:function(A){var B=this.get_element();
if(this._selectedDate!=A){this._selectedDate=A;this._selectedDateChanging=true;var D="";
if(A){D=A.localeFormat(this._format);}var C=AjaxControlToolkit.TextBoxWrapper.get_Wrapper(B);
if(D!=C.get_Value()){C.set_Value(D);this._fireChanged();}this._selectedDateChanging=false;
this.invalidate();this.raisePropertyChanged("selectedDate");}},get_visibleDate:function(){return this._visibleDate;
},set_visibleDate:function(A){if(A){A=A.getDateOnly();}if(this._visibleDate!=A){this._switchMonth(A,!this._isOpen);
this.raisePropertyChanged("visibleDate");}},get_todaysDate:function(){if(this._todaysDate!=null){return this._todaysDate;
}return new Date().getDateOnly();},set_todaysDate:function(A){if(A){A=A.getDateOnly();
}if(this._todaysDate!=A){this._todaysDate=A;this.invalidate();this.raisePropertyChanged("todaysDate");
}},get_firstDayOfWeek:function(){return this._firstDayOfWeek;},set_firstDayOfWeek:function(A){if(this._firstDayOfWeek!=A){this._firstDayOfWeek=A;
this.invalidate();this.raisePropertyChanged("firstDayOfWeek");}},get_cssClass:function(){return this._cssClass;
},set_cssClass:function(A){if(this._cssClass!=A){if(this._cssClass&&this.get_isInitialized()){Sys.UI.DomElement.removeCssClass(this._container,this._cssClass);
}this._cssClass=A;if(this._cssClass&&this.get_isInitialized()){Sys.UI.DomElement.addCssClass(this._container,this._cssClass);
}this.raisePropertyChanged("cssClass");}},add_showing:function(A){this.get_events().addHandler("showing",A);
},remove_showing:function(A){this.get_events().removeHandler("showing",A);},raiseShowing:function(B){var A=this.get_events().getHandler("showing");
if(A){A(this,B);}},add_shown:function(A){this.get_events().addHandler("shown",A);
},remove_shown:function(A){this.get_events().removeHandler("shown",A);},raiseShown:function(){var A=this.get_events().getHandler("shown");
if(A){A(this,Sys.EventArgs.Empty);}},add_hiding:function(A){this.get_events().addHandler("hiding",A);
},remove_hiding:function(A){this.get_events().removeHandler("hiding",A);},raiseHiding:function(B){var A=this.get_events().getHandler("hiding");
if(A){A(this,B);}},add_hidden:function(A){this.get_events().addHandler("hidden",A);
},remove_hidden:function(A){this.get_events().removeHandler("hidden",A);},raiseHidden:function(){var A=this.get_events().getHandler("hidden");
if(A){A(this,Sys.EventArgs.Empty);}},add_dateSelectionChanged:function(A){this.get_events().addHandler("dateSelectionChanged",A);
},remove_dateSelectionChanged:function(A){this.get_events().removeHandler("dateSelectionChanged",A);
},raiseDateSelectionChanged:function(){var A=this.get_events().getHandler("dateSelectionChanged");
if(A){A(this,Sys.EventArgs.Empty);}},initialize:function(){AjaxControlToolkit.CalendarBehavior.callBaseMethod(this,"initialize");
var B=this.get_element();$addHandlers(B,this._element$delegates);if(this._button){$addHandlers(this._button,this._button$delegates);
}this._modeChangeMoveTopOrLeftAnimation=new AjaxControlToolkit.Animation.LengthAnimation(null,null,null,"style",null,0,0,"px");
this._modeChangeMoveBottomOrRightAnimation=new AjaxControlToolkit.Animation.LengthAnimation(null,null,null,"style",null,0,0,"px");
this._modeChangeAnimation=new AjaxControlToolkit.Animation.ParallelAnimation(null,0.25,null,[this._modeChangeMoveTopOrLeftAnimation,this._modeChangeMoveBottomOrRightAnimation]);
var A=this.get_selectedDate();if(A){this.set_selectedDate(A);}},dispose:function(){if(this._popupBehavior){this._popupBehavior.dispose();
this._popupBehavior=null;}this._modes=null;this._modeOrder=null;if(this._modeChangeMoveTopOrLeftAnimation){this._modeChangeMoveTopOrLeftAnimation.dispose();
this._modeChangeMoveTopOrLeftAnimation=null;}if(this._modeChangeMoveBottomOrRightAnimation){this._modeChangeMoveBottomOrRightAnimation.dispose();
this._modeChangeMoveBottomOrRightAnimation=null;}if(this._modeChangeAnimation){this._modeChangeAnimation.dispose();
this._modeChangeAnimation=null;}if(this._container){if(this._container.parentNode){this._container.parentNode.removeChild(this._container);
}this._container=null;}if(this._popupDiv){$common.removeHandlers(this._popupDiv,this._popup$delegates);
this._popupDiv=null;}if(this._prevArrow){$common.removeHandlers(this._prevArrow,this._cell$delegates);
this._prevArrow=null;}if(this._prevArrowImage){$common.removeHandlers(this._prevArrowImage,this._cell$delegates);
this._prevArrowImage=null;}if(this._nextArrow){$common.removeHandlers(this._nextArrow,this._cell$delegates);
this._nextArrow=null;}if(this._nextArrowImage){$common.removeHandlers(this._nextArrowImage,this._cell$delegates);
this._nextArrowImage=null;}if(this._title){$common.removeHandlers(this._title,this._cell$delegates);
this._title=null;}if(this._today){$common.removeHandlers(this._today,this._cell$delegates);
this._today=null;}if(this._daysRow){for(var C=0;C<this._daysBody.rows.length;C++){var D=this._daysBody.rows[C];
for(var B=0;B<D.cells.length;B++){$common.removeHandlers(D.cells[B].firstChild,this._cell$delegates);
}}this._daysRow=null;}if(this._monthsRow){for(var C=0;C<this._monthsBody.rows.length;
C++){var D=this._monthsBody.rows[C];for(var B=0;B<D.cells.length;B++){$common.removeHandlers(D.cells[B].firstChild,this._cell$delegates);
}}this._monthsRow=null;}if(this._yearsRow){for(var C=0;C<this._yearsBody.rows.length;
C++){var D=this._yearsBody.rows[C];for(var B=0;B<D.cells.length;B++){$common.removeHandlers(D.cells[B].firstChild,this._cell$delegates);
}}this._yearsRow=null;}if(this._button){$common.removeHandlers(this._button,this._button$delegates);
this._button=null;}var A=this.get_element();$common.removeHandlers(A,this._element$delegates);
AjaxControlToolkit.CalendarBehavior.callBaseMethod(this,"dispose");},show:function(){this._ensureCalendar();
if(!this._isOpen){var A=new Sys.CancelEventArgs();this.raiseShowing(A);if(A.get_cancel()){return;
}this._isOpen=true;this._switchMonth(null,true);this._popupBehavior.show();this.raiseShown();
}},hide:function(){if(this._isOpen){var A=new Sys.CancelEventArgs();this.raiseHiding(A);
if(A.get_cancel()){return;}if(this._container){this._popupBehavior.hide();this._switchMode("days",true);
}this._isOpen=false;this.raiseHidden();}},suspendLayout:function(){this._layoutSuspended++;
},resumeLayout:function(){this._layoutSuspended--;if(this._layoutSuspended<=0){this._layoutSuspended=0;
if(this._layoutRequested){this._performLayout();}}},invalidate:function(){if(this._layoutSuspended>0){this._layoutRequested=true;
}else{this._performLayout();}},_buildCalendar:function(){var A=this.get_element();
this._container=$common.createElementFromTemplate({nodeName:"div",cssClasses:[this._cssClass]},A.parentNode);
this._popupDiv=$common.createElementFromTemplate({nodeName:"div",events:this._popup$delegates,properties:{tabIndex:0},cssClasses:["ajax__calendar_container"],visible:false},this._container);
},_buildHeader:function(){this._header=$common.createElementFromTemplate({nodeName:"div",cssClasses:["ajax__calendar_header"]},this._popupDiv);
var B=$common.createElementFromTemplate({nodeName:"div"},this._header);this._prevArrow=$common.createElementFromTemplate({nodeName:"div",properties:{mode:"prev"},events:this._cell$delegates,cssClasses:["ajax__calendar_prev"]},B);
var A=$common.createElementFromTemplate({nodeName:"div"},this._header);this._nextArrow=$common.createElementFromTemplate({nodeName:"div",properties:{mode:"next"},events:this._cell$delegates,cssClasses:["ajax__calendar_next"]},A);
var C=$common.createElementFromTemplate({nodeName:"div"},this._header);this._title=$common.createElementFromTemplate({nodeName:"div",properties:{mode:"title"},events:this._cell$delegates,cssClasses:["ajax__calendar_title"]},C);
},_buildBody:function(){this._body=$common.createElementFromTemplate({nodeName:"div",cssClasses:["ajax__calendar_body"]},this._popupDiv);
this._buildDays();this._buildMonths();this._buildYears();},_buildFooter:function(){var A=$common.createElementFromTemplate({nodeName:"div"},this._popupDiv);
this._today=$common.createElementFromTemplate({nodeName:"div",properties:{mode:"today"},events:this._cell$delegates,cssClasses:["ajax__calendar_footer","ajax__calendar_today"]},A);
},_buildDays:function(){var F=Sys.CultureInfo.CurrentCulture.dateTimeFormat;this._days=$common.createElementFromTemplate({nodeName:"div",cssClasses:["ajax__calendar_days"]},this._body);
this._modes["days"]=this._days;this._daysTable=$common.createElementFromTemplate({nodeName:"table",properties:{cellPadding:0,cellSpacing:0,border:0,style:{margin:"auto"}}},this._days);
this._daysTableHeader=$common.createElementFromTemplate({nodeName:"thead"},this._daysTable);
this._daysTableHeaderRow=$common.createElementFromTemplate({nodeName:"tr"},this._daysTableHeader);
this._daysBody=$common.createElementFromTemplate({nodeName:"tbody"},this._daysTable);
for(var D=0;D<7;D++){var A=$common.createElementFromTemplate({nodeName:"td"},this._daysTableHeaderRow);
var B=$common.createElementFromTemplate({nodeName:"div",cssClasses:["ajax__calendar_dayname"]},A);
}for(var D=0;D<6;D++){var C=$common.createElementFromTemplate({nodeName:"tr"},this._daysBody);
for(var E=0;E<7;E++){var A=$common.createElementFromTemplate({nodeName:"td"},C);var B=$common.createElementFromTemplate({nodeName:"div",properties:{mode:"day",innerHTML:"&nbsp;"},events:this._cell$delegates,cssClasses:["ajax__calendar_day"]},A);
}}},_buildMonths:function(){var E=Sys.CultureInfo.CurrentCulture.dateTimeFormat;this._months=$common.createElementFromTemplate({nodeName:"div",cssClasses:["ajax__calendar_months"],visible:false},this._body);
this._modes["months"]=this._months;this._monthsTable=$common.createElementFromTemplate({nodeName:"table",properties:{cellPadding:0,cellSpacing:0,border:0,style:{margin:"auto"}}},this._months);
this._monthsBody=$common.createElementFromTemplate({nodeName:"tbody"},this._monthsTable);
for(var C=0;C<3;C++){var F=$common.createElementFromTemplate({nodeName:"tr"},this._monthsBody);
for(var D=0;D<4;D++){var A=$common.createElementFromTemplate({nodeName:"td"},F);var B=$common.createElementFromTemplate({nodeName:"div",properties:{mode:"month",month:(C*4)+D,innerHTML:"<br />"+E.AbbreviatedMonthNames[(C*4)+D]},events:this._cell$delegates,cssClasses:["ajax__calendar_month"]},A);
}}},_buildYears:function(){this._years=$common.createElementFromTemplate({nodeName:"div",cssClasses:["ajax__calendar_years"],visible:false},this._body);
this._modes["years"]=this._years;this._yearsTable=$common.createElementFromTemplate({nodeName:"table",properties:{cellPadding:0,cellSpacing:0,border:0,style:{margin:"auto"}}},this._years);
this._yearsBody=$common.createElementFromTemplate({nodeName:"tbody"},this._yearsTable);
for(var C=0;C<3;C++){var E=$common.createElementFromTemplate({nodeName:"tr"},this._yearsBody);
for(var D=0;D<4;D++){var B=$common.createElementFromTemplate({nodeName:"td"},E);var A=$common.createElementFromTemplate({nodeName:"div",properties:{mode:"year",year:((C*4)+D)-1},events:this._cell$delegates,cssClasses:["ajax__calendar_year"]},B);
}}},_performLayout:function(){var A=this.get_element();if(!A){return;}if(!this.get_isInitialized()){return;
}if(!this._isOpen){return;}var L=Sys.CultureInfo.CurrentCulture.dateTimeFormat;var C=this.get_selectedDate();
var R=this._getEffectiveVisibleDate();var D=this.get_todaysDate();switch(this._mode){case"days":var K=this._getFirstDayOfWeek();
var N=R.getDay()-K;if(N<=0){N+=7;}var J=new Date(R.getFullYear(),R.getMonth(),R.getDate()-N);
var P=J;for(var F=0;F<7;F++){var Q=this._daysTableHeaderRow.cells[F].firstChild;if(Q.firstChild){Q.removeChild(Q.firstChild);
}Q.appendChild(document.createTextNode(L.ShortestDayNames[(F+K)%7]));}for(var E=0;
E<6;E++){var I=this._daysBody.rows[E];for(var H=0;H<7;H++){var Q=I.cells[H].firstChild;
if(Q.firstChild){Q.removeChild(Q.firstChild);}Q.appendChild(document.createTextNode(P.getDate()));
Q.title=P.localeFormat("D");Q.date=P;$common.removeCssClasses(Q.parentNode,["ajax__calendar_other","ajax__calendar_active"]);
Sys.UI.DomElement.addCssClass(Q.parentNode,this._getCssClass(Q.date,"d"));P=new Date(P.getFullYear(),P.getMonth(),P.getDate()+1);
}}this._prevArrow.date=new Date(R.getFullYear(),R.getMonth()-1,1);this._nextArrow.date=new Date(R.getFullYear(),R.getMonth()+1,1);
if(this._title.firstChild){this._title.removeChild(this._title.firstChild);}this._title.appendChild(document.createTextNode(R.localeFormat("MMMM, yyyy")));
this._title.date=R;break;case"months":for(var F=0;F<this._monthsBody.rows.length;
F++){var M=this._monthsBody.rows[F];for(var G=0;G<M.cells.length;G++){var B=M.cells[G].firstChild;
B.date=new Date(R.getFullYear(),B.month,1);$common.removeCssClasses(B.parentNode,["ajax__calendar_other","ajax__calendar_active"]);
Sys.UI.DomElement.addCssClass(B.parentNode,this._getCssClass(B.date,"M"));}}if(this._title.firstChild){this._title.removeChild(this._title.firstChild);
}this._title.appendChild(document.createTextNode(R.localeFormat("yyyy")));this._title.date=R;
this._prevArrow.date=new Date(R.getFullYear()-1,0,1);this._nextArrow.date=new Date(R.getFullYear()+1,0,1);
break;case"years":var O=(Math.floor(R.getFullYear()/10)*10);for(var F=0;F<this._yearsBody.rows.length;
F++){var M=this._yearsBody.rows[F];for(var G=0;G<M.cells.length;G++){var B=M.cells[G].firstChild;
B.date=new Date(O+B.year,0,1);if(B.firstChild){B.removeChild(B.lastChild);}else{B.appendChild(document.createElement("br"));
}B.appendChild(document.createTextNode(O+B.year));$common.removeCssClasses(B.parentNode,["ajax__calendar_other","ajax__calendar_active"]);
Sys.UI.DomElement.addCssClass(B.parentNode,this._getCssClass(B.date,"y"));}}if(this._title.firstChild){this._title.removeChild(this._title.firstChild);
}this._title.appendChild(document.createTextNode(O.toString()+"-"+(O+9).toString()));
this._title.date=R;this._prevArrow.date=new Date(O-10,0,1);this._nextArrow.date=new Date(O+10,0,1);
break;}if(this._today.firstChild){this._today.removeChild(this._today.firstChild);
}this._today.appendChild(document.createTextNode(String.format(AjaxControlToolkit.Resources.Calendar_Today,D.localeFormat("MMMM d, yyyy"))));
this._today.date=D;},_ensureCalendar:function(){if(!this._container){var A=this.get_element();
this._buildCalendar();this._buildHeader();this._buildBody();this._buildFooter();this._popupBehavior=new $create(AjaxControlToolkit.PopupBehavior,{parentElement:A,positioningMode:AjaxControlToolkit.PositioningMode.BottomLeft},{},{},this._popupDiv);
}},_fireChanged:function(){var A=this.get_element();if(document.createEventObject){A.fireEvent("onchange");
}else{if(document.createEvent){var B=document.createEvent("HTMLEvents");B.initEvent("change",true,true);
A.dispatchEvent(B);}}},_switchMonth:function(B,A){if(this._isAnimating){return;}var C=this._getEffectiveVisibleDate();
if((B&&B.getFullYear()==C.getFullYear()&&B.getMonth()==C.getMonth())){A=true;}if(this._animated&&!A){this._isAnimating=true;
var D=this._modes[this._mode];var F=D.cloneNode(true);this._body.appendChild(F);if(C>B){$common.setLocation(D,{x:-162,y:0});
$common.setVisible(D,true);this._modeChangeMoveTopOrLeftAnimation.set_propertyKey("left");
this._modeChangeMoveTopOrLeftAnimation.set_target(D);this._modeChangeMoveTopOrLeftAnimation.set_startValue(-this._width);
this._modeChangeMoveTopOrLeftAnimation.set_endValue(0);$common.setLocation(F,{x:0,y:0});
$common.setVisible(F,true);this._modeChangeMoveBottomOrRightAnimation.set_propertyKey("left");
this._modeChangeMoveBottomOrRightAnimation.set_target(F);this._modeChangeMoveBottomOrRightAnimation.set_startValue(0);
this._modeChangeMoveBottomOrRightAnimation.set_endValue(this._width);}else{$common.setLocation(F,{x:0,y:0});
$common.setVisible(F,true);this._modeChangeMoveTopOrLeftAnimation.set_propertyKey("left");
this._modeChangeMoveTopOrLeftAnimation.set_target(F);this._modeChangeMoveTopOrLeftAnimation.set_endValue(-this._width);
this._modeChangeMoveTopOrLeftAnimation.set_startValue(0);$common.setLocation(D,{x:162,y:0});
$common.setVisible(D,true);this._modeChangeMoveBottomOrRightAnimation.set_propertyKey("left");
this._modeChangeMoveBottomOrRightAnimation.set_target(D);this._modeChangeMoveBottomOrRightAnimation.set_endValue(0);
this._modeChangeMoveBottomOrRightAnimation.set_startValue(this._width);}this._visibleDate=B;
this.invalidate();var E=Function.createDelegate(this,function(){this._body.removeChild(F);
F=null;this._isAnimating=false;this._modeChangeAnimation.remove_ended(E);});this._modeChangeAnimation.add_ended(E);
this._modeChangeAnimation.play();}else{this._visibleDate=B;this.invalidate();}},_switchMode:function(E,B){if(this._isAnimating||(this._mode==E)){return;
}var A=this._modeOrder[this._mode]<this._modeOrder[E];var F=this._modes[this._mode];
var C=this._modes[E];this._mode=E;if(this._animated&&!B){this._isAnimating=true;this.invalidate();
if(A){$common.setLocation(C,{x:0,y:-this._height});$common.setVisible(C,true);this._modeChangeMoveTopOrLeftAnimation.set_propertyKey("top");
this._modeChangeMoveTopOrLeftAnimation.set_target(C);this._modeChangeMoveTopOrLeftAnimation.set_startValue(-this._height);
this._modeChangeMoveTopOrLeftAnimation.set_endValue(0);$common.setLocation(F,{x:0,y:0});
$common.setVisible(F,true);this._modeChangeMoveBottomOrRightAnimation.set_propertyKey("top");
this._modeChangeMoveBottomOrRightAnimation.set_target(F);this._modeChangeMoveBottomOrRightAnimation.set_startValue(0);
this._modeChangeMoveBottomOrRightAnimation.set_endValue(this._height);}else{$common.setLocation(F,{x:0,y:0});
$common.setVisible(F,true);this._modeChangeMoveTopOrLeftAnimation.set_propertyKey("top");
this._modeChangeMoveTopOrLeftAnimation.set_target(F);this._modeChangeMoveTopOrLeftAnimation.set_endValue(-this._height);
this._modeChangeMoveTopOrLeftAnimation.set_startValue(0);$common.setLocation(C,{x:0,y:139});
$common.setVisible(C,true);this._modeChangeMoveBottomOrRightAnimation.set_propertyKey("top");
this._modeChangeMoveBottomOrRightAnimation.set_target(C);this._modeChangeMoveBottomOrRightAnimation.set_endValue(0);
this._modeChangeMoveBottomOrRightAnimation.set_startValue(this._height);}var D=Function.createDelegate(this,function(){this._isAnimating=false;
this._modeChangeAnimation.remove_ended(D);});this._modeChangeAnimation.add_ended(D);
this._modeChangeAnimation.play();}else{this._mode=E;$common.setVisible(F,false);this.invalidate();
$common.setVisible(C,true);$common.setLocation(C,{x:0,y:0});}},_isSelected:function(B,C){var A=this.get_selectedDate();
if(!A){return false;}switch(C){case"d":if(B.getDate()!=A.getDate()){return false;
}case"M":if(B.getMonth()!=A.getMonth()){return false;}case"y":if(B.getFullYear()!=A.getFullYear()){return false;
}break;}return true;},_isOther:function(B,C){var A=this._getEffectiveVisibleDate();
switch(C){case"d":return(B.getFullYear()!=A.getFullYear()||B.getMonth()!=A.getMonth());
case"M":return false;case"y":var D=(Math.floor(A.getFullYear()/10)*10);return B.getFullYear()<D||(D+10)<=B.getFullYear();
}return false;},_getCssClass:function(A,B){if(this._isSelected(A,B)){return"ajax__calendar_active";
}else{if(this._isOther(A,B)){return"ajax__calendar_other";}else{return"";}}},_getEffectiveVisibleDate:function(){var A=this.get_visibleDate();
if(A==null){A=this.get_selectedDate();}if(A==null){A=this.get_todaysDate();}return new Date(A.getFullYear(),A.getMonth(),1);
},_getFirstDayOfWeek:function(){if(this.get_firstDayOfWeek()!=AjaxControlToolkit.FirstDayOfWeek.Default){return this.get_firstDayOfWeek();
}return Sys.CultureInfo.CurrentCulture.dateTimeFormat.FirstDayOfWeek;},_parseTextValue:function(B){var A=null;
if(B){A=Date.parseLocale(B,this.get_format());}if(isNaN(A)){A=null;}return A;},_onblur:function(){this._focus.cancel();
this.hide();},_onfocus:function(){this._blur.cancel();this.get_element().focus();
},_element_onfocus:function(A){if(this._enabled&&this._button==null){this._focus.cancel();
this._blur.cancel();this.show();}},_element_onblur:function(A){if((A.type=="blur"&&Sys.Browser.agent!=Sys.Browser.InternetExplorer)||(A.type=="focusout"&&Sys.Browser.agent==Sys.Browser.InternetExplorer)){if(this._button==null){this._focus.cancel();
this._blur.post();}}},_element_onchange:function(B){if(!this._selectedDateChanging){var A=this.get_element();
this._selectedDate=this._parseTextValue(AjaxControlToolkit.TextBoxWrapper.get_Wrapper(A).get_Value());
this._switchMonth(this._selectedDate,this._selectedDate==null);}},_popup_onfocus:function(A){if((A.type=="focus"&&Sys.Browser.agent!=Sys.Browser.InternetExplorer)||(A.type=="activate"&&Sys.Browser.agent==Sys.Browser.InternetExplorer)||(Sys.Browser.agent===Sys.Browser.Safari)||(Sys.Browser.agent===Sys.Browser.Opera)){if(this._button==null){this._blur.cancel();
this._focus.post();}}},_popup_ondragstart:function(A){A.stopPropagation();A.preventDefault();
},_popup_onselect:function(A){A.stopPropagation();A.preventDefault();},_cell_onmouseover:function(E){if(Sys.Browser.agent===Sys.Browser.Safari){for(var D=0;
D<this._daysBody.rows.length;D++){var C=this._daysBody.rows[D];for(var A=0;A<C.cells.length;
A++){Sys.UI.DomElement.removeCssClass(C.cells[A].firstChild.parentNode,"ajax__calendar_hover");
}}}var B=E.target;Sys.UI.DomElement.addCssClass(B.parentNode,"ajax__calendar_hover");
E.stopPropagation();},_cell_onmouseout:function(B){var A=B.target;Sys.UI.DomElement.removeCssClass(A.parentNode,"ajax__calendar_hover");
B.stopPropagation();},_cell_onclick:function(C){if((Sys.Browser.agent===Sys.Browser.Safari)||(Sys.Browser.agent===Sys.Browser.Opera)){this._popup_onfocus(C);
}if(!this._enabled){return;}var A=C.target;var B=this._getEffectiveVisibleDate();
Sys.UI.DomElement.removeCssClass(A.parentNode,"ajax__calendar_hover");switch(A.mode){case"prev":case"next":this._switchMonth(A.date);
break;case"title":switch(this._mode){case"days":this._switchMode("months");break;
case"months":this._switchMode("years");break;}break;case"month":if(A.month==B.getMonth()){this._switchMode("days");
}else{this._visibleDate=A.date;this._switchMode("days");}break;case"year":if(A.date.getFullYear()==B.getFullYear()){this._switchMode("months");
}else{this._visibleDate=A.date;this._switchMode("months");}break;case"day":this.set_selectedDate(A.date);
this._switchMonth(A.date);if(this._button!=null){this.hide();}this.raiseDateSelectionChanged();
break;case"today":this.set_selectedDate(A.date);this._switchMonth(A.date);if(this._button!=null){this.hide();
}this.raiseDateSelectionChanged();break;}C.stopPropagation();C.preventDefault();},_button_onclick:function(A){if(!this._isOpen){A.preventDefault();
A.stopPropagation();if(this._enabled){this.show();}}else{this.hide();}}};AjaxControlToolkit.CalendarBehavior.registerClass("AjaxControlToolkit.CalendarBehavior",AjaxControlToolkit.BehaviorBase);
Type.registerNamespace("AjaxControlToolkit");AjaxControlToolkit.CollapsiblePanelExpandDirection=function(){throw Error.invalidOperation();
};AjaxControlToolkit.CollapsiblePanelExpandDirection.prototype={Horizontal:0,Vertical:1};
AjaxControlToolkit.CollapsiblePanelExpandDirection.registerEnum("AjaxControlToolkit.CollapsiblePanelExpandDirection",false);
AjaxControlToolkit.CollapsiblePanelBehavior=function(A){AjaxControlToolkit.CollapsiblePanelBehavior.initializeBase(this,[A]);
this._collapsedSize=0;this._expandedSize=0;this._scrollContents=null;this._collapsed=false;
this._expandControlID=null;this._collapseControlID=null;this._textLabelID=null;this._collapsedText=null;
this._expandedText=null;this._imageControlID=null;this._expandedImage=null;this._collapsedImage=null;
this._suppressPostBack=null;this._autoExpand=null;this._autoCollapse=null;this._expandDirection=AjaxControlToolkit.CollapsiblePanelExpandDirection.Vertical;
this._collapseClickHandler=null;this._expandClickHandler=null;this._panelMouseEnterHandler=null;
this._panelMouseLeaveHandler=null;this._childDiv=null;this._animation=null;};AjaxControlToolkit.CollapsiblePanelBehavior.prototype={initialize:function(){AjaxControlToolkit.CollapsiblePanelBehavior.callBaseMethod(this,"initialize");
var B=this.get_element();this._animation=new AjaxControlToolkit.Animation.LengthAnimation(B,0.25,10,"style",null,0,0,"px");
if(this._expandDirection==AjaxControlToolkit.CollapsiblePanelExpandDirection.Vertical){this._animation.set_propertyKey("height");
}else{if(this._expandDirection==AjaxControlToolkit.CollapsiblePanelExpandDirection.Horizontal){this._animation.set_propertyKey("width");
}}this._animation.add_ended(Function.createDelegate(this,this._onAnimateComplete));
if(this._suppressPostBack==null){if(B.tagName=="INPUT"&&B.type=="checkbox"){this._suppressPostBack=false;
this.raisePropertyChanged("SuppressPostBack");}else{if(B.tagName=="A"){this._suppressPostBack=true;
this.raisePropertyChanged("SuppressPostBack");}}}var D=AjaxControlToolkit.CollapsiblePanelBehavior.callBaseMethod(this,"get_ClientState");
if(D&&D!=""){var E=Boolean.parse(D);if(this._collapsed!=E){this._collapsed=E;this.raisePropertyChanged("Collapsed");
}}this._setupChildDiv();if(this._collapsed){this._setTargetSize(this._getCollapsedSize());
}else{this._setTargetSize(this._getExpandedSize());}this._setupState(this._collapsed);
if(this._collapseControlID==this._expandControlID){this._collapseClickHandler=Function.createDelegate(this,this.togglePanel);
this._expandClickHandler=null;}else{this._collapseClickHandler=Function.createDelegate(this,this.collapsePanel);
this._expandClickHandler=Function.createDelegate(this,this.expandPanel);}if(this._autoExpand){this._panelMouseEnterHandler=Function.createDelegate(this,this._onMouseEnter);
$addHandler(B,"mouseover",this._panelMouseEnterHandler);}if(this._autoCollapse){this._panelMouseLeaveHandler=Function.createDelegate(this,this._onMouseLeave);
$addHandler(B,"mouseout",this._panelMouseLeaveHandler);}if(this._collapseControlID){var A=$get(this._collapseControlID);
if(!A){throw Error.argument("CollapseControlID",String.format(AjaxControlToolkit.Resources.CollapsiblePanel_NoControlID,this._collapseControlID));
}else{$addHandler(A,"click",this._collapseClickHandler);}}if(this._expandControlID){if(this._expandClickHandler){var C=$get(this._expandControlID);
if(!C){throw Error.argument("ExpandControlID",String.format(AjaxControlToolkit.Resources.CollapsiblePanel_NoControlID,this._expandControlID));
}else{$addHandler(C,"click",this._expandClickHandler);}}}},dispose:function(){var B=this.get_element();
if(this._collapseClickHandler){var A=(this._collapseControlID?$get(this._collapseControlID):null);
if(A){$removeHandler(A,"click",this._collapseClickHandler);}this._collapseClickHandler=null;
}if(this._expandClickHandler){var C=(this._expandControlID?$get(this._expandControlID):null);
if(C){$removeHandler(C,"click",this._expandClickHandler);}this._expandClickHandler=null;
}if(this._panelMouseEnterHandler){$removeHandler(B,"mouseover",this._panelMouseEnterHandler);
}if(this._panelMouseLeaveHandler){$removeHandler(B,"mouseout",this._panelMouseLeaveHandler);
}if(this._animation){this._animation.dispose();this._animation=null;}AjaxControlToolkit.CollapsiblePanelBehavior.callBaseMethod(this,"dispose");
},togglePanel:function(A){this._toggle(A);},expandPanel:function(A){this._doOpen(A);
},collapsePanel:function(A){this._doClose(A);},_checkCollapseHide:function(){if(this._collapsed&&this._getTargetSize()==0){var A=this.get_element();
var B=$common.getCurrentStyle(A,"display");if(!A.oldDisplay&&B!="none"){A.oldDisplay=B;
A.style.display="none";}return true;}return false;},_doClose:function(A){var B=new Sys.CancelEventArgs();
this.raiseCollapsing(B);if(B.get_cancel()){return;}if(this._animation){this._animation.stop();
this._animation.set_startValue(this._getTargetSize());this._animation.set_endValue(this._getCollapsedSize());
this._animation.play();}this._setupState(true);if(this._suppressPostBack){if(A&&A.preventDefault){A.preventDefault();
}else{if(event){event.returnValue=false;}return false;}}},_doOpen:function(A){var C=new Sys.CancelEventArgs();
this.raiseExpanding(C);if(C.get_cancel()){return;}if(this._animation){this._animation.stop();
var B=this.get_element();if(this._checkCollapseHide()&&$common.getCurrentStyle(B,"display",B.style.display)){if(B.oldDisplay){B.style.display=B.oldDisplay;
}else{if(B.style.removeAttribute){B.style.removeAttribute("display");}else{B.style.removeProperty("display");
}}B.oldDisplay=null;}this._animation.set_startValue(this._getTargetSize());this._animation.set_endValue(this._getExpandedSize());
this._animation.play();}this._setupState(false);if(this._suppressPostBack){if(A&&A.preventDefault){A.preventDefault();
}else{if(event){event.returnValue=false;}return false;}}},_onAnimateComplete:function(){var A=this.get_element();
if(!this._collapsed&&!this._expandedSize){if(this._expandDirection==AjaxControlToolkit.CollapsiblePanelExpandDirection.Vertical){if(this._childDiv.offsetHeight<=A.offsetHeight){A.style.height="auto";
this.raisePropertyChanged("TargetHeight");}else{this._checkCollapseHide();}}else{if(this._childDiv.offsetWidth<=A.offsetWidth){A.style.width="auto";
this.raisePropertyChanged("TargetWidth");}else{this._checkCollapseHide();}}}else{this._checkCollapseHide();
}if(this._collapsed){this.raiseCollapseComplete();this.raiseCollapsed(Sys.EventArgs.Empty);
}else{this.raiseExpandComplete();this.raiseExpanded(new Sys.EventArgs());}},_onMouseEnter:function(A){if(this._autoExpand){this.expandPanel(A);
}},_onMouseLeave:function(A){if(this._autoCollapse){this.collapsePanel(A);}},_getExpandedSize:function(){if(this._expandedSize){return this._expandedSize;
}if(this._expandDirection==AjaxControlToolkit.CollapsiblePanelExpandDirection.Vertical){return this._childDiv.offsetHeight;
}else{if(this._expandDirection==AjaxControlToolkit.CollapsiblePanelExpandDirection.Horizontal){return this._childDiv.offsetWidth;
}}},_getCollapsedSize:function(){if(this._collapsedSize){return this._collapsedSize;
}return 0;},_getTargetSize:function(){var A;if(this._expandDirection==AjaxControlToolkit.CollapsiblePanelExpandDirection.Vertical){A=this.get_TargetHeight();
}else{if(this._expandDirection==AjaxControlToolkit.CollapsiblePanelExpandDirection.Horizontal){A=this.get_TargetWidth();
}}if(A===undefined){A=0;}return A;},_setTargetSize:function(A){var B=this._collapsed||this._expandedSize;
var C=this.get_element();if(this._expandDirection==AjaxControlToolkit.CollapsiblePanelExpandDirection.Vertical){if(B||A<C.offsetHeight){this.set_TargetHeight(A);
}else{C.style.height="auto";this.raisePropertyChanged("TargetHeight");}}else{if(this._expandDirection==AjaxControlToolkit.CollapsiblePanelExpandDirection.Horizontal){if(B||A<C.offsetWidth){this.set_TargetWidth(A);
}else{C.style.width="auto";this.raisePropertyChanged("TargetWidth");}}}this._checkCollapseHide();
},_setupChildDiv:function(){var A=this._getTargetSize();var C=this.get_element();
this._childDiv=C.cloneNode(false);this._childDiv.id="";while(C.hasChildNodes()){var B=C.childNodes[0];
B=C.removeChild(B);this._childDiv.appendChild(B);}C.style.padding="";C.style.border="";
if(this._scrollContents){if(this._expandDirection==AjaxControlToolkit.CollapsiblePanelExpandDirection.Vertical){C.style.overflowY="scroll";
this._childDiv.style.overflowY="";}else{C.style.overflowX="scroll";this._childDiv.style.overflowX="";
}if(Sys.Browser.agent==Sys.Browser.Safari||Sys.Browser.agent==Sys.Browser.Opera){C.style.overflow="scroll";
this._childDiv.style.overflow="";}}else{if(this._expandDirection==AjaxControlToolkit.CollapsiblePanelExpandDirection.Vertical){C.style.overflowY="hidden";
this._childDiv.style.overflowY="";}else{C.style.overflowX="hidden";this._childDiv.style.overflowX="";
}if(Sys.Browser.Agent==Sys.Browser.Safari||Sys.Browser.Agent==Sys.Browser.Opera){C.style.overflow="hidden";
this._childDiv.style.overflow="";}}this._childDiv.style.position="";this._childDiv.style.margin="";
if(A==this._collapsedSize){if(this._expandDirection==AjaxControlToolkit.CollapsiblePanelExpandDirection.Vertical){this._childDiv.style.height="auto";
}else{if(this._expandDirection==AjaxControlToolkit.CollapsiblePanelExpandDirection.Horizontal){this._childDiv.style.width="auto";
}}}C.appendChild(this._childDiv);if(this._collapsed){A=this._getCollapsedSize();}else{A=this._getExpandedSize();
}if(this._expandDirection==AjaxControlToolkit.CollapsiblePanelExpandDirection.Vertical){C.style.height=A+"px";
if(!this._expandedSize){C.style.height="auto";}else{C.style.height=this._expandedSize+"px";
}this._childDiv.style.height="auto";}else{if(this._expandDirection==AjaxControlToolkit.CollapsiblePanelExpandDirection.Horizontal){C.style.width=A+"px";
if(!this._expandedSize){C.style.width="auto";}else{C.style.width=this._expandedSize+"px";
}this._childDiv.style.width="auto";}}},_setupState:function(A){if(A){if(this._textLabelID&&this._collapsedText){var C=$get(this._textLabelID);
if(C){C.innerHTML=this._collapsedText;}}if(this._imageControlID&&this._collapsedImage){var B=$get(this._imageControlID);
if(B&&B.src){B.src=this._collapsedImage;if(this._expandedText||this._collapsedText){B.title=this._collapsedText;
}}}}else{if(this._textLabelID&&this._expandedText){var C=$get(this._textLabelID);
if(C){C.innerHTML=this._expandedText;}}if(this._imageControlID&&this._expandedImage){var B=$get(this._imageControlID);
if(B&&B.src){B.src=this._expandedImage;if(this._expandedText||this._collapsedText){B.title=this._expandedText;
}}}}if(this._collapsed!=A){this._collapsed=A;this.raisePropertyChanged("Collapsed");
}AjaxControlToolkit.CollapsiblePanelBehavior.callBaseMethod(this,"set_ClientState",[this._collapsed.toString()]);
},_toggle:function(A){if(this.get_Collapsed()){return this.expandPanel(A);}else{return this.collapsePanel(A);
}},add_collapsing:function(A){this.get_events().addHandler("collapsing",A);},remove_collapsing:function(A){this.get_events().removeHandler("collapsing",A);
},raiseCollapsing:function(B){var A=this.get_events().getHandler("collapsing");if(A){A(this,B);
}},add_collapsed:function(A){this.get_events().addHandler("collapsed",A);},remove_collapsed:function(A){this.get_events().removeHandler("collapsed",A);
},raiseCollapsed:function(B){var A=this.get_events().getHandler("collapsed");if(A){A(this,B);
}},add_collapseComplete:function(A){this.get_events().addHandler("collapseComplete",A);
},remove_collapseComplete:function(A){this.get_events().removeHandler("collapseComplete",A);
},raiseCollapseComplete:function(){var A=this.get_events().getHandler("collapseComplete");
if(A){A(this,Sys.EventArgs.Empty);}},add_expanding:function(A){this.get_events().addHandler("expanding",A);
},remove_expanding:function(A){this.get_events().removeHandler("expanding",A);},raiseExpanding:function(B){var A=this.get_events().getHandler("expanding");
if(A){A(this,B);}},add_expanded:function(A){this.get_events().addHandler("expanded",A);
},remove_expanded:function(A){this.get_events().removeHandler("expanded",A);},raiseExpanded:function(B){var A=this.get_events().getHandler("expanded");
if(A){A(this,B);}},add_expandComplete:function(A){this.get_events().addHandler("expandComplete",A);
},remove_expandComplete:function(A){this.get_events().removeHandler("expandComplete",A);
},raiseExpandComplete:function(){var A=this.get_events().getHandler("expandComplete");
if(A){A(this,Sys.EventArgs.Empty);}},get_TargetHeight:function(){return this.get_element().offsetHeight;
},set_TargetHeight:function(A){this.get_element().style.height=A+"px";this.raisePropertyChanged("TargetHeight");
},get_TargetWidth:function(){return this.get_element().offsetWidth;},set_TargetWidth:function(A){this.get_element().style.width=A+"px";
this.raisePropertyChanged("TargetWidth");},get_Collapsed:function(){return this._collapsed;
},set_Collapsed:function(A){if(this.get_isInitialized()&&this.get_element()&&A!=this.get_Collapsed()){this.togglePanel();
}else{this._collapsed=A;this.raisePropertyChanged("Collapsed");}},get_CollapsedSize:function(){return this._collapsedSize;
},set_CollapsedSize:function(A){if(this._collapsedSize!=A){this._collapsedSize=A;
this.raisePropertyChanged("CollapsedSize");}},get_ExpandedSize:function(){return this._expandedSize;
},set_ExpandedSize:function(A){if(this._expandedSize!=A){this._expandedSize=A;this.raisePropertyChanged("ExpandedSize");
}},get_CollapseControlID:function(){return this._collapseControlID;},set_CollapseControlID:function(A){if(this._collapseControlID!=A){this._collapseControlID=A;
this.raisePropertyChanged("CollapseControlID");}},get_ExpandControlID:function(){return this._expandControlID;
},set_ExpandControlID:function(A){if(this._expandControlID!=A){this._expandControlID=A;
this.raisePropertyChanged("ExpandControlID");}},get_ScrollContents:function(){return this._scrollContents;
},set_ScrollContents:function(A){if(this._scrollContents!=A){this._scrollContents=A;
this.raisePropertyChanged("ScrollContents");}},get_SuppressPostBack:function(){return this._suppressPostBack;
},set_SuppressPostBack:function(A){if(this._suppressPostBack!=A){this._suppressPostBack=A;
this.raisePropertyChanged("SuppressPostBack");}},get_TextLabelID:function(){return this._textLabelID;
},set_TextLabelID:function(A){if(this._textLabelID!=A){this._textLabelID=A;this.raisePropertyChanged("TextLabelID");
}},get_ExpandedText:function(){return this._expandedText;},set_ExpandedText:function(A){if(this._expandedText!=A){this._expandedText=A;
this.raisePropertyChanged("ExpandedText");}},get_CollapsedText:function(){return this._collapsedText;
},set_CollapsedText:function(A){if(this._collapsedText!=A){this._collapsedText=A;
this.raisePropertyChanged("CollapsedText");}},get_ImageControlID:function(){return this._imageControlID;
},set_ImageControlID:function(A){if(this._imageControlID!=A){this._imageControlID=A;
this.raisePropertyChanged("ImageControlID");}},get_ExpandedImage:function(){return this._expandedImage;
},set_ExpandedImage:function(A){if(this._expandedImage!=A){this._expandedImage=A;
this.raisePropertyChanged("ExpandedImage");}},get_CollapsedImage:function(){return this._collapsedImage;
},set_CollapsedImage:function(A){if(this._collapsedImage!=A){this._collapsedImage=A;
this.raisePropertyChanged("CollapsedImage");}},get_AutoExpand:function(){return this._autoExpand;
},set_AutoExpand:function(A){if(this._autoExpand!=A){this._autoExpand=A;this.raisePropertyChanged("AutoExpand");
}},get_AutoCollapse:function(){return this._autoCollapse;},set_AutoCollapse:function(A){if(this._autoCollapse!=A){this._autoCollapse=A;
this.raisePropertyChanged("AutoCollapse");}},get_ExpandDirection:function(){return this._expandDirection==AjaxControlToolkit.CollapsiblePanelExpandDirection.Vertical;
},set_ExpandDirection:function(A){if(this._expandDirection!=A){this._expandDirection=A;
this.raisePropertyChanged("ExpandDirection");}}};AjaxControlToolkit.CollapsiblePanelBehavior.registerClass("AjaxControlToolkit.CollapsiblePanelBehavior",AjaxControlToolkit.BehaviorBase);
Type.registerNamespace("AjaxControlToolkit");AjaxControlToolkit.BoxCorners=function(){throw Error.invalidOperation();
};AjaxControlToolkit.BoxCorners.prototype={None:0,TopLeft:1,TopRight:2,BottomRight:4,BottomLeft:8,Top:1|2,Right:2|4,Bottom:4|8,Left:8|1,All:1|2|4|8};
AjaxControlToolkit.BoxCorners.registerEnum("AjaxControlToolkit.BoxCorners",true);
AjaxControlToolkit.RoundedCornersBehavior=function(A){AjaxControlToolkit.RoundedCornersBehavior.initializeBase(this,[A]);
this._corners=AjaxControlToolkit.BoxCorners.All;this._radius=5;this._color=null;this._parentDiv=null;
this._originalStyle=null;this._borderColor=null;};AjaxControlToolkit.RoundedCornersBehavior.prototype={initialize:function(){AjaxControlToolkit.RoundedCornersBehavior.callBaseMethod(this,"initialize");
this.buildParentDiv();},dispose:function(){this.disposeParentDiv();AjaxControlToolkit.RoundedCornersBehavior.callBaseMethod(this,"dispose");
},buildParentDiv:function(){var I=this.get_element();if(!I){return;}this.disposeParentDiv();
var D=this.getBackgroundColor();var L=I.offsetWidth;var J=I.cloneNode(false);this.moveChildren(I,J);
this._originalStyle=I.style.cssText;I.style.backgroundColor="transparent";I.style.verticalAlign="top";
I.style.padding="0";I.style.overflow="";I.style.className="";if(I.style.height){I.style.height=parseInt($common.getCurrentStyle(I,"height"))+(this._radius*2)+"px";
}else{if(!I.style.width&&(0<L)){I.style.width=L+"px";}}J.style.position="";J.style.border="";
J.style.margin="";J.style.width="100%";J.id="";J.removeAttribute("control");if(this._borderColor){J.style.borderTopStyle="none";
J.style.borderBottomStyle="none";J.style.borderLeftStyle="solid";J.style.borderRightStyle="solid";
J.style.borderLeftColor=this._borderColor;J.style.borderRightColor=this._borderColor;
J.style.borderLeftWidth="1px";J.style.borderRightWidth="1px";if(this._radius==0){J.style.borderTopStyle="solid";
J.style.borderBottomStyle="solid";J.style.borderTopColor=this._borderColor;J.style.borderBottomColor=this._borderColor;
J.style.borderTopWidth="1px";J.style.borderBottomWidth="1px";}}else{J.style.borderTopStyle="none";
J.style.borderBottomStyle="none";J.style.borderLeftStyle="none";J.style.borderRightStyle="none";
}var G=null;var A=this._radius;var H=this._radius;var F=0;for(var M=H;M>0;M--){var C=Math.acos(M/A);
var B=A-Math.round(Math.sin(C)*A);var E=document.createElement("DIV");E.__roundedDiv=true;
E.style.backgroundColor=D;E.style.marginLeft=B+"px";E.style.marginRight=(B-(this._borderColor?2:0))+"px";
E.style.height="1px";E.style.fontSize="1px";E.style.overflow="hidden";if(this._borderColor){E.style.borderLeftStyle="solid";
E.style.borderRightStyle="solid";E.style.borderLeftColor=this._borderColor;E.style.borderRightColor=this._borderColor;
var O=Math.max(0,F-B-1);E.style.borderLeftWidth=(O+1)+"px";E.style.borderRightWidth=(O+1)+"px";
if(M==H){E.__roundedDivNoBorder=true;E.style.backgroundColor=this._borderColor;}}I.insertBefore(E,G);
var K=E;E=E.cloneNode(true);E.__roundedDiv=true;I.insertBefore(E,G);var N=E;G=E;F=B;
if(!this.isCornerSet(AjaxControlToolkit.BoxCorners.TopLeft)){K.style.marginLeft="0";
if(this._borderColor){K.style.borderLeftWidth="1px";}}if(!this.isCornerSet(AjaxControlToolkit.BoxCorners.TopRight)){K.style.marginRight="0";
if(this._borderColor){K.style.borderRightWidth="1px";K.style.marginRight="-2px";}}if(!this.isCornerSet(AjaxControlToolkit.BoxCorners.BottomLeft)){N.style.marginLeft="0";
if(this._borderColor){N.style.borderLeftWidth="1px";}}if(!this.isCornerSet(AjaxControlToolkit.BoxCorners.BottomRight)){N.style.marginRight="0";
if(this._borderColor){N.style.borderRightWidth="1px";N.style.marginRight="-2px";}}}I.insertBefore(J,G);
this._parentDiv=J;},disposeParentDiv:function(){if(this._parentDiv){var D=this.get_element();
var A=D.childNodes;for(var C=A.length-1;C>=0;C--){var B=A[C];if(B){if(B==this._parentDiv){this.moveChildren(B,D);
}try{D.removeChild(B);}catch(D){}}}if(this._originalStyle){D.style.cssText=this._originalStyle;
this._originalStyle=null;}this._parentDiv=null;}},getBackgroundColor:function(){if(this._color){return this._color;
}return $common.getCurrentStyle(this.get_element(),"backgroundColor");},moveChildren:function(D,C){var A=0;
while(D.hasChildNodes()){var B=D.childNodes[0];B=D.removeChild(B);C.appendChild(B);
A++;}return A;},isCornerSet:function(A){return(this._corners&A)!=AjaxControlToolkit.BoxCorners.None;
},setCorner:function(B,A){if(A){this.set_Corners(this._corners|B);}else{this.set_Corners(this._corners&~B);
}},get_Color:function(){return this._color;},set_Color:function(A){if(A!=this._color){this._color=A;
this.buildParentDiv();this.raisePropertyChanged("Color");}},get_Radius:function(){return this._radius;
},set_Radius:function(A){if(A!=this._radius){this._radius=A;this.buildParentDiv();
this.raisePropertyChanged("Radius");}},get_Corners:function(){return this._corners;
},set_Corners:function(A){if(A!=this._corners){this._corners=A;this.buildParentDiv();
this.raisePropertyChanged("Corners");}},get_BorderColor:function(){return this._borderColor;
},set_BorderColor:function(A){if(A!=this._borderColor){this._borderColor=A;this.buildParentDiv();
this.raisePropertyChanged("BorderColor");}}};AjaxControlToolkit.RoundedCornersBehavior.registerClass("AjaxControlToolkit.RoundedCornersBehavior",AjaxControlToolkit.BehaviorBase);
Type.registerNamespace("AjaxControlToolkit");AjaxControlToolkit.DropShadowBehavior=function(A){AjaxControlToolkit.DropShadowBehavior.initializeBase(this,[A]);
this._opacity=1;this._width=5;this._shadowDiv=null;this._trackPosition=null;this._trackPositionDelay=50;
this._timer=null;this._tickHandler=null;this._roundedBehavior=null;this._shadowRoundedBehavior=null;
this._rounded=false;this._radius=5;this._lastX=null;this._lastY=null;this._lastW=null;
this._lastH=null;};AjaxControlToolkit.DropShadowBehavior.prototype={initialize:function(){AjaxControlToolkit.DropShadowBehavior.callBaseMethod(this,"initialize");
var A=this.get_element();if($common.getCurrentStyle(A,"position",A.style.position)!="absolute"){A.style.position="relative";
}if(this._rounded){this.setupRounded();}if(this._trackPosition){this.startTimer();
}this.setShadow();},dispose:function(){this.stopTimer();this.disposeShadowDiv();AjaxControlToolkit.DropShadowBehavior.callBaseMethod(this,"dispose");
},buildShadowDiv:function(){var B=this.get_element();if(!this.get_isInitialized()||!B||!this._width){return;
}var A=document.createElement("DIV");A.style.backgroundColor="black";A.style.position="absolute";
if(B.id){A.id=B.id+"_DropShadow";}this._shadowDiv=A;B.parentNode.appendChild(A);if(this._rounded){this._shadowDiv.style.height=Math.max(0,B.offsetHeight-(2*this._radius))+"px";
if(!this._shadowRoundedBehavior){this._shadowRoundedBehavior=$create(AjaxControlToolkit.RoundedCornersBehavior,{"Radius":this._radius},null,null,this._shadowDiv);
}else{this._shadowRoundedBehavior.set_Radius(this._radius);}}else{if(this._shadowRoundedBehavior){this._shadowRoundedBehavior.set_Radius(0);
}}if(this._opacity!=1){this.setupOpacity();}this.setShadow(false,true);this.updateZIndex();
},disposeShadowDiv:function(){if(this._shadowDiv){if(this._shadowDiv.parentNode){this._shadowDiv.parentNode.removeChild(this._shadowDiv);
}this._shadowDiv=null;}if(this._shadowRoundedBehavior){this._shadowRoundedBehavior.dispose();
this._shadowRoundedBehavior=null;}},onTimerTick:function(){this.setShadow();},startTimer:function(){if(!this._timer){if(!this._tickHandler){this._tickHandler=Function.createDelegate(this,this.onTimerTick);
}this._timer=new Sys.Timer();this._timer.set_interval(this._trackPositionDelay);this._timer.add_tick(this._tickHandler);
this._timer.set_enabled(true);}},stopTimer:function(){if(this._timer){this._timer.remove_tick(this._tickHandler);
this._timer.set_enabled(false);this._timer.dispose();this._timer=null;}},setShadow:function(I,B){var E=this.get_element();
if(!this.get_isInitialized()||!E||(!this._width&&!I)){return;}var A=this._shadowDiv;
if(!A){this.buildShadowDiv();}var C=$common.getLocation(E);if(I||this._lastX!=C.x||this._lastY!=C.y||!A){this._lastX=C.x;
this._lastY=C.y;var H=this.get_Width();if((E.parentNode.style.position=="absolute")||(E.parentNode.style.position=="fixed")){C.x=H;
C.y=H;}else{if(E.parentNode.style.position=="relative"){C.x=H;var D=E.parentNode.style.paddingTop;
D=D.replace("px","");var F=0;F=parseInt(D);C.y=H+F;}else{C.x+=H;C.y+=H;}}$common.setLocation(this._shadowDiv,C);
}var G=E.offsetHeight;var H=E.offsetWidth;if(I||G!=this._lastH||H!=this._lastW||!A){this._lastW=H;
this._lastH=G;if(!this._rounded||!A||B){this._shadowDiv.style.width=H+"px";this._shadowDiv.style.height=G+"px";
}else{this.disposeShadowDiv();this.setShadow();}}if(this._shadowDiv){this._shadowDiv.style.visibility=$common.getCurrentStyle(E,"visibility");
}},setupOpacity:function(){if(this.get_isInitialized()&&this._shadowDiv){$common.setElementOpacity(this._shadowDiv,this._opacity);
}},setupRounded:function(){if(!this._roundedBehavior&&this._rounded){this._roundedBehavior=$create(AjaxControlToolkit.RoundedCornersBehavior,null,null,null,this.get_element());
}if(this._roundedBehavior){this._roundedBehavior.set_Radius(this._rounded?this._radius:0);
}},updateZIndex:function(){if(!this._shadowDiv){return;}var C=this.get_element();
var A=C.style.zIndex;var B=this._shadowDiv.style.zIndex;if(B&&A&&A>B){return;}else{A=Math.max(2,A);
B=A-1;}C.style.zIndex=A;this._shadowDiv.style.zIndex=B;},updateRoundedCorners:function(){if(this.get_isInitialized()){this.setupRounded();
this.disposeShadowDiv();this.setShadow();}},get_Opacity:function(){return this._opacity;
},set_Opacity:function(A){if(this._opacity!=A){this._opacity=A;this.setupOpacity();
this.raisePropertyChanged("Opacity");}},get_Rounded:function(){return this._rounded;
},set_Rounded:function(A){if(A!=this._rounded){this._rounded=A;this.updateRoundedCorners();
this.raisePropertyChanged("Rounded");}},get_Radius:function(){return this._radius;
},set_Radius:function(A){if(A!=this._radius){this._radius=A;this.updateRoundedCorners();
this.raisePropertyChanged("Radius");}},get_Width:function(){return this._width;},set_Width:function(A){if(A!=this._width){this._width=A;
if(this._shadowDiv){$common.setVisible(this._shadowDiv,A>0);}this.setShadow(true);
this.raisePropertyChanged("Width");}},get_TrackPositionDelay:function(){return this._trackPositionDelay;
},set_TrackPositionDelay:function(A){if(A!=this._trackPositionDelay){this._trackPositionDelay=A;
if(this._trackPosition){this.stopTimer();this.startTimer();}this.raisePropertyChanged("TrackPositionDelay");
}},get_TrackPosition:function(){return this._trackPosition;},set_TrackPosition:function(A){if(A!=this._trackPosition){this._trackPosition=A;
if(this.get_element()){if(A){this.startTimer();}else{this.stopTimer();}}this.raisePropertyChanged("TrackPosition");
}}};AjaxControlToolkit.DropShadowBehavior.registerClass("AjaxControlToolkit.DropShadowBehavior",AjaxControlToolkit.BehaviorBase);
Type.registerNamespace("AjaxControlToolkit");AjaxControlToolkit.DynamicPopulateBehavior=function(A){AjaxControlToolkit.DynamicPopulateBehavior.initializeBase(this,[A]);
this._servicePath=null;this._serviceMethod=null;this._contextKey=null;this._cacheDynamicResults=false;
this._populateTriggerID=null;this._setUpdatingCssClass=null;this._clearDuringUpdate=true;
this._customScript=null;this._clickHandler=null;this._callID=0;this._currentCallID=-1;
this._populated=false;};AjaxControlToolkit.DynamicPopulateBehavior.prototype={initialize:function(){AjaxControlToolkit.DynamicPopulateBehavior.callBaseMethod(this,"initialize");
$common.prepareHiddenElementForATDeviceUpdate();if(this._populateTriggerID){var A=$get(this._populateTriggerID);
if(A){this._clickHandler=Function.createDelegate(this,this._onPopulateTriggerClick);
$addHandler(A,"click",this._clickHandler);}}},dispose:function(){if(this._populateTriggerID&&this._clickHandler){var A=$get(this._populateTriggerID);
if(A){$removeHandler(A,"click",this._clickHandler);}this._populateTriggerID=null;
this._clickHandler=null;}AjaxControlToolkit.DynamicPopulateBehavior.callBaseMethod(this,"dispose");
},populate:function(contextKey){if(this._populated&&this._cacheDynamicResults){return;
}if(this._currentCallID==-1){var eventArgs=new Sys.CancelEventArgs();this.raisePopulating(eventArgs);
if(eventArgs.get_cancel()){return;}this._setUpdating(true);}if(this._customScript){var scriptResult=eval(this._customScript);
this.get_element().innerHTML=scriptResult;this._setUpdating(false);}else{this._currentCallID=++this._callID;
if(this._servicePath&&this._serviceMethod){Sys.Net.WebServiceProxy.invoke(this._servicePath,this._serviceMethod,false,{contextKey:(contextKey?contextKey:this._contextKey)},Function.createDelegate(this,this._onMethodComplete),Function.createDelegate(this,this._onMethodError),this._currentCallID);
$common.updateFormToRefreshATDeviceBuffer();}}},_onMethodComplete:function(B,A,C){if(A!=this._currentCallID){return;
}var D=this.get_element();if(D){D.innerHTML=B;}this._setUpdating(false);},_onMethodError:function(D,A,B){if(A!=this._currentCallID){return;
}var C=this.get_element();if(C){if(D.get_timedOut()){C.innerHTML=AjaxControlToolkit.Resources.DynamicPopulate_WebServiceTimeout;
}else{C.innerHTML=String.format(AjaxControlToolkit.Resources.DynamicPopulate_WebServiceError,D.get_statusCode());
}}this._setUpdating(false);},_onPopulateTriggerClick:function(){this.populate(this._contextKey);
},_setUpdating:function(A){this.setStyle(A);if(!A){this._currentCallID=-1;this._populated=true;
this.raisePopulated(this,Sys.EventArgs.Empty);}},setStyle:function(A){var B=this.get_element();
if(this._setUpdatingCssClass){if(!A){B.className=this._oldCss;this._oldCss=null;}else{this._oldCss=B.className;
B.className=this._setUpdatingCssClass;}}if(A&&this._clearDuringUpdate){B.innerHTML="";
}},get_ClearContentsDuringUpdate:function(){return this._clearDuringUpdate;},set_ClearContentsDuringUpdate:function(A){if(this._clearDuringUpdate!=A){this._clearDuringUpdate=A;
this.raisePropertyChanged("ClearContentsDuringUpdate");}},get_ContextKey:function(){return this._contextKey;
},set_ContextKey:function(A){if(this._contextKey!=A){this._contextKey=A;this.raisePropertyChanged("ContextKey");
}},get_PopulateTriggerID:function(){return this._populateTriggerID;},set_PopulateTriggerID:function(A){if(this._populateTriggerID!=A){this._populateTriggerID=A;
this.raisePropertyChanged("PopulateTriggerID");}},get_ServicePath:function(){return this._servicePath;
},set_ServicePath:function(A){if(this._servicePath!=A){this._servicePath=A;this.raisePropertyChanged("ServicePath");
}},get_ServiceMethod:function(){return this._serviceMethod;},set_ServiceMethod:function(A){if(this._serviceMethod!=A){this._serviceMethod=A;
this.raisePropertyChanged("ServiceMethod");}},get_cacheDynamicResults:function(){return this._cacheDynamicResults;
},set_cacheDynamicResults:function(A){if(this._cacheDynamicResults!=A){this._cacheDynamicResults=A;
this.raisePropertyChanged("cacheDynamicResults");}},get_UpdatingCssClass:function(){return this._setUpdatingCssClass;
},set_UpdatingCssClass:function(A){if(this._setUpdatingCssClass!=A){this._setUpdatingCssClass=A;
this.raisePropertyChanged("UpdatingCssClass");}},get_CustomScript:function(){return this._customScript;
},set_CustomScript:function(A){if(this._customScript!=A){this._customScript=A;this.raisePropertyChanged("CustomScript");
}},add_populating:function(A){this.get_events().addHandler("populating",A);},remove_populating:function(A){this.get_events().removeHandler("populating",A);
},raisePopulating:function(B){var A=this.get_events().getHandler("populating");if(A){A(this,B);
}},add_populated:function(A){this.get_events().addHandler("populated",A);},remove_populated:function(A){this.get_events().removeHandler("populated",A);
},raisePopulated:function(B){var A=this.get_events().getHandler("populated");if(A){A(this,B);
}}};AjaxControlToolkit.DynamicPopulateBehavior.registerClass("AjaxControlToolkit.DynamicPopulateBehavior",AjaxControlToolkit.BehaviorBase);
Type.registerNamespace("AjaxControlToolkit");AjaxControlToolkit.IDragSource=function(){};
AjaxControlToolkit.IDragSource.prototype={get_dragDataType:function(){throw Error.notImplemented();
},getDragData:function(){throw Error.notImplemented();},get_dragMode:function(){throw Error.notImplemented();
},onDragStart:function(){throw Error.notImplemented();},onDrag:function(){throw Error.notImplemented();
},onDragEnd:function(){throw Error.notImplemented();}};AjaxControlToolkit.IDragSource.registerInterface("AjaxControlToolkit.IDragSource");
AjaxControlToolkit.IDropTarget=function(){};AjaxControlToolkit.IDropTarget.prototype={get_dropTargetElement:function(){throw Error.notImplemented();
},canDrop:function(){throw Error.notImplemented();},drop:function(){throw Error.notImplemented();
},onDragEnterTarget:function(){throw Error.notImplemented();},onDragLeaveTarget:function(){throw Error.notImplemented();
},onDragInTarget:function(){throw Error.notImplemented();}};AjaxControlToolkit.IDropTarget.registerInterface("AjaxControlToolkit.IDropTarget");
AjaxControlToolkit.DragMode=function(){throw Error.invalidOperation();};AjaxControlToolkit.DragMode.prototype={Copy:0,Move:1};
AjaxControlToolkit.DragMode.registerEnum("AjaxControlToolkit.DragMode");AjaxControlToolkit.DragDropEventArgs=function(A,C,B){this._dragMode=A;
this._dataType=C;this._data=B;};AjaxControlToolkit.DragDropEventArgs.prototype={get_dragMode:function(){return this._dragMode||null;
},get_dragDataType:function(){return this._dataType||null;},get_dragData:function(){return this._data||null;
}};AjaxControlToolkit.DragDropEventArgs.registerClass("AjaxControlToolkit.DragDropEventArgs");
AjaxControlToolkit._DragDropManager=function(){this._instance=null;this._events=null;
};AjaxControlToolkit._DragDropManager.prototype={add_dragStart:function(A){this.get_events().addHandler("dragStart",A);
},remove_dragStart:function(A){this.get_events().removeHandler("dragStart",A);},get_events:function(){if(!this._events){this._events=new Sys.EventHandlerList();
}return this._events;},add_dragStop:function(A){this.get_events().addHandler("dragStop",A);
},remove_dragStop:function(A){this.get_events().removeHandler("dragStop",A);},_getInstance:function(){if(!this._instance){if(Sys.Browser.agent===Sys.Browser.InternetExplorer){this._instance=new AjaxControlToolkit.IEDragDropManager();
}else{this._instance=new AjaxControlToolkit.GenericDragDropManager();}this._instance.initialize();
this._instance.add_dragStart(Function.createDelegate(this,this._raiseDragStart));
this._instance.add_dragStop(Function.createDelegate(this,this._raiseDragStop));}return this._instance;
},startDragDrop:function(C,A,B){this._getInstance().startDragDrop(C,A,B);},registerDropTarget:function(A){this._getInstance().registerDropTarget(A);
},unregisterDropTarget:function(A){this._getInstance().unregisterDropTarget(A);},dispose:function(){delete this._events;
Sys.Application.unregisterDisposableObject(this);Sys.Application.removeComponent(this);
},_raiseDragStart:function(A,C){var B=this.get_events().getHandler("dragStart");if(B){B(this,C);
}},_raiseDragStop:function(A,C){var B=this.get_events().getHandler("dragStop");if(B){B(this,C);
}}};AjaxControlToolkit._DragDropManager.registerClass("AjaxControlToolkit._DragDropManager");
AjaxControlToolkit.DragDropManager=new AjaxControlToolkit._DragDropManager();AjaxControlToolkit.IEDragDropManager=function(){AjaxControlToolkit.IEDragDropManager.initializeBase(this);
this._dropTargets=null;this._radius=10;this._activeDragVisual=null;this._activeContext=null;
this._activeDragSource=null;this._underlyingTarget=null;this._oldOffset=null;this._potentialTarget=null;
this._isDragging=false;this._mouseUpHandler=null;this._documentMouseMoveHandler=null;
this._documentDragOverHandler=null;this._dragStartHandler=null;this._mouseMoveHandler=null;
this._dragEnterHandler=null;this._dragLeaveHandler=null;this._dragOverHandler=null;
this._dropHandler=null;};AjaxControlToolkit.IEDragDropManager.prototype={add_dragStart:function(A){this.get_events().addHandler("dragStart",A);
},remove_dragStart:function(A){this.get_events().removeHandler("dragStart",A);},add_dragStop:function(A){this.get_events().addHandler("dragStop",A);
},remove_dragStop:function(A){this.get_events().removeHandler("dragStop",A);},initialize:function(){AjaxControlToolkit.IEDragDropManager.callBaseMethod(this,"initialize");
this._mouseUpHandler=Function.createDelegate(this,this._onMouseUp);this._documentMouseMoveHandler=Function.createDelegate(this,this._onDocumentMouseMove);
this._documentDragOverHandler=Function.createDelegate(this,this._onDocumentDragOver);
this._dragStartHandler=Function.createDelegate(this,this._onDragStart);this._mouseMoveHandler=Function.createDelegate(this,this._onMouseMove);
this._dragEnterHandler=Function.createDelegate(this,this._onDragEnter);this._dragLeaveHandler=Function.createDelegate(this,this._onDragLeave);
this._dragOverHandler=Function.createDelegate(this,this._onDragOver);this._dropHandler=Function.createDelegate(this,this._onDrop);
},dispose:function(){if(this._dropTargets){for(var A=0;A<this._dropTargets;A++){this.unregisterDropTarget(this._dropTargets[A]);
}this._dropTargets=null;}AjaxControlToolkit.IEDragDropManager.callBaseMethod(this,"dispose");
},startDragDrop:function(I,G,H){var B=window._event;if(this._isDragging){return;}this._underlyingTarget=null;
this._activeDragSource=I;this._activeDragVisual=G;this._activeContext=H;var E={x:B.clientX,y:B.clientY};
G.originalPosition=G.style.position;G.style.position="absolute";document._lastPosition=E;
G.startingPoint=E;var A=this.getScrollOffset(G,true);G.startingPoint=this.addPoints(G.startingPoint,A);
if(G.style.position=="absolute"){G.startingPoint=this.subtractPoints(G.startingPoint,$common.getLocation(G));
}else{var D=parseInt(G.style.left);var C=parseInt(G.style.top);if(isNaN(D)){D="0";
}if(isNaN(C)){C="0";}G.startingPoint=this.subtractPoints(G.startingPoint,{x:D,y:C});
}this._prepareForDomChanges();I.onDragStart();var F=new AjaxControlToolkit.DragDropEventArgs(I.get_dragMode(),I.get_dragDataType(),I.getDragData(H));
var J=this.get_events().getHandler("dragStart");if(J){J(this,F);}this._recoverFromDomChanges();
this._wireEvents();this._drag(true);},_stopDragDrop:function(C){var B=window._event;
if(this._activeDragSource!=null){this._unwireEvents();if(!C){C=(this._underlyingTarget==null);
}if(!C&&this._underlyingTarget!=null){this._underlyingTarget.drop(this._activeDragSource.get_dragMode(),this._activeDragSource.get_dragDataType(),this._activeDragSource.getDragData(this._activeContext));
}this._activeDragSource.onDragEnd(C);var A=this.get_events().getHandler("dragStop");
if(A){A(this,Sys.EventArgs.Empty);}this._activeDragVisual.style.position=this._activeDragVisual.originalPosition;
this._activeDragSource=null;this._activeContext=null;this._activeDragVisual=null;
this._isDragging=false;this._potentialTarget=null;B.preventDefault();}},_drag:function(A){var D=window._event;
var C={x:D.clientX,y:D.clientY};document._lastPosition=C;var B=this.getScrollOffset(this._activeDragVisual,true);
var E=this.addPoints(this.subtractPoints(C,this._activeDragVisual.startingPoint),B);
if(!A&&parseInt(this._activeDragVisual.style.left)==E.x&&parseInt(this._activeDragVisual.style.top)==E.y){return;
}$common.setLocation(this._activeDragVisual,E);this._prepareForDomChanges();this._activeDragSource.onDrag();
this._recoverFromDomChanges();this._potentialTarget=this._findPotentialTarget(this._activeDragSource,this._activeDragVisual);
var F=(this._potentialTarget!=this._underlyingTarget||this._potentialTarget==null);
if(F&&this._underlyingTarget!=null){this._leaveTarget(this._activeDragSource,this._underlyingTarget);
}if(this._potentialTarget!=null){if(F){this._underlyingTarget=this._potentialTarget;
this._enterTarget(this._activeDragSource,this._underlyingTarget);}else{this._moveInTarget(this._activeDragSource,this._underlyingTarget);
}}else{this._underlyingTarget=null;}},_wireEvents:function(){$addHandler(document,"mouseup",this._mouseUpHandler);
$addHandler(document,"mousemove",this._documentMouseMoveHandler);$addHandler(document.body,"dragover",this._documentDragOverHandler);
$addHandler(this._activeDragVisual,"dragstart",this._dragStartHandler);$addHandler(this._activeDragVisual,"dragend",this._mouseUpHandler);
$addHandler(this._activeDragVisual,"drag",this._mouseMoveHandler);},_unwireEvents:function(){$removeHandler(this._activeDragVisual,"drag",this._mouseMoveHandler);
$removeHandler(this._activeDragVisual,"dragend",this._mouseUpHandler);$removeHandler(this._activeDragVisual,"dragstart",this._dragStartHandler);
$removeHandler(document.body,"dragover",this._documentDragOverHandler);$removeHandler(document,"mousemove",this._documentMouseMoveHandler);
$removeHandler(document,"mouseup",this._mouseUpHandler);},registerDropTarget:function(A){if(this._dropTargets==null){this._dropTargets=[];
}Array.add(this._dropTargets,A);this._wireDropTargetEvents(A);},unregisterDropTarget:function(A){this._unwireDropTargetEvents(A);
if(this._dropTargets){Array.remove(this._dropTargets,A);}},_wireDropTargetEvents:function(B){var A=B.get_dropTargetElement();
A._dropTarget=B;$addHandler(A,"dragenter",this._dragEnterHandler);$addHandler(A,"dragleave",this._dragLeaveHandler);
$addHandler(A,"dragover",this._dragOverHandler);$addHandler(A,"drop",this._dropHandler);
},_unwireDropTargetEvents:function(B){var A=B.get_dropTargetElement();if(A._dropTarget){A._dropTarget=null;
$removeHandler(A,"dragenter",this._dragEnterHandler);$removeHandler(A,"dragleave",this._dragLeaveHandler);
$removeHandler(A,"dragover",this._dragOverHandler);$removeHandler(A,"drop",this._dropHandler);
}},_onDragStart:function(A){window._event=A;document.selection.empty();var C=A.dataTransfer;
if(!C&&A.rawEvent){C=A.rawEvent.dataTransfer;}var B=this._activeDragSource.get_dragDataType().toLowerCase();
var D=this._activeDragSource.getDragData(this._activeContext);if(D){if(B!="text"&&B!="url"){B="text";
if(D.innerHTML!=null){D=D.innerHTML;}}C.effectAllowed="move";C.setData(B,D.toString());
}},_onMouseUp:function(A){window._event=A;this._stopDragDrop(false);},_onDocumentMouseMove:function(A){window._event=A;
this._dragDrop();},_onDocumentDragOver:function(A){window._event=A;if(this._potentialTarget){A.preventDefault();
}},_onMouseMove:function(A){window._event=A;this._drag();},_onDragEnter:function(A){window._event=A;
if(this._isDragging){A.preventDefault();}else{var C=AjaxControlToolkit.IEDragDropManager._getDataObjectsForDropTarget(this._getDropTarget(A.target));
for(var B=0;B<C.length;B++){this._dropTarget.onDragEnterTarget(AjaxControlToolkit.DragMode.Copy,C[B].type,C[B].value);
}}},_onDragLeave:function(A){window._event=A;if(this._isDragging){A.preventDefault();
}else{var C=AjaxControlToolkit.IEDragDropManager._getDataObjectsForDropTarget(this._getDropTarget(A.target));
for(var B=0;B<C.length;B++){this._dropTarget.onDragLeaveTarget(AjaxControlToolkit.DragMode.Copy,C[B].type,C[B].value);
}}},_onDragOver:function(A){window._event=A;if(this._isDragging){A.preventDefault();
}else{var C=AjaxControlToolkit.IEDragDropManager._getDataObjectsForDropTarget(this._getDropTarget(A.target));
for(var B=0;B<C.length;B++){this._dropTarget.onDragInTarget(AjaxControlToolkit.DragMode.Copy,C[B].type,C[B].value);
}}},_onDrop:function(A){window._event=A;if(!this._isDragging){var C=AjaxControlToolkit.IEDragDropManager._getDataObjectsForDropTarget(this._getDropTarget(A.target));
for(var B=0;B<C.length;B++){this._dropTarget.drop(AjaxControlToolkit.DragMode.Copy,C[B].type,C[B].value);
}}A.preventDefault();},_getDropTarget:function(A){while(A){if(A._dropTarget!=null){return A._dropTarget;
}A=A.parentNode;}return null;},_dragDrop:function(){if(this._isDragging){return;}this._isDragging=true;
this._activeDragVisual.dragDrop();document.selection.empty();},_moveInTarget:function(A,B){this._prepareForDomChanges();
B.onDragInTarget(A.get_dragMode(),A.get_dragDataType(),A.getDragData(this._activeContext));
this._recoverFromDomChanges();},_enterTarget:function(A,B){this._prepareForDomChanges();
B.onDragEnterTarget(A.get_dragMode(),A.get_dragDataType(),A.getDragData(this._activeContext));
this._recoverFromDomChanges();},_leaveTarget:function(A,B){this._prepareForDomChanges();
B.onDragLeaveTarget(A.get_dragMode(),A.get_dragDataType(),A.getDragData(this._activeContext));
this._recoverFromDomChanges();},_findPotentialTarget:function(K,J){var C=window._event;
if(this._dropTargets==null){return null;}var F=K.get_dragDataType();var A=K.get_dragMode();
var H=K.getDragData(this._activeContext);var D=this.getScrollOffset(document.body,true);
var E=C.clientX+D.x;var B=C.clientY+D.y;var G={x:E-this._radius,y:B-this._radius,width:this._radius*2,height:this._radius*2};
var L;for(var I=0;I<this._dropTargets.length;I++){L=$common.getBounds(this._dropTargets[I].get_dropTargetElement());
if($common.overlaps(G,L)&&this._dropTargets[I].canDrop(A,F,H)){return this._dropTargets[I];
}}return null;},_prepareForDomChanges:function(){this._oldOffset=$common.getLocation(this._activeDragVisual);
},_recoverFromDomChanges:function(){var A=$common.getLocation(this._activeDragVisual);
if(this._oldOffset.x!=A.x||this._oldOffset.y!=A.y){this._activeDragVisual.startingPoint=this.subtractPoints(this._activeDragVisual.startingPoint,this.subtractPoints(this._oldOffset,A));
scrollOffset=this.getScrollOffset(this._activeDragVisual,true);var B=this.addPoints(this.subtractPoints(document._lastPosition,this._activeDragVisual.startingPoint),scrollOffset);
$common.setLocation(this._activeDragVisual,B);}},addPoints:function(B,A){return{x:B.x+A.x,y:B.y+A.y};
},subtractPoints:function(B,A){return{x:B.x-A.x,y:B.y-A.y};},getScrollOffset:function(D,E){var C=D.scrollLeft;
var A=D.scrollTop;if(E){var B=D.parentNode;while(B!=null&&B.scrollLeft!=null){C+=B.scrollLeft;
A+=B.scrollTop;if(B==document.body&&(C!=0&&A!=0)){break;}B=B.parentNode;}}return{x:C,y:A};
},getBrowserRectangle:function(){var B=window.innerWidth;var A=window.innerHeight;
if(B==null){B=document.body.clientWidth;}if(A==null){A=document.body.clientHeight;
}return{x:0,y:0,width:B,height:A};},getNextSibling:function(A){for(A=A.nextSibling;
A!=null;A=A.nextSibling){if(A.innerHTML!=null){return A;}}return null;},hasParent:function(A){return(A.parentNode!=null&&A.parentNode.tagName!=null);
}};AjaxControlToolkit.IEDragDropManager.registerClass("AjaxControlToolkit.IEDragDropManager",Sys.Component);
AjaxControlToolkit.IEDragDropManager._getDataObjectsForDropTarget=function(F){if(F==null){return[];
}var D=window._event;var C=[];var A=["URL","Text"];var G;for(var E=0;E<A.length;E++){var B=D.dataTransfer;
if(!B&&D.rawEvent){B=D.rawEvent.dataTransfer;}G=B.getData(A[E]);if(F.canDrop(AjaxControlToolkit.DragMode.Copy,A[E],G)){if(G){Array.add(C,{type:A[E],value:G});
}}}return C;};AjaxControlToolkit.GenericDragDropManager=function(){AjaxControlToolkit.GenericDragDropManager.initializeBase(this);
this._dropTargets=null;this._scrollEdgeConst=40;this._scrollByConst=10;this._scroller=null;
this._scrollDeltaX=0;this._scrollDeltaY=0;this._activeDragVisual=null;this._activeContext=null;
this._activeDragSource=null;this._oldOffset=null;this._potentialTarget=null;this._mouseUpHandler=null;
this._mouseMoveHandler=null;this._keyPressHandler=null;this._scrollerTickHandler=null;
};AjaxControlToolkit.GenericDragDropManager.prototype={initialize:function(){AjaxControlToolkit.GenericDragDropManager.callBaseMethod(this,"initialize");
this._mouseUpHandler=Function.createDelegate(this,this._onMouseUp);this._mouseMoveHandler=Function.createDelegate(this,this._onMouseMove);
this._keyPressHandler=Function.createDelegate(this,this._onKeyPress);this._scrollerTickHandler=Function.createDelegate(this,this._onScrollerTick);
if(Sys.Browser.agent===Sys.Browser.Safari){AjaxControlToolkit.GenericDragDropManager.__loadSafariCompatLayer(this);
}this._scroller=new Sys.Timer();this._scroller.set_interval(10);this._scroller.add_tick(this._scrollerTickHandler);
},startDragDrop:function(C,A,B){this._activeDragSource=C;this._activeDragVisual=A;
this._activeContext=B;AjaxControlToolkit.GenericDragDropManager.callBaseMethod(this,"startDragDrop",[C,A,B]);
},_stopDragDrop:function(A){this._scroller.set_enabled(false);AjaxControlToolkit.GenericDragDropManager.callBaseMethod(this,"_stopDragDrop",[A]);
},_drag:function(A){AjaxControlToolkit.GenericDragDropManager.callBaseMethod(this,"_drag",[A]);
this._autoScroll();},_wireEvents:function(){$addHandler(document,"mouseup",this._mouseUpHandler);
$addHandler(document,"mousemove",this._mouseMoveHandler);$addHandler(document,"keypress",this._keyPressHandler);
},_unwireEvents:function(){$removeHandler(document,"keypress",this._keyPressHandler);
$removeHandler(document,"mousemove",this._mouseMoveHandler);$removeHandler(document,"mouseup",this._mouseUpHandler);
},_wireDropTargetEvents:function(A){},_unwireDropTargetEvents:function(A){},_onMouseUp:function(A){window._event=A;
this._stopDragDrop(false);},_onMouseMove:function(A){window._event=A;this._drag();
},_onKeyPress:function(A){window._event=A;var B=A.keyCode?A.keyCode:A.rawEvent.keyCode;
if(B==27){this._stopDragDrop(true);}},_autoScroll:function(){var A=window._event;
var B=this.getBrowserRectangle();if(B.width>0){this._scrollDeltaX=this._scrollDeltaY=0;
if(A.clientX<B.x+this._scrollEdgeConst){this._scrollDeltaX=-this._scrollByConst;}else{if(A.clientX>B.width-this._scrollEdgeConst){this._scrollDeltaX=this._scrollByConst;
}}if(A.clientY<B.y+this._scrollEdgeConst){this._scrollDeltaY=-this._scrollByConst;
}else{if(A.clientY>B.height-this._scrollEdgeConst){this._scrollDeltaY=this._scrollByConst;
}}if(this._scrollDeltaX!=0||this._scrollDeltaY!=0){this._scroller.set_enabled(true);
}else{this._scroller.set_enabled(false);}}},_onScrollerTick:function(){var F=document.body.scrollLeft;
var C=document.body.scrollTop;window.scrollBy(this._scrollDeltaX,this._scrollDeltaY);
var E=document.body.scrollLeft;var B=document.body.scrollTop;var A=this._activeDragVisual;
var D={x:parseInt(A.style.left)+(E-F),y:parseInt(A.style.top)+(B-C)};$common.setLocation(A,D);
}};AjaxControlToolkit.GenericDragDropManager.registerClass("AjaxControlToolkit.GenericDragDropManager",AjaxControlToolkit.IEDragDropManager);
if(Sys.Browser.agent===Sys.Browser.Safari){AjaxControlToolkit.GenericDragDropManager.__loadSafariCompatLayer=function(A){A._getScrollOffset=A.getScrollOffset;
A.getScrollOffset=function(B,C){return{x:0,y:0};};A._getBrowserRectangle=A.getBrowserRectangle;
A.getBrowserRectangle=function(){var C=A._getBrowserRectangle();var B=A._getScrollOffset(document.body,true);
return{x:C.x+B.x,y:C.y+B.y,width:C.width+B.x,height:C.height+B.y};};};}AjaxControlToolkit.FloatingBehavior=function(A){AjaxControlToolkit.FloatingBehavior.initializeBase(this,[A]);
var G;var F;var D;var H;var B;var C=Function.createDelegate(this,E);this.add_move=function(I){this.get_events().addHandler("move",I);
};this.remove_move=function(I){this.get_events().removeHandler("move",I);};this.get_handle=function(){return G;
};this.set_handle=function(I){if(G!=null){$removeHandler(G,"mousedown",C);}G=I;$addHandler(G,"mousedown",C);
};this.get_profileProperty=function(){return H;};this.set_profileProperty=function(I){H=I;
};this.get_profileComponent=function(){return B;};this.set_profileComponent=function(I){B=I;
};this.get_location=function(){return F;};this.set_location=function(I){if(F!=I){F=I;
if(this.get_isInitialized()){$common.setLocation(this.get_element(),F);}this.raisePropertyChanged("location");
}};this.initialize=function(){AjaxControlToolkit.FloatingBehavior.callBaseMethod(this,"initialize");
AjaxControlToolkit.DragDropManager.registerDropTarget(this);var I=this.get_element();
if(!F){F=$common.getLocation(I);}I.style.position="fixed";$common.setLocation(I,F);
};this.dispose=function(){AjaxControlToolkit.DragDropManager.unregisterDropTarget(this);
if(G&&C){$removeHandler(G,"mousedown",C);}C=null;AjaxControlToolkit.FloatingBehavior.callBaseMethod(this,"dispose");
};this.checkCanDrag=function(I){var K=["input","button","select","textarea","label"];
var J=I.tagName;if((J.toLowerCase()=="a")&&(I.href!=null)&&(I.href.length>0)){return false;
}if(Array.indexOf(K,J.toLowerCase())>-1){return false;}return true;};function E(J){window._event=J;
var I=this.get_element();if(this.checkCanDrag(J.target)){D=$common.getLocation(I);
J.preventDefault();this.startDragDrop(I);}}this.get_dragDataType=function(){return"_floatingObject";
};this.getDragData=function(I){return null;};this.get_dragMode=function(){return AjaxControlToolkit.DragMode.Move;
};this.onDragStart=function(){};this.onDrag=function(){};this.onDragEnd=function(M){if(!M){var J=this.get_events().getHandler("move");
if(J){var L=new Sys.CancelEventArgs();J(this,L);M=L.get_cancel();}}var I=this.get_element();
if(M){$common.setLocation(I,D);}else{var K=$common.getLocation(I);F=K.x+","+K.y;this.raisePropertyChanged("location");
}};this.startDragDrop=function(I){AjaxControlToolkit.DragDropManager.startDragDrop(this,I,null);
};this.get_dropTargetElement=function(){return document.body;};this.canDrop=function(I,J,K){return(J=="_floatingObject");
};this.drop=function(I,J,K){};this.onDragEnterTarget=function(I,J,K){};this.onDragLeaveTarget=function(I,J,K){};
this.onDragInTarget=function(I,J,K){};};AjaxControlToolkit.FloatingBehavior.registerClass("AjaxControlToolkit.FloatingBehavior",AjaxControlToolkit.BehaviorBase,AjaxControlToolkit.IDragSource,AjaxControlToolkit.IDropTarget,Sys.IDisposable);
Type.registerNamespace("AjaxControlToolkit");AjaxControlToolkit.ModalPopupBehavior=function(A){AjaxControlToolkit.ModalPopupBehavior.initializeBase(this,[A]);
this._PopupControlID=null;this._PopupDragHandleControlID=null;this._BackgroundCssClass=null;
this._DropShadow=false;this._Drag=false;this._OkControlID=null;this._CancelControlID=null;
this._OnOkScript=null;this._OnCancelScript=null;this._xCoordinate=-1;this._yCoordinate=-1;
this._backgroundElement=null;this._foregroundElement=null;this._relativeOrAbsoluteParentElement=null;
this._popupElement=null;this._dragHandleElement=null;this._showHandler=null;this._okHandler=null;
this._cancelHandler=null;this._scrollHandler=null;this._resizeHandler=null;this._windowHandlersAttached=false;
this._dropShadowBehavior=null;this._dragBehavior=null;this._isIE6=false;this._saveTabIndexes=new Array();
this._saveDesableSelect=new Array();this._tagWithTabIndex=new Array("A","AREA","BUTTON","INPUT","OBJECT","SELECT","TEXTAREA","IFRAME");
};AjaxControlToolkit.ModalPopupBehavior.prototype={initialize:function(){AjaxControlToolkit.ModalPopupBehavior.callBaseMethod(this,"initialize");
this._isIE6=(Sys.Browser.agent==Sys.Browser.InternetExplorer&&Sys.Browser.version<7);
if(this._PopupDragHandleControlID){this._dragHandleElement=$get(this._PopupDragHandleControlID);
}this._popupElement=$get(this._PopupControlID);if(this._DropShadow){this._foregroundElement=document.createElement("div");
this._popupElement.parentNode.appendChild(this._foregroundElement);this._foregroundElement.appendChild(this._popupElement);
}else{this._foregroundElement=$get(this._PopupControlID);}this._backgroundElement=document.createElement("div");
this._backgroundElement.style.display="none";this._backgroundElement.style.position="fixed";
this._backgroundElement.style.left="0px";this._backgroundElement.style.top="0px";
this._backgroundElement.style.zIndex=10000;if(this._BackgroundCssClass){this._backgroundElement.className=this._BackgroundCssClass;
}this._foregroundElement.parentNode.appendChild(this._backgroundElement);this._foregroundElement.style.display="none";
this._foregroundElement.style.position="fixed";this._foregroundElement.style.zIndex=$common.getCurrentStyle(this._backgroundElement,"zIndex",this._backgroundElement.style.zIndex)+1;
this._showHandler=Function.createDelegate(this,this._onShow);$addHandler(this.get_element(),"click",this._showHandler);
if(this._OkControlID){this._okHandler=Function.createDelegate(this,this._onOk);$addHandler($get(this._OkControlID),"click",this._okHandler);
}if(this._CancelControlID){this._cancelHandler=Function.createDelegate(this,this._onCancel);
$addHandler($get(this._CancelControlID),"click",this._cancelHandler);}this._scrollHandler=Function.createDelegate(this,this._onLayout);
this._resizeHandler=Function.createDelegate(this,this._onLayout);this.registerPartialUpdateEvents();
},dispose:function(){this._detachPopup();if(this._DropShadow){this._foregroundElement.parentNode.appendChild(this._popupElement);
this._foregroundElement.parentNode.removeChild(this._foregroundElement);}this._scrollHandler=null;
this._resizeHandler=null;if(this._cancelHandler&&$get(this._CancelControlID)){$removeHandler($get(this._CancelControlID),"click",this._cancelHandler);
this._cancelHandler=null;}if(this._okHandler&&$get(this._OkControlID)){$removeHandler($get(this._OkControlID),"click",this._okHandler);
this._okHandler=null;}if(this._showHandler){$removeHandler(this.get_element(),"click",this._showHandler);
this._showHandler=null;}AjaxControlToolkit.ModalPopupBehavior.callBaseMethod(this,"dispose");
},_attachPopup:function(){if(this._DropShadow&&!this._dropShadowBehavior){this._dropShadowBehavior=$create(AjaxControlToolkit.DropShadowBehavior,{},null,null,this._popupElement);
}if(this._dragHandleElement&&!this._dragBehavior){this._dragBehavior=$create(AjaxControlToolkit.FloatingBehavior,{"handle":this._dragHandleElement},null,null,this._foregroundElement);
}$addHandler(window,"resize",this._resizeHandler);$addHandler(window,"scroll",this._scrollHandler);
this._windowHandlersAttached=true;},_detachPopup:function(){if(this._windowHandlersAttached){if(this._scrollHandler){$removeHandler(window,"scroll",this._scrollHandler);
}if(this._resizeHandler){$removeHandler(window,"resize",this._resizeHandler);}this._windowHandlersAttached=false;
}if(this._dragBehavior){this._dragBehavior.dispose();this._dragBehavior=null;}if(this._dropShadowBehavior){this._dropShadowBehavior.dispose();
this._dropShadowBehavior=null;}},_onShow:function(A){if(!this.get_element().disabled){this.show();
A.preventDefault();return false;}},_onOk:function(B){var A=$get(this._OkControlID);
if(A&&!A.disabled){if(this.hide()&&this._OnOkScript){window.setTimeout(this._OnOkScript,0);
}B.preventDefault();return false;}},_onCancel:function(B){var A=$get(this._CancelControlID);
if(A&&!A.disabled){if(this.hide()&&this._OnCancelScript){window.setTimeout(this._OnCancelScript,0);
}B.preventDefault();return false;}},_onLayout:function(){this._layout();},show:function(){var A=new Sys.CancelEventArgs();
this.raiseShowing(A);if(A.get_cancel()){return;}this.populate();this._attachPopup();
this._backgroundElement.style.display="";this._foregroundElement.style.display="";
this._popupElement.style.display="";if(this._isIE6){this._foregroundElement.style.position="absolute";
this._backgroundElement.style.position="absolute";var B=this._foregroundElement.parentNode;
while(B&&(B!=document.documentElement)){if((B.style.position!="relative")&&(B.style.position!="absolute")){B=B.parentNode;
}else{this._relativeOrAbsoluteParentElement=B;break;}}}this.disableTab();this._layout();
this._layout();this.raiseShown(Sys.EventArgs.Empty);},disableTab:function(){var D=0;
var A;var C=new Array();Array.clear(this._saveTabIndexes);for(var E=0;E<this._tagWithTabIndex.length;
E++){A=this._foregroundElement.getElementsByTagName(this._tagWithTabIndex[E]);for(var F=0;
F<A.length;F++){C[D]=A[F];D++;}}D=0;for(var E=0;E<this._tagWithTabIndex.length;E++){A=document.getElementsByTagName(this._tagWithTabIndex[E]);
for(var F=0;F<A.length;F++){if(Array.indexOf(C,A[F])==-1){this._saveTabIndexes[D]={tag:A[F],index:A[F].tabIndex};
A[F].tabIndex="-1";D++;}}}D=0;if((Sys.Browser.agent===Sys.Browser.InternetExplorer)&&(Sys.Browser.version<7)){var B=new Array();
for(var E=0;E<this._tagWithTabIndex.length;E++){A=this._foregroundElement.getElementsByTagName("SELECT");
for(var F=0;F<A.length;F++){B[D]=A[F];D++;}}D=0;Array.clear(this._saveDesableSelect);
A=document.getElementsByTagName("SELECT");for(var F=0;F<A.length;F++){if(Array.indexOf(B,A[F])==-1){this._saveDesableSelect[D]={tag:A[F],visib:$common.getCurrentStyle(A[F],"visibility")};
A[F].style.visibility="hidden";D++;}}}},restoreTab:function(){for(var A=0;A<this._saveTabIndexes.length;
A++){this._saveTabIndexes[A].tag.tabIndex=this._saveTabIndexes[A].index;}if((Sys.Browser.agent===Sys.Browser.InternetExplorer)&&(Sys.Browser.version<7)){for(var B=0;
B<this._saveDesableSelect.length;B++){this._saveDesableSelect[B].tag.style.visibility=this._saveDesableSelect[B].visib;
}}},hide:function(){var A=new Sys.CancelEventArgs();this.raiseHiding(A);if(A.get_cancel()){return false;
}this._backgroundElement.style.display="none";this._foregroundElement.style.display="none";
this.restoreTab();this._detachPopup();this.raiseHidden(Sys.EventArgs.Empty);return true;
},_layout:function(){var E=(document.documentElement.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft);
var B=(document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop);
var D=$common.getClientBounds();var A=D.width;var G=D.height;this._layoutBackgroundElement();
var F=0;var C=0;if(this._xCoordinate<0){var H=this._foregroundElement.offsetWidth?this._foregroundElement.offsetWidth:this._foregroundElement.scrollWidth;
F=((A-H)/2);if(this._foregroundElement.style.position=="absolute"){F+=E;}this._foregroundElement.style.left=F+"px";
}else{if(this._isIE6){this._foregroundElement.style.left=(this._xCoordinate+E)+"px";
F=this._xCoordinate+E;}else{this._foregroundElement.style.left=this._xCoordinate+"px";
F=this._xCoordinate;}}if(this._yCoordinate<0){var I=this._foregroundElement.offsetHeight?this._foregroundElement.offsetHeight:this._foregroundElement.scrollHeight;
C=((G-I)/2);if(this._foregroundElement.style.position=="absolute"){C+=B;}this._foregroundElement.style.top=C+"px";
}else{if(this._isIE6){this._foregroundElement.style.top=(this._yCoordinate+B)+"px";
C=this._yCoordinate+B;}else{this._foregroundElement.style.top=this._yCoordinate+"px";
C=this._yCoordinate;}}this._layoutForegroundElement(F,C);if(this._dropShadowBehavior){this._dropShadowBehavior.setShadow();
window.setTimeout(Function.createDelegate(this,this._fixupDropShadowBehavior),0);
}this._layoutBackgroundElement();},_layoutForegroundElement:function(B,C){if(this._isIE6&&this._relativeOrAbsoluteParentElement){var A=$common.getLocation(this._foregroundElement);
var F=$common.getLocation(this._relativeOrAbsoluteParentElement);var E=A.x;if(E!=B){this._foregroundElement.style.left=(B-F.x)+"px";
}var D=A.y;if(D!=C){this._foregroundElement.style.top=(C-F.y)+"px";}}},_layoutBackgroundElement:function(){if(this._isIE6){var D=$common.getLocation(this._backgroundElement);
var A=D.x;if(A!=0){this._backgroundElement.style.left=(-A)+"px";}var B=D.y;if(B!=0){this._backgroundElement.style.top=(-B)+"px";
}}var E=$common.getClientBounds();var F=E.width;var C=E.height;this._backgroundElement.style.width=Math.max(Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),F)+"px";
this._backgroundElement.style.height=Math.max(Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),C)+"px";
},_fixupDropShadowBehavior:function(){if(this._dropShadowBehavior){this._dropShadowBehavior.setShadow();
}},_partialUpdateEndRequest:function(A,B){AjaxControlToolkit.ModalPopupBehavior.callBaseMethod(this,"_partialUpdateEndRequest",[A,B]);
if(this.get_element()){var C=B.get_dataItems()[this.get_element().id];if("show"==C){this.show();
}else{if("hide"==C){this.hide();}}}this._layout();},_onPopulated:function(A,B){AjaxControlToolkit.ModalPopupBehavior.callBaseMethod(this,"_onPopulated",[A,B]);
this._layout();},get_PopupControlID:function(){return this._PopupControlID;},set_PopupControlID:function(A){if(this._PopupControlID!=A){this._PopupControlID=A;
this.raisePropertyChanged("PopupControlID");}},get_X:function(){return this._xCoordinate;
},set_X:function(A){if(this._xCoordinate!=A){this._xCoordinate=A;this.raisePropertyChanged("X");
}},get_Y:function(){return this._yCoordinate;},set_Y:function(A){if(this._yCoordinate!=A){this._yCoordinate=A;
this.raisePropertyChanged("Y");}},get_PopupDragHandleControlID:function(){return this._PopupDragHandleControlID;
},set_PopupDragHandleControlID:function(A){if(this._PopupDragHandleControlID!=A){this._PopupDragHandleControlID=A;
this.raisePropertyChanged("PopupDragHandleControlID");}},get_BackgroundCssClass:function(){return this._BackgroundCssClass;
},set_BackgroundCssClass:function(A){if(this._BackgroundCssClass!=A){this._BackgroundCssClass=A;
this.raisePropertyChanged("BackgroundCssClass");}},get_DropShadow:function(){return this._DropShadow;
},set_DropShadow:function(A){if(this._DropShadow!=A){this._DropShadow=A;this.raisePropertyChanged("DropShadow");
}},get_Drag:function(){return this._Drag;},set_Drag:function(A){if(this._Drag!=A){this._Drag=A;
this.raisePropertyChanged("Drag");}},get_OkControlID:function(){return this._OkControlID;
},set_OkControlID:function(A){if(this._OkControlID!=A){this._OkControlID=A;this.raisePropertyChanged("OkControlID");
}},get_CancelControlID:function(){return this._CancelControlID;},set_CancelControlID:function(A){if(this._CancelControlID!=A){this._CancelControlID=A;
this.raisePropertyChanged("CancelControlID");}},get_OnOkScript:function(){return this._OnOkScript;
},set_OnOkScript:function(A){if(this._OnOkScript!=A){this._OnOkScript=A;this.raisePropertyChanged("OnOkScript");
}},get_OnCancelScript:function(){return this._OnCancelScript;},set_OnCancelScript:function(A){if(this._OnCancelScript!=A){this._OnCancelScript=A;
this.raisePropertyChanged("OnCancelScript");}},add_showing:function(A){this.get_events().addHandler("showing",A);
},remove_showing:function(A){this.get_events().removeHandler("showing",A);},raiseShowing:function(B){var A=this.get_events().getHandler("showing");
if(A){A(this,B);}},add_shown:function(A){this.get_events().addHandler("shown",A);
},remove_shown:function(A){this.get_events().removeHandler("shown",A);},raiseShown:function(B){var A=this.get_events().getHandler("shown");
if(A){A(this,B);}},add_hiding:function(A){this.get_events().addHandler("hiding",A);
},remove_hiding:function(A){this.get_events().removeHandler("hiding",A);},raiseHiding:function(B){var A=this.get_events().getHandler("hiding");
if(A){A(this,B);}},add_hidden:function(A){this.get_events().addHandler("hidden",A);
},remove_hidden:function(A){this.get_events().removeHandler("hidden",A);},raiseHidden:function(B){var A=this.get_events().getHandler("hidden");
if(A){A(this,B);}}};AjaxControlToolkit.ModalPopupBehavior.registerClass("AjaxControlToolkit.ModalPopupBehavior",AjaxControlToolkit.DynamicPopulateBehaviorBase);
AjaxControlToolkit.ModalPopupBehavior.invokeViaServer=function(B,A){var C=$find(B);
if(C){if(A){C.show();}else{C.hide();}}};Type.registerNamespace("AjaxControlToolkit");
AjaxControlToolkit.AutoSize=function(){throw Error.invalidOperation();};AjaxControlToolkit.AutoSize.prototype={None:0,Fill:1,Limit:2};
AjaxControlToolkit.AutoSize.registerEnum("AjaxControlToolkit.AutoSize",false);AjaxControlToolkit.AccordionSelectedIndexChangeEventArgs=function(A,B){AjaxControlToolkit.AccordionSelectedIndexChangeEventArgs.initializeBase(this);
this._oldIndex=A;this._selectedIndex=B;};AjaxControlToolkit.AccordionSelectedIndexChangeEventArgs.prototype={get_oldIndex:function(){return this._oldIndex;
},set_oldIndex:function(A){this._oldIndex=A;},get_selectedIndex:function(){return this._oldIndex;
},set_selectedIndex:function(A){this._oldIndex=A;}};AjaxControlToolkit.AccordionSelectedIndexChangeEventArgs.registerClass("AjaxControlToolkit.AccordionSelectedIndexChangeEventArgs",Sys.CancelEventArgs);
AjaxControlToolkit.AccordionBehavior=function(A){AjaxControlToolkit.AccordionBehavior.initializeBase(this,[A]);
this._selectedIndex=0;this._panes=[];this._fadeTransitions=false;this._duration=0.25;
this._framesPerSecond=30;this._autoSize=AjaxControlToolkit.AutoSize.None;this._requireOpenedPane=true;
this._suppressHeaderPostbacks=false;this._headersSize=0;this._headerClickHandler=null;
this._headerCssClass="";this._headerSelectedCssClass="";this._contentCssClass="";
this._resizeHandler=null;};AjaxControlToolkit.AccordionBehavior.prototype={initialize:function(){AjaxControlToolkit.AccordionBehavior.callBaseMethod(this,"initialize");
this._headerClickHandler=Function.createDelegate(this,this._onHeaderClick);var A=this.get_ClientState();
if(A!==null&&A!==""){this._changeSelectedIndex(parseInt(A),false,true);}var D=this.get_element().childNodes;
var E={};for(E.value=0;E.value<D.length;E.value++){var B=this._getNextDiv(D,E);if(!B){break;
}var C=this._getNextDiv(D,E);if(C){this.addPane(B,C);E.value--;}}if(this._requireOpenedPane&&!this.get_Pane()&&this._panes.length>0){this._changeSelectedIndex(0,false,true);
}this._initializeLayout();},_getNextDiv:function(B,C){var A=null;while(C.value<B.length&&(A=B[C.value++])){if(A.tagName&&(A.tagName.toLowerCase()==="div")){break;
}}return A;},addPane:function(E,B){var A={};A.animation=null;A.header=E;E._index=this._panes.length;
$addHandler(E,"click",this._headerClickHandler);var C=this.get_element();var D=document.createElement("div");
C.insertBefore(D,B);C.removeChild(B);D.appendChild(B);D._original=B;A.content=D;D.style.border="";
D.style.margin="";D.style.padding="";Array.add(this._panes,A);this._initializePane(E._index);
B.style.display="block";return A;},_getAnimation:function(A){var D=A.animation;if(!D){var B=null;
var C=null;if(!this._fadeTransitions){D=B=new AjaxControlToolkit.Animation.LengthAnimation(A.content,this._duration,this._framesPerSecond,"style","height",0,0,"px");
}else{B=new AjaxControlToolkit.Animation.LengthAnimation(null,null,null,"style","height",0,0,"px");
C=new AjaxControlToolkit.Animation.FadeAnimation(null,null,null,AjaxControlToolkit.Animation.FadeEffect.FadeOut,0,1,false);
D=new AjaxControlToolkit.Animation.ParallelAnimation(A.content,this._duration,this._framesPerSecond,[C,B]);
}A.animation=D;D._length=B;D._fade=C;D._pane=A;D._opening=true;D._behavior=this;D._ended=Function.createDelegate(A.animation,this._onAnimationFinished);
D.add_ended(A.animation._ended);D.initialize();}return D;},_onAnimationFinished:function(){this._behavior._endPaneChange(this._pane,this._opening);
},_initializeLayout:function(){for(var B=0;B<this._panes.length;B++){var C=this._panes[B].animation;
if(C&&C.get_isPlaying()){C.stop();}}var A=this.get_element();this._initialHeight=A.offsetHeight;
if(this._autoSize===AjaxControlToolkit.AutoSize.None){this._disposeResizeHandler();
A.style.height="auto";A.style.overflow="auto";}else{this._addResizeHandler();A.style.height=A.offsetHeight+"px";
A.style.overflow="hidden";}for(var B=0;B<this._panes.length;B++){this._initializePane(B);
}this._resizeSelectedPane();},_initializePane:function(F){var A=this.get_Pane(F);
if(!A){return;}var E=A.content;var D=E._original;var C=(F===this._selectedIndex);
E.style.height=(C||(this._autoSize===AjaxControlToolkit.AutoSize.Fill))?"auto":"0px";
E.style.overflow=C?"auto":"hidden";E.style.display=C?"block":"none";D.style.height="auto";
D.style.maxHeight="";D.style.overflow=C?"auto":"hidden";var B=(C||!this._fadeTransitions)?1:0;
if(this._autoSize===AjaxControlToolkit.AutoSize.Fill){$common.setElementOpacity(D,B);
$common.setElementOpacity(E,1);}else{$common.setElementOpacity(E,B);$common.setElementOpacity(D,1);
}},_addResizeHandler:function(){if(!this._resizeHandler){this._resizeHandler=Function.createDelegate(this,this._resizeSelectedPane);
$addHandler(window,"resize",this._resizeHandler);}},dispose:function(){this._disposeResizeHandler();
this._disposeAnimations();for(var B=this._panes.length-1;B>=0;B--){var A=this._panes[B];
if(A){if(A.header){A.header._index=null;$removeHandler(A.header,"click",this._headerClickHandler);
A.header=null;}if(A.content){A.content._original=null;A.content=null;}this._panes[B]=null;
delete this._panes[B];}}this._panes=null;this._headerClickHandler=null;AjaxControlToolkit.AccordionBehavior.callBaseMethod(this,"dispose");
},_disposeResizeHandler:function(){if(this._resizeHandler){$removeHandler(window,"resize",this._resizeHandler);
this._resizeHandler=null;}},_disposeAnimations:function(){for(var A=0;A<this._panes.length;
A++){var B=this._panes[A].animation;if(B){if(B.get_isPlaying()){B.stop();}if(B._ended){B.remove_ended(B._ended);
B._ended=null;}B.dispose();B._length=null;B._fade=null;B._pane=null;B._opening=null;
B._behavior=null;this._panes[A].animation=null;}}},_resizeSelectedPane:function(){var A=this.get_Pane();
if(!A){return;}this._headersSize=this._getHeadersSize().height;var B=A.content._original;
switch(this._autoSize){case AjaxControlToolkit.AutoSize.None:B.style.height="auto";
B.style.maxHeight="";break;case AjaxControlToolkit.AutoSize.Limit:var C=this._getRemainingHeight(false);
B.style.height="auto";B.style.maxHeight=C+"px";break;case AjaxControlToolkit.AutoSize.Fill:var C=this._getRemainingHeight(true);
B.style.height=C+"px";B.style.maxHeight="";break;}},_onHeaderClick:function(A){var C=A.target;
var B=this.get_element();while(C&&(C.parentNode!==B)){C=C.parentNode;}A.stopPropagation();
if(this._suppressHeaderPostbacks){A.preventDefault();}var D=C._index;if((D===this._selectedIndex)&&!this._requireOpenedPane){D=-1;
}this._changeSelectedIndex(D,true);},_changeSelectedIndex:function(G,C,F){var D=this._selectedIndex;
var A=this.get_Pane(G);var E=this.get_Pane(D);if(!F&&(A==E)){return;}var B=new AjaxControlToolkit.AccordionSelectedIndexChangeEventArgs(D,G);
this.raiseSelectedIndexChanging(B);if(B.get_cancel()){return;}if(E){E.header.className=this._headerCssClass;
}if(A){A.header.className=(this._headerSelectedCssClass=="")?this._headerCssClass:this._headerSelectedCssClass;
}this._selectedIndex=G;this.set_ClientState(this._selectedIndex);if(C){this._changePanes(D);
}this.raiseSelectedIndexChanged(new AjaxControlToolkit.AccordionSelectedIndexChangeEventArgs(D,G));
this.raisePropertyChanged("SelectedIndex");},_changePanes:function(C){if(!this.get_isInitialized()){return;
}var D=null;var A=null;for(var B=0;B<this._panes.length;B++){var E=this._panes[B];
var F=this._getAnimation(E);if(F.get_isPlaying()){F.stop();}if(B==this._selectedIndex){F._opening=true;
D=F;}else{if(B==C){F._opening=false;A=F;}else{continue;}}this._startPaneChange(E,F._opening);
if(this._fadeTransitions){F._fade.set_effect(F._opening?AjaxControlToolkit.Animation.FadeEffect.FadeIn:AjaxControlToolkit.Animation.FadeEffect.FadeOut);
}if(this._autoSize===AjaxControlToolkit.AutoSize.Fill){F.set_target(E.content._original);
F._length.set_startValue($common.getContentSize(E.content._original).height);F._length.set_endValue(F._opening?this._getRemainingHeight(true):0);
}else{F.set_target(E.content);F._length.set_startValue(E.content.offsetHeight);F._length.set_endValue(F._opening?this._getRemainingHeight(false):0);
}}if(A){A.play();}if(D){D.play();}},_startPaneChange:function(A,D){var C=A.content;
var B=C._original;if(D){C.style.display="block";}else{C.style.overflow="hidden";B.style.overflow="hidden";
if(this._autoSize===AjaxControlToolkit.AutoSize.Limit){C.style.height=this._getTotalSize(B).height+"px";
B.style.maxHeight="";}}},_endPaneChange:function(A,D){var C=A.content;var B=C._original;
if(D){if(this._autoSize===AjaxControlToolkit.AutoSize.Limit){var E=this._getRemainingHeight(true);
B.style.maxHeight=E+"px";}B.style.overflow="auto";C.style.height="auto";C.style.overflow="auto";
}else{C.style.display="none";}},_getHeadersSize:function(){var A={width:0,height:0};
for(var C=0;C<this._panes.length;C++){var B=this._getTotalSize(this._panes[C].header);
A.width=Math.max(A.width,B.width);A.height+=B.height;}return A;},_getRemainingHeight:function(E){var B=0;
var A=this.get_Pane();if(this._autoSize===AjaxControlToolkit.AutoSize.None){if(A){B=this._getTotalSize(A.content._original).height;
}}else{B=this._headersSize;if(E&&A){B+=this._getGutterSize(A.content._original).height;
}var C=this.get_element();B=Math.max(C.offsetHeight-B,0);if(A&&(this._autoSize===AjaxControlToolkit.AutoSize.Limit)){var D=this._getTotalSize(A.content._original).height;
if(D>0){B=Math.min(B,D);}}}return B;},_getTotalSize:function(C){var A=$common.getSize(C);
var B=$common.getMarginBox(C);A.width+=B.horizontal;A.height+=B.vertical;return A;
},_getGutterSize:function(B){var D={width:0,height:0};try{var A=$common.getPaddingBox(B);
D.width+=A.horizontal;D.height+=A.vertical;}catch(C){}try{var A=$common.getBorderBox(B);
D.width+=A.horizontal;D.height+=A.vertical;}catch(C){}var A=$common.getMarginBox(B);
D.width+=A.horizontal;D.height+=A.vertical;return D;},add_selectedIndexChanging:function(A){this.get_events().addHandler("selectedIndexChanging",A);
},remove_selectedIndexChanging:function(A){this.get_events().removeHandler("selectedIndexChanging",A);
},raiseSelectedIndexChanging:function(B){var A=this.get_events().getHandler("selectedIndexChanging");
if(A){A(this,B);}},add_selectedIndexChanged:function(A){this.get_events().addHandler("selectedIndexChanged",A);
},remove_selectedIndexChanged:function(A){this.get_events().removeHandler("selectedIndexChanged",A);
},raiseSelectedIndexChanged:function(B){var A=this.get_events().getHandler("selectedIndexChanged");
if(A){A(this,B);}},get_Pane:function(A){if(A===undefined||A===null){A=this._selectedIndex;
}return(this._panes&&A>=0&&A<this._panes.length)?this._panes[A]:null;},get_Count:function(){return this._panes?this._panes.length:0;
},get_TransitionDuration:function(){return this._duration*1000;},set_TransitionDuration:function(A){if(this._duration!=(A/1000)){this._duration=A/1000;
for(var B=0;B<this._panes.length;B++){var C=this._panes[B].animation;if(C){C.set_duration(this._duration);
}}this.raisePropertyChanged("TransitionDuration");}},get_FramesPerSecond:function(){return this._framesPerSecond;
},set_FramesPerSecond:function(A){if(this._framesPerSecond!=A){this._framesPerSecond=A;
for(var B=0;B<this._panes.length;B++){var C=this._panes[B].animation;if(C){C.set_fps(this._framesPerSecond);
}}this.raisePropertyChanged("FramesPerSecond");}},get_FadeTransitions:function(){return this._fadeTransitions;
},set_FadeTransitions:function(A){if(this._fadeTransitions!=A){this._fadeTransitions=A;
this._disposeAnimations();if(!this._fadeTransitions){for(var B=0;B<this._panes.length;
B++){$common.setElementOpacity(this._panes[B].content,1);$common.setElementOpacity(this._panes[B].content._original,1);
}}this.raisePropertyChanged("FadeTransitions");}},get_HeaderCssClass:function(){return this._headerCssClass;
},set_HeaderCssClass:function(A){this._headerCssClass=A;this.raisePropertyChanged("HeaderCssClass");
},get_HeaderSelectedCssClass:function(){return this._headerSelectedCssClass;},set_HeaderSelectedCssClass:function(A){this._headerSelectedCssClass=A;
this.raisePropertyChanged("HeaderSelectedCssClass");},get_ContentCssClass:function(){return this._contentCssClass;
},set_ContentCssClass:function(A){this._contentCssClass=A;this.raisePropertyChanged("ContentCssClass");
},get_AutoSize:function(){return this._autoSize;},set_AutoSize:function(A){if(Sys.Browser.agent===Sys.Browser.InternetExplorer&&A===AjaxControlToolkit.AutoSize.Limit){A=AjaxControlToolkit.AutoSize.Fill;
}if(this._autoSize!=A){this._autoSize=A;this._initializeLayout();this.raisePropertyChanged("AutoSize");
}},get_SelectedIndex:function(){return this._selectedIndex;},set_SelectedIndex:function(A){this._changeSelectedIndex(A,true);
},get_requireOpenedPane:function(){return this._requireOpenedPane;},set_requireOpenedPane:function(A){if(this._requireOpenedPane!=A){this._requireOpenedPane=A;
this.raisePropertyChanged("requireOpenedPane");}},get_suppressHeaderPostbacks:function(){return this._suppressHeaderPostbacks;
},set_suppressHeaderPostbacks:function(A){if(this._suppressHeaderPostbacks!=A){this._suppressHeaderPostbacks=A;
this.raisePropertyChanged("suppressHeaderPostbacks");}}};AjaxControlToolkit.AccordionBehavior.registerClass("AjaxControlToolkit.AccordionBehavior",AjaxControlToolkit.BehaviorBase);
Sys.Application.getDisposableObjects=function(){return this._disposableObjects;};
Sys.Application.disposeAllDisposableObjects=function(){var A=Array.clone(this.getDisposableObjects());
while(A.length>0){Sys.Application.removeDisposableObject(A[A.length-1]);Array.removeAt(A,A.length-1);
}Array.clear(this._disposableObjects);};Sys.Application.removeDisposableObject=function(A){this.removeComponent(A);
if(A.dispose){A.dispose();}A=null;};Sys.Application.printDisposableObjects=function(C){var A=new Sys.StringBuilder("Disposable objects at: "+window.location+"\n\n");
var D=Sys.Application.getDisposableObjects();for(var E=0;E<D.length;E++){var B=D[E];
A.append(Type.getTypeName(B)+" - id: "+B.get_id()+"\n");}alert(A.toString());};Type.prototype._createGetter=function(A){return function(){return this[A];
};};Type.prototype._createSetter=function(A){return function(B){this[A]=B;};};Type.prototype.createProperty=function(A,B){var E="_"+A;
var D=this._createGetter(E);var C=this._createSetter(E);this.prototype["get_"+A]=D;
this.prototype["set_"+A]=C;};Type.prototype._createAddHandler=function(A){return function(B){Type.addHandlerToEventHandlerList_SafeAccrossWindows(this.get_events(),A,B);
};};Type.prototype._removeAddHandler=function(A){return function(B){Type.removeHandlerFromEvantHandlerList_SafeAccrossWindows(this.get_events(),A,B);
};};Type.prototype.createEvent=function(C){var B=this._createAddHandler(C);var A=this._removeAddHandler(C);
this.prototype["add_"+C]=B;this.prototype["remove_"+C]=A;if(!this.__events){if(!this.inheritsFrom(Sys.Component)){this.prototype.get_events=function(){if(!this.__events){this._events=new Sys.EventHandlerList();
}return this._events;};}}if(!Type.isFunction(this.prototype._raiseEvent)){this.prototype._raiseEvent=function(E,F){var D=this.get_events().getHandler(E);
if(D){if(!F){F=Sys.EventArgs.Empty;}D(this,F);}};}this.__events=true;};Sys.Component.prototype.set_events=function(C){C=CClientLib.UI.Events.parse(C);
var B=C.get_events();for(var A in B){this["add_"+A](B[A]);}};Sys.GetTypes=function(){var A=Sys.__upperCaseTypes;
if(!A){alert("Error: Sys.GetTypes is empty");}return A;};Sys.Application.add_init(function(){Sys.EventHandlerList.prototype.addHandler=function(E,F){if(Type.isFunction(F)){var D=this._getEvent(E,true);
D[D.length]=F;}else{alert("ERROR you can only add a function to the eventhandler list");
}};if(Sys.Browser.agent==Sys.Browser.InternetExplorer){var A=Sys.GetTypes();for(var C in A){var B=A[C];
B.prototype._constructor=B.prototype.constructor;}}});Type.addHandlerToEventHandlerList_SafeAccrossWindows=function(D,A,C){D=Sys.EventHandlerList.parse(D);
var B=D._getEvent(A,true);B[B.length]=C;};Type.removeHandlerFromEvantHandlerList_SafeAccrossWindows=function(D,A,C){D=Sys.EventHandlerList.parse(D);
var B=D._getEvent(A);if(!B){return;}Array.remove(B,C);};Type.addHandlerToElement_SafeAccrossWindows=function(D,E,A){if(E==="error"){throw Error.invalidOperation(Sys.Res.addHandlerCantBeUsedForError);
}if(!D._events){D._events={};}var B=D._events[E];if(!B){D._events[E]=B=[];}var C;
if(D.addEventListener){C=function(F){return A.call(D,new Sys.UI.DomEvent(F));};D.addEventListener(E,C,false);
}else{if(D.attachEvent){C=function(){var F={};try{F=Sys.UI.DomElement._getWindow(D).event;
}catch(G){}return A.call(D,new Sys.UI.DomEvent(F));};D.attachEvent("on"+E,C);}}B[B.length]={handler:A,browserHandler:C};
};Sys.EventHandlerList.parse=function(A){return Sys.EventHandlerList._parse(A);};
Sys.UI.DomEvent.parse=function(A){return Sys.UI.DomEvent._parse(A);};Sys.Net.WebServiceError.parse=function(A){return Sys.Net.WebServiceError._parse(A);
};Sys.HistoryEventArgs.parse=function(A){return Sys.HistoryEventArgs._parse(A);};
Sys.ApplicationLoadEventArgs.parse=function(A){return Sys.ApplicationLoadEventArgs._parse(A);
};Type.prototype._parse=function(B){var A=Error.create("Unable to cast obj:"+B+" as a "+this.getName(),{"name":"CClientLib.InvalidParse"});
if(this.getName()!=Type.getTypeName(B)){fn_Global_DebbugingAlertObject(B,"EXCEPTION UNABLE TO PASS - CHECK ERROR CONSOLE");
throw A;}return B;};Type.getTypeName=function(B){if(B==undefined){return"undefined";
}if(B=="null"){return"null";}if(typeof(B)=="function"){return"function";}var A=(B._constructor?B._constructor:B.constructor);
if(!A||!A.__typeName||A.__typeName==="Object"){return"Object";}return A.getName();
};Type.prototype.getTypeName=function(){return Type.getTypeName(this);};Type.isBoolean=function(A){if(Type.getTypeName(A).toLowerCase()=="boolean"){return true;
}return false;};Type.isFunction=function(A){if(Type.getTypeName(A).toLowerCase()=="function"){return true;
}return false;};Type.isArray=function(A){if(Type.getTypeName(A).toLowerCase()=="array"){return true;
}return false;};Array.cast=function(A){if(!Type.isArray(A)){fn_Global_DebbugingAlertObject(A,"Unable to cast "+A+" as an Array.");
}return A;};Type.isString=function(A){if(Type.getTypeName(A).toLowerCase().toLowerCase()=="string"){return true;
}return false;};Type.isNumber=function(A){if(Type.getTypeName(A).toLowerCase().toLowerCase()=="number"){return true;
}return false;};Type.registerNamespace("CClientLib.UI");CClientLib.UI.Element=function(I,F,B,G){B=fn_Global_SafeObject_Object(B);
this.ownerDocument=F.ownerDocument;this._strElementType=I;this._element=null;var D=function(){alert("warning not overridden in ui builder");
};var E=this;var A=function(){if(B.insertBefore){F.insertBefore(E._element,B.insertBefore);
fn_Gloabl_ObjectDeleteProperty(B,"insertBefore");}else{F.appendChild(E._element);
}};var H=this._strElementType;switch(H){case"td":E._element=F.insert_cell(F.get_cellCount());
D=Function.emptyFunction;break;case"div":E._element=E.ownerDocument.createElement("div");
D=A;break;case"span":E._element=E.ownerDocument.createElement("span");D=A;break;case"tr":E._element=F.insert_row(F.get_rowCount());
D=Function.emptyFunction;break;case"table":E._element=E.ownerDocument.createElement("table");
E.rows=[];D=A;break;case"anchor":E._element=E.ownerDocument.createElement("a");D=function(){A();
E._element.onerror=window.onerror;$addHandler(E._element,"click",function(J){J=Sys.UI.DomEvent.parse(J);
J.stopPropagation();J.preventDefault();});};break;case"br":E._element=E.ownerDocument.createElement("br");
D=A;break;case"hr":E._element=E.ownerDocument.createElement("hr");D=A;break;case"button":E._element=E.ownerDocument.createElement("button");
D=function(){A();$addHandler(E._element,"click",function(J){Sys.UI.DomEvent.parse(J).preventDefault();
});};break;case"checkbox":E._element=E.ownerDocument.createElement("input");E._element.type="checkbox";
Sys.UI.DomElement.addCssClass(E._element,"checkbox");D=A;break;case"textbox":E._element=E.ownerDocument.createElement("input");
E._element.type="text";D=A;break;case"textarea":E._element=E.ownerDocument.createElement("textarea");
D=A;break;case"image":E._element=E.ownerDocument.createElement("img");D=function(){A();
$addHandler(E._element,"click",function(J){J=Sys.UI.DomEvent.parse(J);J.stopPropagation();
J.preventDefault();});};break;case"radiobutton":var C=$createSpan(F,{"value":"<input type='radio' name='"+B.name+"' />"});
E._element=C.get_element().childNodes[0];Sys.UI.DomElement.addCssClass(E._element,"radioBotton");
D=Function.emptyFunction;break;case"password":E._element=E.ownerDocument.createElement("input");
E._element.type="password";D=A;break;case"iframe":var C=$createSpan(F,{"value":'<iframe frameborder="0" src=\'\' scrolling="no" allowtransparency="true"></iframe>'});
E._element=C.get_element().childNodes[0];D=Function.emptyFunction;break;case"fileUploader":E._element=E.ownerDocument.createElement("input");
E._element.type="file";D=A;break;}if(fn_Global_SafeBool_Bool(G)){this.appendElementToPage=D;
}else{D();}this.set_Properties(B);this.style=this.get_element().style;this._element.get_elementWrapper=Function.createDelegate(this,function(){return CClientLib.UI.Element.parse(this);
});};CClientLib.UI.Element.prototype={set_Properties:function(A){for(var B in A){this["set_"+B](A[B]);
}},set_events:function(C){var A=C.get_events();for(var B in A){Type.addHandlerToElement_SafeAccrossWindows(this.get_element(),B,A[B]);
}},set_value:function(A,C){var B=this._strElementType;if(B=="textbox"||B=="textarea"||B=="radiobutton"||B=="password"){this._element.value=A;
}else{if(B=="button"||B=="div"||B=="span"||B=="image"||B=="tr"||B=="td"||B=="anchor"){this._element.innerHTML=A;
}else{if(B=="checkbox"){this._element.checked=A;}else{if(C!=false){C=true;}if(C){fn_Global_DebbugingAlertObject(this,"CClientLib.UI.Element.set_value() tag name not found");
}}}}},get_value:function(){var A=this._strElementType;if(A=="textbox"||A=="textarea"||A=="radiobutton"||A=="password"){return this._element.value;
}else{if(A=="button"||A=="div"||A=="span"||A=="image"||A=="tr"||A=="td"||A=="anchor"){return this._element.innerHTML;
}else{if(A=="checkbox"){return this._element.checked;}else{alert("CClientLib.UI.Element.get_value() tag name not found");
}}}},set_zIndex:function(A){this._element.style.zIndex=A;},set_id:function(A){this._element.id=A;
},set_css:function(A){Sys.UI.DomElement.addCssClass(this._element,A);},set_style:function(A){this.get_element().style.cssText=A;
this._element.setAttribute("style",A);},set_allowEditing:function(){alert("Method not yet created - 34566");
},set_name:function(A){this.get_element().name=A;},set_align:function(A){this.get_element().align=A;
},set_display:function(A){if(this._strElementType=="tr"&&A=="block"){A="";}this._element.style.display=A;
},set_isFaded:function(){alert("Method not yet created - 34566xxx");},set_disabled:function(B){if(this._strElementType=="anchor"){if(B){var A=this.get_element();
$clearHandlers(A);A.removeAttribute("href");A.style.color="gray";}else{throw Error.create("set_disabled to true has yet to be created for an anchor in the ElementBuilder");
}}else{if(this._strElementType=="button"||this._strElementType=="checkbox"){this._element.disabled=B;
}else{throw Error.create("ElementBuilder.set_disabled code path still under construction");
}}},set_colSpan:function(A){this._element.colSpan=A;},set_textboxAsLabel:function(A){if(A){this.get_element().style.borderStyle="Solid";
this.get_element().style.borderWidth="0px";this.get_element().style.borderColor="Transparent";
this.get_element().style._borderColor="tomato";this.get_element().style._filter="chroma(color=tomato)";
$addHandlers(this.get_element(),{focus:function(){this.get_element().blur();}},this);
}else{}},set_tooltip:function(A){this.get_element().setAttribute("Title",A);},set_src:function(A){if(this._strElementType=="iframe"){this.get_element().src=A;
}else{alert("ERROR: 24562");}},setAttribute:function(A,B){this.get_element().setAttribute(A,B);
},get_id:function(){return this._element.id;},get_element:function(){return this._element;
},set_focus:function(A){if(A){this._element.focus();}else{window.focus();}},get_elementType:function(){return this._strElementType;
},appendChild:function(A){this.get_element().appendChild(A);},insertBefore:function(B,A){this.get_element().insertBefore(B,A.get_element());
},removeFromDOM:function(A){this.removeChildrenFromDOM(A);CClientLib.UI.Element.RemoveRawElementFromDOM(this.get_element());
},removeChildrenFromDOM:function(){var J=[];var C=this.get_element().childNodes;J[0]=[];
for(var D=0;D<C.length;D++){Array.add(J[0],C[D]);}while(C.length){var G=J[J.length]=[];
var L=C.length;for(var A=0;A<L;A++){var K=C[A].childNodes;var F=K.length;for(var B=0;
B<F;B++){Array.add(G,K[B]);}}C=G;}var E=J.length;while(E){E--;var H=J[E];var I=H.length;
while(I){I--;CClientLib.UI.Element.RemoveRawElementFromDOM(H[I]);}}}};CClientLib.UI.Element.registerClass("CClientLib.UI.Element");
CClientLib.UI.Element.RemoveRawElementFromDOM=function(C){$clearHandlers(C);if(C.get_elementWrapper){var B=C.get_elementWrapper();
B=null;}else{}var A=C.parentNode;if(A){A.removeChild(C);}C=null;};CClientLib.UI.Events=function(C,A,B){this._events=C;
this._handlersOwner=A;this._additionalParameters=B;};CClientLib.UI.Events.prototype={get_events:function(B){var D={};
var C=function(G,F,H){var E=function(){var J=[];for(var I=0;I<arguments.length;I++){Array.add(J,arguments[I]);
}if(Type.isArray(F)){for(var I=0;I<F.length;I++){Array.add(J,F[I]);}}G.apply(H,J);
};return E;};for(var A in this._events){D[A]=C(this._events[A],this._additionalParameters,this._handlersOwner);
}return D;},add_additionalEvents:function(C){for(var B in C){var A=this._events[B];
if(Type.isFunction(A)){this._events[B]=function(){A(arguments);C[B](arguments);};
}else{this._events[B]=C[B];}}},get_handlersOwner:function(){return this._handlersOwner;
},set_additionalParameters:function(A){if(Type.isArray(A)){this._additionalParameters=A;
}else{alert("You may only add an Array of event parameters.");}}};CClientLib.UI.Events.registerClass("CClientLib.UI.Events");
CClientLib.UI.Events.addAdditionEventsToPropertiesObject=function(A,B){B=CClientLib.UI.Events.parse(B);
A=fn_Global_SafeObject_Object(A);var C=A.events;if(Type.getTypeName(A.events)!=CClientLib.UI.Events.getName()){A.events=B;
}else{C=CClientLib.UI.Events.parse(C);C.add_additionalEvents(B.get_events());}return A;
};var $createEvents=function(C,A,B){return new CClientLib.UI.Events(C,A,B);};var $createTextbox=function(C,A){var B=new CClientLib.UI.Element("textbox",C,A);
return B;};var $createTextboxPassword=function(C,A){var B=new CClientLib.UI.Element("password",C,A);
return B;};var $createTextboxNumber=function(D,C,B){var A=$createTextbox(D,C);$create(Textbox.Number,B,{},{},A.get_element());
return A;};var $createTextboxTimeSpan=function(D,A,C,E){var B=$createTextbox(D,A);
$create(Textbox.TimeSpan,{"_bAllowEditing":E},{},{},B.get_element());return B;};var $createTextBoxWaterMark=function(D,B,A){var C=$createTextbox(D,A);
$create(Textbox.Base,{"_bHighlightOnFocus":true,"_strWaterMark":B},{},{},C.get_element());
return C;};var $createTextarea=function(C,A){var B=new CClientLib.UI.Element("textarea",C,A);
return B;};var $createTextareaWaterMark=function(D,C,A){var B=$createTextarea(D,A);
$create(Textbox.Base,{"_bHighlightOnFocus":true,"_strWaterMark":C},{},{},B.get_element());
return B;};var $createCheckbox=function(C,A){var B=new CClientLib.UI.Element("checkbox",C,A);
return B;};var $createRadioButtonList=function(B){if(B==null||B=="undefined"){alert("warning you must set tname when creating a radiobuttonlist");
}var A={};A.radioButtons=[];A.add_radioButton=function(I,G,F,C){C.name=B;var H=$createDiv(I);
var D=new CClientLib.UI.Element("radiobutton",H,C);var E=$createSpan(H,{"value":F});
D.get_element().checked=G;Array.add(A.radioButtons,D);return{"divWrapper":H,"radioButton":D,"spanHeader":E};
};A.get_value=function(){for(var D=0;D<A.radioButtons.length;D++){var C=A.radioButtons[D];
if(C.get_element().checked){return C.get_value();}}return"";};A.set_value=function(D){var C=false;
for(var E=0;E<A.radioButtons.length;E++){var F=A.radioButtons[E];F.get_element().checked=false;
if(F.get_value().toLowerCase()==D.toLowerCase()){F.get_element().checked=true;C=true;
}}};return A;};var $createSpan=function(C,A){var B=new CClientLib.UI.Element("span",C,A);
return B;};var $createDiv=function(D,A,C){var B=new CClientLib.UI.Element("div",D,A,C);
return B;};var $createImage=function(C,B,A){var D=new CClientLib.UI.Element("image",C,A);
D.get_element().src=B;return D;};var $createBR=function(B,A){var C=new CClientLib.UI.Element("br",B,A);
return C;};var $createHR=function(B,A){var C=new CClientLib.UI.Element("hr",B,A);
return C;};var $createAnchor=function(C,A){var B=new CClientLib.UI.Element("anchor",C,A);
B.get_element().setAttribute("href","#");return B;};var $createButton=function(C,A){var B=new CClientLib.UI.Element("button",C,A);
return B;};var $createTable=function(D,A,C){var B=new CClientLib.UI.Element("table",D,A,C);
B.get_rows=Function.createDelegate(B,function(){return this.get_element().rows;});
B.get_rowCount=Function.createDelegate(B,function(){return this.get_element().rows.length;
});B.insert_row=Function.createDelegate(B,function(E){return this.get_element().insertRow(E);
});B.delete_row=Function.createDelegate(B,function(E){this.get_element().deleteRow(E.get_rowIndex());
});return B;};var $createTableRow=function(C,A){var B=new CClientLib.UI.Element("tr",C,A);
C.rows[C.rows.length]=B;B.get_cells=Function.createDelegate(B,function(){return this.get_element().cells;
});B.get_cellCount=Function.createDelegate(B,function(){return this.get_element().cells.length;
});B.insert_cell=Function.createDelegate(B,function(D){return this.get_element().insertCell(D);
});B.get_rowIndex=Function.createDelegate(B,function(){return this.get_element().rowIndex;
});return B;};var $createTableCell=function(C,A){var B=new CClientLib.UI.Element("td",C,A);
return B;};var $createIFrame=function(C,B){B=fn_Global_SafeObject_Object(B);if(!String.isPopulatedString(B.src)){B.src="blank.htm";
}var A=new CClientLib.UI.Element("iframe",C,B);A.get_iframeWindow=function(){return A.get_element().contentWindow;
};return A;};var $createFileUploader=function(E,F,G){var D="../Utilities/FileUploader.aspx?UploaderType="+G;
var C={};C.divWrapper=$createDiv(E);C.elementFileUploader=null;var B=$createDiv(C.divWrapper,{"value":"Loading images please wait..."},true);
C._setState=function(H){C._strState=H;};C._setState("initializing");C.get_state=function(){return C._strState;
};C._getGUID="";C.get_GUID=function(){return C._getGUID;};C.set_GUID=function(I){if(String.isPopulatedString(I)&&C.get_GUID()!=I){C._setState("initializing");
C.iFrame.set_display("none");B.set_display("block");B.set_value("Loading images please wait...");
if(C.get_state()=="ready"){var H=C.iFrame.get_iframeWindow();H.__doPostBack(H.fn_getElementUpdatePanel().id,I);
C.elementFileUploader=null;}else{C.iFrame.set_src(D+"&GUID="+I);}}};var A=function(J){J=Sys.UI.DomEvent.parse(J);
var H=CClientLib.UI.Element.parse(C.iFrame);var I=H.get_iframeWindow().fn_getElementUploader().value;
var M=I.substring(I.length-4,I.length).toLowerCase();var K=H.get_iframeWindow().fn_getElementFeedback();
if(I.length==0){K.innerHTML="<span style='color:red;'>*** Please select a file.</span>";
}else{if(M!=".jpg"&&M!=".gif"&&M!=".png"){C.elementFileUploader.value="";K.innerHTML="<span style='color:red;'>*** Invalid file type. Only supports jpg, gif or png.</span>";
}else{C._setState("uploading");C.iFrame.set_display("none");B.set_display("block");
B.set_value("Uploading file: "+I+".<br />Depending on the file size this could take a few minutes.<br />Please wait...");
var L=C.get_GUID();C.iFrame.get_iframeWindow().__doPostBack(H.get_iframeWindow().fn_getElementUploader().id,(String.isPopulatedString(L)?L:""));
C.elementFileUploader=null;}}};C.fn_onIFameLoad=function(){var I=CClientLib.UI.Element.parse(C.iFrame);
C._setState("ready");B.set_display("none");C.iFrame.set_display("block");C.elementFileUploader=I.get_iframeWindow().fn_getElementUploader();
I.get_iframeWindow()._objParentUploaderWrapper=C;var H=I.get_iframeWindow().fn_get_elementHiddenGUID().value;
C._getGUID=H;if(C.elementFileUploader._events==undefined||C.elementFileUploader._events["change"]==undefined){$addHandler(C.elementFileUploader,"change",A);
}I.get_iframeWindow().document.body.style.display="block";};C.iFrame=$createIFrame(E,{"src":D,"events":$createEvents({"load":C.fn_onIFameLoad},this),"style":"padding:0px; margin:0px; width:530px; height:650px;"});
C.iFrame.get_element().frameBorder="0";C.iFrame.get_element().allowTransparency="true";
C.iFrame.get_element().scrolling="no";return C;};var $createLoading=function(E,B,D){var A=$createDiv(E,fn_Global_ObjectAddDefultProperties(B,{"value":"Loading..."}));
if(false){var C=CClientLib.Parent.GetParentComponent();if(C){A.style.background="url("+C.get_clientData().get_applicationSettings().strRootURL+"Images/loading.gif) no-repeat center right";
A.style.paddingRight="20px";}}return A;};var $createCheckBoxWithTitle=function(J,B,E,A,D,C,G){var I=$createDiv(J,B,E);
var H=$createCheckbox(I,C,G);var F=$createSpan(I,A,D);return{"divWrapper":I,"spanHeader":F,"checkbox":H};
};var $createRowInDetailsTable=function(H,B,G,E,F,C,A){objectPropertiesDivHeading=fn_Global_ObjectAddDefultProperties(E,{"css":"heading"});
var D=$createTableRow(H,fn_Global_ObjectAddDefultProperties(B,{"style":"font-size:10px; vertical-align:top; height:23px;"}));
D.cellHeading=$createTableCell(D,fn_Global_ObjectAddDefultProperties(G,{"style":"vertical-align: top;"}));
D.cellValue=$createTableCell(D,fn_Global_ObjectAddDefultProperties(F,{"style":"vertical-align: top;"}));
D.cellErrorMessage=$createTableCell(D,fn_Global_ObjectAddDefultProperties(C,{"style":"vertical-align: top; color: red;"}));
D.divHeading=$createDiv(D.cellHeading,E);D.divErrorMessage=$createDiv(D.cellErrorMessage,A);
return D;};var $createStandardTitleAndNotes=function(J,E,H,C){var A=265;var I=130;
var B=$createSpan(J,{"style":"width:"+A+"px; float:left;"});var F=$createSpan(B,{"value":"<b>"+H+"</b>","style":"margin-right:15px;"});
var G=$createTextbox(B,{"style":"width:155px;","textboxAsLabel":!E});var D=$createDiv(J,{"style":"margin-left:"+A+"px; padding-left:"+I+"px; position:relative; z-index:1;"});
var K=$createTextarea(D,{"style":"width:100%;float:right","textboxAsLabel":!E});var F=$createSpan(D,{"value":"<b>"+C+"</b>&nbsp;","style":"margin:-"+(I-15)+"px; width:100%;"});
$createDiv(J,{"style":"clear:both;"});return{"textboxTitle":G,"textboxNotes":K};};
var $createStandardNote=function(B,A){var C=$createDiv(B,fn_Global_ObjectAddDefultProperties(A,{"css":"mainStandarNotes"}));
return C;};var $createStandardError=function(B,A){var C=$createDiv(B,fn_Global_ObjectAddDefultProperties(A,{"css":"mainStandarErrorNote"}));
return C;};var $createTabContainer=function(E,F){var D=$createDiv(E,{"id":F,"css":"ajax__tab_xp","style":"width:100%; visibility:hidden; padding-bottom:0px;"});
var B=$createDiv(D,{"id":D.get_id()+"_header"});var C=$createDiv(D,{"id":D.get_id()+"_body"});
var A=$create(AjaxControlToolkit.TabContainer,{"activeTabIndex":0},null,null,D.get_element());
A.add_tabPanel=Function.createDelegate(A,function(I){var H=$createSpan(B,{"value":I});
var G=$createDiv(C,{"style":"visibility:hidden;","css":"mainTabPanel"});var J=$create(AjaxControlToolkit.TabPanel,{"headerTab":H.get_element()},null,{"owner":D.get_id()},G.get_element());
Sys.EventHandlerList.parse(A.get_events()).addHandler("disposing",function(){if(fn_Global_IsParent()){Sys.Application.removeDisposableObject(J);
}});return{"spanHeader":H,"divBody":G,"controlTabPanel":J};});A.render=Function.createDelegate(A,function(H){H=fn_Global_SafeInt_Int(H);
A._app_onload();var G=this.get_tabs();for(var I=0;I<G.length;I++){this.set_activeTabIndex(I);
}this.set_activeTabIndex(H);});return A;};var $createDatePicker=function(R,G,F,O,E){var Q=CClientLib.Parent.GetClientData().get_applicationSettings().strRootURL+"Images/";
G=fn_Global_SafeObject_Object(G);var H=$createTable(R,{"style":"vertical-align:middle; display:inline; z-index:100;"});
var I=$createTableRow(H);var B=$createTableCell(I);var K=$createTableCell(I);var P=$createTableCell(I);
var J=$createTableCell(I);F=fn_Global_ObjectAddDefultProperties(F,{"style":"width:100px; text-align:center;"});
var N=$createTextbox(K,F);objImageButtonProperties=fn_Global_ObjectAddDefultProperties(O,{"style":"cursor:pointer;"});
var D=$createImage(P,Q+"calendar.png",O);D.get_element().alt="";E=fn_Global_ObjectAddDefultProperties(E,{"format":"dd / MMM / yyyy","button":D.get_element(),"firstDayOfWeek":1});
var L=$create(AjaxControlToolkit.CalendarBehavior,E,{},{},N.get_element());var A=null;
var C=null;if(Type.isFunction(G.fnStepForwardBy)){var M=function(U){var T=L.get_selectedDate();
var S=CClientLib.Type.Date.AddUnits(T,G.fnStepForwardBy(),U);L.set_selectedDate(S);
L.raiseDateSelectionChanged();};A=$createImage(B,Q+"arrowLeft.png",{"style":"cursor:pointer;","events":$createEvents({"click":function(){M(-1);
}},window)});C=$createImage(J,Q+"arrowRight.png",{"style":"cursor:pointer;","events":$createEvents({"click":function(){M(1);
}},window)});}$addHandler(N.get_element(),"focus",Function.createDelegate(L,L.show));
return{"tableWrapper":H,"textboxInput":N,"imgButton":D,"controlCalendar":L,"imageLeft":A,"imageLeft":C};
};var $createDatePickerDuration=function(I,C){var A=$createTable(I);var G=$createTableRow(A);
var B=$createTableCell(G,{"value":"Start Date: "});var D=$createTableCell(G);var E=$createTableCell(G,{"value":"End Date: ","style":"padding-left:15px;"});
var H=$createTableCell(G);var F=$createDatePicker(D);var J=$createDatePicker(H);};
var $createCollapsePanel=function(E,A,C){A=fn_Global_ObjectAddDefultProperties(A,{"Collapsed":true,"CollapsedSize":1,"SuppressPostBack":true});
var D=$create(AjaxControlToolkit.CollapsiblePanelBehavior,A,C,null,E.get_element());
D.add_collapsed(function(){E.set_display("none");});if(D.get_Collapsed()){E.set_display("none");
}var B=new Sys.UI.DomEvent({"altKey":false,"button":"undefined","charCode":"undefined","clientX":"undefined","clientY":"undefined","ctrlKey":"undefined","keyCode":"undefined","offsetX":"undefined","offsetY":"undefined","screenX":"undefined","screenY":"undefined","shiftKey":"undefined","target":"undefined","type":"undefined"});
D.close=function(){D.collapsePanel(B);};D.open=function(){D.expandPanel(B);};return D;
};CClientLib.UI.Element.parse=function(A){return CClientLib.UI.Element._parse(A);
};CClientLib.UI.Events.parse=function(A){return CClientLib.UI.Events._parse(A);};
Type.registerNamespace("Textbox");Textbox.Base=function(A){Textbox.Base.initializeBase(this,[A]);
this._strDefaultValue="";this._bDisabled=false;this._strDisabledBorder="Solid 1px White";
this._strCSSClass="";this._strStyle="";this._bHighlightOnFocus=true;this._strStandardBorder="Solid 1px #CCC";
this._strFocusBorder="Solid 1px Blue";this._strWaterMark="";this._arrayShowWaterMarkOnInput=[];
};Textbox.Base.prototype={initialize:function(){Textbox.Base.callBaseMethod(this,"initialize");
if(this._strDefaultValue!=""){this.get_element().value=this._strDefaultValue;}if(this._strCSSClass!=""){fn_Global_ElementSetAttributeCSS(this.get_element(),this._strCSSClass);
}if(this._strStyle!=""){fn_Global_ElementSetStyle(this.get_element(),this._strStyle);
}if(this._bDisabled){this.get_element().style.border=this._strDisabledBorder;$addHandlers(this.get_element(),{focus:function(){alert("this element is disabled. TODO: pass focus onto next element");
}},this);}else{$addHandlers(this.get_element(),{focus:this._onFocus,blur:this._onBlur},this);
}this.show_waterMark();},dispose:function(){Textbox.Base.callBaseMethod(this,"dispose");
},_onFocus:function(){if(this._strWaterMark!=""&&this.get_element().value==this._strWaterMark){this.get_element().value="";
}if(this._bHighlightOnFocus){this.get_element().style.border=this._strFocusBorder;
this.get_element().style.color="black";}},_onBlur:function(){this.get_element().style.border=this._strStandardBorder;
this.show_waterMark();},show_waterMark:function(){if(this._strWaterMark!=""){if(this.getValue()==""){this.get_element().style.color="gray";
this.get_element().value=this._strWaterMark;}else{this.get_element().style.color="black";
}}},setValue:function(A){this.get_element().value=A;this.show_waterMark();},getValue:function(){var A=this.get_element().value;
if(A==this._strWaterMark){A="";}return A;}};Textbox.Base.registerClass("Textbox.Base",Sys.UI.Behavior);
Type.registerNamespace("Textbox");Textbox.Number=function(A){Textbox.Number.initializeBase(this,[A]);
this._nDefaultValue=0;this._bDisplayValueIfZero=true;this._bAllowEditing=true;this._fn_MoveUp=function(){};
this._fn_MoveRight=function(){};this._fn_MoveDown=function(){};this._fn_MoveLeft=function(){};
this._bAllowDecimal=false;};Textbox.Number.prototype={initialize:function(){Textbox.Number.callBaseMethod(this,"initialize");
if(this._bAllowEditing){$addHandlers(this.get_element(),{focus:this._onFocus,blur:this._onBlur,keydown:this._onKeyDown},this);
}if(this._nDefaultValue!=""){this.get_element().value=this._nDefaultValue;}this.validateValue();
},dispose:function(){Textbox.Number.callBaseMethod(this,"dispose");},_onFocus:function(){doSetCaretPosition(this.get_element(),0);
},_onBlur:function(){this.validateValue();},_onKeyDown:function(A){var B=this.get_element().value.length;
var C=Array.contains(this.get_element().value.split(""),".");var D=doGetCaretPosition(this.get_element());
var E=fn_TextboxBaseFunctions_SafeKeyCode(A);if(fn_TextboxBaseFunctions_charCodeIsInt_bool(E)){}else{if(E==Sys.UI.Key.up){this._fn_MoveUp();
}else{if(E==Sys.UI.Key.right){if(D>=B){this._fn_MoveRight();}}else{if(E==Sys.UI.Key.down){this._fn_MoveDown();
}else{if(E==Sys.UI.Key.left){if(D<1){this._fn_MoveLeft();}}else{if(E==Sys.UI.Key.enter||E==Sys.UI.Key.tab){this._fn_MoveRight();
}else{if(E==190&&!C&&this._bAllowDecimal){}else{if(E==Sys.UI.Key.del||E==Sys.UI.Key.backspace||E==Sys.UI.Key.end||E==Sys.UI.Key.home||E==16){}else{A.preventDefault();
}}}}}}}}},set_numberValue:function(A){this.get_element().value=A;this.validateValue();
},get_numberValue:function(){this.validateValue();var A=this.get_element().value;
if(this._bAllowDecimal){return fn_Global_SafeDecimal_Decimal(A);}else{return fn_Global_SafeInt_Int(A);
}},validateValue:function(){var B=0;var A=this.get_element().value;if(this._bAllowDecimal){B=fn_Global_SafeDecimal_Decimal(A);
}else{B=fn_Global_SafeInt_Int(A);}this.get_element().value=B+"";if(B==0&&!this._bDisplayValueIfZero){this.get_element().value="";
}}};Textbox.Number.registerClass("Textbox.Number",Sys.UI.Behavior);Type.registerNamespace("Textbox");
Textbox.TimeSpan=function(A){Textbox.TimeSpan.initializeBase(this,[A]);this._strDefaultValue="";
this._strWaterMarkValue="hh:mm:ss";this._strWaterMarkColor="Gray";this._strTemplateUnit="_";
this._strTemplateDivider=":";this._strTemplateDefaultValue="0";this._bAllowEditing=true;
};Textbox.TimeSpan.prototype={initialize:function(){Textbox.TimeSpan.callBaseMethod(this,"initialize");
if(this._bAllowEditing){$addHandlers(this.get_element(),{focus:this._onFocus,blur:this._onBlur,keypress:this._onKeyPress,keydown:this._onKeyDown},this);
}if(this._strDefaultValue!=""){this.get_element().value=this._strDefaultValue;}this.validateInput();
},dispose:function(){Textbox.TimeSpan.callBaseMethod(this,"dispose");},_onFocus:function(){this.get_element().style.color="black";
this._showWaterMark();if(this.get_element().value==this._strWaterMarkValue||this.get_element().value==""){this.get_element().value=this._getTemplate();
}doSetCaretPosition(this.get_element(),0);},_onBlur:function(){this.validateInput();
},_onKeyPress:function(A){A.preventDefault();},_onKeyDown:function(C){var I=this._getTemplate().length;
var E=doGetCaretPosition(this.get_element());var H=fn_TextboxBaseFunctions_SafeKeyCode(C);
var G=true;C.preventDefault();if(fn_TextboxBaseFunctions_charCodeIsInt_bool(H)&&E<I){this._addCharToTemplate(E,String.fromCharCode(H),G);
doSetCaretPosition(this.get_element(),E+1);}if(H==Sys.UI.Key.right&&E<I){doSetCaretPosition(this.get_element(),E+1);
}if(H==Sys.UI.Key.left&&E>0){G=false;doSetCaretPosition(this.get_element(),E-1);}if(H==Sys.UI.Key.backspace&&E>0){G=false;
this._addCharToTemplate(E-1,this._strTemplateUnit,G);doSetCaretPosition(this.get_element(),E-1);
}if(H==Sys.UI.Key.del&&E<I){var J=this.get_element().value;if(E<J.length){for(var A=E;
A<J.length;A++){if(A!=2&&A!=5){var D=A+1;var B="";if(D>7){B=this._strTemplateUnit;
}else{if(D==2||D==5){B=J.charAt(D+1);}else{B=J.charAt(D);}}this._addCharToTemplate(A,B,null);
}}}doSetCaretPosition(this.get_element(),E);}if(this._getNextCharAfterCarret()==this._strTemplateDivider){var F=((G)?1:-1);
doSetCaretPosition(this.get_element(),doGetCaretPosition(this.get_element())+F);}},_getTemplate:function(){var A=this._strTemplateUnit+this._strTemplateUnit;
A+=this._strTemplateDivider;A+=this._strTemplateUnit+this._strTemplateUnit;A+=this._strTemplateDivider;
A+=this._strTemplateUnit+this._strTemplateUnit;return A;},_getNextCharAfterCarret:function(){var A=doGetCaretPosition(this.get_element());
return this.get_element().value.charAt(A);},_addCharToTemplate:function(B,A,C){if(B==2||B==5){B=B+((C)?1:-1);
}if(B==0||B==1||B==3||B==4||B==6||B==7){this.get_element().value=fn_Global_ReplaceCharAtSpecifiedIndex(this.get_element().value,B,A);
return true;}return false;},_showWaterMark:function(){if(this._bAllowEditing){if(this.get_element().value==this._strTemplateDefaultValue+this._strTemplateDefaultValue+this._strTemplateDivider+this._strTemplateDefaultValue+this._strTemplateDefaultValue+this._strTemplateDivider+this._strTemplateDefaultValue+this._strTemplateDefaultValue||this.get_element().value==this._getTemplate()||this.get_element().value==""){this.get_element().style.color=this._strWaterMarkColor;
this.get_element().value=this._strWaterMarkValue;}}},get_timeSpanValue:function(){var A=this.get_element().value;
if(A==this._strWaterMarkValue){return"";}else{return A;}},validateInput:function(){this._showWaterMark();
var D="";var C=this.get_element().value;for(var A=0;A<C.length;A++){var B=C.charAt(A);
D+=(B==this._strTemplateUnit)?this._strTemplateDefaultValue:B;}this.get_element().value=D;
this._showWaterMark();}};Textbox.TimeSpan.registerClass("Textbox.TimeSpan",Sys.UI.Behavior);
Type.registerNamespace("CClientLib");CClientLib.ClientDataCollection=function(){this._applicationSettings=Sys.Serialization.JavaScriptSerializer.deserialize("{ 'strRootURL': 'http://www.training-track.com/', 'Status_Active': 1, 'Status_Archived': 2 }");
this._selectableTimeCollection=new CClientLib.ServerClasses.SelectableTimeCollection.parse(eval('new CClientLib.ServerClasses.SelectableTimeCollection([_$5([0,"6:00 am"]), _$5([1,"6:30 am"]), _$5([2,"7:00 am"]), _$5([3,"7:30 am"]), _$5([4,"8:00 am"]), _$5([5,"8:30 am"]), _$5([6,"9:00 am"]), _$5([7,"9:30 am"]), _$5([8,"10:00 am"]), _$5([9,"10:30 am"]), _$5([10,"11:00 am"]), _$5([11,"11:30 am"]), _$5([12,"12:00 pm"]), _$5([13,"12:30 pm"]), _$5([14,"1:00 pm"]), _$5([15,"1:30 pm"]), _$5([16,"2:00 pm"]), _$5([17,"2:30 pm"]), _$5([18,"3:00 pm"]), _$5([19,"3:30 pm"]), _$5([20,"4:00 pm"]), _$5([21,"4:30 pm"]), _$5([22,"5:00 pm"]), _$5([23,"5:30 pm"]), _$5([24,"6:00 pm"]), _$5([25,"6:30 pm"]), _$5([26,"7:00 pm"]), _$5([27,"7:30 pm"]), _$5([28,"8:00 pm"]), _$5([29,"8:30 pm"]), _$5([30,"9:00 pm"]), _$5([31,"9:30 pm"])])'));
this._unitWeightCollection=new CClientLib.ServerClasses.UnitWeightCollection.parse(eval('new CClientLib.ServerClasses.UnitWeightCollection([_$3([100,"kg","Kilogram"]), _$3([101,"g","Gram"]), _$3([300,"lb","Pound"])])'));
this._unitDistanceCollection=new CClientLib.ServerClasses.UnitDistanceCollection.parse(eval('new CClientLib.ServerClasses.UnitDistanceCollection([_$4([200,"km","Kilometer"]), _$4([201,"m","Meter"]), _$4([202,"mi","Mile"]), _$4([203,"yd","Yard"])])'));
this._mapCollection=new CClientLib.ServerClasses.MapCollection([]);this._exerciseCollection=new CClientLib.ServerClasses.ExerciseCollection([]);
this._scheduleProgramCollection=new CClientLib.ServerClasses.ScheduledProgramCollection([]);
this._programsActiveCollection=new CClientLib.ServerClasses.ProgramCollection([]);
this._programsArchivedCollection=new CClientLib.ServerClasses.ProgramCollection([]);
this._associatedUsersCollection=new CClientLib.ServerClasses.UserCollection([]);this._userCurrent=null;
this._exerciseAndMapCollection=null;this._arrayExerciseAndMapAssociations=[];};CClientLib.ClientDataCollection.prototype={load_clientDynamicData:function(A){A=CClientLib.ServerClasses.ClientDynamicData.parse(A);
this.load_user(A.get_currentUser());this.load_associatedUsers(A.get_associatedUsers());
this.load_exercises(A.get_exercises());this.load_maps(A.get_maps());this.load_exerciseAndMapAssociations(A.get_exerciseAndMapAppociations());
this.load_programs(A.get_programs());this.load_schedulePrograms(A.get_scheduledPrograms());
},load_maps:function(A){this._mapCollection=CClientLib.ServerClasses.MapCollection.parse(A);
this._exerciseAndMapCollection=null;},load_exercises:function(A){this._exerciseCollection=CClientLib.ServerClasses.ExerciseCollection.parse(A);
this._exerciseAndMapCollection=null;},load_schedulePrograms:function(A){this._scheduleProgramCollection=CClientLib.ServerClasses.ScheduledProgramCollection.parse(A);
},load_user:function(A){this._userCurrent=CClientLib.ServerClasses.User.parse(A);
},load_associatedUsers:function(A){this._associatedUsersCollection=CClientLib.ServerClasses.UserCollection.parse(A);
},load_programs:function(A){var B=CClientLib.ServerClasses.ProgramCollection.parse(A);
this._programsActiveCollection=new CClientLib.ServerClasses.ProgramCollection([]);
this._programsArchivedCollection=new CClientLib.ServerClasses.ProgramCollection([]);
for(var D=0;D<B.program_count();D++){var C=CClientLib.ServerClasses.Program.parse(B.get_program(D));
if(C.get_statusID()==this.get_applicationSettings().Status_Active){this._programsActiveCollection.add_program(C);
}else{if(C.get_statusID()==this.get_applicationSettings().Status_Archived){this._programsArchivedCollection.add_program(C);
}else{alert("error in passing the programs data to the client collection - invalid status");
}}}},load_exerciseAndMapAssociations:function(A){if(!Type.isArray(A)){alert("Error: invalid param in load_exerciseAndMapAssociations");
}this._arrayExerciseAndMapAssociations=A;this._exerciseAndMapCollection=null;},get_exerciseAssociatedMaps:function(A){A=CClientLib.ServerClasses.Exercise.parse(A);
var D=new CClientLib.ServerClasses.MapCollection([]);if(!A.get_showDistance()){return D;
}for(var B=0;B<this._arrayExerciseAndMapAssociations.length;B++){if(A.get_exerciseID()==this._arrayExerciseAndMapAssociations[B][0]){var C=CClientLib.ServerClasses.MapCollection.parse(this.get_maps()).get_mapByMapID(this._arrayExerciseAndMapAssociations[B][1]);
if(Maps!=null){D.add_map(C);}}}return D;},get_mapAssociatedExercises:function(){alert("not yet implemented");
},get_exercisesAndMaps:function(){if(this._exerciseAndMapCollection!=null){return this._exerciseAndMapCollection;
}this._exerciseAndMapCollection=new CClientLib.ServerClasses.ExerciseAndMapCollection([]);
var B=this.get_exercises();for(var C=0;C<B.item_count();C++){var A=CClientLib.ServerClasses.Exercise.parse(B.get_exercise(C));
this._exerciseAndMapCollection.add_exerciseAndMap(CClientLib.ServerClasses.ExerciseAndMap.CreateExerciseAndMap(A,null));
var E=this.get_exerciseAssociatedMaps(A);for(var D=0;D<E.item_count();D++){this._exerciseAndMapCollection.add_exerciseAndMap(CClientLib.ServerClasses.ExerciseAndMap.CreateExerciseAndMap(A,CClientLib.ServerClasses.Map.parse(E.get_item(D))));
}}return this._exerciseAndMapCollection;},get_selectableTimes:function(){return this._selectableTimeCollection;
},get_exercises:function(){return CClientLib.ServerClasses.ExerciseCollection.parse(this._exerciseCollection);
},get_maps:function(){return CClientLib.ServerClasses.MapCollection.parse(this._mapCollection);
},get_unitsDistance:function(){return this._unitDistanceCollection;},get_unitsWeight:function(){return this._unitWeightCollection;
},get_programsActive:function(){return this._programsActiveCollection;},get_programsArchived:function(){return this._programsArchivedCollection;
},get_associatedUsers:function(){return this._associatedUsersCollection;},get_currentUser:function(){return this._userCurrent;
},get_scheduleProgramCollection:function(){return this._scheduleProgramCollection;
},get_applicationSettings:function(){return this._applicationSettings;}};CClientLib.ClientDataCollection.registerClass("CClientLib.ClientDataCollection");
CClientLib.ClientDataCollection.parse=function(A){return CClientLib.ClientDataCollection._parse(A);
};Type.registerNamespace("CClientLib");CClientLib.Dictionary=function(){};CClientLib.Dictionary.prototype={add_item:function(B,A){this[B]=A;
}};CClientLib.Dictionary.registerClass("CClientLib.Dictionary");CClientLib.Dictionary.parse=function(A){return CClientLib.Dictionary._parse(A);
};Type.registerNamespace("CClientLib.GoogleLoader");CClientLib.GoogleLoader._cclientlib_googleapiloaded=function(){google.load("maps","2",{"callback":function(){CClientLib.GoogleMaps.GetGoogleMaps()._raiseLoaded();
}});Sys.Application.add_unload(function(){if(GUnload){GUnload();}});};CClientLib.GoogleLoader.GetClientPosition=function(){fn_Global_DebbugingAlertObject(google.loader.ClientLocation);
if(google&&google.loader&&google.loader.ClientLocation){return google.loader.ClientLocation;
}return null;};Sys.Application.add_load(function(){var A="ABQIAAAAB-byzg2IfTLFp94GbtFK9xTGLnvYXGTlgo9Tlgg-PiVg2fkhKxRxzZOY9wff2SWEijWFQgKMDSS0dg";
fn_Global_DynamicallyIncludeScript("http://www.google.com/jsapi?key="+A+"&callback=CClientLib.GoogleLoader._cclientlib_googleapiloaded");
});Type.registerNamespace("CClientLib");CClientLib.NavigationState=function(C,A,B,E,F,D){if(arguments.length!=6){alert("Invalid parameter count for new CClientLib.NavigationState()");
}this._strStateTitle=fn_Global_SafeString_String(C);this._bIFrameSetSRC=fn_Global_SafeBool_Bool(A);
this._strIframeSRC=fn_Global_SafeString_String(B);this._strCanvasFunctionName=fn_Global_SafeString_String(E);
this._aCanvasFunctionArguments=fn_Global_SafeArray_Array(F);this._bAuthenticationRequired=fn_Global_SafeBool_Bool(D);
};CClientLib.NavigationState.prototype={get_stateTitle:function(){return this._strStateTitle;
},get_iFrameSetSRC:function(){return this._bIFrameSetSRC;},get_iframeSRC:function(){return this._strIframeSRC;
},get_canvasFunctionName:function(){return this._strCanvasFunctionName;},get_canvasFunctionArguments:function(){return this._aCanvasFunctionArguments;
},get_authenticationRequired:function(){return this._bAuthenticationRequired;},get_safeStateObject:function(){return{"____isNavigationState":true,"serializedJSON":window.top.Sys.Serialization.JavaScriptSerializer.serialize(this)};
}};CClientLib.NavigationState.registerClass("CClientLib.NavigationState");CClientLib.NavigationState.nNavigationStateID=0;
CClientLib.NavigationState.parse=function(A){A=fn_Global_SafeObject_Object(A);if(Type.getTypeName(A)==CClientLib.NavigationState.getName()){return A;
}else{if(A.____isNavigationState){A=window.top.Sys.Serialization.JavaScriptSerializer.deserialize(A.serializedJSON,false);
return new CClientLib.NavigationState(A._strStateTitle,A._bIFrameSetSRC,A._strIframeSRC,A._strCanvasFunctionName,A._aCanvasFunctionArguments,A._bAuthenticationRequired);
}}return CClientLib.NavigationState._parse(A);};CClientLib.Navigation=function(B,A){window.top.Sys.Application.add_navigate(Function.createDelegate(this,function(C,D){CClientLib.Parent.GetParentComponent().set_loading(true);
window.setTimeout(Function.createDelegate(this,function(){this._handlerOnNavigate(C,D);
}),1);}));this._fnHandlerRenderCanvasOnInit=function(){};this._dtNavigationBegun=null;
this._dtNavigationComplete=null;this._strInitialDocumentTitle=document.title;this._strURLLoggedInPage=B;
this._strURLLoggedOutPage=A;this._navigationBegun=false;};CClientLib.Navigation.prototype={_handlerOnNavigate:function(A,D){D=window.top.Sys.HistoryEventArgs.parse(D);
var C=fn_Global_SafeObject_Object(D.get_state());this._navigationBegun=true;if(Type.getTypeName(C)==CClientLib.NavigationState.getName()||C.____isNavigationState){C=CClientLib.NavigationState.parse(C);
if(!Sys.Services.AuthenticationService.get_isLoggedIn()&&C.get_authenticationRequired()){this.navigateTo_LoggedOut();
return;}CClientLib.Parent.GetParentComponent()._setIFrameHeading(C.get_stateTitle());
if(C.get_iFrameSetSRC()){this._navigate_toURL(C.get_iframeSRC());}else{if(Type.isFunction(CClientLib.Canvas.prototype[C.get_canvasFunctionName()])){var B=C.get_canvasFunctionArguments();
this._dtNavigationBegun=new Date();CClientLib.Parent.GetModalPopupContainer().close_allOpenModalPopups();
this._fnHandlerRenderCanvasOnInit=function(E){E=CClientLib.Canvas.parse(E);E[C.get_canvasFunctionName()].apply(E,B);
};this._initializeCanvas();}}}else{}},raiseEventCanvasInit:function(A){A=CClientLib.Canvas.parse(A);
Type.addHandlerToEventHandlerList_SafeAccrossWindows(A.get_events(),"canvasLoad",function(){CClientLib.Parent.GetParentComponent().set_loading(false);
});this._fnHandlerRenderCanvasOnInit(A);},_initializeCanvas:function(B){var A=CClientLib.Parent.GetIFrameWindowObject();
if(A!=null&&A.CClientLib&&A.CClientLib.Canvas&&A.CClientLib.Canvas.IsCanvasLoaded()){A.CClientLib.Canvas.ReloadCanvas();
}else{this._setIFrameURL(CClientLib.Canvas.CanvasSRC);}},_setIFrameURL:function(B){var A=CClientLib.Parent.GetIFrameWindowObject();
if(A!=null){CClientLib.Parent.GetIFrameWindowObject().location.replace(B);}else{CClientLib.Parent.GetIFrame().src=B;
}},get_state:function(){var A=window.top.Sys.Application._state;if(Type.getTypeName(A)==CClientLib.NavigationState.getName()||A.____isNavigationState){A=CClientLib.NavigationState.parse(A);
return A;}return null;},get_navigaionBegun:function(){return this._navigationBegun;
},addHistoryPoint:function(A){this._navigationBegun=true;A=CClientLib.NavigationState.parse(A);
window.top.Sys.Application.addHistoryPoint(CClientLib.NavigationState.parse(A).get_safeStateObject(),this._strInitialDocumentTitle+" - "+A.get_stateTitle());
},navigate_toURL:function(C,B,A){this.addHistoryPoint(new CClientLib.NavigationState(B,true,C,null,null,A));
},_navigate_toURL:function(A){this._fnHandlerRenderCanvasOnInit=function(){};this._setIFrameURL(A);
},navigateTo_DefaultPage:function(){if(Sys.Services.AuthenticationService.get_isLoggedIn()){this.navigateTo_LoggedIn();
}else{this.navigateTo_LoggedOut();}},navigateTo_LoggedIn:function(){this.navigate_toURL(this._strURLLoggedInPage,"",true);
},navigateTo_LoggedOut:function(){this.navigate_toURL(this._strURLLoggedOutPage,"",false);
},navigateTo_ScheduleCalendar:function(A){this.addHistoryPoint(new CClientLib.NavigationState("View your scheduled programs / workouts",false,"","load_scheduleCalendar",[A],true));
},navigateTo_ScheduleProgramList:function(A){this.addHistoryPoint(new CClientLib.NavigationState("Schedule a program to your training calendar",false,"","load_scheduleProgramList",[A],true));
},navigateTo_CreateUser:function(A){this.addHistoryPoint(new CClientLib.NavigationState("Create New User",false,"","load_personalSettings",[A],false));
},navigateTo_PersonalSettings:function(A){this.addHistoryPoint(new CClientLib.NavigationState("Personal Settings",false,"","load_personalSettings",[A],true));
},navigateTo_PersonalProfiles:function(A){this.addHistoryPoint(new CClientLib.NavigationState("Personal Profiles",false,"","load_personalProfiles",[A],true));
},navigateTo_ProgramCreate:function(A,B){this.addHistoryPoint(new CClientLib.NavigationState("Program Create",false,"","load_programCreate",[A,B],true));
},navigateTo_ProgramListActive:function(A){this.addHistoryPoint(new CClientLib.NavigationState("Program List (Active)",false,"","load_programListActive",[A],true));
},navigationIsSetTo_ProgramListActive:function(){var A=this.get_state();if(A!=null){A=CClientLib.NavigationState.parse(A);
if(A.get_canvasFunctionName()=="load_programListActive"){return true;}}return false;
},navigateTo_ProgramListArchived:function(A){this.addHistoryPoint(new CClientLib.NavigationState("Program List (Archived)",false,"","load_programListArchived",[A],true));
},navigateTo_ExerciseList:function(A){this.addHistoryPoint(new CClientLib.NavigationState("View your exercises",false,"","load_exerciseList",[A],true));
},navigateTo_MapList:function(A){this.addHistoryPoint(new CClientLib.NavigationState("View your maps",false,"","load_mapList",[A],true));
},navigateTo_StatsWortout:function(A){this.addHistoryPoint(new CClientLib.NavigationState("View your staticial informaion",false,"","load_statsWorkout",[A],true));
},navigateTo_StatsExercise:function(A){this.addHistoryPoint(new CClientLib.NavigationState("View your staticial informaion",false,"","load_statsExercise",[A],true));
},navigateTo_StatsMap:function(A){this.addHistoryPoint(new CClientLib.NavigationState("View your staticial informaion",false,"","load_statsMap",[A],true));
},navigateTo_StatsProfile:function(A){this.addHistoryPoint(new CClientLib.NavigationState("View your staticial informaion",false,"","load_statsProfile",[A],true));
}};CClientLib.Navigation.registerClass("CClientLib.Navigation");Type.registerNamespace("CClientLib.Type");
CClientLib.Type.Enum=function(){throw Error.create("Static class, can't be instanciated");
};CClientLib.Type.Enum._strEnumerationItemIdentifier="____isEnum";CClientLib.Type.Enum.EnumerationItem=function(B,C,A){this._objEnumGroup=B;
this._nEnum=C;this._strEnum=A;this[CClientLib.Type.Enum._strEnumerationItemIdentifier]=true;
};CClientLib.Type.Enum.EnumerationItem.prototype={get_integer:function(){return this._nEnum;
},get_string:function(){return this._strEnum;},get_enumGroup:function(){return this._objEnumGroup;
}};CClientLib.Type.Enum.EnumerationItem.registerClass("CClientLib.Type.Enum.EnumerationItem");
CClientLib.Type.Enum.parse=function(A){if(!CClientLib.Type.Enum.isEnum(A)){throw Error.create("Unable to parse CClientLib.Type.Enum");
}return A;};CClientLib.Type.Enum.isEnum=function(A){return(fn_Global_SafeBool_Bool(A[CClientLib.Type.Enum._strEnumerationItemIdentifier]));
};CClientLib.Type.Enum.parseFromInt=function(C,D){for(var A in C){var B=C[A];if(CClientLib.Type.Enum.isEnum(B)){if(CClientLib.Type.Enum.parse(B).get_integer()==D){return B;
}}}throw Error.create("Unable to CClientLib.Type.Enum.parseFromInt");};CClientLib.Type.Enum.parseFromString=function(D,B){for(var A in D){var C=D[A];
if(CClientLib.Type.Enum.isEnum(C)){B=fn_Global_RemoveSubstring(B," ").toLocaleLowerCase();
strEnumProperty=fn_Global_RemoveSubstring(CClientLib.Type.Enum.parse(C).get_string()," ").toLocaleLowerCase();
if(strEnumProperty==B){return C;}}}throw Error.create("Unable to CClientLib.Type.Enum.parseFromString");
};CClientLib.Type.Enum.Compare=function(B,A){B=CClientLib.Type.Enum.parse(B);A=CClientLib.Type.Enum.parse(A);
if(B.get_enumGroup()!=A.get_enumGroup()){throw Error.create("Enums not of the same type");
}return((B.get_integer())==(A.get_integer()));};CClientLib.Type.Enum.ForEach=function(B,A){for(name in B){var C=B[name];
if(CClientLib.Type.Enum.isEnum(C)){if(Type.isFunction(A)){A(C);}}}};CClientLib.Type.Date=function(){throw Error.create("Static class, can't be instanciated");
};CClientLib.Type.Date.registerClass("CClientLib.Type.Date");CClientLib.Type.Date.isDate=function(A){if(Type.getTypeName(A).toLowerCase()=="date"){return true;
}return false;};CClientLib.Type.Date.safeDate=function(A){if(CClientLib.Type.Date.isDate(A)){return A;
}return null;};CClientLib.Type.Date.parse=function(A){if(!CClientLib.Type.Date.isDate(A)){fn_Global_DebbugingAlertObject(A,"Unable to cast "+A+" as a Date.");
}return A;};CClientLib.Type.Date.parseString=function(F){var D=Error.create("Unable to pase date in "+CClientLib.Type.Date.parseString);
if(!Type.isString(F)){throw D;}var C;var H;var I;var E=F.split("/");if(E.length!=3){throw D;
}else{C=E[0];H=E[1];I=E[2];if(Type.isNumber(I)||I<1900||I>2100){throw D;}var B=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];
var G=-1;for(var A=0;A<B.length;A++){if(B[A]==H){G=A;break;}}if(G==-1){throw D;}if(Type.isNumber(C)||C<1||C>31){throw D;
}}return new Date(I,G,C);};CClientLib.Type.Date.dateToServerDTString=function(A){A=CClientLib.Type.Date.safeDate(A);
if(A==null){return"";}return CClientLib.Type.Date.format(A,"dd/MMMM/yyyy hh:mm:ss tt");
};CClientLib.Type.Date.format=function(U,C){var P=/d{1,4}|M{1,4}|yy(?:yy)?|([HhmsTt])\1?|[LloZ]|"[^"]*"|'[^']*'/g;
var H=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g;
var K=/[^-+\dA-Z]/g;var T=function(D,L){D=String(D);L=parseInt(L)||2;while(D.length<L){D="0"+D;
}return D;};if(!(CClientLib.Type.Date.isDate(U)&&String.isPopulatedString(C))){alert("invalid params in: "+CClientLib.Type.Date.format+"\nDate: "+U+"\nFormat: "+C);
}var I=CClientLib.Type.Date;var Q=U.getDate(),E=U.getDay(),S=U.getMonth(),A=U.getFullYear(),G=U.getHours(),J=U.getMinutes(),F=U.getSeconds(),R=U.getMilliseconds(),N=U.getTimezoneOffset(),B={d:Q,dd:T(Q),ddd:I.i18n.dayNames[E],dddd:I.i18n.dayNames[E+7],M:S+1,MM:T(S+1),MMM:I.i18n.monthNames[S],MMMM:I.i18n.monthNames[S+12],yy:String(A).slice(2),yyyy:A,h:G%12||12,hh:T(G%12||12),H:G,HH:T(G),m:J,mm:T(J),s:F,ss:T(F),l:T(R,3),L:T(R>99?Math.round(R/10):R),t:G<12?"a":"p",tt:G<12?"am":"pm",T:G<12?"A":"P",TT:G<12?"AM":"PM",Z:(String(U).match(H)||[""]).pop().replace(K,""),o:(N>0?"-":"+")+T(Math.floor(Math.abs(N)/60)*100+Math.abs(N)%60,4)};
var O=C.replace(P,function(D){return(D in B)?B[D]:D.slice(1,D.length-1);});return O;
};CClientLib.Type.Date.masks={defaultDateTime:"ddd MMM d yyyy hh:mm:ss",shortDate:"M/d/yy",mediumDate:"MMM d, yyyy",longDate:"MMMM d, yyyy",fullDate:"dddd, MMMM d, yyyy",shortTime:"h:mm TT",mediumTime:"h:mm:ss TT",longTime:"h:mm:ss TT Z",isoDate:"yyyy-MM-dd",isoTime:"hh:mm:ss",isoDateTime:"yyyy-MM-dd'T'hh:mm:ss",isoFullDateTime:"yyyy-MM-dd'T'hh:mm:ss.lo"};
CClientLib.Type.Date.i18n={dayNames:["Sun","Mon","Tue","Wed","Thr","Fri","Sat","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"]};
CClientLib.Type.Date.SecondsBetweenDates=function(A,D){var E=A.getTime();var C=D.getTime();
var B=(E-C)/1000;return B;};CClientLib.Type.Date.Duplicate=function(A){A=CClientLib.Type.Date.parse(A);
return new Date(A.getFullYear(),A.getMonth(),A.getDate());};CClientLib.Type.Date.AddUnits=function(B,C,A){C=C.toLocaleLowerCase();
if(C=="day"){return CClientLib.Type.Date.AddDays(B,A);}else{if(C=="week"){return CClientLib.Type.Date.AddDays(B,A*7);
}else{alert("Not implemented yet... (CClientLib.Type.Date.AddUnits)");}}};CClientLib.Type.Date.AddDays=function(C,B){var D=CClientLib.Type.Date.Duplicate(C);
var A=D.getDate();D.setDate(A+fn_Global_SafeInt_Int(B));return D;};CClientLib.Type.Date.GetDayNumber=function(A){return A.getDay();
};CClientLib.Type.Date.GetDayString=function(A){return CClientLib.Type.Date.format(A,"dddd");
};CClientLib.Type.Date.GetWeek=function(C){var A=CClientLib.Type.Date.GetStartOfWeek(C);
var E=new CClientLib.ServerClasses.GenericCollection("Value","Text");for(var D=0;
D<7;D++){var B=CClientLib.Type.Date.AddDays(A,D);E.add_item({"Value":B,"Text":CClientLib.Type.Date.format(B,"dddd (dd/MMM)")});
}return E;};CClientLib.Type.Date.GetWeekDayNamesAsGenericCollection=function(){var A=new CClientLib.ServerClasses.GenericCollection("Value","Text");
A.add_item({"Text":"Monday","Value":1});A.add_item({"Text":"Tuesday","Value":2});
A.add_item({"Text":"Wednesday","Value":3});A.add_item({"Text":"Thursday","Value":4});
A.add_item({"Text":"Friday","Value":5});A.add_item({"Text":"Saturday","Value":6});
A.add_item({"Text":"Sunday","Value":7});return A;};CClientLib.Type.Date.IsFistDayOfWeek=function(A){A=CClientLib.Type.Date.parse(A);
return(CClientLib.Type.Date.GetDayNumber(A)==CClientLib.Type.Date.WeekStartsOn_Temp());
};CClientLib.Type.Date.WeekStartsOn_Temp=function(){return 1;};CClientLib.Type.Date.GetStartOfWeek=function(B){var A=CClientLib.Type.Date.GetDayNumber(B);
var D=0;if(A==0){D=6;}else{D=A-1;}var C=CClientLib.Type.Date.AddDays(CClientLib.Type.Date.GetDateOnly(B),(D*-1));
return C;};CClientLib.Type.Date.GetDateOnly=function(A){A=CClientLib.Type.Date.parse(A);
return(new Date(A.getFullYear(),A.getMonth(),A.getDate()));};CClientLib.Type.Date.DateRangesOverLap=function(A,E,C,D){A=CClientLib.Type.Date.parse(A);
E=CClientLib.Type.Date.parse(E);C=CClientLib.Type.Date.parse(C);D=CClientLib.Type.Date.parse(D);
var B=(A<=D&&C<=E);return B;};CClientLib.Type.Date.GetDayIndex=function(A){var B=CClientLib.Type.Date.GetDayNumber(A);
if(B==0){return 7;}else{return B;}};function fn_WebServices_AlertFailed(B){var A=String.format("statusCode={0}\n\nexceptionType={1}\n\ntimedOut={2}\n\nmessage={3}\n\nstackTrace={4}",B.get_statusCode(),B.get_exceptionType(),B.get_timedOut(),B.get_message(),B.get_stackTrace());
alert(A);}Type.registerNamespace("CClientLib");CClientLib.WSWebServiceResponseClientWrapper=function(){};
CClientLib.WSWebServiceResponseClientWrapper.prototype.bTerminated=true;CClientLib.WSWebServiceResponseClientWrapper.prototype.nTerminationCode=0;
CClientLib.WSWebServiceResponseClientWrapper.prototype.strTerminationMessage="";CClientLib.WSWebServiceResponseClientWrapper.prototype.strSuccessMessage="";
CClientLib.WSWebServiceResponseClientWrapper.prototype.objResponse="";CClientLib.WSWebServiceResponseClientWrapper.registerClass("CClientLib.WSWebServiceResponseClientWrapper");
CClientLib.WSWebServiceResponseClientWrapper.parse=function(A){return A;};CClientLib.WSWebserviceDetails=function(A,B){this._dtInitialized=new Date();
this._dtDisposed=null;this._strWebServiceStatus="Pending";this._strWebserviveTitle="";
this._strLoadingText=A;this._strLoadedText=B;this._secondsProcessingTime=-1;this._arrayOnSuccessHandler=new Array();
this._divWebServicesDisplayContainer=$get("divWebServicesDisplayContainer");this._divWebServicesDisplayContainer.style.display="block";
this._divWebserviceDisplayData=$createLoading(this._divWebServicesDisplayContainer,{"value":A,"style":"margin:5px; z-index:1000000;"},{});
this._strErrorTimeoutMesssage="The website failed to make a connection with Training-Track.com.\n";
this._strErrorTimeoutMesssage+="Any recent changes that you made may have been lost.";
this._strErrorTimeoutMesssage+="\n\n";this._strErrorTimeoutMesssage+="There are two possible causes for this:\n";
this._strErrorTimeoutMesssage+="1) You have lost connection to the internet or it is running slowly.\n";
this._strErrorTimeoutMesssage+="\t or\n";this._strErrorTimeoutMesssage+="2) The Training-Track servers are experiencing some technical difficulties.\n";
this._strErrorTimeoutMesssage+="\n\n";this._strErrorTimeoutMesssage+="Press 'Ok' and the website will try to reestablish a connection with Training-Track.com";
this._strUnrecoverableErrorMessage="Oops! An unknown error has occurred...\n";this._strUnrecoverableErrorMessage+="Any recent changes that you made may have been lost.\n\n";
this._strUnrecoverableErrorMessage+="We are sorry for the inconvenience. Please contact us if the problem persists.\n\n";
this._strUnrecoverableErrorMessage+="Press 'Ok' and the website will reload in an attempt to recover from the error";
};CClientLib.WSWebserviceDetails.prototype={buildOnFailureFunction:function(B){var A=Function.createDelegate(this,function(C,D){C=Sys.Net.WebServiceError.parse(C);
var E=false;if(Type.isFunction(B)){E=B(C,D);this._failed("Unable to complete your retuest :S");
}if(!E){if(C.get_timedOut()){alert(this._strErrorTimeoutMesssage);CClientLib.Parent.GetParentComponent().reloadParentPage();
}else{alert(this._strUnrecoverableErrorMessage);if(CClientLib.Parent.IsDebugMode()){fn_WebServices_AlertFailed(C);
}CClientLib.Parent.GetParentComponent().reloadParentPage();this._failed("I don't know why i failed :S");
}}});return A;},add_onSuccessHandler:function(A){Array.add(this._arrayOnSuccessHandler,A);
},buildOnSuccessFunction:function(C,D,B){this.add_onSuccessHandler(D);var A=Function.createDelegate(this,function(F,G){var J=CClientLib.WSWebServiceResponseClientWrapper.parse(F);
if(J.bTerminated){this._terminated(J.strTerminationMessage);var I=false;if(Type.isFunction(B)){I=B(F,G);
}if(!I){if(J.nTerminationCode==1){window.setTimeout(function(){alert("You are currently not logged in.  Please log back in and try again.");
},10);CClientLib.Parent.GetParentComponent().reloadParentPage();return;}else{if(J.nTerminationCode==2){window.setTimeout(function(){alert(this._strUnrecoverableErrorMessage);
},10);CClientLib.Parent.GetParentComponent().reloadParentPage();return;}else{window.setTimeout(function(){alert(this._strUnrecoverableErrorMessage);
},10);CClientLib.Parent.GetParentComponent().reloadParentPage();return;}}}}else{this._succeeded();
var H=F.objResponse;if(Type.isFunction(C)){H=C(H);}for(var E=0;E<this._arrayOnSuccessHandler.length;
E++){if(Type.isFunction(this._arrayOnSuccessHandler[E])){this._arrayOnSuccessHandler[E](H,G);
}}}});return A;},_failed:function(A){this._processWebserviceDisposed("Failed",A,"red");
},_succeeded:function(){this._processWebserviceDisposed("Successful",this._strLoadedText,"green");
},_terminated:function(A){this._processWebserviceDisposed("Terminated",A,"red");},_processWebserviceDisposed:function(B,D,C){this._dtDisposed=new Date();
this._secondsProcessingTime=CClientLib.Type.Date.SecondsBetweenDates(this._dtDisposed,this._dtInitialized);
this._strWebServiceStatus=B;this._divWebservice=CClientLib.UI.Element.parse(this._divWebserviceDisplayData);
this._divWebservice.set_style("margin: 5px; color: "+C);this._divWebservice.set_value(D+" [Processing time: "+this._secondsProcessingTime.toFixed(2)+"seconds]");
var A=Function.createDelegate(this,function(){this._divWebserviceDisplayData.removeFromDOM();
if(!this._divWebServicesDisplayContainer.hasChildNodes()){this._divWebServicesDisplayContainer.style.display="none";
}});window.setTimeout(A,5000);}};CClientLib.WSWebserviceDetails.registerClass("CClientLib.WSWebserviceDetails");
CClientLib.WSWebserviceDetails.parse=function(A){return CClientLib.WSWebserviceDetails._parse(A);
};CClientLib.WSWebServices=function(){this._timeoutLimit=15000;WSExercise.set_timeout(this._timeoutLimit);
WSMaps.set_timeout(this._timeoutLimit);WSScheduleCalendar.set_timeout(this._timeoutLimit);
WSUser.set_timeout(this._timeoutLimit);WSProgram.set_timeout(this._timeoutLimit);
};CClientLib.WSWebServices.prototype={WSUser_InsertOrEditUser:function(user,bEditSecurityData,strPreviousPassword,strNewPassword,strSecurityAnswer,fn_AdditionalHandlerOnSuccess,fn_AdditionalHandlerOnTerminated,fn_AdditionalHandlerOnFailure){user=CClientLib.ServerClasses.User.parse(user);
var webServiceDetails=new CClientLib.WSWebserviceDetails("Updating Personal Settings...","Personal Settings Updated");
var fn_ResponseConverter=function(response){return CClientLib.ServerClasses.User.parse(eval(response));
};webServiceDetails.add_onSuccessHandler(function(updatedUser){Sys.Services.AuthenticationService._setAuthenticated(true);
CClientLib.Parent.GetClientData().load_user(updatedUser);});var fn_OnSucceess=webServiceDetails.buildOnSuccessFunction(fn_ResponseConverter,fn_AdditionalHandlerOnSuccess,fn_AdditionalHandlerOnTerminated);
var fn_OnFailure=webServiceDetails.buildOnFailureFunction(fn_AdditionalHandlerOnFailure);
var userConext=null;var strClientDateTime=this._getClientDateTimeAsString();WSUser.WSUser_InsertOrEditUser(CClientLib.ServerClasses.User.GetSafeWSObject(user),bEditSecurityData,strPreviousPassword,strNewPassword,strSecurityAnswer,strClientDateTime,fn_OnSucceess,fn_OnFailure,userConext);
return webServiceDetails;},WSUser_Login:function(C,E,K,F,A,G){var L=new CClientLib.WSWebserviceDetails("Logging In User...","User Logged In");
var I=function(M){return String.isPopulatedString(M)?M:"";};L.add_onSuccessHandler(function(M){Sys.Services.AuthenticationService._setAuthenticated(true);
});var J=L.buildOnSuccessFunction(I,F,A);var B=L.buildOnFailureFunction(G);var H=null;
var D=this._getClientDateTimeAsString();WSUser.WSUser_Login(C,E,fn_Global_SafeBool_Bool(K),D,J,B,H);
return L;},_getClientDateTimeAsString:function(){return CClientLib.Type.Date.dateToServerDTString(new Date());
},WSScheduleCalendar_WSUnscheduleProgram:function(strUserID,nScheduleProgramID,dStartDate,dEndDate,fn_AdditionalHandlerOnSuccess,fn_AdditionalHandlerOnTerminated,fn_AdditionalHandlerOnFailure){var webServiceDetails=new CClientLib.WSWebserviceDetails("Unscheduling Program...","Program Unscheduled");
var fn_ResponseConverter=function(response){CClientLib.Parent.GetClientData().load_schedulePrograms(eval(response.strObjScheduleProgram));
return fn_Global_XMLParseFromString_XMLObject(response.strXmlDocScheduleData);};webServiceDetails.add_onSuccessHandler(function(responseXmlDoc){});
var fn_OnSucceess=webServiceDetails.buildOnSuccessFunction(fn_ResponseConverter,fn_AdditionalHandlerOnSuccess,fn_AdditionalHandlerOnTerminated);
var fn_OnFailure=webServiceDetails.buildOnFailureFunction(fn_AdditionalHandlerOnFailure);
var strStartDate="";var strEndDate="";if(CClientLib.Type.Date.isDate(dStartDate)&&CClientLib.Type.Date.isDate(dEndDate)){strStartDate=CClientLib.Type.Date.format(dStartDate,"dd/MMM/yyyy");
strEndDate=CClientLib.Type.Date.format(dEndDate,"dd/MMM/yyyy");}var userContext="";
WSScheduleCalendar.WSUnscheduleProgram(strUserID,nScheduleProgramID,strStartDate,strEndDate,fn_OnSucceess,fn_OnFailure,userContext);
return webServiceDetails;},WSScheduleCalendar_WSScheduleProgram:function(strUserID,nProgramID,dtProgramStartDate,nCycles,dtResponseStartDate,dtResponseEndDate,fn_AdditionalHandlerOnSuccess,fn_AdditionalHandlerOnTerminated,fn_AdditionalHandlerOnFailure){var webServiceDetails=new CClientLib.WSWebserviceDetails("Scheduling Program...","Program Scheduled");
var fn_ResponseConverter=function(response){CClientLib.Parent.GetClientData().load_schedulePrograms(eval(response.strObjScheduleProgram));
return fn_Global_XMLParseFromString_XMLObject(response.strXmlDocScheduleData);};webServiceDetails.add_onSuccessHandler(function(responseXmlDoc){});
var fn_OnSucceess=webServiceDetails.buildOnSuccessFunction(fn_ResponseConverter,fn_AdditionalHandlerOnSuccess,fn_AdditionalHandlerOnTerminated);
var fn_OnFailure=webServiceDetails.buildOnFailureFunction(fn_AdditionalHandlerOnFailure);
var strResponseStartDate="";var strResponseEndDate="";if(CClientLib.Type.Date.isDate(dtResponseStartDate)&&CClientLib.Type.Date.isDate(dtResponseEndDate)){strResponseStartDate=CClientLib.Type.Date.format(dtResponseStartDate,"dd/MMM/yyyy");
strResponseEndDate=CClientLib.Type.Date.format(dtResponseEndDate,"dd/MMM/yyyy");}var strProgramStartDate=CClientLib.Type.Date.format(dtProgramStartDate,"dd/MMM/yyyy");
var userContext="";WSScheduleCalendar.WSScheduleProgram(strUserID,nProgramID,strProgramStartDate,nCycles,strResponseStartDate,strResponseEndDate,fn_OnSucceess,fn_OnFailure,userContext);
return webServiceDetails;},WSScheduleCalendar_WSGetScheduledData:function(L,A,C,F,B,G){var M=new CClientLib.WSWebserviceDetails("Loading Calendar...","Calendar Loaded");
var J=function(N){return fn_Global_XMLParseFromString_XMLObject(N);};var K=M.buildOnSuccessFunction(J,F,B);
var I=M.buildOnFailureFunction(G);var E=CClientLib.Type.Date.format(A,"dd/MMM/yyyy");
var H=CClientLib.Type.Date.format(C,"dd/MMM/yyyy");var D="";WSScheduleCalendar.WSGetScheduleData(L,E,H,K,I,D);
return M;},WSScheduleCalendar_WSUnscheduleWorkoutSession:function(E,P,D,O,N,L,F,G,A,H){var K=new CClientLib.WSWebserviceDetails("Uncheduling Workout...","Workout Unscheduled");
var J=function(Q){return fn_Global_XMLParseFromString_XMLObject(Q);};var M=K.buildOnSuccessFunction(J,G,A);
var B=K.buildOnFailureFunction(H);var I=CClientLib.Type.Date.format(L,"dd/MMM/yyyy");
var C=CClientLib.Type.Date.format(F,"dd/MMM/yyyy");WSScheduleCalendar.WSUnscheduleWorkoutSession(E,P,D,O,N,I,C,M,B,"");
return K;},WSScheduleCalendar_WSPerformWorkoutSession:function(O,U,L,S,J,M,G,F,I,P,T,D,R,B){G=CClientLib.Type.Date.parse(G);
P=CClientLib.Type.Date.parse(P);T=CClientLib.Type.Date.parse(T);L=fn_Global_SafeInt_Int(L);
S=fn_Global_SafeInt_Int(S);J=fn_Global_SafeInt_Int(J);M=fn_Global_SafeInt_Int(M);
var C=new CClientLib.WSWebserviceDetails("Saving Workout Session...","Workout Session Saved");
var A=function(W){return fn_Global_XMLParseFromString_XMLObject(W);};var N=C.buildOnSuccessFunction(A,D,R);
var E=C.buildOnFailureFunction(B);var Q=CClientLib.Type.Date.format(G,"dd/MMM/yyyy");
var K=CClientLib.Type.Date.format(P,"dd/MMM/yyyy");var H=CClientLib.Type.Date.format(T,"dd/MMM/yyyy");
var V=fn_Global_XMLObjectToString_Str(U);WSScheduleCalendar.WSPerformWorkoutSession(O,V,L,S,J,M,Q,F,I,K,H,N,E,"");
return C;},WSScheduleCalendar_WSGetWorkoutSessionDetails:function(J,D,L,C,K,E,A,F){var H=new CClientLib.WSWebserviceDetails("Loading Workout Session...","Workout Session Loaded");
var G=function(M){return fn_Global_XMLParseFromString_XMLObject(M);};var I=H.buildOnSuccessFunction(G,E,A);
var B=H.buildOnFailureFunction(F);WSScheduleCalendar.WSGetWorkoutSessionDetails(J,fn_Global_SafeInt_Int(D),fn_Global_SafeInt_Int(L),fn_Global_SafeInt_Int(C),fn_Global_SafeInt_Int(K),I,B,"");
return H;},WSProgram_WSGetProgramList:function(fn_AdditionalHandlerOnSuccess,fn_AdditionalHandlerOnTerminated,fn_AdditionalHandlerOnFailure){var webServiceDetails=new CClientLib.WSWebserviceDetails("Loading Program Data...","Programs Loaded");
var fn_ResponseConverter=function(response){return CClientLib.ServerClasses.ProgramCollection.parse(eval(response));
};webServiceDetails.add_onSuccessHandler(function(responseProgramCollection){CClientLib.Parent.GetClientData().load_programs(responseProgramCollection);
});var fn_OnSucceess=webServiceDetails.buildOnSuccessFunction(fn_ResponseConverter,fn_AdditionalHandlerOnSuccess,fn_AdditionalHandlerOnTerminated);
var fn_OnFailure=webServiceDetails.buildOnFailureFunction(fn_AdditionalHandlerOnFailure);
WSProgram.WSGetProgramList(fn_OnSucceess,fn_OnFailure,"");return webServiceDetails;
},WSProgram_WSSaveProgram:function(nProgramID,strProgramTitle,nDays,strProgramNotes,fn_AdditionalHandlerOnSuccess,fn_AdditionalHandlerOnTerminated,fn_AdditionalHandlerOnFailure){var webServiceDetails=new CClientLib.WSWebserviceDetails("Saving Program...","Program Saved");
var fn_ResponseConverter=function(response){return CClientLib.ServerClasses.ProgramCollection.parse(eval(response));
};webServiceDetails.add_onSuccessHandler(function(programCollection){CClientLib.Parent.GetClientData().load_programs(programCollection);
});var fn_OnSucceess=webServiceDetails.buildOnSuccessFunction(fn_ResponseConverter,fn_AdditionalHandlerOnSuccess,fn_AdditionalHandlerOnTerminated);
var fn_OnFailure=webServiceDetails.buildOnFailureFunction(fn_AdditionalHandlerOnFailure);
WSProgram.WSSaveProgram(nProgramID,strProgramTitle,nDays,strProgramNotes,fn_OnSucceess,fn_OnFailure,"");
return webServiceDetails;},WSProgram_WSGetProgramDetails:function(E,C,A,D){var H=new CClientLib.WSWebserviceDetails("Loading Program Data...","Program Loaded");
var F=function(I){return fn_Global_XMLParseFromString_XMLObject(I);};var G=H.buildOnSuccessFunction(F,C,A);
var B=H.buildOnFailureFunction(D);WSProgram.WSGetProgramDetails(E,G,B,"");return H;
},WSProgram_WSAddWorkoutToProgram:function(I,B,J,E,K,A,F){var L=new CClientLib.WSWebserviceDetails("Loading Program Data...","Program Loaded");
var H=function(M){return fn_Global_XMLParseFromString_XMLObject(M);};var D=L.buildOnSuccessFunction(H,K,A);
var G=L.buildOnFailureFunction(F);var C=fn_Global_XMLObjectToString_Str(E);WSProgram.WSAddWorkoutToProgram(I,B,J,C,D,G,"");
return L;},WSProgram_WSEditProgramWorkout:function(J,B,K,E,F,L,A,G){var M=new CClientLib.WSWebserviceDetails("Loading Program Data...","Program Loaded");
var I=function(N){return fn_Global_XMLParseFromString_XMLObject(N);};var D=M.buildOnSuccessFunction(I,L,A);
var H=M.buildOnFailureFunction(G);var C=fn_Global_XMLObjectToString_Str(F);WSProgram.WSEditProgramWorkout(J,B,K,E,C,D,H,"");
return M;},WSProgram_WSRemoveWorkoutFromProgram:function(H,C,E,A,F){var I=new CClientLib.WSWebserviceDetails("Removing Workout...","Workout Removed");
var G=function(J){return fn_Global_XMLParseFromString_XMLObject(J);};var D=I.buildOnSuccessFunction(G,E,A);
var B=I.buildOnFailureFunction(F);WSProgram.WSRemoveWorkoutFromProgram(H,C,D,B,"");
return I;},WSProgram_WSGetProgramWorkout:function(C,D,A,E){var H=new CClientLib.WSWebserviceDetails("Loading Workout...","Workout Loaded");
var F=function(I){return fn_Global_XMLParseFromString_XMLObject(I);};var G=H.buildOnSuccessFunction(F,D,A);
var B=H.buildOnFailureFunction(E);C=fn_Global_SafeInt_Int(C);if(!(C>0)){alert("ERROR: Workout is invalid...");
}WSProgram.WSGetProgramWorkout(C,G,B,"");return H;},WSProgram_WSProgramArchive:function(nProgramID,fn_AdditionalHandlerOnSuccess,fn_AdditionalHandlerOnTerminated,fn_AdditionalHandlerOnFailure){var webServiceDetails=new CClientLib.WSWebserviceDetails("Archiving Program...","Program Archived");
var fn_ResponseConverter=function(response){return CClientLib.ServerClasses.ProgramCollection.parse(eval(response));
};webServiceDetails.add_onSuccessHandler(function(responseProgramCollection){CClientLib.Parent.GetClientData().load_programs(responseProgramCollection);
});var fn_OnSucceess=webServiceDetails.buildOnSuccessFunction(fn_ResponseConverter,fn_AdditionalHandlerOnSuccess,fn_AdditionalHandlerOnTerminated);
var fn_OnFailure=webServiceDetails.buildOnFailureFunction(fn_AdditionalHandlerOnFailure);
WSProgram.WSProgramArchive(nProgramID,fn_OnSucceess,fn_OnFailure,"");return webServiceDetails;
},WSProgram_WSProgramActivate:function(nProgramID,fn_AdditionalHandlerOnSuccess,fn_AdditionalHandlerOnTerminated,fn_AdditionalHandlerOnFailure){var webServiceDetails=new CClientLib.WSWebserviceDetails("Activating Program...","Program Actiavted");
var fn_ResponseConverter=function(response){return CClientLib.ServerClasses.ProgramCollection.parse(eval(response));
};webServiceDetails.add_onSuccessHandler(function(responseProgramCollection){CClientLib.Parent.GetClientData().load_programs(responseProgramCollection);
});var fn_OnSucceess=webServiceDetails.buildOnSuccessFunction(fn_ResponseConverter,fn_AdditionalHandlerOnSuccess,fn_AdditionalHandlerOnTerminated);
var fn_OnFailure=webServiceDetails.buildOnFailureFunction(fn_AdditionalHandlerOnFailure);
WSProgram.WSProgramActivate(nProgramID,fn_OnSucceess,fn_OnFailure,"");return webServiceDetails;
},WSExercise_WSCreateOrUpdateExercise:function(exerciseObj,collectionAssociatedMaps,fn_AdditionalHandlerOnSuccess,fn_AdditionalHandlerOnTerminated,fn_AdditionalHandlerOnFailure){var webServiceDetails=new CClientLib.WSWebserviceDetails("Updating Exercise...","Exercise Updated");
var fn_ResponseConverter=function(response){CClientLib.Parent.GetClientData().load_exercises(CClientLib.ServerClasses.ExerciseCollection.parse(eval(response.strExerciseCollection)));
CClientLib.Parent.GetClientData().load_exerciseAndMapAssociations(response.strsExerciseAndMapAssociations);
return CClientLib.ServerClasses.Exercise.parse(eval(response.strUpdatedExercise));
};webServiceDetails.add_onSuccessHandler(function(objExercise){});var fn_OnSucceess=webServiceDetails.buildOnSuccessFunction(fn_ResponseConverter,fn_AdditionalHandlerOnSuccess,fn_AdditionalHandlerOnTerminated);
var fn_OnFailure=webServiceDetails.buildOnFailureFunction(fn_AdditionalHandlerOnFailure);
collectionAssociatedMaps=CClientLib.ServerClasses.MapCollection.parse(collectionAssociatedMaps);
var aMapIDs=[];for(var i=0;i<collectionAssociatedMaps.item_count();i++){Array.add(aMapIDs,CClientLib.ServerClasses.Map.parse(collectionAssociatedMaps.get_map(i)).get_mapID());
}WSExercise.WSCreateOrUpdateExercise(exerciseObj,aMapIDs,fn_OnSucceess,fn_OnFailure,"");
return webServiceDetails;},WSMaps_WSCreateOrUpdateMap:function(objMap,bAddMapToMapList,bOverwriteExistingMap,fn_AdditionalHandlerOnSuccess,fn_AdditionalHandlerOnTerminated,fn_AdditionalHandlerOnFailure){var webServiceDetails=new CClientLib.WSWebserviceDetails("Saving Map...","Map Saved");
var fn_ResponseConverter=function(response){CClientLib.Parent.GetClientData().load_maps(CClientLib.ServerClasses.MapCollection.parse(eval(response.strMapCollection)));
CClientLib.Parent.GetClientData().load_exerciseAndMapAssociations(response.strsExerciseAndMapAssociations);
return CClientLib.ServerClasses.Map.parse(eval(response.strUpdatedMap));};webServiceDetails.add_onSuccessHandler(function(map){});
var fn_OnSucceess=webServiceDetails.buildOnSuccessFunction(fn_ResponseConverter,fn_AdditionalHandlerOnSuccess,fn_AdditionalHandlerOnTerminated);
var fn_OnFailure=webServiceDetails.buildOnFailureFunction(fn_AdditionalHandlerOnFailure);
WSMaps.WSCreateOrUpdateMap(objMap,bAddMapToMapList,bOverwriteExistingMap,fn_OnSucceess,fn_OnFailure,"");
return webServiceDetails;},WSMaps_WSGetMap:function(strMapID,fn_AdditionalHandlerOnSuccess,fn_AdditionalHandlerOnTerminated,fn_AdditionalHandlerOnFailure){var webServiceDetails=new CClientLib.WSWebserviceDetails("Loading Map...","Map Loaded");
var fn_ResponseConverter=function(strEvalMapObject){return CClientLib.ServerClasses.Map.parse(eval(strEvalMapObject));
};var fn_OnSucceess=webServiceDetails.buildOnSuccessFunction(fn_ResponseConverter,fn_AdditionalHandlerOnSuccess,fn_AdditionalHandlerOnTerminated);
var fn_OnFailure=webServiceDetails.buildOnFailureFunction(fn_AdditionalHandlerOnFailure);
WSMaps.WSGetMap(strMapID,fn_OnSucceess,fn_OnFailure,"");return webServiceDetails;
},WSProfiles_WSGetProfileList:function(fn_AdditionalHandlerOnSuccess,fn_AdditionalHandlerOnTerminated,fn_AdditionalHandlerOnFailure){var webServiceDetails=new CClientLib.WSWebserviceDetails("Loading Profiles...","Profiles Loaded");
var fn_ResponseConverter=function(strEvalProfilesCollection){return CClientLib.ServerClasses.ProfileCollection.parse(eval(strEvalProfilesCollection));
};var fn_OnSucceess=webServiceDetails.buildOnSuccessFunction(fn_ResponseConverter,fn_AdditionalHandlerOnSuccess,fn_AdditionalHandlerOnTerminated);
var fn_OnFailure=webServiceDetails.buildOnFailureFunction(fn_AdditionalHandlerOnFailure);
WSProfile.WSGetProfileList(fn_OnSucceess,fn_OnFailure,"");return webServiceDetails;
},WSProfiles_WSInsertOrEdit:function(objProfile,fn_AdditionalHandlerOnSuccess,fn_AdditionalHandlerOnTerminated,fn_AdditionalHandlerOnFailure){var webServiceDetails=new CClientLib.WSWebserviceDetails("Saving Profile...","Profile Saved");
var fn_ResponseConverter=function(strEvalProfilesCollection){return CClientLib.ServerClasses.ProfileCollection.parse(eval(strEvalProfilesCollection));
};var fn_OnSucceess=webServiceDetails.buildOnSuccessFunction(fn_ResponseConverter,fn_AdditionalHandlerOnSuccess,fn_AdditionalHandlerOnTerminated);
var fn_OnFailure=webServiceDetails.buildOnFailureFunction(fn_AdditionalHandlerOnFailure);
WSProfile.WSInsertOrEdit(CClientLib.ServerClasses.Profile.GetSafeWSObject(objProfile),fn_OnSucceess,fn_OnFailure,"");
return webServiceDetails;},WSStats_WSGetStats:function(K,B,C,G,D,A,E){var J=new CClientLib.WSWebserviceDetails("Loading Your Stats...","Stats Loaded");
var H=function(L){return(String.isPopulatedString(L)?L:"Stats have not been found...");
};var I=J.buildOnSuccessFunction(H,D,A);var F=J.buildOnFailureFunction(E);G=CClientLib.Dictionary.parse(G);
G=CClientLib.WSWebServices.SafeWSObject(G);WSStats.WSGetStats(K,CClientLib.Type.Date.dateToServerDTString(B),CClientLib.Type.Date.dateToServerDTString(C),G,I,F,"");
return J;}};CClientLib.WSWebServices.registerClass("CClientLib.WSWebServices");CClientLib.WSWebServices.SafeWSObject=function(D){var A={};
for(var C in D){var B=D[C];if(!Type.isFunction(B)){A[C]=B;}}return A;};CClientLib.WSWebServices.parse=function(A){return A;
};Type.registerNamespace("CClientLib");CClientLib.Canvas=function(){CClientLib.Canvas.initializeBase(this);
this._strDivParentID={};this._divCanvas={};this._bCanvasLoaded=false;this._fnDelegateCanvasResized=Function.createDelegate(this,this.set_canvasSize);
};CClientLib.Canvas.prototype={initialize:function(){CClientLib.Canvas.callBaseMethod(this,"initialize");
this._divCanvas=$createDiv($get(this._strDivParentID));this.add_canvasInit(Function.createDelegate(this,this._canvasInit));
this.add_canvasLoad(Function.createDelegate(this,this._canvasLoad));this._raiseEvent(CClientLib.Canvas.strInitEventName,Sys.EventArgs.Empty);
this._raiseEvent(CClientLib.Canvas.strLoadEventName,Sys.EventArgs.Empty);this.set_canvasSize();
CClientLib.Parent.GetParentComponent().add_windowResized(this._fnDelegateCanvasResized);
this._bCanvasLoaded=true;},dispose:function(){CClientLib.Parent.GetParentComponent().remove_windowResized(this._fnDelegateCanvasResized);
this._divCanvas=CClientLib.UI.Element.parse(this._divCanvas);this._divCanvas.removeFromDOM();
CClientLib.Canvas.callBaseMethod(this,"dispose");},_canvasInit:function(){this.set_canvasSize();
CClientLib.Parent.GetNavigation().raiseEventCanvasInit(this);},_canvasLoad:function(){this.set_canvasSize();
},set_canvasSize:function(){var A=function(){var H=CClientLib.Parent.GetParentComponent().get_IframeElement();
var C=Sys.UI.DomElement.getBounds(H);var D=H.offsetWidth;var E=H.offsetHeight;var F=$get(this._strDivParentID);
var B=Sys.Browser.agent;var G=Sys.Browser.version;if(B==Sys.Browser.Firefox){D=D-15;
E=E-18;}else{if(B==Sys.Browser.InternetExplorer){if(G==6){D=D-15;E=E-16;F.style.paddingRight="5px";
}else{if(G==7){D=D-15;E=E-14;}}}else{if(B==Sys.Browser.Safari){D=D-15;E=E-23;}else{if(B==Sys.Browser.Opera){D=D-10;
E=E-18;}else{if(B==Sys.Browser.Chrome){D=D-10;E=E-18;}}}}}if(E>0&&D>0){F.style.overflowX="hidden";
F.style.overflowY="auto";F.style.height=E+"px";F.style.width=D+"px";}this._divCanvas.get_element().style.height="100%";
this._divCanvas.get_element().style.width="100%";};window.setTimeout(Function.createDelegate(this,A),1);
},get_divCanvas:function(){return CClientLib.UI.Element.parse(this._divCanvas);},load_scheduleCalendar:function(A){var B=CClientLib.ScheduleCalendar.CreateScheduleCalendar(A,this.get_divCanvas());
},load_scheduleProgramList:function(A){var B=CClientLib.ScheduleProgramList.CreateScheduleProgramList(A,this.get_divCanvas());
},load_personalSettings:function(A){var B=CClientLib.PersonalSettings.CreatePersonalSettings(A,this.get_divCanvas());
},load_personalProfiles:function(A){var B=CClientLib.PersonalProfiles.CreatePersonalProfiles(A,this.get_divCanvas());
},load_programCreate:function(A,B){var C=CClientLib.ProgramCreate.CreateProgramCreate(A,B,this.get_divCanvas());
},load_programListActive:function(A){var B=CClientLib.ProgramListActive.CreateProgramListActive(A,this.get_divCanvas());
},load_programListArchived:function(A){var B=CClientLib.ProgramListArchived.CreateProgramListArchived(A,this.get_divCanvas());
},load_exerciseList:function(A){var B=CClientLib.ExerciseList.CreateExerciseList(A,this.get_divCanvas());
},load_mapList:function(A){var B=CClientLib.MapList.CreateMapList(A,this.get_divCanvas());
},load_statsWorkout:function(A){var B=CClientLib.GenericStats.CreateWorkoutStats(A,this.get_divCanvas());
},load_statsExercise:function(A){var B=CClientLib.GenericStats.CreateExerciseStats(A,this.get_divCanvas(),true,"");
},load_statsMap:function(A){var B=CClientLib.GenericStats.CreateMapStats(A,this.get_divCanvas(),true,"");
},load_statsProfile:function(A){var B=CClientLib.GenericStats.CreateProfileStats(A,this.get_divCanvas());
}};CClientLib.Canvas.strCanvasID="canvas";CClientLib.Canvas.registerClass("CClientLib.Canvas",Sys.Component);
CClientLib.Canvas.strInitEventName="canvasInit";CClientLib.Canvas.strLoadEventName="canvasLoad";
CClientLib.Canvas.createEvent(CClientLib.Canvas.strInitEventName);CClientLib.Canvas.createEvent(CClientLib.Canvas.strLoadEventName);
CClientLib.Canvas.parse=function(A){return CClientLib.Canvas._parse(A);};CClientLib.Canvas.GetCanvas=function(){return $find(CClientLib.Canvas.strCanvasID);
};CClientLib.Canvas.GetCanvasWindowObject=function(){return CClientLib.Parent.GetIFrameWindowObject();
};CClientLib.Canvas.IsCanvasLoaded=function(){var A=false;var B=CClientLib.Canvas.GetCanvas();
if(B!=null&&Type.getTypeName(B)=="CClientLib.Canvas"){if(fn_Global_SafeBool_Bool(B._bCanvasLoaded)){return true;
}}return A;};CClientLib.Canvas.ReloadCanvas=function(){Sys.Application.disposeAllDisposableObjects();
return CClientLib.Canvas.CreateCanvas();};CClientLib.Canvas.CreateCanvas=function(){return $create(CClientLib.Canvas,{"id":CClientLib.Canvas.strCanvasID,"_strDivParentID":"divCanvasParent"},{},{});
};CClientLib.Canvas.CanvasSRC="Canvas/Canvas.aspx?v=090131_v1_33";Type.registerNamespace("CClientLib");
CClientLib.GoogleMaps=function(){CClientLib.GoogleMaps.initializeBase(this);this._state="void";
};CClientLib.GoogleMaps.prototype={initialize:function(){CClientLib.GoogleMaps.callBaseMethod(this,"initialize");
},dispose:function(){CClientLib.GoogleMaps.callBaseMethod(this,"dispose");},_raiseLoading:function(A){this._state="loading";
this._raiseEvent(CClientLib.GoogleMaps.strEventGoogleMapsLoading);},_raiseLoaded:function(){this._state="loaded";
this._raiseEvent(CClientLib.GoogleMaps.strEventGoogleMapsLoaded);},HasAPILoaded:function(){return(this._state.toLocaleLowerCase()=="loaded");
},SafeAddGoogleMapFunctionality:function(A){if(!Type.isFunction(A)){alert("ERROR: Only functions can be added to SafeAddGoogleMapFunctionality()");
}if(this.HasAPILoaded()){A();}else{this.add_googleMapsLoaded(A);}},check_mapSize:function(A){if(this.HasAPILoaded&&A&&Type.isFunction(A.checkResize)){A.checkResize();
}},set_mapPopsition:function(A,C,D,E){var B=function(){var F=new GLatLng(fn_Global_SafeDecimal_Decimal(C),fn_Global_SafeDecimal_Decimal(D));
A.setCenter(F,E);};this.SafeAddGoogleMapFunctionality(B);},get_mapCenterPoint:function(A){return A.getCenter();
},get_mapCenterLat:function(A){return this.get_mapCenterPoint(A).lat();},get_mapCenterLng:function(A){return this.get_mapCenterPoint(A).lng();
},get_mapZoom:function(A){return A.getZoom();}};CClientLib.GoogleMaps.registerClass("CClientLib.GoogleMaps",Sys.Component);
CClientLib.GoogleMaps.strEventGoogleMapsLoading="googleMapsLoading";CClientLib.GoogleMaps.strEventGoogleMapsLoaded="googleMapsLoaded";
CClientLib.GoogleMaps.createEvent(CClientLib.GoogleMaps.strEventGoogleMapsLoading);
CClientLib.GoogleMaps.createEvent(CClientLib.GoogleMaps.strEventGoogleMapsLoaded);
CClientLib.GoogleMaps.parse=function(A){return CClientLib.GoogleMaps._parse(A);};
CClientLib.GoogleMaps._object=null;Sys.Application.add_init(function(){CClientLib.GoogleMaps._object=$create(CClientLib.GoogleMaps,{},{},{});
});CClientLib.GoogleMaps.GetGoogleMaps=function(){return CClientLib.GoogleMaps.parse(CClientLib.GoogleMaps._object);
};function bdccGeo(D,A){var E=(A*Math.PI/180);var B=bdccGeoGeocentricLatitude(D*Math.PI/180);
var C=Math.cos(B);this.x=C*Math.cos(E);this.y=C*Math.sin(E);this.z=Math.sin(B);}bdccGeo.prototype={getLatitudeRadians:function(){return(bdccGeoGeographicLatitude(Math.atan2(this.z,Math.sqrt((this.x*this.x)+(this.y*this.y)))));
},getLongitudeRadians:function(){return(Math.atan2(this.y,this.x));},getLatitude:function(){return this.getLatitudeRadians()*180/Math.PI;
},getLongitude:function(){return this.getLongitudeRadians()*180/Math.PI;},dot:function(A){return((this.x*A.x)+(this.y*A.y)+(this.z*A.z));
},crossLength:function(D){var A=(this.y*D.z)-(this.z*D.y);var B=(this.z*D.x)-(this.x*D.z);
var C=(this.x*D.y)-(this.y*D.x);return Math.sqrt((A*A)+(B*B)+(C*C));},scale:function(B){var A=new bdccGeo(0,0);
A.x=this.x*B;A.y=this.y*B;A.z=this.z*B;return A;},crossNormalize:function(E){var B=(this.y*E.z)-(this.z*E.y);
var C=(this.z*E.x)-(this.x*E.z);var D=(this.x*E.y)-(this.y*E.x);var A=Math.sqrt((B*B)+(C*C)+(D*D));
var F=new bdccGeo(0,0);F.x=B/A;F.y=C/A;F.z=D/A;return F;},antipode:function(){return this.scale(-1);
},distance:function(A){return Math.atan2(A.crossLength(this),A.dot(this));},distanceToLineSegMtrs:function(G,D){var E=G.crossNormalize(D);
var C=bdccGeoGetIntersection(G,D,this,E);var F=G.distance(D);var B=G.distance(C);
var A=D.distance(C);if((F>=B)&&(F>=A)){return bdccGeoRadiansToMeters(this.distance(C));
}else{C=C.antipode();B=G.distance(C);A=D.distance(C);}if((F>=B)&&(F>=A)){return bdccGeoRadiansToMeters(this.distance(C));
}else{return bdccGeoRadiansToMeters(Math.min(G.distance(this),D.distance(this)));
}}};function bdccGeoGeocentricLatitude(B){var A=1/298.257223563;var C=(1-A)*(1-A);
return Math.atan((Math.tan(B)*C));}function bdccGeoGeographicLatitude(B){var A=1/298.257223563;
var C=(1-A)*(1-A);return Math.atan(Math.tan(B)/C);}function bdccGeoGetIntersection(F,C,A,E){var D=F.crossNormalize(C);
var B=A.crossNormalize(E);return D.crossNormalize(B);}function bdccGeoRadiansToMeters(A){return A*6378137;
}function bdccGeoMetersToRadians(A){return A/6378137;}function fnJHJHTESTY(F,E,A){var C=new bdccGeo(F.lat(),F.lng());
var B=new bdccGeo(E.lat(),E.lng());var D=new bdccGeo(A.lat(),A.lng());return C.distanceToLineSegMtrs(B,D);
}GetPointAtDistance=function(H,G){if(G==0){return H.getVertex(0);}if(G<0){return null;
}var E=0;var C=0;for(var A=1;(A<H.getVertexCount()&&E<G);A++){C=E;E+=H.getVertex(A).distanceFrom(H.getVertex(A-1));
}if(E<G){return null;}var D=H.getVertex(A-2);var F=H.getVertex(A-1);var B=(G-C)/(E-C);
return new GLatLng(D.lat()+(F.lat()-D.lat())*B,D.lng()+(F.lng()-D.lng())*B);};Type.registerNamespace("CClientLib");
CClientLib.GoogleVisualization=function(){CClientLib.GoogleVisualization.initializeBase(this);
this._state="void";this._nProtocolVersion=0.5;};CClientLib.GoogleVisualization.prototype={initialize:function(){CClientLib.GoogleVisualization.callBaseMethod(this,"initialize");
},dispose:function(){CClientLib.GoogleVisualization.callBaseMethod(this,"dispose");
},_raiseLoading:function(A){this._state="loading";this._raiseEvent(CClientLib.GoogleVisualization.strEventGoogleVisualizationLoading);
},_raiseLoaded:function(){this._state="loaded";this._raiseEvent(CClientLib.GoogleVisualization.strEventGoogleVisualizationLoaded);
},create_pieChart:function(D,F,E,C){var A=new google.visualization.DataTable(D,this._nProtocolVersion);
F=fn_Global_ObjectAddDefultProperties(F,{is3D:true,borderColor:"#ccc",backgroundColor:{stroke:"#ccc",strokeSize:1}});
var B=new google.visualization.PieChart(E.get_element());B.draw(A,F);},create_lineChart:function(D,F,E,C){var A=new google.visualization.DataTable(D,this._nProtocolVersion);
http:F=fn_Global_ObjectAddDefultProperties(F,{lineSize:3,smoothLine:true,borderColor:"#ccc",backgroundColor:{stroke:"#ccc",strokeSize:1}});
var B=new google.visualization.LineChart(E.get_element());B.draw(A,F);},HasAPILoaded:function(){return(this._state.toLocaleLowerCase()=="loaded");
},SafeAddGoogleVisualizationFunctionality:function(A){if(!Type.isFunction(A)){alert("ERROR: Only functions can be added to SafeAddGoogleMapFunctionality()");
}if(this.HasAPILoaded()){A();}else{this.add_googleVisualizationLoaded(A);}}};CClientLib.GoogleVisualization.registerClass("CClientLib.GoogleVisualization",Sys.Component);
CClientLib.GoogleVisualization.strEventGoogleVisualizationLoading="googleVisualizationLoading";
CClientLib.GoogleVisualization.strEventGoogleVisualizationLoaded="googleVisualizationLoaded";
CClientLib.GoogleVisualization.createEvent(CClientLib.GoogleVisualization.strEventGoogleVisualizationLoading);
CClientLib.GoogleVisualization.createEvent(CClientLib.GoogleVisualization.strEventGoogleVisualizationLoaded);
CClientLib.GoogleVisualization.parse=function(A){return CClientLib.GoogleVisualization._parse(A);
};CClientLib.GoogleVisualization._object=null;Sys.Application.add_init(function(){CClientLib.GoogleVisualization._object=$create(CClientLib.GoogleVisualization,{},{},{});
});CClientLib.GoogleVisualization.GetGoogleVisualization=function(){return CClientLib.GoogleVisualization.parse(CClientLib.GoogleVisualization._object);
};var nnBlaBlaBlaTest=0;Type.registerNamespace("CClientLib");CClientLib.Parent=function(){CClientLib.Parent.initializeBase(this);
this._bDebugMode=true;this._strURLLoggedInPage="";this._strURLLoggedOutPage="";this._tdRightContent={};
this._spanIFrameHeading={};this._divIFrameWrapper={};this._divGenericContent={};this._iframeContent=null;
this._clientDataCollection={};this._webservices={};this._objNavigation=null;this._modalPopupContainer={};
this._nModalPopupCounter=0;this._nCurrentWindowResizingTimeoutID=0;this._fnDelegateOnReSizeHandler=null;
};CClientLib.Parent.prototype={initialize:function(){CClientLib.Parent.callBaseMethod(this,"initialize");
this._clientDataCollection=new CClientLib.ClientDataCollection();this._webservices=new CClientLib.WSWebServices();
$addHandler(window,"resize",Function.createDelegate(this,this._raiseEventWindowResized));
this._fnDelegateOnReSizeHandler=Function.createDelegate(this,this._onResizedHandler);
this.add_windowResized(this._fnDelegateOnReSizeHandler);this._objNavigation=new CClientLib.Navigation(this._strURLLoggedInPage,this._strURLLoggedOutPage);
this._modalPopupContainer=$create(CClientLib.UI.ModalPopupContainer,{},{});this._spanIFrameHeading=document.getElementById(this._spanIFrameHeading.id);
this._divIFrameWrapper=document.getElementById(this._divIFrameWrapper.id);this._divGenericContent=document.getElementById(this._divGenericContent.id);
var A=$createIFrame(this._divIFrameWrapper,{"style":"padding:0px; margin:0px; width:100%; overflow-x:hidden; overflow-y:hidden;","events":$createEvents({"load":this._iFrameOnLoad},this)});
var B=A.get_element();this._iframeContent=B;this._iframeContent.src=CClientLib.Canvas.CanvasSRC;
this._set_iframeSize();},dispose:function(){this.remove_windowResized(this._fnDelegateOnReSizeHandler);
CClientLib.Parent.callBaseMethod(this,"dispose");},get_clientData:function(){return this._clientDataCollection;
},get_webServices:function(){return this._webservices;},set_userLoggedIn:function(){this.performPartialPostback();
this._objNavigation.navigateTo_DefaultPage();},get_navigation:function(){return this._objNavigation;
},get_IframesWindowObject:function(){return this.get_IframeElement().contentWindow;
},get_IframeElement:function(){if(this._divGenericContent!=null&&this.get_navigation().get_navigaionBegun()){CClientLib.UI.Element.RemoveRawElementFromDOM(this._divGenericContent);
this._divGenericContent=null;this._divIFrameWrapper.style.display="block";}return this._iframeContent;
},_set_iframeSize:function(){if(this._iframeContent!=null){this._iframeContent.style.height=(this.get_parentWindowHeight()-68)+"px";
}},set_loading:function(A){A=fn_Global_SafeBool_Bool(A);if(this._divLoading==null||this._divLoading==undefined){this._divLoading=$createLoading(document.body,{"value":"Loading...","style":"background:white; position:absolute; top:45px; left:220px; font-size:12px; margin:7px;","display":"none"},true);
}this.get_IframeElement().style.visibility=(A?"hidden":"visible");if(this.get_navigation().get_navigaionBegun()){this._divLoading.set_display(A?"block":"none");
}},_setIFrameHeading:function(A){this._spanIFrameHeading.innerHTML=A;},_iFrameOnLoad:function(){this.set_loading(false);
var B=Function.createDelegate(this,function(C,D){this.set_loading(true);});var A=this.get_IframesWindowObject();
if(A&&A.Sys){Type.addHandlerToEventHandlerList_SafeAccrossWindows(A.Sys.Application.get_events(),"unload",B);
}},get_isDebugMode:function(){return fn_Global_SafeBool_Bool(this._bDebugMode);},reloadParentPage:function(){var B=window.top;
var A=CClientLib.Parent.GetIFrameWindowObject();document.body.innerHTML="<br /><span style='margin:15px; font-size:12px;'>Reloading Page...</span>";
B.location.reload(true);},get_modalPopupContainer:function(){return this._modalPopupContainer;
},_raiseEventWindowResized:function(){if(this._nCurrentWindowResizingTimeoutID>0){window.clearTimeout(this._nCurrentWindowResizingTimeoutID);
}var A=Function.createDelegate(this,function(){if(this._events){var B=(this._events._getEvent(CClientLib.Parent.strEventWindowResize,true));
for(var C=0,E=B.length;C<E;C++){var D=B[C];window.setTimeout(D,C*10);}}this._nCurrentWindowResizingTimeoutID=0;
});this._nCurrentWindowResizingTimeoutID=window.setTimeout(A,150);},get_parentWindowHeight:function(){return document.documentElement.clientHeight;
},get_parentWindowWidth:function(){return document.documentElement.clientWidth;},_onResizedHandler:function(){this._set_iframeSize();
},_createMapDetails:function(A,B){var C=$create(CClientLib.MapDetails,A,{},{},B.get_element());
return C;},performPartialPostback:function(B){var A=Function.createDelegate(this,function(){window.top.Sys.WebForms.PageRequestManager.getInstance().remove_endRequest(A);
if(Type.isFunction(B)){B();}});Sys.WebForms.PageRequestManager.getInstance().add_endRequest(A);
__doPostBack(fn_getUpdatePanelNavigationClientID(),"LoggedIn");var D=fn_getElementOpenLogin_Element();
if(D!=null){$clearHandlers(D);}var C=fn_loginViewLoginDiv();if(C!=null){C.innerHTML="<span class='loadingRed'>Loading your settings...<span>";
}}};CClientLib.Parent.registerClass("CClientLib.Parent",Sys.Component);CClientLib.Parent.strEventWindowResize="windowResized";
CClientLib.Parent.createEvent(CClientLib.Parent.strEventWindowResize);CClientLib.Parent.parse=function(A){return CClientLib.Parent._parse(A);
};CClientLib.Parent.GetParentComponent=function(){if(top){return top.fn_Defaultaspx_getParentObject();
}else{if(Type.isFunction(fn_Defaultaspx_getParentObject)){return fn_Defaultaspx_getParentObject;
}else{throw Error.create("Unable to return the parent object from CClientLib.Parent.GetParentComponent()",{"name":""});
}}};CClientLib.Parent.IsDebugMode=function(){return CClientLib.Parent.GetParentComponent().get_isDebugMode();
};CClientLib.Parent.GetWebServices=function(){return CClientLib.Parent.GetParentComponent().get_webServices();
};CClientLib.Parent.GetClientData=function(){return CClientLib.Parent.GetParentComponent().get_clientData();
};CClientLib.Parent.GetModalPopupContainer=function(){return CClientLib.Parent.GetParentComponent().get_modalPopupContainer();
};CClientLib.Parent.GetNavigation=function(){return CClientLib.Parent.GetParentComponent().get_navigation();
};CClientLib.Parent.GetIFrame=function(){return CClientLib.Parent.GetParentComponent().get_IframeElement();
};CClientLib.Parent.GetIFrameWindowObject=function(){return CClientLib.Parent.GetParentComponent().get_IframesWindowObject();
};CClientLib.Parent.OpenModalPopupAndRenderControl=function(F,E,A,C,D){var B=CClientLib.Parent.GetModalPopupContainer().create_modalPopup(F);
A=fn_Global_SafeObject_Object(A);if(String.isPopulatedString(C)){A[C]=B.get_modalPopupNumber();
}var G=B.render_contentControl(E,A,D);return G;};CClientLib.Parent.OnErrorHandler=function(C,D,B){var A=["Error: "+C,"File: "+D,"Line: "+B,"Error URL: "+window.location,"Parent URL: "+window.top.location];
top.window.__doPostBack("CLIENT_ERROR",A.join("\n"));return false;};window.onerror=CClientLib.Parent.OnErrorHandler;
function fn_CalendarWeek_GetControl(){return $get("_divCalendarWeek").control;}Type.registerNamespace("CClientLib");
CClientLib.CalendarWeek=function(A){CClientLib.CalendarWeek.initializeBase(this,[A]);
this._nReservedPixelsAtBottomOfPage=0;this._arrayWorkOutPanels=[];this._oSelectedWorkoutPanel="";
this._gcWeekDates=[];this._twoDemensionalArrayCells=[];this._nSelectedDayIndex=0;
this._nSelectedTimeIndex=0;this._spanDay0Title=null;this._spanDay1Title=null;this._spanDay2Title=null;
this._spanDay3Title=null;this._spanDay4Title=null;this._spanDay5Title=null;this._spanDay6Title=null;
this._spanHeaderDay0Date=null;this._spanHeaderDay1Date=null;this._spanHeaderDay2Date=null;
this._spanHeaderDay3Date=null;this._spanHeaderDay4Date=null;this._spanHeaderDay5Date=null;
this._spanHeaderDay6Date=null;this._spanHeaderDay0Count=null;this._spanHeaderDay1Count=null;
this._spanHeaderDay2Count=null;this._spanHeaderDay3Count=null;this._spanHeaderDay4Count=null;
this._spanHeaderDay5Count=null;this._spanHeaderDay6Count=null;this._divCalendarWrapper=null;
this._tableCalendar=null;this._objSelectableTimes={};this._strRowHeight="25px";this._fnDelagateOnWindowResize=Function.createDelegate(this,this._setSize);
};CClientLib.CalendarWeek.prototype={initialize:function(){CClientLib.CalendarWeek.callBaseMethod(this,"initialize");
this._objSelectableTimes=CClientLib.Parent.GetClientData().get_selectableTimes();
this.get_element().id="_divCalendarWeek";this._buildHeaderTable();this._buildSkelatonCalendar();
this._setSize();var A=Function.createDelegate(this,this._buildPostLoadElements);window.setTimeout(A,1);
CClientLib.Parent.GetParentComponent().add_windowResized(this._fnDelagateOnWindowResize);
},dispose:function(){CClientLib.Parent.GetParentComponent().remove_windowResized(this._fnDelagateOnWindowResize);
CClientLib.CalendarWeek.callBaseMethod(this,"dispose");},_setSize:function(){this._divCalendarWrapper.get_element().style.height=(CClientLib.Parent.GetParentComponent().get_parentWindowHeight()-195-this._nReservedPixelsAtBottomOfPage)+"px";
var A=CClientLib.Parent.GetParentComponent().get_parentWindowWidth();if(Sys.Browser.agent==Sys.Browser.InternetExplorer){this._tableCalendar.get_element().style.width=(A-310)+"px";
}var B=0;if(A>1200){B=7;}this._spanDay0Title.set_value(CClientLib.Type.Date.i18n.dayNames[B+1]);
this._spanDay1Title.set_value(CClientLib.Type.Date.i18n.dayNames[B+2]);this._spanDay2Title.set_value(CClientLib.Type.Date.i18n.dayNames[B+3]);
this._spanDay3Title.set_value(CClientLib.Type.Date.i18n.dayNames[B+4]);this._spanDay4Title.set_value(CClientLib.Type.Date.i18n.dayNames[B+5]);
this._spanDay5Title.set_value(CClientLib.Type.Date.i18n.dayNames[B+6]);this._spanDay6Title.set_value(CClientLib.Type.Date.i18n.dayNames[B]);
var C=Function.createDelegate(this,function(){for(var D=0;D<this._arrayWorkOutPanels.length;
D++){CClientLib.Calendar.Week.WorkoutPanel.parse(this._arrayWorkOutPanels[D]).set_panelClosedWidthAndHeight();
}});window.setTimeout(C,100);},_buildHeaderTable:function(){var B=$createTable(this.get_element(),{"style":"width:100%;"});
var G=$createTableRow(B,{"style":"font-size:10px; text-align:center;"});var H=$createTableCell(G,{"style":"width:30px;"});
var F=$createTableCell(G,{"style":"width:14%"});var L=$createTableCell(G,{"style":"width:14%"});
var D=$createTableCell(G,{"style":"width:14%"});var I=$createTableCell(G,{"style":"width:14%"});
var C=$createTableCell(G,{"style":"width:14%"});var E=$createTableCell(G,{"style":"width:14%"});
var J=$createTableCell(G,{"style":"width:14%"});var K=$createTableCell(G,{"value":"&nbsp;&nbsp;&nbsp;&nbsp;","style":"width:25px;"});
var A=$createDiv(H,{"value":"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;","style":"width:35px;"});
this._spanDay0Title=$createSpan(F);this._spanDay1Title=$createSpan(L);this._spanDay2Title=$createSpan(D);
this._spanDay3Title=$createSpan(I);this._spanDay4Title=$createSpan(C);this._spanDay5Title=$createSpan(E);
this._spanDay6Title=$createSpan(J);this._spanHeaderDay0Date=$createSpan(F);this._spanHeaderDay1Date=$createSpan(L);
this._spanHeaderDay2Date=$createSpan(D);this._spanHeaderDay3Date=$createSpan(I);this._spanHeaderDay4Date=$createSpan(C);
this._spanHeaderDay5Date=$createSpan(E);this._spanHeaderDay6Date=$createSpan(J);this._divHeaderDay0Count=$createDiv(F,{"value":"&nbsp;"});
this._divHeaderDay1Count=$createDiv(L,{"value":"&nbsp;"});this._divHeaderDay2Count=$createDiv(D,{"value":"&nbsp;"});
this._divHeaderDay3Count=$createDiv(I,{"value":"&nbsp;"});this._divHeaderDay4Count=$createDiv(C,{"value":"&nbsp;"});
this._divHeaderDay5Count=$createDiv(E,{"value":"&nbsp;"});this._divHeaderDay6Count=$createDiv(J,{"value":"&nbsp;"});
},_buildSkelatonCalendar:function(){objSelectableTimes=this._objSelectableTimes;var A=this._strRowHeight;
this._divCalendarWrapper=$createDiv(this.get_element(),{"style":"overflow-y:scroll; overflow-x:auto;  border:double 3px #CCC; padding:3px; position:relative;"});
this._tableCalendar=$createTable(this._divCalendarWrapper,{"css":"CalendarWeek"},true);
var I=new Date();var C=objSelectableTimes.item_count();var F=new Date();for(var M=0;
M<C;M++){var B=objSelectableTimes.get_itemText(M);var L=B.indexOf(":00");var K=$createTableRow(this._tableCalendar,{"style":"height:"+this._strRowHeight});
var D=$createTableCell(K);if(L>-1){var G=B.substr(0,L);G+=B.substr(L+4);D.set_value(G);
D.set_css("Time_HourMark");}else{D.set_value("&nbsp;");D.set_css("Time_NonHourMark");
}this._twoDemensionalArrayCells[M]=[];var E=(((M%2)===0)?"CalendarCell_HourMark":"CalendarCell_NonHourMark");
var O="vertical-align:top; height:"+this._strRowHeight+";background-color:white;";
for(var N=1;N<=7;N++){var J=$createTableCell(K,{"css":E,"style":O});this._twoDemensionalArrayCells[M][N]=J;
}}var H=new Date();this._tableCalendar.appendElementToPage();},_buildPostLoadElements:function(){var G=this._objSelectableTimes;
var F=G.item_count()-1;var A=7;var D=$createEvents({"click":function(J){var K=Sys.UI.DomEvent.parse(J).target.get_elementWrapper();
var L=K.dayIndex;var I=K.timeIndex;this._handlerCellClicked(J,L,I);}},this);do{var C=G.get_itemText(F);
for(var B=1;B<=7;B++){cellClickable=this._twoDemensionalArrayCells[F][B];cellClickable.timeIndex=F;
cellClickable.dayIndex=B;var H=Function.createCallback(this._handlerCellClicked,B);
H=Function.createCallback(H,F);cellClickable.set_events(D);var E=$createSpan(cellClickable,{"value":C,"css":"DayTimes"});
}}while(F--);},_handlerCellClicked:function(C,A,B){this.set_selectedDayIndex(A);this.set_selectedTimeIndex(B);
this._raiseEvent(CClientLib.CalendarWeek.strEventNameCellClicked);},get_selectedDayIndex_Int:function(){return this._nSelectedDayIndex;
},set_selectedDayIndex:function(A){this._nSelectedDayIndex=A;},get_selectedTimeIndex_Int:function(){return this._nSelectedTimeIndex;
},set_selectedTimeIndex:function(A){this._nSelectedTimeIndex=A;},get_selectedDate:function(){if(this._gcWeekDates.item_count()==7){return this._gcWeekDates.get_item(this.get_selectedDayIndex_Int()-1);
}return null;},clear_workoutPanels:function(){Array.forEach(this._arrayWorkOutPanels,function(controlWorkoutPanel){controlWorkoutPanel.dispose();
});Array.clear(this._arrayWorkOutPanels);for(var i=0;i<7;i++){eval("this._divHeaderDay"+i+'Count.set_value("&nbsp;")');
}},add_workoutPanel:function(oWorkoutPanelVariables){var nDayIndex=oWorkoutPanelVariables._nDayIndex;
var cell=this.get_calendarCell_Element(nDayIndex,oWorkoutPanelVariables._nStartTimeIndex);
var controlWorkoutPanel=$create(CClientLib.Calendar.Week.WorkoutPanel,oWorkoutPanelVariables,{},{},$createDiv(cell).get_element());
Array.add(this._arrayWorkOutPanels,controlWorkoutPanel);var nWorkoutCountForDay=this.get_workoutPanelsByDayIndex(nDayIndex).length;
eval("this._divHeaderDay"+(nDayIndex-1)+'Count.set_value("&nbsp;[ '+nWorkoutCountForDay+" workout"+((nWorkoutCountForDay>1)?"s":"")+' ]&nbsp;")');
},set_selectedWorkoutPanel:function(A){var A=CClientLib.Calendar.Week.WorkoutPanel.parse(A);
this._oSelectedWorkoutPanel=A;this.set_selectedDayIndex(A.get_dayIndex());},get_selectedWorkoutPanel:function(){return this._oSelectedWorkoutPanel;
},get_calendarCell_Element:function(A,B){return CClientLib.UI.Element.parse(this._twoDemensionalArrayCells[B][A]);
},set_weekDates:function(gcDates){gcDates=CClientLib.ServerClasses.GenericCollection.parse(gcDates);
if(gcDates.item_count()!=7){alert("Error: you mast pass an array of 7 Date objects to calendarWeek.set_weekDates(arrayDates)");
}var nCurrentDayIndex=-1;var strDateFormat="dd/MMM";for(var i=0;i<gcDates.item_count();
i++){var strDate=CClientLib.Type.Date.format(gcDates.get_item(i)[gcDates.get_collectionKey()],strDateFormat);
eval("this._spanHeaderDay"+i+'Date.set_value("&nbsp;&nbsp;'+strDate+'")');if(strDate==CClientLib.Type.Date.format(new Date(),strDateFormat)){nCurrentDayIndex=i;
}}this.set_allColumsBackgroundColorToWhite();if(nCurrentDayIndex>-1){this.set_columnColor((nCurrentDayIndex+1),"#FFFFCC");
}},set_columnColor:function(A,C){if(this._twoDemensionalArrayCells[0][A].style.backgroundColor.toLowerCase()==C.toLowerCase()){return;
}for(var B=0;B<this._twoDemensionalArrayCells.length;B++){this._twoDemensionalArrayCells[B][A].style.backgroundColor=C;
}},set_allColumsBackgroundColorToWhite:function(){for(var A=1;A<=7;A++){this.set_columnColor(A,"white");
}},scrollCalendar:function(A){this._divCalendarWrapper.scrollTop=this._divCalendarWrapper.scrollTop+A;
},get_workoutPanelsByDayIndex:function(B){var C=[];var D="Day index: "+B+"\n";D+="w/o panel count: : "+this._arrayWorkOutPanels.length+"\n\n\n";
for(var E=0;E<this._arrayWorkOutPanels.length;E++){var A=CClientLib.Calendar.Week.WorkoutPanel.parse(this._arrayWorkOutPanels[E]);
D+="passed day indes: "+B+" || workout panel day index: "+A.get_dayIndex();if(A.get_dayIndex()==B){D+=" (match found)";
Array.add(C,A);}D+="\n";}return C;},get_countOfWorkoutPanelsSpanningCell:function(B,D){var C=this.get_workoutPanelsByDayIndex(B);
var G=[];for(var F=0;F<C.length;F++){var A=CClientLib.Calendar.Week.WorkoutPanel.parse(C[F]);
Array.addRange(G,A.get_cellIndexesSpaned(B));}var E=0;for(var F=0;F<G.length;F++){if(D==G[F]){E++;
}}return E;}};CClientLib.CalendarWeek.registerClass("CClientLib.CalendarWeek",Sys.UI.Control);
CClientLib.CalendarWeek.strEventNameCellClicked="cellClicked";CClientLib.CalendarWeek.createEvent(CClientLib.CalendarWeek.strEventNameCellClicked);
CClientLib.CalendarWeek.parse=function(A){return CClientLib.CalendarWeek._parse(A);
};CClientLib.CalendarWeek.CreateCalendarWeek=function(C,A){C=CClientLib.UI.Element.parse(C);
var B=$create(CClientLib.CalendarWeek,A,null,null,C.get_element());return B;};Type.registerNamespace("CClientLib");
CClientLib.ExerciseDetails=function(A){CClientLib.ExerciseDetails.initializeBase(this,[A]);
this._strExerciseID="";this._bAllowEditing=true;this._nModalPopupID=0;this._strTitle="";
this._strDescription="";this._bShowRepetitions=true;this._bShowWeight=true;this._bShowDistance=true;
this._bShowDuration=true;this._strImageURL="";this._tablePage=null;this._cellPageLeft=null;
this._cellPageRight=null;this._cellProccessingControl=null;this._tableExerciseDetails=null;
this._textBoxTitle=null;this._textAreaDescription=null;this._checkBoxShowRepetitions=null;
this._checkBoxShowWeight=null;this._checkBoxShowDistance=null;this._checkBoxShowDuration=null;
this._divMapContainer=null;this._imageExercise=null;this._buttonProcessing=null;this._divTabDetails=null;
this._divTabAssociatedMaps=null;this._divTabStats=null;this._sddlMap=null;this._controlTabContainer=null;
this._gridViewMapAssociations=null;};CClientLib.ExerciseDetails.prototype={initialize:function(){CClientLib.ExerciseDetails.callBaseMethod(this,"initialize");
this.load_exerciseData();this._createTabs();this._createDetails();this._createAssociatedMaps();
this._createStats();this._buildProcessingContols();this._controlTabContainer.render(0);
this._addHandlers();},dispose:function(){this._controlTabContainer.dispose();CClientLib.ExerciseDetails.callBaseMethod(this,"dispose");
},get_modalPopup:function(){return CClientLib.UI.ModalPopupWrapper.parse(CClientLib.Parent.GetModalPopupContainer().get_modalPopupByID(this._nModalPopupID));
},load_exerciseData:function(){if(String.isPopulatedString(this._strExerciseID)){var A=CClientLib.Parent.GetClientData().get_exercises().get_itemByValue(this._strExerciseID);
if(A!=null){A=CClientLib.ServerClasses.Exercise.parse(A);this._strTitle=A.get_title();
this._strDescription=A.get_description();this._bShowRepetitions=A.get_showRepetitions();
this._bShowWeight=A.get_showWeight();this._bShowDistance=A.get_showDistance();this._bShowDuration=A.get_showDuration();
}else{this._strExerciseID="";alert("Error: A exerciseId was passed to the contol CClientLib.ExerciseDetails yet it couldn't be found in the clien data.");
}}},_createTabs:function(){this._controlTabContainer=window.top.$createTabContainer(this.get_element(),"exerciseDetailsTabContainer");
var A=this._controlTabContainer.add_tabPanel("Details");var C=this._controlTabContainer.add_tabPanel("Associated Maps");
var B=this._controlTabContainer.add_tabPanel("Stats");this._divTabDetails=A.divBody;
this._divTabAssociatedMaps=C.divBody;this._divTabStats=B.divBody;},_createDetails:function(){if(this._strImageURL==""){this._strImageURL=CClientLib.Parent.GetClientData().get_applicationSettings().strRootURL+"Images/image_not_found.jpg";
}this._imageExercise=$createImage(this._divTabDetails,this._strImageURL,{"style":"padding: 5px; border: solid 1px #ccc; float: right;"});
var C=$createTable(this._divTabDetails,{"style":"width: 50%; margin-bottom: 100px;"});
var D={"style":"width: 100px;"};var G={"style":""};var E={"style":"width: 100px;"};
var I=$createRowInDetailsTable(C,{},D,{"value":"Title: "},G,E,{});this._textBoxTitle=$createTextbox(I.cellValue,{"value":this._strTitle,"style":"width:250px;"});
var J=$createRowInDetailsTable(C,{},D,{"value":"Description: "},G,E,{});this._textAreaDescription=$createTextarea(J.cellValue,{"value":this._strDescription,"style":"width: 100%; height: 100px; margin-bottom: 15px;"});
var B=$createRowInDetailsTable(C,{},D,{"value":"Attributes: "},G,E,{});var F=$createCheckBoxWithTitle(B.cellValue,{},{},{"value":"Show Repetitions"},{},{"value":this._bShowRepetitions},{});
var H=$createCheckBoxWithTitle(B.cellValue,{},{},{"value":"Show Weight"},{},{"value":this._bShowWeight},{});
var A=$createCheckBoxWithTitle(B.cellValue,{},{},{"value":"Show Distance"},{},{"value":this._bShowDistance},{});
var K=$createCheckBoxWithTitle(B.cellValue,{"style":"margin-bottom: 15px;"},{},{"value":"Show Duration"},{},{"value":this._bShowDuration},{});
this._checkBoxShowRepetitions=F.checkbox;this._checkBoxShowWeight=H.checkbox;this._checkBoxShowDistance=A.checkbox;
this._checkBoxShowDuration=K.checkbox;},_createAssociatedMaps:function(){var G=this._checkBoxShowDistance.get_value();
this._divTabAssociatedMaps=CClientLib.UI.Element.parse(this._divTabAssociatedMaps);
this._divTabAssociatedMaps.removeChildrenFromDOM();var F=$createStandardNote(this._divTabAssociatedMaps,{"value":"Maps that are currently associated with the exercise '"+this._strTitle+"'"});
var H=$createDiv(this._divTabAssociatedMaps,{"style":"margin-bottom:40px;"});var L=$createDiv(this._divTabAssociatedMaps);
if(G){$createBR(H);this._gridViewMapAssociations=CClientLib.MapDetails.GridView_Create(H,{},"This exercise doesn't have any associated maps...");
$createBR(H);var J=CClientLib.Parent.GetClientData().get_exercises().get_exerciseByExerciseID(this._strExerciseID);
var A=new CClientLib.ServerClasses.MapCollection([]);if(J!=null){A=CClientLib.Parent.GetClientData().get_exerciseAssociatedMaps(J);
}this._gridViewMapAssociations.set_dataSource(function(){return A;});var I=function(N,O){O=CClientLib.UI.GridViewEventArgs.parse(O);
A.remove_item(O.get_dataItem());O.get_gridView().dataBind();};CClientLib.MapDetails.GridView_AddColumnThumbnail(this._gridViewMapAssociations);
CClientLib.MapDetails.GridView_AddColumnMapTitle(this._gridViewMapAssociations);CClientLib.MapDetails.GridView_AddColumnDistance(this._gridViewMapAssociations);
CClientLib.MapDetails.GridView_AddColumnDescription(this._gridViewMapAssociations);
this._gridViewMapAssociations.add_columnAnchor({"style":"width:50px;"},null,{"style":"vertical-align:top;"},{"value":"Remove","events":$createEvents({"click":I},this)});
this._gridViewMapAssociations.dataBind();var D=$createDiv(H);var E=$createDiv(H,{"display":"none"});
var M=$createAnchor(D,{"value":"Associate a map to this exercise","style":""});$addHandlers(M.get_element(),{click:function(){D.set_display("none");
E.set_display("block");}},this);$createDiv(E,{"value":"Select the map that you would like to associate with this exercise","style":"margin-bottom:20px;"});
var B=Function.createDelegate(this,function(N,P){var O=CClientLib.ServerClasses.Map.parse(N.get_selectedItem_Array());
A.add_item(O);this._gridViewMapAssociations.dataBind();D.set_display("block");E.set_display("none");
N.clearSelection();});var K=$createDiv(E,{"style":"float:left;"});this._sddlMap=CClientLib.UI.SDDL.CreateMapList($createDiv(K),{"_strClientCollectionEmpty":"You currently do not have any maps. You need to create the map before you can associate it to an exercise"},null);
this._sddlMap.add_selectionMade(Function.createDelegate(this,B));var C=$createAnchor(E,{"value":"cancel","style":"margin-left: 25px;"});
$addHandlers(C.get_element(),{click:function(){D.set_display("block");E.set_display("none");
}},this);}else{L.set_value("* You can not associate a map with an exercise that doesn't have a distance attribute.");
}},_createStats:function(){var A=$createDiv(this._divTabStats,{});var B=CClientLib.GenericStats.CreateExerciseStats({},A,false,this._strExerciseID);
},_addHandlers:function(){$addHandlers(this._checkBoxShowDistance.get_element(),{click:this._createAssociatedMaps},this);
},_buildProcessingContols:function(){var A=function(C){var B=new CClientLib.ServerClasses.Exercise();
var E=this._checkBoxShowDistance.get_value();B.set_exerciseID(this._strExerciseID);
B.set_title(this._textBoxTitle.get_value());B.set_description(this._textAreaDescription.get_value());
B.set_showRepetitions(this._checkBoxShowRepetitions.get_value());B.set_showWeight(this._checkBoxShowWeight.get_value());
B.set_showDistance(E);B.set_showDuration(this._checkBoxShowDuration.get_value());
var D=new CClientLib.ServerClasses.MapCollection([]);if(E){var D=CClientLib.ServerClasses.MapCollection.parse(CClientLib.UI.GridView.parse(this._gridViewMapAssociations).get_dataSource());
}var F=function(){CClientLib.Parent.GetNavigation().navigateTo_ExerciseList({"_bIncrementalDataBind":false});
};CClientLib.Parent.GetWebServices().WSExercise_WSCreateOrUpdateExercise(B,D,F,null,null);
this.get_modalPopup().close();};this._buttonProcessing=$createButton(this.get_element(),{"style":"float: right;","value":"Save","events":$createEvents({"click":A},this)});
}};CClientLib.ExerciseDetails.registerClass("CClientLib.ExerciseDetails",Sys.UI.Control);
CClientLib.ExerciseDetails.parse=function(A){return CClientLib.ExerciseDetails._parse(A);
};CClientLib.ExerciseDetails.CreateExerciseDetails=function(C,A){C=fn_Global_SafeObject_Object(C);
C._objSpanHeadingProperties=fn_Global_ObjectAddDefultProperties(C._objSpanHeadingProperties,{"value":"Exercise Details"});
var B=CClientLib.Parent.OpenModalPopupAndRenderControl(C,CClientLib.ExerciseDetails,A,"_nModalPopupID",false);
return CClientLib.ExerciseDetails.parse(B);};Type.registerNamespace("CClientLib");
CClientLib.ExerciseList=function(A){CClientLib.ExerciseList.initializeBase(this,[A]);
this._bIncrementalDataBind=true;};CClientLib.ExerciseList.prototype={initialize:function(){CClientLib.ExerciseList.callBaseMethod(this,"initialize");
this._buildCreateNewExercise();this._buildTableList();},dispose:function(){CClientLib.ExerciseList.callBaseMethod(this,"dispose");
},_buildCreateNewExercise:function(){var D=$createDiv(this.get_element(),{"style":"text-align:right;"});
var A=$createSpan(D,{"value":"Click&nbsp;"});var C=$createAnchor(D,{"value":"here","events":$createEvents({"click":function(){CClientLib.ExerciseDetails.CreateExerciseDetails({"_bIncrementalDataBind":false});
}},this)});var B=$createSpan(D,{"value":"&nbsp;to create a new exercise."});},_buildTableList:function(){var A=function(D,E){E=CClientLib.UI.GridViewEventArgs.parse(E);
dataRow=E.get_dataRow();dataRow.disable();var C=CClientLib.ServerClasses.Exercise.parse(E.get_dataItem());
CClientLib.ExerciseDetails.CreateExerciseDetails({"events":$createEvents({"cancel":function(){dataRow.enable();
}},this)},{"_strExerciseID":C.get_exerciseID()});};var B=CClientLib.UI.GridView.GridViewStandardList($createDiv(this.get_element()),{"_bIncrementalDataBind":this._bIncrementalDataBind,"_objDataRowProperties":{"events":$createEvents({"click":A},this)}},"You currently do not have any exercises.");
B.set_dataSource(function(){return CClientLib.Parent.GetClientData().get_exercises();
});B.add_columnBindToDataItem({"value":"Exercise Title","style":"width: 200px"},null,{"style":"width:200px"},CClientLib.ServerClasses.Exercise.Properties.Title);
B.add_columnBindToDataItem({"value":"Description","style":""},null,{},CClientLib.ServerClasses.Exercise.Properties.Description);
B.add_columnAnchor({"value":"&nbsp;","style":"width:80px;"},null,{"style":"width:80px;"},{"value":"View","events":$createEvents({"click":A},this)});
B.dataBind();}};CClientLib.ExerciseList.registerClass("CClientLib.ExerciseList",Sys.UI.Control);
CClientLib.ExerciseList.parse=function(A){return CClientLib.ExerciseList._parse(A);
};CClientLib.ExerciseList.CreateExerciseList=function(A,B){B=CClientLib.UI.Element.parse(B);
return $create(CClientLib.ExerciseList,A,{},{},B.get_element());};Type.registerNamespace("CClientLib");
CClientLib.GenericStats=function(A){CClientLib.GenericStats.initializeBase(this,[A]);
this._strStatsName="";this._strHeaderNotes="";this._bAllowEditing=true;this._strLoadingMessage="Loading you stats...";
this._fnGetDataDictFilters=function(){return new CClientLib.Dictionary();};this._divWrapper=null;
this._tableFilers=null;this._divButtonUpdateWrapper=null;this._buttonUpdate=null;
this._divServerHTML=null;};CClientLib.GenericStats.prototype={initialize:function(){CClientLib.GenericStats.callBaseMethod(this,"initialize");
this._bAllowEditing=false;this._divWrapper=$createDiv(this.get_element());if(String.isPopulatedString(this._strHeaderNotes)){$createStandardNote(this._divWrapper,{"value":this._strHeaderNotes});
}this._tableFilers=$createTable(this._divWrapper);this._divServerHTML=$createDiv(this._divWrapper);
this._raiseEvent(CClientLib.GenericStats.strInitEventName);var A=$createRowInDetailsTable(this._tableFilers,{"display":(this._bAllowEditing?"":"none")},{},{},{"align":"right"},{},{});
this._divButtonUpdateWrapper=$createDiv(A.cellValue);this._addButtonUpdate();},dispose:function(){CClientLib.GenericStats.callBaseMethod(this,"dispose");
},_addButtonUpdate:function(){this._divButtonUpdateWrapper.removeChildrenFromDOM();
$createButton(this._divButtonUpdateWrapper,{"value":"view stats","events":$createEvents({"click":function(){this.load_stats();
}},this)});},load_stats:function(){this._divServerHTML=CClientLib.UI.Element.parse(this._divServerHTML);
this.clear_serverHTML();this._divServerHTML.set_value(this._strLoadingMessage);var D=Function.createDelegate(this,function(E){this._divServerHTML.set_value(E);
this._addButtonUpdate();});var A="statistics not found...";var B=Function.createDelegate(this,function(){this._divServerHTML.set_value(A);
return true;});var C=Function.createDelegate(this,function(){this._divServerHTML.set_value(A);
return true;});CClientLib.Parent.GetWebServices().WSStats_WSGetStats(this._strStatsName,"","",this._fnGetDataDictFilters(),D,B,C);
},clear_serverHTML:function(){this._divServerHTML=CClientLib.UI.Element.parse(this._divServerHTML);
this._divServerHTML.set_value("");},get_filtersTable:function(){return this._tableFilers;
},set_dataDictionaryFilters:function(A){this._fnGetDataDictFilters=A;}};CClientLib.GenericStats.registerClass("CClientLib.GenericStats",Sys.UI.Control);
CClientLib.GenericStats.strInitEventName="init";CClientLib.GenericStats.createEvent(CClientLib.GenericStats.strInitEventName);
CClientLib.GenericStats.parse=function(A){return CClientLib.GenericStats._parse(A);
};CClientLib.GenericStats._CreateGenericStats=function(A,C){A=fn_Global_SafeObject_Object(A);
var B=$create(CClientLib.GenericStats,A,{},{},CClientLib.UI.Element.parse(C).get_element());
return CClientLib.GenericStats.parse(B);};CClientLib.GenericStats.CreateExerciseStats=function(D,F,E,A){var C=function(G,I){var H=CClientLib.GenericStats.parse(G);
var K=H.get_filtersTable();var L=$createRowInDetailsTable(H.get_filtersTable(),{"display":(E?"":"none")},{},{"value":"Exercise:","style":"font-weight:bold; font-size:1.1em;padding-right:5px;"},{},{},{});
var J=CClientLib.UI.SDDL.CreateExercise(L.cellValue,{"_bAllowEditing":E,"events":$createEvents({"selectionMade":H.load_stats,"selectionRemoved":H.clear_serverHTML},H)});
var M=function(){var N=new CClientLib.Dictionary();N.add_item("ExerciseID",J.get_selectedItemValue_Obj());
return N;};H.set_dataDictionaryFilters(M);if(String.isPopulatedString(A)){J.set_SelectedItemByValue(A);
}};D=fn_Global_ObjectAddDefultProperties(D,{"_strStatsName":"Exercise","_strHeaderNotes":"Your Exercise Stats...","_bAllowEditing":E,"events":$createEvents({"init":C},this)});
var B=$create(CClientLib.GenericStats,D,{},{},CClientLib.UI.Element.parse(F).get_element());
return CClientLib.GenericStats.parse(B);};CClientLib.GenericStats.CreateMapStats=function(D,F,E,A){var C=function(G,I){var K=CClientLib.GenericStats.parse(G);
var J=$createRowInDetailsTable(K.get_filtersTable(),{"display":(E?"":"none")},{},{"value":"Map:","style":"font-weight:bold; font-size:1.1em;padding-right:5px;"},{},{},{});
var L=CClientLib.UI.SDDL.CreateMapList(J.cellValue,{"_bAllowEditing":E,"events":$createEvents({"selectionMade":K.load_stats,"selectionRemoved":K.clear_serverHTML},K)},null);
var H=function(){var M=new CClientLib.Dictionary();M.add_item("MapID",L.get_selectedItemValue_Obj());
return M;};K.set_dataDictionaryFilters(H);if(String.isPopulatedString(A)){L.set_SelectedItemByValue(A);
}};D=fn_Global_ObjectAddDefultProperties(D,{"_strStatsName":"Map","_strHeaderNotes":"Your Map Stats...","_bAllowEditing":E,"events":$createEvents({"init":C},this)});
var B=$create(CClientLib.GenericStats,D,{},{},CClientLib.UI.Element.parse(F).get_element());
return CClientLib.GenericStats.parse(B);};CClientLib.GenericStats.CreateWorkoutStats=function(B,C){B=fn_Global_ObjectAddDefultProperties(B,{"_strStatsName":"Workout","_strHeaderNotes":"Your Workout Stats...","_bAllowEditing":false});
var A=$create(CClientLib.GenericStats,B,{},{},CClientLib.UI.Element.parse(C).get_element());
A.load_stats();return CClientLib.GenericStats.parse(A);};CClientLib.GenericStats.CreateProfileStats=function(B,C){objGenericStatsProperties=fn_Global_SafeObject_Object(B);
objGenericStatsProperties._strStatsName="Profile";var A=$create(CClientLib.GenericStats,B,{},{},CClientLib.UI.Element.parse(C).get_element());
return CClientLib.GenericStats.parse(A);};Type.registerNamespace("CClientLib.UI");
CClientLib.UI.GridView=function(A){CClientLib.UI.GridView.initializeBase(this,[A]);
this._bIncrementalDataBind=true;this._objTableProperties={};this._objHeaderRowProperties={};
this._objDataRowProperties={};this._objDataRowOddProperties={};this._objDataRowEvenProperties={};
this._strDataRowFocusStyle="";this._objDivPropertiesEmpty={};this._objDivEventsEmpty={};
this._strDataRowLoadingStyle="";this._table=null;this._headerRow=null;this._objDataRowEvenEvents=null;
this._objDataRowEvenOdd=null;this._fnGenericCollection=function(){return new CClientLib.ServerClasses.GenericCollection("","");
};this._arrayHeaderCellFunctions=[];this._arrayDataCellFunctions=[];this._divEmpty=null;
this._divLoading=null;this._dataRows=[];this._dataRows.focusDataRow=null;};CClientLib.UI.GridView.prototype={initialize:function(){CClientLib.UI.GridView.callBaseMethod(this,"initialize");
this._table=$createTable(this.get_element(),this._objTableProperties,this._objTableEvents);
this._divLoading=$createDiv(this.get_element(),{"style":"position:relative; top:-15px;"},{});
this._divEmpty=$createDiv(this.get_element(),this._objDivPropertiesEmpty,this._objDivEventsEmpty);
this._divEmpty.set_display("none");this._objDataRowEvenProperties=fn_Global_ObjectAddDefultProperties(this._objDataRowEvenProperties,this._objDataRowProperties);
this._objDataRowOddProperties=fn_Global_ObjectAddDefultProperties(this._objDataRowOddProperties,this._objDataRowProperties);
this._objDataRowEvenEvents=this._objDataRowEvenProperties.events;fn_Gloabl_ObjectDeleteProperty(this._objDataRowEvenProperties,"events");
this._objDataRowEvenOdd=this._objDataRowOddProperties.events;fn_Gloabl_ObjectDeleteProperty(this._objDataRowOddProperties,"events");
},dispose:function(){CClientLib.UI.GridView.callBaseMethod(this,"dispose");},set_dataSource:function(A){if(Type.isFunction(A)&&CClientLib.ServerClasses.GenericCollection.parse(A())){this._fnGenericCollection=A;
}else{alert("Unable to pass into gridview");}},get_dataSource:function(){return CClientLib.ServerClasses.GenericCollection.parse(this._fnGenericCollection());
},add_columnAnchor:function(E,B,A,C){var D=function(G,F){if(Type.getTypeName(C.events)==CClientLib.UI.Events.getName()){C.events.set_additionalParameters([F]);
}var H=$createAnchor(F.get_dataCell(),C,true);};this.add_column(E,B,A,D);},add_columnImage:function(G,C,A,E,F,D){var B=function(I,H){if(String.isPopulatedString(F)){if(Type.getTypeName(E.events)==CClientLib.UI.Events.getName()){E.events.set_additionalParameters([H]);
}var J=$createImage(H.get_dataCell(),String.format(F,[H.get_dataItem()[D]]),E);}};
this.add_column(G,C,A,B);},add_columnBindToDataItem:function(E,C,B,D){var A=Function.createDelegate(this,function(H,G){var F=G.get_dataItem()[D];
$createSpan(G.get_dataCell(),{"value":F});});this.add_column(E,C,B,A);},add_columnDate:function(E,D,B,C){var A=Function.createDelegate(this,function(G,F){var H=F.get_dataItem()[C];
if(CClientLib.Type.Date.isDate(H)){$createSpan(F.get_dataCell(),{"value":CClientLib.Type.Date.format(H,"dd / MMM / yy")});
}else{if(H==null){}else{alert("Error: unable to render date as a column of the gridview");
}}});this.add_column(E,D,B,A);},add_column:function(F,C,B,D){var A=Function.createDelegate(this,function(G){var H=$createTableCell(G,F);
if(Type.isFunction(C)){C(G,H);}});var E=Function.createDelegate(this,function(H,G){var I=$createTableCell(H,B);
if(Type.isFunction(D)){D(this,new CClientLib.UI.GridViewEventArgs(this,H,I,G));}});
Array.add(this._arrayHeaderCellFunctions,A);Array.add(this._arrayDataCellFunctions,E);
},dataReBind:function(A){this.set_dataSource(A);this.dataBind();},dataBind:function(){this.clearTable();
var E=CClientLib.ServerClasses.GenericCollection.parse(this.get_dataSource());this._headerRow=$createTableRow(this._table,this._objHeaderRowProperties,this._objHeaderRowEvents={});
for(var C=0;C<this._arrayHeaderCellFunctions.length;C++){var A=this._arrayHeaderCellFunctions[C];
A(this._headerRow);}var F=E.item_count();var D=Function.createDelegate(this,function(I,H){for(var J=I;
J<H;J++){this._createDataRow(E.get_item(J));}});if(this._bIncrementalDataBind){var B=5;
var G=null;G=function(I,H){if(H>=F){H=F;D(I,H);return;}else{if(I==0){D(I,H);I=I+B;
H=H+B;if(H>=F){H=F;}}}window.setTimeout(function(){D(I,H);G(I+B,H+B);},1);};G(0,B);
}else{D(0,F);}this._divLoading.set_value("");this._checkIsEmpty();},_createDataRow:function(A){var B=this._table.get_rowCount()-1;
var G=this._getDataRowProperties(B);var C=$createTableRow(this._table,G);C.initialRowStyle=((G=="undefined")?"":G.style);
C.rowIndex=B;Array.add(this._dataRows,C);C.remove_afterBind=Function.createDelegate(this,function(){this.get_dataSource().remove_item(A);
this._table.delete_row(C);this._checkIsEmpty();});var F=Function.createDelegate(this,function(I){var K=C.get_element().getElementsByTagName("a");
for(var J=0;J<K.length;J++){rawElementAnchor=K[J];var H=CClientLib.UI.Element.parse(rawElementAnchor.get_elementWrapper());
H.set_display(((I)?"none":"inline"));}C.set_style((I)?this._strDataRowLoadingStyle:C.initialRowStyle);
});C.disable=function(){F(true);};C.enable=function(){F(false);};C.setFocus=Function.createDelegate(this,function(){this._setFocusRow(C,true);
});C.get_dataItem=function(){return A;};$addHandlers(C.get_element(),{"mouseover":function(){this._setFocusRow(C,true);
}},this);this._setDataRowEvents(C,B,A);A.associatedDataRow=C;for(var E=0;E<this._arrayDataCellFunctions.length;
E++){var D=this._arrayDataCellFunctions[E];D(C,A);}this._checkIsEmpty();},_setFocusRow:function(A,B){if(this._dataRows.previouslyFocusRow==null||this._dataRows.previouslyFocusRow=="undefined"){this._dataRows.previouslyFocusRow=[];
}for(var C=0;C<this._dataRows.previouslyFocusRow.length;C++){this._dataRows.previouslyFocusRow[C].set_style(A.initialRowStyle);
}Array.clear(this._dataRows.previouslyFocusRow);this._dataRows.focusDataRow=null;
if(B){this._dataRows.focusDataRow=A;Array.add(this._dataRows.previouslyFocusRow,A);
A.set_style(this._strDataRowFocusStyle);this._raiseEvent(CClientLib.UI.GridView.strEventRowHasFocus);
}},get_focusRow:function(){return this._dataRows.focusDataRow;},get_nextRow:function(){var A=this.get_focusRow();
if(A!=null){var B=A.rowIndex+1;return this.get_dateRowByIndex(B);}return null;},get_PreviousRow:function(){var A=this.get_focusRow();
if(A!=null){var B=A.rowIndex-1;if(B>=0&&this._dataRows.length>0){return this._dataRows[B];
}}return null;},get_dateRowByIndex:function(A){if(this._dataRows.length>0&&A<this._dataRows.length&&A>-1){return this._dataRows[A];
}return null;},get_dataRows:function(){return this._dataRows;},_getDataRowProperties:function(A){return(((A%2)==0)?this._objDataRowEvenProperties:this._objDataRowOddProperties);
},_setDataRowEvents:function(A,B,D){var C=(((B%2)==0)?this._objDataRowEvenEvents:this._objDataRowEvenOdd);
if(Type.getTypeName(C)==CClientLib.UI.Events.getName()){C=CClientLib.UI.Events.parse(C);
C.set_additionalParameters([new CClientLib.UI.GridViewEventArgs(this,A,null,D)]);
A.set_events(C);}else{}},_checkIsEmpty:function(){if(this.get_dataSource().item_count()>0){this._table.set_display("");
this._divEmpty.set_display("none");}else{this._table.set_display("none");this._divEmpty.set_display("block");
}},add_rowAfterBind:function(A){var B=CClientLib.ServerClasses.GenericCollection.parse(this.get_dataSource());
if(B.get_itemByValue(A[B.get_collectionKey()])==null){B.add_item(A);this._createDataRow(A);
}},removeAll:function(){this.clearTable();this._fnGenericCollection=function(){return new CClientLib.ServerClasses.GenericCollection("","");
};this._arrayHeaderCellFunctions=[];this._arrayDataCellFunctions=[];},clearTable:function(){this._dataRows=[];
this._dataRows.focusDataRow=null;if(this._table!=null){this._table=CClientLib.UI.Element.parse(this._table);
this._table.removeChildrenFromDOM();this._divEmpty=CClientLib.UI.Element.parse(this._divEmpty);
this._divEmpty.set_display("none");}},get_table:function(){return this._table;}};
CClientLib.UI.GridView.registerClass("CClientLib.UI.GridView",Sys.UI.Control);CClientLib.UI.GridView.strEventRowHasFocus="rowGainsFocus";
CClientLib.UI.GridView.createEvent(CClientLib.UI.GridView.strEventRowHasFocus);CClientLib.UI.GridView.parse=function(A){return CClientLib.UI.GridView._parse(A);
};CClientLib.UI.GridViewEventArgs=function(A,D,C,B){this._controlGridView=A;this._elementDataRow=D;
this._elementDataCell=C;this._aDataItem=B;};CClientLib.UI.GridViewEventArgs.prototype={get_gridView:function(){return this._controlGridView;
},get_dataRow:function(){return this._elementDataRow;},get_dataCell:function(){return this._elementDataCell;
},get_dataItem:function(){return this._aDataItem;}};CClientLib.UI.GridViewEventArgs.registerClass("CClientLib.UI.GridViewEventArgs");
CClientLib.UI.GridViewEventArgs.parse=function(A){return CClientLib.UI.GridViewEventArgs._parse(A);
};CClientLib.UI.GridView.GridViewStandardList=function(D,A,B){D=CClientLib.UI.Element.parse(D);
var C="cursor:arrow;";if(A&&A._objDataRowProperties&&A._objDataRowProperties.events&&Type.isFunction(A._objDataRowProperties.events.get_events().click)){C="cursor:pointer;";
}A=fn_Global_ObjectAddDefultProperties(A,{"_objTableProperties":{"css":"ListTable"},"_objHeaderRowProperties":{"css":"ListHeader","style":"width:100%;"},"_objDataRowOddProperties":{"style":"width:100%;"},"_objDataRowEvenProperties":{"css":"ListAlternateRows","style":"width:100%;"},"_strDataRowLoadingStyle":"color:gray; background-color:#FFFFCC;","_objDivPropertiesEmpty":{"value":B,"css":"mainStandarNotes"},"_strDataRowFocusStyle":"background-color:#FFFFCC; "+C});
return $create(CClientLib.UI.GridView,A,{},{},D.get_element());};Type.registerNamespace("CClientLib");
CClientLib.Login=function(A){CClientLib.Login.initializeBase(this,[A]);this._nModalPopupID=0;
this._strErrorMessage="";this._bHideModalPopupAfterLoggedIn=false;this._arrayValidationFunctions=[];
this._textBoxUserName=null;this._testBoxPassword=null;this._checkBoxRememberMe=null;
this._btnLogin=null;this._divLoading=null;};CClientLib.Login.prototype={initialize:function(){CClientLib.Login.callBaseMethod(this,"initialize");
this._buildElements();},dispose:function(){CClientLib.Login.CurrentlyOpenedLoginControl=null;
CClientLib.Login.callBaseMethod(this,"dispose");},get_modalPopup:function(){return CClientLib.UI.ModalPopupWrapper.parse(CClientLib.Parent.GetModalPopupContainer().get_modalPopupByID(this._nModalPopupID));
},get_textboxUserName:function(){return this._textBoxUserName;},get_textboxPassword:function(){return this._testBoxPassword;
},_setLoadingState:function(A){this._btnLogin=CClientLib.UI.Element.parse(this._btnLogin);
if(A){this._divLoading.set_display("block");this._btnLogin.set_disabled(true);}else{this._divLoading.set_display("none");
this._btnLogin.set_disabled(false);}},_buildElements:function(){if(String.isPopulatedString(this._strErrorMessage)){$createStandardError(this.get_element(),{"value":this._strErrorMessage});
this.get_modalPopup().set_divSize("420px","250px");}else{$createStandardNote(this.get_element(),{"value":"Please enter your username and password"});
}var H=$createTable(this.get_element(),{"style":"margin-left:10px;"});var F=$createRowInDetailsTable(H,{},{},{"value":"User Name:"},{},{},{});
this._textBoxUserName=$createTextbox(F.cellValue);var A=Function.createDelegate(this,function(){var J="";
if(!String.isPopulatedString(this._textBoxUserName.get_value())){J="* Please enter a username";
}F.divErrorMessage.set_value(J);return J;});this._textBoxUserName.set_events($createEvents({"blur":A},this));
Array.add(this._arrayValidationFunctions,A);var E=$createRowInDetailsTable(H,{},{},{"value":"Password:"},{},{},{});
this._testBoxPassword=$createTextboxPassword(E.cellValue);var B=Function.createDelegate(this,function(){var J="";
if(!String.isPopulatedString(this._testBoxPassword.get_value())){J="* Please enter a password";
}E.divErrorMessage.set_value(J);return J;});this._testBoxPassword.set_events($createEvents({"blur":B,"keydown":Function.createDelegate(this,function(J){J=Sys.UI.DomEvent.parse(J);
if(J.keyCode==Sys.UI.Key.enter){J.preventDefault();this._handlerLogin(J);}})},this));
Array.add(this._arrayValidationFunctions,B);var C=$createTableRow(H);var G=$createTableCell(C,{"colSpan":2,"align":"left"});
this._checkBoxRememberMe=$createCheckbox(G,{"value":true});$createSpan(G,{"value":"Remember me next time."});
var I=$createTableRow(H,{});var D=$createTableCell(I,{"colSpan":2,"align":"right"});
this._btnLogin=$createButton(D,{"value":"Login","events":$createEvents({"click":this._handlerLogin},this)});
this._divLoading=$createLoading(this.get_element(),{"style":"float:right;","display":"none"},true);
},close_modalPopup:function(){this.get_modalPopup().close();},_handlerLogin:function(C){C=Sys.UI.DomEvent.parse(C);
for(var A=0;A<this._arrayValidationFunctions.length;A++){var D=this._arrayValidationFunctions[A];
var B=D();if(String.isPopulatedString(B)){alert(B);return;}}var E=this._textBoxUserName.get_value();
var F=this._testBoxPassword.get_value();var J=this._checkBoxRememberMe.get_value();
var G=function(K){this._onLoggedIn(K);};var H=function(K,L){this._setLoadingState(false);
alert("Login Failed...\nEither the username or password was incorrect.\n\nPlease try again.");
return true;};var I=function(K,L){this._setLoadingState(false);err=Sys.Net.WebServiceError.parse(err);
var M="We are unable to log you in at the moment.  Is your internet connection OK?\n\n Please try again later...";
alert(M);return true;};CClientLib.Parent.GetWebServices().WSUser_Login(E,F,J,Function.createDelegate(this,G),Function.createDelegate(this,H),Function.createDelegate(this,I));
this._setLoadingState(true);},_onLoggedIn:function(A){this._raiseEvent(CClientLib.Login.strEventLoggedIn);
if(this._bHideModalPopupAfterLoggedIn){this.get_modalPopup().hide();}CClientLib.Parent.GetParentComponent().performPartialPostback(Function.createDelegate(this,this.close_modalPopup));
}};CClientLib.Login.registerClass("CClientLib.Login",Sys.UI.Control);CClientLib.Login.strEventLoggedIn="loggedIn";
CClientLib.Login.createEvent(CClientLib.Login.strEventLoggedIn);CClientLib.Login.parse=function(A){return CClientLib.Login._parse(A);
};CClientLib.Login.CurrentlyOpenedLoginControl=null;CClientLib.Login.CreateLogin=function(B,A){if(CClientLib.Login.CurrentlyOpenedLoginControl==null){B=fn_Global_ObjectAddDefultProperties(B,{"_strModalPopupWidth":"400px","_strModalPopupHeight":"205px","_nOffsetTop":-300});
B=fn_Global_SafeObject_Object(B);B._objSpanHeadingProperties=fn_Global_ObjectAddDefultProperties(B._objSpanHeadingProperties,{"value":"Login to Training-Track.com"});
CClientLib.Login.CurrentlyOpenedLoginControl=CClientLib.Parent.OpenModalPopupAndRenderControl(B,CClientLib.Login,A,"_nModalPopupID",false);
}CClientLib.Login.CurrentlyOpenedLoginControl.get_textboxUserName().set_focus(true);
return CClientLib.Login.parse(CClientLib.Login.CurrentlyOpenedLoginControl);};CClientLib.Login.CreateLoginExpired=function(B,A){return CClientLib.Login.CreateLogin(B,fn_Global_ObjectAddDefultProperties(A,{"_strErrorMessage":"Your login session expired before your request could be processsed.","_bHideModalPopupAfterLoggedIn":false}));
};Type.registerNamespace("CClientLib");CClientLib.MapDetails=function(A){CClientLib.MapDetails.initializeBase(this,[A]);
this._strMapID="";this._bAllowEdit=true;this._bDirectlyEditingMapList=true;this._nModalPopupID=0;
this._divMapCanvas=null;this._textBoxMapTitle=null;this._textAreaMapDescription=null;
this._divTotalDistance=null;this._divProcessingLinks=null;this._divClickMapMessage=null;
this._divMapLoading=null;this._anchorClearMap=null;this._anchorUndoLast=null;this._divCheckPoints=null;
this._buttonSaving=null;this._bLoading=true;this._bChangesMade=false;this._saveOptionsModalPopup=null;
this._map=null;this._bMapInitialized=false;this._aPoints=[];this._aCheckpointMarkers=[];
this._routeOverlay=null;this._bMouseOverRoute=false;this._startMarker=null;this._endMarker=null;
this._strStartMarkerURL="";this._strEndMarkerURL="";this._controlTabsContainer=null;
this._tabPanelMap=null;this._tabPanelAssociatedExercises=null;this._tabPanelStats=null;
this._divTabMap=null;this._divTabAssociatedExercises=null;this._divTabStats=null;
this._fnDelateOnResize=Function.createDelegate(this,this._setSized);};CClientLib.MapDetails.prototype={initialize:function(){CClientLib.MapDetails.callBaseMethod(this,"initialize");
var A=CClientLib.Parent.GetClientData().get_applicationSettings().strRootURL+"Images/GoogleMaps/";
this._strStartMarkerURL=A+"marker_start.png";this._strEndMarkerURL=A+"marker_end.png";
this._bLoading=true;this._createElements();this._setSized();CClientLib.Parent.GetParentComponent().add_windowResized(this._fnDelateOnResize);
CClientLib.GoogleMaps.GetGoogleMaps().SafeAddGoogleMapFunctionality(Function.createDelegate(this,this._initializeMap));
this._loadData();},dispose:function(){CClientLib.Parent.GetParentComponent().remove_windowResized(this._fnDelateOnSesize);
this._controlTabsContainer.dispose();CClientLib.MapDetails.callBaseMethod(this,"dispose");
},_setSized:function(){var A=(this.get_element().offsetHeight-85)+"px";this._divMapCanvas.style.height=A;
CClientLib.GoogleMaps.GetGoogleMaps().check_mapSize(this._map);},_loadData:function(){if(this.get_isViewExistingMap()){var A=CClientLib.Parent.GetClientData().get_maps().get_mapByMapID(this._strMapID);
if(A!=null){this.populateControl(CClientLib.ServerClasses.Map.parse(A));}var B=Function.createDelegate(this,function(){return false;
});CClientLib.Parent.GetWebServices().WSMaps_WSGetMap(this._strMapID,Function.createDelegate(this,function(C){this.populateControl(C);
this._loaded();}),B,B);}else{this._loaded();}},get_modalPopup:function(){return CClientLib.UI.ModalPopupWrapper.parse(CClientLib.Parent.GetModalPopupContainer().get_modalPopupByID(this._nModalPopupID));
},_createElements:function(){this._createTabs();this._createMap();this._createAssociatedExercises();
this._createStats();this._createProcessingControl();this._controlTabsContainer.render(0);
},_createTabs:function(){this._controlTabsContainer=window.top.$createTabContainer(this.get_element(),"mapDetailsTabContainer");
var A=this._controlTabsContainer.add_tabPanel("Map");var B=this._controlTabsContainer.add_tabPanel("Stats");
this._tabPanelMap=A.controlTabPanel;this._tabPanelStats=B.controlTabPanel;this._divTabMap=A.divBody;
this._divTabStats=B.divBody;},_createMap:function(){var I=$createTable(this._divTabMap,{"css":"googleMapsTable","style":"height:100%; width:100%;"});
var E=$createTableRow(I,{});var G=$createTableCell(E);var F=$createTableCell(E,{"style":"width:150px; height:100%; padding:5px; padding-top:20px;"});
this._divMapCanvas=$createDiv(G,{"style":"width:100%; height:100%;"});this._divTitle=$createDiv(F,{"value":"<u><b>Map Details</b></u>"});
var B="margin-top:10px; margin-bottom:4px; width:150px; text-align:left;";var D="width:150px; height:50px; margin-bottom:25px;";
this._textBoxMapTitle=$createTextBoxWaterMark(F,"Map title ...",{"style":B});this._textAreaMapDescription=$createTextareaWaterMark(F,"Map description ...",{"style":D});
var A=function(){if(!this._bAllowEdit){this._textBoxMapTitle.get_element().blur();
}};var C=function(J){J=Sys.UI.DomEvent.parse(J);if(!this.confirm_makeChange()){J.preventDefault();
J.target.blur();}};var H=$createEvents({"keypress":C,"focus":A},this);this._textBoxMapTitle.set_events(H);
this._textAreaMapDescription.set_events(H);this._divProcessingLinks=$createDiv(F,{"display":"none"});
this._anchorClearMap=$createAnchor(this._divProcessingLinks,{"value":"Clear Map","style":"display:block; padding:5px;"});
$addHandlers(this._anchorClearMap.get_element(),{click:this.clear_map},this);this._anchorUndoLast=$createAnchor(this._divProcessingLinks,{"value":"Undo Last Point","style":"display:block; padding:5px;"});
$addHandlers(this._anchorUndoLast.get_element(),{click:this.undo_last},this);this._divClickMapMessage=$createDiv(F,{"value":"Click the map to start building your map.","display":"none"});
this._divMapLoading=$createDiv(F,{"value":"loading map..."});this._divTotalDistance=$createDiv(F,{"css":"googleMapsTotalDistance"});
this._divCheckPoints=$createDiv(F,{"css":"googleMapsCheckPoints"});},_createAssociatedExercises:function(){},_createStats:function(){var A=$createDiv(this._divTabStats);
CClientLib.GenericStats.CreateMapStats({},A,false,this._strMapID);},_createProcessingControl:function(){this._buttonSaving=$createButton(this.get_element(),{"value":"Save","style":"float:right;","disabled":true,"display":(this._bAllowEdit?"block":"none"),"events":$createEvents({"click":function(A){A=Sys.UI.DomEvent.parse(A);
this._saveButtonClicked();}},this)});},_initializeMap:function(){if(GBrowserIsCompatible()){var A=this._controlTabsContainer.get_activeTabIndex();
this._controlTabsContainer.set_activeTabIndex(this._tabPanelMap.get_tabIndex());this._map=new google.maps.Map2(this._divMapCanvas.get_element());
this._map.getMousePosition=Function.createDelegate(this,function(){if(this._map.__mousePoint){return this._map.__mousePoint;
}else{this._map.getCenter();}});GEvent.addListener(this._map,"mousemove",Function.createDelegate(this,function(C){this._map.__mousePoint=C;
this.fnTest();}));var B=CClientLib.Parent.GetClientData().get_currentUser();this._setMapLatLngZoomAndType(B.get_mappingDefaultLat(),B.get_mappingDefaultLng(),B.get_mappingDefaultZoom());
this._map.addControl(new GLargeMapControl());this._map.addControl(new GMapTypeControl());
this._map.addControl(new GScaleControl());this._addHandlers();this._bMapInitialized=true;
this._controlTabsContainer.set_activeTabIndex(A);}},__addCheckPointControl:function(){var A=function(){};
A.prototype=new GControl();A.prototype.initialize=function(C){var B=$createDiv(C.getContainer(),{"value":"Check points (0)","tooltip":"Click the route to add a checkpoint to your map","style":"background-color:white; border:solid 1px #000; padding: 2px 5px 2px 5px; font:Arial;"});
return B.get_element();};A.prototype.getDefaultPosition=function(){return new GControlPosition(G_ANCHOR_TOP_RIGHT,new GSize(7,30));
};return new A();},_setMapLatLngZoomAndType:function(D,C,B,G){var H=new GLatLng(fn_Global_SafeDecimal_Decimal(D),fn_Global_SafeDecimal_Decimal(C));
this._map.setCenter(H,B);var F=this._map.getMapTypes();for(var A=0;A<F.length;A++){var E=F[A];
if(G==E.getName()){this._map.setMapType(E);break;}}},_addHandlers:function(){var A=Function.createDelegate(this,this._mapClickedHandler);
GEvent.addListener(this._map,"click",A);},get_changesMade:function(){return(this._bChangesMade&&!this._bLoading);
},confirm_makeChange:function(){var A=false;if(!this._bAllowEdit){alert("You are unable to edit this map as it has already been completed...");
A=false;}else{if(!this.get_changesMade()){if(!this.get_isViewExistingMap()){this._bChangesMade=true;
A=true;}else{if(window.confirm("Are you sure you would like to edit this map.")){this._bChangesMade=true;
A=true;}else{A=false;}}}else{A=true;}}this._toggleElementsState();return A;},get_isViewExistingMap:function(){return(String.isPopulatedString(this._strMapID));
},get_isLoading:function(){return this._bLoading;},get_isContentOnMap:function(){return(this._aPoints.length>0);
},_mapClickedHandler:function(A,B){this.__nClickTimeout=fn_Global_SafeInt_Int(this.__nClickTimeout);
if(this.__nClickTimeout>0){window.clearTimeout(this.__nClickTimeout);this.__nClickTimeout=0;
this._mapDoubleClickHandler(A,B);}else{this.__nClickTimeout=window.setTimeout(Function.createDelegate(this,function(){window.clearTimeout(this.__nClickTimeout);
this.__nClickTimeout=0;this._mapSingleClickHandler(A,B);}),200);}},_mapDoubleClickHandler:function(A,B){},_mapSingleClickHandler:function(A,B){if(this._bLoading){alert("Please wait the map is still loading...");
return;}else{if(!this.confirm_makeChange()){return;}}if(B!=null&&B!="undefined"){this.add_RoutePoint(B);
}else{if(A!=null&&A!="undefined"){if(A==this._startMarker){this._startMarkerClickedHandler();
}}else{alert("Google Maps Errorc 001: invlaid arguments to _mapClickedHandler");}}},add_RoutePoint:function(A){this._aPoints[this._aPoints.length]=A;
this.plotRoute();},fnTest:function(){var Q=this._map.getMousePosition();if(this._bMouseOverRoute){var B=Number.MAX_VALUE;
var J=null;var K=[];for(var G=0;G<this._aPoints.length;G++){var H=(G<1?0:G-1);var M=G;
var O=this._aPoints[H];var L=this._aPoints[M];var D=fnJHJHTESTY(Q,O,L);K[G]=O.distanceFrom(L)+(G>0?K[G-1]:0);
if(D<B){B=D;nClosestIndex=H;}}if(nClosestIndex!=null&&this._endMarker){var N=this._aPoints[nClosestIndex];
if(N){var P=(K[nClosestIndex]+N.distanceFrom(Q));var A=GetPointAtDistance(this._routeOverlay,P);
if(A){var E=$createDiv(document.body,{"style":"text-align:right;"},true);var C=P/1000;
var I=this.get_totalDistanceAsKM();var F=$createDiv(E,{"style":""});$createImage(F,this._strStartMarkerURL);
$createSpan(F,{"value":"Distance to the start marker: "+fn_Global_FormatDistanceForUser(C),"style":"margin: 0px 0px 10px 10px; height:100%;"});
var F=$createDiv(E,{"style":""});$createImage(F,this._strEndMarkerURL);$createSpan(F,{"value":"Distance to the end marker: "+fn_Global_FormatDistanceForUser(((C-I)*-1)),"style":"margin: 0px 0px 10px 10px"});
$createDiv(E,{"value":"Total distance of exercise route: "+fn_Global_FormatDistanceForUser(I),"style":"margin: 20px 0px 20px 0px"});
this._map.openInfoWindow(A,E.get_element());}}}}else{this._map.closeInfoWindow();
}},plotRoute:function(){if(this._routeOverlay!=null){this._map.removeOverlay(this._routeOverlay);
}var D=0.5;this._routeOverlay=new GPolyline(this._aPoints,"#0000ff",6,D);this._map.addOverlay(this._routeOverlay);
GEvent.addListener(this._routeOverlay,"mouseover",Function.createDelegate(this,function(){this._routeOverlay.setStrokeStyle({"opacity":0.7});
this._bMouseOverRoute=true;this.fnTest();}));GEvent.addListener(this._routeOverlay,"mouseout",Function.createDelegate(this,function(){this._routeOverlay.setStrokeStyle({"opacity":D});
this._bMouseOverRoute=false;}));GEvent.addListener(this._routeOverlay,"click",Function.createDelegate(this,this.fnTest));
this.remove_marker(this._startMarker);this.remove_marker(this._endMarker);if(this._aPoints.length>0){var C=new GIcon(G_DEFAULT_ICON);
C.image=this._strStartMarkerURL;var A={icon:C,"title":"The start point of your map route"};
this._startMarker=new GMarker(this._aPoints[0],A);this._map.addOverlay(this._startMarker);
}if(this._aPoints.length>1){var B=new GIcon(G_DEFAULT_ICON);B.image=this._strEndMarkerURL;
var A={icon:B,"title":"The end point of your map route"};this._endMarker=new GMarker(this._aPoints[this._aPoints.length-1],A);
this._map.addOverlay(this._endMarker);}this._toggleElementsState();},clear_map:function(){Array.clear(this._aPoints);
for(var B=0;B<this._aCheckpointMarkers.length;B++){var A=this._aCheckpointMarkers[B];
this.remove_marker(A);}Array.clear(this._aCheckpointMarkers);this.plotRoute();},undo_last:function(){var A=this._aPoints.length-1;
if(A>0){Array.removeAt(this._aPoints,A);}this.plotRoute();},remove_marker:function(A){if(A!=null&&A!="undefined"){this._map.removeOverlay(A);
A=null;}},_startMarkerClickedHandler:function(){var A=confirm("Do you want to go back to where you started?");
if(A){this.add_RoutePoint(this._startMarker.getPoint());}},_toggleElementsState:function(){this._divMapLoading=CClientLib.UI.Element.parse(this._divMapLoading);
this._buttonSaving=CClientLib.UI.Element.parse(this._buttonSaving);var A=this.get_totalDistanceAsKM();
this._divTotalDistance.set_value((A>0)?"<b>Distance: "+fn_Global_FormatDistanceForUser(A)+"</b>":"");
this._divMapLoading.set_display((this.get_isLoading()?"block":"none"));var B=(this.get_isContentOnMap()&&this.get_changesMade());
this._divProcessingLinks.set_display(B?"block":"none");this._divClickMapMessage.set_display((!B&&this.get_changesMade())?"block":"none");
this._buttonSaving.set_disabled(!this.get_changesMade());},get_totalDistanceAsKM:function(){var A=0;
var E=this._aPoints.length;for(var B=0;B<E;B++){if(B>0){var D=this._aPoints[B-1];
var C=this._aPoints[B];A+=D.distanceFrom(C);}}return A/1000;},populateControl:function(A){var B=Function.createDelegate(this,function(){A=CClientLib.ServerClasses.Map.parse(A);
this.set_elementTitle(A.get_title());this.set_elementDescription(A.get_description());
this._setMapLatLngZoomAndType(A.get_defaultLat(),A.get_defaultLng(),A.get_defaultZoom(),A.get_defaultMapType());
this.buildRouteFromXML(A.get_routeXML());});CClientLib.GoogleMaps.GetGoogleMaps().SafeAddGoogleMapFunctionality(B);
},set_elementTitle:function(A){this._textBoxMapTitle.get_element().Base.setValue(A);
},set_elementDescription:function(A){this._textAreaMapDescription.get_element().Base.setValue(A);
},get_map:function(){var B=new CClientLib.ServerClasses.Map();B.set_mapID(this._strMapID);
B.set_title(this._textBoxMapTitle.get_element().Base.getValue());B.set_description(this._textAreaMapDescription.get_element().Base.getValue());
var A=this._map.getCenter();B.set_defaultLat(fn_Global_SafeString_String(A.lat()));
B.set_defaultLng(fn_Global_SafeString_String(A.lng()));B.set_defaultZoom(this._map.getZoom());
B.set_defaultMapType(this._map.getCurrentMapType().getName());B.set_totalDistance(this.get_totalDistanceAsKM());
B.set_routeXML(fn_Global_XMLObjectToString_Str(this.buildXMLFromMap()));return B;
},buildRouteFromXML:function(A){this.clear_map();if(A!=""){var H=fn_Global_XMLParseFromString_XMLObject(A);
var D=H.getElementsByTagName("point");for(var G=0;G<D.length;G++){var E=D[G];var C=fn_Global_XMLGetAttribute_String(E,"lat");
var B=fn_Global_XMLGetAttribute_String(E,"lng");var F=new GLatLng(fn_Global_SafeDecimal_Decimal(C),fn_Global_SafeDecimal_Decimal(B));
this._aPoints[G]=F;}}this.plotRoute();},buildXMLFromMap:function(){var E=fn_Global_XMLCreateBlank_XMLObject();
var C=E.getElementsByTagName("root")[0];for(var B=0;B<this._aPoints.length;B++){var A=this._aPoints[B];
var D=fn_Global_XMLCreateNode_Node(E,C,"point");fn_Global_XMLSetAttributeStr(D,"lat",A.lat());
fn_Global_XMLSetAttributeStr(D,"lng",A.lng());}return E;},_loaded:function(){var A=Function.createDelegate(this,function(){this._bLoading=false;
this._toggleElementsState();this._raiseEvent(CClientLib.MapDetails.strLoadedEventName);
});CClientLib.GoogleMaps.GetGoogleMaps().SafeAddGoogleMapFunctionality(A);},_saveButtonClicked:function(){if(this.get_map().get_title()==""){alert("Please add a map title.");
return;}var A=this.get_isViewExistingMap();if(!this._bDirectlyEditingMapList||A){this._saveOptionsModalPopup=CClientLib.Parent.GetModalPopupContainer().create_modalPopup({"_strModalPopupWidth":"600px","_strModalPopupHeight":"200px","_objSpanHeadingProperties":{"value":"Mapping Save Options"}});
var B=Function.createDelegate(this,function(F,G){if(A){$createStandardNote(G,{"value":"You are editing an existing map, how would you like to proceed?"});
var E=$createRadioButtonList("saveOptions");if(!this._bDirectlyEditingMapList){E.add_radioButton(G,true,"This is a once off map, save it but don't add it to my map list or overwrite the original map",{"value":"1"});
}E.add_radioButton(G,this._bDirectlyEditingMapList,"Overwrite my original map (NOTE - any previous staticial data will be lost)",{"value":"2"});
E.add_radioButton(G,false,"Create two seperate maps and include them both in my map list",{"value":"3"});
var D=$createDiv(G,{"style":"float:right; padding-top:10px;"});$createButton(D,{"value":"save","events":$createEvents({"click":function(){var H=fn_Global_SafeInt_Int(E.get_value());
if(H==1){this._saving(false,false);}else{if(H==2){this._saving(true,true);}else{this._saving(true,false);
}}}},this)});}else{$createStandardNote(G,{"value":"Would you also like to add this map to your map list?"});
var C=$createDiv(G,{"style":"float:right;"});$createButton(C,{"value":"yes","events":$createEvents({"click":function(){this._saving(true,true);
}},this)});$createSpan(C,{"value":"&nbsp;|&nbsp;"});$createButton(C,{"value":"no","events":$createEvents({"click":function(){this._saving(false,true);
}},this)});}});this._saveOptionsModalPopup.render_contentRaw(B,false);}else{this._saving(true,true);
}},_saving:function(B,A){this._raiseEvent(CClientLib.MapDetails.strSavingEventName);
CClientLib.Parent.GetWebServices().WSMaps_WSCreateOrUpdateMap(this.get_map(),B,A,Function.createDelegate(this,this._saved),Function.createDelegate(this,this._terminated),Function.createDelegate(this,this._failed));
if(this._bDirectlyEditingMapList){this.get_modalPopup().hide();if(this._saveOptionsModalPopup){this._saveOptionsModalPopup.hide();
}}else{if(this._saveOptionsModalPopup!=null){this._saveOptionsModalPopup=CClientLib.UI.ModalPopupWrapper.parse(this._saveOptionsModalPopup);
var C=this._saveOptionsModalPopup.get_contentDiv();C.removeChildrenFromDOM();C.set_value("loading...");
}}},_saved:function(A){var B=this.get_events().getHandler(CClientLib.MapDetails.strSavedEventName);
if(B){A=CClientLib.ServerClasses.Map.parse(A);B(this,A);}if(this._saveOptionsModalPopup!=null){this._saveOptionsModalPopup.close();
this._saveOptionsModalPopup=null;}this.get_modalPopup().close();},_terminated:function(B,A){var B=CClientLib.WSWebServiceResponseClientWrapper.parse(B);
if(B.nTerminationCode==1){CClientLib.Login.CreateLoginExpired();this.get_modalPopup().show();
return true;}return false;},_failed:function(){return false;}};CClientLib.MapDetails.registerClass("CClientLib.MapDetails",Sys.UI.Control);
CClientLib.MapDetails.strLoadedEventName="loaded";CClientLib.MapDetails.createEvent(CClientLib.MapDetails.strLoadedEventName);
CClientLib.MapDetails.strSavingEventName="saving";CClientLib.MapDetails.createEvent(CClientLib.MapDetails.strSavingEventName);
CClientLib.MapDetails.strSavedEventName="saved";CClientLib.MapDetails.createEvent(CClientLib.MapDetails.strSavedEventName);
CClientLib.MapDetails.parse=function(A){return CClientLib.MapDetails._parse(A);};
CClientLib.MapDetails.CreateMapDetails=function(B,A){B=fn_Global_SafeObject_Object(B);
B._objSpanHeadingProperties=fn_Global_ObjectAddDefultProperties(B._objSpanHeadingProperties,{"value":"Exercise Map"});
var C=CClientLib.Parent.OpenModalPopupAndRenderControl(B,CClientLib.MapDetails,A,"_nModalPopupID",false);
return CClientLib.MapDetails.parse(C);};CClientLib.MapDetails.CreateMapDetailsThumbNail=function(G,F,E,A,C){var B=CClientLib.Parent.GetClientData().get_applicationSettings().strRootURL+"Images/GoogleMaps/ThumbNails/{0}.axd";
E=fn_Global_ObjectAddDefultProperties(E,{"css":"googleMapsDSSLThumbNail","style":"","events":$createEvents({"click":function(){C=fn_Global_SafeObject_Object(C);
C._strMapID=F;CClientLib.MapDetails.CreateMapDetails(A,C);}},this)});var D=$createImage(G,String.format(B,F),E);
return D;};CClientLib.MapDetails.GridView_Create=function(B,C,A){C=fn_Global_ObjectAddDefultProperties({"_bIncrementalDataBind":false,"_objDataRowProperties":{"events":$createEvents({"click":CClientLib.MapDetails._GridView_EventOpenMapDetails},this)}});
return CClientLib.UI.GridView.GridViewStandardList(B,C,A);};CClientLib.MapDetails._GridView_EventOpenMapDetails=function(A,C){C=CClientLib.UI.GridViewEventArgs.parse(C);
var B=CClientLib.ServerClasses.Map.parse(C.get_dataItem());C.get_dataRow().disable();
CClientLib.MapDetails.CreateMapDetails({"events":$createEvents({"cancel":function(){C.get_dataRow().enable();
}},this)},{"_strMapID":B.get_mapID(),"events":$createEvents({"saved":function(){var D=C.get_gridView();
if(D!=null){D.dataBind();}}},this)});};CClientLib.MapDetails.GridView_AddColumnViewDetails=function(A){A=CClientLib.UI.GridView.parse(A);
A.add_columnAnchor({"value":"&nbsp;","style":"width:80px;"},null,{"style":"vertical-align:top;"},{"value":"View","events":$createEvents({"click":CClientLib.MapDetails._GridView_EventOpenMapDetails})});
};CClientLib.MapDetails.GridView_AddColumnThumbnail=function(A){A=CClientLib.UI.GridView.parse(A);
var B=function(D,C){C=CClientLib.UI.GridViewEventArgs.parse(C);mapObj=CClientLib.ServerClasses.Map.parse(C.get_dataItem());
CClientLib.MapDetails.CreateMapDetailsThumbNail(C.get_dataCell(),mapObj.get_mapID(),{"events":$createEvents({"click":function(){CClientLib.MapDetails._GridView_EventOpenMapDetails(A,C);
}})},{},{});};A.add_column({"value":"Thumbnail","style":"width:0px;"},null,{"style":"width:150px; vertical-align:top;"},B);
};CClientLib.MapDetails.GridView_AddColumnMapTitle=function(A){A=CClientLib.UI.GridView.parse(A);
A.add_columnBindToDataItem({"value":"Map Title","style":"width: 150px;"},null,{"style":"vertical-align:top;"},CClientLib.ServerClasses.Map.Properties.Title);
};CClientLib.MapDetails.GridView_AddColumnDistance=function(B){B=CClientLib.UI.GridView.parse(B);
var A=function(D,C){C=CClientLib.UI.GridViewEventArgs.parse(C);mapObj=CClientLib.ServerClasses.Map.parse(C.get_dataItem());
C.get_dataCell().set_value(fn_Global_FormatDistanceForUser(mapObj.get_totalDistance()));
};B.add_column({"value":"Distance","style":"width:100px;"},null,{"style":"vertical-align:top;"},A);
};CClientLib.MapDetails.GridView_AddColumnDescription=function(A){A=CClientLib.UI.GridView.parse(A);
A.add_columnBindToDataItem({"value":"Description","style":""},null,{"style":"vertical-align:top;"},CClientLib.ServerClasses.Map.Properties.Description);
};Type.registerNamespace("CClientLib");CClientLib.MapList=function(A){CClientLib.MapList.initializeBase(this,[A]);
this._bIncrementalDataBind=true;};CClientLib.MapList.prototype={initialize:function(){CClientLib.MapList.callBaseMethod(this,"initialize");
this._buildCreateNewMap();this._buildTableList();},dispose:function(){CClientLib.MapList.callBaseMethod(this,"dispose");
},_buildCreateNewMap:function(){var A=$createDiv(this.get_element(),{"style":"text-align:right;"});
var B=$createSpan(A,{"value":"Click&nbsp;"});var D=$createAnchor(A,{"value":"here"});
$addHandlers(D.get_element(),{click:function(){CClientLib.MapDetails.CreateMapDetails({},{"_strMapID":"","events":$createEvents({"saved":function(){CClientLib.Parent.GetNavigation().navigateTo_MapList({"_bIncrementalDataBind":false});
}},this)});}},this);var C=$createSpan(A,{"value":"&nbsp;to create a new map."});},_buildTableList:function(){var A=CClientLib.MapDetails.GridView_Create($createDiv(this.get_element()),{"_bIncrementalDataBind":this._bIncrementalDataBind},"You currently do not have any maps.");
A.set_dataSource(function(){return CClientLib.Parent.GetClientData().get_maps();});
CClientLib.MapDetails.GridView_AddColumnThumbnail(A);CClientLib.MapDetails.GridView_AddColumnMapTitle(A);
CClientLib.MapDetails.GridView_AddColumnDistance(A);CClientLib.MapDetails.GridView_AddColumnDescription(A);
CClientLib.MapDetails.GridView_AddColumnViewDetails(A);A.dataBind();}};CClientLib.MapList.registerClass("CClientLib.MapList",Sys.UI.Control);
CClientLib.MapList.parse=function(A){return CClientLib.MapList._parse(A);};CClientLib.MapList.CreateMapList=function(A,B){B=CClientLib.UI.Element.parse(B);
return $create(CClientLib.MapList,A,{},{},B.get_element());};Type.registerNamespace("CClientLib.UI");
CClientLib.UI.ModalPopupWrapper=function(){CClientLib.UI.ModalPopupWrapper.initializeBase(this);
this._modalPopupNumber=0;this._objDivModalPopupProperties={};this._objDivDragPanelProperties={};
this._objAnchorCancelProperties={};this._objSpanHeadingProperties={};this._objDivLoadingProperties={};
this._objDivContentProperties={};this._objModalPopupProperties={};this._objModalPopupEvents={};
this._strModalPopupWidth="";this._strModalPopupHeight="";this._nOffsetTop=0;this._strAnchorTokenID="";
this._divModalPopup=null;this._divDragPanel=null;this._anchorCancel=null;this._spanHeading=null;
this._divLoading=null;this._divContent=null;this._fnDelegateOnResize=Function.createDelegate(this,this._setContentDivSize);
};CClientLib.UI.ModalPopupWrapper.prototype={initialize:function(){CClientLib.UI.ModalPopupWrapper.callBaseMethod(this,"initialize");
if(!fn_Global_IsParent()){throw CClientLib.UI.ModalPopupContainer.ErrorContext;}this._objDivModalPopupProperties.id="modalPopup"+this._modalPopupNumber;
this._divModalPopup=$createDiv(document.body,fn_Global_ObjectAddDefultProperties(this._objDivModalPopupProperties,{"style":"overflow:hidden; position:relative; top:"+this._nOffsetTop+"px","css":"modalPopup"}));
this._objDivDragPanelProperties.id=this._divModalPopup.get_id()+"_dragPanel";this._divDragPanel=$createDiv(this._divModalPopup,fn_Global_ObjectAddDefultProperties(this._objDivDragPanelProperties,{"css":"ModalPopupDragPanel","style":"background:transparent url(images/BackgroundTransitions/blueBanner.png) repeat-x left 0px"}));
this._anchorCancel=$createAnchor(this._divDragPanel,fn_Global_ObjectAddDefultProperties(this._objAnchorCancelProperties,{"value":"Close","css":"ModalPopupCancel"}));
$addHandler(this._anchorCancel.get_element(),"click",Function.createDelegate(this,function(C){this._cancelOnClick(C);
}));this._spanHeading=$createSpan(this._divDragPanel,fn_Global_ObjectAddDefultProperties(this._objSpanHeadingProperties,{"value":"Popup window open...","css":"ModalPopupDragHeading"}));
this._divLoading=$createDiv(this._divModalPopup,fn_Global_ObjectAddDefultProperties(this._objDivLoadingProperties,{"value":"Loading...","style":"position:absolute; background-color:white;"}));
this._divContent=$createDiv(this._divModalPopup,fn_Global_ObjectAddDefultProperties(this._objDivContentProperties,{"style":"visibility:hidden; overflow-y:auto; overflow-x:hidden; position:relative;"}));
this._objModalPopupProperties.id=this._divModalPopup.get_id();this._objModalPopupProperties.PopupControlID=this._divModalPopup.get_id();
this._objModalPopupProperties.PopupDragHandleControlID=this._divDragPanel.get_id();
this._behaviourModalPopup=$create(AjaxControlToolkit.ModalPopupBehavior,fn_Global_ObjectAddDefultProperties(this._objModalPopupProperties,{"BackgroundCssClass":"modalBackground"}),null,null,$get(this._strAnchorTokenID));
this._behaviourModalPopup._backgroundElement.style.zIndex=10000+(this._modalPopupNumber*10);
this._behaviourModalPopup._foregroundElement.style.zIndex=fn_Global_SafeInt_Int(this._behaviourModalPopup._backgroundElement.style.zIndex)+1;
var B=CClientLib.Parent.GetParentComponent().get_modalPopupContainer().get_openModalPopupCount();
var A=(B*20)+"px";this._divModalPopup.style.marginTop=A;this._divModalPopup.style.marginLeft=A;
this.set_divSize(this._strModalPopupWidth,this._strModalPopupHeight);this.show();
this._fnDelegateOnResize();CClientLib.Parent.GetParentComponent().add_windowResized(this._fnDelegateOnResize);
},dispose:function(){CClientLib.Parent.GetParentComponent().remove_windowResized(this._fnDelegateOnResize);
CClientLib.Parent.GetParentComponent().get_modalPopupContainer().remove_modalPopup(this);
CClientLib.UI.ModalPopupWrapper.callBaseMethod(this,"dispose");},set_divSize:function(A,B){if(String.isPopulatedString(A)){this._divModalPopup.style.width=A;
}if(String.isPopulatedString(B)){this._divModalPopup.style.height=B;}this._setContentDivSize();
},_setContentDivSize:function(){var B=this._divModalPopup.get_element().offsetHeight-70;
if(B>0){var A=B+"px";this._divContent.style.height=A;}},get_modalPopupNumber:function(){return this._modalPopupNumber;
},get_modalPopup:function(){return this._behaviourModalPopup;},get_divDragPanel:function(){return this._divDragPanel;
},get_sapnHeading:function(){return this._spanHeading;},render_contentRaw:function(A,B){this._divLoading.set_display("block");
this._divContent.style.visibility="hidden";this._divLoading.set_value("Loading... (rendering)");
var C=null;if(Type.isFunction(A)){C=A(this._behaviourModalPopup,this._divContent.get_element());
}if(!fn_Global_SafeBool_Bool(B)){this.rendering_complete();}return C;},render_contentControl:function(type,properties,bDelayRenderingComplete){var fn_renderControl=Function.createDelegate(this,function(){type=eval(type.getName());
var control=$create(type,properties,{},{},this._divContent.get_element());return control;
});var renderedControl=this.render_contentRaw(fn_renderControl,bDelayRenderingComplete);
renderedControl=type.parse(renderedControl);this.add_close(function(){renderedControl.dispose();
});return renderedControl;},rendering_complete:function(){this._divLoading.set_display("none");
this.showContentDiv();},showContentDiv:function(){this._divContent.style.visibility="visible";
},get_contentDiv:function(){return this._divContent;},_cancelOnClick:function(A){A=Sys.UI.DomEvent.parse(A);
this._raiseEvent(CClientLib.UI.ModalPopupWrapper.strCancelEventName);this.close();
},hide:function(){this._behaviourModalPopup.hide();},show:function(){this._behaviourModalPopup.show();
},close:function(){this.hide();this._raiseEvent(CClientLib.UI.ModalPopupWrapper.strCloseEventName);
Sys.Application.removeDisposableObject(this._behaviourModalPopup);CClientLib.UI.Element.RemoveRawElementFromDOM(CClientLib.UI.Element.parse(this._divModalPopup).get_element());
this.dispose();}};CClientLib.UI.ModalPopupWrapper.registerClass("CClientLib.UI.ModalPopupWrapper",Sys.Component);
CClientLib.UI.ModalPopupWrapper.strCancelEventName="cancel";CClientLib.UI.ModalPopupWrapper.createEvent(CClientLib.UI.ModalPopupWrapper.strCancelEventName);
CClientLib.UI.ModalPopupWrapper.strCloseEventName="close";CClientLib.UI.ModalPopupWrapper.createEvent(CClientLib.UI.ModalPopupWrapper.strCloseEventName);
CClientLib.UI.ModalPopupContainer=function(){CClientLib.UI.ModalPopupContainer.initializeBase(this);
this._nModalPopupCounter=0;this._arrayOpenModalPopups=[];this._anchorToken;};CClientLib.UI.ModalPopupContainer.prototype={initialize:function(){CClientLib.UI.ModalPopupContainer.callBaseMethod(this,"initialize");
if(!fn_Global_IsParent()){throw CClientLib.UI.ModalPopupContainer.ErrorContext;}this._anchorToken=$createAnchor(document.body,{"display":"none","id":"modalPopupTokenAnchor"});
},dispose:function(){CClientLib.UI.ModalPopupContainer.callBaseMethod(this,"dispose");
},create_modalPopup:function(A){this._nModalPopupCounter=this._nModalPopupCounter+1;
A._modalPopupNumber=this._nModalPopupCounter;A._strAnchorTokenID=this._anchorToken.get_id();
var B=$create(CClientLib.UI.ModalPopupWrapper,A);this._arrayOpenModalPopups[this._arrayOpenModalPopups.length]=B;
return B;},remove_modalPopup:function(C){C=CClientLib.UI.ModalPopupWrapper.parse(C);
for(var B=0;B<this._arrayOpenModalPopups.length;B++){var A=CClientLib.UI.ModalPopupWrapper.parse(this._arrayOpenModalPopups[B]);
if(C.get_modalPopupNumber()==A.get_modalPopupNumber()){Array.removeAt(this._arrayOpenModalPopups,B);
break;}}},close_allOpenModalPopups:function(){while(this._arrayOpenModalPopups.length>0){this._arrayOpenModalPopups[this._arrayOpenModalPopups.length-1].close();
}},get_openModalPopupCount:function(){return this._arrayOpenModalPopups.length;},get_modalPopupByID:function(A){for(var B=0;
B<this._arrayOpenModalPopups.length;B++){var C=this._arrayOpenModalPopups[B];if(C.get_modalPopupNumber()==A){return C;
}}return null;}};CClientLib.UI.ModalPopupContainer.registerClass("CClientLib.UI.ModalPopupContainer",Sys.Component);
CClientLib.UI.ModalPopupContainer.ErrorContext=Error.create("The modal popup can only be created from the context of the parent window");
CClientLib.UI.ModalPopupWrapper.parse=function(A){return CClientLib.UI.ModalPopupWrapper._parse(A);
};Type.registerNamespace("CClientLib");CClientLib.PersonalProfiles=function(A){CClientLib.PersonalProfiles.initializeBase(this,[A]);
this._strUserID="";this._nActiveTabIndex=0;this._strActiveProfileID="";this._user={};
this._objPropertiesBehaviourTextBoxNumber={"_bAllowDecimal":true,"_bDisplayValueIfZero":false};
this._objPropertiesStandardProperties={"style":"width:45px; margin-right:5px; text-align:center;"};
this._profileCollection=null;this._objActiveProfile=null;this._divPage=null;this._divProfilesList=null;
this._divProfileDetail=null;this._divGridViewProfiles=null;this._divDetailsSubHeading=null;
this._divDetailsPageTabs=null;this._divDetailsGeneral=null;this._divDetailsGirths=null;
this._divDetailsFitnessTests=null;this._divDetailsPictures=null;this._divDetailsPageProcess=null;
this._divProfileDate=null;this._textareaProfileNotes=null;this._textboxWeight=null;
this._spanWeightUnit=null;this._textboxHeight=null;this._spanHeightUnit=null;this._textboxNeck=null;
this._spanNeckUnit=null;this._textboxChest=null;this._spanChestUnit=null;this._textboxWaist=null;
this._spanWaistUnit=null;this._textboxHips=null;this._spanHipsUnit=null;this._textboxArmLeft=null;
this._spanArmLeftUnit=null;this._textboxArmRight=null;this._spanArmRightUnit=null;
this._textboxThighLeft=null;this._spanThighLeftUnit=null;this._textboxThighRight=null;
this._spanThighRightUnit=null;this._textboxCalfLeft=null;this._spanCalfLeftUnit=null;
this._textboxCalfRight=null;this._spanCalfRightUnit=null;this.objFileUploader=null;
this._buttonDetailsSave=null;this._arrayDetailsValidationFunctions=[];this._controlDetailsTabsContainer=null;
this._tabPanelDetailsGeneral=null;this._tabPanelDetailsGirths=null;this._tabPanelDetailsFitnessTests=null;
this._tabPanelDetailsPictures=null;};CClientLib.PersonalProfiles.prototype={initialize:function(){CClientLib.PersonalProfiles.callBaseMethod(this,"initialize");
this._user=CClientLib.Parent.GetClientData().get_currentUser();this._strUserID=this._user.get_userID();
this._divPage=this.get_element();this._divProfilesList=$createDiv(this._divPage);
this._divProfileDetail=$createDiv(this._divPage);this._createProfilesList();this._createDetailsTableWrapper();
this._createDetailsTabs();this._createDetailsGeneral();this._createDetailsGirths();
this._createDetailsFitnessTests();this._createDetailsPictures();this._createDetailsProcessingControl();
var A=Function.createDelegate(this,function(){this._controlDetailsTabsContainer.set_activeTabIndex(fn_Global_SafeInt_Int(this._nActiveTabIndex));
});CClientLib.Canvas.GetCanvas().add_canvasLoad(A);CClientLib.Parent.GetWebServices().WSProfiles_WSGetProfileList(Function.createDelegate(this,this.load_profileCollection));
this.view_toggle(true);},dispose:function(){CClientLib.PersonalProfiles.callBaseMethod(this,"dispose");
},_createProfilesList:function(){var D=$createDiv(this._divProfilesList,{"style":"text-align:right;"});
var B=$createSpan(D,{"value":"Click&nbsp;"});var A=$createAnchor(D,{"value":"here","events":$createEvents({"click":function(){this.view_profileDetail("");
}},this)});var C=$createSpan(D,{"value":"&nbsp;to create a new personal profile."});
this._divGridViewProfiles=$createDiv(this._divProfilesList);$createSpan(this._divGridViewProfiles,{"value":"loading personal profiles..."});
},_createDetailsTableWrapper:function(){$createStandardNote(this._divProfileDetail,{"value":"Personal Profile Details"});
this._divDetailsSubHeading=$createDiv(this._divProfileDetail,{"style":"float:right;"});
this._divDetailsPageTabs=$createDiv(this._divProfileDetail,{"style":"vertical-align:top;"});
this._divDetailsPageProcess=$createDiv(this._divProfileDetail,{"style":"height:30px; text-align:right;"});
},_createDetailsTabs:function(){this._controlDetailsTabsContainer=$createTabContainer(this._divDetailsPageTabs,"PersonalProfilesTabPanel");
var D=this._controlDetailsTabsContainer.add_tabPanel("General");var B=this._controlDetailsTabsContainer.add_tabPanel("Girths");
var A=this._controlDetailsTabsContainer.add_tabPanel("Fitness Tests");var C=this._controlDetailsTabsContainer.add_tabPanel("Pictures");
var E=Function.createDelegate(this,function(){this._controlDetailsTabsContainer.render(0);
});CClientLib.Canvas.GetCanvas().add_canvasLoad(E);this._tabPanelDetailsGeneral=B.controlTabPanel;
this._tabPanelDetailsGirths=B.controlTabPanel;this._tabPanelDetailsFitnessTests=A.controlTabPanel;
this._tabPanelDetailsPictures=C.controlTabPanel;this._divDetailsGeneral=D.divBody;
this._divDetailsGirths=B.divBody;this._divDetailsFitnessTests=A.divBody;this._divDetailsPictures=C.divBody;
},_createDetailsGeneral:function(){var B=$createTable(this._divDetailsGeneral,{"style":"text-align:top;"});
var C=$createRowInDetailsTable(B,{},{},{"value":"Profile Date:"},{},{},{});this._divProfileDate=$createDiv(C.cellValue,{"value":""});
var E=$createRowInDetailsTable(B,{},{},{"value":"Profile Notes:"},{},{},{});this._textareaProfileNotes=$createTextareaWaterMark(E.cellValue,"",{"style":"width:400px; height:100px;"});
var D=$createRowInDetailsTable(B,{},{},{"value":"Weight:"},{},{},{});this._textboxWeight=$createTextboxNumber(D.cellValue,this._objPropertiesStandardProperties,this._objPropertiesBehaviourTextBoxNumber);
this._spanWeightUnit=$createSpan(D.cellValue);var A=$createRowInDetailsTable(B,{},{},{"value":"Height:"},{},{},{});
this._textboxHeight=$createTextboxNumber(A.cellValue,this._objPropertiesStandardProperties,this._objPropertiesBehaviourTextBoxNumber);
this._spanHeightUnit=$createSpan(A.cellValue);},_createDetailsGirths:function(){this._user=CClientLib.ServerClasses.User.parse(this._user);
var K=this._tabPanelDetailsGirths.get_tabIndex();var G=$createTable(this._divDetailsGirths,{"style":"vertical-align:top;"});
var A=$createRowInDetailsTable(G,{},{},{"value":"Neck:"},{},{},{});this._textboxNeck=$createTextboxNumber(A.cellValue,this._objPropertiesStandardProperties,this._objPropertiesBehaviourTextBoxNumber);
this._spanNeckUnit=$createSpan(A.cellValue);var F=$createRowInDetailsTable(G,{},{},{"value":"Chest:"},{},{},{});
this._textboxChest=$createTextboxNumber(F.cellValue,this._objPropertiesStandardProperties,this._objPropertiesBehaviourTextBoxNumber);
this._spanChestUnit=$createSpan(F.cellValue);var J=$createRowInDetailsTable(G,{},{},{"value":"Waist:"},{},{},{});
this._textboxWaist=$createTextboxNumber(J.cellValue,this._objPropertiesStandardProperties,this._objPropertiesBehaviourTextBoxNumber);
this._spanWaistUnit=$createSpan(J.cellValue);var L=$createRowInDetailsTable(G,{},{},{"value":"Hips:"},{},{},{});
this._textboxHips=$createTextboxNumber(L.cellValue,this._objPropertiesStandardProperties,this._objPropertiesBehaviourTextBoxNumber);
this._spanHipsUnit=$createSpan(L.cellValue);var I=$createRowInDetailsTable(G,{},{},{"value":"Left Arm:"},{},{},{});
this._textboxArmLeft=$createTextboxNumber(I.cellValue,this._objPropertiesStandardProperties,this._objPropertiesBehaviourTextBoxNumber);
this._spanArmLeftUnit=$createSpan(I.cellValue);var B=$createRowInDetailsTable(G,{},{},{"value":"Right Arm:"},{},{},{});
this._textboxArmRight=$createTextboxNumber(B.cellValue,this._objPropertiesStandardProperties,this._objPropertiesBehaviourTextBoxNumber);
this._spanArmRightUnit=$createSpan(B.cellValue);var H=$createRowInDetailsTable(G,{},{},{"value":"Left Thigh:"},{},{},{});
this._textboxThighLeft=$createTextboxNumber(H.cellValue,this._objPropertiesStandardProperties,this._objPropertiesBehaviourTextBoxNumber);
this._spanThighLeftUnit=$createSpan(H.cellValue);var E=$createRowInDetailsTable(G,{},{},{"value":"Right Thigh:"},{},{},{});
this._textboxThighRight=$createTextboxNumber(E.cellValue,this._objPropertiesStandardProperties,this._objPropertiesBehaviourTextBoxNumber);
this._spanThighRightUnit=$createSpan(E.cellValue);var C=$createRowInDetailsTable(G,{},{},{"value":"Left Calf:"},{},{},{});
this._textboxCalfLeft=$createTextboxNumber(C.cellValue,this._objPropertiesStandardProperties,this._objPropertiesBehaviourTextBoxNumber);
this._spanCalfLeftUnit=$createSpan(C.cellValue);var D=$createRowInDetailsTable(G,{},{},{"value":"Right Calf:"},{},{},{});
this._textboxCalfRight=$createTextboxNumber(D.cellValue,this._objPropertiesStandardProperties,this._objPropertiesBehaviourTextBoxNumber);
this._spanCalfRightUnit=$createSpan(D.cellValue);},_createDetailsFitnessTests:function(){this._divDetailsFitnessTests.set_value("Under construction...");
},_createDetailsPictures:function(){this.objFileUploader=$createFileUploader(this._divDetailsPictures,{},"Profile","");
},_createDetailsProcessingControl:function(){this._buttonDetailsSave=$createButton(this._divDetailsPageProcess,{"value":"save","events":$createEvents({"click":this._savePersonalProfile},this)});
},load_profileCollection:function(A){A=CClientLib.ServerClasses.ProfileCollection.parse(A);
this._profileCollection=A;this._divGridViewProfiles=CClientLib.UI.Element.parse(this._divGridViewProfiles);
this._divGridViewProfiles.removeChildrenFromDOM();var B=function(E,F){F=CClientLib.UI.GridViewEventArgs.parse(F);
var D=CClientLib.ServerClasses.Profile.parse(F.get_dataItem());this.view_profileDetail(D.get_profileID());
};var C=CClientLib.UI.GridView.GridViewStandardList($createDiv(this._divGridViewProfiles),{"_objDataRowProperties":{"events":$createEvents({"click":B},this)}},"You currently do not have any personal profiles.");
C.set_dataSource(Function.createDelegate(this,function(){return this._profileCollection;
}));C.add_columnDate({"value":"Profile Date","style":"width: 200px"},null,{"style":"width:200px"},CClientLib.ServerClasses.Profile.Properties.ProfileDate);
C.add_columnBindToDataItem({"value":"Notes","style":""},null,{"style":""},CClientLib.ServerClasses.Profile.Properties.ProfileNotes);
C.add_columnAnchor({"value":"&nbsp;","style":"width:80px;"},null,{"style":"width:60px;"},{"value":"View","events":$createEvents({"click":B},this)});
C.dataBind();if(String.isPopulatedString(this._strActiveProfileID)){this.view_profileDetail(this._strActiveProfileID);
}},view_toggle:function(A){if(A){this._divProfilesList.set_display("block");this._divProfileDetail.set_display("none");
this._objActiveProfile=null;}else{this._divProfilesList.set_display("none");this._divProfileDetail.set_display("block");
}},view_profileDetail:function(B){this._user=CClientLib.ServerClasses.User.parse(this._user);
this._divDetailsSubHeading=CClientLib.UI.Element.parse(this._divDetailsSubHeading);
this._divDetailsSubHeading.removeChildrenFromDOM();this._profileCollection=CClientLib.ServerClasses.ProfileCollection.parse(this._profileCollection);
this._objActiveProfile=null;if(!String.isPopulatedString(B)){this._objActiveProfile=new CClientLib.ServerClasses.Profile();
this._objActiveProfile.set_unitsType(CClientLib.Parent.GetClientData().get_currentUser().get_unitsType());
this._objActiveProfile.set_profileDate(new Date());this._objActiveProfile.set_unitsType(this._user.get_unitsType());
$createSpan(this._divDetailsSubHeading,{"value":"[ Creating a new profile ]","style":"color:green"});
}else{this._objActiveProfile=this._profileCollection.get_profileByProfileID(B);if(Type.getTypeName(this._objActiveProfile)!="CClientLib.ServerClasses.Profile"){this._strActiveProfileID="";
alert("Requested personal profile not found...");this.view_toggle(true);return;}$createSpan(this._divDetailsSubHeading,{"value":"Profile created on "+CClientLib.Type.Date.format(this._objActiveProfile.get_profileDate(),"dddd dd/MMM/yyyy")});
}this._objActiveProfile=CClientLib.ServerClasses.Profile.parse(this._objActiveProfile);
this._divProfileDate.set_value(CClientLib.Type.Date.format(this._objActiveProfile.get_profileDate(),"dddd dd /MMM/yyyy"));
this._textareaProfileNotes.set_value(this._objActiveProfile.get_profileNotes());this._textboxWeight.get_element().Number.set_numberValue(this._objActiveProfile.get_weight());
this._textboxHeight.get_element().Number.set_numberValue(this._objActiveProfile.get_height());
this._textboxNeck.get_element().Number.set_numberValue(this._objActiveProfile.get_girthNeck());
this._textboxChest.get_element().Number.set_numberValue(this._objActiveProfile.get_girthChest());
this._textboxWaist.get_element().Number.set_numberValue(this._objActiveProfile.get_girthWaist());
this._textboxHips.get_element().Number.set_numberValue(this._objActiveProfile.get_girthHips());
this._textboxArmLeft.get_element().Number.set_numberValue(this._objActiveProfile.get_girthLeftArm());
this._textboxArmRight.get_element().Number.set_numberValue(this._objActiveProfile.get_girthRightArm());
this._textboxThighLeft.get_element().Number.set_numberValue(this._objActiveProfile.get_girthLeftThigh());
this._textboxThighRight.get_element().Number.set_numberValue(this._objActiveProfile.get_girthRightThigh());
this._textboxCalfLeft.get_element().Number.set_numberValue(this._objActiveProfile.get_girthLeftCalf());
this._textboxCalfRight.get_element().Number.set_numberValue(this._objActiveProfile.get_girthRightCalf());
this._strActiveProfileID=this._objActiveProfile.get_profileID();var C="";var A="";
var D=this._objActiveProfile.get_unitsType().toLowerCase();if(D=="metric"){C="kg";
A="cm";}else{if(D=="imperial"){C="pounds";A="inches";}}this._spanWeightUnit.set_value(C);
this._spanHeightUnit.set_value(A);this._spanNeckUnit.set_value(A);this._spanChestUnit.set_value(A);
this._spanWaistUnit.set_value(A);this._spanHipsUnit.set_value(A);this._spanArmLeftUnit.set_value(A);
this._spanArmRightUnit.set_value(A);this._spanThighLeftUnit.set_value(A);this._spanThighRightUnit.set_value(A);
this._spanCalfLeftUnit.set_value(A);this._spanCalfRightUnit.set_value(A);this._strActiveProfileID=this._objActiveProfile.get_profileID();
this.objFileUploader.set_GUID(this._objActiveProfile.get_profileID());this.view_toggle(false);
},_enableProcessControl:function(){this._buttonDetailsSave.set_disabled(false);},_createValidationObject:function(C,B,A){return{"bIsValid":C,"strErrorMessage":B,"nTabIndex":A};
},get_newProfile:function(){var A=new CClientLib.ServerClasses.Profile();A.set_profileID(this._strActiveProfileID);
A.set_profileNotes(this._textareaProfileNotes.get_value());A.set_weight(this._textboxWeight.get_element().Number.get_numberValue());
A.set_height(this._textboxHeight.get_element().Number.get_numberValue());A.set_girthNeck(this._textboxNeck.get_element().Number.get_numberValue());
A.set_girthChest(this._textboxChest.get_element().Number.get_numberValue());A.set_girthWaist(this._textboxWaist.get_element().Number.get_numberValue());
A.set_girthHips(this._textboxHips.get_element().Number.get_numberValue());A.set_girthLeftArm(this._textboxArmLeft.get_element().Number.get_numberValue());
A.set_girthRightArm(this._textboxArmRight.get_element().Number.get_numberValue());
A.set_girthLeftThigh(this._textboxThighLeft.get_element().Number.get_numberValue());
A.set_girthRightThigh(this._textboxThighRight.get_element().Number.get_numberValue());
A.set_girthLeftCalf(this._textboxCalfLeft.get_element().Number.get_numberValue());
A.set_girthRightCalf(this._textboxCalfRight.get_element().Number.get_numberValue());
A.set_unitsType(CClientLib.ServerClasses.Profile.parse(this._objActiveProfile).get_unitsType());
if(!String.isPopulatedString(A.get_profileID())){A.set_profileID(this.objFileUploader.get_GUID());
}return A;},_savePersonalProfile:function(A){if(this.objFileUploader.get_state()=="uploading"){if(!window.confirm("You still have a picture uploading...\n\nIf you save now your picture may not be saved correctly. Do you want to contine?")){return;
}}var B=this.get_newProfile();this._buttonDetailsSave.set_disabled(true);var E=null;
var C=Function.createDelegate(this,function(F){this.load_profileCollection(F);this._buttonDetailsSave.set_disabled(false);
});var D=Function.createDelegate(this,function(F,G){alert("Unable to save all of the personal profile.\n\nReason: "+G);
this._buttonDetailsSave.set_disabled(false);});CClientLib.Parent.GetWebServices().WSProfiles_WSInsertOrEdit(B,C,D,E);
}};CClientLib.PersonalProfiles.registerClass("CClientLib.PersonalProfiles",Sys.UI.Control);
CClientLib.PersonalProfiles.CreatePersonalProfiles=function(C,A){A=CClientLib.UI.Element.parse(A);
var B=$create(CClientLib.PersonalProfiles,C,{},{},A.get_element());return B;};Type.registerNamespace("CClientLib");
CClientLib.PersonalSettings=function(A){CClientLib.PersonalSettings.initializeBase(this,[A]);
this._strUserID="";this._nActiveTabIndex=0;this._user={};this._bEditingExistingUser=false;
this._divPageHeader=null;this._divSubHeading=null;this._divPageTabs=null;this._divPageProcess=null;
this._divPersonal=null;this._divSecurity=null;this._divMapping=null;this._divAssociations=null;
this._textboxFirstName=null;this._textboxLastName=null;this._textboxEmail=null;this._radioButtonListSex=$createRadioButtonList("Sex");
this._controlDOB=null;this._radioButtonListUnits=$createRadioButtonList("Units");
this._sddlDefaultWeightUnit=null;this._sddlDefaultDistanceUnit=null;this._radioButtonListFirstDayOfWeek=$createRadioButtonList("FirstDayOfWeek");
this._tablePasswordAndSecurityQuestion=null;this._rowCheckBoxToggleSecurityQuestion=null;
this._rowPreviousPassword=null;this._checkboxUpdateSecurityInformaion=null;this._textboxUserName=null;
this._textboxPasswordPrevious=null;this._textboxPassword=null;this._textboxPasswordReEnter=null;
this._textAreaSecuritQuestion=null;this._textboxSecurityAnswer=null;this._radioButtonListUserType=$createRadioButtonList("UserType");
this._map=null;this._cellLatValue=null;this._cellLngValue=null;this._cellZoomValue=null;
this._divMapCanvas=null;this._bTempDisplayUserAssociations=false;this._buttonSave=null;
this._arrayValidationFunctions=[];this._controlTabsContainer=null;this._tabPanelPersonal=null;
this._tabPanelSecurity=null;this._tabPanelMapping=null;this._tabPanelAssociation=null;
this._fnDelateOnResize=Function.createDelegate(this,this._setSize);};CClientLib.PersonalSettings.prototype={initialize:function(){CClientLib.PersonalSettings.callBaseMethod(this,"initialize");
this._createTableWrapper();this._createTabs();this._createPersonal();this._createSecurity();
this._createMappingElements();this._createUserAssociations();this._createProcessingControl();
var A=Function.createDelegate(this,function(){this._controlTabsContainer.set_activeTabIndex(fn_Global_SafeInt_Int(this._nActiveTabIndex));
});CClientLib.Canvas.GetCanvas().add_canvasLoad(A);this._loadUser(this._strUserID);
this._setSize();CClientLib.Parent.GetParentComponent().add_windowResized(this._fnDelateOnResize);
},dispose:function(){CClientLib.Parent.GetParentComponent().remove_windowResized(this._fnDelateOnResize);
CClientLib.PersonalSettings.callBaseMethod(this,"dispose");},_setSize:function(){var A=CClientLib.Parent.GetParentComponent().get_parentWindowHeight();
this._divMapCanvas.style.height=(A-250)+"px";CClientLib.GoogleMaps.GetGoogleMaps().check_mapSize(this._map);
},_createTableWrapper:function(){this._divPageHeader=$createStandardNote(this.get_element(),{"value":""});
this._divSubHeading=$createDiv(this.get_element(),{"style":"float:right"});this._divPageTabs=$createDiv(this.get_element(),{"style":"vertical-align:top;"});
this._divPageProcess=$createDiv(this.get_element(),{"style":"height:30px; text-align:right;"});
},_loadUser:function(A){this._strUserID=A;this._user=null;var C=CClientLib.Parent.GetClientData().get_currentUser();
if(C==null){this._user=new CClientLib.ServerClasses.User();this._strUserID="";this._bEditingExistingUser=false;
var B=CClientLib.GoogleLoader.GetClientPosition();if(B!=null){this._user.set_mappingDefaultLat(fn_Global_SafeString_String(B.latitude));
this._user.set_mappingDefaultLng(fn_Global_SafeString_String(B.longitude));this._user.set_mappingDefaultZoom(12);
}}else{if(!String.isPopulatedString(this._strUserID)||this._strUserID==C.get_userID()){this._user=C;
this._strUserID=C.get_userID();this._bEditingExistingUser=true;}else{alert("Error: Not yet implemented in personal settings...");
}}this._user=CClientLib.ServerClasses.User.parse(this._user);this._buttonSave.set_value(this._bEditingExistingUser?"Save":"Create Account");
this._divPageHeader.set_value(this._bEditingExistingUser?"Personal Settings":"Creating a New User Account");
this._divSubHeading.set_value(this._bEditingExistingUser?"":"[&nbsp;<span style='color:green'>Creating a new user account</span>&nbsp;]");
this._textboxFirstName.set_value(this._user.get_firstName());this._textboxLastName.set_value(this._user.get_lastName());
this._textboxEmail.set_value(this._user.get_email());this._radioButtonListSex.set_value(this._user.get_sex());
this._controlDOB.set_selectedDate((CClientLib.Type.Date.isDate(this._user.get_dob())?this._user.get_dob():new Date("1/1/1970")));
this._radioButtonListUnits.set_value(this._user.get_unitsType());CClientLib.UI.SDDL.parse(this._sddlDefaultWeightUnit).set_SelectedItemByValue(this._user.get_defaultWeightUnitID());
CClientLib.UI.SDDL.parse(this._sddlDefaultDistanceUnit).set_SelectedItemByValue(this._user.get_defaultDistanceUnitID());
this._radioButtonListFirstDayOfWeek.set_value(this._user.get_weekStartsOn());this._textboxUserName=CClientLib.UI.Element.parse(this._textboxUserName);
this._textboxUserName.set_value(this._user.get_userName());this._textboxUserName.set_textboxAsLabel(this._bEditingExistingUser);
this._radioButtonListUserType.set_value(this._user.get_userRoleTitle());this._textAreaSecuritQuestion.set_value(this._user.get_securityQuestion());
this._checkboxUpdateSecurityInformaion.get_element().checked=!this._bEditingExistingUser;
this._rowCheckBoxToggleSecurityQuestion.set_style(this._bEditingExistingUser?"visibility:visible;":"visibility:hidden;");
this._updatePasswordTableByCheckboxState();this.set_userMappingProperties(this._user.get_mappingDefaultLat(),this._user.get_mappingDefaultLng(),this._user.get_mappingDefaultZoom());
},_createTabs:function(){this._controlTabsContainer=$createTabContainer(this._divPageTabs,"personalSettingsTabPanel");
var A=this._controlTabsContainer.add_tabPanel("Personal");var D=this._controlTabsContainer.add_tabPanel("Security");
var B=this._controlTabsContainer.add_tabPanel("Mapping");var C=Function.createDelegate(this,function(){this._controlTabsContainer.render(0);
});CClientLib.Canvas.GetCanvas().add_canvasLoad(C);this._tabPanelPersonal=A.controlTabPanel;
this._tabPanelSecurity=D.controlTabPanel;this._tabPanelMapping=B.controlTabPanel;
this._divPersonal=A.divBody;this._divSecurity=D.divBody;this._divMapping=B.divBody;
this._tabPanelMapping.add_click(Function.createDelegate(this,function(){window.setTimeout(Function.createDelegate(this,function(){this._tabPanelMapClicked();
}),0);}));},_createPersonal:function(){var M=this._tabPanelPersonal.get_tabIndex();
var B=$createTable(this._divPersonal,{"style":"vertical-align:top;"});var K=$createRowInDetailsTable(B,{},{},{"value":"First Name:"},{},{},{});
this._textboxFirstName=$createTextbox(K.cellValue,{});var H=$createRowInDetailsTable(B,{},{},{"value":"Last Name:"},{},{},{});
this._textboxLastName=$createTextbox(H.cellValue,{});var F=$createRowInDetailsTable(B,{},{},{"value":"Email:"},{},{},{});
this._textboxEmail=$createTextbox(F.cellValue,{"style":"width: 300px;"});var A=Function.createDelegate(this,function(){var S=String.isPopulatedString(this._textboxEmail.get_value())?this._textboxEmail.get_value():"";
var R="";var Q="";var P=S.indexOf("@");if(P>0&&((P+1)<S.length)){Q=S.substr(P+1,S.length-P+1);
}var O=Q.indexOf(".");if(((!String.isPopulatedString(Q))||(O<1||((O+1)>=Q.length))||(Q.indexOf("@")!=-1))){R=" * Invalid email address";
}F.cellErrorMessage.set_value(R);return this._createValidationObject((R==""),R,M);
});$addHandlers(this._textboxEmail.get_element(),{"blur":A},this);Array.add(this._arrayValidationFunctions,A);
var E=$createRowInDetailsTable(B,{},{},{"value":"Sex:"},{},{},{});this._radioButtonListSex=$createRadioButtonList("Sex");
this._radioButtonListSex.add_radioButton(E.cellValue,false,"Male",{"value":"Male"});
this._radioButtonListSex.add_radioButton(E.cellValue,false,"Female",{"value":"Female"});
var G=$createRowInDetailsTable(B,{},{},{"value":"DOB:"},{},{},{});var I=$createDatePicker(G.cellValue,{},{},{},{});
this._controlDOB=I.controlCalendar;this._controlDOB.show();this._controlDOB.hide();
var L=Function.createDelegate(this._controlDOB,function(){this._today.style.display="none";
var O=this.get_selectedDate();if(O==null){this.set_selectedDate(new Date("1/1/1970"));
}this._switchMode("years",false);});this._controlDOB.add_shown(L);var D=$createRowInDetailsTable(B,{},{},{"value":"Measurement Units:"},{},{},{});
this._radioButtonListUnits=$createRadioButtonList("Units");this._radioButtonListUnits.add_radioButton(D.cellValue,false,"Metric (kilograms, meters etc)",{"value":"Metric"});
this._radioButtonListUnits.add_radioButton(D.cellValue,false,"Imperial (pounds, miles etc)",{"value":"Imperial"});
var N=$createRowInDetailsTable(B,{},{},{"value":"Default Weight Unit:"},{},{},{});
this._sddlDefaultWeightUnit=CClientLib.UI.SDDL.CreateUnitWeight($createTableCell($createTableRow($createTable(N.cellValue))),{"_nTextBoxWidth":100});
var C=$createRowInDetailsTable(B,{},{},{"value":"Default Distance Unit:"},{},{},{});
this._sddlDefaultDistanceUnit=CClientLib.UI.SDDL.CreateUnitDistance($createTableCell($createTableRow($createTable(C.cellValue))),{"_nTextBoxWidth":100});
var J=$createRowInDetailsTable(B,{},{},{"value":"Week Starts On:"},{},{},{});this._radioButtonListFirstDayOfWeek.add_radioButton(J.cellValue,false,"Sunday",{"value":"Sunday"});
this._radioButtonListFirstDayOfWeek.add_radioButton(J.cellValue,false,"Monday",{"value":"monday"});
},_createSecurity:function(){var E=this._tabPanelSecurity.get_tabIndex();var F={"style":"width:130px;"};
var J=$createTable(this._divSecurity,{"style":"vertical-align:top;"});var L=Function.createDelegate(this,function(S,T){if(!this.update_securityInformation()){return this._createValidationObject(true,"",E);
}var U="";var V=S.get_value();if(V==""){U=" * Field can't be blank.";}else{if(V.length<5){U=" * Field must contain 5 characters or more.";
}}T.set_value(U);return this._createValidationObject((U==""),U,E);});var H=$createRowInDetailsTable(J,{},F,{"value":"User Name:"},{},{},{});
this._textboxUserName=$createTextbox(H.cellValue);var N=Function.createDelegate(this,function(){return L(this._textboxUserName,H.cellErrorMessage);
});$addHandler(this._textboxUserName.get_element(),"blur",N);Array.add(this._arrayValidationFunctions,N);
var O=$createRowInDetailsTable(J,{},F,{"value":"User Type:"},{},{},{});CClientLib.Type.Enum.ForEach(CClientLib.ServerEnums.User.Roles,Function.createDelegate(this,function(S){S=CClientLib.Type.Enum.parse(S);
this._radioButtonListUserType.add_radioButton(O.cellValue,false,S.get_string(),{"value":S.get_string()});
}));this._rowCheckBoxToggleSecurityQuestion=$createTableRow(J,{"style":"height: 20px;"});
var I=$createTableCell(this._rowCheckBoxToggleSecurityQuestion,{"colSpan":3});$createBR(I);
var K=$createCheckBoxWithTitle(I,{},{},{"value":"Edit security information"},{},{"value":false},{});
this._checkboxUpdateSecurityInformaion=K.checkbox;this._tablePasswordAndSecurityQuestion=$createTable($createTableCell($createTableRow(J,{"style":"margin-bottom:50px;"}),{"colSpan":"3"}));
var G=$createRowInDetailsTable(this._tablePasswordAndSecurityQuestion,{},F,{"value":"Security Question:"},{},{},{});
this._textAreaSecuritQuestion=$createTextarea(G.cellValue,{});this._textAreaSecuritQuestion.get_element().style.width="200px";
this._textAreaSecuritQuestion.get_element().style.height="25px";var R=Function.createDelegate(this,function(){return L(this._textAreaSecuritQuestion,G.cellErrorMessage);
});$addHandlers(this._textAreaSecuritQuestion.get_element(),{"blur":R},this);Array.add(this._arrayValidationFunctions,R);
var Q=$createRowInDetailsTable(this._tablePasswordAndSecurityQuestion,{"style":"margin-bottom:30px;"},F,{"value":"Security Answer:"},{},{},{});
this._textboxSecurityAnswer=$createTextbox(Q.cellValue,{});var P=Function.createDelegate(this,function(){return L(this._textboxSecurityAnswer,Q.cellErrorMessage);
});$addHandlers(this._textboxSecurityAnswer.get_element(),{"blur":P},this);Array.add(this._arrayValidationFunctions,P);
this._rowPreviousPassword=$createRowInDetailsTable(this._tablePasswordAndSecurityQuestion,{},F,{"value":"Previous Password:"},{},{},{});
this._textboxPasswordPrevious=$createTextboxPassword(this._rowPreviousPassword.cellValue,{});
var A=Function.createDelegate(this,function(){return L(this._textboxPasswordPrevious,this._rowPreviousPassword.cellErrorMessage);
});$addHandlers(this._textboxPasswordPrevious.get_element(),{"blur":A},this);if(this._bEditingExistingUser){Array.add(this._arrayValidationFunctions,A);
}var M=$createRowInDetailsTable(this._tablePasswordAndSecurityQuestion,{},F,{"value":"Password:"},{},{},{});
this._textboxPassword=$createTextboxPassword(M.cellValue,{});var C=Function.createDelegate(this,function(){return L(this._textboxPassword,M.cellErrorMessage);
});$addHandlers(this._textboxPassword.get_element(),{"blur":C},this);Array.add(this._arrayValidationFunctions,C);
var B=$createRowInDetailsTable(this._tablePasswordAndSecurityQuestion,{},F,{"value":"Re-Enter Password:"},{},{},{});
this._textboxPasswordReEnter=$createTextboxPassword(B.cellValue,{});var D=Function.createDelegate(this,function(){if(!this.update_securityInformation()){return this._createValidationObject(true,"",E);
}var S=L(this._textboxPasswordReEnter,B.cellErrorMessage);if(!S.bIsValid){return S;
}else{var T="";if(this._textboxPasswordReEnter.get_value()!=this._textboxPassword.get_value()){T="Both 'Password' and 'Re-Enter Password' must be the same.";
B.cellErrorMessage.set_value(T);}return this._createValidationObject((T==""),T,E);
}});$addHandlers(this._textboxPasswordReEnter.get_element(),{"blur":D},this);Array.add(this._arrayValidationFunctions,D);
$addHandlers(this._checkboxUpdateSecurityInformaion.get_element(),{"click":this._updatePasswordTableByCheckboxState},this);
},_updatePasswordTableByCheckboxState:function(){var A=((this._checkboxUpdateSecurityInformaion.get_value())?"visibility:visible":"visibility:hidden");
this._rowPreviousPassword.style.visibility=((this._checkboxUpdateSecurityInformaion.get_value()&&this._bEditingExistingUser)?"visible":"hidden");
this._tablePasswordAndSecurityQuestion.set_style(A);},_createMappingElements:function(){var F=$createTable(this._divMapping,{"style":"font-size:10px; vertical-align:top; width:100%;"});
var G=this._tabPanelMapping.get_tabIndex();var I=$createTableRow(F);var K=$createTableCell(I,{"style":""});
var A=$createTableCell(I,{"style":"width:230px; vertical-align:top;"});this._divMapCanvas=$createDiv(K,{"style":"width:100%; height:500px; padding:1px; border:solid 1px #ccc; margin:1px"});
var D=$createTable(A);var L=$createTableRow(D);var E=$createTableCell(L,{"value":"Latitude:","style":""});
this._cellLatValue=$createTableCell(L,{"style":""});var B=$createTableRow(D);var J=$createTableCell(B,{"value":"Longitude:","style":""});
this._cellLngValue=$createTableCell(B,{"style":""});var C=$createTableRow(D);var H=$createTableCell(C,{"value":"Zoom&nbsp;Level:","style":""});
this._cellZoomValue=$createTableCell(C,{"style":""});},_tabPanelMapClicked:function(){var B=CClientLib.GoogleMaps.GetGoogleMaps();
var A=function(){if(!GBrowserIsCompatible()){alert("Your browser doesn't support mapping, you will need to upgrade.");
return;}var C=Function.createDelegate(this,function(){B.set_mapPopsition(this._map,fn_Global_SafeDecimal_Decimal(this._cellLatValue.get_value()),fn_Global_SafeDecimal_Decimal(this._cellLngValue.get_value()),fn_Global_SafeInt_Int(this._cellZoomValue.get_value()));
});if(this._map==null){this._map=new google.maps.Map2(this._divMapCanvas.get_element());
C();this._map.addControl(new GLargeMapControl());this._map.addControl(new GMapTypeControl());
this._map.addControl(new GScaleControl());var D=Function.createDelegate(this,function(){this.set_userMappingProperties(fn_Global_SafeString_String(B.get_mapCenterLat(this._map)),fn_Global_SafeString_String(B.get_mapCenterLng(this._map)),B.get_mapZoom(this._map));
});GEvent.addListener(this._map,"dragend",D);GEvent.addListener(this._map,"zoomend",D);
}else{C();}};B.SafeAddGoogleMapFunctionality(Function.createDelegate(this,A));},set_userMappingProperties:function(B,A,C){this._cellLatValue.set_value(B);
this._cellLngValue.set_value(A);this._cellZoomValue.set_value(C);},_createUserAssociationsTab:function(){if(this._bTempDisplayUserAssociations){this._tabPanelAssociation=tabPanelAssociations.controlTabPanel;
this._divAssociations=tabPanelAssociations.divBody;}},_createUserAssociations:function(){if(this._bTempDisplayUserAssociations){var B=this._tabPanelAssociation.get_tabIndex();
var A=$createDiv(this._divAssociations,{});CClientLib.UserAssociations.CreateUserAssociations({},A);
}},_createProcessingControl:function(){this._buttonSave=$createButton(this._divPageProcess,{"value":"save","events":$createEvents({"click":this._savePersonalSettings},this)});
},_createValidationObject:function(C,B,A){return{"bIsValid":C,"strErrorMessage":B,"nTabIndex":A};
},update_securityInformation:function(){return this._checkboxUpdateSecurityInformaion.get_value();
},_savePersonalSettings:function(I){for(var A=0;A<this._arrayValidationFunctions.length;
A++){if(Type.isFunction(this._arrayValidationFunctions[A])){var B=this._arrayValidationFunctions[A]();
if(!B.bIsValid){bIsValid=false;this._controlTabsContainer.set_activeTabIndex(B.nTabIndex);
return;}}}var E=new CClientLib.ServerClasses.User();E.set_userID(CClientLib.ServerClasses.User.parse(this._user).get_userID());
E.set_firstName(CClientLib.UI.Element.parse(this._textboxFirstName).get_value());
E.set_lastName(CClientLib.UI.Element.parse(this._textboxLastName).get_value());E.set_email(CClientLib.UI.Element.parse(this._textboxEmail).get_value());
E.set_sex(this._radioButtonListSex.get_value());E.set_dob(this._controlDOB.get_selectedDate());
E.set_unitsType(this._radioButtonListUnits.get_value());E.set_defaultWeightUnitID(fn_Global_SafeInt_Int(CClientLib.UI.SDDL.parse(this._sddlDefaultWeightUnit).get_selectedItemValue_Obj()));
E.set_defaultDistanceUnitID(fn_Global_SafeInt_Int(CClientLib.UI.SDDL.parse(this._sddlDefaultDistanceUnit).get_selectedItemValue_Obj()));
E.set_weekStartsOn(this._radioButtonListFirstDayOfWeek.get_value());E.set_userName(CClientLib.UI.Element.parse(this._textboxUserName).get_value());
var C=CClientLib.UI.Element.parse(this._textboxPasswordPrevious).get_value();var F=CClientLib.UI.Element.parse(this._textboxPassword).get_value();
E.set_securityQuestion(CClientLib.UI.Element.parse(this._textAreaSecuritQuestion).get_value());
var D=CClientLib.UI.Element.parse(this._textboxSecurityAnswer).get_value();E.set_userRoleTitle(this._radioButtonListUserType.get_value());
E.set_mappingDefaultLat(CClientLib.UI.Element.parse(this._cellLatValue).get_value());
E.set_mappingDefaultLng(CClientLib.UI.Element.parse(this._cellLngValue).get_value());
E.set_mappingDefaultZoom(fn_Global_SafeInt_Int(CClientLib.UI.Element.parse(this._cellZoomValue).get_value()));
var G=null;var H=Function.createDelegate(this,function(K){CClientLib.UI.Element.parse(this._buttonSave).set_disabled(false);
if(this._bEditingExistingUser){this._loadUser(CClientLib.ServerClasses.User.parse(K).get_userID());
}else{CClientLib.Parent.GetParentComponent().set_userLoggedIn();}});var J=Function.createDelegate(this,function(M,K){if(M.nTerminationCode==1){return false;
}else{var M=CClientLib.WSWebServiceResponseClientWrapper.parse(M);var L=((this._bEditingExistingUser)?"Unable to save all of the personal settings.":"Unable to create a new user.");
L+="\n\n"+M.strTerminationMessage;alert(L);CClientLib.UI.Element.parse(this._buttonSave).set_disabled(false);
return true;}});CClientLib.Parent.GetWebServices().WSUser_InsertOrEditUser(E,this.update_securityInformation(),C,F,D,H,J,G);
CClientLib.UI.Element.parse(this._buttonSave).set_disabled(true);}};CClientLib.PersonalSettings.registerClass("CClientLib.PersonalSettings",Sys.UI.Control);
CClientLib.PersonalSettings.CreatePersonalSettings=function(B,C){C=CClientLib.UI.Element.parse(C);
var A=$create(CClientLib.PersonalSettings,B,{},{},C.get_element());return A;};Type.registerNamespace("CClientLib");
CClientLib.ProgramCreate=function(A){CClientLib.ProgramCreate.initializeBase(this,[A]);
this._bIsScheduled=false;this._tableCellHeader=null;this._tableCellTabContainer=null;
this._tableCellFooter=null;this._divMessage=null;this._textboxTitle=null;this._textboxNotes=null;
this._divTabPanelWeek1=null;this._controlCalendar=null;this._controlTabContainer=null;
};CClientLib.ProgramCreate.prototype={initialize:function(){CClientLib.ProgramCreate.callBaseMethod(this,"initialize");
this._createWrapperTable();this._createTitleAndNotesElements();this._createTabs();
this._createCalendar();this._createFooter();this._getProgramDetailsFromServer();},dispose:function(){if(this.get_programID()>0){this.save();
}CClientLib.ProgramCreate.callBaseMethod(this,"dispose");},_createWrapperTable:function(){var A=$createTable(this.get_element(),{"style":"width: 100%; height: 100%; overflow: hidden;"});
var C=$createTableRow(A,{});this._tableCellHeader=$createTableCell(C,{"style":"height: 50px;"});
var B=$createTableRow(A,{});this._tableCellTabContainer=$createTableCell(B,{"style":""});
var D=$createTableRow(A,{});this._tableCellFooter=$createTableCell(D,{"align":"right","style":"height: 10px;"});
},_createTitleAndNotesElements:function(){var A=$createStandardTitleAndNotes(this._tableCellHeader,true,"Program&nbsp;Title:","Program&nbsp;Notes:");
this._textboxTitle=A.textboxTitle;this._textboxNotes=A.textboxNotes;},_createTabs:function(){this._divMessage=$createDiv(this._tableCellTabContainer,{"style":"color: green; float: right;"});
this._controlTabContainer=$createTabContainer(this._tableCellTabContainer,"tabContainerProgramCreate");
var A=this._controlTabContainer.add_tabPanel("Week 1");this._controlTabContainer.render(0);
this._divTabPanelWeek1=A.divBody;},_createCalendar:function(){this._controlCalendar=CClientLib.CalendarWeek.CreateCalendarWeek($createDiv(this._divTabPanelWeek1),{"_nReservedPixelsAtBottomOfPage":70,"events":$createEvents({"cellClicked":this._handlerWeekCellClicked},this)});
},_createFooter:function(){var A=$createButton(this._tableCellFooter,{"value":"save program","style":"position:relative;top:-10px;","events":$createEvents({"click":function(B){this.save();
}},this)});},_handlerWeekCellClicked:function(A,B){var D={"events":$createEvents({"workoutDetailsSaved":function(E,F){this.loadProgramDetailsFromXML(F.get_webserviceResponse());
}},this)};var C=CClientLib.WorkoutDetails.CreateWorkoutDetails_ProgramWorkoutNew(this.get_programID(),this.get_programTitle(),this.get_programNotes(),A.get_selectedDayIndex_Int(),A.get_selectedTimeIndex_Int(),{},D);
},_getProgramDetailsFromServer:function(){if(this.get_programID()>0){var A=Function.createDelegate(this,this.loadProgramDetailsFromXML);
CClientLib.Parent.GetWebServices().WSProgram_WSGetProgramDetails(this.get_programID(),A,null,null);
}},save:function(){var A=function(){if(CClientLib.Parent.GetNavigation().navigationIsSetTo_ProgramListActive()){CClientLib.Parent.GetNavigation().navigateTo_ProgramListActive();
}};CClientLib.Parent.GetWebServices().WSProgram_WSSaveProgram(this.get_programID(),this.get_programTitle(),7,this.get_programNotes(),A);
},loadProgramDetailsFromXML:function(G){this._controlCalendar.clear_workoutPanels();
var J=G.getElementsByTagName("p")[0];var Q=fn_Global_XMLGetAttribute_Int(J,"pID");
var F=fn_Global_XMLGetAttribute_String(J,"t");var D=fn_Global_XMLGetAttribute_String(J,"n");
var O=fn_Global_XMLGetAttribute_Bool(J,"is");this.set_programID(Q);this.set_programTitle(F);
this.set_programNotes(D);this.set_isScheduled(O);var L=G.getElementsByTagName("w");
for(var E=0;E<L.length;E++){var C=L[E];var H=fn_Global_XMLGetAttribute_Int(C,"pWID");
var K=fn_Global_XMLGetAttribute_Int(C,"wTID");var P=fn_Global_XMLGetAttribute_String(C,"t");
var B=fn_Global_XMLGetAttribute_String(C,"n");var A=fn_Global_XMLGetAttribute_Int(C,"dNo");
var I=fn_Global_XMLGetAttribute_Int(C,"sTI");var M=fn_Global_XMLGetAttribute_Int(C,"eTI");
var N={"_componentProgramCreate":this,"_objectCalendarWeek":this._controlCalendar,"_nProgramID":Q,"_strProgramTitle":F,"_nProgramWorkoutID":H,"_nTemplateWorkoutID":K,"_strWorkoutTitle":P,"_strWorkoutNotes":B,"_nDayIndex":A,"_nStartTimeIndex":I,"_nEndTimeIndex":M};
this._controlCalendar.add_workoutPanel(N);}},removeProgramWorkout:function(B){var A=true;
if(this.get_isScheduled()){A=window.confirm("This program is currently scheduled to your calender.  Removing this workout from its program will also remove all pending occurrences of the workout from your calendar.\n\n\nDo you wish to proceed?");
}if(A){var C=Function.createDelegate(this,this.loadProgramDetailsFromXML);CClientLib.Parent.GetWebServices().WSProgram_WSRemoveWorkoutFromProgram(this.get_programID(),B,C,null,null);
}return A;},set_programTitle:function(A){this._textboxTitle.set_value(A);},set_programNotes:function(A){this._textboxNotes.set_value(A);
},set_programID:function(A){CClientLib.ProgramCreate.ProgramID=A;},set_isScheduled:function(A){this._bIsScheduled=fn_Global_SafeBool_Bool(A);
this._divMessage.set_value((this.get_isScheduled()?"NOTE: This program is currently scheduled to your calendar":""));
},get_programTitle:function(){return this._textboxTitle.get_value();},get_programNotes:function(){return this._textboxNotes.get_value();
},get_programID:function(){return CClientLib.ProgramCreate.ProgramID;},get_isScheduled:function(){return fn_Global_SafeBool_Bool(this._bIsScheduled);
}};CClientLib.ProgramCreate.ProgramID=0;CClientLib.ProgramCreate.registerClass("CClientLib.ProgramCreate",Sys.UI.Control);
CClientLib.ProgramCreate.parse=function(A){return CClientLib.ProgramCreate._parse(A);
};CClientLib.ProgramCreate.CreateProgramCreate=function(A,B,D){D=CClientLib.UI.Element.parse(D);
CClientLib.ProgramCreate.ProgramID=A;var C=$create(CClientLib.ProgramCreate,B,{},{},D.get_element());
return C;};Type.registerNamespace("CClientLib");CClientLib.ProgramListActive=function(A){CClientLib.ProgramListActive.initializeBase(this,[A]);
this._bIncrementalDataBind=true;};CClientLib.ProgramListActive.prototype={initialize:function(){CClientLib.ProgramListActive.callBaseMethod(this,"initialize");
this._buildCreateNewProgram();this._buildTableList();},dispose:function(){CClientLib.ProgramListActive.callBaseMethod(this,"dispose");
},_buildCreateNewProgram:function(){var A=$createDiv(this.get_element(),{"style":"text-align:right;"});
var D=$createSpan(A,{"value":"Click&nbsp;"});var C=$createAnchor(A,{"value":"here"});
$addHandlers(C.get_element(),{click:function(){CClientLib.Parent.GetNavigation().navigateTo_ProgramCreate(0,{});
}},this);var B=$createSpan(A,{"value":"&nbsp;to create a new program."});},_buildTableList:function(){var D=function(E,G){G=CClientLib.UI.GridViewEventArgs.parse(G);
var F=CClientLib.ServerClasses.Program.parse(G.get_dataItem());CClientLib.Parent.GetNavigation().navigateTo_ProgramCreate(F.get_programID(),{});
};this._gridviewProgramListActive=CClientLib.UI.GridView.GridViewStandardList($createDiv(this.get_element()),{"_bIncrementalDataBind":this._bIncrementalDataBind,"_objDataRowProperties":{"events":$createEvents({"click":D},this)}},"You currently do not have any programs.");
this._gridviewProgramListActive.set_dataSource(function(){return CClientLib.Parent.GetClientData().get_programsActive();
});var A=function(F,E){E=CClientLib.UI.GridViewEventArgs.parse(E);var H=E.get_dataRow();
var J=CClientLib.ServerClasses.Program.parse(E.get_dataItem());if(!J.get_isScheduled()){var I=$createAnchor(E.get_dataCell(),{"value":"Archive"});
var G=function(){H.disable();var K=Function.createDelegate(this,function(){CClientLib.Parent.GetNavigation().navigateTo_ProgramListActive({"_bIncrementalDataBind":false});
});CClientLib.Parent.GetWebServices().WSProgram_WSProgramArchive(J.get_programID(),K);
};$addHandler(I.get_element(),"click",G);}};var C=function(F,E){E=CClientLib.UI.GridViewEventArgs.parse(E);
dataItem=CClientLib.ServerClasses.Program.parse(E.get_dataItem());if(dataItem.get_isScheduled()){rowData.get_element().style.color="green";
$createSpan(E.get_dataCell(),{"style":"color: green;","value":"Scheduled"});}};var B=function(F,E){E=CClientLib.UI.GridViewEventArgs.parse(E);
dataItem=CClientLib.ServerClasses.Program.parse(E.get_dataItem());$createSpan(E.get_dataCell(),{"value":dataItem.get_permissionID()});
};this._gridviewProgramListActive.add_columnBindToDataItem({"value":"Program Title","style":"width: 200px"},null,{"style":"width:200px"},CClientLib.ServerClasses.Program.Properties.Title);
this._gridviewProgramListActive.add_columnBindToDataItem({"value":"Created","style":""},null,{"style":""},CClientLib.ServerClasses.Program.Properties.CreationUserName);
this._gridviewProgramListActive.add_columnBindToDataItem({"value":"Last Updated","style":";"},null,{},CClientLib.ServerClasses.Program.Properties.LastUpdatedUserName);
this._gridviewProgramListActive.add_column({"value":"Scheduled","style":""},null,{},C);
this._gridviewProgramListActive.add_column({"value":"Permission","style":""},null,{},B);
this._gridviewProgramListActive.add_column({"value":"&nbsp;","style":"50px"},null,{},A);
this._gridviewProgramListActive.add_columnAnchor({"value":"&nbsp;","style":"50px"},null,{},{"value":"View","events":$createEvents({"click":D},this)});
this._gridviewProgramListActive.dataBind();}};CClientLib.ProgramListActive.registerClass("CClientLib.ProgramListActive",Sys.UI.Control);
CClientLib.ProgramListActive.parse=function(A){return CClientLib.ProgramListActive._parse(A);
};CClientLib.ProgramListActive.CreateProgramListActive=function(A,B){B=CClientLib.UI.Element.parse(B);
return $create(CClientLib.ProgramListActive,A,{},{},B.get_element());};Type.registerNamespace("CClientLib");
CClientLib.ProgramListArchived=function(A){CClientLib.ProgramListArchived.initializeBase(this,[A]);
this._bIncrementalDataBind=true;this._gridviewProgramListArchived=null;};CClientLib.ProgramListArchived.prototype={initialize:function(){CClientLib.ProgramListArchived.callBaseMethod(this,"initialize");
this._buildTableList();},dispose:function(){CClientLib.ProgramListArchived.callBaseMethod(this,"dispose");
},_buildTableList:function(){this._gridviewProgramListArchived=CClientLib.UI.GridView.GridViewStandardList($createDiv(this.get_element()),{"_bIncrementalDataBind":this._bIncrementalDataBind},"You currently do not have any archived programs.");
this._gridviewProgramListArchived.set_dataSource(function(){return CClientLib.Parent.GetClientData().get_programsArchived();
});var A=Function.createDelegate(this,function(B,C){C=CClientLib.UI.GridViewEventArgs.parse(C);
C.get_dataRow().disable();dataItem=CClientLib.ServerClasses.Program.parse(C.get_dataItem());
var D=function(){CClientLib.Parent.GetNavigation().navigateTo_ProgramListArchived({"_bIncrementalDataBind":false});
};CClientLib.Parent.GetWebServices().WSProgram_WSProgramActivate(dataItem.get_programID(),D);
});this._gridviewProgramListArchived.add_columnBindToDataItem({"value":"Program Title","style":"width: 200px"},null,{"style":"width:200px"},CClientLib.ServerClasses.Program.Properties.Title);
this._gridviewProgramListArchived.add_columnBindToDataItem({"value":"Archived Date","style":""},null,{},CClientLib.ServerClasses.Program.Properties.ArchivedDateTime);
this._gridviewProgramListArchived.add_columnAnchor({"value":"&nbsp;","style":"50px"},null,{},{"value":"Activate","events":$createEvents({"click":A},this)});
this._gridviewProgramListArchived.dataBind();}};CClientLib.ProgramListArchived.registerClass("CClientLib.ProgramListArchived",Sys.UI.Control);
CClientLib.ProgramListArchived.parse=function(A){return CClientLib.ProgramListArchived._parse(A);
};CClientLib.ProgramListArchived.CreateProgramListArchived=function(A,B){B=CClientLib.UI.Element.parse(B);
return $create(CClientLib.ProgramListArchived,A,{},{},B.get_element());};Type.registerNamespace("CClientLib");
CClientLib.ScheduleCalendar=function(A){CClientLib.ScheduleCalendar.initializeBase(this,[A]);
this._nActiveTabIndex=1;this._divTabPanelWeek=null;this._divProgramListHeader=null;
this._divProgramListCollapsePanelHeading=null;this._spanUnscheduledWorkoutsCount=null;
this._spanProgramStatus=null;this._anchorOpenProgramList=null;this._divProgramListWrapper=null;
this._checkboxShowUnscheduledWorkouts=null;this._divScheduleProgram=null;this._controlDatePicker=null;
this._controlCalendarWeek=null;this._controlTabContainer=null;this._controlTabWeek=null;
this._controlProgramListCollapsePanel=null;this._controlGridViewProgramList=null;
this._controlUpdating=false;this._xmlDoc=null;};CClientLib.ScheduleCalendar.prototype={initialize:function(){CClientLib.ScheduleCalendar.callBaseMethod(this,"initialize");
this._createHeader();this._createTabPanels();this._createCalendar();this.request_serverData();
this._controlDatePicker.add_dateSelectionChanged(Function.createDelegate(this,this._onDateSelectionChanged));
$addHandlers(this._anchorOpenProgramList.get_element(),{click:function(){if(this._controlProgramListCollapsePanel.get_Collapsed()){this._controlProgramListCollapsePanel.open();
this._anchorOpenProgramList.set_value("Close");}else{this._controlProgramListCollapsePanel.close();
this._anchorOpenProgramList.set_value("View details");}}},this);},dispose:function(){CClientLib.ScheduleCalendar.callBaseMethod(this,"dispose");
},_createHeader:function(){var H=$createDiv(this.get_element(),{"style":"position:absolute; top:0px; right:10px; z-index:100; font-size:10px; text-align:right;"});
var J=$createDiv(H,{"style":"vertical-align:middle;"});var L=$createSpan(J,{"style":"width:200px;","align":"left"});
var I=$createDatePicker(L,{"fnStepForwardBy":Function.createDelegate(this,this.get_scheduleCalendarState)},{},{},{"selectedDate":(new Date())});
this._controlDatePicker=I.controlCalendar;var F=$createSpan(J,{"style":"color:grey; vertical-align:middle; margin-left:15px;"});
$createSpan(F,{"value":"View Training Schedule For: *** under construction ***","style":"color:grey; vertical-align:middle;"});
var K=$createDiv(H,{"style":"margin-top:3px;"});this._spanProgramStatus=$createSpan(K,{"style":"margin-right:15px;"});
var D=$createSpan(K,{"align":"center","style":"width:200px; text-align:center; vertical-align:bottom;"});
$createSpan(D,{"value":"[&nbsp;"});this._anchorOpenProgramList=$createAnchor(D,{"value":"View details","style":""});
$createSpan(D,{"value":"&nbsp;]"});var C=$createDiv(H,{"style":"border: Double 1px Black; padding:5px; margin-top:5px; background-color:lightGrey; z-index:50; text-align:left; position:absolute; top:40px; right:0px;"});
this._divProgramListCollapsePanelHeading=$createDiv(C,{"style":"font-size:1.2em; font-style:italic; width:800px;","value":"Loading..."});
this._divScheduleProgram=$createDiv(C,{"style":"float:right;"});$createSpan(this._divScheduleProgram,{"value":"[&nbsp;"});
$createAnchor(this._divScheduleProgram,{"value":"Schedule Program","events":$createEvents({"click":this._createScheduleProgramControl},this)});
$createSpan(this._divScheduleProgram,{"value":"&nbsp;]"});this._divProgramListWrapper=$createDiv(C,{"style":"margin-top: 15px; margin-bottom: 45px;"});
this._controlGridViewProgramList=$create(CClientLib.UI.GridView,{"_objTableProperties":{"style":"border-collapse:collapse; width:100%;"},"_objDivPropertiesEmpty":{"value":"No scheduled programs found for this date range.","style":""}},{},{},this._divProgramListWrapper.get_element());
var G=$createDiv(C,{"align":"right","style":"padding-top:15px;"});var A=$createSpan(G,{"value":"Show unscheduled workouts"});
this._spanUnscheduledWorkoutsCount=$createSpan(G);this._checkboxShowUnscheduledWorkouts=$createCheckbox(G,{});
$addHandlers(this._checkboxShowUnscheduledWorkouts.get_element(),{"click":function(){if(!this._controlUpdating&&this._xmlDoc!=null){this.load_dataFromXML(this._xmlDoc);
}}},this);var E=$createDiv(C,{"style":"text-align:right;"});var B=$createAnchor(E,{"style":"","value":"Close"});
$addHandlers(B.get_element(),{click:function(){this._controlProgramListCollapsePanel.close();
this._anchorOpenProgramList.set_value("View details");}},this);this._controlProgramListCollapsePanel=$createCollapsePanel(C);
},_createTabPanels:function(){$createBR(this.get_element());$createBR(this.get_element());
this._controlTabContainer=$createTabContainer(this.get_element(),"tabContainerScheduleCalendar");
this._controlTabWeek=this._controlTabContainer.add_tabPanel("Week");this._divTabPanelWeek=this._controlTabWeek.divBody;
this._controlTabContainer.render(0);},_createCalendar:function(){this._controlCalendarWeek=CClientLib.CalendarWeek.CreateCalendarWeek($createDiv(this._divTabPanelWeek),{"events":$createEvents({"cellClicked":this._onWeekCellClicked},this)});
},_renderTableProgramList:function(A){this._divProgramListCollapsePanelHeading.set_value(String.format("Programs scheduled to your between {0} and {1}:",CClientLib.Type.Date.format(this.get_selectedDateRange_StartDate(),"dd/MMM"),CClientLib.Type.Date.format(this.get_selectedDateRange_EndDate(),"dd/MMM")));
this._divScheduleProgram.set_display("block");this._controlGridViewProgramList=CClientLib.UI.GridView.parse(this._controlGridViewProgramList);
this._controlGridViewProgramList.removeAll();this._controlGridViewProgramList.set_dataSource(function(){return A;
});var D="padding-right:10px;";var E=Function.createDelegate(this,function(J,H){H=CClientLib.UI.GridViewEventArgs.parse(H);
var I=H.get_dataItem()["nScheduleProgramStatusID"];if(I==1||I==2){var K=$createAnchor(H.get_dataCell(),{"value":"Unschedule Program"});
$addHandlers(K.get_element(),{"click":function(){this.clear_calendar();var L=dataItem["nScheduleProgramID"];
CClientLib.Parent.GetWebServices().WSScheduleCalendar_WSUnscheduleProgram(this.get_selectedUserID(),L,this.get_selectedDateRange_StartDate(),this.get_selectedDateRange_EndDate(),Function.createDelegate(this,this.load_dataFromXML));
}},this);}else{$createSpan(H.get_dataCell(),{"value":"Unschedule Program","style":"color:grey;"});
}});var B=Function.createDelegate(this,function(K,I){I=CClientLib.UI.GridViewEventArgs.parse(I);
var J=I.get_dataItem()["nScheduleProgramStatusID"];var H=I.get_dataItem()["nProgramID"];
if(J==1||J==2){var L=$createAnchor(I.get_dataCell(),{"value":"Edit Program"});$addHandlers(L.get_element(),{"click":function(){CClientLib.Parent.GetNavigation().navigateTo_ProgramCreate(H,{});
}},this);}else{$createSpan(I.get_dataCell(),{"value":"Edit Program","style":"color:grey;"});
}});var C="font-weight: bold; border-bottom: Solid 1px Black;"+D;this._controlGridViewProgramList.add_columnBindToDataItem({"value":"Program Title","style":C},null,{"style":D},"strProgramTitle");
this._controlGridViewProgramList.add_columnBindToDataItem({"value":"Start Date","style":C},null,{"style":D},"strScheduleProgramStartDate");
this._controlGridViewProgramList.add_columnBindToDataItem({"value":"Completition Date","style":C},null,{"style":D},"strScheduleProgramCompletitionDate");
this._controlGridViewProgramList.add_columnBindToDataItem({"value":"Cycle(s)","style":C},null,{"style":D},"strCycleInterrogation");
this._controlGridViewProgramList.add_columnBindToDataItem({"value":"Status","style":C},null,{"style":D},"strScheduleProgramStatusTitle");
this._controlGridViewProgramList.add_column({"value":"&nbsp;","style":C},null,{"style":D},B);
this._controlGridViewProgramList.add_column({"value":"&nbsp;","style":C},null,{"style":D},E);
this._controlGridViewProgramList.dataBind();var G=CClientLib.Parent.GetClientData().get_scheduleProgramCollection();
var F=G.item_count();if(F>0){this._spanProgramStatus.set_value("You currently have "+F+" program"+(F>0?"s":"")+" scheduled to your calendar.");
}else{this._spanProgramStatus.removeChildrenFromDOM();$createSpan(this._spanProgramStatus,{"value":"You currently do not have any programs scheduled to your calendar. Click&nbsp;","style":"color:red;"});
$createAnchor(this._spanProgramStatus,{"value":"here","events":$createEvents({"click":this._createScheduleProgramControl},this)});
$createSpan(this._spanProgramStatus,{"value":"&nbsp; to schedule a program","style":"color:red;"});
}},_createScheduleProgramControl:function(){var A=CClientLib.ScheduleProgramInsert.CreateScheduleProgramInsert({},{"events":$createEvents({"saving":function(){this.clear_calendar();
},"saved":function(B){this.load_dataFromXML(B);}},this)});A.set_responseDateDuration(this.get_selectedDateRange_StartDate(),this.get_selectedDateRange_EndDate());
},_onWeekCellClicked:function(A,B){A=CClientLib.CalendarWeek.parse(A);if(confirm("Would you like to perform an impromptu workout?")){var C=this.get_selectedDateRange();
CClientLib.WorkoutDetails.CreateWorkoutDetails_ScheduledNew(this.get_selectedUserID(),C.get_item(A.get_selectedDayIndex_Int()-1)[C.get_collectionKey()],A.get_selectedTimeIndex_Int(),{},{"_objGenericCollectionSelectableDays":C,"events":$createEvents({"workoutDetailsSaved":function(D,E){this.load_dataFromXML(E.get_webserviceResponse());
}},this)});}},_onDateSelectionChanged:function(A,B){this.clear_calendar();this.request_serverData();
},get_scheduleCalendarState:function(){return"week";},clear_calendar:function(){this._controlCalendarWeek.clear_workoutPanels();
this._controlGridViewProgramList.removeAll();this._divProgramListCollapsePanelHeading.set_value("Loading...");
this._spanUnscheduledWorkoutsCount.set_value("");this._divScheduleProgram.set_display("none");
},updateProgramListHeader:function(A){},update_calendarDates:function(){var A=this.get_selectedDateRange();
if(this.get_scheduleCalendarState()=="week"){this._controlCalendarWeek.set_weekDates(A);
}},update_unscheduleWorkoutsCount:function(A){this._spanUnscheduledWorkoutsCount.set_value("&nbsp; ("+(A==0?"None":A)+") &nbsp;");
},request_serverData:function(){CClientLib.Parent.GetWebServices().WSScheduleCalendar_WSGetScheduledData(this.get_selectedUserID(),this.get_selectedDateRange_StartDate(),this.get_selectedDateRange_EndDate(),Function.createDelegate(this,this.load_dataFromXML));
this.update_calendarDates();},load_dataFromXML:function(H){this._controlUpdating=true;
this.clear_calendar();var J=0;this._xmlDoc=H;this._controlCalendarWeek.clear_workoutPanels();
var Q=Function.createDelegate(this,function(Z,Y,T,U){if(!U){return;}var X=U.getElementsByTagName("w");
if(X){for(var S=0;S<X.length;S++){var V=X[S];var R=fn_Global_XMLGetAttribute_Int(V,"sID");
if(R==5){J=J+1;}if(!(R==5&&!this.get_showUnscheduledWorkouts())){var W={"_objectCalendarWeek":this._controlCalendarWeek,"_nScheduleProgramID":Z,"_nProgramID":Y,"_strProgramTitle":T,"_nProgramWorkoutID":fn_Global_XMLGetAttribute_String(V,"pWID"),"_nCycleNumber":fn_Global_XMLGetAttribute_Int(V,"cNo"),"_nTemplateWorkoutID":fn_Global_XMLGetAttribute_Int(V,"wTID"),"_nSessionWorkoutID":fn_Global_XMLGetAttribute_Int(V,"wSID"),"_strWorkoutTitle":fn_Global_XMLGetAttribute_String(V,"t"),"_strWorkoutNotes":fn_Global_XMLGetAttribute_String(V,"n"),"_nWorkoutStatusID":R,"_nDayIndex":CClientLib.Type.Date.GetDayIndex(fn_Global_XMLGetAttribute_Date(V,"wD")),"_nStartTimeIndex":fn_Global_XMLGetAttribute_Int(V,"sTI"),"_nEndTimeIndex":fn_Global_XMLGetAttribute_Int(V,"eTI")};
this._controlCalendarWeek.add_workoutPanel(W);}}}});var P=this._xmlDoc.getElementsByTagName("sp");
var G=this._xmlDoc.getElementsByTagName("iw");var B=new CClientLib.ServerClasses.GenericCollection("Key","Text");
for(var E=0;E<P.length;E++){var O=P[E];var K=fn_Global_XMLGetAttribute_Int(O,"sPID");
var N=fn_Global_XMLGetAttribute_Int(O,"pID");var F=fn_Global_XMLGetAttribute_String(O,"t");
var A=fn_Global_XMLGetAttribute_String(O,"sd");var C=fn_Global_XMLGetAttribute_String(O,"cd");
var D=fn_Global_XMLGetAttribute_Int(O,"spsID");var L=fn_Global_XMLGetAttribute_String(O,"spsT");
var M=fn_Global_XMLGetAttribute_Int(O,"c");var I=fn_Global_XMLGetAttribute_String(O,"cI");
B.add_item({"nScheduleProgramID":K,"nProgramID":N,"strProgramTitle":F,"strScheduleProgramStartDate":A,"strScheduleProgramCompletitionDate":C,"nScheduleProgramStatusID":D,"strScheduleProgramStatusTitle":L,"nCycles":M,"strCycleInterrogation":I});
Q(K,N,F,O);}if(G&&G.length){Q(0,0,"",G[0]);}this._renderTableProgramList(B);this.update_unscheduleWorkoutsCount(J);
this._controlUpdating=false;},get_selectedDateRange:function(){if(this.get_scheduleCalendarState()=="week"){return CClientLib.Type.Date.GetWeek(this._controlDatePicker.get_selectedDate());
}},get_selectedDateRange_StartDate:function(){var A=CClientLib.ServerClasses.GenericCollection.parse(this.get_selectedDateRange());
if(A.item_count()>0){return A.get_item(0)[A.get_collectionKey()];}return null;},get_selectedDateRange_EndDate:function(){var A=CClientLib.ServerClasses.GenericCollection.parse(this.get_selectedDateRange());
if(A.item_count()>0){return A.get_item(A.item_count()-1)[A.get_collectionKey()];}return null;
},get_selectedUserID:function(){return CClientLib.Parent.GetClientData().get_currentUser().get_userID();
},get_showUnscheduledWorkouts:function(){this._checkboxShowUnscheduledWorkouts=CClientLib.UI.Element.parse(this._checkboxShowUnscheduledWorkouts);
return this._checkboxShowUnscheduledWorkouts.get_value();}};CClientLib.ScheduleCalendar.registerClass("CClientLib.ScheduleCalendar",Sys.UI.Control);
CClientLib.ScheduleCalendar.strID="ScheduledProgram";CClientLib.ScheduleCalendar.GetScheduleCalendar=function(){return CClientLib.ScheduleCalendar.parse(CClientLib.Canvas.GetCanvasWindowObject().$find(CClientLib.ScheduleCalendar.strID));
};CClientLib.ScheduleCalendar.CreateScheduleCalendar=function(A,B){B.set_id(CClientLib.ScheduleCalendar.strID);
return $create(CClientLib.ScheduleCalendar,A,{},{},B.get_element());};CClientLib.ScheduleCalendar.parse=function(A){return CClientLib.ScheduleCalendar._parse(A);
};Type.registerNamespace("CClientLib");CClientLib.ScheduleProgramInsert=function(A){CClientLib.ScheduleProgramInsert.initializeBase(this,[A]);
this._nModalPopupID=0;this._arrayValidationFunctions=[];this._dtWSResponseDataStartDate=null;
this._dtWSResponseDataEndDate=null;this._controlDatePicker=null;this._sddlNoOfCycles=null;
this._sddlActivePrograms={};this._btnScheduleProgram={};};CClientLib.ScheduleProgramInsert.prototype={initialize:function(){CClientLib.ScheduleProgramInsert.callBaseMethod(this,"initialize");
if(!this._validateParams()){return;}this._buildElements();},dispose:function(){CClientLib.ScheduleProgramInsert.callBaseMethod(this,"dispose");
},_validateParams:function(){if(CClientLib.Parent.GetClientData().get_programsActive().item_count()<1){this.get_modalPopup().set_divSize("400px","150px");
$createStandardNote(this.get_element(),{"value":"You currently do not have any active programs to schedule to your calendar. Would you like to create one now?"});
var A=$createDiv(this.get_element(),{"style":"float:right;"});$createButton(A,{"value":"yes","events":$createEvents({"click":function(){CClientLib.Parent.GetNavigation().navigateTo_ProgramCreate(0,{});
this.get_modalPopup().close();}},this)});$createSpan(A,{"value":"&nbsp;|&nbsp;"});
$createButton(A,{"value":"no","events":$createEvents({"click":function(){this.get_modalPopup().close();
}},this)});return false;}return true;},get_modalPopup:function(){return CClientLib.UI.ModalPopupWrapper.parse(CClientLib.Parent.GetModalPopupContainer().get_modalPopupByID(this._nModalPopupID));
},_buildElements:function(){$createStandardNote(this.get_element(),{"value":"Schedule an existing program to your calandar"});
var J=$createTable(this.get_element(),{});var G=$createRowInDetailsTable(J,{},{},{"value":"Program Start Date:"},{},{},{});
var H=new Date();if(!CClientLib.Type.Date.IsFistDayOfWeek(H)){H=CClientLib.Type.Date.GetStartOfWeek(CClientLib.Type.Date.AddDays(H,7));
}var A=$createDatePicker(G.cellValue,{},{},{},{"selectedDate":H});this._controlDatePicker=A.controlCalendar;
var B=Function.createDelegate(this,function(){var K=this.get_startDate();var L=CClientLib.Type.Date.GetStartOfWeek(new Date());
var M="";if(!CClientLib.Type.Date.isDate(K)){M="* Please select a start date";}else{if(K<L){M="* The start date can not be before "+CClientLib.Type.Date.format(L,"dd/MMM/yy");
}}G.divErrorMessage.set_value(M);return M;});this._controlDatePicker.add_dateSelectionChanged(Function.createDelegate(this,function(){var M=B();
if(!String.isPopulatedString(M)){var K=this.get_startDate();if(!CClientLib.Type.Date.IsFistDayOfWeek(K)){var L=CClientLib.Type.Date.GetStartOfWeek(K);
alert("When scheduling a program it must begin on the first day of the week ("+CClientLib.Type.Date.GetDayString(L)+").\n Your start date has been wound back to "+CClientLib.Type.Date.format(L,"dddd dd/MMM/yy"));
this._controlDatePicker.set_selectedDate(L);}}}));Array.add(this._arrayValidationFunctions,B);
var C=$createRowInDetailsTable(J,{},{},{"value":"Program to Schedule:"},{},{},{});
this._sddlActivePrograms=CClientLib.UI.SDDL.CreateProgramListActive(C.cellValue,{});
var E=Function.createDelegate(this,function(){var L=this.get_programID();var K="";
if(L==null){var K=" * Please select a program";}C.divErrorMessage.set_value(K);return K;
});this._sddlActivePrograms.add_selectionMade(E);Array.add(this._arrayValidationFunctions,E);
var F=$createRowInDetailsTable(J,{},{},{"value":"No. of Program Cycles:"},{},{},{});
this._createNoOfWeeksSDDL(F.cellValue);var D=Function.createDelegate(this,function(){var L=this.get_NoOfCycles();
var K="";if(L==null){var K=" * Please select the number of cycles";}F.divErrorMessage.set_value(K);
return K;});this._sddlNoOfCycles=CClientLib.UI.SDDL.parse(this._sddlNoOfCycles);this._sddlNoOfCycles.add_selectionMade(D);
Array.add(this._arrayValidationFunctions,D);var I=$createTableCell($createTableRow(J),{"colSpan":"2","align":"right","style":"margin-top: 15px;"});
this._btnScheduleProgram=$createButton(I,{"value":"Schedule Program","events":$createEvents({"click":this._handlerScheduleProgram},this)});
},_createNoOfWeeksSDDL:function(D){var C=new CClientLib.ServerClasses.GenericCollection("value","text");
for(var A=0;A<10;A++){var B=A+1;C.add_item({"value":B,"text":(B+" cycles")});}this._sddlNoOfCycles=$create(CClientLib.UI.SDDL,{"_fnGetDataSource":function(){return C;
},"_bAllowEditing":true,"_nTextBoxWidth":200,"_nOptionsListWidth":250},{},{},D.get_element());
},get_startDate:function(){return this._controlDatePicker.get_selectedDate();},get_NoOfCycles:function(){this._sddlNoOfCycles=CClientLib.UI.SDDL.parse(this._sddlNoOfCycles);
return this._sddlNoOfCycles.get_selectedItemValue_Obj();},get_programID:function(){this._sddlActivePrograms=CClientLib.UI.SDDL.parse(this._sddlActivePrograms);
return this._sddlActivePrograms.get_selectedItemValue_Obj();},get_perdictedCompletionDate:function(){var B=this.get_startDate();
var A=this.get_NoOfCycles();if(CClientLib.Type.Date.isDate(B)&&A!=null){var C=(A*7);
if(C>0){C--;}return CClientLib.Type.Date.AddDays(B,C);}return null;},set_responseDateDuration:function(A,B){this._dtWSResponseDataStartDate=A;
this._dtWSResponseDataEndDate=B;},_handlerScheduleProgram:function(B){B=Sys.UI.DomEvent.parse(B);
for(var A=0;A<this._arrayValidationFunctions.length;A++){var C=this._arrayValidationFunctions[A];
var N=C();if(String.isPopulatedString(N)){alert(N);return;}}var F=this.get_startDate();
var G=this.get_NoOfCycles();var L=this.get_programID();var K=CClientLib.ServerClasses.Program.parse((CClientLib.UI.SDDL.parse(this._sddlActivePrograms).get_selectedItem_Array()));
var M=CClientLib.ServerClasses.ScheduledProgramCollection.parse(CClientLib.Parent.GetClientData().get_scheduleProgramCollection());
for(var A=0;A<M.item_count();A++){var E=CClientLib.ServerClasses.ScheduledProgram.parse(M.get_item(A));
if(E.get_programID()==L){var I=this.get_perdictedCompletionDate();if(I!=null&&CClientLib.Type.Date.DateRangesOverLap(F,I,E.get_startDate(),E.get_completionDate())){var J=new Sys.StringBuilder("Unable to schedule this program to your calendar.");
J.append("\n\nThe program '"+K.get_title()+"' has already been scheduled to your calendar between "+CClientLib.Type.Date.format(E.get_startDate(),"dd/MMM/yy")+" - "+E.get_completionDate().format("dd/MMM/yy")+".");
J.append("\n\nBy rescheduling this program between the "+CClientLib.Type.Date.format(F,"dd/MMM/yy")+" - "+CClientLib.Type.Date.format(I,"dd/MMM/yy")+" will result in a overlap.");
J.append("\n\n\nPlease type again...");alert(J.toString());return;}}}var D=CClientLib.Parent.GetClientData().get_currentUser().get_userID();
var H=this.get_events().getHandler(CClientLib.ScheduleProgramInsert.strEventSaved);
CClientLib.Parent.GetWebServices().WSScheduleCalendar_WSScheduleProgram(D,L,F,G,this._dtWSResponseDataStartDate,this._dtWSResponseDataEndDate,H);
this._raiseEvent(CClientLib.ScheduleProgramInsert.strEventSaving);this.get_modalPopup().close();
}};CClientLib.ScheduleProgramInsert.registerClass("CClientLib.ScheduleProgramInsert",Sys.UI.Control);
CClientLib.ScheduleProgramInsert.strEventSaving="saving";CClientLib.ScheduleProgramInsert.strEventSaved="saved";
CClientLib.ScheduleProgramInsert.createEvent(CClientLib.ScheduleProgramInsert.strEventSaving);
CClientLib.ScheduleProgramInsert.createEvent(CClientLib.ScheduleProgramInsert.strEventSaved);
CClientLib.ScheduleProgramInsert.parse=function(A){return CClientLib.ScheduleProgramInsert._parse(A);
};CClientLib.ScheduleProgramInsert.CreateScheduleProgramInsert=function(C,B){C=fn_Global_ObjectAddDefultProperties(C,{"_strModalPopupWidth":"600px","_strModalPopupHeight":"400px"});
C=fn_Global_SafeObject_Object(C);C._objSpanHeadingProperties=fn_Global_ObjectAddDefultProperties(C._objSpanHeadingProperties,{"value":"Schedule Program To Calendar"});
var A=CClientLib.Parent.OpenModalPopupAndRenderControl(C,CClientLib.ScheduleProgramInsert,B,"_nModalPopupID",false);
return CClientLib.ScheduleProgramInsert.parse(A);};Type.registerNamespace("CClientLib");
CClientLib.ScheduleProgramList=function(A){CClientLib.ScheduleProgramList.initializeBase(this,[A]);
this._bIncrementalDataBind=true;};CClientLib.ScheduleProgramList.prototype={initialize:function(){CClientLib.ScheduleProgramList.callBaseMethod(this,"initialize");
this._buildCreateNewScheduleProgram();this._buildTableList();},dispose:function(){CClientLib.ScheduleProgramList.callBaseMethod(this,"dispose");
},_buildCreateNewScheduleProgram:function(){var D=$createDiv(this.get_element(),{"style":"text-align: right;"});
var A=$createSpan(D,{"value":"Click&nbsp;"});var B=$createAnchor(D,{"value":"here","events":$createEvents({"click":function(){this._createScheduleProgram();
}},this)});var C=$createSpan(D,{"value":"&nbsp;to schedule a program to your calendar."});
},_buildTableList:function(){var B=CClientLib.UI.GridView.GridViewStandardList($createDiv(this.get_element()),{"_bIncrementalDataBind":this._bIncrementalDataBind},"You currently do not have any programs scheduled to your calendar.");
B.set_dataSource(function(){return CClientLib.Parent.GetClientData().get_scheduleProgramCollection();
});var C=function(E,G){G=CClientLib.UI.GridViewEventArgs.parse(G);scheduleProgramObj=CClientLib.ServerClasses.ScheduledProgram.parse(G.get_dataItem());
var F=CClientLib.Parent.GetClientData().get_programsActive().get_programByProgramID(scheduleProgramObj.get_programID());
F=CClientLib.ServerClasses.Program.parse(F);G.get_dataCell().set_value(F.get_title());
};var D=function(E,F){F=CClientLib.UI.GridViewEventArgs.parse(F);var G=CClientLib.ServerClasses.ScheduledProgram.parse(F.get_dataItem());
CClientLib.Parent.GetNavigation().navigateTo_ProgramCreate(G.get_programID(),{});
};var A=function(F,H){H=CClientLib.UI.GridViewEventArgs.parse(H);var I=CClientLib.ServerClasses.ScheduledProgram.parse(H.get_dataItem());
H.get_dataRow().disable();var E=CClientLib.Parent.GetClientData().get_currentUser().get_userID();
var G=function(){CClientLib.Parent.GetNavigation().navigateTo_ScheduleProgramList();
};CClientLib.Parent.GetWebServices().WSScheduleCalendar_WSUnscheduleProgram(E,I.get_scheduleProgramID(),null,null,G,null,null);
};B.add_column({"value":"Program Title"},null,{},C);B.add_columnDate({"value":"Start Date"},null,{},CClientLib.ServerClasses.ScheduledProgram.Properties.StartDate);
B.add_columnDate({"value":"Completition Date"},null,{},CClientLib.ServerClasses.ScheduledProgram.Properties.CompletionDate);
B.add_columnBindToDataItem({"value":"Status"},null,{"style":"width:200px"},CClientLib.ServerClasses.ScheduledProgram.Properties.ScheduleProgramStatusTitle);
B.add_columnAnchor({"value":"&nbsp;"},null,{},{"value":"Unschedule Program","events":$createEvents({"click":A},this)});
B.add_columnAnchor({"value":"&nbsp;"},null,{},{"value":"View Program","events":$createEvents({"click":D},this)});
B.dataBind();},_createScheduleProgram:function(){CClientLib.ScheduleProgramInsert.CreateScheduleProgramInsert({},{"events":$createEvents({"saved":function(){CClientLib.Parent.GetNavigation().navigateTo_ScheduleProgramList({"_bIncrementalDataBind":false});
}},this)});}};CClientLib.ScheduleProgramList.registerClass("CClientLib.ScheduleProgramList",Sys.UI.Control);
CClientLib.ScheduleProgramList.parse=function(A){return CClientLib.ScheduleProgramList._parse(A);
};CClientLib.ScheduleProgramList.CreateScheduleProgramList=function(A,B){B=CClientLib.UI.Element.parse(B);
return $create(CClientLib.ScheduleProgramList,A,{},{},B.get_element());};Type.registerNamespace("CClientLib");
CClientLib.UI.SDDL=function(A){CClientLib.UI.SDDL.initializeBase(this,[A]);this._optionListPositionLeftOrRight="left";
this._nTextBoxWidth=100;this._nOptionsListWidth=300;this._strStyleInputtedText="text-decoration:underline; font-weight:bold;";
this._strClientCollectionEmpty="No items found...";this._bAutoCompleteFromFirstCharOnly=false;
this._fnGetDataSource=function(){alert("You have not passed a data source function to the SDDL");
};this._bAllowEditing=true;this._displayItemDetails=false;this._displayOptionListFooter=false;
this._objectDefaultItemValue={};this._objectTextBoxProperties={};this._objPropertiesTableWrapper={};
this._objPropertiesOptionListFooter={};this._nTimeoutID;this._nTimeoutDuration=500;
this._strKeyValue="";this._strTextValue="";this._objSelectedItem=null;this._divControlWrapper=null;
this._tableInputWrapper=null;this._tableInputWrapper_tr=null;this._tableInputWrapper_tdLeft=null;
this._tableInputWrapper_tdRight=null;this._textboxInput=null;this._imgOpenDropDownList=null;
this._divOptionListWrapper=null;this._divOptionListGV=null;this._divOptionListDetails=null;
this._divOptionListFooter=null;this._gridViewOptionList=null;};CClientLib.UI.SDDL.prototype={initialize:function(){CClientLib.UI.SDDL.callBaseMethod(this,"initialize");
this._initializeValidateParameters();var A=CClientLib.ServerClasses.GenericCollection.parse(this.get_dataSource());
this._strKeyValue=A.get_collectionKey();this._strTextValue=A.get_collectionText();
this._buildElements();this.set_SelectedItemByValue(this._objectDefaultItemValue);
},_buildElements:function(){if(!this._bAllowEditing){this._objectTextBoxProperties.textboxAsLabel=true;
this._textboxInput=$createTextbox(this.get_element(),this._objectTextBoxProperties);
this._textboxInput.style.width=this._nTextBoxWidth+"px";}else{this._divControlWrapper=$createDiv(this.get_element(),{});
this._tableInputWrapper=$createTable(this._divControlWrapper,this._objPropertiesTableWrapper);
this._tableInputWrapper_tr=$createTableRow(this._tableInputWrapper);this._tableInputWrapper_tdLeft=$createTableCell(this._tableInputWrapper_tr);
this._tableInputWrapper_tdRight=$createTableCell(this._tableInputWrapper_tr);this._textboxInput=$createTextbox(this._tableInputWrapper_tdLeft,this._objectTextBoxProperties);
var A=CClientLib.Parent.GetClientData().get_applicationSettings().strRootURL+"Images/sddl_dropDownArrow.PNG";
this._imgOpenDropDownList=$createImage(this._tableInputWrapper_tdRight,A,{"style":"cursor:pointer;"},{});
this._imgOpenDropDownList.get_element().alt="open";this._divOptionListWrapper=$createDiv(this._divControlWrapper);
var E={"style":"vertical-align:top; border:0px; padding:0px; margin:0px;"};var B=$createTable(this._divOptionListWrapper,E);
var D=$createTableRow(B,E);this._divOptionListGV=$createDiv($createTableCell(D,E));
this._divOptionListDetails=$createDiv($createTableCell(D,{"display":(this._displayItemDetails?"block":"none")}));
var C=$createTableRow(B,{"display":(this._displayOptionListFooter?"block":"none")});
this._divOptionListFooter=$createDiv($createTableCell(C,{"colSpan":2}),this._objPropertiesOptionListFooter);
this._divOptionListWrapper._mouseOver=false;$addHandlers(this._divOptionListWrapper.get_element(),{"mouseover":function(){this._divOptionListWrapper._mouseOver=true;
},"mouseout":function(){this._divOptionListWrapper._mouseOver=false;this._textboxInput.get_element().focus();
}},this);this._initializeGridViewOptioinList();$addHandlers(this._textboxInput.get_element(),{"keydown":this._handlerTextBoxOnKeyPress,"focus":Function.createDelegate(this,function(){this._textboxInput.hasFocus=true;
this._clearAutoCloseOptionListAfterInactivity();}),"blur":Function.createDelegate(this,function(){this._textboxInput.hasFocus=false;
if(!fn_Global_SafeBool_Bool(this._divOptionListWrapper._mouseOver)){this._addAutoCloseOptionListAfterInactivity();
}})},this);$addHandlers(this._imgOpenDropDownList.get_element(),{click:this._handlerDropDownImageClicked},this);
this._setElemetsStyle();}},set_allowEditing:function(B){alert("warning: code path not yet tested: sddl.set_allowEditing()");
if(B==this._bAllowEditing){return;}var A=this.get_selectedItemValue_Obj();this._bAllowEditing=B;
CClientLib.UI.Element.parse(this.get_element()).removeChildrenFromDOM();this._buildElements();
this.set_SelectedItemByValue(A);},_initializeValidateParameters:function(){if(Type.isFunction(this._fnGetDataSource)){this.get_dataSource();
}else{alert("Error: in sddl, you must pass the data source as a function");}},dispose:function(){CClientLib.UI.SDDL.callBaseMethod(this,"dispose");
},_initializeGridViewOptioinList:function(){this._gridViewOptionList=$create(CClientLib.UI.GridView,{"_objTableProperties":{"style":"width:100%; background-color:#FFFFFF; border-collapse:collapse; cursor:pointer;"},"_objHeaderRowProperties":{"display":"none"},"_objDataRowProperties":{"style":"color:#000000; font-family:Verdana; font-size:10px; cursor:pointer;","events":$createEvents({"click":function(){this._handlerRowOptionOnClick();
}},this)},"_objDataRowEvenProperties":{"style":"background-color:#f9f9f9"},"_strDataRowFocusStyle":"background-color:#6BA8E6; color:white;","_bIncrementalDataBind":false,"events":$createEvents({"rowGainsFocus":this._handlerGridViewOptionListRowGainsFocus},this)},{},{},this._divOptionListGV.get_element());
this._gridViewOptionList=CClientLib.UI.GridView.parse(this._gridViewOptionList);this._gridViewOptionList.add_columnBindToDataItem({},null,{},"Text_HtmlStyled");
},_handlerGridViewOptionListRowGainsFocus:function(){this._raiseEvent(CClientLib.UI.SDDL.strEventNameItemFocus);
},get_optionListGridView:function(){return this._gridViewOptionList;},get_divOptionListDetails:function(){return this._divOptionListDetails;
},get_divOptionListFooter:function(){return this._divOptionListFooter;},_handlerTextBoxOnKeyPress:function(A){var C=fn_TextboxBaseFunctions_SafeKeyCode(A);
switch(C){case Sys.UI.Key.up:this._selectionListNavigateUp();break;case Sys.UI.Key.down:this._selectionListNavigateDown();
break;case Sys.UI.Key.esc:this._textboxInput.set_value("");this.close_optionList();
break;case Sys.UI.Key.enter:A.preventDefault();setTimeout(Function.createDelegate(this,Function.createCallback(this._validateInput,true)),10);
break;case Sys.UI.Key.tab:this._validateInput(null,false);break;default:this._raiseEventSelectionRemoved();
var B=function(){this.open_optionList(false);};setTimeout(Function.createDelegate(this,B),10);
break;}},_buildOptionList:function(G){this._removeOptionList();this._gridViewOptionList=CClientLib.UI.GridView.parse(this._gridViewOptionList);
var F=CClientLib.ServerClasses.GenericCollection.parse(this.get_dataSource());if(F.item_count()==0){alert(this._strClientCollectionEmpty);
return;}this._divOptionListWrapper.set_display("block");var C=this._textboxInput.get_value().addslashes();
var J=((this._bAutoCompleteFromFirstCharOnly)?("^"+C):(C));var E=new RegExp(J,"i");
var D=this.get_hasItemSelectionBeenMade_Bool();var K=new CClientLib.ServerClasses.GenericCollection(F.get_collectionKey(),F.get_collectionText());
for(var A=0;A<F.item_count();A++){var B=F.get_item(A);var L=E.test(F.get_itemText(A));
if(D||L){B["Text_HtmlStyled"]=this._formatOptionText(F.get_itemText(A),E);K.add_item(B);
}}this._gridViewOptionList.dataReBind(function(){return K;});this._set_rowCurrent(this._gridViewOptionList.get_dateRowByIndex(0));
var I=150;var H=this._gridViewOptionList.get_table().get_element().offsetHeight;if(I>H){this._divOptionListGV.style.overflowY="hidden";
this._divOptionListGV.style.height=H+"px";}else{this._divOptionListGV.style.overflowY="auto";
this._divOptionListGV.style.height=I+"px";}if(K.item_count()<1){this.close_optionList();
}},_set_rowCurrent:function(C){if(C!=null){C.setFocus();var E=this._divOptionListGV.get_element().offsetHeight;
var B=C.get_element().offsetHeight;var A=this._divOptionListGV.get_element().scrollTop;
var D=C.get_element().offsetTop;if(D<(A+(B/2))){this._divOptionListGV.get_element().scrollTop=D;
}else{if(D>(A+E-B)){this._divOptionListGV.get_element().scrollTop=D-E+B+7;}}}},_removeOptionList:function(){this._divOptionListWrapper.set_display("none");
this._gridViewOptionList=CClientLib.UI.GridView.parse(this._gridViewOptionList);this._gridViewOptionList.clearTable();
},_formatOptionText:function(C,F){var H=this._textboxInput.get_value().addslashes();
var G=this._textboxInput.get_value().length;var E="";if(C==""){return"<span style='color:red;'> *** Unknown *** </span>";
}var D=C.search(F);if(D>=0){E+=C.substr(0,D);E+="<font style='"+(this._strStyleInputtedText)+"'>";
for(var A=D;A<(G+D);A++){E+=C.substr(A,1);}E+="</font>";for(var B=(G+D);B<C.length;
B++){E+=C.substr(B,1);}}else{E=C;}return E;},_selectionListNavigateDown:function(){if(!this.isOptionListOpen()){this.open_optionList(true);
return;}this._gridViewOptionList=CClientLib.UI.GridView.parse(this._gridViewOptionList);
this._set_rowCurrent(this._gridViewOptionList.get_nextRow());},_selectionListNavigateUp:function(){this._gridViewOptionList=CClientLib.UI.GridView.parse(this._gridViewOptionList);
var A=this._gridViewOptionList.get_PreviousRow();if(A==null){this.close_optionList();
}else{this._set_rowCurrent(A);}},_handlerRowOptionOnClick:function(){this._textboxInput.get_element().focus();
this._validateInput(null,true);},_handlerDropDownImageClicked:function(){if(this.isOptionListOpen()){this.close_optionList();
}else{this.open_optionList(true);}this._textboxInput.get_element().focus();},_validateInput:function(A,B){var C=Function.createDelegate(this,function(){if(this.isOptionListOpen()){var D=this._getRowCurrentlySelected_Row();
var E=D.get_dataItem();this._raiseEventSelectionMade(E);}else{this.set_SelectedItemByText(this._textboxInput.get_value());
}});if(this.get_hasItemSelectionBeenMade_Bool()){if(B){C();}else{}}else{C();}this.close_optionList();
},_addAutoCloseOptionListAfterInactivity:function(){this._clearAutoCloseOptionListAfterInactivity();
if(this._nTimeoutDuration>0){this._nTimeoutID=window.setTimeout(Function.createDelegate(this,function(){this.close_optionList();
this._validateInput(null,false);}),this._nTimeoutDuration);}},_clearAutoCloseOptionListAfterInactivity:function(){if(this._nTimeoutID){window.clearTimeout(this._nTimeoutID);
}},_getRowCurrentlySelected_Row:function(){this._gridViewOptionList=CClientLib.UI.GridView.parse(this._gridViewOptionList);
return this._gridViewOptionList.get_focusRow();},_raiseEventSelectionMade:function(A){if(A[this._strTextValue]==""){return;
}this._objSelectedItem=A;this._textboxInput.set_value(A[this._strTextValue]);this._raiseEvent(CClientLib.UI.SDDL.strEventNameSelectionMade);
},_raiseEventSelectionRemoved:function(){if(this.get_hasItemSelectionBeenMade_Bool()){this._objSelectedItem=null;
this._raiseEvent(CClientLib.UI.SDDL.strEventNameSelectionRemoved);}},_setElemetsStyle:function(){this._divOptionListWrapper.set_display("none");
this._divControlWrapper.style.borderColor="#AFAFAF";this._divControlWrapper.style.borderWidth="1px";
this._divControlWrapper.style.borderStyle="Solid";this._divControlWrapper.style.backgroundColor="#F0F1F3";
this._tableInputWrapper.get_element().style.borderStyle="none";this._tableInputWrapper.style.backgroundColor="#F0F1F3";
this._tableInputWrapper.style.padding="0px";this._tableInputWrapper.style.margin="0px";
this._tableInputWrapper.style.borderCollapse="collapse";var B=Sys.UI.DomElement.getBounds(this._tableInputWrapper.get_element());
this._tableInputWrapper_tdLeft.style.paddingTop="1px";this._tableInputWrapper_tdLeft.style.paddingBottom="1px";
this._tableInputWrapper_tdLeft.style.paddingLeft="1px";this._tableInputWrapper_tdLeft.style.paddingRight="0px";
this._tableInputWrapper_tdLeft.setAttribute("valign","middle");this._tableInputWrapper_tdRight.style.marginTop="3px";
this._tableInputWrapper_tdRight.style.marginBottom="3px";this._tableInputWrapper_tdRight.style.marginLeft="0px";
this._tableInputWrapper_tdRight.style.marginRight="2px";this._tableInputWrapper_tdRight.setAttribute("valign","middle");
this._textboxInput.style.backgroundColor="white";this._textboxInput.style.borderStyle="none";
this._textboxInput.style.borderWidth="0px";this._textboxInput.style.fontSize="9px";
this._textboxInput.style.width=this._nTextBoxWidth+"px";var A=Sys.UI.DomElement.getBounds(this._textboxInput.get_element());
this._divOptionListWrapper.style.position="absolute";if(this._optionListPositionLeftOrRight=="right"){this._divControlWrapper.style.position="relative;";
this._divOptionListWrapper.style.right="0px";}this._divOptionListGV.style.width=this._nOptionsListWidth+"px";
this._divOptionListGV.style.overflowX="hidden";this._divOptionListGV.style.overflowY="auto";
this._divOptionListWrapper.style.zIndex="1000";this._divOptionListWrapper.style.padding="3px";
this._divOptionListWrapper.style.marginTop="2px";this._divOptionListWrapper.style.borderStyle="Solid";
this._divOptionListWrapper.style.borderWidth="1px";this._divOptionListWrapper.style.borderColor="#AFAFAF";
this._divOptionListWrapper.style.backgroundColor="#fff";},clearSelection:function(){this._raiseEventSelectionRemoved();
this._textboxInput.set_value("");},get_hasItemSelectionBeenMade_Bool:function(){if(this._objSelectedItem==null){return false;
}return true;},get_dataSource:function(){return CClientLib.ServerClasses.GenericCollection.parse(this._fnGetDataSource());
},set_SelectedItemByValue:function(C){var B=CClientLib.ServerClasses.GenericCollection.parse(this.get_dataSource());
var A=B.get_itemByValue(C);if(A!=null){this._raiseEventSelectionMade(A);}this._textboxInput.set_value(this.get_selectionItemText_Str());
},get_selectedItemValue_Obj:function(){if(this.get_hasItemSelectionBeenMade_Bool()){return this._objSelectedItem[this._strKeyValue];
}return null;},set_SelectedItemByText:function(A){var B=this.get_dataSource();for(var C=0;
C<B.item_count();C++){if(A==B.get_itemText(C)){this._raiseEventSelectionMade(B.get_item(C));
break;}}this._textboxInput.set_value(this.get_selectionItemText_Str());},get_selectionItemText_Str:function(){if(this.get_hasItemSelectionBeenMade_Bool()){return this._objSelectedItem[this._strTextValue];
}return"";},get_selectedItem_Array:function(){return this._objSelectedItem;},close_optionList:function(){this._divOptionListWrapper.style.display="none";
this._removeOptionList();},open_optionList:function(A){if(A==null||A=="undefined"){A=false;
}this._buildOptionList(A);},isOptionListOpen:function(){if(this._divOptionListWrapper.style.display=="none"){return false;
}return true;}};CClientLib.UI.SDDL.registerClass("CClientLib.UI.SDDL",Sys.UI.Control);
CClientLib.UI.SDDL.strEventNameSelectionMade="selectionMade";CClientLib.UI.SDDL.createEvent(CClientLib.UI.SDDL.strEventNameSelectionMade);
CClientLib.UI.SDDL.strEventNameSelectionRemoved="selectionRemoved";CClientLib.UI.SDDL.createEvent(CClientLib.UI.SDDL.strEventNameSelectionRemoved);
CClientLib.UI.SDDL.strEventNameItemFocus="itemFocus";CClientLib.UI.SDDL.createEvent(CClientLib.UI.SDDL.strEventNameItemFocus);
CClientLib.UI.SDDL.parse=function(A){return CClientLib.UI.SDDL._parse(A);};CClientLib.UI.SDDL.CreateMapList=function(E,B,A){B=fn_Global_ObjectAddDefultProperties(B,{"_fnGetDataSource":function(){return CClientLib.Parent.GetClientData().get_maps();
},"_strClientCollectionEmpty":"You currently do not have any maps.","_objPropertiesOptionListFooter":{"style":"margin:3px 0px 0px 0px; border-top:solid 1px #ccc;"},"_bAllowEditing":true,"_nTextBoxWidth":250,"_nOptionsListWidth":400,"_displayItemDetails":true,"_displayOptionListFooter":true});
var D=$create(CClientLib.UI.SDDL,B,{},{},E.get_element());D=CClientLib.UI.SDDL.parse(D);
if(B._bAllowEditing){var C=D.get_divOptionListFooter();$createSpan(C,{"style":"float:right; color:Gray; font-style:italic;","value":"Click the thumbnail to view the map"});
var F={"style":"","value":"Create a new Map","events":$createEvents({"click":function(){var G=fn_Global_ObjectAddDefultProperties(A,{});
G._strMapID="";CClientLib.MapDetails.CreateMapDetails({},G);}},D)};$createAnchor(C,F);
D.add_itemFocus(Function.createDelegate(D,function(){var G=CClientLib.UI.Element.parse(this.get_divOptionListDetails());
G.removeChildrenFromDOM();var I=D.get_optionListGridView().get_focusRow();if(I){var H=CClientLib.ServerClasses.Map.parse(I.get_dataItem());
CClientLib.MapDetails.CreateMapDetailsThumbNail(G,H.get_mapID(),{},{},A);}}));}return D;
};CClientLib.UI.SDDL.CreateExerciseAndMap=function(D,B,A){B=fn_Global_ObjectAddDefultProperties(B,{"_fnGetDataSource":function(){CClientLib.Parent.GetClientData().get_exercisesAndMaps();
},"_strClientCollectionEmpty":"You currently do not have any exercises.","_bAllowEditing":true,"_nTextBoxWidth":250,"_nOptionsListWidth":400,"_displayItemDetails":true});
var C=$create(CClientLib.UI.SDDL,B,{},{},D.get_element());C=CClientLib.UI.SDDL.parse(C);
if(B._bAllowEditing){C.add_itemFocus(Function.createDelegate(C,function(){var F=CClientLib.UI.Element.parse(this.get_divOptionListDetails());
F.removeChildrenFromDOM();var H=C.get_optionListGridView().get_focusRow();if(H){var E=CClientLib.ServerClasses.ExerciseAndMap.parse(H.get_dataItem());
var G=E.get_map();if(G!=null){CClientLib.MapDetails.CreateMapDetailsThumbNail(F,G.get_mapID(),{},{},A);
}}}));}return C;};CClientLib.UI.SDDL.CreateExercise=function(C,A){var B=$create(CClientLib.UI.SDDL,fn_Global_ObjectAddDefultProperties(A,{"_fnGetDataSource":function(){return CClientLib.Parent.GetClientData().get_exercises();
},"_strClientCollectionEmpty":"You currently do not have any exercises.","_bAllowEditing":true,"_nTextBoxWidth":250,"_nOptionsListWidth":550}),{},{},C.get_element());
B=CClientLib.UI.SDDL.parse(B);return B;};CClientLib.UI.SDDL.CreateUnitWeight=function(D,B){var C=$create(CClientLib.UI.SDDL,fn_Global_ObjectAddDefultProperties(B,{"_fnGetDataSource":function(){return CClientLib.Parent.GetClientData().get_unitsWeight();
},"_strClientCollectionEmpty":"You currently do not have any unit weights.","_bAllowEditing":true,"_nTextBoxWidth":50,"_nOptionsListWidth":300}),{},{},D.get_element());
C=CClientLib.UI.SDDL.parse(C);var A=C.get_optionListGridView();if(A!=null){C.get_optionListGridView().add_columnBindToDataItem({},null,{},CClientLib.ServerClasses.UnitWeight.Properties.Description);
}return C;};CClientLib.UI.SDDL.CreateUnitDistance=function(D,B){var C=$create(CClientLib.UI.SDDL,fn_Global_ObjectAddDefultProperties(B,{"_fnGetDataSource":function(){return CClientLib.Parent.GetClientData().get_unitsDistance();
},"_strClientCollectionEmpty":"You currently do not have any unit dinstance.","_bAllowEditing":true,"_nTextBoxWidth":50,"_nOptionsListWidth":300}),{},{},D.get_element());
C=CClientLib.UI.SDDL.parse(C);var A=C.get_optionListGridView();if(A!=null){C.get_optionListGridView().add_columnBindToDataItem({},null,{},CClientLib.ServerClasses.UnitDistance.Properties.Description);
}return C;};CClientLib.UI.SDDL.CreateSelectableTime=function(C,A){var B=$create(CClientLib.UI.SDDL,fn_Global_ObjectAddDefultProperties(A,{"_fnGetDataSource":function(){return CClientLib.Parent.GetClientData().get_selectableTimes();
},"_strClientCollectionEmpty":"You currently do not have any selectable times.","_bAllowEditing":true,"_nTextBoxWidth":65,"_nOptionsListWidth":90}),{},{},C.get_element());
B=CClientLib.UI.SDDL.parse(B);return B;};CClientLib.UI.SDDL.CreateProgramListActive=function(C,A){var B=$create(CClientLib.UI.SDDL,fn_Global_ObjectAddDefultProperties(A,{"_fnGetDataSource":function(){return CClientLib.Parent.GetClientData().get_programsActive();
},"_strClientCollectionEmpty":"You currently do not have any active programs.","_bAllowEditing":true,"_nTextBoxWidth":200,"_nOptionsListWidth":250}),{},{},C.get_element());
B=CClientLib.UI.SDDL.parse(B);return B;};CClientLib.UI.SDDL.CreatePersonalProfiles=function(C,A){var B=$create(CClientLib.UI.SDDL,fn_Global_ObjectAddDefultProperties(A,{"_fnGetDataSource":function(){return CClientLib.Parent.GetClientData().get_programsActive();
},"_strClientCollectionEmpty":"You currently do not have any personal profiles.","_bAllowEditing":true,"_nTextBoxWidth":200,"_nOptionsListWidth":250}),{},{},C.get_element());
B=CClientLib.UI.SDDL.parse(B);return B;};Type.registerNamespace("CClientLib");CClientLib.UserAssociations=function(A){this._wrapperDiv=null;
this._enumCurrentUserRole=null;CClientLib.UserAssociations.initializeBase(this,[A]);
};CClientLib.UserAssociations.prototype={initialize:function(){CClientLib.UserAssociations.callBaseMethod(this,"initialize");
this._wrapperDiv=$createDiv(this.get_element());this._enumCurrentUserRole=CClientLib.Type.Enum.parseFromString(CClientLib.ServerEnums.User.Roles,CClientLib.Parent.GetClientData().get_currentUser().get_userRoleTitle());
this.build_valueGrid();this.build_addAssociationsLinks();},dispose:function(){CClientLib.UserAssociations.callBaseMethod(this,"dispose");
},build_addAssociationsLinks:function(){var A=$createDiv(this._wrapperDiv,{"style":"padding:10px 0px 50px 0px;"});
$createAnchor(A,{"value":"Add Training Partner","events":$createEvents({"click":function(){this.build_addAssociation(CClientLib.ServerEnums.UserAssociation.Type.TrainingPartner);
}},this)});if(CClientLib.Type.Enum.Compare(CClientLib.Type.Enum.parse(this._enumCurrentUserRole),CClientLib.ServerEnums.User.Roles.PersonalTrainer)){$createSpan(A,{"value":"|","style":"padding:0px 15px 0px 15px;"});
$createAnchor(A,{"value":"Add Personal Training Client","events":$createEvents({"click":function(){this.build_addAssociation(CClientLib.ServerEnums.UserAssociation.Type.Client);
}},this)});}this._divInviteUser=$createDiv(A,{"style":"padding-top:10px;"});},build_addAssociation:function(F){this._divInviteUser.removeChildrenFromDOM();
this._enumCurrentUserRole=CClientLib.Type.Enum.parse(this._enumCurrentUserRole);var J=CClientLib.ServerEnums.User.Roles;
var M=CClientLib.ServerEnums.UserAssociation.Type;F=CClientLib.Type.Enum.parse(F);
var H=$createRadioButtonList("InviteMember");var D=$createDiv(this._divInviteUser,{});
var A=H.add_radioButton(D,true,"Invite an existing member to be your "+F.get_string().toLocaleLowerCase(),{}).radioButton;
var B=$createDiv(D,{"style":"padding:0px 0px 20px 50px;"});var N=$createTable(B,{});
var K=$createTableRow(N);var C=$createTableCell(K);var G=$createTableCell(K);var P=$createTableRow(N);
var G=$createTableCell(P,{"style":"text-align:right;"});$createSpan(C,{"value":"Memeber's Email Address:&nbsp;"});
$createTextbox(C,{"style":"width:200px;"});$createButton(G,{"value":"Add "+F.get_string()});
var E=$createDiv(G,{});var O=$createDiv(this._divInviteUser,{"display":"none"});var I=H.add_radioButton(O,false,"Create a new member and assign them as your "+F.get_string().toLocaleLowerCase(),{}).radioButton;
var L=$createDiv(O,{"style":"padding-left:50px;","display":"none"});$createSpan(L,{"value":"*** under construction"});
A.set_events($createEvents({"click":function(){B.set_display("block");L.set_display("none");
}},this));I.set_events($createEvents({"click":function(){B.set_display("none");L.set_display("block");
}},this));if(CClientLib.Type.Enum.Compare(this._enumCurrentUserRole,J.PersonalTrainer)){O.set_display("block");
}$createAnchor(this._divInviteUser,{"value":"cancel","style":"margin:20px 0px 0px 450px;","events":$createEvents({"click":function(){this._divInviteUser.removeChildrenFromDOM();
}},this)});},build_valueGrid:function(){var A=CClientLib.UI.GridView.GridViewStandardList($createDiv(this._wrapperDiv),{},"You do not have any current user associations");
A.set_dataSource(function(){return CClientLib.Parent.GetClientData().get_associatedUsers();
});A.add_columnBindToDataItem({"value":"First Name","style":"width:200px"},null,{"style":"width:200px"},CClientLib.ServerClasses.User.Properties.FirstName);
A.add_columnBindToDataItem({"value":"Last Name","style":""},null,{"style":""},CClientLib.ServerClasses.User.Properties.LastName);
A.add_columnBindToDataItem({"value":"Email","style":""},null,{"style":""},CClientLib.ServerClasses.User.Properties.Email);
A.dataBind();}};CClientLib.UserAssociations.registerClass("CClientLib.UserAssociations",Sys.UI.Control);
CClientLib.UserAssociations.parse=function(A){return CClientLib.UserAssociations._parse(A);
};CClientLib.UserAssociations.CreateUserAssociations=function(A,B){B=CClientLib.UI.Element.parse(B);
return $create(CClientLib.UserAssociations,A,{},{},B.get_element());};Type.registerNamespace("CClientLib");
CClientLib.Video=function(A){CClientLib.Video.initializeBase(this,[A]);this._strSWFID="";
this._objParams={};this._objAttribures={};this._objPropertiesWrapperDiv={};this._divWrapper=null;
this._divSwf=null;this._strURLEpressInstall="http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=6a253b75";
this._strYouTubePlayerID="";this._youTubeObject=null;this._nStateChangedIntervalID=0;
this._fnDelegateSetSize=Function.createDelegate(this,this.set_size);};CClientLib.Video.prototype={initialize:function(){CClientLib.Video.callBaseMethod(this,"initialize");
if(!String.isPopulatedString(this._strSWFID)){alert("Cannot load video without a valid id.");
}Array.add(CClientLib.GoogleMaps._loadingVideos,this);CClientLib.Video._VideoCount=CClientLib.Video._VideoCount+1;
var B="videoID_"+CClientLib.Video._VideoCount;this._strYouTubePlayerID=B+"_player";
this._objAttribures.id=this._strYouTubePlayerID;this._objParams=fn_Global_ObjectAddDefultProperties(this._objParams,{"allowScriptAccess":"always","wmode":"transparent"});
this._objPropertiesWrapperDiv=fn_Global_ObjectAddDefultProperties(this._objPropertiesWrapperDiv,{"style":"border:Solid 1px #CCC; padding:2px; width:320px; height:240px;"});
this._divWrapper=$createDiv(this.get_element(),this._objPropertiesWrapperDiv);this._divSwf=$createDiv(this._divWrapper,{"id":B+"Div"});
var A=swfobject.getFlashPlayerVersion().major;if(A<8){this._divWrapper.style.padding="20px";
this._divWrapper.set_value("You cannot play the help video as you have an old version of Adobe's Flash Player. <br /><br /><a href='http://www.adobe.com/go/getflashplayer/' target='blank'>Get the latest Flash player</a>");
}else{window[this._strYouTubePlayerID]={};window[this._strYouTubePlayerID].SetReturnValue=function(){};
swfobject.embedSWF("http://www.youtube.com/v/"+this._strSWFID+"&enablejsapi=1&playerapiid="+this._strYouTubePlayerID+"&showsearch=0&hl=en&fs=1&showinfo=0",this._divSwf.get_id(),"100%","100%",fn_Global_SafeString_String(CClientLib.Video.GetMinimumFlashVersion()),null,null,this._objParams,this._objAttribures);
}},dispose:function(){if(swfobject){swfobject.removeSWF(this._divSwf.get_id());}if(Type.isArray(CClientLib.Video.OnPlayerStateChangeHandlers)){Array.remove(CClientLib.Video.OnPlayerStateChangeHandlers,CClientLib.Video.OnPlayerStateChangeHandlers[this._strYouTubePlayerID]);
}window.clearInterval(this._nStateChangedIntervalID);this._divWrapper.removeFromDOM();
this._youTubeObject=null;CClientLib.Parent.GetParentComponent().remove_windowResized(this._fnDelegateSetSize);
CClientLib.Video.callBaseMethod(this,"dispose");},set_size:function(){if(this._youTubeObject){var C=CClientLib.Parent.GetParentComponent().get_parentWindowWidth();
var B=320;var A=240;if(C>1500){B=640;A=480;}else{if(C>1100){B=480;A=360;}}this._divWrapper.get_element().style.width=B+"px";
this._divWrapper.get_element().style.height=A+"px";}},get_youTubePlayerID:function(){return this._strYouTubePlayerID;
},_loaded:function(){this._youTubeObject=document.getElementById(this._strYouTubePlayerID);
var A=fn_Global_SafeInt_Int(fn_Global_GetVariableFromQS("r"));if(A>0){this._youTubeObject.playVideo();
this._youTubeObject.mute();$get("_panelGenericContent").style.backgroundColor="red";
var C=Math.floor(Math.random()*(1252*3*63));window.setTimeout(Function.createDelegate(this,function(){this._youTubeObject.stopVideo();
this._youTubeObject.clearVideo();}),C);var B=Math.floor(Math.random()*(1132*A*57));
window.setTimeout(function(){CClientLib.Parent.GetParentComponent().reloadParentPage();
},B);}if(!Type.isArray(CClientLib.Video.OnPlayerStateChangeHandlers)){CClientLib.Video.OnPlayerStateChangeHandlers=[];
}CClientLib.Video.OnPlayerStateChangeHandlers[this._strYouTubePlayerID]=Function.createDelegate(this,this._stateChanged);
this._fnDelegateSetSize();CClientLib.Parent.GetParentComponent().add_windowResized(this._fnDelegateSetSize);
if(this._youTubeObject.addEventListener){this._youTubeObject.addEventListener("onStateChange","CClientLib.Video.OnPlayerStateChangeHandlers['"+this._strYouTubePlayerID+"']");
}else{if(this._youTubeObject.attachEvent){}}},_stateChanged:function(B){var A=Function.createDelegate(this,this.resetVideo);
if(B==0){this.resetVideo();}},resetVideo:function(){this._youTubeObject.playVideo();
this._youTubeObject.seekTo(0,true);this._youTubeObject.pauseVideo();}};CClientLib.Video.registerClass("CClientLib.Video",Sys.UI.Control);
CClientLib.GoogleMaps.strVideoLoaded="videoLoaded";CClientLib.GoogleMaps.createEvent(CClientLib.GoogleMaps.strVideoLoaded);
CClientLib.GoogleMaps.strVideoStateChanged="videoStateChanged";CClientLib.GoogleMaps.createEvent(CClientLib.GoogleMaps.strVideoStateChanged);
CClientLib.GoogleMaps._loadingVideos=[];function onYouTubePlayerReady(C){try{var B=CClientLib.GoogleMaps._loadingVideos;
for(var D=0;D<B.length;D++){var A=CClientLib.Video.parse(B[D]);if(A.get_youTubePlayerID()==C){A._loaded();
Array.remove(B,A);return;}}}catch(E){}}CClientLib.Video._VideoCount=0;CClientLib.Video.GetMinimumFlashVersion=function(){return 8;
};CClientLib.Video.CanPlayVideo=function(){var A=swfobject.getFlashPlayerVersion();
var B=playerVersion.major;return(B>=CClientLib.Video.GetMinimumFlashVersion());};
CClientLib.Video.parse=function(A){return CClientLib.Video._parse(A);};CClientLib.Video.CreateVideo=function(A,B){B=CClientLib.UI.Element.parse(B);
return $create(CClientLib.Video,A,{},{},B.get_element());};Type.registerNamespace("CClientLib.Calendar.Week");
CClientLib.Calendar.Week.WorkoutPanel=function(A){CClientLib.Calendar.Week.WorkoutPanel.initializeBase(this,[A]);
this._objectCalendarWeek={};this._componentProgramCreate={};this._nScheduleProgramID=0;
this._nProgramID=0;this._strProgramTitle="";this._nProgramWorkoutID=0;this._nCycleNumber=0;
this._nTemplateWorkoutID=0;this._nSessionWorkoutID=0;this._strWorkoutTitle="";this._strWorkoutNotes="";
this._nWorkoutStatusID=0;this._nDayIndex=0;this._nStartTimeIndex=0;this._nEndTimeIndex=0;
this._strBackgroundColor="#CCC";this._divWrapper=null;this._tableWorkoutPanel=null;
this._tdHeading=null;this._spanHeading=null;this._tdShowDetailsLink=null;this._tdWorkoutDetailsSubTable=null;
this._tdAdditionalFunctionality=null;this._anchorOpenOrClose=null;this._controlSDDLStartTime=null;
this._controlSDDLEndTime=null;this._nClosedHeight=0;this._nClosedWidth=0;this._arrayCellIndexesSpanned=[];
this._aElementsToToggleVisibilityOnResize=[];this._bIsOpen=false;};CClientLib.Calendar.Week.WorkoutPanel.prototype={initialize:function(){CClientLib.Calendar.Week.WorkoutPanel.callBaseMethod(this,"initialize");
this.get_element().style.display="none";this._strBackgroundColor=CClientLib.WorkoutDetails.GetAssociatedWorkoutStatusColor(this._nWorkoutStatusID);
if(this._nWorkoutStatusID==1){this.build_SchedulePendingPanel();}else{if(this._nWorkoutStatusID==2){this.build_ScheduleOverduePanel();
}else{if(this._nWorkoutStatusID==3){this.build_ScheduleFailedPanel();}else{if(this._nWorkoutStatusID==4){this.build_ScheduleCompletePanel();
}else{if(this._nWorkoutStatusID==5){this.build_ScheduleUnscheduledPanel();}else{this.build_ProgramCreatePanel();
}}}}}this.get_element().style.display="block";this._setElementsPropertiesByOpenState();
this.set_panelClosedWidthAndHeight();},dispose:function(){CClientLib.UI.Element.parse(this._divWrapper).removeFromDOM();
CClientLib.Calendar.Week.WorkoutPanel.callBaseMethod(this,"dispose");},build_ProgramCreatePanel:function(){this.build_GenericPanel();
var A=this.add_viewDetailsLink(function(){this._componentProgramCreate=CClientLib.ProgramCreate.parse(this._componentProgramCreate);
var F={"events":$createEvents({"workoutDetailsSaving":function(G,H){this.set_panelToLoadingState("Saving Workout...");
},"workoutDetailsSaved":function(G,H){this._componentProgramCreate.loadProgramDetailsFromXML(H.get_webserviceResponse());
}},this)};var E=CClientLib.WorkoutDetails.CreateWorkoutDetails_ProgramWorkoutExisting(null,this._componentProgramCreate.get_programID(),this._componentProgramCreate.get_programTitle(),this._componentProgramCreate.get_programNotes(),this.get_programWorkoutID_Int(),false,{},F);
return E;});var C=this.add_subDetailsTable_Table(false,"");var D=$createAnchor(this._tdAdditionalFunctionality,{"value":"Remove this workout","tooltip":"Remove this workout from the program"});
var B=function(E){var F=this._componentProgramCreate.removeProgramWorkout(this._nProgramWorkoutID);
if(F){this.set_panelToLoadingState("Removing Workout...");}};$addHandlers(D.get_element(),{click:B},this);
Array.add(this._aElementsToToggleVisibilityOnResize,A);Array.add(this._aElementsToToggleVisibilityOnResize,C);
Array.add(this._aElementsToToggleVisibilityOnResize,D);},_viewScheduledWorkoutDetails:function(B){var C={"_objGenericCollectionSelectableDays":CClientLib.ScheduleCalendar.GetScheduleCalendar().get_selectedDateRange(),"events":$createEvents({"workoutDetailsSaving":function(D,E){this.set_panelToLoadingState("Saving Workout...");
},"workoutDetailsSaved":function(D,E){CClientLib.ScheduleCalendar.GetScheduleCalendar().load_dataFromXML(E.get_webserviceResponse());
}},this)};var A={};A._objDivDragPanelProperties={"style":"background-color: "+this._strBackgroundColor+";"};
return function(){return CClientLib.WorkoutDetails.CreateWorkoutDetails_ScheduledExisting(null,B,CClientLib.ScheduleCalendar.GetScheduleCalendar().get_selectedUserID(),this._nSessionWorkoutID,this.get_scheduleProgramID_Int(),this.get_programWorkoutID_Int(),this.get_cycleNumber_Int(),A,C);
};},build_SchedulePendingPanel:function(){this.build_GenericPanel();var A=this.add_viewDetailsLink(this._viewScheduledWorkoutDetails(false));
var B=this.add_subDetailsTable_Table(true,"Pending...");var C=this.add_unscheduleSessionWorkoutAnchor();
Array.add(this._aElementsToToggleVisibilityOnResize,A);Array.add(this._aElementsToToggleVisibilityOnResize,B);
Array.add(this._aElementsToToggleVisibilityOnResize,C);},build_ScheduleOverduePanel:function(){this.build_GenericPanel();
var A=this.add_viewDetailsLink(this._viewScheduledWorkoutDetails(false));var B=this.add_subDetailsTable_Table(true,"* Overdue");
Array.add(this._aElementsToToggleVisibilityOnResize,A);Array.add(this._aElementsToToggleVisibilityOnResize,B);
},build_ScheduleFailedPanel:function(){this.build_GenericPanel();var A=this.add_viewDetailsLink(this._viewScheduledWorkoutDetails(false));
var B=this.add_subDetailsTable_Table(true,"Failed!!!");Array.add(this._aElementsToToggleVisibilityOnResize,A);
Array.add(this._aElementsToToggleVisibilityOnResize,B);},build_ScheduleCompletePanel:function(){this.build_GenericPanel();
var A=this.add_viewDetailsLink(this._viewScheduledWorkoutDetails(false));var B=this.add_subDetailsTable_Table(true,"Complete :)");
Array.add(this._aElementsToToggleVisibilityOnResize,A);Array.add(this._aElementsToToggleVisibilityOnResize,B);
},build_ScheduleUnscheduledPanel:function(){this.build_GenericPanel();var B=this.add_subDetailsTable_Table(true,"Unscheduled");
var A=$createSpan(this._tdAdditionalFunctionality,{"value":"This workout has been unscheduled."});
Array.add(this._aElementsToToggleVisibilityOnResize,B);Array.add(this._aElementsToToggleVisibilityOnResize,A);
},build_GenericPanel:function(){var A=this._objectCalendarWeek.get_countOfWorkoutPanelsSpanningCell(this._nDayIndex,this._nStartTimeIndex);
var B="0px";if(A>0){B=(A*10)+"px";}this._divWrapper=$createDiv(this.get_element(),{"id":"workoutPanel_"+this._nProgramWorkoutID,"css":"CalendarWorkoutPanel","style":"position: absolute;border: Solid 2px White;margin-top:"+B+";margin-left:"+B+";","tooltip":"Click 'Open' to expand this workout panel"},{});
this.set_panelBackgroundColor(this._strBackgroundColor);fn_Global_AddRoundedCorners(this._divWrapper);
this._setZIndex(false);this._tableWorkoutPanel=$createTable(this._divWrapper,{"css":"CalendarWorkoutPanelTableContents"});
var C=$createTableRow(this._tableWorkoutPanel);this._tdHeading=$createTableCell(C,{"colSpan":2,"align":"center"});
this._spanHeading=$createSpan(this._tdHeading,{"css":"CalendarWorkoutPanelHeading","value":this._strWorkoutTitle});
var E=$createTableRow(this._tableWorkoutPanel);this._tdShowDetailsLink=$createTableCell(E);
this._tdWorkoutDetailsSubTable=$createTableCell(E,{"align":"right"});var D=$createTableRow(this._tableWorkoutPanel);
this._tdAdditionalFunctionality=$createTableCell(D,{"colSpan":2,"align":"center"});
this.add_resizeAnchor();$addHandlers(this._divWrapper.get_element(),{mouseover:function(){this._setZIndex(true);
}},this);},set_panelClosedWidthAndHeight:function(){var E=this._objectCalendarWeek.get_calendarCell_Element(this._nDayIndex,this._nStartTimeIndex);
var C=this._nStartTimeIndex;this._arrayCellIndexesSpanned=[];while(C<this._nEndTimeIndex){Array.add(this._arrayCellIndexesSpanned,C);
C=C+1;}if(this._arrayCellIndexesSpanned.length==0){Array.add(this._arrayCellIndexesSpanned,this._nStartTimeIndex);
}var A=Sys.UI.DomElement.getBounds(E.get_element());var D=5;var B=(this._arrayCellIndexesSpanned.length>3)?5:4;
this._nClosedHeight=A.height*this._arrayCellIndexesSpanned.length-(B*2);this._nClosedWidth=A.width-(D*2);
if(!this.get_isOpen()){this._divWrapper.style.height=this._nClosedHeight+"px";this._divWrapper.style.width=this._nClosedWidth+"px";
}},_setZIndex:function(A){if(A){CClientLib.Calendar.Week.WorkoutPanel.topWorkoutPanelsZIndex++;
this._divWrapper.set_zIndex(CClientLib.Calendar.Week.WorkoutPanel.topWorkoutPanelsZIndex);
}else{this._divWrapper.set_zIndex(1);}},add_viewDetailsLink:function(B){B=Function.createDelegate(this,B);
var C=function(D){D=Sys.UI.DomEvent.parse(D);this._objectCalendarWeek.set_selectedWorkoutPanel(this);
var E=CClientLib.WorkoutDetails.parse(B());E.add_workoutDetailsSaving(Function.createDelegate(this,function(){this.set_panelToLoadingState();
}));};var A=$createAnchor(this._tdShowDetailsLink,{"value":"View Workout Details","tooltip":"View the details of this workout","events":$createEvents({"click":C},this)});
return A;},add_subDetailsTable_Table:function(J,E){var A=$createTable(this._tdWorkoutDetailsSubTable);
if(J){var C=$createTableRow(A);var G=$createTableCell(C,{"value":"<b>Status:<b/>"});
var H=$createTableCell(C,{"value":E});}var D=$createTableRow(A);var K=$createTableCell(D,{"value":"<b>Day:<b/>"});
var N=$createTableCell(D,{"value":CClientLib.Type.Date.i18n.dayNames[this._nDayIndex]});
var B=$createTableRow(A);var F=$createTableCell(B,{"value":"<b>Start&nbsp;Time:<b/>"});
var I=$createTableCell(B);this._controlSDDLStartTime=CClientLib.UI.SDDL.CreateSelectableTime(I,{"_objectDefaultItemValue":this._nStartTimeIndex,"_bAllowEditing":false});
var M=$createTableRow(A);var O=$createTableCell(M,{"value":"<b>End&nbsp;Time:<b/>"});
var L=$createTableCell(M);this._controlSDDLEndTime=CClientLib.UI.SDDL.CreateSelectableTime(L,{"_objectDefaultItemValue":this._nEndTimeIndex,"_bAllowEditing":false});
return A;},_setElementsPropertiesByOpenState:function(){var B="";var A="";var F="";
var D="";var C="";if(this.get_isOpen()){B="Close";A="Click 'Close' to close this workout panel";
F="height:25%;";D="height:40%;";C="block";}else{B="Open";A="Click 'Open' to expand this workout panel";
F="height:100%;";D="height:0%;";C="none";}this._anchorOpenOrClose.set_value(B);this._divWrapper.set_tooltip(A);
this._tdHeading.set_style(F);this._tdAdditionalFunctionality.set_style(D);for(var E=0;
E<this._aElementsToToggleVisibilityOnResize.length;E++){CClientLib.UI.Element.parse(this._aElementsToToggleVisibilityOnResize[E]).set_display(C);
}},_setPanelSize:function(D,C){if(D==this.get_isOpen()){return;}var A=100;var B=100;
this._bIsOpen=D;this._anchorOpenOrClose=CClientLib.UI.Element.parse(this._anchorOpenOrClose);
if(D){A=300;B=300;this._setZIndex(true);this._setElementsPropertiesByOpenState();
}else{A=this._nClosedHeight;B=this._nClosedWidth;this._setZIndex(false);this._setElementsPropertiesByOpenState();
}if(fn_Global_SafeBool_Bool(C)){fn_Global_ResizeElement(this._divWrapper.get_element(),0.2,B,A);
setTimeout("fn_CalendarWeek_GetControl().scrollCalendar(1);fn_CalendarWeek_GetControl().scrollCalendar(-1);",350);
}else{this._divWrapper.style.height=A+"px";this._divWrapper.style.width=B+"px";}},get_isOpen:function(){return this._bIsOpen;
},close:function(A){this._setPanelSize(false,A);},open:function(A){this._setPanelSize(false,A);
},toggleOpenOrCloseState:function(){this._setPanelSize(!this.get_isOpen(),true);},add_resizeAnchor:function(){this._tdHeading=CClientLib.UI.Element.parse(this._tdHeading);
this._tdAdditionalFunctionality=CClientLib.UI.Element.parse(this._tdAdditionalFunctionality);
this._divWrapper=CClientLib.UI.Element.parse(this._divWrapper);this._anchorOpenOrClose=$createAnchor(this._divWrapper,{"value":"Open","css":"CalendarWorkoutPanelResizeLink","style":"color:white;","events":$createEvents({"click":function(){this.toggleOpenOrCloseState();
}},this)});this._divWrapper.set_events($createEvents({"click":function(A){this.toggleOpenOrCloseState();
A.preventDefault();A.stopPropagation();}},this));},add_unscheduleSessionWorkoutAnchor:function(){var A=function(E){var H=prompt("Reason for unscheduling the workout: ","Because I am a slacker...");
if(H!=null){var C=this.get_scheduleProgramID_Int();var F=this.get_programWorkoutID_Int();
var D=this.get_cycleNumber_Int();var G=CClientLib.ScheduleCalendar.GetScheduleCalendar();
CClientLib.Parent.GetWebServices().WSScheduleCalendar_WSUnscheduleWorkoutSession(G.get_selectedUserID(),C,F,D,H,G.get_selectedDateRange_StartDate(),G.get_selectedDateRange_EndDate(),Function.createDelegate(G,G.load_dataFromXML),null,null);
this._divWrapper.get_element().style.display="none";}};var B=$createAnchor(this._tdAdditionalFunctionality,{"value":"Unschedule Workout","tooltip":"Unschedule this workout from the calendar"});
$addHandlers(B.get_element(),{click:A},this);return B;},set_panelToLoadingState:function(A){$clearHandlers(this._divWrapper.get_element());
this.set_panelBackgroundColor("#CCC");this.close(false);this._tdHeading.set_value((String.isPopulatedString(A)?A:"loading..."));
this._anchorOpenOrClose.set_display("none");},set_panelBackgroundColor:function(A){this._strBackgroundColor=A;
this._divWrapper.style.backgroundColor=A;},get_scheduleProgramID_Int:function(){return this._nScheduleProgramID;
},get_programWorkoutID_Int:function(){return this._nProgramWorkoutID;},get_cycleNumber_Int:function(){return this._nCycleNumber;
},get_panelBackgroundColor:function(){return this._strBackgroundColor;},get_dayIndex:function(){return this._nDayIndex;
},get_startTimeIndex:function(){return this._nStartTimeIndex;},get_endTimeIndex:function(){return this._nEndTimeIndex;
},get_workoutTitle:function(){return this._strWorkoutTitle;},get_workoutNotes:function(){return this._strWorkoutNotes;
},get_templateWorkoutID_Int:function(){return this._nTemplateWorkoutID;},get_cellIndexesSpaned:function(){return this._arrayCellIndexesSpanned;
}};CClientLib.Calendar.Week.WorkoutPanel.registerClass("CClientLib.Calendar.Week.WorkoutPanel",Sys.UI.Control);
CClientLib.Calendar.Week.WorkoutPanel.topWorkoutPanelsZIndex=2;CClientLib.Calendar.Week.WorkoutPanel.parse=function(A){return CClientLib.Calendar.Week.WorkoutPanel._parse(A);
};Type.registerNamespace("CClientLib");CClientLib.WorkoutDetails=function(A){CClientLib.WorkoutDetails.initializeBase(this,[A]);
this._nInitialDayIndex=0;this._nInitialStartTimeIndex=0;this._objGenericCollectionSelectableDays={};
this._nInitialDateIndex=0;this._strXmlInitialWorkoutDoc="";this._nModalPopupID=0;
this._bShowGoalData=false;this._bAllowEditing=false;this._bAllowEditingUpdatedAfterInit=false;
this._bShowGaolDataUpdatedAfterInit=false;this._bRaisesSavedEvent=false;this._additionalExerciseAndMapCollection=new CClientLib.ServerClasses.ExerciseAndMapCollection([]);
this._strAttribute_Repetitions="Repetitions";this._strAttribute_Weight="Weight";this._strAttribute_WeightUnit="WeightUnit";
this._strAttribute_Distance="Distance";this._strAttribute_DistanceUnit="DistanceUnit";
this._strAttribute_Duration="Duration";this._strAttribute_Notes="Notes";this._eDivHeader=null;
this._eDivExercises=null;this._eDivPostExercises=null;this._eDivProcessingControls=null;
this._eDivFooter=null;this._controlSDDLDay=null;this._controlSDDLStartTime=null;this._controlSDDLEndTime=null;
this._eTextBoxWorkoutTitle=null;this._eTextAreaWorkoutNotes=null;this._strSubTableCellRepsGoalWidth="40px";
this._strSubTableCellRepsValueWidth="50px";this._strSubTableCellWeightGoalWidth="50px";
this._strSubTableCellWeightValueWidth="90px";this._strSubTableCellDistanceGoalWidth="50px";
this._strSubTableCellDistanceValueWidth="90px";this._strSubTableCellDurationGoalWidth="60px";
this._strSubTableCellDurationValueWidth="80px";this._objDefaultPropertiesMapDetails={};
};CClientLib.WorkoutDetails.prototype={initialize:function(){CClientLib.WorkoutDetails.callBaseMethod(this,"initialize");
this._objDefaultPropertiesMapDetails={"_strMapID":"","_bDirectlyEditingMapList":false,"_bAllowEdit":this._bAllowEditing};
this._createElements();this.raiseInitialised();},dispose:function(){this._saveWorkoutStateToCookie();
CClientLib.WorkoutDetails.callBaseMethod(this,"dispose");},get_modalPopup:function(){return CClientLib.UI.ModalPopupWrapper.parse(CClientLib.Parent.GetModalPopupContainer().get_modalPopupByID(this._nModalPopupID));
},_createElements:function(){var A=$createDiv(this.get_element(),{"style":"margin:5px;"});
this._eDivHeader=$createDiv(A);this._eDivExercises=$createDiv(A);this._eDivExercises.aChildExerciseDivs=[];
this._eDivPostExercises=$createDiv(A,{"style":"text-align:right; display:none;"});
this._eDivProcessingControls=$createDiv(A,{"style":"padding-top:15px; padding-bottom:20px; text-align:right; display:none;"});
this._eDivFooter=$createDiv(A,{"style":"margin-top:10px; text-align:right;"});this._createWorkoutHeader();
this._createBlankExercise();this._createWorkoutFooter();},_createHeaderFromWorkoutPanelObject:function(){var D=this._objectCallerWorkoutPanel.get_startTimeIndex();
var B=this._objectCallerWorkoutPanel.get_endTimeIndex();var A=this._objectCallerWorkoutPanel.get_workoutTitle();
var C=this._objectCallerWorkoutPanel.get_workoutNotes();this._createWorkoutHeader(D,B,A,C);
},_createBlankExercise:function(C){var E="";var A="";var B=this._createWorkoutExercise(E,A,C,true);
var D=this._createWorkoutExerciseSetHeader(B,true,true,true,true);this._createBlankSet(D);
B.fnRenderExerciseLoaded();this._setExerciseNumbers();},_insertBlankExerciseBefore:function(A){this.__insertExercise(A,true);
},_insertBlankExerciseAfter:function(A){this.__insertExercise(A,false);},__insertExercise:function(A,D){A=CClientLib.UI.Element.parse(A);
var C=this.get_exerciseDivs();var B=this.get_exerciseDivIndex(A);if(!D){B=B+1;if(B>=C.length){this._createBlankExercise();
return;}else{A=C[B];}}this._createBlankExercise(A);},_createBlankSet:function(C){var H=this._getSetCount(C)+1;
var B=CClientLib.Parent.GetClientData().get_currentUser();var J=0;var A=0;var F=B.get_defaultWeightUnitID();
var D=0;var E=B.get_defaultDistanceUnitID();var G="";if(H>1){var I=this._getSetCount(C)-1;
J=this._getRepetitionsValue_Decimal(C,I);A=this._getWeightValue_Decimal(C,I);F=this._getWeightValueUnit_Int(C,I);
D=this._getDistanceValue_Decimal(C,I);E=this._getDistanceValueUnit_Int(C,I);G=this._getDurationValue_Str(C,I);
}this._createWorkoutExerciseSet(C,H,J,A,F,D,E,G,"",0,0,0,0,0,"","");this._setAttributeVisibility(C);
},_createBlankSetEventHandler:function(A,B){this._createBlankSet(B);},_clearElements:function(){this._clearExercises();
CClientLib.UI.Element.parse(this.get_element().get_elementWrapper()).removeChildrenFromDOM();
},_clearExercises:function(){this._eDivExercises=CClientLib.UI.Element.parse(this._eDivExercises);
this._eDivExercises.removeChildrenFromDOM();this._eDivExercises.aChildExerciseDivs=[];
},_deleteExercise:function(A){A=CClientLib.UI.Element.parse(A);Array.remove(this.get_exerciseDivs(),A);
A.removeFromDOM();this._setExerciseNumbers();},_setExerciseNumbers:function(){var D=this.get_exerciseDivs();
for(var B=0;B<D.length;B++){var C=CClientLib.UI.Element.parse(D[B]);var A=CClientLib.UI.Element.parse(C.spanExerciseNumber);
A.set_value("Exercise "+(B+1)+" - ");}},_createWorkoutHeader:function(){var K=$createTable(this._eDivHeader,{"align":"right"});
var I=$createTableRow(K);var J=$createTableCell(I);var A=$createTableCell(I);var L=$createTableCell(I);
var C=$createTableCell(I);var D=$createTableCell(I);var H=$createTableCell(I);var B=$createSpan(J,{"value":"Day: ","css":"Title"});
this._buildDaySDDL(A);var G=$createSpan(L,{"value":"Start&nbsp;Time: ","css":"Title"});
this._controlSDDLStartTime=CClientLib.UI.SDDL.CreateSelectableTime(C,{"_objectDefaultItemValue":this._nInitialStartTimeIndex,"_bAllowEditing":this._bAllowEditing,"_nTextBoxWidth":65,"_nOptionsListWidth":80});
var F=$createSpan(D,{"value":"End&nbsp;Time: ","css":"Title"});this._controlSDDLEndTime=CClientLib.UI.SDDL.CreateSelectableTime(H,{"_objectDefaultItemValue":(this._nInitialStartTimeIndex+2),"_bAllowEditing":this._bAllowEditing,"_nTextBoxWidth":65,"_nOptionsListWidth":80});
$createBR(this._eDivHeader);$createBR(this._eDivHeader);$createBR(this._eDivHeader);
var E=$createStandardTitleAndNotes(this._eDivHeader,this._bAllowEditing,"Workout&nbsp;Title:","Workout&nbsp;Notes:");
this._eTextBoxWorkoutTitle=E.textboxTitle;this._eTextAreaWorkoutNotes=E.textboxNotes;
$createBR(this._eDivHeader);$createBR(this._eDivHeader);},_createWorkoutExercise:function(R,S,G,B){var M={"css":"DivExercise","style":"z-index:-1000;"};
var T=(Type.getTypeName(G)=="CClientLib.UI.Element");if(T){M.insertBefore=G;}var A=$createDiv(this._eDivExercises,M);
var F=this.get_exerciseDivs();if(T){var L=this.get_exerciseDivIndex(G);L=(L<1?0:L);
Array.insert(F,L,A);}else{F[F.length]=A;}$createHR(A);var C=$createDiv(A,{"style":"position:relative; float:right; padding-top:5px;"});
var I=$createTable(A);var Q=$createTableRow(I);var J=$createTableCell(Q,{"style":"width:100px;"});
var E=$createTableCell(Q,{"style":"width:100px;"});var O=$createTableCell(Q,{"style":"width:500px;"});
A.spanExerciseNumber=$createSpan(J,{"css":"Title"});var D=(String.isPopulatedString(S)?R+"_"+S:R);
var P=function(){controlExerciseSDDL=CClientLib.UI.SDDL.CreateExerciseAndMap(E,{"_bAllowEditing":this._bAllowEditing,"_fnGetDataSource":Function.createDelegate(this,this._getExerciseAndMapDataSource),"_objectDefaultItemValue":D,"events":$createEvents({"selectionMade":this._handlerOnExerciseSelecionMade,"selectionRemoved":this._handlerOnExerciseSelectionRemoved},this,[A])},fn_Global_ObjectAddDefultProperties(this._objDefaultPropertiesMapDetails,{"events":$createEvents({"saved":function(W,V){this._handlerOnMapSelected(A.controlExerciseSDDL,V);
}},this)}));A.controlExerciseSDDL=controlExerciseSDDL;A.set_style("z-index:1;");};
var K=$createDiv(A,{"style":"float:left; padding: 5px 0px 0px 20px;"});var N=$createTable(A,{"css":"TableSets","style":"overflow-x:visible;"});
$createDiv(A,{"style":"clear:both;"});A.tableSets=N;A.divMap=K;A.fnRenderExerciseLoaded=Function.createDelegate(this,P);
if(this._bAllowEditing){var H=function(){var V=$createDiv(C,{"style":"position:absolute; bottom:-90px; right:0px; border:Solid 2px gray; padding:10px; text-align:left; width:170px; background-color:white; overflow:visible;"});
$createAnchor(V,{"value":"Insert Exercise Before","display":"block","events":$createEvents({"click":function(){this._insertBlankExerciseBefore(A);
V.removeFromDOM();}},this)});$createAnchor(V,{"value":"Insert Exercise After","display":"block","events":$createEvents({"click":function(){this._insertBlankExerciseAfter(A);
V.removeFromDOM();}},this)});var W="Delete Exercise";if(!B){$createDiv(V,{"value":W+"&nbsp;<span style='color:red;'>* You can not delete scheduled exercises</span>","style":"color:#CCC;"});
}else{if(this.get_exerciseCount()<=1){$createDiv(V,{"value":W,"style":"color:#CCC;"});
}else{$createAnchor(V,{"value":W,"display":"block","events":$createEvents({"click":function(){this._deleteExercise(A);
V.removeFromDOM();}},this)});}}$createAnchor($createDiv(V,{"style":"margin-top:15px; text-align:right;"}),{"value":"Close","events":$createEvents({"click":function(){V.removeFromDOM();
}},this)});};$createSpan(C,{"value":"[&nbsp;"});var U=$createAnchor(C,{"value":"More Options","events":$createEvents({"click":H},this)});
$createSpan(C,{"value":"&nbsp;]"});}return A;},_createWorkoutExerciseSetHeader:function(E,D,A,G,B){var C=this._getSetsTable_Table(E);
C.get_element().width="75%";var K=$createTableRow(C);var N=$createTableCell(K,{"value":"&nbsp;"});
var J=Function.createDelegate(this,function(O,P){var Q=$createTableCell(K,{"css":"TDAttrubutHeading"});
return $createCheckBoxWithTitle(Q,{},{},{"value":O,"css":"Title"},{},{"value":P,"disabled":!this._bAllowEditing},{});
});C.repetitionsHeaderCollection=J("Reps",D);C.weightHeaderCollection=J("Weight",A);
C.distanceHeaderCollection=J("Distance",G);C.durationHeaderCollection=J("Duration",B);
C.notesHeaderCollection=J("Notes",true);C.notesHeaderCollection.checkbox.set_display("none");
C.notesHeaderCollection.divWrapper.set_style("float:left;");C.notesHeaderCollection.spanHeader.set_style("padding-left:0px;");
var I=$createTableRow(C,{"style":"height: 10px;"});var M=$createTableCell(I,{"value":"&nbsp;"});
var L=Function.createDelegate(this,function(R,V){var S="font-style:italic; text-decoration:underline; font-size:0.9em; text-align:center;";
var U=$createTableCell(I,{"align":"center"});var Q=$createTable(U,{"align":"center","css":"TableSetSubTable"});
var W=$createTableRow(Q);var X=$createTableCell(W,{"align":"center"});var P=$createTableCell(W,{"align":"center"});
var T=$createSpan(X,{"value":"Goal","style":S});var O=$createSpan(P,{"value":"Archieved","style":S});
X.get_element().width=R;P.get_element().width=V;return U;});C.subHeadingCellReps=L(this._strSubTableCellRepsGoalWidth,this._strSubTableCellRepsValueWidth);
C.subHeadingCellWeight=L(this._strSubTableCellWeightGoalWidth,this._strSubTableCellWeightValueWidth);
C.subHeadingCellDistance=L(this._strSubTableCellDistanceGoalWidth,this._strSubTableCellDistanceValueWidth);
C.subHeadingCellDuration=L(this._strSubTableCellDurationGoalWidth,this._strSubTableCellDurationValueWidth);
$createTableCell(I,{"value":"&nbsp;"});if(!this._bShowGoalData){I.set_display("none");
}if(this._bAllowEditing){var H=$createAnchor(E,{"value":"Add Another Set","css":"AnchorAddSet","events":$createEvents({"click":Function.createCallback(this._createBlankSetEventHandler,C)},this)});
var F=Function.createDelegate(this,function(O,R){var P=this._getShowArrtibute_CheckBox(O,R);
var Q=this._setShowAttribute(O,R,P.get_value());this._setAttributeVisibility(O);if(!Q){alert("Unable to toggle this exercise atribute as it contains exercise information");
}});$addHandlers(this._getShowArrtibute_CheckBox(C,this._strAttribute_Repetitions).get_element(),{"click":function(){F(C,this._strAttribute_Repetitions);
}},this);$addHandlers(this._getShowArrtibute_CheckBox(C,this._strAttribute_Weight).get_element(),{"click":function(){F(C,this._strAttribute_Weight);
}},this);$addHandlers(this._getShowArrtibute_CheckBox(C,this._strAttribute_Distance).get_element(),{"click":function(){F(C,this._strAttribute_Distance);
}},this);$addHandlers(this._getShowArrtibute_CheckBox(C,this._strAttribute_Duration).get_element(),{"click":function(){F(C,this._strAttribute_Duration);
}},this);}return C;},_createWorkoutExerciseSet:function(M,e,C,c,S,f,K,d,g,b,I,B,D,Q,X,L){if(!this._bAllowEditing){if(c==0){S=0;
}if(f==0){K=0;}if(I==0){B=0;}if(D==0){Q=0;}}var R=$createTableRow(M,{"display":"none"});
R.cellSetNumber=$createTableCell(R,{"value":"Set&nbsp;"+e,"style":"width:20px;"});
R.cellRepetitions=$createTableCell(R,{"align":"center"});R.cellWeight=$createTableCell(R,{"align":"center"});
R.cellDistance=$createTableCell(R,{"align":"center"});R.cellDuration=$createTableCell(R,{"align":"center"});
R.cellNotes=$createTableCell(R,{"style":"width:20%;"});var N=Function.createDelegate(this,function(r,n,t){var m=$createTable(r,{"align":"center","css":"TableSetSubTable"});
var p=$createTableRow(m,{"style":""});var u=$createTableCell(p,{"align":"center","style":"height:100%;","display":((this._bShowGoalData)?"block":"none")});
var l=$createTableCell(p,{"align":"center","style":"height:100%;"});var k=$createDiv(u,{"style":"height:25px;overflow:hidden; vertical-align: middle; display:table-cell;"});
var s=$createDiv(l,{"style":"height:25px;overflow:hidden; vertical-align:middle; display:table-cell;"});
var q=$createDiv(k,{"style":"width:"+n+";overflow:hidden;"});var o=$createDiv(s,{"style":"width:"+t+";overflow:hidden;"});
return{"divGoal":q,"divValue":o};});var G=N(R.cellRepetitions,this._strSubTableCellRepsGoalWidth,this._strSubTableCellRepsValueWidth);
var T=N(R.cellWeight,this._strSubTableCellWeightGoalWidth,this._strSubTableCellWeightValueWidth);
var Z=N(R.cellDistance,this._strSubTableCellDistanceGoalWidth,this._strSubTableCellDistanceValueWidth);
var W=N(R.cellDuration,this._strSubTableCellDurationGoalWidth,this._strSubTableCellDurationValueWidth);
var Y="Gray";var E=function(l,k){var m="";if(l>0){m=l+"";if(k!=null){m+="&nbsp;"+k.get_title();
}}return m;};R.spanRepetitionsGoal=$createSpan(G.divGoal,{"value":((b>0)?b:""),"style":"color: "+Y+"; vertical-align: middle;"});
R.spanWeightGoal=$createSpan(T.divGoal,{"value":E(I,CClientLib.Parent.GetClientData().get_unitsWeight().get_unitWeightByUnitWeightID(B)),"style":"color: "+Y+"; vertical-align: middle;"});
R.dWeightGoal=I;R.intWeightUnitGoal=B;R.spanDistanceGoal=$createSpan(Z.divGoal,{"value":E(D,CClientLib.Parent.GetClientData().get_unitsDistance().get_unitDistanceByUnitDistanceID(Q)),"style":"color: "+Y+"; vertical-align: middle;"});
R.dDistanceGoal=D;R.intDistanceUnitGoal=Q;R.spanDurationGoal=$createSpan(W.divGoal,{"value":X,"style":"color: "+Y+"; width:75px;vertical-align:middle;"});
R.spanNotesGoal=$createSpan(R.cellNotes,{"display":"none"});var U=25;var J={"_bAllowDecimal":true,"_bDisplayValueIfZero":false};
R.textBoxRepetitions=$createTextboxNumber(G.divValue,{"value":C,"textboxAsLabel":!this._bAllowEditing,"css":"TextBoxStandardAttribute"},J);
var H=$createTable(T.divValue);var a=$createTableRow(H);var F=$createTableCell(a);
var V=$createTableCell(a);R.textBoxWeight=$createTextboxNumber(F,{"value":c,"style":"text-align: "+((this._bAllowEditing)?"center":"right")+";","textboxAsLabel":!this._bAllowEditing,"css":"TextBoxStandardAttribute"},J);
R.sddlWeightsUnit=CClientLib.UI.SDDL.CreateUnitWeight($createSpan(V),{"_bAllowEditing":this._bAllowEditing,"_objectDefaultItemValue":S,"_nTextBoxWidth":U,"_nOptionsListWidth":140});
var O=$createTable(Z.divValue);var A=$createTableRow(O);var h=$createTableCell(A);
var P=$createTableCell(A);R.textBoxDistance=$createTextboxNumber(h,{"value":f,"style":"text-align: "+((this._bAllowEditing)?"center":"right"),"textboxAsLabel":!this._bAllowEditing,"css":"TextBoxStandardAttribute"},J);
R.sddlDistanceUnit=CClientLib.UI.SDDL.CreateUnitDistance($createSpan(P),{"_bAllowEditing":this._bAllowEditing,"_objectDefaultItemValue":K,"_nTextBoxWidth":U,"_nOptionsListWidth":140});
R.textBoxDuration=$createTextboxTimeSpan(W.divValue,{"value":d,"style":"width: 75px","textboxAsLabel":!this._bAllowEditing,"css":"TextBoxStandardAttribute"},{},this._bAllowEditing);
R.textBoxNotes=$createTextbox(R.cellNotes,{"value":g,"textboxAsLabel":!this._bAllowEditing,"css":"TextBoxSetNotes"});
R.set_display("");},_createWorkoutFooter:function(){if(this._bAllowEditing){var A=$createAnchor(this._eDivPostExercises,{"value":"Add Another Exercise","css":"AnchorAddExercise","events":$createEvents({"click":this._createBlankExercise},this)});
}},_buildDaySDDL:function(B){this._objGenericCollectionSelectableDays=CClientLib.ServerClasses.GenericCollection.parse(this._objGenericCollectionSelectableDays);
var A=null;if(this._nInitialDateIndex<this._objGenericCollectionSelectableDays.item_count()){A=this._objGenericCollectionSelectableDays.get_item(this._nInitialDateIndex);
}this._controlSDDLDay=$create(CClientLib.UI.SDDL,{"_fnGetDataSource":Function.createDelegate(this,function(){return this._objGenericCollectionSelectableDays;
}),"_bAllowEditing":this._bAllowEditing,"_nTextBoxWidth":140,"_nOptionsListWidth":170},{},{},B.get_element());
this._controlSDDLDay=CClientLib.UI.SDDL.parse(this._controlSDDLDay);this._controlSDDLDay.set_SelectedItemByValue(A);
},_getExerciseAndMapDataSource:function(){var A=new CClientLib.ServerClasses.ExerciseAndMapCollection(Array.clone(CClientLib.Parent.GetClientData().get_exercisesAndMaps().get_exerciseAndMaps()));
this._additionalExerciseAndMapCollection=CClientLib.ServerClasses.ExerciseAndMapCollection.parse(this._additionalExerciseAndMapCollection);
for(var C=0;C<this._additionalExerciseAndMapCollection.exerciseAndMap_count();C++){var B=this._additionalExerciseAndMapCollection.get_exerciseAndMap(C);
if(A.get_exerciseAndMapByKeyID(B.get_keyID())==null){A.add_exerciseAndMap(B);}else{this._additionalExerciseAndMapCollection.remove_exerciseAndMap(B);
}}return A;},create_workoutFromXML:function(xmlDoc,bGoalDataIsValueData){this._strXmlInitialWorkoutDoc=fn_Global_XMLObjectToString_Str(xmlDoc);
if(this._bAllowEditingUpdatedAfterInit){this._clearElements();this._createElements();
}this._clearExercises();var xmlDoc=fn_Global_XMLParseFromString_XMLObject(this._strXmlInitialWorkoutDoc);
var workoutNode=xmlDoc.getElementsByTagName("w")[0];var strWorkoutTitle=fn_Global_XMLGetAttribute_String(workoutNode,"t");
var strWorkoutNotes=fn_Global_XMLGetAttribute_String(workoutNode,"n");var nStartTimeIndex=fn_Global_XMLGetAttribute_Int(workoutNode,"sTI");
var nEndTimeIndex=fn_Global_XMLGetAttribute_Int(workoutNode,"eTI");this.set_workoutTitle(strWorkoutTitle);
this.set_workoutNotes(strWorkoutNotes);this.set_startTimeIndex(nStartTimeIndex);this.set_endTimeIndex(nEndTimeIndex);
var strExerciseAndMapCollection=fn_Global_XMLGetAttribute_String(workoutNode,"ems");
if(String.isPopulatedString(strExerciseAndMapCollection)){var objAdditionalExerciseAndMapCollection=CClientLib.ServerClasses.ExerciseAndMapCollection.parse(eval(strExerciseAndMapCollection));
CClientLib.ServerClasses.ExerciseAndMapCollection.parse(this._additionalExerciseAndMapCollection).add_items(objAdditionalExerciseAndMapCollection.get_items());
}var strDayType=this.get_sddlDayValueTypeName();if(strDayType==Number.getName()){this.set_dayIndex(fn_Global_XMLGetAttribute_Int(workoutNode,"dNo"));
}else{if(strDayType==Date.getName()){this.set_dayDate(fn_Global_XMLGetAttribute_Date(workoutNode,"d"));
}else{alert("invalid day type in workout details: "+strDayType+"\n should only be: \n"+Number.getName()+"\n"+Date.getTypeName());
}}this.get_modalPopup().showContentDiv();var aExerciseNodes=workoutNode.getElementsByTagName("e");
for(var i=0;i<aExerciseNodes.length;i++){var exerciseNode=aExerciseNodes[i];var strExerciseID=fn_Global_XMLGetAttribute_String(exerciseNode,"eID");
var bShowRepetitions=fn_Global_XMLGetAttribute_Bool(exerciseNode,"sR");var bShowWeight=fn_Global_XMLGetAttribute_Bool(exerciseNode,"sW");
var bShowDistance=fn_Global_XMLGetAttribute_Bool(exerciseNode,"sDi");var bShowDuration=fn_Global_XMLGetAttribute_Bool(exerciseNode,"sDu");
var strMapID=fn_Global_XMLGetAttribute_String(exerciseNode,"mID");var eDivExercise=this._createWorkoutExercise(strExerciseID,strMapID,null,(!this._bShowGoalData));
var tableSets=this._createWorkoutExerciseSetHeader(eDivExercise,bShowRepetitions,bShowWeight,bShowDistance,bShowDuration);
var aSetNodes=exerciseNode.getElementsByTagName("s");for(var j=0;j<aSetNodes.length;
j++){var setNode=aSetNodes[j];var nSetNumber=j+1;var dRepetitions=fn_Global_XMLGetAttribute_Decimal(setNode,"r");
var dWeight=fn_Global_XMLGetAttribute_Decimal(setNode,"w");var nWeightUnitID=fn_Global_XMLGetAttribute_Int(setNode,"w_U");
var dDistance=fn_Global_XMLGetAttribute_Decimal(setNode,"dI");var nDistanceUnitID=fn_Global_XMLGetAttribute_Int(setNode,"dI_U");
var strDuration=fn_Global_XMLGetAttribute_String(setNode,"dU");var strNotes=fn_Global_XMLGetAttribute_String(setNode,"n");
var dRepetitionsGoal=0;var dWeightGoal=0;var nWeightUnitGoalID=0;var dDistanceGoal=0;
var nDistanceUnitGoalID=0;var strDurationGoal="";var strNotesGoal="";if(this._bShowGoalData){if(fn_Global_SafeBool_Bool(bGoalDataIsValueData)){dRepetitionsGoal=dRepetitions;
dWeightGoal=dWeight;nWeightUnitGoalID=nWeightUnitID;dDistanceGoal=dDistance;nDistanceUnitGoalID=nDistanceUnitID;
strDurationGoal=strDuration;strNotesGoal=strNotes;}else{dRepetitionsGoal=fn_Global_XMLGetAttribute_Decimal(setNode,"G_r");
dWeightGoal=fn_Global_XMLGetAttribute_Decimal(setNode,"G_w");nWeightUnitGoalID=fn_Global_XMLGetAttribute_Int(setNode,"G_w_U");
dDistanceGoal=fn_Global_XMLGetAttribute_Decimal(setNode,"G_dI");nDistanceUnitGoalID=fn_Global_XMLGetAttribute_Int(setNode,"G_dI_U");
strDurationGoal=fn_Global_XMLGetAttribute_String(setNode,"G_dU");strNotesGoal=fn_Global_XMLGetAttribute_String(setNode,"G_n");
}}this._createWorkoutExerciseSet(tableSets,nSetNumber,dRepetitions,dWeight,nWeightUnitID,dDistance,nDistanceUnitID,strDuration,strNotes,dRepetitionsGoal,dWeightGoal,nWeightUnitGoalID,dDistanceGoal,nDistanceUnitGoalID,strDurationGoal,strNotesGoal);
}eDivExercise.fnRenderExerciseLoaded();}this._setExerciseNumbers();},inputIsValid:function(){var A=true;
if(!String.isPopulatedString(this.get_workoutTitle())){alert("Please enter a 'Workout Title'");
A=false;}else{if(!CClientLib.UI.SDDL.parse(this.get_sddlDay()).get_hasItemSelectionBeenMade_Bool()){alert("Please select a 'Day'");
A=false;}else{if(!CClientLib.UI.SDDL.parse(this.get_sddlStartTime()).get_hasItemSelectionBeenMade_Bool()){alert("Please select a 'Start Time'");
A=false;}else{if(!CClientLib.UI.SDDL.parse(this.get_sddlEndTime()).get_hasItemSelectionBeenMade_Bool()){alert("Please select a 'End Time'");
A=false;}else{if(this.get_endTimeIndex()<this.get_startTimeIndex()){alert("The 'End Time' cannot come before the 'Start Time'");
A=false;}}}}}return A;},create_XMLFromWorkout:function(){var L=fn_Global_XMLCreateBlank_XMLObject();
var C=L.getElementsByTagName("root")[0];var G=fn_Global_XMLCreateNode_Node(L,C,"w");
fn_Global_XMLSetAttributeStr(G,"t",this.get_workoutTitle());fn_Global_XMLSetAttributeStr(G,"n",this.get_workoutNotes());
if(this.get_sddlDayValueTypeName()==Number.getName()){fn_Global_XMLSetAttributeInt(G,"dNo",this.get_dayIndex());
}else{if(this.get_sddlDayValueTypeName()==Date.getName()){fn_Global_XMLSetAttributeDate(G,"d",this.get_dayDate());
}else{alert("ERROR: Invalid workout day state: Not a Number or Date object");}}fn_Global_XMLSetAttributeInt(G,"sTI",this.get_startTimeIndex());
fn_Global_XMLSetAttributeInt(G,"eTI",this.get_endTimeIndex());var b=this.get_exerciseDivs();
for(var M=0;M<b.length;M++){var F=fn_Global_XMLCreateNode_Node(L,G,"e");var B=CClientLib.UI.Element.parse(b[M]);
var N=CClientLib.UI.Element.parse(this._getSetsTable_Table(B));var T=this._getExerciseID(B);
var K=this._getShowAttribute_Bool(N,this._strAttribute_Repetitions);var E=this._getShowAttribute_Bool(N,this._strAttribute_Weight);
var Y=this._getShowAttribute_Bool(N,this._strAttribute_Distance);var I=this._getShowAttribute_Bool(N,this._strAttribute_Duration);
var U=this._getExerciseMapID(B);fn_Global_XMLSetAttributeStr(F,"eID",T);fn_Global_XMLSetAttributeBool(F,"sR",K);
fn_Global_XMLSetAttributeBool(F,"sW",E);fn_Global_XMLSetAttributeBool(F,"sDi",Y);
fn_Global_XMLSetAttributeBool(F,"sDu",I);fn_Global_XMLSetAttributeStr(F,"mID",U);
var S=this._getOnlySetRows(N);for(var J=0;J<S.length;J++){var Q=fn_Global_XMLCreateNode_Node(L,F,"s");
var a=(K?this._getRepetitionsValue_Decimal(N,J):0);var Z=(E?this._getWeightValue_Decimal(N,J):0);
var d=(E?this._getWeightValueUnit_Int(N,J):0);var e=(Y?this._getDistanceValue_Decimal(N,J):0);
var X=(Y?this._getDistanceValueUnit_Int(N,J):0);var A=(I?this._getDurationValue_Str(N,J):"");
var H=this._getNotesValue_Str(N,J);var O=this._getRepetitionsGoal_Decimal(N,J);var D=this._getWeightGoal_Decimal(N,J);
var W=this._getWeightGoalUnit_Int(N,J);var V=this._getDistanceGoal_Decimal(N,J);var c=this._getDistanceGoalUnit_Int(N,J);
var P=this._getDurationGoal_Str(N,J);var R=this._getNotesGoal_Str(N,J);fn_Global_XMLSetAttributeDecimal(Q,"r",a);
fn_Global_XMLSetAttributeDecimal(Q,"w",Z);fn_Global_XMLSetAttributeInt(Q,"w_U",d);
fn_Global_XMLSetAttributeDecimal(Q,"dI",e);fn_Global_XMLSetAttributeInt(Q,"dI_U",X);
fn_Global_XMLSetAttributeStr(Q,"dU",A);fn_Global_XMLSetAttributeStr(Q,"n",H);fn_Global_XMLSetAttributeDecimal(Q,"G_r",O);
fn_Global_XMLSetAttributeDecimal(Q,"G_w",D);fn_Global_XMLSetAttributeInt(Q,"G_w_U",W);
fn_Global_XMLSetAttributeDecimal(Q,"G_dI",V);fn_Global_XMLSetAttributeInt(Q,"G_dI_U",c);
fn_Global_XMLSetAttributeStr(Q,"G_dU",P);fn_Global_XMLSetAttributeStr(Q,"G_n",R);
}}return L;},get_rawLoadedXMLDoc:function(){if(String.isPopulatedString(this._strXmlInitialWorkoutDoc)){return fn_Global_XMLParseFromString_XMLObject(this._strXmlInitialWorkoutDoc);
}return null;},close:function(){this.get_modalPopup().close();},_saveWorkoutStateToCookie:function(){},add_processingButton:function(D,E,A){D=fn_Global_SafeObject_Object(D);
E=fn_Global_SafeBool_Bool(E);var C=$createButton(this._getProcessingControlDiv(),D);
if(E){this._bRaisesSavedEvent=true;if(D.events){alert("WARNING: you already have events associated to this element that is to call a webservice...");
}var B=function(){if(!this.inputIsValid()){return;}var F=A(Function.createDelegate(this,this.raiseSaved),Function.createDelegate(this,this.raiseSaveTerminated),Function.createDelegate(this,this.raiseSaveFailed));
if(Type.getTypeName(F)==CClientLib.WSWebserviceDetails.getName()){this.raiseSaving();
}};C.set_events($createEvents({"click":B},this));}else{}},raiseInitialised:function(){this._raiseEvent(CClientLib.WorkoutDetails.strEventInitialised);
},raiseLoaded:function(){CClientLib.UI.ModalPopupWrapper.parse(this.get_modalPopup()).rendering_complete();
this._raiseEvent(CClientLib.WorkoutDetails.strEventLoaded);this.get_postExercisesDiv().set_display("block");
this._getProcessingControlDiv().set_display("block");},raiseSaving:function(){this._raiseEvent(CClientLib.WorkoutDetails.strEventSaving);
this.get_modalPopup().hide();},raiseSaved:function(A){var C=Sys.EventHandlerList.parse(this.get_events()).getHandler(CClientLib.WorkoutDetails.strEventSaved);
var B=Sys.EventArgs.Empty;B.get_webserviceResponse=function(){return A;};if(Type.isFunction(C)){C(this,B);
}this.close();},raiseSaveTerminated:function(B,A){var B=CClientLib.WSWebServiceResponseClientWrapper.parse(B);
if(B.nTerminationCode==1){CClientLib.Login.CreateLoginExpired();this.get_modalPopup().show();
return true;}return false;},raiseSaveFailed:function(){return false;},set_allowEditing:function(A){if(this._bAllowEditing!=A){this._bAllowEditingUpdatedAfterInit=true;
this._bAllowEditing=A;}},set_showGoalData:function(A){if(this._bShowGoalData!=A){this._bShowGaolDataUpdatedAfterInit=true;
this._bShowGoalData=A;}},get_postExercisesDiv:function(){return this._eDivPostExercises;
},_getProcessingControlDiv:function(){return this._eDivProcessingControls;},get_workoutTitleTextBox:function(){return CClientLib.UI.Element.parse(this._eTextBoxWorkoutTitle);
},get_workoutNotesTextBox:function(){return CClientLib.UI.Element.parse(this._eTextAreaWorkoutNotes);
},get_workoutTitle:function(){return this.get_workoutTitleTextBox().get_value();},get_workoutNotes:function(){return this.get_workoutNotesTextBox().get_value();
},set_workoutTitle:function(A){this.get_workoutTitleTextBox().set_value(A);},set_workoutNotes:function(A){this.get_workoutNotesTextBox().set_value(A);
},get_selectableDays:function(){return this._objGenericCollectionSelectableDays;},get_sddlDay:function(){return CClientLib.UI.SDDL.parse(this._controlSDDLDay);
},get_dayIndex:function(){var A=this.get_sddlDay();if(this.get_sddlDayValueTypeName()!=Number.getName()){alert("ERROR: in WorkoutDetails: get_dayIndex can only return an int");
}return fn_Global_SafeInt_Int(A.get_selectedItemValue_Obj());},get_dayDate:function(){var B=this.get_sddlDay();
if(this.get_sddlDayValueTypeName()!=Date.getName()){alert("ERROR: in WorkoutDetails: get_dayDate can only return an date");
}var A=B.get_selectedItemValue_Obj();return((A==null)?null:CClientLib.Type.Date.parse(A));
},set_dayIndex:function(A){var B=this.get_sddlDay();if(this.get_sddlDayValueTypeName()!=Number.getName()){alert("ERROR: in WorkoutDetails: set_dayIndex can only recieve an int");
}B.set_SelectedItemByValue(fn_Global_SafeInt_Int(A));},set_dayDate:function(A){var B=this.get_sddlDay();
if(this.get_sddlDayValueTypeName()!=Date.getName()){alert("ERROR: in WorkoutDetails: set_dayDate can only recieve an date");
}B.set_SelectedItemByValue(CClientLib.Type.Date.parse(A));},get_sddlDayValueTypeName:function(){this._objGenericCollectionSelectableDays=CClientLib.ServerClasses.GenericCollection.parse(this._objGenericCollectionSelectableDays);
var A=this._objGenericCollectionSelectableDays.get_collectionKey();var B=this._objGenericCollectionSelectableDays.get_item(0)[A];
return Type.getTypeName(B);},get_sddlStartTime:function(){return CClientLib.UI.SDDL.parse(this._controlSDDLStartTime);
},get_sddlEndTime:function(){return CClientLib.UI.SDDL.parse(this._controlSDDLEndTime);
},get_startTimeIndex:function(){return fn_Global_SafeInt_Int(this.get_sddlStartTime().get_selectedItemValue_Obj());
},get_endTimeIndex:function(){return fn_Global_SafeInt_Int(this.get_sddlEndTime().get_selectedItemValue_Obj());
},set_startTimeIndex:function(A){this.get_sddlStartTime().set_SelectedItemByValue(fn_Global_SafeInt_Int(A));
},set_endTimeIndex:function(A){this.get_sddlEndTime().set_SelectedItemByValue(fn_Global_SafeInt_Int(A));
},get_exerciseDivs:function(){return Array.cast(this._eDivExercises.aChildExerciseDivs);
},get_exerciseDivIndex:function(A){return Array.indexOf(this.get_exerciseDivs(),A);
},get_exerciseCount:function(){return this.get_exerciseDivs().length;},_getSDDLExerciseAndMap:function(B){var A=B.controlExerciseSDDL;
if(A==null||A=="undefined"){alert("controlExerciseSDDL doesn't exist. Note: you may be trying to reference it before it has been rendered in _getSDDLExerciseAndMap");
}return CClientLib.UI.SDDL.parse(A);},_getExerciseID:function(B){var A=this._getSDDLExerciseAndMap(B);
var D=A.get_selectedItem_Array();var C="";if(D!=null){C=fn_Global_SafeString_String(CClientLib.ServerClasses.ExerciseAndMap.parse(D).get_exercise().get_exerciseID());
}return C;},_getExerciseMapID:function(D){var B=this._getSDDLExerciseAndMap(D);var C=B.get_selectedItem_Array();
var E="";if(C!=null){var A=CClientLib.ServerClasses.ExerciseAndMap.parse(C).get_map();
if(A!=null){E=fn_Global_SafeString_String(CClientLib.ServerClasses.Map.parse(A).get_mapID());
}}return E;},_getMapDiv_Div:function(A){return A.divMap;},_getSetsTable_Table:function(A){return A.tableSets;
},_getSetsTableHeader_Row:function(A){var B=fn_Global_TableGetRow_TR(A,0);return B;
},_getSetRow_Row:function(B,A){var C=this._getOnlySetRows(B)[A];return C;},_getSetCount:function(A){return this._getOnlySetRows(A).length;
},_getOnlySetRows:function(B){var E=B.rows;var A=[];var C=0;for(var D=2;D<E.length;
D++){A[C]=E[D];C++;}return A;},_getShowArrtibute_CheckBox:function(A,B){if(this._strAttribute_Repetitions==B){return A.repetitionsHeaderCollection.checkbox;
}else{if(this._strAttribute_Weight==B){return A.weightHeaderCollection.checkbox;}else{if(this._strAttribute_Distance==B){return A.distanceHeaderCollection.checkbox;
}else{if(this._strAttribute_Duration==B){return A.durationHeaderCollection.checkbox;
}else{if(this._strAttribute_Duration==strAttributeNotes){return A.notesHeaderCollection.checkbox;
}else{alert("ERROR: Attribute not found within method _getShowArrtibute_CheckBox()");
}}}}}},_getAttributeHeading_Span:function(A,B){if(this._strAttribute_Repetitions==B){return A.repetitionsHeaderCollection.spanHeader;
}else{if(this._strAttribute_Weight==B){return A.weightHeaderCollection.spanHeader;
}else{if(this._strAttribute_Distance==B){return A.distanceHeaderCollection.spanHeader;
}else{if(this._strAttribute_Duration==B){return A.durationHeaderCollection.spanHeader;
}else{if(this._strAttribute_Duration==strAttributeNotes){return A.notesHeaderCollection.spanHeader;
}else{alert("ERROR: Attribute not found within method _getShowArrtibute_CheckBox()");
}}}}}},_getShowAttribute_Bool:function(A,B){var C=this._getShowArrtibute_CheckBox(A,B);
return C.get_value();},_setShowAttribute:function(H,B,C){var D=this._getShowArrtibute_CheckBox(H,B);
var I=true;if(!C){var G=this._getSetCount(H);for(var A=0;A<G;A++){var E="";var F="";
if(B==this._strAttribute_Repetitions){E=this._getRepetitionsValue_Decimal(H,A).toString();
F=this._getRepetitionsGoal_Decimal(H,A).toString();}else{if(B==this._strAttribute_Weight){E=this._getWeightValue_Decimal(H,A).toString();
F=this._getWeightGoal_Decimal(H,A).toString();}else{if(B==this._strAttribute_Distance){E=this._getDistanceValue_Decimal(H,A).toString();
F=this._getDistanceGoal_Decimal(H,A).toString();}else{if(B==this._strAttribute_Duration){E=this._getDurationValue_Str(H,A).toString();
F=this._getDurationGoal_Str(H,A).toString();}}}}E=((E=="0")?"":E);F=((F=="0")?"":F);
if(String.isPopulatedString(E)||String.isPopulatedString(F)){C=true;I=false;break;
}}}D.set_value(C);return I;},_setAllShowAttributeCheckBoxes:function(D,F,C,E,A){var B=this._getSetsTable_Table(D);
this._setShowAttribute(B,this._strAttribute_Repetitions,F);this._setShowAttribute(B,this._strAttribute_Weight,C);
this._setShowAttribute(B,this._strAttribute_Distance,E);this._setShowAttribute(B,this._strAttribute_Duration,A);
this._setAttributeVisibility(B);},_getValueAttribute_Element:function(C,B,E,D){var A=this._getSetRow_Row(C,B);
if(this._strAttribute_Repetitions==E){if(D){return A.spanRepetitionsGoal;}else{return A.textBoxRepetitions;
}}else{if(this._strAttribute_Weight==E){if(D){return A.dWeightGoal;}else{return A.textBoxWeight;
}}else{if(this._strAttribute_WeightUnit==E){if(D){return A.intWeightUnitGoal;}else{return A.sddlWeightsUnit;
}}else{if(this._strAttribute_Distance==E){if(D){return A.dDistanceGoal;}else{return A.textBoxDistance;
}}else{if(this._strAttribute_DistanceUnit==E){if(D){return A.intDistanceUnitGoal;
}else{return A.sddlDistanceUnit;}}else{if(this._strAttribute_Duration==E){if(D){return A.spanDurationGoal;
}else{return A.textBoxDuration;}}else{if(this._strAttribute_Notes==E){if(D){return A.spanNotesGoal;
}else{return A.textBoxNotes;}}else{alert("ERROR: Attribute not found within method _getValueAttribute_Element()");
}}}}}}}},_getRepetitionsValue_Decimal:function(B,A){var C=this._getValueAttribute_Element(B,A,this._strAttribute_Repetitions,false);
return C.get_element().Number.get_numberValue();},_getRepetitionsGoal_Decimal:function(B,A){var C=this._getValueAttribute_Element(B,A,this._strAttribute_Repetitions,true);
return C.get_value();},_getWeightValue_Decimal:function(B,A){var C=this._getValueAttribute_Element(B,A,this._strAttribute_Weight,false);
return C.get_element().Number.get_numberValue();},_getWeightValueUnit_Int:function(C,B){var A=this._getValueAttribute_Element(C,B,this._strAttribute_WeightUnit,false);
return fn_Global_SafeInt_Int(A.get_selectedItemValue_Obj());},_getWeightGoal_Decimal:function(B,A){return this._getValueAttribute_Element(B,A,this._strAttribute_Weight,true);
},_getWeightGoalUnit_Int:function(B,A){return fn_Global_SafeInt_Int(this._getValueAttribute_Element(B,A,this._strAttribute_WeightUnit,true));
},_getDistanceValue_Decimal:function(B,A){var C=this._getValueAttribute_Element(B,A,this._strAttribute_Distance,false);
return C.get_element().Number.get_numberValue();},_getDistanceValueUnit_Int:function(B,A){var C=this._getValueAttribute_Element(B,A,this._strAttribute_DistanceUnit,false);
return fn_Global_SafeInt_Int(C.get_selectedItemValue_Obj());},_getDistanceGoal_Decimal:function(B,A){return this._getValueAttribute_Element(B,A,this._strAttribute_Distance,true);
},_getDistanceGoalUnit_Int:function(B,A){return fn_Global_SafeInt_Int(this._getValueAttribute_Element(B,A,this._strAttribute_DistanceUnit,true));
},_getDurationValue_Str:function(B,A){var C=this._getValueAttribute_Element(B,A,this._strAttribute_Duration,false);
return C.get_element().TimeSpan.get_timeSpanValue();},_getDurationGoal_Str:function(B,A){var C=this._getValueAttribute_Element(B,A,this._strAttribute_Duration,true);
return C.get_value();},_getNotesValue_Str:function(B,A){var C=this._getValueAttribute_Element(B,A,this._strAttribute_Notes,false);
return C.get_value();},_getNotesGoal_Str:function(C,B){var A=this._getValueAttribute_Element(C,B,this._strAttribute_Notes,true);
return A.get_value();},_setAttributeVisibility:function(J){var H=this._getShowAttribute_Bool(J,this._strAttribute_Repetitions);
var B=this._getShowAttribute_Bool(J,this._strAttribute_Weight);var Q=this._getShowAttribute_Bool(J,this._strAttribute_Distance);
var C=this._getShowAttribute_Bool(J,this._strAttribute_Duration);var K=this._getAttributeHeading_Span(J,this._strAttribute_Repetitions);
var I=this._getAttributeHeading_Span(J,this._strAttribute_Weight);var F=this._getAttributeHeading_Span(J,this._strAttribute_Distance);
var N=this._getAttributeHeading_Span(J,this._strAttribute_Duration);var L=J.subHeadingCellReps;
var E=J.subHeadingCellWeight;var D=J.subHeadingCellDistance;var P=J.subHeadingCellDuration;
var O=Function.createDelegate(this,function(S,R,T){S.set_style("color: "+((T)?"Black":"#CCC"));
R.get_element().style.visibility=((T)?"visible":"hidden");});O(K,L,H);O(I,E,B);O(F,D,Q);
O(N,P,C);var M=this._getOnlySetRows(J);for(var G=0;G<M.length;G++){var A=M[G];A.cellRepetitions.get_element().style.visibility=((H)?"visible":"hidden");
A.cellWeight.get_element().style.visibility=((B)?"visible":"hidden");A.cellDistance.get_element().style.visibility=((Q)?"visible":"hidden");
A.cellDuration.get_element().style.visibility=((C)?"visible":"hidden");}},_handlerOnExerciseSelectionRemoved:function(A,B,C){this._setAllShowAttributeCheckBoxes(C,true,true,true,true);
var D=this._getMapDiv_Div(C);D.removeChildrenFromDOM();},_handlerOnExerciseSelecionMade:function(G,B,D){G=CClientLib.UI.SDDL.parse(G);
D=CClientLib.UI.Element.parse(D);var A=CClientLib.ServerClasses.ExerciseAndMap.parse(G.get_selectedItem_Array());
var I=CClientLib.ServerClasses.Exercise.parse(A.get_exercise());var E=A.get_map();
var F=I.get_showDistance();var H=this._getMapDiv_Div(D);H.removeChildrenFromDOM();
this._setAllShowAttributeCheckBoxes(D,I.get_showRepetitions(),I.get_showWeight(),F,I.get_showDuration());
if(E!=null||(F&&this._bAllowEditing)){var J=fn_Global_ObjectAddDefultProperties(this._objDefaultPropertiesMapDetails,{"events":$createEvents({"saved":function(M,L){this._handlerOnMapSelected(G,L);
}},this)});if(E!=null){E=CClientLib.ServerClasses.Map.parse(E);CClientLib.MapDetails.CreateMapDetailsThumbNail(H,E.get_mapID(),{},{},J);
var K=E.get_totalDistance();this.set_distanceForASets(D,K);}else{$createSpan(H,{"value":"[&nbsp;"});
var C=$createAnchor(H,{"value":"Associate Map"});strAnchorValue="Add a map";$createSpan(H,{"value":"&nbsp;]"});
C.set_events($createEvents({"click":function(){H.removeChildrenFromDOM();var L=$createTable(H,{"style":"display:inline;"});
var M=$createTableCell($createTableRow(L));var O=$createTableRow($createTable(M));
var N=$createTableCell(O,{"value":"Select&nbsp; map:&nbsp;"});CClientLib.UI.SDDL.CreateMapList($createTableCell(O),{"_nTextBoxWidth":"100","events":$createEvents({"selectionMade":function(Q,P){this._handlerOnMapSelected(G,Q.get_selectedItem_Array());
}},this)},J);}},this));}}},_handlerOnMapSelected:function(B,A){B=CClientLib.UI.SDDL.parse(B);
var D=CClientLib.ServerClasses.Exercise.parse(B.get_selectedItem_Array().get_exercise());
var E=CClientLib.ServerClasses.Map.parse(A);var C=CClientLib.ServerClasses.ExerciseAndMap.CreateExerciseAndMap(D,E);
CClientLib.ServerClasses.ExerciseAndMapCollection.parse(this._additionalExerciseAndMapCollection).add_item(C);
B.set_SelectedItemByValue(C.get_keyID());},set_distanceForASets:function(D,B){var A=D.tableSets;
var C=this._getOnlySetRows(A);B=B.toFixed(2);for(var F=0;F<C.length;F++){var E=this._getValueAttribute_Element(A,F,this._strAttribute_Distance,false);
if(B>0){E.set_value(B);}}}};CClientLib.WorkoutDetails.registerClass("CClientLib.WorkoutDetails",Sys.UI.Control);
CClientLib.WorkoutDetails.strEventInitialised="workoutDetailsInit";CClientLib.WorkoutDetails.strEventLoaded="workoutDetailsLoaded";
CClientLib.WorkoutDetails.strEventSaving="workoutDetailsSaving";CClientLib.WorkoutDetails.strEventSaved="workoutDetailsSaved";
CClientLib.WorkoutDetails.createEvent(CClientLib.WorkoutDetails.strEventInitialised);
CClientLib.WorkoutDetails.createEvent(CClientLib.WorkoutDetails.strEventLoaded);CClientLib.WorkoutDetails.createEvent(CClientLib.WorkoutDetails.strEventSaving);
CClientLib.WorkoutDetails.createEvent(CClientLib.WorkoutDetails.strEventSaved);function fn_Workout2_OnlyDisplayPositiveInt(A){if(A>0){return A+"";
}else{return"";}}CClientLib.WorkoutDetails.parse=function(A){return CClientLib.WorkoutDetails._parse(A);
};CClientLib.WorkoutDetails.CreateWorkoutDetails=function(E,C,D,F,A,B){A=fn_Global_SafeObject_Object(A);
A._objSpanHeadingProperties=fn_Global_ObjectAddDefultProperties(A._objSpanHeadingProperties,{"value":E});
A._objDivDragPanelProperties=fn_Global_ObjectAddDefultProperties(A._objDivDragPanelProperties,{"style":"background-color: "+C+";"});
B._bShowGoalData=D;B._bAllowEditing=F;var G=CClientLib.Parent.OpenModalPopupAndRenderControl(A,CClientLib.WorkoutDetails,B,"_nModalPopupID",true);
return CClientLib.WorkoutDetails.parse(G);};CClientLib.WorkoutDetails.CreateWorkoutDetails_ProgramWorkoutExisting=function(B,I,G,J,E,F,H,D){var A=function(L){var K=function(){};
if(F){K=function(){this.add_processingButton({"value":"Save Workout"},true,Function.createDelegate(this,function(R,P,M){var Q=this.create_XMLFromWorkout();
var N=true;var O=CClientLib.Parent.GetClientData().get_programsActive().get_programByProgramID(I);
if(O!=null&&CClientLib.ServerClasses.Program.parse(O).get_isScheduled()){N=window.confirm("This program is currently scheduled to your calender.  Editing this workout will also edit all occurances of this workout on your calendar from today onwards.\n\n\nDo you wish to proceed?");
}if(N){return CClientLib.Parent.GetWebServices().WSProgram_WSEditProgramWorkout(I,G,J,E,Q,R,P,M);
}return null;}));};}else{K=function(){this.add_processingButton({"value":"Edit Workout","events":$createEvents({"click":function(){var M=this.get_rawLoadedXMLDoc();
this.close();CClientLib.WorkoutDetails.CreateWorkoutDetails_ProgramWorkoutExisting(M,I,G,J,E,true,H,D);
}},this)},false);};}this.add_workoutDetailsLoaded(Function.createDelegate(this,K));
this.create_workoutFromXML(L);this.raiseLoaded();};D=fn_Global_SafeObject_Object(D);
D._objGenericCollectionSelectableDays=CClientLib.Type.Date.GetWeekDayNamesAsGenericCollection();
var C=CClientLib.WorkoutDetails.CreateWorkoutDetails("Workout Template Details",CClientLib.WorkoutDetails.GetAssociatedWorkoutStatusColor(null),false,F,H,D);
C=CClientLib.WorkoutDetails.parse(C);A=Function.createDelegate(C,A);if(B!=null){A(B);
}else{CClientLib.Parent.GetWebServices().WSProgram_WSGetProgramWorkout(E,A,null,null);
}return C;};CClientLib.WorkoutDetails.CreateWorkoutDetails_ProgramWorkoutNew=function(E,B,I,F,H,G,D){D=fn_Global_SafeObject_Object(D);
D._objGenericCollectionSelectableDays=CClientLib.Type.Date.GetWeekDayNamesAsGenericCollection();
var C=CClientLib.WorkoutDetails.CreateWorkoutDetails("Adding a workout to the program",CClientLib.WorkoutDetails.GetAssociatedWorkoutStatusColor(null),false,true,G,D);
C=CClientLib.WorkoutDetails.parse(C);var A=function(){this.set_dayIndex(F);this.set_startTimeIndex(H);
this.set_endTimeIndex(H+2);this.add_processingButton({"value":"Add Workout"},true,Function.createDelegate(this,function(O,M,L){var N=this.create_XMLFromWorkout();
var J=true;var K=CClientLib.Parent.GetClientData().get_programsActive().get_programByProgramID(E);
if(K!=null&&CClientLib.ServerClasses.Program.parse(K).get_isScheduled()){J=window.confirm("This program is currently scheduled to your calender.  Adding a workout to the program will also schedule the workout onto your calendar from today onwards.\n\n\nDo you wish to proceed?");
}if(J){return CClientLib.Parent.GetWebServices().WSProgram_WSAddWorkoutToProgram(E,B,I,N,O,M,L);
}return null;}));this.raiseLoaded();};A=Function.createDelegate(C,A);A();return C;
};CClientLib.WorkoutDetails.CreateWorkoutDetails_ScheduledExisting=function(B,F,I,G,K,E,J,H,D){var A=function(R){var Q=false;
var T=false;var N=R.getElementsByTagName("w")[0];var M=fn_Global_XMLGetAttribute_Int(N,"sID");
var L=fn_Global_XMLGetAttribute_String(N,"sT");var U=CClientLib.WorkoutDetails.GetAssociatedWorkoutStatusColor(M);
var O=function(){};var S=CClientLib.UI.ModalPopupWrapper.parse(this.get_modalPopup());
S.get_sapnHeading().set_value(S.get_sapnHeading().get_value()+" (Status: "+L+")");
S.get_divDragPanel().style.backgroundColor=U;var P=Function.createDelegate(this,function(a,Y,V){var b=CClientLib.ServerClasses.GenericCollection.parse(this.get_selectableDays());
var W=b.get_collectionKey();var X=b.get_item(0)[W];var Z=b.get_item(b.item_count()-1)[W];
return CClientLib.Parent.GetWebServices().WSScheduleCalendar_WSPerformWorkoutSession(I,this.create_XMLFromWorkout(),G,K,E,J,this.get_dayDate(),this.get_startTimeIndex(),this.get_endTimeIndex(),X,Z,a,Y,V);
});if(M==1||M==2){if(F){Q=true;T=true;O=function(){this.add_processingButton({"value":"Complete Workout"},true,P);
};}else{Q=false;O=function(){this.add_processingButton({"value":"Begin Workout","events":$createEvents({"click":function(){this.close();
CClientLib.WorkoutDetails.CreateWorkoutDetails_ScheduledExisting(R,true,I,G,K,E,J,H,D);
}},this)},false);};}}else{if(M==3){F=false;Q=false;$createDiv(this._eDivFooter,{"style":"color: "+U+";","value":"This workout has been failed as you did not completed it within the given week. Schedule another workout to make up for it ;)"});
}else{if(M==4){Q=true;O=function(){if(!F){$createDiv(this._eDivFooter,{"style":"color: "+U+";","value":"This workout has been completed successfully.  Well done!"});
this.add_processingButton({"value":"Edit Completed Workout","events":$createEvents({"click":function(){if(window.confirm("This workout has already been completed.\n\nAre you sure that you would like to edit it?")){this.close();
CClientLib.WorkoutDetails.CreateWorkoutDetails_ScheduledExisting(R,true,I,G,K,E,J,H,D);
}}},this)},false);}else{this.add_processingButton({"value":"Complete Workout"},true,P);
}};}else{alert("ERROR: in workout details: invalid status id");}}}this.set_allowEditing(F);
this.set_showGoalData(Q);this.add_workoutDetailsLoaded(Function.createDelegate(this,O));
this.create_workoutFromXML(R,T);this.raiseLoaded();};var C=CClientLib.WorkoutDetails.CreateWorkoutDetails("Workout Session Details","White",false,false,H,D);
C=CClientLib.WorkoutDetails.parse(C);A=Function.createDelegate(C,A);if(B!=null){A(B);
}else{CClientLib.Parent.GetWebServices().WSScheduleCalendar_WSGetWorkoutSessionDetails(I,G,K,E,J,A,null,null);
}return C;};CClientLib.WorkoutDetails.CreateWorkoutDetails_ScheduledNew=function(A,B,D,E,G){G=fn_Global_SafeObject_Object(G);
var F=CClientLib.WorkoutDetails.CreateWorkoutDetails("Performing an impromptu workout",CClientLib.WorkoutDetails.GetAssociatedWorkoutStatusColor(1),false,true,E,G);
F=CClientLib.WorkoutDetails.parse(F);var C=function(){this.set_dayDate(B);this.set_startTimeIndex(D);
this.set_endTimeIndex(D+2);this.add_processingButton({"value":"Complete Impromptu Workout"},true,Function.createDelegate(this,function(P,O,S){var R=CClientLib.ServerClasses.GenericCollection.parse(this.get_selectableDays());
var T=R.get_collectionKey();var Q=0;var V=0;var L=0;var U=0;var I=this.get_dayDate();
var M=this.get_startTimeIndex();var N=this.get_endTimeIndex();var K=this.create_XMLFromWorkout();
var H=R.get_item(0)[T];var J=R.get_item(R.item_count()-1)[T];return CClientLib.Parent.GetWebServices().WSScheduleCalendar_WSPerformWorkoutSession(A,K,Q,V,L,U,I,M,N,H,J,P,O,S);
}));this.raiseLoaded();};C=Function.createDelegate(F,C);C();return F;};CClientLib.WorkoutDetails.GetAssociatedWorkoutStatusColor=function(A){A=fn_Global_SafeInt_Int(A);
if(A==1){return"#FFCC33";}else{if(A==2){return"#FF6611";}else{if(A==3){return"#FF0000";
}else{if(A==4){return"#66BF25";}else{if(A==5){return"#eee9e9";}else{return"#3399FF";
}}}}}};function fn_Global_IsParent(){return fn_Global_SafeBool_Bool(window.isParent);
}function fn_Global_ObjectAddDefultProperties(C,A){if(C==null||C=="undefiled"){C={};
}var B={};for(name in A){B[name]=A[name];}for(name in C){B[name]=C[name];}return B;
}function fn_Gloabl_ObjectDeleteProperty(B,A){delete B[A];}function fn_Global_SafeBool_Bool(A){if(A=="true"||A=="True"||A=="1"||A==true){return true;
}else{return false;}}function fn_Global_SafeArray_Array(A){return(Type.isArray(A)?A:[]);
}function fn_Global_SafeString_String(A){if(A==null||A==undefined){A="";}if(A.toString){A=A.toString();
}return(String.isPopulatedString(A)?A:"");}function fn_Global_SafeInt_Int(A){A=A+"";
while(A.length>1&&A.charAt(0)=="0"){A=A.substr(1,(A.length-1));}if(A==""||isNaN(A)){return 0;
}else{return parseInt(A);}}function fn_Global_SafeDecimal_Decimal(A){if(A==""||isNaN(A)){return 0;
}else{return parseFloat(A);}}function fn_Global_ConvertKilometersToMiles(A){return fn_Global_SafeDecimal_Decimal(A)*0.621371192;
}function fn_Global_FormatDistanceForUser(B){B=fn_Global_SafeDecimal_Decimal(B);var C="{0} km";
var A=B;if(fn_Global_CurrentUserIsMetric()){A=fn_Global_ConvertKilometersToMiles(B);
C="{0} miles";}return String.format(C,[A.toFixed(2)]);}function fn_Global_CurrentUserIsMetric(){var A=CClientLib.Parent.GetClientData().get_currentUser();
return(CClientLib.ServerClasses.User.parse(A).get_unitsType().toLocaleLowerCase()=="imperial");
}function fn_Global_SafeObject_Object(A){if(A=="undefined"||A==null){A={};}return A;
}function fn_Global_DynamicallyIncludeScript(A){var B=document.createElement("script");
B.src=A;B.type="text/javascript";document.getElementsByTagName("head")[0].appendChild(B);
}function fn_Global_ResizeElement(B,C,A,D){AjaxControlToolkit.Animation.ResizeAnimation.play(B,C,45,A,D,"px");
}function fn_Global_ElementSetAttributeCSS(A,B){A.className=B;}function fn_Global_XMLParseFromString_XMLObject(B){var A=null;
try{if(window.ActiveXObject){A=new ActiveXObject("Microsoft.XMLDOM");A.async="false";
A.loadXML(B);}else{parser=new DOMParser();A=parser.parseFromString(B,"text/xml");
}}catch(C){alert("ERROR: A error occurred while trying to pass the XML string in fn_Global_XMLParseFromString_XMLObject(strXML): \n XML string: "+B+"\n Exception details: "+C.message);
}return A;}function fn_Global_XMLObjectToString_Str(A){if(typeof XMLSerializer!="undefined"){return(new XMLSerializer()).serializeToString(A);
}else{if(A.xml){return A.xml;}else{throw"XML.serialize is not supported or can't serialize "+A;
}}}function fn_Global_XMLGetAttribute_String(C,B){var A=C.getAttribute(B);if(A==null){A="";
}return A;}function fn_Global_XMLGetAttribute_Bool(D,B){var A=fn_Global_XMLGetAttribute_String(D,B);
var C=fn_Global_SafeBool_Bool(A);return C;}function fn_Global_XMLGetAttribute_Int(D,C){var A=fn_Global_XMLGetAttribute_String(D,C);
var B=fn_Global_SafeInt_Int(A);return B;}function fn_Global_XMLGetAttribute_Decimal(D,C){var B=fn_Global_XMLGetAttribute_String(D,C);
var A=fn_Global_SafeDecimal_Decimal(B);return A;}function fn_Global_XMLGetAttribute_Date(D,B){var A=fn_Global_XMLGetAttribute_String(D,B);
var C=CClientLib.Type.Date.parseString(A);return C;}function fn_Global_XMLCreateNode_Node(A,D,B){var C=A.createElement(B);
D.appendChild(C);return C;}function fn_Global_XMLSetAttributeStr(C,B,A){if(A!=""){C.setAttribute(B,A);
}}function fn_Global_XMLSetAttributeInt(C,B,A){A=fn_Global_SafeInt_Int(A);if(A>0){fn_Global_XMLSetAttributeStr(C,B,A.toString());
}}function fn_Global_XMLSetAttributeDecimal(C,B,A){A=fn_Global_SafeDecimal_Decimal(A);
if(A>0){fn_Global_XMLSetAttributeStr(C,B,A.toString());}}function fn_Global_XMLSetAttributeBool(C,B,A){A=fn_Global_SafeBool_Bool(A);
if(A){fn_Global_XMLSetAttributeStr(C,B,A.toString());}}function fn_Global_XMLSetAttributeDate(C,B,A){if(CClientLib.Type.Date.isDate(A)){A=CClientLib.Type.Date.parse(A);
fn_Global_XMLSetAttributeStr(C,B,CClientLib.Type.Date.format(A,"dd/MMM/yyyy"));}}function fn_Global_XMLCreateBlank_XMLObject(){var A=fn_Global_XMLParseFromString_XMLObject("<root></root>");
return A;}function fn_Global_RemoveSubstring(C,A){aStrings=C.split(A);var B="";for(var D=0;
D<aStrings.length;D++){B+=aStrings[D];}return B;}function fn_Global_RemoveFirstOccuranceOfSubstring(B,A){return B.replace(A,"");
}function fn_Global_ReplaceCharAtSpecifiedIndex(C,F,A){var B="";var E=C.split("");
for(var D=0;D<E.length;D++){B+=((D==F)?A:E[D]);}return B;}function fn_Global_GetElementsByClass(C,G,B){var E=new Array();
if(G==null){G=document;}if(B==null){B="*";}var A=G.getElementsByTagName(B);var D=A.length;
var F=new RegExp("(^|s)"+C+"(s|$)");for(i=0,j=0;i<D;i++){if(F.test(A[i].className)){E[j]=A[i];
j++;}}return E;}function fn_Global_AddRoundedCorners(E){E=CClientLib.UI.Element.parse(E);
var C=$createDiv(E,{"css":"roundedCorner_TR"});var D=$createDiv(E,{"css":"roundedCorner_TL"});
var A=$createDiv(E,{"css":"roundedCorner_BR"});var B=$createDiv(E,{"css":"roundedCorner_BL"});
}function fn_Global_DebbugingPrintApplicationComponents(D){var C=Sys.Application.getDisposableObjects();
if(C.length==0){alert(D+": no components in sys.application");return;}var A=new Sys.StringBuilder("strHeading \n\n");
for(var B=0;B<C.length;B++){A.append("Type Name: "+C[B].getTypeName()+"\n");}alert(A.toString());
}function fn_Global_DebbugingAlertObject(A,F){var E=[];var H=[];if(F=="undefined"||F==null){F="";
}for(var D in A){var B=A[D];if(Type.isFunction(B)){Array.add(H,D);}else{Array.add(E,(D+": "+A[D]));
}}var G=Type.getTypeName(A);var C=new Sys.StringBuilder();C.append(F+"\n");C.append("Type Name: "+G+"\n");
C.append("ToString(): "+A+"\n\n");C.append("*** Properties ***\n");C.append(E.join(" | "));
C.append("\n\n\n*** Functions ***\n");C.append(H.join(" | "));alert(C.toString());
}function fn_Global_DebuggingAlertCollection(C,A){for(var B=0;B<C.length;B++){fn_Global_DebbugingAlertObject(C[B],A+" :Colection Item "+(B+1)+" of "+C.length);
}}Array.duplicate=function(A){var B=[];for(name in A){B[name]=A[name];}return B;};
String.isPopulatedString=function(A){if(Type.isString(A)&&A!=""){return true;}return false;
};String.prototype.addslashes=function(){return this.replace(/(["\\\.\|\[\]\^\*\+\?\$\(\)])/g,"\\$1");
};String.prototype.trim=function(){return this.replace(/^\s*(\S*(\s+\S+)*)\s*$/,"$1");
};function fn_Global_GetVariableFromQS(A){A=A.toLocaleLowerCase();var D=window.location.search.substring(1);
var E=D.split("&");for(var C=0;C<E.length;C++){var B=E[C].split("=");if(A==B[0].toLocaleLowerCase()){return B[1];
}}return"";}function fn_Global_GetVariableSafeIntFromQS(A){return fn_Global_SafeInt_Int(fn_Global_GetVariableFromQS(A));
}function fn_Global_GetVariableSafeBoolFromQS(A){return fn_Global_SafeBool_Bool(fn_Global_GetVariableFromQS(A));
}var _global_encodingCharLength=4;function fn_Global_EncodeString(B){var D="";for(var C=0;
C<B.length;C++){var F=B.charCodeAt(C);var E=F+"";for(var A=E.length;A<_global_encodingCharLength;
A++){E="0"+E;}D+=E;}return D;}function fn_Global_DecodeString(F){var G="";var A=((F.length=0)?0:(F.length/_global_encodingCharLength));
for(var E=0;E<A;E++){var D=F.substr((E*_global_encodingCharLength),_global_encodingCharLength);
var B=fn_Global_SafeInt_Int(D);var C=String.fromCharCode(B);G+=C;}return G;}function fn_Global_CookieCreate(C,A,D){var B=CClientLib.Type.Date.AddDays(new Date(),D);
document.cookie=C+"="+escape(A)+";expires="+B.toGMTString();}function fn_Global_CookieGet(D){var E=document.cookie;
if(E.length>0){var A=E.indexOf(D+"=");if(A!=-1){var B=A+(D+"=").length;var C=E.indexOf(";",B);
if(C==-1){C=E.length;}return unescape(E.substring(B,C));}}return"";}function fn_Global_CookieExists(A){return String.isPopulatedString(fn_Global_CookieGet(A));
}function fn_Global_CookieDelete(A){fn_Global_CookieCreate(A,"",-1);}function doGetCaretPosition(B){var A=0;
if(document.selection){B.focus();var C=document.selection.createRange();C.moveStart("character",-B.value.length);
A=C.text.length;}else{if(B.selectionStart||B.selectionStart=="0"){A=B.selectionStart;
}}return(A);}function doSetCaretPosition(E,B){var D=E;var A=B;var F=B;if(D.setSelectionRange){D.setSelectionRange(A,F);
}else{if(D.createTextRange){var C=D.createTextRange();C.collapse(true);C.moveEnd("character",F);
C.moveStart("character",A);C.select();}}}function fn_TextboxBaseFunctions_SafeKeyCode(A){var B=0;
if(A.keyIdentifier){if(A.charCode==63272){B=46;}else{if(A.charCode==63302){B=45;}else{if(A.charCode==63233){B=40;
}else{if(A.charCode==63235){B=39;}else{if(A.charCode==63232){B=38;}else{if(A.charCode==63234){B=37;
}else{if(A.charCode==63273){B=36;}else{if(A.charCode==63275){B=35;}else{if(A.charCode==63277){B=34;
}else{if(A.charCode==63276){B=33;}else{if(A.charCode==3){B=13;}}}}}}}}}}}}if(B==0){if(A.charCode){B=A.charCode;
}}if(B==0){B=A.keyCode;}return B;}function fn_TextboxBaseFunctions_charCodeIsInt_bool(A){if(A>=48&&A<=57){return true;
}else{return false;}}function fn_TextboxBaseFunctions_charCodeIsViewableInput_bool(A){if(A>=32&&A<=126){return true;
}return false;}Type.registerNamespace("CClientLib.ServerEnums.User");CClientLib.ServerEnums.User.Roles=function(){throw Error.notImplemented();
};CClientLib.ServerEnums.User.Roles={"Individual":new CClientLib.Type.Enum.EnumerationItem(CClientLib.ServerEnums.User.Roles,1,"Individual"),"PersonalTrainer":new CClientLib.Type.Enum.EnumerationItem(CClientLib.ServerEnums.User.Roles,2,"Personal Trainer")};
Type.registerNamespace("CClientLib.ServerEnums.UserAssociation");CClientLib.ServerEnums.UserAssociation.Rights=function(){throw Error.notImplemented();
};CClientLib.ServerEnums.UserAssociation.Rights={"UNDEFINED":new CClientLib.Type.Enum.EnumerationItem(CClientLib.ServerEnums.UserAssociation.Rights,0,"U N D E F I N E D"),"None":new CClientLib.Type.Enum.EnumerationItem(CClientLib.ServerEnums.UserAssociation.Rights,1,"None"),"Read":new CClientLib.Type.Enum.EnumerationItem(CClientLib.ServerEnums.UserAssociation.Rights,2,"Read"),"Write":new CClientLib.Type.Enum.EnumerationItem(CClientLib.ServerEnums.UserAssociation.Rights,3,"Write")};
CClientLib.ServerEnums.UserAssociation.Status=function(){throw Error.notImplemented();
};CClientLib.ServerEnums.UserAssociation.Status={"UNDEFINED":new CClientLib.Type.Enum.EnumerationItem(CClientLib.ServerEnums.UserAssociation.Status,0,"U N D E F I N E D"),"PendingApproval":new CClientLib.Type.Enum.EnumerationItem(CClientLib.ServerEnums.UserAssociation.Status,1,"Pending Approval"),"Active":new CClientLib.Type.Enum.EnumerationItem(CClientLib.ServerEnums.UserAssociation.Status,2,"Active"),"Declined":new CClientLib.Type.Enum.EnumerationItem(CClientLib.ServerEnums.UserAssociation.Status,3,"Declined"),"Terminated":new CClientLib.Type.Enum.EnumerationItem(CClientLib.ServerEnums.UserAssociation.Status,4,"Terminated")};
CClientLib.ServerEnums.UserAssociation.Type=function(){throw Error.notImplemented();
};CClientLib.ServerEnums.UserAssociation.Type={"UNDEFINED":new CClientLib.Type.Enum.EnumerationItem(CClientLib.ServerEnums.UserAssociation.Type,0,"U N D E F I N E D"),"PersonalTrainer":new CClientLib.Type.Enum.EnumerationItem(CClientLib.ServerEnums.UserAssociation.Type,1,"Personal Trainer"),"Client":new CClientLib.Type.Enum.EnumerationItem(CClientLib.ServerEnums.UserAssociation.Type,2,"Client"),"TrainingPartner":new CClientLib.Type.Enum.EnumerationItem(CClientLib.ServerEnums.UserAssociation.Type,3,"Training Partner")};
Type.registerNamespace("CClientLib.ServerClasses");CClientLib.ServerClasses.GenericCollection=function(A,B){this._strKey=A;
this._strText=B;this._aCollection=[];this._____bIsOfGenericList=true;};CClientLib.ServerClasses.GenericCollection.prototype.get_items=function(){return this._aCollection;
};CClientLib.ServerClasses.GenericCollection.prototype.get_item=function(A){return this._aCollection[A];
};CClientLib.ServerClasses.GenericCollection.prototype.get_itemText=function(A){return this.get_item(A)[this.get_collectionText()];
};CClientLib.ServerClasses.GenericCollection.prototype.get_itemByValue=function(D){try{for(var B=0;
B<this.item_count();B++){var C=this.get_item(B);if(C[this.get_collectionKey()]=="undefined"){alert("warning key value is undefined: "+this.get_collectionKey());
}else{if(D.toString()==C[this.get_collectionKey()].toString()){return C;}}}return null;
}catch(A){fn_Global_DebbugingAlertObject(C,"******Key value: "+D);}};CClientLib.ServerClasses.GenericCollection.prototype.add_item=function(A){if(A[this.get_collectionKey()]=="undefined"||A[this.get_collectionText()]=="undefined"){alert("Error unable to add the item to the collection as it doesnt have both a key and text value");
fn_Global_DebbugingAlertObject(A,"Required Key: "+this.get_collectionKey()+" | Requied Text: "+this.get_collectionText());
}this._aCollection[this._aCollection.length]=A;};CClientLib.ServerClasses.GenericCollection.prototype.remove_item=function(A){while(Array.contains(this._aCollection,A)){Array.remove(this._aCollection,A);
}};CClientLib.ServerClasses.GenericCollection.prototype.item_count=function(){return this._aCollection.length;
};CClientLib.ServerClasses.GenericCollection.prototype.add_items=function(A){for(var B=0;
B<A.length;B++){this.add_item(A[B]);}};CClientLib.ServerClasses.GenericCollection.prototype.get_collectionKey=function(){return this._strKey;
};CClientLib.ServerClasses.GenericCollection.prototype.get_collectionText=function(){return this._strText;
};CClientLib.ServerClasses.GenericCollection.registerClass("CClientLib.ServerClasses.GenericCollection");
CClientLib.ServerClasses.GenericCollection.parse=function(A){var B=Error.create("Unbale to pass obj as a CClientLib.ServerClasses.GenericCollection");
if(A!="undefined"||A!=null){if(fn_Global_SafeBool_Bool(A._____bIsOfGenericList)){return A;
}}throw B;};CClientLib.ServerClasses.Map=function(){this._mapID="";this._title="";
this._description="";this._totalDistance=0;this._defaultLat="";this._defaultLng="";
this._defaultZoom=16;this._defaultMapType="";this._routeXML="";};CClientLib.ServerClasses.Map.prototype.get_mapID=function(){return fn_Global_SafeString_String(this._mapID);
};CClientLib.ServerClasses.Map.prototype.set_mapID=function(A){this._mapID=A;};CClientLib.ServerClasses.Map.prototype.get_title=function(){return fn_Global_SafeString_String(this._title);
};CClientLib.ServerClasses.Map.prototype.set_title=function(A){this._title=A;};CClientLib.ServerClasses.Map.prototype.get_description=function(){return fn_Global_SafeString_String(this._description);
};CClientLib.ServerClasses.Map.prototype.set_description=function(A){this._description=A;
};CClientLib.ServerClasses.Map.prototype.get_totalDistance=function(){return fn_Global_SafeDecimal_Decimal(this._totalDistance);
};CClientLib.ServerClasses.Map.prototype.set_totalDistance=function(A){this._totalDistance=A;
};CClientLib.ServerClasses.Map.prototype.get_defaultLat=function(){return fn_Global_SafeString_String(this._defaultLat);
};CClientLib.ServerClasses.Map.prototype.set_defaultLat=function(A){this._defaultLat=A;
};CClientLib.ServerClasses.Map.prototype.get_defaultLng=function(){return fn_Global_SafeString_String(this._defaultLng);
};CClientLib.ServerClasses.Map.prototype.set_defaultLng=function(A){this._defaultLng=A;
};CClientLib.ServerClasses.Map.prototype.get_defaultZoom=function(){return fn_Global_SafeInt_Int(this._defaultZoom);
};CClientLib.ServerClasses.Map.prototype.set_defaultZoom=function(A){this._defaultZoom=A;
};CClientLib.ServerClasses.Map.prototype.get_defaultMapType=function(){return fn_Global_SafeString_String(this._defaultMapType);
};CClientLib.ServerClasses.Map.prototype.set_defaultMapType=function(A){this._defaultMapType=A;
};CClientLib.ServerClasses.Map.prototype.get_routeXML=function(){return fn_Global_SafeString_String(this._routeXML);
};CClientLib.ServerClasses.Map.prototype.set_routeXML=function(A){this._routeXML=A;
};CClientLib.ServerClasses.Map.registerClass("CClientLib.ServerClasses.Map");CClientLib.ServerClasses.Map.Properties={};
CClientLib.ServerClasses.Map.Properties.MapID="_mapID";CClientLib.ServerClasses.Map.Properties.Title="_title";
CClientLib.ServerClasses.Map.Properties.Description="_description";CClientLib.ServerClasses.Map.Properties.TotalDistance="_totalDistance";
CClientLib.ServerClasses.Map.Properties.DefaultLat="_defaultLat";CClientLib.ServerClasses.Map.Properties.DefaultLng="_defaultLng";
CClientLib.ServerClasses.Map.Properties.DefaultZoom="_defaultZoom";CClientLib.ServerClasses.Map.Properties.DefaultMapType="_defaultMapType";
CClientLib.ServerClasses.Map.Properties.RouteXML="_routeXML";CClientLib.ServerClasses.Map.GetSafeWSObject=function(A){A=CClientLib.ServerClasses.Map.parse(A);
return{_mapID:A.get_mapID(),_title:A.get_title(),_description:A.get_description(),_totalDistance:A.get_totalDistance(),_defaultLat:A.get_defaultLat(),_defaultLng:A.get_defaultLng(),_defaultZoom:A.get_defaultZoom(),_defaultMapType:A.get_defaultMapType(),_routeXML:A.get_routeXML()};
};if(_$1!=undefined||_$1!=null){alert("Error: 13092 - variable already in use");}var _$1=CClientLib.ServerClasses.Map._serverParse=function(A){if(A.length!=9){alert("Parameter mismatch count: 2012. Expected 9 but only recieved "+A.length+" in CClientLib.ServerClasses.Map");
}var B=new CClientLib.ServerClasses.Map();B.set_mapID(A[0]);B.set_title(A[1]);B.set_description(A[2]);
B.set_totalDistance(A[3]);B.set_defaultLat(A[4]);B.set_defaultLng(A[5]);B.set_defaultZoom(A[6]);
B.set_defaultMapType(A[7]);B.set_routeXML(A[8]);return B;};CClientLib.ServerClasses.Map.parse=function(A){return CClientLib.ServerClasses.Map._parse(A);
};CClientLib.ServerClasses.MapCollection=function(A){this._aCollection=[];this.add_items(A);
this._____bIsOfGenericList=true;};CClientLib.ServerClasses.MapCollection.prototype.get_items=CClientLib.ServerClasses.MapCollection.prototype.get_maps=function(){return this._aCollection;
};CClientLib.ServerClasses.MapCollection.prototype.get_item=CClientLib.ServerClasses.MapCollection.prototype.get_map=function(A){return this._aCollection[A];
};CClientLib.ServerClasses.MapCollection.prototype.get_itemText=CClientLib.ServerClasses.MapCollection.prototype.get_mapText=function(A){return this.get_item(A)[this.get_collectionText()];
};CClientLib.ServerClasses.MapCollection.prototype.get_itemByValue=CClientLib.ServerClasses.MapCollection.prototype.get_mapByMapID=function(D){try{for(var B=0;
B<this.item_count();B++){var C=this.get_item(B);if(C[this.get_collectionKey()]=="undefined"){alert("warning key value is undefined: "+this.get_collectionKey());
}else{if(D.toString()==C[this.get_collectionKey()].toString()){return C;}}}return null;
}catch(A){fn_Global_DebbugingAlertObject(C,"******Key value: "+D);}};CClientLib.ServerClasses.MapCollection.prototype.add_item=CClientLib.ServerClasses.MapCollection.prototype.add_map=function(A){if(A[this.get_collectionKey()]=="undefined"||A[this.get_collectionText()]=="undefined"){alert("Error unable to add the item to the collection as it doesnt have both a key and text value");
fn_Global_DebbugingAlertObject(A,"Required Key: "+this.get_collectionKey()+" | Requied Text: "+this.get_collectionText());
}this._aCollection[this._aCollection.length]=A;};CClientLib.ServerClasses.MapCollection.prototype.remove_item=CClientLib.ServerClasses.MapCollection.prototype.remove_map=function(A){while(Array.contains(this._aCollection,A)){Array.remove(this._aCollection,A);
}};CClientLib.ServerClasses.MapCollection.prototype.item_count=CClientLib.ServerClasses.MapCollection.prototype.map_count=function(){return this._aCollection.length;
};CClientLib.ServerClasses.MapCollection.prototype.add_items=CClientLib.ServerClasses.MapCollection.prototype.add_maps=function(B){for(var A=0;
A<B.length;A++){this.add_item(B[A]);}};CClientLib.ServerClasses.MapCollection.prototype.get_collectionKey=function(){return"_mapID";
};CClientLib.ServerClasses.MapCollection.prototype.get_collectionText=function(){return"_title";
};CClientLib.ServerClasses.MapCollection.registerClass("CClientLib.ServerClasses.MapCollection");
CClientLib.ServerClasses.MapCollection.parse=function(A){return CClientLib.ServerClasses.MapCollection._parse(A);
};CClientLib.ServerClasses.Exercise=function(){this._exerciseID="";this._title="";
this._description="";this._imageURL="";this._showRepetitions=true;this._showWeight=true;
this._showDistance=true;this._showDuration=true;};CClientLib.ServerClasses.Exercise.prototype.get_exerciseID=function(){return fn_Global_SafeString_String(this._exerciseID);
};CClientLib.ServerClasses.Exercise.prototype.set_exerciseID=function(A){this._exerciseID=A;
};CClientLib.ServerClasses.Exercise.prototype.get_title=function(){return fn_Global_SafeString_String(this._title);
};CClientLib.ServerClasses.Exercise.prototype.set_title=function(A){this._title=A;
};CClientLib.ServerClasses.Exercise.prototype.get_description=function(){return fn_Global_SafeString_String(this._description);
};CClientLib.ServerClasses.Exercise.prototype.set_description=function(A){this._description=A;
};CClientLib.ServerClasses.Exercise.prototype.get_imageURL=function(){return fn_Global_SafeString_String(this._imageURL);
};CClientLib.ServerClasses.Exercise.prototype.set_imageURL=function(A){this._imageURL=A;
};CClientLib.ServerClasses.Exercise.prototype.get_showRepetitions=function(){return fn_Global_SafeBool_Bool(this._showRepetitions);
};CClientLib.ServerClasses.Exercise.prototype.set_showRepetitions=function(A){this._showRepetitions=A;
};CClientLib.ServerClasses.Exercise.prototype.get_showWeight=function(){return fn_Global_SafeBool_Bool(this._showWeight);
};CClientLib.ServerClasses.Exercise.prototype.set_showWeight=function(A){this._showWeight=A;
};CClientLib.ServerClasses.Exercise.prototype.get_showDistance=function(){return fn_Global_SafeBool_Bool(this._showDistance);
};CClientLib.ServerClasses.Exercise.prototype.set_showDistance=function(A){this._showDistance=A;
};CClientLib.ServerClasses.Exercise.prototype.get_showDuration=function(){return fn_Global_SafeBool_Bool(this._showDuration);
};CClientLib.ServerClasses.Exercise.prototype.set_showDuration=function(A){this._showDuration=A;
};CClientLib.ServerClasses.Exercise.registerClass("CClientLib.ServerClasses.Exercise");
CClientLib.ServerClasses.Exercise.Properties={};CClientLib.ServerClasses.Exercise.Properties.ExerciseID="_exerciseID";
CClientLib.ServerClasses.Exercise.Properties.Title="_title";CClientLib.ServerClasses.Exercise.Properties.Description="_description";
CClientLib.ServerClasses.Exercise.Properties.ImageURL="_imageURL";CClientLib.ServerClasses.Exercise.Properties.ShowRepetitions="_showRepetitions";
CClientLib.ServerClasses.Exercise.Properties.ShowWeight="_showWeight";CClientLib.ServerClasses.Exercise.Properties.ShowDistance="_showDistance";
CClientLib.ServerClasses.Exercise.Properties.ShowDuration="_showDuration";CClientLib.ServerClasses.Exercise.GetSafeWSObject=function(A){A=CClientLib.ServerClasses.Exercise.parse(A);
return{_exerciseID:A.get_exerciseID(),_title:A.get_title(),_description:A.get_description(),_imageURL:A.get_imageURL(),_showRepetitions:A.get_showRepetitions(),_showWeight:A.get_showWeight(),_showDistance:A.get_showDistance(),_showDuration:A.get_showDuration()};
};if(_$2!=undefined||_$2!=null){alert("Error: 13092 - variable already in use");}var _$2=CClientLib.ServerClasses.Exercise._serverParse=function(A){if(A.length!=8){alert("Parameter mismatch count: 2012. Expected 8 but only recieved "+A.length+" in CClientLib.ServerClasses.Exercise");
}var B=new CClientLib.ServerClasses.Exercise();B.set_exerciseID(A[0]);B.set_title(A[1]);
B.set_description(A[2]);B.set_imageURL(A[3]);B.set_showRepetitions(A[4]);B.set_showWeight(A[5]);
B.set_showDistance(A[6]);B.set_showDuration(A[7]);return B;};CClientLib.ServerClasses.Exercise.parse=function(A){return CClientLib.ServerClasses.Exercise._parse(A);
};CClientLib.ServerClasses.ExerciseCollection=function(A){this._aCollection=[];this.add_items(A);
this._____bIsOfGenericList=true;};CClientLib.ServerClasses.ExerciseCollection.prototype.get_items=CClientLib.ServerClasses.ExerciseCollection.prototype.get_exercises=function(){return this._aCollection;
};CClientLib.ServerClasses.ExerciseCollection.prototype.get_item=CClientLib.ServerClasses.ExerciseCollection.prototype.get_exercise=function(A){return this._aCollection[A];
};CClientLib.ServerClasses.ExerciseCollection.prototype.get_itemText=CClientLib.ServerClasses.ExerciseCollection.prototype.get_exerciseText=function(A){return this.get_item(A)[this.get_collectionText()];
};CClientLib.ServerClasses.ExerciseCollection.prototype.get_itemByValue=CClientLib.ServerClasses.ExerciseCollection.prototype.get_exerciseByExerciseID=function(D){try{for(var B=0;
B<this.item_count();B++){var C=this.get_item(B);if(C[this.get_collectionKey()]=="undefined"){alert("warning key value is undefined: "+this.get_collectionKey());
}else{if(D.toString()==C[this.get_collectionKey()].toString()){return C;}}}return null;
}catch(A){fn_Global_DebbugingAlertObject(C,"******Key value: "+D);}};CClientLib.ServerClasses.ExerciseCollection.prototype.add_item=CClientLib.ServerClasses.ExerciseCollection.prototype.add_exercise=function(A){if(A[this.get_collectionKey()]=="undefined"||A[this.get_collectionText()]=="undefined"){alert("Error unable to add the item to the collection as it doesnt have both a key and text value");
fn_Global_DebbugingAlertObject(A,"Required Key: "+this.get_collectionKey()+" | Requied Text: "+this.get_collectionText());
}this._aCollection[this._aCollection.length]=A;};CClientLib.ServerClasses.ExerciseCollection.prototype.remove_item=CClientLib.ServerClasses.ExerciseCollection.prototype.remove_exercise=function(A){while(Array.contains(this._aCollection,A)){Array.remove(this._aCollection,A);
}};CClientLib.ServerClasses.ExerciseCollection.prototype.item_count=CClientLib.ServerClasses.ExerciseCollection.prototype.exercise_count=function(){return this._aCollection.length;
};CClientLib.ServerClasses.ExerciseCollection.prototype.add_items=CClientLib.ServerClasses.ExerciseCollection.prototype.add_exercises=function(B){for(var A=0;
A<B.length;A++){this.add_item(B[A]);}};CClientLib.ServerClasses.ExerciseCollection.prototype.get_collectionKey=function(){return"_exerciseID";
};CClientLib.ServerClasses.ExerciseCollection.prototype.get_collectionText=function(){return"_title";
};CClientLib.ServerClasses.ExerciseCollection.registerClass("CClientLib.ServerClasses.ExerciseCollection");
CClientLib.ServerClasses.ExerciseCollection.parse=function(A){return CClientLib.ServerClasses.ExerciseCollection._parse(A);
};CClientLib.ServerClasses.UnitWeight=function(){this._unitWeightID=0;this._title="";
this._description="";};CClientLib.ServerClasses.UnitWeight.prototype.get_unitWeightID=function(){return fn_Global_SafeInt_Int(this._unitWeightID);
};CClientLib.ServerClasses.UnitWeight.prototype.set_unitWeightID=function(A){this._unitWeightID=A;
};CClientLib.ServerClasses.UnitWeight.prototype.get_title=function(){return fn_Global_SafeString_String(this._title);
};CClientLib.ServerClasses.UnitWeight.prototype.set_title=function(A){this._title=A;
};CClientLib.ServerClasses.UnitWeight.prototype.get_description=function(){return fn_Global_SafeString_String(this._description);
};CClientLib.ServerClasses.UnitWeight.prototype.set_description=function(A){this._description=A;
};CClientLib.ServerClasses.UnitWeight.registerClass("CClientLib.ServerClasses.UnitWeight");
CClientLib.ServerClasses.UnitWeight.Properties={};CClientLib.ServerClasses.UnitWeight.Properties.UnitWeightID="_unitWeightID";
CClientLib.ServerClasses.UnitWeight.Properties.Title="_title";CClientLib.ServerClasses.UnitWeight.Properties.Description="_description";
CClientLib.ServerClasses.UnitWeight.GetSafeWSObject=function(A){A=CClientLib.ServerClasses.UnitWeight.parse(A);
return{_unitWeightID:A.get_unitWeightID(),_title:A.get_title(),_description:A.get_description()};
};if(_$3!=undefined||_$3!=null){alert("Error: 13092 - variable already in use");}var _$3=CClientLib.ServerClasses.UnitWeight._serverParse=function(A){if(A.length!=3){alert("Parameter mismatch count: 2012. Expected 3 but only recieved "+A.length+" in CClientLib.ServerClasses.UnitWeight");
}var B=new CClientLib.ServerClasses.UnitWeight();B.set_unitWeightID(A[0]);B.set_title(A[1]);
B.set_description(A[2]);return B;};CClientLib.ServerClasses.UnitWeight.parse=function(A){return CClientLib.ServerClasses.UnitWeight._parse(A);
};CClientLib.ServerClasses.UnitWeightCollection=function(A){this._aCollection=[];
this.add_items(A);this._____bIsOfGenericList=true;};CClientLib.ServerClasses.UnitWeightCollection.prototype.get_items=CClientLib.ServerClasses.UnitWeightCollection.prototype.get_unitWeights=function(){return this._aCollection;
};CClientLib.ServerClasses.UnitWeightCollection.prototype.get_item=CClientLib.ServerClasses.UnitWeightCollection.prototype.get_unitWeight=function(A){return this._aCollection[A];
};CClientLib.ServerClasses.UnitWeightCollection.prototype.get_itemText=CClientLib.ServerClasses.UnitWeightCollection.prototype.get_unitWeightText=function(A){return this.get_item(A)[this.get_collectionText()];
};CClientLib.ServerClasses.UnitWeightCollection.prototype.get_itemByValue=CClientLib.ServerClasses.UnitWeightCollection.prototype.get_unitWeightByUnitWeightID=function(D){try{for(var B=0;
B<this.item_count();B++){var C=this.get_item(B);if(C[this.get_collectionKey()]=="undefined"){alert("warning key value is undefined: "+this.get_collectionKey());
}else{if(D.toString()==C[this.get_collectionKey()].toString()){return C;}}}return null;
}catch(A){fn_Global_DebbugingAlertObject(C,"******Key value: "+D);}};CClientLib.ServerClasses.UnitWeightCollection.prototype.add_item=CClientLib.ServerClasses.UnitWeightCollection.prototype.add_unitWeight=function(A){if(A[this.get_collectionKey()]=="undefined"||A[this.get_collectionText()]=="undefined"){alert("Error unable to add the item to the collection as it doesnt have both a key and text value");
fn_Global_DebbugingAlertObject(A,"Required Key: "+this.get_collectionKey()+" | Requied Text: "+this.get_collectionText());
}this._aCollection[this._aCollection.length]=A;};CClientLib.ServerClasses.UnitWeightCollection.prototype.remove_item=CClientLib.ServerClasses.UnitWeightCollection.prototype.remove_unitWeight=function(A){while(Array.contains(this._aCollection,A)){Array.remove(this._aCollection,A);
}};CClientLib.ServerClasses.UnitWeightCollection.prototype.item_count=CClientLib.ServerClasses.UnitWeightCollection.prototype.unitWeight_count=function(){return this._aCollection.length;
};CClientLib.ServerClasses.UnitWeightCollection.prototype.add_items=CClientLib.ServerClasses.UnitWeightCollection.prototype.add_unitWeights=function(B){for(var A=0;
A<B.length;A++){this.add_item(B[A]);}};CClientLib.ServerClasses.UnitWeightCollection.prototype.get_collectionKey=function(){return"_unitWeightID";
};CClientLib.ServerClasses.UnitWeightCollection.prototype.get_collectionText=function(){return"_title";
};CClientLib.ServerClasses.UnitWeightCollection.registerClass("CClientLib.ServerClasses.UnitWeightCollection");
CClientLib.ServerClasses.UnitWeightCollection.parse=function(A){return CClientLib.ServerClasses.UnitWeightCollection._parse(A);
};CClientLib.ServerClasses.UnitDistance=function(){this._unitDistanceID=0;this._title="";
this._description="";};CClientLib.ServerClasses.UnitDistance.prototype.get_unitDistanceID=function(){return fn_Global_SafeInt_Int(this._unitDistanceID);
};CClientLib.ServerClasses.UnitDistance.prototype.set_unitDistanceID=function(A){this._unitDistanceID=A;
};CClientLib.ServerClasses.UnitDistance.prototype.get_title=function(){return fn_Global_SafeString_String(this._title);
};CClientLib.ServerClasses.UnitDistance.prototype.set_title=function(A){this._title=A;
};CClientLib.ServerClasses.UnitDistance.prototype.get_description=function(){return fn_Global_SafeString_String(this._description);
};CClientLib.ServerClasses.UnitDistance.prototype.set_description=function(A){this._description=A;
};CClientLib.ServerClasses.UnitDistance.registerClass("CClientLib.ServerClasses.UnitDistance");
CClientLib.ServerClasses.UnitDistance.Properties={};CClientLib.ServerClasses.UnitDistance.Properties.UnitDistanceID="_unitDistanceID";
CClientLib.ServerClasses.UnitDistance.Properties.Title="_title";CClientLib.ServerClasses.UnitDistance.Properties.Description="_description";
CClientLib.ServerClasses.UnitDistance.GetSafeWSObject=function(A){A=CClientLib.ServerClasses.UnitDistance.parse(A);
return{_unitDistanceID:A.get_unitDistanceID(),_title:A.get_title(),_description:A.get_description()};
};if(_$4!=undefined||_$4!=null){alert("Error: 13092 - variable already in use");}var _$4=CClientLib.ServerClasses.UnitDistance._serverParse=function(A){if(A.length!=3){alert("Parameter mismatch count: 2012. Expected 3 but only recieved "+A.length+" in CClientLib.ServerClasses.UnitDistance");
}var B=new CClientLib.ServerClasses.UnitDistance();B.set_unitDistanceID(A[0]);B.set_title(A[1]);
B.set_description(A[2]);return B;};CClientLib.ServerClasses.UnitDistance.parse=function(A){return CClientLib.ServerClasses.UnitDistance._parse(A);
};CClientLib.ServerClasses.UnitDistanceCollection=function(A){this._aCollection=[];
this.add_items(A);this._____bIsOfGenericList=true;};CClientLib.ServerClasses.UnitDistanceCollection.prototype.get_items=CClientLib.ServerClasses.UnitDistanceCollection.prototype.get_unitDistances=function(){return this._aCollection;
};CClientLib.ServerClasses.UnitDistanceCollection.prototype.get_item=CClientLib.ServerClasses.UnitDistanceCollection.prototype.get_unitDistance=function(A){return this._aCollection[A];
};CClientLib.ServerClasses.UnitDistanceCollection.prototype.get_itemText=CClientLib.ServerClasses.UnitDistanceCollection.prototype.get_unitDistanceText=function(A){return this.get_item(A)[this.get_collectionText()];
};CClientLib.ServerClasses.UnitDistanceCollection.prototype.get_itemByValue=CClientLib.ServerClasses.UnitDistanceCollection.prototype.get_unitDistanceByUnitDistanceID=function(D){try{for(var B=0;
B<this.item_count();B++){var C=this.get_item(B);if(C[this.get_collectionKey()]=="undefined"){alert("warning key value is undefined: "+this.get_collectionKey());
}else{if(D.toString()==C[this.get_collectionKey()].toString()){return C;}}}return null;
}catch(A){fn_Global_DebbugingAlertObject(C,"******Key value: "+D);}};CClientLib.ServerClasses.UnitDistanceCollection.prototype.add_item=CClientLib.ServerClasses.UnitDistanceCollection.prototype.add_unitDistance=function(A){if(A[this.get_collectionKey()]=="undefined"||A[this.get_collectionText()]=="undefined"){alert("Error unable to add the item to the collection as it doesnt have both a key and text value");
fn_Global_DebbugingAlertObject(A,"Required Key: "+this.get_collectionKey()+" | Requied Text: "+this.get_collectionText());
}this._aCollection[this._aCollection.length]=A;};CClientLib.ServerClasses.UnitDistanceCollection.prototype.remove_item=CClientLib.ServerClasses.UnitDistanceCollection.prototype.remove_unitDistance=function(A){while(Array.contains(this._aCollection,A)){Array.remove(this._aCollection,A);
}};CClientLib.ServerClasses.UnitDistanceCollection.prototype.item_count=CClientLib.ServerClasses.UnitDistanceCollection.prototype.unitDistance_count=function(){return this._aCollection.length;
};CClientLib.ServerClasses.UnitDistanceCollection.prototype.add_items=CClientLib.ServerClasses.UnitDistanceCollection.prototype.add_unitDistances=function(A){for(var B=0;
B<A.length;B++){this.add_item(A[B]);}};CClientLib.ServerClasses.UnitDistanceCollection.prototype.get_collectionKey=function(){return"_unitDistanceID";
};CClientLib.ServerClasses.UnitDistanceCollection.prototype.get_collectionText=function(){return"_title";
};CClientLib.ServerClasses.UnitDistanceCollection.registerClass("CClientLib.ServerClasses.UnitDistanceCollection");
CClientLib.ServerClasses.UnitDistanceCollection.parse=function(A){return CClientLib.ServerClasses.UnitDistanceCollection._parse(A);
};CClientLib.ServerClasses.SelectableTime=function(){this._selectableTimeID=0;this._selectableTime="TrainingLog_CodeBase.Code.Time";
};CClientLib.ServerClasses.SelectableTime.prototype.get_selectableTimeID=function(){return fn_Global_SafeInt_Int(this._selectableTimeID);
};CClientLib.ServerClasses.SelectableTime.prototype.set_selectableTimeID=function(A){this._selectableTimeID=A;
};CClientLib.ServerClasses.SelectableTime.prototype.get_selectableTime=function(){return fn_Global_SafeString_String(this._selectableTime);
};CClientLib.ServerClasses.SelectableTime.prototype.set_selectableTime=function(A){this._selectableTime=A;
};CClientLib.ServerClasses.SelectableTime.registerClass("CClientLib.ServerClasses.SelectableTime");
CClientLib.ServerClasses.SelectableTime.Properties={};CClientLib.ServerClasses.SelectableTime.Properties.SelectableTimeID="_selectableTimeID";
CClientLib.ServerClasses.SelectableTime.Properties.SelectableTime="_selectableTime";
CClientLib.ServerClasses.SelectableTime.GetSafeWSObject=function(A){A=CClientLib.ServerClasses.SelectableTime.parse(A);
return{_selectableTimeID:A.get_selectableTimeID(),_selectableTime:A.get_selectableTime()};
};if(_$5!=undefined||_$5!=null){alert("Error: 13092 - variable already in use");}var _$5=CClientLib.ServerClasses.SelectableTime._serverParse=function(A){if(A.length!=2){alert("Parameter mismatch count: 2012. Expected 2 but only recieved "+A.length+" in CClientLib.ServerClasses.SelectableTime");
}var B=new CClientLib.ServerClasses.SelectableTime();B.set_selectableTimeID(A[0]);
B.set_selectableTime(A[1]);return B;};CClientLib.ServerClasses.SelectableTime.parse=function(A){return CClientLib.ServerClasses.SelectableTime._parse(A);
};CClientLib.ServerClasses.SelectableTimeCollection=function(A){this._aCollection=[];
this.add_items(A);this._____bIsOfGenericList=true;};CClientLib.ServerClasses.SelectableTimeCollection.prototype.get_items=CClientLib.ServerClasses.SelectableTimeCollection.prototype.get_selectableTimes=function(){return this._aCollection;
};CClientLib.ServerClasses.SelectableTimeCollection.prototype.get_item=CClientLib.ServerClasses.SelectableTimeCollection.prototype.get_selectableTime=function(A){return this._aCollection[A];
};CClientLib.ServerClasses.SelectableTimeCollection.prototype.get_itemText=CClientLib.ServerClasses.SelectableTimeCollection.prototype.get_selectableTimeText=function(A){return this.get_item(A)[this.get_collectionText()];
};CClientLib.ServerClasses.SelectableTimeCollection.prototype.get_itemByValue=CClientLib.ServerClasses.SelectableTimeCollection.prototype.get_selectableTimeBySelectableTimeID=function(D){try{for(var B=0;
B<this.item_count();B++){var C=this.get_item(B);if(C[this.get_collectionKey()]=="undefined"){alert("warning key value is undefined: "+this.get_collectionKey());
}else{if(D.toString()==C[this.get_collectionKey()].toString()){return C;}}}return null;
}catch(A){fn_Global_DebbugingAlertObject(C,"******Key value: "+D);}};CClientLib.ServerClasses.SelectableTimeCollection.prototype.add_item=CClientLib.ServerClasses.SelectableTimeCollection.prototype.add_selectableTime=function(A){if(A[this.get_collectionKey()]=="undefined"||A[this.get_collectionText()]=="undefined"){alert("Error unable to add the item to the collection as it doesnt have both a key and text value");
fn_Global_DebbugingAlertObject(A,"Required Key: "+this.get_collectionKey()+" | Requied Text: "+this.get_collectionText());
}this._aCollection[this._aCollection.length]=A;};CClientLib.ServerClasses.SelectableTimeCollection.prototype.remove_item=CClientLib.ServerClasses.SelectableTimeCollection.prototype.remove_selectableTime=function(A){while(Array.contains(this._aCollection,A)){Array.remove(this._aCollection,A);
}};CClientLib.ServerClasses.SelectableTimeCollection.prototype.item_count=CClientLib.ServerClasses.SelectableTimeCollection.prototype.selectableTime_count=function(){return this._aCollection.length;
};CClientLib.ServerClasses.SelectableTimeCollection.prototype.add_items=CClientLib.ServerClasses.SelectableTimeCollection.prototype.add_selectableTimes=function(B){for(var A=0;
A<B.length;A++){this.add_item(B[A]);}};CClientLib.ServerClasses.SelectableTimeCollection.prototype.get_collectionKey=function(){return"_selectableTimeID";
};CClientLib.ServerClasses.SelectableTimeCollection.prototype.get_collectionText=function(){return"_selectableTime";
};CClientLib.ServerClasses.SelectableTimeCollection.registerClass("CClientLib.ServerClasses.SelectableTimeCollection");
CClientLib.ServerClasses.SelectableTimeCollection.parse=function(A){return CClientLib.ServerClasses.SelectableTimeCollection._parse(A);
};CClientLib.ServerClasses.Program=function(){this._programID=0;this._title="";this._creationUserName="";
this._lastUpdatedUserName="";this._archivedDateTime=null;this._isScheduled=false;
this._permissionID=0;this._statusID=0;};CClientLib.ServerClasses.Program.prototype.get_programID=function(){return fn_Global_SafeInt_Int(this._programID);
};CClientLib.ServerClasses.Program.prototype.set_programID=function(A){this._programID=A;
};CClientLib.ServerClasses.Program.prototype.get_title=function(){return fn_Global_SafeString_String(this._title);
};CClientLib.ServerClasses.Program.prototype.set_title=function(A){this._title=A;
};CClientLib.ServerClasses.Program.prototype.get_creationUserName=function(){return fn_Global_SafeString_String(this._creationUserName);
};CClientLib.ServerClasses.Program.prototype.set_creationUserName=function(A){this._creationUserName=A;
};CClientLib.ServerClasses.Program.prototype.get_lastUpdatedUserName=function(){return fn_Global_SafeString_String(this._lastUpdatedUserName);
};CClientLib.ServerClasses.Program.prototype.set_lastUpdatedUserName=function(A){this._lastUpdatedUserName=A;
};CClientLib.ServerClasses.Program.prototype.get_archivedDateTime=function(){return((CClientLib.Type.Date.isDate(this._archivedDateTime))?this._archivedDateTime:null);
};CClientLib.ServerClasses.Program.prototype.set_archivedDateTime=function(A){this._archivedDateTime=A;
};CClientLib.ServerClasses.Program.prototype.get_isScheduled=function(){return fn_Global_SafeBool_Bool(this._isScheduled);
};CClientLib.ServerClasses.Program.prototype.set_isScheduled=function(A){this._isScheduled=A;
};CClientLib.ServerClasses.Program.prototype.get_permissionID=function(){return fn_Global_SafeInt_Int(this._permissionID);
};CClientLib.ServerClasses.Program.prototype.set_permissionID=function(A){this._permissionID=A;
};CClientLib.ServerClasses.Program.prototype.get_statusID=function(){return fn_Global_SafeInt_Int(this._statusID);
};CClientLib.ServerClasses.Program.prototype.set_statusID=function(A){this._statusID=A;
};CClientLib.ServerClasses.Program.registerClass("CClientLib.ServerClasses.Program");
CClientLib.ServerClasses.Program.Properties={};CClientLib.ServerClasses.Program.Properties.ProgramID="_programID";
CClientLib.ServerClasses.Program.Properties.Title="_title";CClientLib.ServerClasses.Program.Properties.CreationUserName="_creationUserName";
CClientLib.ServerClasses.Program.Properties.LastUpdatedUserName="_lastUpdatedUserName";
CClientLib.ServerClasses.Program.Properties.ArchivedDateTime="_archivedDateTime";
CClientLib.ServerClasses.Program.Properties.IsScheduled="_isScheduled";CClientLib.ServerClasses.Program.Properties.PermissionID="_permissionID";
CClientLib.ServerClasses.Program.Properties.StatusID="_statusID";CClientLib.ServerClasses.Program.GetSafeWSObject=function(A){A=CClientLib.ServerClasses.Program.parse(A);
return{_programID:A.get_programID(),_title:A.get_title(),_creationUserName:A.get_creationUserName(),_lastUpdatedUserName:A.get_lastUpdatedUserName(),_archivedDateTime:(CClientLib.Type.Date.isDate(A.get_archivedDateTime())?new Date(A.get_archivedDateTime()):new Date("1/1/1900")),_isScheduled:A.get_isScheduled(),_permissionID:A.get_permissionID(),_statusID:A.get_statusID()};
};if(_$6!=undefined||_$6!=null){alert("Error: 13092 - variable already in use");}var _$6=CClientLib.ServerClasses.Program._serverParse=function(A){if(A.length!=8){alert("Parameter mismatch count: 2012. Expected 8 but only recieved "+A.length+" in CClientLib.ServerClasses.Program");
}var B=new CClientLib.ServerClasses.Program();B.set_programID(A[0]);B.set_title(A[1]);
B.set_creationUserName(A[2]);B.set_lastUpdatedUserName(A[3]);B.set_archivedDateTime(A[4]);
B.set_isScheduled(A[5]);B.set_permissionID(A[6]);B.set_statusID(A[7]);return B;};
CClientLib.ServerClasses.Program.parse=function(A){return CClientLib.ServerClasses.Program._parse(A);
};CClientLib.ServerClasses.ProgramCollection=function(A){this._aCollection=[];this.add_items(A);
this._____bIsOfGenericList=true;};CClientLib.ServerClasses.ProgramCollection.prototype.get_items=CClientLib.ServerClasses.ProgramCollection.prototype.get_programs=function(){return this._aCollection;
};CClientLib.ServerClasses.ProgramCollection.prototype.get_item=CClientLib.ServerClasses.ProgramCollection.prototype.get_program=function(A){return this._aCollection[A];
};CClientLib.ServerClasses.ProgramCollection.prototype.get_itemText=CClientLib.ServerClasses.ProgramCollection.prototype.get_programText=function(A){return this.get_item(A)[this.get_collectionText()];
};CClientLib.ServerClasses.ProgramCollection.prototype.get_itemByValue=CClientLib.ServerClasses.ProgramCollection.prototype.get_programByProgramID=function(D){try{for(var B=0;
B<this.item_count();B++){var C=this.get_item(B);if(C[this.get_collectionKey()]=="undefined"){alert("warning key value is undefined: "+this.get_collectionKey());
}else{if(D.toString()==C[this.get_collectionKey()].toString()){return C;}}}return null;
}catch(A){fn_Global_DebbugingAlertObject(C,"******Key value: "+D);}};CClientLib.ServerClasses.ProgramCollection.prototype.add_item=CClientLib.ServerClasses.ProgramCollection.prototype.add_program=function(A){if(A[this.get_collectionKey()]=="undefined"||A[this.get_collectionText()]=="undefined"){alert("Error unable to add the item to the collection as it doesnt have both a key and text value");
fn_Global_DebbugingAlertObject(A,"Required Key: "+this.get_collectionKey()+" | Requied Text: "+this.get_collectionText());
}this._aCollection[this._aCollection.length]=A;};CClientLib.ServerClasses.ProgramCollection.prototype.remove_item=CClientLib.ServerClasses.ProgramCollection.prototype.remove_program=function(A){while(Array.contains(this._aCollection,A)){Array.remove(this._aCollection,A);
}};CClientLib.ServerClasses.ProgramCollection.prototype.item_count=CClientLib.ServerClasses.ProgramCollection.prototype.program_count=function(){return this._aCollection.length;
};CClientLib.ServerClasses.ProgramCollection.prototype.add_items=CClientLib.ServerClasses.ProgramCollection.prototype.add_programs=function(A){for(var B=0;
B<A.length;B++){this.add_item(A[B]);}};CClientLib.ServerClasses.ProgramCollection.prototype.get_collectionKey=function(){return"_programID";
};CClientLib.ServerClasses.ProgramCollection.prototype.get_collectionText=function(){return"_title";
};CClientLib.ServerClasses.ProgramCollection.registerClass("CClientLib.ServerClasses.ProgramCollection");
CClientLib.ServerClasses.ProgramCollection.parse=function(A){return CClientLib.ServerClasses.ProgramCollection._parse(A);
};CClientLib.ServerClasses.User=function(){this._userID="";this._userName="";this._firstName="";
this._lastName="";this._email="";this._dob=new Date(1970,0,1,0,0,0,0);this._sex="";
this._unitsType="";this._defaultWeightUnitID=0;this._defaultDistanceUnitID=0;this._weekStartsOn="";
this._securityQuestion="";this._mappingDefaultLat="-8.407168163601074";this._mappingDefaultLng="10.8984375";
this._mappingDefaultZoom=2;this._userRoleTitle="Individual";};CClientLib.ServerClasses.User.prototype.get_userID=function(){return fn_Global_SafeString_String(this._userID);
};CClientLib.ServerClasses.User.prototype.set_userID=function(A){this._userID=A;};
CClientLib.ServerClasses.User.prototype.get_userName=function(){return fn_Global_SafeString_String(this._userName);
};CClientLib.ServerClasses.User.prototype.set_userName=function(A){this._userName=A;
};CClientLib.ServerClasses.User.prototype.get_firstName=function(){return fn_Global_SafeString_String(this._firstName);
};CClientLib.ServerClasses.User.prototype.set_firstName=function(A){this._firstName=A;
};CClientLib.ServerClasses.User.prototype.get_lastName=function(){return fn_Global_SafeString_String(this._lastName);
};CClientLib.ServerClasses.User.prototype.set_lastName=function(A){this._lastName=A;
};CClientLib.ServerClasses.User.prototype.get_email=function(){return fn_Global_SafeString_String(this._email);
};CClientLib.ServerClasses.User.prototype.set_email=function(A){this._email=A;};CClientLib.ServerClasses.User.prototype.get_dob=function(){return((CClientLib.Type.Date.isDate(this._dob))?this._dob:null);
};CClientLib.ServerClasses.User.prototype.set_dob=function(A){this._dob=A;};CClientLib.ServerClasses.User.prototype.get_sex=function(){return fn_Global_SafeString_String(this._sex);
};CClientLib.ServerClasses.User.prototype.set_sex=function(A){this._sex=A;};CClientLib.ServerClasses.User.prototype.get_unitsType=function(){return fn_Global_SafeString_String(this._unitsType);
};CClientLib.ServerClasses.User.prototype.set_unitsType=function(A){this._unitsType=A;
};CClientLib.ServerClasses.User.prototype.get_defaultWeightUnitID=function(){return fn_Global_SafeInt_Int(this._defaultWeightUnitID);
};CClientLib.ServerClasses.User.prototype.set_defaultWeightUnitID=function(A){this._defaultWeightUnitID=A;
};CClientLib.ServerClasses.User.prototype.get_defaultDistanceUnitID=function(){return fn_Global_SafeInt_Int(this._defaultDistanceUnitID);
};CClientLib.ServerClasses.User.prototype.set_defaultDistanceUnitID=function(A){this._defaultDistanceUnitID=A;
};CClientLib.ServerClasses.User.prototype.get_weekStartsOn=function(){return fn_Global_SafeString_String(this._weekStartsOn);
};CClientLib.ServerClasses.User.prototype.set_weekStartsOn=function(A){this._weekStartsOn=A;
};CClientLib.ServerClasses.User.prototype.get_securityQuestion=function(){return fn_Global_SafeString_String(this._securityQuestion);
};CClientLib.ServerClasses.User.prototype.set_securityQuestion=function(A){this._securityQuestion=A;
};CClientLib.ServerClasses.User.prototype.get_mappingDefaultLat=function(){return fn_Global_SafeString_String(this._mappingDefaultLat);
};CClientLib.ServerClasses.User.prototype.set_mappingDefaultLat=function(A){this._mappingDefaultLat=A;
};CClientLib.ServerClasses.User.prototype.get_mappingDefaultLng=function(){return fn_Global_SafeString_String(this._mappingDefaultLng);
};CClientLib.ServerClasses.User.prototype.set_mappingDefaultLng=function(A){this._mappingDefaultLng=A;
};CClientLib.ServerClasses.User.prototype.get_mappingDefaultZoom=function(){return fn_Global_SafeInt_Int(this._mappingDefaultZoom);
};CClientLib.ServerClasses.User.prototype.set_mappingDefaultZoom=function(A){this._mappingDefaultZoom=A;
};CClientLib.ServerClasses.User.prototype.get_userRoleTitle=function(){return fn_Global_SafeString_String(this._userRoleTitle);
};CClientLib.ServerClasses.User.prototype.set_userRoleTitle=function(A){this._userRoleTitle=A;
};CClientLib.ServerClasses.User.registerClass("CClientLib.ServerClasses.User");CClientLib.ServerClasses.User.Properties={};
CClientLib.ServerClasses.User.Properties.UserID="_userID";CClientLib.ServerClasses.User.Properties.UserName="_userName";
CClientLib.ServerClasses.User.Properties.FirstName="_firstName";CClientLib.ServerClasses.User.Properties.LastName="_lastName";
CClientLib.ServerClasses.User.Properties.Email="_email";CClientLib.ServerClasses.User.Properties.Dob="_dob";
CClientLib.ServerClasses.User.Properties.Sex="_sex";CClientLib.ServerClasses.User.Properties.UnitsType="_unitsType";
CClientLib.ServerClasses.User.Properties.DefaultWeightUnitID="_defaultWeightUnitID";
CClientLib.ServerClasses.User.Properties.DefaultDistanceUnitID="_defaultDistanceUnitID";
CClientLib.ServerClasses.User.Properties.WeekStartsOn="_weekStartsOn";CClientLib.ServerClasses.User.Properties.SecurityQuestion="_securityQuestion";
CClientLib.ServerClasses.User.Properties.MappingDefaultLat="_mappingDefaultLat";CClientLib.ServerClasses.User.Properties.MappingDefaultLng="_mappingDefaultLng";
CClientLib.ServerClasses.User.Properties.MappingDefaultZoom="_mappingDefaultZoom";
CClientLib.ServerClasses.User.Properties.UserRoleTitle="_userRoleTitle";CClientLib.ServerClasses.User.GetSafeWSObject=function(A){A=CClientLib.ServerClasses.User.parse(A);
return{_userID:A.get_userID(),_userName:A.get_userName(),_firstName:A.get_firstName(),_lastName:A.get_lastName(),_email:A.get_email(),_dob:(CClientLib.Type.Date.isDate(A.get_dob())?new Date(A.get_dob()):new Date("1/1/1900")),_sex:A.get_sex(),_unitsType:A.get_unitsType(),_defaultWeightUnitID:A.get_defaultWeightUnitID(),_defaultDistanceUnitID:A.get_defaultDistanceUnitID(),_weekStartsOn:A.get_weekStartsOn(),_securityQuestion:A.get_securityQuestion(),_mappingDefaultLat:A.get_mappingDefaultLat(),_mappingDefaultLng:A.get_mappingDefaultLng(),_mappingDefaultZoom:A.get_mappingDefaultZoom(),_userRoleTitle:A.get_userRoleTitle()};
};if(_$7!=undefined||_$7!=null){alert("Error: 13092 - variable already in use");}var _$7=CClientLib.ServerClasses.User._serverParse=function(A){if(A.length!=16){alert("Parameter mismatch count: 2012. Expected 16 but only recieved "+A.length+" in CClientLib.ServerClasses.User");
}var B=new CClientLib.ServerClasses.User();B.set_userID(A[0]);B.set_userName(A[1]);
B.set_firstName(A[2]);B.set_lastName(A[3]);B.set_email(A[4]);B.set_dob(A[5]);B.set_sex(A[6]);
B.set_unitsType(A[7]);B.set_defaultWeightUnitID(A[8]);B.set_defaultDistanceUnitID(A[9]);
B.set_weekStartsOn(A[10]);B.set_securityQuestion(A[11]);B.set_mappingDefaultLat(A[12]);
B.set_mappingDefaultLng(A[13]);B.set_mappingDefaultZoom(A[14]);B.set_userRoleTitle(A[15]);
return B;};CClientLib.ServerClasses.User.parse=function(A){return CClientLib.ServerClasses.User._parse(A);
};CClientLib.ServerClasses.UserCollection=function(A){this._aCollection=[];this.add_items(A);
this._____bIsOfGenericList=true;};CClientLib.ServerClasses.UserCollection.prototype.get_items=CClientLib.ServerClasses.UserCollection.prototype.get_users=function(){return this._aCollection;
};CClientLib.ServerClasses.UserCollection.prototype.get_item=CClientLib.ServerClasses.UserCollection.prototype.get_user=function(A){return this._aCollection[A];
};CClientLib.ServerClasses.UserCollection.prototype.get_itemText=CClientLib.ServerClasses.UserCollection.prototype.get_userText=function(A){return this.get_item(A)[this.get_collectionText()];
};CClientLib.ServerClasses.UserCollection.prototype.get_itemByValue=CClientLib.ServerClasses.UserCollection.prototype.get_userByUserID=function(D){try{for(var B=0;
B<this.item_count();B++){var C=this.get_item(B);if(C[this.get_collectionKey()]=="undefined"){alert("warning key value is undefined: "+this.get_collectionKey());
}else{if(D.toString()==C[this.get_collectionKey()].toString()){return C;}}}return null;
}catch(A){fn_Global_DebbugingAlertObject(C,"******Key value: "+D);}};CClientLib.ServerClasses.UserCollection.prototype.add_item=CClientLib.ServerClasses.UserCollection.prototype.add_user=function(A){if(A[this.get_collectionKey()]=="undefined"||A[this.get_collectionText()]=="undefined"){alert("Error unable to add the item to the collection as it doesnt have both a key and text value");
fn_Global_DebbugingAlertObject(A,"Required Key: "+this.get_collectionKey()+" | Requied Text: "+this.get_collectionText());
}this._aCollection[this._aCollection.length]=A;};CClientLib.ServerClasses.UserCollection.prototype.remove_item=CClientLib.ServerClasses.UserCollection.prototype.remove_user=function(A){while(Array.contains(this._aCollection,A)){Array.remove(this._aCollection,A);
}};CClientLib.ServerClasses.UserCollection.prototype.item_count=CClientLib.ServerClasses.UserCollection.prototype.user_count=function(){return this._aCollection.length;
};CClientLib.ServerClasses.UserCollection.prototype.add_items=CClientLib.ServerClasses.UserCollection.prototype.add_users=function(A){for(var B=0;
B<A.length;B++){this.add_item(A[B]);}};CClientLib.ServerClasses.UserCollection.prototype.get_collectionKey=function(){return"_userID";
};CClientLib.ServerClasses.UserCollection.prototype.get_collectionText=function(){return"_userName";
};CClientLib.ServerClasses.UserCollection.registerClass("CClientLib.ServerClasses.UserCollection");
CClientLib.ServerClasses.UserCollection.parse=function(A){return CClientLib.ServerClasses.UserCollection._parse(A);
};CClientLib.ServerClasses.ScheduledProgram=function(){this._scheduleProgramID=0;
this._programID=0;this._startDate=null;this._completionDate=null;this._scheduleProgramStatusID=0;
this._scheduleProgramStatusTitle="";};CClientLib.ServerClasses.ScheduledProgram.prototype.get_scheduleProgramID=function(){return fn_Global_SafeInt_Int(this._scheduleProgramID);
};CClientLib.ServerClasses.ScheduledProgram.prototype.set_scheduleProgramID=function(A){this._scheduleProgramID=A;
};CClientLib.ServerClasses.ScheduledProgram.prototype.get_programID=function(){return fn_Global_SafeInt_Int(this._programID);
};CClientLib.ServerClasses.ScheduledProgram.prototype.set_programID=function(A){this._programID=A;
};CClientLib.ServerClasses.ScheduledProgram.prototype.get_startDate=function(){return((CClientLib.Type.Date.isDate(this._startDate))?this._startDate:null);
};CClientLib.ServerClasses.ScheduledProgram.prototype.set_startDate=function(A){this._startDate=A;
};CClientLib.ServerClasses.ScheduledProgram.prototype.get_completionDate=function(){return((CClientLib.Type.Date.isDate(this._completionDate))?this._completionDate:null);
};CClientLib.ServerClasses.ScheduledProgram.prototype.set_completionDate=function(A){this._completionDate=A;
};CClientLib.ServerClasses.ScheduledProgram.prototype.get_scheduleProgramStatusID=function(){return fn_Global_SafeInt_Int(this._scheduleProgramStatusID);
};CClientLib.ServerClasses.ScheduledProgram.prototype.set_scheduleProgramStatusID=function(A){this._scheduleProgramStatusID=A;
};CClientLib.ServerClasses.ScheduledProgram.prototype.get_scheduleProgramStatusTitle=function(){return fn_Global_SafeString_String(this._scheduleProgramStatusTitle);
};CClientLib.ServerClasses.ScheduledProgram.prototype.set_scheduleProgramStatusTitle=function(A){this._scheduleProgramStatusTitle=A;
};CClientLib.ServerClasses.ScheduledProgram.registerClass("CClientLib.ServerClasses.ScheduledProgram");
CClientLib.ServerClasses.ScheduledProgram.Properties={};CClientLib.ServerClasses.ScheduledProgram.Properties.ScheduleProgramID="_scheduleProgramID";
CClientLib.ServerClasses.ScheduledProgram.Properties.ProgramID="_programID";CClientLib.ServerClasses.ScheduledProgram.Properties.StartDate="_startDate";
CClientLib.ServerClasses.ScheduledProgram.Properties.CompletionDate="_completionDate";
CClientLib.ServerClasses.ScheduledProgram.Properties.ScheduleProgramStatusID="_scheduleProgramStatusID";
CClientLib.ServerClasses.ScheduledProgram.Properties.ScheduleProgramStatusTitle="_scheduleProgramStatusTitle";
CClientLib.ServerClasses.ScheduledProgram.GetSafeWSObject=function(A){A=CClientLib.ServerClasses.ScheduledProgram.parse(A);
return{_scheduleProgramID:A.get_scheduleProgramID(),_programID:A.get_programID(),_startDate:(CClientLib.Type.Date.isDate(A.get_startDate())?new Date(A.get_startDate()):new Date("1/1/1900")),_completionDate:(CClientLib.Type.Date.isDate(A.get_completionDate())?new Date(A.get_completionDate()):new Date("1/1/1900")),_scheduleProgramStatusID:A.get_scheduleProgramStatusID(),_scheduleProgramStatusTitle:A.get_scheduleProgramStatusTitle()};
};if(_$8!=undefined||_$8!=null){alert("Error: 13092 - variable already in use");}var _$8=CClientLib.ServerClasses.ScheduledProgram._serverParse=function(A){if(A.length!=6){alert("Parameter mismatch count: 2012. Expected 6 but only recieved "+A.length+" in CClientLib.ServerClasses.ScheduledProgram");
}var B=new CClientLib.ServerClasses.ScheduledProgram();B.set_scheduleProgramID(A[0]);
B.set_programID(A[1]);B.set_startDate(A[2]);B.set_completionDate(A[3]);B.set_scheduleProgramStatusID(A[4]);
B.set_scheduleProgramStatusTitle(A[5]);return B;};CClientLib.ServerClasses.ScheduledProgram.parse=function(A){return CClientLib.ServerClasses.ScheduledProgram._parse(A);
};CClientLib.ServerClasses.ScheduledProgramCollection=function(A){this._aCollection=[];
this.add_items(A);this._____bIsOfGenericList=true;};CClientLib.ServerClasses.ScheduledProgramCollection.prototype.get_items=CClientLib.ServerClasses.ScheduledProgramCollection.prototype.get_scheduledPrograms=function(){return this._aCollection;
};CClientLib.ServerClasses.ScheduledProgramCollection.prototype.get_item=CClientLib.ServerClasses.ScheduledProgramCollection.prototype.get_scheduledProgram=function(A){return this._aCollection[A];
};CClientLib.ServerClasses.ScheduledProgramCollection.prototype.get_itemText=CClientLib.ServerClasses.ScheduledProgramCollection.prototype.get_scheduledProgramText=function(A){return this.get_item(A)[this.get_collectionText()];
};CClientLib.ServerClasses.ScheduledProgramCollection.prototype.get_itemByValue=CClientLib.ServerClasses.ScheduledProgramCollection.prototype.get_scheduledProgramByScheduleProgramID=function(D){try{for(var B=0;
B<this.item_count();B++){var C=this.get_item(B);if(C[this.get_collectionKey()]=="undefined"){alert("warning key value is undefined: "+this.get_collectionKey());
}else{if(D.toString()==C[this.get_collectionKey()].toString()){return C;}}}return null;
}catch(A){fn_Global_DebbugingAlertObject(C,"******Key value: "+D);}};CClientLib.ServerClasses.ScheduledProgramCollection.prototype.add_item=CClientLib.ServerClasses.ScheduledProgramCollection.prototype.add_scheduledProgram=function(A){if(A[this.get_collectionKey()]=="undefined"||A[this.get_collectionText()]=="undefined"){alert("Error unable to add the item to the collection as it doesnt have both a key and text value");
fn_Global_DebbugingAlertObject(A,"Required Key: "+this.get_collectionKey()+" | Requied Text: "+this.get_collectionText());
}this._aCollection[this._aCollection.length]=A;};CClientLib.ServerClasses.ScheduledProgramCollection.prototype.remove_item=CClientLib.ServerClasses.ScheduledProgramCollection.prototype.remove_scheduledProgram=function(A){while(Array.contains(this._aCollection,A)){Array.remove(this._aCollection,A);
}};CClientLib.ServerClasses.ScheduledProgramCollection.prototype.item_count=CClientLib.ServerClasses.ScheduledProgramCollection.prototype.scheduledProgram_count=function(){return this._aCollection.length;
};CClientLib.ServerClasses.ScheduledProgramCollection.prototype.add_items=CClientLib.ServerClasses.ScheduledProgramCollection.prototype.add_scheduledPrograms=function(A){for(var B=0;
B<A.length;B++){this.add_item(A[B]);}};CClientLib.ServerClasses.ScheduledProgramCollection.prototype.get_collectionKey=function(){return"_scheduleProgramID";
};CClientLib.ServerClasses.ScheduledProgramCollection.prototype.get_collectionText=function(){return"_programID";
};CClientLib.ServerClasses.ScheduledProgramCollection.registerClass("CClientLib.ServerClasses.ScheduledProgramCollection");
CClientLib.ServerClasses.ScheduledProgramCollection.parse=function(A){return CClientLib.ServerClasses.ScheduledProgramCollection._parse(A);
};CClientLib.ServerClasses.Profile=function(){this._profileID="";this._profileNotes="";
this._profileDate=null;this._unitsType="";this._height=0;this._weight=0;this._girthNeck=0;
this._girthChest=0;this._girthWaist=0;this._girthHips=0;this._girthLeftArm=0;this._girthRightArm=0;
this._girthLeftThigh=0;this._girthRightThigh=0;this._girthLeftCalf=0;this._girthRightCalf=0;
};CClientLib.ServerClasses.Profile.prototype.get_profileID=function(){return fn_Global_SafeString_String(this._profileID);
};CClientLib.ServerClasses.Profile.prototype.set_profileID=function(A){this._profileID=A;
};CClientLib.ServerClasses.Profile.prototype.get_profileNotes=function(){return fn_Global_SafeString_String(this._profileNotes);
};CClientLib.ServerClasses.Profile.prototype.set_profileNotes=function(A){this._profileNotes=A;
};CClientLib.ServerClasses.Profile.prototype.get_profileDate=function(){return((CClientLib.Type.Date.isDate(this._profileDate))?this._profileDate:null);
};CClientLib.ServerClasses.Profile.prototype.set_profileDate=function(A){this._profileDate=A;
};CClientLib.ServerClasses.Profile.prototype.get_unitsType=function(){return fn_Global_SafeString_String(this._unitsType);
};CClientLib.ServerClasses.Profile.prototype.set_unitsType=function(A){this._unitsType=A;
};CClientLib.ServerClasses.Profile.prototype.get_height=function(){return fn_Global_SafeDecimal_Decimal(this._height);
};CClientLib.ServerClasses.Profile.prototype.set_height=function(A){this._height=A;
};CClientLib.ServerClasses.Profile.prototype.get_weight=function(){return fn_Global_SafeDecimal_Decimal(this._weight);
};CClientLib.ServerClasses.Profile.prototype.set_weight=function(A){this._weight=A;
};CClientLib.ServerClasses.Profile.prototype.get_girthNeck=function(){return fn_Global_SafeDecimal_Decimal(this._girthNeck);
};CClientLib.ServerClasses.Profile.prototype.set_girthNeck=function(A){this._girthNeck=A;
};CClientLib.ServerClasses.Profile.prototype.get_girthChest=function(){return fn_Global_SafeDecimal_Decimal(this._girthChest);
};CClientLib.ServerClasses.Profile.prototype.set_girthChest=function(A){this._girthChest=A;
};CClientLib.ServerClasses.Profile.prototype.get_girthWaist=function(){return fn_Global_SafeDecimal_Decimal(this._girthWaist);
};CClientLib.ServerClasses.Profile.prototype.set_girthWaist=function(A){this._girthWaist=A;
};CClientLib.ServerClasses.Profile.prototype.get_girthHips=function(){return fn_Global_SafeDecimal_Decimal(this._girthHips);
};CClientLib.ServerClasses.Profile.prototype.set_girthHips=function(A){this._girthHips=A;
};CClientLib.ServerClasses.Profile.prototype.get_girthLeftArm=function(){return fn_Global_SafeDecimal_Decimal(this._girthLeftArm);
};CClientLib.ServerClasses.Profile.prototype.set_girthLeftArm=function(A){this._girthLeftArm=A;
};CClientLib.ServerClasses.Profile.prototype.get_girthRightArm=function(){return fn_Global_SafeDecimal_Decimal(this._girthRightArm);
};CClientLib.ServerClasses.Profile.prototype.set_girthRightArm=function(A){this._girthRightArm=A;
};CClientLib.ServerClasses.Profile.prototype.get_girthLeftThigh=function(){return fn_Global_SafeDecimal_Decimal(this._girthLeftThigh);
};CClientLib.ServerClasses.Profile.prototype.set_girthLeftThigh=function(A){this._girthLeftThigh=A;
};CClientLib.ServerClasses.Profile.prototype.get_girthRightThigh=function(){return fn_Global_SafeDecimal_Decimal(this._girthRightThigh);
};CClientLib.ServerClasses.Profile.prototype.set_girthRightThigh=function(A){this._girthRightThigh=A;
};CClientLib.ServerClasses.Profile.prototype.get_girthLeftCalf=function(){return fn_Global_SafeDecimal_Decimal(this._girthLeftCalf);
};CClientLib.ServerClasses.Profile.prototype.set_girthLeftCalf=function(A){this._girthLeftCalf=A;
};CClientLib.ServerClasses.Profile.prototype.get_girthRightCalf=function(){return fn_Global_SafeDecimal_Decimal(this._girthRightCalf);
};CClientLib.ServerClasses.Profile.prototype.set_girthRightCalf=function(A){this._girthRightCalf=A;
};CClientLib.ServerClasses.Profile.registerClass("CClientLib.ServerClasses.Profile");
CClientLib.ServerClasses.Profile.Properties={};CClientLib.ServerClasses.Profile.Properties.ProfileID="_profileID";
CClientLib.ServerClasses.Profile.Properties.ProfileNotes="_profileNotes";CClientLib.ServerClasses.Profile.Properties.ProfileDate="_profileDate";
CClientLib.ServerClasses.Profile.Properties.UnitsType="_unitsType";CClientLib.ServerClasses.Profile.Properties.Height="_height";
CClientLib.ServerClasses.Profile.Properties.Weight="_weight";CClientLib.ServerClasses.Profile.Properties.GirthNeck="_girthNeck";
CClientLib.ServerClasses.Profile.Properties.GirthChest="_girthChest";CClientLib.ServerClasses.Profile.Properties.GirthWaist="_girthWaist";
CClientLib.ServerClasses.Profile.Properties.GirthHips="_girthHips";CClientLib.ServerClasses.Profile.Properties.GirthLeftArm="_girthLeftArm";
CClientLib.ServerClasses.Profile.Properties.GirthRightArm="_girthRightArm";CClientLib.ServerClasses.Profile.Properties.GirthLeftThigh="_girthLeftThigh";
CClientLib.ServerClasses.Profile.Properties.GirthRightThigh="_girthRightThigh";CClientLib.ServerClasses.Profile.Properties.GirthLeftCalf="_girthLeftCalf";
CClientLib.ServerClasses.Profile.Properties.GirthRightCalf="_girthRightCalf";CClientLib.ServerClasses.Profile.GetSafeWSObject=function(A){A=CClientLib.ServerClasses.Profile.parse(A);
return{_profileID:A.get_profileID(),_profileNotes:A.get_profileNotes(),_profileDate:(CClientLib.Type.Date.isDate(A.get_profileDate())?new Date(A.get_profileDate()):new Date("1/1/1900")),_unitsType:A.get_unitsType(),_height:A.get_height(),_weight:A.get_weight(),_girthNeck:A.get_girthNeck(),_girthChest:A.get_girthChest(),_girthWaist:A.get_girthWaist(),_girthHips:A.get_girthHips(),_girthLeftArm:A.get_girthLeftArm(),_girthRightArm:A.get_girthRightArm(),_girthLeftThigh:A.get_girthLeftThigh(),_girthRightThigh:A.get_girthRightThigh(),_girthLeftCalf:A.get_girthLeftCalf(),_girthRightCalf:A.get_girthRightCalf()};
};if(_$9!=undefined||_$9!=null){alert("Error: 13092 - variable already in use");}var _$9=CClientLib.ServerClasses.Profile._serverParse=function(A){if(A.length!=16){alert("Parameter mismatch count: 2012. Expected 16 but only recieved "+A.length+" in CClientLib.ServerClasses.Profile");
}var B=new CClientLib.ServerClasses.Profile();B.set_profileID(A[0]);B.set_profileNotes(A[1]);
B.set_profileDate(A[2]);B.set_unitsType(A[3]);B.set_height(A[4]);B.set_weight(A[5]);
B.set_girthNeck(A[6]);B.set_girthChest(A[7]);B.set_girthWaist(A[8]);B.set_girthHips(A[9]);
B.set_girthLeftArm(A[10]);B.set_girthRightArm(A[11]);B.set_girthLeftThigh(A[12]);
B.set_girthRightThigh(A[13]);B.set_girthLeftCalf(A[14]);B.set_girthRightCalf(A[15]);
return B;};CClientLib.ServerClasses.Profile.parse=function(A){return CClientLib.ServerClasses.Profile._parse(A);
};CClientLib.ServerClasses.ProfileCollection=function(A){this._aCollection=[];this.add_items(A);
this._____bIsOfGenericList=true;};CClientLib.ServerClasses.ProfileCollection.prototype.get_items=CClientLib.ServerClasses.ProfileCollection.prototype.get_profiles=function(){return this._aCollection;
};CClientLib.ServerClasses.ProfileCollection.prototype.get_item=CClientLib.ServerClasses.ProfileCollection.prototype.get_profile=function(A){return this._aCollection[A];
};CClientLib.ServerClasses.ProfileCollection.prototype.get_itemText=CClientLib.ServerClasses.ProfileCollection.prototype.get_profileText=function(A){return this.get_item(A)[this.get_collectionText()];
};CClientLib.ServerClasses.ProfileCollection.prototype.get_itemByValue=CClientLib.ServerClasses.ProfileCollection.prototype.get_profileByProfileID=function(D){try{for(var B=0;
B<this.item_count();B++){var C=this.get_item(B);if(C[this.get_collectionKey()]=="undefined"){alert("warning key value is undefined: "+this.get_collectionKey());
}else{if(D.toString()==C[this.get_collectionKey()].toString()){return C;}}}return null;
}catch(A){fn_Global_DebbugingAlertObject(C,"******Key value: "+D);}};CClientLib.ServerClasses.ProfileCollection.prototype.add_item=CClientLib.ServerClasses.ProfileCollection.prototype.add_profile=function(A){if(A[this.get_collectionKey()]=="undefined"||A[this.get_collectionText()]=="undefined"){alert("Error unable to add the item to the collection as it doesnt have both a key and text value");
fn_Global_DebbugingAlertObject(A,"Required Key: "+this.get_collectionKey()+" | Requied Text: "+this.get_collectionText());
}this._aCollection[this._aCollection.length]=A;};CClientLib.ServerClasses.ProfileCollection.prototype.remove_item=CClientLib.ServerClasses.ProfileCollection.prototype.remove_profile=function(A){while(Array.contains(this._aCollection,A)){Array.remove(this._aCollection,A);
}};CClientLib.ServerClasses.ProfileCollection.prototype.item_count=CClientLib.ServerClasses.ProfileCollection.prototype.profile_count=function(){return this._aCollection.length;
};CClientLib.ServerClasses.ProfileCollection.prototype.add_items=CClientLib.ServerClasses.ProfileCollection.prototype.add_profiles=function(B){for(var A=0;
A<B.length;A++){this.add_item(B[A]);}};CClientLib.ServerClasses.ProfileCollection.prototype.get_collectionKey=function(){return"_profileID";
};CClientLib.ServerClasses.ProfileCollection.prototype.get_collectionText=function(){return"_profileNotes";
};CClientLib.ServerClasses.ProfileCollection.registerClass("CClientLib.ServerClasses.ProfileCollection");
CClientLib.ServerClasses.ProfileCollection.parse=function(A){return CClientLib.ServerClasses.ProfileCollection._parse(A);
};CClientLib.ServerClasses.ExerciseAndMap=function(){this._keyID="";this._title="";
this._exercise=null;this._map=null;};CClientLib.ServerClasses.ExerciseAndMap.prototype.get_keyID=function(){return fn_Global_SafeString_String(this._keyID);
};CClientLib.ServerClasses.ExerciseAndMap.prototype.set_keyID=function(A){this._keyID=A;
};CClientLib.ServerClasses.ExerciseAndMap.prototype.get_title=function(){return fn_Global_SafeString_String(this._title);
};CClientLib.ServerClasses.ExerciseAndMap.prototype.set_title=function(A){this._title=A;
};CClientLib.ServerClasses.ExerciseAndMap.prototype.get_exercise=function(){return(this._exercise==null?null:CClientLib.ServerClasses.Exercise.parse(this._exercise));
};CClientLib.ServerClasses.ExerciseAndMap.prototype.set_exercise=function(A){this._exercise=A;
};CClientLib.ServerClasses.ExerciseAndMap.prototype.get_map=function(){return(this._map==null?null:CClientLib.ServerClasses.Map.parse(this._map));
};CClientLib.ServerClasses.ExerciseAndMap.prototype.set_map=function(A){this._map=A;
};CClientLib.ServerClasses.ExerciseAndMap.registerClass("CClientLib.ServerClasses.ExerciseAndMap");
CClientLib.ServerClasses.ExerciseAndMap.Properties={};CClientLib.ServerClasses.ExerciseAndMap.Properties.KeyID="_keyID";
CClientLib.ServerClasses.ExerciseAndMap.Properties.Title="_title";CClientLib.ServerClasses.ExerciseAndMap.Properties.Exercise="_exercise";
CClientLib.ServerClasses.ExerciseAndMap.Properties.Map="_map";CClientLib.ServerClasses.ExerciseAndMap.GetSafeWSObject=function(A){A=CClientLib.ServerClasses.ExerciseAndMap.parse(A);
return{_keyID:A.get_keyID(),_title:A.get_title(),_exercise:A.get_exercise(),_map:A.get_map()};
};if(_$10!=undefined||_$10!=null){alert("Error: 13092 - variable already in use");
}var _$10=CClientLib.ServerClasses.ExerciseAndMap._serverParse=function(A){if(A.length!=4){alert("Parameter mismatch count: 2012. Expected 4 but only recieved "+A.length+" in CClientLib.ServerClasses.ExerciseAndMap");
}var B=new CClientLib.ServerClasses.ExerciseAndMap();B.set_keyID(A[0]);B.set_title(A[1]);
B.set_exercise(A[2]);B.set_map(A[3]);return B;};CClientLib.ServerClasses.ExerciseAndMap.parse=function(A){return CClientLib.ServerClasses.ExerciseAndMap._parse(A);
};CClientLib.ServerClasses.ExerciseAndMapCollection=function(A){this._aCollection=[];
this.add_items(A);this._____bIsOfGenericList=true;};CClientLib.ServerClasses.ExerciseAndMapCollection.prototype.get_items=CClientLib.ServerClasses.ExerciseAndMapCollection.prototype.get_exerciseAndMaps=function(){return this._aCollection;
};CClientLib.ServerClasses.ExerciseAndMapCollection.prototype.get_item=CClientLib.ServerClasses.ExerciseAndMapCollection.prototype.get_exerciseAndMap=function(A){return this._aCollection[A];
};CClientLib.ServerClasses.ExerciseAndMapCollection.prototype.get_itemText=CClientLib.ServerClasses.ExerciseAndMapCollection.prototype.get_exerciseAndMapText=function(A){return this.get_item(A)[this.get_collectionText()];
};CClientLib.ServerClasses.ExerciseAndMapCollection.prototype.get_itemByValue=CClientLib.ServerClasses.ExerciseAndMapCollection.prototype.get_exerciseAndMapByKeyID=function(D){try{for(var B=0;
B<this.item_count();B++){var C=this.get_item(B);if(C[this.get_collectionKey()]=="undefined"){alert("warning key value is undefined: "+this.get_collectionKey());
}else{if(D.toString()==C[this.get_collectionKey()].toString()){return C;}}}return null;
}catch(A){fn_Global_DebbugingAlertObject(C,"******Key value: "+D);}};CClientLib.ServerClasses.ExerciseAndMapCollection.prototype.add_item=CClientLib.ServerClasses.ExerciseAndMapCollection.prototype.add_exerciseAndMap=function(A){if(A[this.get_collectionKey()]=="undefined"||A[this.get_collectionText()]=="undefined"){alert("Error unable to add the item to the collection as it doesnt have both a key and text value");
fn_Global_DebbugingAlertObject(A,"Required Key: "+this.get_collectionKey()+" | Requied Text: "+this.get_collectionText());
}this._aCollection[this._aCollection.length]=A;};CClientLib.ServerClasses.ExerciseAndMapCollection.prototype.remove_item=CClientLib.ServerClasses.ExerciseAndMapCollection.prototype.remove_exerciseAndMap=function(A){while(Array.contains(this._aCollection,A)){Array.remove(this._aCollection,A);
}};CClientLib.ServerClasses.ExerciseAndMapCollection.prototype.item_count=CClientLib.ServerClasses.ExerciseAndMapCollection.prototype.exerciseAndMap_count=function(){return this._aCollection.length;
};CClientLib.ServerClasses.ExerciseAndMapCollection.prototype.add_items=CClientLib.ServerClasses.ExerciseAndMapCollection.prototype.add_exerciseAndMaps=function(B){for(var A=0;
A<B.length;A++){this.add_item(B[A]);}};CClientLib.ServerClasses.ExerciseAndMapCollection.prototype.get_collectionKey=function(){return"_keyID";
};CClientLib.ServerClasses.ExerciseAndMapCollection.prototype.get_collectionText=function(){return"_title";
};CClientLib.ServerClasses.ExerciseAndMapCollection.registerClass("CClientLib.ServerClasses.ExerciseAndMapCollection");
CClientLib.ServerClasses.ExerciseAndMapCollection.parse=function(A){return CClientLib.ServerClasses.ExerciseAndMapCollection._parse(A);
};CClientLib.ServerClasses.ClientDynamicData=function(){this._currentUser=null;this._associatedUsers=new CClientLib.ServerClasses.UserCollection([]);
this._exercises=new CClientLib.ServerClasses.ExerciseCollection([]);this._maps=new CClientLib.ServerClasses.MapCollection([]);
this._exerciseAndMapAppociations=[];this._scheduledPrograms=new CClientLib.ServerClasses.ScheduledProgramCollection([]);
this._programs=new CClientLib.ServerClasses.ProgramCollection([]);};CClientLib.ServerClasses.ClientDynamicData.prototype.get_currentUser=function(){return(this._currentUser==null?null:CClientLib.ServerClasses.User.parse(this._currentUser));
};CClientLib.ServerClasses.ClientDynamicData.prototype.set_currentUser=function(A){this._currentUser=A;
};CClientLib.ServerClasses.ClientDynamicData.prototype.get_associatedUsers=function(){return(this._associatedUsers==null?null:CClientLib.ServerClasses.UserCollection.parse(this._associatedUsers));
};CClientLib.ServerClasses.ClientDynamicData.prototype.set_associatedUsers=function(A){this._associatedUsers=A;
};CClientLib.ServerClasses.ClientDynamicData.prototype.get_exercises=function(){return(this._exercises==null?null:CClientLib.ServerClasses.ExerciseCollection.parse(this._exercises));
};CClientLib.ServerClasses.ClientDynamicData.prototype.set_exercises=function(A){this._exercises=A;
};CClientLib.ServerClasses.ClientDynamicData.prototype.get_maps=function(){return(this._maps==null?null:CClientLib.ServerClasses.MapCollection.parse(this._maps));
};CClientLib.ServerClasses.ClientDynamicData.prototype.set_maps=function(A){this._maps=A;
};CClientLib.ServerClasses.ClientDynamicData.prototype.get_exerciseAndMapAppociations=function(){return fn_Global_SafeArray_Array(this._exerciseAndMapAppociations);
};CClientLib.ServerClasses.ClientDynamicData.prototype.set_exerciseAndMapAppociations=function(A){this._exerciseAndMapAppociations=A;
};CClientLib.ServerClasses.ClientDynamicData.prototype.get_scheduledPrograms=function(){return(this._scheduledPrograms==null?null:CClientLib.ServerClasses.ScheduledProgramCollection.parse(this._scheduledPrograms));
};CClientLib.ServerClasses.ClientDynamicData.prototype.set_scheduledPrograms=function(A){this._scheduledPrograms=A;
};CClientLib.ServerClasses.ClientDynamicData.prototype.get_programs=function(){return(this._programs==null?null:CClientLib.ServerClasses.ProgramCollection.parse(this._programs));
};CClientLib.ServerClasses.ClientDynamicData.prototype.set_programs=function(A){this._programs=A;
};CClientLib.ServerClasses.ClientDynamicData.registerClass("CClientLib.ServerClasses.ClientDynamicData");
CClientLib.ServerClasses.ClientDynamicData.Properties={};CClientLib.ServerClasses.ClientDynamicData.Properties.CurrentUser="_currentUser";
CClientLib.ServerClasses.ClientDynamicData.Properties.AssociatedUsers="_associatedUsers";
CClientLib.ServerClasses.ClientDynamicData.Properties.Exercises="_exercises";CClientLib.ServerClasses.ClientDynamicData.Properties.Maps="_maps";
CClientLib.ServerClasses.ClientDynamicData.Properties.ExerciseAndMapAppociations="_exerciseAndMapAppociations";
CClientLib.ServerClasses.ClientDynamicData.Properties.ScheduledPrograms="_scheduledPrograms";
CClientLib.ServerClasses.ClientDynamicData.Properties.Programs="_programs";CClientLib.ServerClasses.ClientDynamicData.GetSafeWSObject=function(A){A=CClientLib.ServerClasses.ClientDynamicData.parse(A);
return{_currentUser:A.get_currentUser(),_associatedUsers:A.get_associatedUsers(),_exercises:A.get_exercises(),_maps:A.get_maps(),_exerciseAndMapAppociations:A.get_exerciseAndMapAppociations(),_scheduledPrograms:A.get_scheduledPrograms(),_programs:A.get_programs()};
};if(_$11!=undefined||_$11!=null){alert("Error: 13092 - variable already in use");
}var _$11=CClientLib.ServerClasses.ClientDynamicData._serverParse=function(A){if(A.length!=7){alert("Parameter mismatch count: 2012. Expected 7 but only recieved "+A.length+" in CClientLib.ServerClasses.ClientDynamicData");
}var B=new CClientLib.ServerClasses.ClientDynamicData();B.set_currentUser(A[0]);B.set_associatedUsers(A[1]);
B.set_exercises(A[2]);B.set_maps(A[3]);B.set_exerciseAndMapAppociations(A[4]);B.set_scheduledPrograms(A[5]);
B.set_programs(A[6]);return B;};CClientLib.ServerClasses.ClientDynamicData.parse=function(A){return CClientLib.ServerClasses.ClientDynamicData._parse(A);
};CClientLib.ServerClasses.ExerciseAndMap.CreateExerciseAndMap=function(B,A){B=CClientLib.ServerClasses.Exercise.parse(B);
var C=new CClientLib.ServerClasses.ExerciseAndMap();C.set_exercise(B);C.set_map(A);
if(C.get_map()!=null){C.set_keyID(C.get_exercise().get_exerciseID()+"_"+C.get_map().get_mapID());
C.set_title(C.get_exercise().get_title()+" ("+C.get_map().get_title()+")");}else{C.set_keyID(C.get_exercise().get_exerciseID());
C.set_title(C.get_exercise().get_title());C.set_map(null);}return C;};var WSExercise=function(){WSExercise.initializeBase(this);
this._timeout=0;this._userContext=null;this._succeeded=null;this._failed=null;};WSExercise.prototype={_get_path:function(){var A=this.get_path();
if(A){return A;}else{return WSExercise._staticInstance.get_path();}},WSCreateOrUpdateExercise:function(B,A,D,E,C){return this._invoke(this._get_path(),"WSCreateOrUpdateExercise",false,{exercise:B,listMapIDs:A},D,E,C);
},WSGetExerciseList:function(B,C,A){return this._invoke(this._get_path(),"WSGetExerciseList",false,{},B,C,A);
}};WSExercise.registerClass("WSExercise",Sys.Net.WebServiceProxy);WSExercise._staticInstance=new WSExercise();
WSExercise.set_path=function(A){WSExercise._staticInstance.set_path(A);};WSExercise.get_path=function(){return WSExercise._staticInstance.get_path();
};WSExercise.set_timeout=function(A){WSExercise._staticInstance.set_timeout(A);};
WSExercise.get_timeout=function(){return WSExercise._staticInstance.get_timeout();
};WSExercise.set_defaultUserContext=function(A){WSExercise._staticInstance.set_defaultUserContext(A);
};WSExercise.get_defaultUserContext=function(){return WSExercise._staticInstance.get_defaultUserContext();
};WSExercise.set_defaultSucceededCallback=function(A){WSExercise._staticInstance.set_defaultSucceededCallback(A);
};WSExercise.get_defaultSucceededCallback=function(){return WSExercise._staticInstance.get_defaultSucceededCallback();
};WSExercise.set_defaultFailedCallback=function(A){WSExercise._staticInstance.set_defaultFailedCallback(A);
};WSExercise.get_defaultFailedCallback=function(){return WSExercise._staticInstance.get_defaultFailedCallback();
};WSExercise.set_path("/WebServices/WSExercise.asmx");WSExercise.WSCreateOrUpdateExercise=function(B,A,E,D,C){WSExercise._staticInstance.WSCreateOrUpdateExercise(B,A,E,D,C);
};WSExercise.WSGetExerciseList=function(C,B,A){WSExercise._staticInstance.WSGetExerciseList(C,B,A);
};var gtc=Sys.Net.WebServiceProxy._generateTypedConstructor;Type.registerNamespace("CClientLib.ServerClasses");
if(typeof(CClientLib.ServerClasses.Exercise)==="undefined"){CClientLib.ServerClasses.Exercise=gtc("CClientLib.ServerClasses.Exercise");
CClientLib.ServerClasses.Exercise.registerClass("CClientLib.ServerClasses.Exercise");
}if(typeof(ClientWrapper)==="undefined"){var ClientWrapper=gtc("ClientWrapper");ClientWrapper.registerClass("ClientWrapper");
}var WSMaps=function(){WSMaps.initializeBase(this);this._timeout=0;this._userContext=null;
this._succeeded=null;this._failed=null;};WSMaps.prototype={_get_path:function(){var A=this.get_path();
if(A){return A;}else{return WSMaps._staticInstance.get_path();}},WSCreateOrUpdateMap:function(E,A,C,D,F,B){return this._invoke(this._get_path(),"WSCreateOrUpdateMap",false,{map:E,bAddMapToMapList:A,bOverwriteExistingMap:C},D,F,B);
},WSGetMap:function(C,B,D,A){return this._invoke(this._get_path(),"WSGetMap",false,{strMapID:C},B,D,A);
},WSGetMapList:function(B,C,A){return this._invoke(this._get_path(),"WSGetMapList",false,{},B,C,A);
}};WSMaps.registerClass("WSMaps",Sys.Net.WebServiceProxy);WSMaps._staticInstance=new WSMaps();
WSMaps.set_path=function(A){WSMaps._staticInstance.set_path(A);};WSMaps.get_path=function(){return WSMaps._staticInstance.get_path();
};WSMaps.set_timeout=function(A){WSMaps._staticInstance.set_timeout(A);};WSMaps.get_timeout=function(){return WSMaps._staticInstance.get_timeout();
};WSMaps.set_defaultUserContext=function(A){WSMaps._staticInstance.set_defaultUserContext(A);
};WSMaps.get_defaultUserContext=function(){return WSMaps._staticInstance.get_defaultUserContext();
};WSMaps.set_defaultSucceededCallback=function(A){WSMaps._staticInstance.set_defaultSucceededCallback(A);
};WSMaps.get_defaultSucceededCallback=function(){return WSMaps._staticInstance.get_defaultSucceededCallback();
};WSMaps.set_defaultFailedCallback=function(A){WSMaps._staticInstance.set_defaultFailedCallback(A);
};WSMaps.get_defaultFailedCallback=function(){return WSMaps._staticInstance.get_defaultFailedCallback();
};WSMaps.set_path("/WebServices/WSMaps.asmx");WSMaps.WSCreateOrUpdateMap=function(F,A,D,C,E,B){WSMaps._staticInstance.WSCreateOrUpdateMap(F,A,D,C,E,B);
};WSMaps.WSGetMap=function(D,A,C,B){WSMaps._staticInstance.WSGetMap(D,A,C,B);};WSMaps.WSGetMapList=function(C,B,A){WSMaps._staticInstance.WSGetMapList(C,B,A);
};var gtc=Sys.Net.WebServiceProxy._generateTypedConstructor;Type.registerNamespace("CClientLib.ServerClasses");
if(typeof(CClientLib.ServerClasses.Map)==="undefined"){CClientLib.ServerClasses.Map=gtc("CClientLib.ServerClasses.Map");
CClientLib.ServerClasses.Map.registerClass("CClientLib.ServerClasses.Map");}if(typeof(ClientWrapper)==="undefined"){var ClientWrapper=gtc("ClientWrapper");
ClientWrapper.registerClass("ClientWrapper");}var WSProfile=function(){WSProfile.initializeBase(this);
this._timeout=0;this._userContext=null;this._succeeded=null;this._failed=null;};WSProfile.prototype={_get_path:function(){var A=this.get_path();
if(A){return A;}else{return WSProfile._staticInstance.get_path();}},WSGetProfileList:function(B,C,A){return this._invoke(this._get_path(),"WSGetProfileList",false,{},B,C,A);
},WSInsertOrEdit:function(B,C,D,A){return this._invoke(this._get_path(),"WSInsertOrEdit",false,{profile:B},C,D,A);
}};WSProfile.registerClass("WSProfile",Sys.Net.WebServiceProxy);WSProfile._staticInstance=new WSProfile();
WSProfile.set_path=function(A){WSProfile._staticInstance.set_path(A);};WSProfile.get_path=function(){return WSProfile._staticInstance.get_path();
};WSProfile.set_timeout=function(A){WSProfile._staticInstance.set_timeout(A);};WSProfile.get_timeout=function(){return WSProfile._staticInstance.get_timeout();
};WSProfile.set_defaultUserContext=function(A){WSProfile._staticInstance.set_defaultUserContext(A);
};WSProfile.get_defaultUserContext=function(){return WSProfile._staticInstance.get_defaultUserContext();
};WSProfile.set_defaultSucceededCallback=function(A){WSProfile._staticInstance.set_defaultSucceededCallback(A);
};WSProfile.get_defaultSucceededCallback=function(){return WSProfile._staticInstance.get_defaultSucceededCallback();
};WSProfile.set_defaultFailedCallback=function(A){WSProfile._staticInstance.set_defaultFailedCallback(A);
};WSProfile.get_defaultFailedCallback=function(){return WSProfile._staticInstance.get_defaultFailedCallback();
};WSProfile.set_path("/WebServices/WSProfile.asmx");WSProfile.WSGetProfileList=function(C,B,A){WSProfile._staticInstance.WSGetProfileList(C,B,A);
};WSProfile.WSInsertOrEdit=function(B,D,C,A){WSProfile._staticInstance.WSInsertOrEdit(B,D,C,A);
};var gtc=Sys.Net.WebServiceProxy._generateTypedConstructor;if(typeof(ClientWrapper)==="undefined"){var ClientWrapper=gtc("ClientWrapper");
ClientWrapper.registerClass("ClientWrapper");}Type.registerNamespace("CClientLib.ServerClasses");
if(typeof(CClientLib.ServerClasses.Profile)==="undefined"){CClientLib.ServerClasses.Profile=gtc("CClientLib.ServerClasses.Profile");
CClientLib.ServerClasses.Profile.registerClass("CClientLib.ServerClasses.Profile");
}var WSProgram=function(){WSProgram.initializeBase(this);this._timeout=0;this._userContext=null;
this._succeeded=null;this._failed=null;};WSProgram.prototype={_get_path:function(){var A=this.get_path();
if(A){return A;}else{return WSProgram._staticInstance.get_path();}},WSGetProgramList:function(B,C,A){return this._invoke(this._get_path(),"WSGetProgramList",false,{},B,C,A);
},WSSaveProgram:function(A,B,C,F,E,G,D){return this._invoke(this._get_path(),"WSSaveProgram",false,{nProgramID:A,strProgramTitle:B,nDays:C,strProgramNotes:F},E,G,D);
},WSGetProgramDetails:function(A,C,D,B){return this._invoke(this._get_path(),"WSGetProgramDetails",false,{nProgramID:A},C,D,B);
},WSEditProgramWorkout:function(F,A,G,C,E,H,D,B){return this._invoke(this._get_path(),"WSEditProgramWorkout",false,{nProgramID:F,strProgramTitle:A,strProgramNotes:G,nEditingProgramWorkoutID:C,strNewWorkoutXMLData:E},H,D,B);
},WSRemoveWorkoutFromProgram:function(A,C,D,E,B){return this._invoke(this._get_path(),"WSRemoveWorkoutFromProgram",false,{nProgramID:A,nProgramWorkoutID:C},D,E,B);
},WSAddWorkoutToProgram:function(A,C,F,B,E,G,D){return this._invoke(this._get_path(),"WSAddWorkoutToProgram",false,{nProgramID:A,strProgramTitle:C,strProgramNotes:F,strWorkoutXMLData:B},E,G,D);
},WSGetProgramWorkout:function(B,C,D,A){return this._invoke(this._get_path(),"WSGetProgramWorkout",false,{nProgramWorkoutID:B},C,D,A);
},WSProgramArchive:function(A,C,D,B){return this._invoke(this._get_path(),"WSProgramArchive",false,{nProgramID:A},C,D,B);
},WSProgramActivate:function(A,C,D,B){return this._invoke(this._get_path(),"WSProgramActivate",false,{nProgramID:A},C,D,B);
}};WSProgram.registerClass("WSProgram",Sys.Net.WebServiceProxy);WSProgram._staticInstance=new WSProgram();
WSProgram.set_path=function(A){WSProgram._staticInstance.set_path(A);};WSProgram.get_path=function(){return WSProgram._staticInstance.get_path();
};WSProgram.set_timeout=function(A){WSProgram._staticInstance.set_timeout(A);};WSProgram.get_timeout=function(){return WSProgram._staticInstance.get_timeout();
};WSProgram.set_defaultUserContext=function(A){WSProgram._staticInstance.set_defaultUserContext(A);
};WSProgram.get_defaultUserContext=function(){return WSProgram._staticInstance.get_defaultUserContext();
};WSProgram.set_defaultSucceededCallback=function(A){WSProgram._staticInstance.set_defaultSucceededCallback(A);
};WSProgram.get_defaultSucceededCallback=function(){return WSProgram._staticInstance.get_defaultSucceededCallback();
};WSProgram.set_defaultFailedCallback=function(A){WSProgram._staticInstance.set_defaultFailedCallback(A);
};WSProgram.get_defaultFailedCallback=function(){return WSProgram._staticInstance.get_defaultFailedCallback();
};WSProgram.set_path("/WebServices/WSProgram.asmx");WSProgram.WSGetProgramList=function(C,B,A){WSProgram._staticInstance.WSGetProgramList(C,B,A);
};WSProgram.WSSaveProgram=function(A,C,D,G,B,F,E){WSProgram._staticInstance.WSSaveProgram(A,C,D,G,B,F,E);
};WSProgram.WSGetProgramDetails=function(A,D,C,B){WSProgram._staticInstance.WSGetProgramDetails(A,D,C,B);
};WSProgram.WSEditProgramWorkout=function(G,B,H,D,E,A,F,C){WSProgram._staticInstance.WSEditProgramWorkout(G,B,H,D,E,A,F,C);
};WSProgram.WSRemoveWorkoutFromProgram=function(A,C,E,D,B){WSProgram._staticInstance.WSRemoveWorkoutFromProgram(A,C,E,D,B);
};WSProgram.WSAddWorkoutToProgram=function(A,C,G,B,E,F,D){WSProgram._staticInstance.WSAddWorkoutToProgram(A,C,G,B,E,F,D);
};WSProgram.WSGetProgramWorkout=function(B,D,C,A){WSProgram._staticInstance.WSGetProgramWorkout(B,D,C,A);
};WSProgram.WSProgramArchive=function(A,D,C,B){WSProgram._staticInstance.WSProgramArchive(A,D,C,B);
};WSProgram.WSProgramActivate=function(A,D,C,B){WSProgram._staticInstance.WSProgramActivate(A,D,C,B);
};var gtc=Sys.Net.WebServiceProxy._generateTypedConstructor;if(typeof(ClientWrapper)==="undefined"){var ClientWrapper=gtc("ClientWrapper");
ClientWrapper.registerClass("ClientWrapper");}var WSScheduleCalendar=function(){WSScheduleCalendar.initializeBase(this);
this._timeout=0;this._userContext=null;this._succeeded=null;this._failed=null;};WSScheduleCalendar.prototype={_get_path:function(){var A=this.get_path();
if(A){return A;}else{return WSScheduleCalendar._staticInstance.get_path();}},WSGetScheduleData:function(A,C,E,D,F,B){return this._invoke(this._get_path(),"WSGetScheduleData",false,{strUserID:A,strStartDate:C,strEndDate:E},D,F,B);
},WSUnscheduleProgram:function(A,B,C,D,F,G,E){return this._invoke(this._get_path(),"WSUnscheduleProgram",false,{strUserID:A,nScheduleProgramID:B,strResponseDataStartDate:C,strResponseDataEndDate:D},F,G,E);
},WSScheduleProgram:function(G,F,E,C,H,A,I,D,B){return this._invoke(this._get_path(),"WSScheduleProgram",false,{strUserID:G,nProgramID:F,strProgramStartDate:E,nCycles:C,strResponseDataStartDate:H,strResponseDataEndDate:A},I,D,B);
},WSPerformWorkoutSession:function(L,K,I,N,C,M,J,E,F,D,B,G,A,H){return this._invoke(this._get_path(),"WSPerformWorkoutSession",false,{strUserID:L,strXMLWorkoutSession:K,nWorkoutSessionID:I,nScheduleProgramID:N,nProgramWorkoutID:C,nCycleNumber:M,strWorkoutSessionDate:J,nStartTimeIndex:E,nEndTimeIndex:F,strResponseStartDate:D,strResponseEndDate:B},G,A,H);
},WSUnscheduleWorkoutSession:function(G,J,B,I,H,C,A,E,D,F){return this._invoke(this._get_path(),"WSUnscheduleWorkoutSession",false,{strUserID:G,nScheduleProgramID:J,nProgramWorkoutID:B,nCycleNumber:I,strUnscheduleReason:H,strResponseStartDate:C,strResponseEndDate:A},E,D,F);
},WSGetWorkoutSessionDetails:function(F,D,A,B,G,H,E,C){return this._invoke(this._get_path(),"WSGetWorkoutSessionDetails",false,{strUserID:F,nSessionWorkoutID:D,nScheduleProgramID:A,nProgramWorkoutID:B,nCycleNumber:G},H,E,C);
}};WSScheduleCalendar.registerClass("WSScheduleCalendar",Sys.Net.WebServiceProxy);
WSScheduleCalendar._staticInstance=new WSScheduleCalendar();WSScheduleCalendar.set_path=function(A){WSScheduleCalendar._staticInstance.set_path(A);
};WSScheduleCalendar.get_path=function(){return WSScheduleCalendar._staticInstance.get_path();
};WSScheduleCalendar.set_timeout=function(A){WSScheduleCalendar._staticInstance.set_timeout(A);
};WSScheduleCalendar.get_timeout=function(){return WSScheduleCalendar._staticInstance.get_timeout();
};WSScheduleCalendar.set_defaultUserContext=function(A){WSScheduleCalendar._staticInstance.set_defaultUserContext(A);
};WSScheduleCalendar.get_defaultUserContext=function(){return WSScheduleCalendar._staticInstance.get_defaultUserContext();
};WSScheduleCalendar.set_defaultSucceededCallback=function(A){WSScheduleCalendar._staticInstance.set_defaultSucceededCallback(A);
};WSScheduleCalendar.get_defaultSucceededCallback=function(){return WSScheduleCalendar._staticInstance.get_defaultSucceededCallback();
};WSScheduleCalendar.set_defaultFailedCallback=function(A){WSScheduleCalendar._staticInstance.set_defaultFailedCallback(A);
};WSScheduleCalendar.get_defaultFailedCallback=function(){return WSScheduleCalendar._staticInstance.get_defaultFailedCallback();
};WSScheduleCalendar.set_path("/WebServices/WSScheduleCalendar.asmx");WSScheduleCalendar.WSGetScheduleData=function(A,C,F,E,D,B){WSScheduleCalendar._staticInstance.WSGetScheduleData(A,C,F,E,D,B);
};WSScheduleCalendar.WSUnscheduleProgram=function(A,B,C,D,G,F,E){WSScheduleCalendar._staticInstance.WSUnscheduleProgram(A,B,C,D,G,F,E);
};WSScheduleCalendar.WSScheduleProgram=function(H,G,F,D,I,B,A,E,C){WSScheduleCalendar._staticInstance.WSScheduleProgram(H,G,F,D,I,B,A,E,C);
};WSScheduleCalendar.WSPerformWorkoutSession=function(L,K,H,N,C,M,J,E,F,D,B,I,A,G){WSScheduleCalendar._staticInstance.WSPerformWorkoutSession(L,K,H,N,C,M,J,E,F,D,B,I,A,G);
};WSScheduleCalendar.WSUnscheduleWorkoutSession=function(G,J,C,I,H,D,B,A,E,F){WSScheduleCalendar._staticInstance.WSUnscheduleWorkoutSession(G,J,C,I,H,D,B,A,E,F);
};WSScheduleCalendar.WSGetWorkoutSessionDetails=function(F,C,H,A,G,E,D,B){WSScheduleCalendar._staticInstance.WSGetWorkoutSessionDetails(F,C,H,A,G,E,D,B);
};var gtc=Sys.Net.WebServiceProxy._generateTypedConstructor;if(typeof(ClientWrapper)==="undefined"){var ClientWrapper=gtc("ClientWrapper");
ClientWrapper.registerClass("ClientWrapper");}var WSStats=function(){WSStats.initializeBase(this);
this._timeout=0;this._userContext=null;this._succeeded=null;this._failed=null;};WSStats.prototype={_get_path:function(){var A=this.get_path();
if(A){return A;}else{return WSStats._staticInstance.get_path();}},WSGetStats:function(B,C,F,A,E,G,D){return this._invoke(this._get_path(),"WSGetStats",false,{strStatsName:B,strStartDateTime:C,strEndDateTime:F,dictReportFilters:A},E,G,D);
}};WSStats.registerClass("WSStats",Sys.Net.WebServiceProxy);WSStats._staticInstance=new WSStats();
WSStats.set_path=function(A){WSStats._staticInstance.set_path(A);};WSStats.get_path=function(){return WSStats._staticInstance.get_path();
};WSStats.set_timeout=function(A){WSStats._staticInstance.set_timeout(A);};WSStats.get_timeout=function(){return WSStats._staticInstance.get_timeout();
};WSStats.set_defaultUserContext=function(A){WSStats._staticInstance.set_defaultUserContext(A);
};WSStats.get_defaultUserContext=function(){return WSStats._staticInstance.get_defaultUserContext();
};WSStats.set_defaultSucceededCallback=function(A){WSStats._staticInstance.set_defaultSucceededCallback(A);
};WSStats.get_defaultSucceededCallback=function(){return WSStats._staticInstance.get_defaultSucceededCallback();
};WSStats.set_defaultFailedCallback=function(A){WSStats._staticInstance.set_defaultFailedCallback(A);
};WSStats.get_defaultFailedCallback=function(){return WSStats._staticInstance.get_defaultFailedCallback();
};WSStats.set_path("/WebServices/WSStats.asmx");WSStats.WSGetStats=function(B,C,G,A,E,F,D){WSStats._staticInstance.WSGetStats(B,C,G,A,E,F,D);
};var gtc=Sys.Net.WebServiceProxy._generateTypedConstructor;if(typeof(ClientWrapper)==="undefined"){var ClientWrapper=gtc("ClientWrapper");
ClientWrapper.registerClass("ClientWrapper");}var WSUser=function(){WSUser.initializeBase(this);
this._timeout=0;this._userContext=null;this._succeeded=null;this._failed=null;};WSUser.prototype={_get_path:function(){var A=this.get_path();
if(A){return A;}else{return WSUser._staticInstance.get_path();}},WSUser_InsertOrEditUser:function(A,G,B,F,C,H,I,E,D){return this._invoke(this._get_path(),"WSUser_InsertOrEditUser",false,{user:A,bEditSecurityData:G,strPreviousPassword:B,strNewPassword:F,strSecurityAnswer:C,strClientDateTime:H},I,E,D);
},WSUser_Login:function(C,E,B,A,F,G,D){return this._invoke(this._get_path(),"WSUser_Login",false,{strUserName:C,strPassword:E,bRememberMe:B,strClientDateTime:A},F,G,D);
}};WSUser.registerClass("WSUser",Sys.Net.WebServiceProxy);WSUser._staticInstance=new WSUser();
WSUser.set_path=function(A){WSUser._staticInstance.set_path(A);};WSUser.get_path=function(){return WSUser._staticInstance.get_path();
};WSUser.set_timeout=function(A){WSUser._staticInstance.set_timeout(A);};WSUser.get_timeout=function(){return WSUser._staticInstance.get_timeout();
};WSUser.set_defaultUserContext=function(A){WSUser._staticInstance.set_defaultUserContext(A);
};WSUser.get_defaultUserContext=function(){return WSUser._staticInstance.get_defaultUserContext();
};WSUser.set_defaultSucceededCallback=function(A){WSUser._staticInstance.set_defaultSucceededCallback(A);
};WSUser.get_defaultSucceededCallback=function(){return WSUser._staticInstance.get_defaultSucceededCallback();
};WSUser.set_defaultFailedCallback=function(A){WSUser._staticInstance.set_defaultFailedCallback(A);
};WSUser.get_defaultFailedCallback=function(){return WSUser._staticInstance.get_defaultFailedCallback();
};WSUser.set_path("/WebServices/WSUser.asmx");WSUser.WSUser_InsertOrEditUser=function(A,G,B,F,C,I,H,E,D){WSUser._staticInstance.WSUser_InsertOrEditUser(A,G,B,F,C,I,H,E,D);
};WSUser.WSUser_Login=function(C,E,B,A,G,F,D){WSUser._staticInstance.WSUser_Login(C,E,B,A,G,F,D);
};var gtc=Sys.Net.WebServiceProxy._generateTypedConstructor;Type.registerNamespace("CClientLib.ServerClasses");
if(typeof(CClientLib.ServerClasses.User)==="undefined"){CClientLib.ServerClasses.User=gtc("CClientLib.ServerClasses.User");
CClientLib.ServerClasses.User.registerClass("CClientLib.ServerClasses.User");}if(typeof(ClientWrapper)==="undefined"){var ClientWrapper=gtc("ClientWrapper");
ClientWrapper.registerClass("ClientWrapper");}if(typeof(Sys)!="undefined"){Sys.Application.notifyScriptLoaded();
}