﻿this.HttpClient=function(b){var c=this;this.errorHandler=this.completed=null;this.errorMessage="";this.async=true;this.isMsAjaxJson=this.evalResult=false;this.contentType="application/x-www-form-urlencoded";this.method="GET";this.timeout=2E4;this.headers={};$.extend(c,b);this.appendHeader=function(a,d){c.headers[a]=d};this.send=function(a,d,e,f){e=e||c.completed;f=f||c.errorHandler;$.ajax({url:a,data:d,type:d?"POST":c.method,processData:false,contentType:c.contentType,timeout:c.timeout,dataType:"text",
global:false,async:c.async,beforeSend:function(g){for(var h in c.headers)g.setRequestHeader(h,c.headers[h])},success:function(g){var h=null;if(c.evalResult)try{g=JSON.parse(g);if(g!=null)if(g.d&&g.d.__type)g=g.d;else if(c.isMsAjaxJson)for(var i in g){g=g[i];break}}catch(j){h=new CallbackException(j)}if(h)f&&f(h,c);else{if(g&&(g.isCallbackError||g.iscallbackerror))f&&f(g,c);e&&e(g,c)}},error:function(g){var h=g.responseText,i=null;if(h&&h.charAt(0)=="{")i=JSON.parse(h);if(i)i=new CallbackException(i);
else{i=g.status!=200?new CallbackException(g.status+" "+g.statusText):new CallbackException("Unknown Error Response");i.detail=h}f&&f(i,c,g)}})};this.returnError=function(a){a=new CallbackException(a);c.errorHandler&&c.errorHandler(a,c)}};this.ServiceProxy=function(b){var c=this;this.serviceUrl=b;this.invoke=function(a,d,e,f,g){d=JSON.serialize(d);a=c.serviceUrl+a;(new HttpClient({contentType:"application/json",evalResult:true,isMsAjaxJson:!g})).send(a,d,e,f)}};
this.AjaxMethodCallback=function(b,c,a){var d=this;this.controlId=b;this.postbackMode="PostMethodParametersOnly";this.serverUrl=c;this.formName=null;this.resultMode="json";this.errorHandler=this.completed=null;$.extend(this,a);this.Http=null;this.callMethod=function(e,f,g,h){d.completed=g;d.errorHandler=h;http=new HttpClient;d.Http=http;http.evalResult=true;g={};if(d.resultMode=="msajax"){http.isMsAjax=true;g=JSON.serialize(f)}else{h=0;if(f.length){h=f.length;for(var i=0;i<h;i++)g["Parm"+(i+1).toString()]=
JSON.serialize(f[i])}$.extend(g,{CallbackMethod:e,CallbackParmCount:h,__WWEVENTCALLBACK:d.controlId});g=$.param(g)+"&"}e=d.formName||document.forms[0];if(d.postbackMode=="Post")g+=$("#"+e).serialize();else if(d.postbackMode=="PostNoViewstate")g+=$().serializeNoViewState();else if(this.postbackMode=="Get"){Url=this.serverUrl;Url+=Url.indexOf("?")>-1?g:"?"+g;return http.send(Url,null,d.onHttpCallback,d.onHttpCallback)}return http.send(this.serverUrl,g,d.onHttpCallback,d.onHttpCallback)};this.onHttpCallback=
function(e){if(e&&e.isCallbackError||e.iscallbackerror)d.errorHandler&&d.errorHandler(e,d);else d.completed!=null&&d.completed(e,d)}};ajaxJson=function(b,c,a,d,e){var f=c,g={method:"POST",contentType:"application/json",noPostEncoding:false};$.extend(g,e);e=new HttpClient(g);e.evalResult=true;if(!g.noPostEncoding&&g.method=="POST")f=JSON.serialize(c);e.send(b,f,a,d)};ajaxCallMethod=function(b,c,a,d,e,f){(new AjaxMethodCallback(null,b,f)).callMethod(c,a,d,e)};
this.CallbackException=function(b,c){this.isCallbackError=true;if(typeof b=="object")if(b.message)this.message=b.message;else{if(b.Message)this.message=b.Message}else this.message=b;this.detail=c?c:null};
this.JSON={copyright:"(c)2005 JSON.org",license:"http://www.crockford.com/JSON/license.html",serialize:function(b){function c(e){d[d.length]=e}function a(e){var f,g,h;switch(typeof e){case "string":c('"');if(/["\\\x00-\x1f\x7d\x5d]/.test(e)){h=e.length;for(g=0;g<h;g+=1){f=e.charAt(g);if(f>=" "&&f!="}"&&f!="]"){if(f=="\\"||f=='"')c("\\");c(f)}else switch(f){case "\u0008":c("\\b");break;case "\u000c":c("\\f");break;case "\n":c("\\n");break;case "\r":c("\\r");break;case "\t":c("\\t");break;case "}":c("\\u007D");
break;case "]":c("\\u005D");break;default:f=f.charCodeAt();c("\\u00"+Math.floor(f/16).toString(16)+(f%16).toString(16))}}}else c(e);c('"');return;case "number":c(isFinite(e)?e:"null");return;case "object":if(e){if(e.toUTCString)return c('"\\/Date('+e.getTime()+')\\/"');if(e instanceof Array){c("[");for(g=0;g<e.length;g+=1){h=e[g];if(typeof h!=_ud&&typeof h!="function"){f&&c(",");a(h);f=true}}c("]");return}else if(typeof e.valueOf=="function"){c("{");for(g in e){h=e[g];if(typeof h!=_ud&&typeof h!=
"function"&&(!h||typeof h!="object"||typeof h.valueOf=="function")){f&&c(",");a(g);c(":");a(h);f=true}}return c("}")}}c("null");return;case "boolean":c(e);return;default:c("null");return}}var d=[];a(b);return d.join("")},regExDate:function(b){var c=b=b.substring(1).replace('"',"");if(/\/Date(.*)\//.test(b)){b=b.match(/Date\((.*?)\)/)[1];c="new Date("+parseInt(b)+")"}else{b=b.split(/[-,:,T,Z]/);b[1]=(parseInt(b[1],0)-1).toString();c="new Date(Date.UTC("+b.join(",")+"))"}return c},parse:function(b,
c){if(!c&&/[^,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]/.test(b.replace(/"(\\.|[^"\\])*"/g,"")))throw new Error("Invalid characters in JSON parse string.");b=b.replace(/(\"\d{4}-\d{2}-\d{2}T\d{2}:\d{2}.*?\")|(\"\\*\/Date\(.*?\)\\*\/")/g,this.regExDate);return eval("("+b+")")},parseSafe:function(b){try{return this.parse(b)}catch(c){return null}}};
this.StatusBar=function(b,c){var a=this,d=null;this.elementId="_showstatus";this.prependMultiline=true;this.showCloseButton=false;this.afterTimeoutText=null;this.cssClass="statusbar";this.highlightClass="statusbarhighlight";this.closeButtonClass="statusbarclose";this.additive=false;$.extend(this,c);if(b)d=$(b);d||(d=$("<div id='_statusbar' class='"+a.cssClass+"'><div class='"+a.closeButtonClass+"'>"+(a.showCloseButton?" X </div></div>":"")).appendTo(document.body).show());a.showCloseButton&&$("."+
a.cssClass).click(function(){$(d).hide()});this.show=function(e,f,g){if(a.additive){e=$("<div style='margin-bottom: 2px;'>"+e+"</div>");a.prependMultiline?d.prepend(e):d.append(e)}else if(a.showCloseButton){var h=d.find("div.statusbarclose");d.text(e).prepend(h)}else d.text(e);d.show();if(f){g?d.addClass(a.errorClass):d.addClass(a.highlightClass);setTimeout(function(){d.removeClass(a.highlightClass);a.afterTimeoutText&&a.show(a.afterTimeoutText)},f)}};this.hide=function(){d.hide()};this.release=function(){_statusbar&&
$(_statusbar).remove()}};var __statusbar=null;this.showStatus=function(b,c,a,d){if(!__statusbar)if(typeof b=="object"){__statusbar=new StatusBar(null,b);return}else __statusbar=new StatusBar;__statusbar.show(b,c,a,d)};
$.fn.centerInClient=function(b){var c={forceAbsolute:false,container:window,completed:null};$.extend(c,b);return this.each(function(){var a=$(this),d=$(c.container),e=c.container==window;if(c.forceAbsolute)e?a.remove().appendTo("body"):a.remove().appendTo(d.get(0));a.css("position","absolute");var f=(e?d.width():d.outerWidth())/2-a.outerWidth()/2;e=(e?d.height():d.outerHeight())/2.2-a.outerHeight()/2;a.css({left:f+d.scrollLeft(),top:e+d.scrollTop()});d=a.css("zIndex");if(!d||d=="auto")a.css("zIndex",
1);c.completed&&c.completed(this)})};$.fn.moveToMousePosition=function(b,c){var a={left:0,top:0};$.extend(a,c);return this.each(function(){$(this).css({left:b.pageX+a.left,top:b.pageY+a.top,position:"absolute"})})};
$.fn.shadow=function(b,c){if(typeof b=="object")c=b;var a={offset:6,color:"black",opacity:0.25,callback:null,zIndex:100};$.extend(a,c);this.each(function(){var d=$(this),e=$("#"+d.get(0).id+"Shadow");if(typeof b=="string"){if(b=="hide"||b=="remove"){d.unwatch("_shadowMove");e.remove()}}else{var f=true;if(e.length<1){e=$("<div style='height: 1px; width: 1px;'></div>").attr("id",d.get(0).id+"Shadow").insertAfter(d);f=d.css("zIndex");if(!f||f=="auto"){d.css("zIndex",a.zIndex);e.css("zIndex",a.zIndex-
1)}f=e.get(0);if(typeof f.style.filter=="string"){f.style.filter="progid:DXImageTransform.Microsoft.Blur(makeShadow=1, shadowOpacity="+a.opacity.toString()+", pixelRadius=3)";a.offset-=4}f=false}d.css("position","absolute");var g=d.is(":visible");g||d.show();var h=d.position();e.show().css({position:"absolute",width:d.outerWidth(),height:d.outerHeight(),opacity:a.opacity,background:a.color,left:h.left+a.offset,top:h.top+a.offset}).css("-moz-border-radius","0px 1px 2px 1px").css("-webkit-border-radius",
"3px");if(!g){d.hide();e.hide()}if((zIndex=d.css("zIndex"))&&zIndex!="auto")e.css("zIndex",zIndex-1);else{d.css("zIndex",a.zIndex);e.css("zIndex",a.zIndex-1)}f||d.watch("left,top,width,height,display,opacity,zIndex",function(){if(d.is(":visible")){$(this).shadow(a);e.css("opacity",d.css("opacity")*a.opacity)}else e.hide()},100,"_shadowMove");a.callback&&a.callback(e)}});return this};
$.fn.tooltip=function(b,c,a){function d(f,g){var h=this,i=$(f);this.cssClass="";this.onRelease=null;$.extend(h,g);var j=i.get(0),k=$("#"+j.id+"_tt");this.show=function(l,m,n){k.length>0&&k.remove();k=$("<div></div>").attr("id",j.id+"_tt");$(document.body).append(k);k.css({position:"absolute",display:"none",zIndex:1E3});h.cssClass?k.addClass(h.cssClass):k.css({background:"cornsilk",border:"solid 1px gray",fontSize:"0.80em",padding:2});n?k.html(l):k.text(l);n=i.position();l=n.left+5;n=n.top+i.height()-
2;var o=k.width();if(o>400)o=400;k.css({left:l,top:n,width:o});k.show();k.shadow({offset:g.shadowOffset});m&&m>0&&setTimeout(function(){h.onRelease&&h.onRelease.call(j,h);h.hide()},m)};this.hide=function(){k.length>0&&k.fadeOut("slow",function(){k.shadow("hide")})}}var e={cssClass:"",isHtml:false,shadowOffset:2,onRelease:null};$.extend(e,a);return this.each(function(){var f=new d(this,e);b=="hide"?f.hide():f.show(b,c,e.isHtml)})};
$.fn.watch=function(b,c,a,d){function e(f){var g=$(this);f=g.data(f);for(var h=false,i=0;i<f.props.length;i++){var j=g.css(f.props[i]);if(f.vals[i]!=j){f.vals[i]=j;h=true;break}}h&&f.func&&f.func.call(this,f,i)}a||(a=200);d||(d="_watcher");return this.each(function(){var f=this,g=$(this),h=function(){e.call(f,d)},i=null;if(typeof this.onpropertychange=="object")g.bind("propertychange."+d,h);else if($.browser.mozilla)g.bind("DOMAttrModified."+d,h);else i=setInterval(h,a);var j={id:i,props:b.split(","),
func:c,vals:[b.split(",").length]};$.each(j.vals,function(k){j.vals[k]=g.css(j.props[k])});g.data(d,j)})};$.fn.unwatch=function(b){this.each(function(){var c=$(this).data(b),a=$(this);a.removeData();try{if(typeof this.onpropertychange=="object")a.unbind("propertychange."+b,fnc);else $.browser.mozilla?a.unbind("DOMAttrModified."+b,fnc):clearInterval(c.id)}catch(d){}});return this};
$.fn.listSetData=function(b,c){var a={noClear:false,dataValueField:null,dataTextField:null};$.extend(a,c);return this.each(function(){var d=$(this);if(b==null)d.children().remove();else{a.noClear||d.children().remove();if(b.Rows)b=b.Rows;var e=false;if(!a.dataTextField&&!a.dataValueField)e=true;for(x=0;x<b.length;x++){var f=b[x];e?d.listAddItem(f,f):d.listAddItem(f[a.dataTextField],f[a.dataValueField])}}})};
$.fn.listAddItem=function(b,c){return this.each(function(){$(this).append($("<option></option>").attr("value",c).text(b))})};$.fn.listSelectItem=function(b){if(this.options)for(var c=this.options.length-1;c>-1;c--)if(this.options[c].value==b){this.options[c].selected=true;return}};
this.HoverPanel=function(b,c){var a=this,d=$(b);b=d.get(0);this.serverUrl="";this.htmlTargetId=this.controlId=b.id;this.queryString="";this.eventHandlerMode="ShowHtmlAtMousePosition";this.postbackMode="Get";this.errorHandler=this.completed=null;this.hoverOffsetBottom=this.hoverOffsetRight=0;this.panelOpacity=1;this.shadowOffset=0;this.shadowOpacity=0.25;this.adjustWindowPosition=true;this.formName="";this.navigateDelay=0;this.http=null;$.extend(a,c);this.startCallback=function(e,f,g,h){try{var i=
(new Date).getTime();a.busy=i;var j=this.serverUrl;if(e){a.lastMouseTop=e.clientY;a.lastMouseLeft=e.clientX}else a.lastMouseTop=0;a.queryString=f==null?(f=""):f;if(h)a.errorHandler=h;if(f)f+="&";else f="";f+="__WWEVENTCALLBACK="+a.controlId;a.formName=a.formName||document.forms[0];a.http=new HttpClient;a.http.appendHeader("RequestKey",i);if(g)g+="&";else g="";if(a.postbackMode=="Post")g+=$(a.formName).serialize();else if(this.postbackMode=="PostNoViewstate")g+=$(a.formName).serializeNoViewState();
else if(this.postbackMode=="Get"&&g)f+=g;if(f!="")j=j.indexOf("?")>-1?j+"&"+f:j+"?"+f;a.eventHandlerMode=="ShowIFrameAtMousePosition"||a.eventHandlerMode=="ShowIFrameInPanel"?setTimeout(function(){a.busy&&a.showIFrame.call(a,j)},a.navigateDelay):setTimeout(function(){a.busy==i&&a.http.send.call(a,j,g,a.onHttpCallback,a.onHttpCallback)},a.navigateDelay)}catch(k){a.onHttpCallback(new CallbackException(k.message))}};this.onHttpCallback=function(e){a.busy=-1;if(a.http&&a.http.status&&a.http.status!=200)e=
new CallbackException(http.statusText);if(e==null)e=new CallbackException("No output was returned.");if(e.isCallbackError)a.errorHandler&&a.errorHandler(e);else a.displayResult(e)};this.displayResult=function(e){if(!(a.completed&&a.completed(Result,a)==false))if(a.eventHandlerMode=="ShowHtmlAtMousePosition"){a.assignContent(e);a.movePanelToPosition(a.lastMouseLeft+a.hoverOffsetRight,a.lastMouseTop+a.hoverOffsetBottom);a.show()}else if(a.eventHandlerMode=="ShowHtmlInPanel"){a.assignContent(e);a.show()}};
this.assignContent=function(e){$("#"+a.htmlTargetId).html(e)};this.movePanelToPosition=function(e,f){try{d.css("position","absolute");if(typeof e=="object"){a.lastMouseTop=e.clientY;a.lastMouseLeft=e.clientX}else if(typeof e=="number"){a.lastMouseTop=f;a.lastMouseLeft=e}e=a.lastMouseLeft+3;f=a.lastMouseTop+3;var g=$(window);d.css({left:e+g.scrollLeft(),top:f+g.scrollTop()});if(a.adjustWindowPosition&&document.body){var h=g.height(),i=d.outerHeight(),j=g.width(),k=d.outerWidth();if(h<i)f=0;else if(h<
a.lastMouseTop+i)f=h-i-10;if(j<k)e=0;else if(j<a.lastMouseLeft+k)e=j-k-25;d.css({left:e+g.scrollLeft(),top:f+g.scrollTop()})}}catch(l){window.status="Moving off window failed: "+l.message}};this.showIFrame=function(e){a.busy=false;e=e?e:a.serverUrl;$w(a.controlId+"_IFrame").src=e;if(a.eventHandlerMode=="ShowIFrameAtMousePosition"){a.show();a.movePanelToPosition(a.lastMouseLeft+a.hoverOffsetRight,a.lastMouseTop+a.hoverOffsetBottom)}else a.show()};this.hide=function(){this.abort();d.hide()};this.abort=
function(){a.busy=-1};this.show=function(){d.show().css("opacity",a.panelOpacity);a.shadowOffset&&d.shadow({offset:a.shadowOffset,opacity:a.shadowOpacity})}};
function _ModalDialog(b,c){var a=this,d=$(b);if(d.length<1)d=$("#"+b);if(!(d.length<1)){this.overlayId="_ModalOverlay";this.contentId=d.get(0).id;this.headerId="";this.backgroundOpacity=0.75;this.fadeInBackground=false;this.zIndex=1E4;this.jOverlay=null;this.keepCentered=true;this.dialogHandler=null;$.extend(a,c);var e=null;this.show=function(f,g,h){if(a.contentId&&typeof f=="string")!h?$("#"+a.contentId).text(f):$("#"+a.contentId).html(f);if(a.headerId&&typeof g=="string")!h?$("#"+a.headerId).text(g):
$("#"+a.headerId).html(g);d.css({zIndex:a.zIndex+2}).show().centerInClient();f=opaqueOverlay({zIndex:a.zIndex+1,sel:"#"+a.overlayId});a.zIndex++;a.fadeInBackground&&f.hide().fadeIn("slow");d.click(a.callback);a.keepCentered&&$(window).bind("resize.modal",function(){d.centerInClient()}).bind("scroll.modal",function(){d.centerInClient()});if($.browser.msie&&$.browser.version<"7")e=$("select:visible").not($(d).find("select")).hide()};this.hide=function(){d.hide();a.keepCentered&&$(window).unbind("resize.modal").unbind("scroll.modal");
opaqueOverlay("hide",{sel:"#"+a.overlayId});d.unbind("click");if(e){e.show();e=null}};this.genericDialog=function(f,g,h,i){var j=$("#_MBOX");if(j.length<1){j=$("<div></div>").addClass("blackBorder dragwindow").attr("id","_MBOX").css({width:400});var k=$("<div></div>").addClass("gridheader").attr("id","_MBOXHEADER"),l=$("<div></div>").addClass("containercontent").attr("id","_MBOXCONTENT");j.append(k).append(l).appendTo(document.body)}j.modalDialog({dialogHandler:i,headerId:"_MBOXHEADER",contentId:"_MBOXCONTENT"},
f,g,h).draggable().shadow().closable({closeHandler:i||function(){j.modalDialog("hide")}})};this.callback=function(f){if(a.dialogHandler){var g=f.target==$("#"+a.okButtonId).get(0)?1:0;a.dialogHandler.call(f.target,f,g)!=false&&setTimeout(function(){a.hide()},10)}else $(f.target).is(":button,a,img")&&setTimeout(function(){a.hide()},10)}}}
$.fn.modalDialog=function(b,c,a,d,e){if(this.length<1)return this;var f=this.get(0),g=$(f);f="modal"+f.id;var h=g.data(f);h||(h=new _ModalDialog(g,b));if(typeof b=="string"){if(b=="hide"||b=="close")h.hide();if(b=="instance"||b=="get")return h;b=="generic"&&h.genericDialog(c,a,d,e)}else{h.show(c,a,d);g.data(f,h);return this}};
this.opaqueOverlay=function(b,c){var a=this,d=$(window);this.sel="#_ShadowOverlay";this.opacity=0.75;this.zIndex=1E4;$.extend(this,c||b);c=$(sel);if(b=="hide"){if(!(c.length<1)){c.hide();c.get(0).opaqueOverlay=false;d.unbind("resize.opaque").unbind("scroll.opaque")}}else{if(c.length<1)c=$("<div></div>").attr("id",this.sel.substr(1)).css("background","black").appendTo(document.body);var e=c.get(0);c.show();e.opaqueOverlay||d.bind("resize.opaque",function(){opaqueOverlay(b)}).bind("scroll.opaque",function(){opaqueOverlay(b)});
e.opaqueOverlay=true;c.css({top:0+d.scrollTop(),left:0+d.scrollLeft(),position:"absolute",opacity:a.opacity,zIndex:a.zIndex}).width(d.width()).height(d.height());return c}};
if(!$.fn.draggable){$.fn.draggable=function(b){return this.each(function(){var c=$(this),a=c.data("draggable");if(typeof b=="string"){if(a&&b=="remove"){a.stopDragging();c.removeData("draggable")}}else if(!a){a=new DragBehavior(this,b);c.data("draggable",a)}})};var __dragIndex=1;function DragBehavior(b,c){var a=this,d=$(b);this.handle="";this.opacity=0.75;this.stop=this.start=null;this.dragDelay=100;this.forceAbsolute=false;$.extend(a,c);a.handle=a.handle?$(a.handle):d;if(a.handle.length<1)a.handle=
d;var e=false,f=false,g=0,h=0,i=1,j=0;this.mouseDown=function(l){var m=a.handle.get(0),n=false;$(l.target).parents().each(function(){if(this==m)n=true});if(!(e||l.target!=m&&!n||$(l.target).is(".closebox,input,textara,a"))){e=true;f=false;var o=a.handle.offset();g=l.pageX-o.left;h=l.pageY-o.top;setTimeout(function(){if(e){d.show().makeAbsolute(a.forceAbsolute);a.dragActivate(l)}},a.dragDelay)}};var k=function(l){l.stopPropagation()};this.dragActivate=function(l){if(e){f=true;a.moveToMouse(l);e=true;
j=d.css("zIndex");d.css("zIndex",15E4);i=d.css("opacity");d.css({opacity:a.opacity,cursor:"move"});$(document).bind("mousemove.dbh",a.mouseMove);$(document.body).bind("selectstart.dbh",k);$(document.body).bind("dragstart.dbh",k);$(document.body).bind("selectstart.dbh",k);a.handle.bind("selectstart.dbh",k);a.start&&a.start(l,a)}};this.dragDeactivate=function(l,m){if(e){e=false;if(f){f=false;m||a.moveToMouse(l);$(document).unbind("mousemove.dbh");$(document).unbind("selectstart.dbh");$(document.body).unbind("dragstart.dbh");
$(document.body).unbind("selectstart.dbh");a.handle.unbind("selectstart.dbh");if(!m){__dragIndex+=10;d.css({zIndex:1E4+__dragIndex,cursor:"auto"});d.css("opacity",i);a.stop&&a.stop(l,a)}}}};this.mouseUp=function(l){a.dragDeactivate(l)};this.mouseMove=function(l){e&&a.moveToMouse(l)};this.moveToMouse=function(l){d.css({left:l.pageX-g,top:l.pageY-h})};this.stopDragging=function(){if(f){a.dragDeactivate(null,true);$(document).unbind("mousedown",a.mouseDown)}};$(document).mousedown(a.mouseDown);$(document).mouseup(a.mouseUp)}
}$.fn.closable=function(b){var c={handle:null,closeHandler:null,cssClass:"closebox"};$.extend(c,b);return this.each(function(){var a=$(this),d=a.css("position");if(!d||d=="static")a.css("position","relative");d=c.handle?$(c.handle):a;var e=$("<div></div>").addClass(c.cssClass).click(function(){if(c.closeHandler)if(!c.closeHandler.call(this))return;$(a).hide()});d.append(e)})};var _tmplCache={};
this.parseTemplate=function(b,c){var a="";try{var d=_tmplCache[b];if(!d){var e="var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push('"+b.replace(/[\r\t\n]/g," ").replace(/'(?=[^#]*#>)/g,"\t").split("'").join("\\'").split("\t").join("'").replace(/<#=(.+?)#>/g,"',$1,'").split("<#").join("');").split("#>").join("p.push('")+"');}return p.join('');";d=new Function("obj",e);_tmplCache[b]=d}return d(c)}catch(f){a=f.message}return"< # ERROR: "+a.htmlEncode()+" # >"};
String.prototype.htmlEncode=function(){var b=document.createElement("div");if(typeof b.textContent=="string")b.textContent=this.toString();else b.innerText=this.toString();return b.innerHTML};String.prototype.trimEnd=function(){return this.replace(/\s+$/,"")};String.prototype.trimStart=function(){return this.replace(/^\s+/,"")};String.repeat=function(b,c){for(var a="",d=0;d<c;d++)a+=b;return a};
String.prototype.padL=function(b,c){if(!b||b<1)return this;c||(c=" ");var a=b-this.length;if(a<1)return this.substr(0,b);return(String.repeat(c,a)+this).substr(0,b)};String.prototype.padR=function(b,c){if(!b||b<1)return this;c||(c=" ");var a=b-this.length;a<1&&this.substr(0,b);return(this+String.repeat(c,a)).substr(0,b)};String.startsWith=function(b){if(!b)return false;return this.substr(0,b.length)==b};
String.format=function(b){for(var c=0;c<arguments.length;c++)b=b.replace("{"+c+"}",arguments[c+1]);return b};String.prototype.format=function(){var b=[this];$.merge(b,arguments);return String.format.apply(this,b)};String.prototype.isNumber=function(){if(this.length==0)return false;if("0123456789".indexOf(this.substr(0,1))>-1)return true;return false};var _monthNames=["January","February","March","April","May","June","July","August","September","October","November","December"];
Date.prototype.formatDate=function(b){var c=this;b||(b="MM/dd/yyyy");var a=c.getMonth(),d=c.getFullYear();if(b.indexOf("yyyy")>-1)b=b.replace("yyyy",d.toString());else if(b.indexOf("yy")>-1)b=b.replace("yy",d.toString().substr(2,2));b=b.replace("dd",c.getDate().toString().padL(2,"0"));d=c.getHours();if(b.indexOf("t")>-1)b=d>11?b.replace("t","pm"):b.replace("t","am");if(b.indexOf("HH")>-1)b=b.replace("HH",d.toString().padL(2,"0"));if(b.indexOf("hh")>-1){if(d>12)d-=12;if(d==0)d=12;b=b.replace("hh",
d.toString().padL(2,"0"))}if(b.indexOf("mm")>-1)b=b.replace("mm",c.getMinutes().toString().padL(2,"0"));if(b.indexOf("ss")>-1)b=b.replace("ss",c.getSeconds().toString().padL(2,"0"));return b=b.indexOf("MMMM")>-1?b.replace("MMMM",_monthNames[a]):b.indexOf("MMM")>-1?b.replace("MMM",_monthNames[a].substr(0,3)):b.replace("MM",(a+1).toString().padL(2,"0"))};
Number.prototype.formatNumber=function(b,c){var a=this,d=Number.getNumberFormat();if(b=="c"){a=Math.round(a*100)/100;c=c||"$";a=a.toLocaleString();a=a.split(".");return c+a[0]+d.d+(a.length>1?a[1]:"").padR(2,"0")}if(b.substr(0,1)=="n"){if(b.length==1)return a.toLocaleString();c=b.substr(1);c=parseInt(c);if(typeof c!="number")return a.toLocaleString();a=a.toFixed(c);a=a.split(d.d);c=a[0];a=a.length>1?d.d+a[1]:"";for(b=/(\d+)(\d{3})/;b.test(c);)c=c.replace(b,"$1"+d.c+"$2");return c+a}if(b.substr(0,
1)=="f"){if(b.length==1)return a.toString();c=b.substr(1);c=parseFloat(c);if(typeof c!="number")return a.toString();return a.toFixed(c)}return a.toString()};Number.getNumberFormat=function(b){var c=(1000.1).toLocaleString(),a={};a.d=c.substr(5,1);if(a.d.isNumber())a.d=c.substr(4,1);a.c=c.substr(1,1);if(a.c.isNumber())a.c=",";a.s=b||"$";return a};registerNamespace=function(b){b=b.split(".");for(var c=window,a=0;a<b.length;a++){var d=b[a];c=c[d]?c[d]:(c[d]={})}};$.fn.serializeNoViewState=function(){return this.find("input,textarea,select,hidden").not("#__VIEWSTATE,#__EVENTVALIDATION").serialize()};
$.fn.makeAbsolute=function(b){return this.each(function(){var c=$(this),a=c.position();c.css({position:"absolute",marginLeft:0,marginTop:0,top:a.top,left:a.left});b&&c.remove().appendTo("body")})};var _ud="undefined";
