
(function()
{var a=window.navigator.userAgent;WL.browser={ie:false,firefox:false,safari:false,opera:false,gecko:false,webkit:false,v:0};if(a.indexOf("MSIE")>=0)
{if(a.indexOf("Win64")==-1)
{WL.browser.v=parseInt(a.split("MSIE")[1]);if(WL.browser.v>=6)WL.browser.ie=true;}}
else if(a.indexOf("Firefox")>=0)
{var b=a.split("Firefox/")[1].split("."),c=parseInt(b[0]);if(c>=2)WL.browser.firefox=true;else
{var d=parseInt(b[1]);if(c==1&&d>=5)WL.browser.firefox=true;}}
else if(a.indexOf("Chrome")>=0)WL.browser.chrome=true;else if(a.indexOf("Safari")>=0)WL.browser.safari=true;else if(a.indexOf("Opera")>=0)WL.browser.opera=true;if(a.indexOf("AppleWebKit")>=0)WL.browser.webkit=true;else if(a.indexOf("Gecko")>=0)WL.browser.gecko=true;})();WL.browser.option={};WL.browser.option.rtlTableScrollOnRight=!WL.browser.safari;WL.browser.option.cssPositionFixed=!(WL.browser.ie&&(WL.browser.v<7||(document.compatMode&&document.compatMode=="BackCompat")));WL.browser.option.selectOpacityBag=WL.browser.ie&&WL.browser.v<7;Function.prototype.extend=function(i){return i.apply(this.prototype,Array.prototype.slice.call(arguments,1))}
Function.prototype.bind=function(o){var f=this;switch(arguments.length){case 0:return f;case 1:return function(){return f.apply(o,arguments);};default:var a=Array.prototype.slice.call(arguments,1);return function(){return f.apply(o,a.concat(Array.prototype.slice.call(arguments,0)));}}}
Function.prototype.raise=function(ctx,timeout){var f=this;var a=Array.prototype.slice.call(arguments,2);return function(){var b=a.concat(Array.prototype.slice.call(arguments,0));if(f.__raiseCookie)window.clearTimeout(f.__raiseCookie);f.__raiseCookie=window.setTimeout(function(){f.__raiseCookie=null;f.apply(ctx,b);},timeout||0);};}
Array.prototype.clear=function(){this.splice(0,this.length);}
Array.prototype.insert=function(index,item){this.splice(index,0,item);}
Array.prototype.indexOf=function(item){for(var i=0;i<this.length;++i)if(this[i]==item)return i;return-1;}
Array.prototype.remove=function(item){for(var i=0;i<this.length;++i)if(this[i]==item){this.splice(i,1);}}
Array.prototype.removeAt=function(index){this[index]=null;this.splice(index,1);}
Array.prototype.removeIf=function(f,thisp){var s=thisp||this;for(var i=this.length-1;i>=0;i--)if(f.call(s,this[i],i,this))this.splice(i,1);return this;}
Array.prototype.findIndex=function(f,thisp){var s=thisp||this,i=0,l=this.length;for(;i<l;++i)if(f.call(s,this[i],i,this))return i;return-1;}
Array.prototype.find=function(f,thisp){var i=this.findIndex(f,thisp);return i!=-1?this[i]:null;}
Array.prototype.replace=function(item,newitem){for(var i=0;i<this.length;++i)if(this[i]==item){this[i]=newitem;return;}}
Array.prototype.replaceIf=function(f,newitem,thisp){var s=thisp||this,i=0,l=this.length;for(;i<l;++i)if(f.call(s,this[i],i,this)){this[i]=newitem;return;}}
Array.prototype.clone=function(){var ar=[];for(var i=0;i<this.length;++i)ar.push(this[i]);return ar;}
Array.prototype.binarySearch=function(value,comparer,thisp){var l=0,r=this.length-1,m;if(comparer!=null){var res,s=thisp||this;while(l<=r){m=(l+r)>>1;res=comparer.call(s,this[m],value);if(res==0)return m;if(res<0)l=m+1;else r=m-1;}}else{while(l<=r){m=(l+r)>>1;if(this[m]==value)return m;if(this[m]<value)l=m+1;else r=m-1;}}return~l;}
Array.prototype.equals=function(ar,comparer){if(this.length!=ar.length)return false;if(comparer!=null){for(var i=0;this.length;++i)if(comparer(this[i],ar[i])!=0)return false;}else{for(var i=0;this.length;++i)if(this[i]!=ar[i])return false;}return true;}
Array.prototype.last=function(){return this.length==0?null:this[this.length-1];}
Array.prototype.each=function(f,thisp){var s=thisp||this;for(var i=0,l=this.length;i<l;++i)f.call(s,this[i],i,this);return this}
Array.prototype.map=function(f,thisp){var s=thisp||this;var i=0,l=this.length,r=new Array(l);for(;i<l;++i)r[i]=f.call(s,this[i],i,this);return r}
Array.prototype.every=function(f,thisp){var s=thisp||this;var i=0,l=this.length;for(;i<l;++i)if(!f.call(s,this[i],i,this))return false;return true}
Array.prototype.some=function(f,thisp){var s=thisp||this;var i=0,l=this.length;for(;i<l;++i)if(f.call(s,this[i],i,this))return true;return false}
Array.prototype.filter=function(f,thisp){var s=thisp||this;var r=[],i=0,l=this.length;for(;i<l;++i)if(f.call(s,this[i],i,this))r.push(this[i]);return r}
String.empty="";String.isNullOrEmpty=function(s){return s!=null&&s.length>0;}
String.format=function(f){var a=arguments;return f.replace(/{(\d+)}/ig,function($0,$1){return(a[Number($1)+1]);});}
String.prototype.trim=function(c){if(c==null)c=' ';var i,f,t;for(i=0;i<this.length;++i)if(this.charAt(i)!=c)break;f=i;for(i=this.length-1;i>=0;i--)if(this.charAt(i)!=c)break;t=i;if(f>t)return"";return this.substring(f,t+1);}
String.prototype.trimLeft=function(c){if(c==null)c=' ';var i,f,t;t=this.length-1;for(i=0;i<this.length;++i)if(this.charAt(i)!=c)break;f=i;return this.substring(f,t+1);}
String.prototype.trimRight=function(c){if(c==null)c=' ';var i,f,t;f=0;for(i=this.length-1;i>=0;i--)if(this.charAt(i)!=c)break;t=i;if(f>t)return"";return this.substring(f,t+1);}
String.prototype.escapeXML=function(){return this.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;");}
String.prototype.unescapeXML=function(){return this.replace(/&apos;/g,"'").replace(/&quot;/g,"\"").replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&amp;/g,"&");}
String.prototype.escapeHTML=function(){return this.replace(/&/gm,"&amp;").replace(/</gm,"&lt;").replace(/>/gm,"&gt;").replace(/\u00A0/g,"&nbsp;");}
String.prototype.unescapeHTML=function(){return this.replace(/&nbsp;/g,"\u00A0").replace(/&gt;/gm,">").replace(/&lt;/gm,"<").replace(/&amp;/gm,"&");}
Math.middle=function(v1,v2,v3){return v2<v3?(v2<v1?(v3<v1?v3:v1):v2):(v3<v1?(v2<v1?v2:v1):v3);}
Number.prototype.toHexString=function(n){var r=this.toString(16);n-=r.length;if(n<=0)return r;var a=[];while(n--)a.push("0");a.push(r);return a.join("");}
Number.prototype.format=function(n){var c=parseInt(n);var o=this.toString();var d=o.length-c;if(d>0)return o;var a=[];while(d++<0)a.push(0);a.push(o);return a.join("");}
Number.prototype.NaN0=function(){return isNaN(this)?0:this;}
Number.prototype.toMoney=function(fraction){return WL.Utils.floatToString(this,fraction!=null?fraction:CultureInfo.Currency.decimalDigits,true,true,CultureInfo.Currency.groupSeparator,CultureInfo.Currency.decimalSeparator);}
Number.fromMoney=function(s){return parseFloat(s.split(CultureInfo.Currency.groupSeparator).join('').replace(CultureInfo.Currency.decimalSeparator,'.'));}
WL.using=function(ns,use_as){if(typeof(use_as)=='undefined'||use_as==null)use_as=window;for(var p in ns)use_as[p]=ns[p];}
WL.Class=function(b,i){var l=new Function;l.prototype=b.prototype;var c=new Function;c.prototype=new l;c.extend(i,new l,c);c.prototype.constructor.prototype=c.prototype;for(var j in c)if(c.hasOwnProperty(j))c.prototype.constructor[j]=c[j];return c.prototype.constructor;}
if(typeof(window.showModalDialog)!="undefined")
{WL.__showModalDialog=function(sURL,vArguments,sFeatures,returner)
{var ret=window.showModalDialog(sURL,vArguments,sFeatures);if(returner!=null)
returner(ret);}
WL.returnValue=function(value)
{window.returnValue=value;}
WL.getModalDialogFeatures=function(width,height,scroll,resizable)
{var features=["dialogWidth:",width?width+"px":"auto",";dialogHeight:",height?height+"px":"auto",";scroll:",scroll?"yes":"no",";resizable:",resizable?"yes":"no",";status:yes;help:no"];return features.join('');}}
else
{WL.__showModalDialog=function(sURL,vArguments,sFeatures,returner)
{var w=window.open(sURL,"mdl_dlg",sFeatures);w.opener=window.self;w.dialogArguments=vArguments;var w_focus=function(){w.focus();};var handler=function()
{if(w.closed&&!w.removed)
{w.removed=true;window.removeEventListener("focus",handler,true);var value=undefined;if(w.__returnValue)
{value=w.__returnValue;w.__returnValue=null;}
if(returner!=null)
returner(value);}
else
{try{w.focus();}catch(e){}}};window.addEventListener("focus",handler,true);}
WL.returnValue=function(value)
{top.__returnValue=value;}
WL.getModalDialogFeatures=function(width,height,scroll,resizable)
{var left=width?((window.screen.availWidth-width)/2).NaN0():0;var top=height?((window.screen.availHeight-height)/2).NaN0():0;return String.format("modal=yes,channelmode=no,directories=no,fullscreen=no{0}{1}{2}{3},scrollbars={4},resizable={5},titlebar=no,toolbar=no,location=no,menubar=no,status=no",top>0?",top="+top:"",left>0?",left="+left:"",height?",height="+height:"",width?",width="+width:"",scroll!=false?"yes":"no",resizable!=false?"yes":"no");}}
WL.getWindowFeatures=function(width,height,top,left,location,resizable)
{return String.format("channelmode=no,directories=no,fullscreen=no{0}{1}{2}{3},location={4},menubar=yes,resizable={5},scrollbars=yes,status=yes,titlebar=yes,toolbar=yes",height?",height="+height:"",left!=null?",left="+left:"",width?",width="+width:"",top!=null?",top="+top:"",location==true?"yes":"no",resizable!=false?"yes":"no");}
if(typeof(document.addEventListener)!="undefined")
{WL.attachListener=function(element,name,handler)
{element.addEventListener(name,handler,false);}
WL.detachListener=function(element,name,handler)
{element.removeEventListener(name,handler,false);}
WL.getEvent=function(e){return e;}
WL.returnEvent=function(e,result,cancelBubble)
{if(cancelBubble)
{e.stopPropagation();e.preventDefault();}
e.returnValue=result;return result;}}
else
{WL.attachListener=function(element,name,handler)
{element.attachEvent("on"+name,handler);}
WL.detachListener=function(element,name,handler)
{element.detachEvent("on"+name,handler);}
WL.getEvent=function(e)
{if(window.event)e=window.event;if(e&&!e.target)
e.target=e.srcElement;return e;}
WL.returnEvent=function(e,result,cancelBubble)
{window.event.returnValue=result;if(cancelBubble!=null)
window.event.cancelBubble=cancelBubble;return result;}}
if(WL.browser.ie)
{WL.$=document.getElementById;WL.$e=document.createElement;WL.$en=function(type,name){return document.createElement('<'+type+' name="'+name+'">');}
WL.currentStyle=function(obj){return obj.currentStyle;}}
else
{WL.$=function(id){return document.getElementById(id);}
WL.$e=function(tag){return document.createElement(tag);}
WL.$en=function(type,name){var el=document.createElement(type);el.setAttribute("name",name);return el;}
WL.currentStyle=function(obj){return window.getComputedStyle(obj,null);}}
var _uIDs=0;WL.uniqueID=function(el){if(!el.id)el.id="_uid"+_uIDs++;return el.id;}
WL.$$=function(id){return WL.$(id).control;}
WL.$$$=function(){return WL.$(Array.prototype.slice.call(arguments).join('_'));}
WL.$$$$=function(id){return WL.$$$(id).control;}
WL.$$e=function(type,tag,parent){var cont=WL.$e(tag);parent.appendChild(cont);var c=new type();c.generate2(cont);return c;};(function(){var A=function(){var E=arguments[0];if(A.x[E]&&!arguments[2]){return A.x[E]}else{if(!E){return undefined}var J=arguments[1]||document;if(J.querySelectorAll){A.z=J.querySelectorAll(E)}else{switch(E){case"a":A.z=J.links||J.getElementsByTagName("a");break;case"body":A.z=J.body;break;case"form":A.z=J.forms||J.getElementsByTagName("form");break;case"head":A.z=J.getElementsByTagName("head")[0];break;case"img":A.z=J.images||J.getElementsByTagName("img");break;default:var C=E.split(/, */),N,G=0;while(N=C[G++]){var F=N.split(/ +/),B=F.length,M,H=0;A.y=J;while(M=F[H++]){M.replace(/([^\.#]+)?(?:#([^\.#]+))?(?:\.([^\.#]+))?/,function(V,Y,K,S){switch(H){case 0:if(!S){if(!Y){A.y=document.getElementById(K);break}if(!K){A.y=J.getElementsByTagName(Y);break}}if(!Y&&!K&&J.getElementsByClassName){A.y=J.getElementsByClassName(S);break}default:var Q=[],U=0,W=0,P;A.y=A.y.length?A.y:[A.y[0]||A.y];while((P=A.y[U++])&&P.nodeName){var R=0,O,T=P.getElementsByTagName(Y||"*"),X=H==B?1:0;while(O=T[R++]){if((!K||(K&&O.id==K))&&(!S||(S&&O.className.match(S)))&&!O.yeasss){if(X){O.yeasss=1}Q[W++]=O}}}A.y=Q;break}})}A.z=A.z||A.y;if(A.y&&G>1){var D,I=0,L=A.z.length;while(D=A.y[I++]){A.z[L++]=D}}}break}}var L=A.z.length;while(L--){A.z[L].yeasss=undefined}A.x[E]=A.z.length>1||A.z.nodeName?A.z:A.z[0];A.z=A.y=null;return A.x[E]}};A.y=null;A.z=null;A.x={};WL.$css=A})();WL.showModalDialog=function(sURL,vArguments,sFeatures,returner)
{if(WL.xmlCallback)
WL.xmlCallback.updateWindowStatus(true);if(vArguments==null)vArguments={};vArguments.window_opener=window.window_opener;vArguments.opener=window.self;if(sFeatures==null)
sFeatures=WL.getModalDialogFeatures(null,null,false,true);WL.__showModalDialog(sURL,vArguments,sFeatures,returner);vArguments.window_opener=null;vArguments.opener=null;}
WL.windowOpen=function(sURL,sName,sFeatures,bReplace)
{WL.Utils.assert(!window.window_opener,"window.window_opener is null");var w;try
{if(window.window_opener)
{w=window.window_opener.open(sURL,sName,sFeatures,bReplace);w.window_opener=window.window_opener;w.opener=window.self;}
else
{w=window.open(sURL,sName,sFeatures,bReplace);w.window_opener=window.self;}}
catch(e){}
return w;}
WL.navigate=function(url){if(url.toLowerCase().indexOf(WL.LogoutPage)==0)window.logout_alert=true;if(url.toLowerCase().indexOf("http")!=0)url=window.baseUrl+'/'+url;WL._closeMethod(function(){window.location.href=url;});}
WL.windowClose=function(){WL._closeMethod(function(){window.close();});}
WL.login=function(){WL.navigate(String.format("{0}?redirect={1}",WL.LogoutPage,encodeURIComponent(window.location.pathname+window.location.search)));}
WL.logoutStatic=function()
{var close_method=function(){window.location.href=String.format("{0}?redirect={1}",WL.LogoutPage,encodeURIComponent(window.location.pathname+window.location.search));}
if(!window.logout_alert){window.logout_alert=true;WL.alertCallback=close_method;WL.alert(WL.LogoutMsg);}
else close_method();}
WL.logoutPopup=function()
{var close_method=function()
{if(window.opener!=null&&window.opener.closed==false&&window.opener.logout!=null)
{window.opener.logout_alert=true;window.opener.logout();}
window.close();}
if(!window.logout_alert){window.logout_alert=true;WL.alertCallback=close_method;WL.alert(WL.LogoutMsg);}
else close_method();}
WL.onstart=[];WL._startup=function(){for(var i=0;i<WL.onstart.length;++i)WL.onstart[i]();WL.onstart.clear();WL.onstart.push=function(f){f();}}
WL.onload=[];WL._loadup=function(){for(var i=0;i<WL.onload.length;++i)WL.onload[i]();WL.onload.clear();WL.onload.push=function(f){f();}}
WL.onclose=[];WL._closeMethod=function(method)
{if(window.window_closing)return;window.window_closing=true;for(var i=0;i<WL.onclose.length;++i)
{try{WL.onclose[i]();}
catch(e){}}
WL.onclose.clear();var closeMethod=function()
{window.window_opener=null;window.opener=null;method();}
if(WL.xmlCallback!=null&&(WL.xmlCallback.getQueueLength()>0||WL.xmlCallback.getLateQueueLength()>0))
{var request=new ServerAPI.Request(WL.Guids.Api.WebGeneral,"Ping");window.xmlCallback.doWebRequest(request,this,closeMethod,closeMethod,false);}
else closeMethod();}
WL.R=[];WL.S=function(rid){return WL.R[rid]||"";}
WL.SHTML=function(rid){return WL.R[rid]||"";}
if(!Object.prototype.toJsonString){Array.prototype.toJsonString=function(w){var a=[],i,l=this.length,v;for(i=0;i<l;i+=1){v=this[i];switch(typeof v){case'object':if(v){if(typeof v.toJsonString==='function'){a.push(v.toJsonString(w));}}else{a.push('null');}
break;case'string':case'number':case'boolean':a.push(v.toJsonString());}}
return'['+a.join(',')+']';};Boolean.prototype.toJsonString=function(){return String(this);};Date.prototype.toJsonString=function(){return'new Date('+this.valueOf()+')';};Number.prototype.toJsonString=function(){return isFinite(this)?String(this):'null';};Object.prototype.toJsonString=function(w){var a=[],k,i,v;if(w){for(i=0;i<w.length;i+=1){k=w[i];if(typeof k==='string'){v=this[k];switch(typeof v){case'object':if(v){if(typeof v.toJsonString==='function'){a.push(k+':'+
v.toJsonString(w));}}else{a.push(k+':null');}
break;case'string':case'number':case'boolean':a.push(k+':'+v.toJsonString());}}}}else{for(k in this){if(typeof k==='string'&&Object.prototype.hasOwnProperty.apply(this,[k])){v=this[k];switch(typeof v){case'object':if(v){if(typeof v.toJsonString==='function'){a.push(k+':'+
v.toJsonString());}}else{a.push(k+':null');}
break;case'string':case'number':case'boolean':a.push(k+':'+v.toJsonString());}}}}
return'{'+a.join(',')+'}';};(function(){var m={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'};String.parseJson=function(json,type){var o=eval('('+json+')');if(!type)return o;if(!o)return null;if(o instanceof Array)
return[].fromRawObject(o,type);return(new type()).fromRawObject(o);}
String.prototype.toJsonString=function(){if(/["\\\x00-\x1f]/.test(this)){return'"'+this.replace(/[\x00-\x1f\\"]/g,function(a){var c=m[a];if(c){return c;}
c=a.charCodeAt();return'\\u00'+
Math.floor(c/16).toString(16)+
(c%16).toString(16);})+'"';}
return'"'+this+'"';};})();Object.prototype.fromRawObject=function(o)
{for(var p in o)
if(this.hasOwnProperty(p))
{if(o[p]==null){this[p]=null;continue;}
if(o[p]instanceof Array)
{var t=this.getClassOf(p);if(!t)this[p]=o[p];else
{this[p]=[];this[p].fromRawObject(o[p],t);}
continue;}
if(this[p]==null)
{var t=this.getClassOf(p);if(t)this[p]=new t();else{this[p]=o[p];continue;}}
switch(typeof this[p])
{case'function':break;case'object':this[p]=this[p].fromRawObject(o[p]);break;case'string':case'number':case'boolean':this[p]=o[p];break;}}
return this;}
Object.prototype.getClassOf=function(p)
{var o=this[p]?this[p]:(new this.constructor())[p];if(o==null||o instanceof Array)return null;return o.constructor;}
Array.prototype.fromRawObject=function(a,t)
{this.splice(0,this.length);if(t){for(var i=0;i<a.length;++i)
this.push((new t()).fromRawObject(a[i]));}
else{for(var i=0;i<a.length;++i)
this.push(a[i]);}
return this;}
String.prototype.fromRawObject=function(o){return o;}
Number.prototype.fromRawObject=function(o){return o;}
Boolean.prototype.fromRawObject=function(o){return o;}
Date.prototype.fromRawObject=function(o)
{if(o instanceof Date)return o;return o?Date.parseUTCExact(o,"yyyy-MM-ddTHH:mm:ssZ"):null;}}