
(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(o,t){var f=this,c=0,s=false;var a=Array.prototype.slice.call(arguments,2);return function(){if(s)return;var b=a.concat(Array.prototype.slice.call(arguments,0));if(c)window.clearTimeout(c);c=window.setTimeout(function(){c=0;s=true;try{f.apply(o,b);}catch(e){};s=false;},t||0);};}
Function.prototype.waitAll=function(cnt){var f=this;if(cnt==null)cnt=1;return{add:function(){cnt++},set:function(){if(--cnt<=0)f();}};}
Array.wrap=function(ar){var a=[];if(ar){if(typeof(ar.length)=="number")for(var i=0;i<ar.length;++i)a.push(ar[i]);else a.push(ar);}return a;}
Array.prototype.clear=function(){this.splice(0,this.length);}
Array.prototype.insert=function(i,it){this.splice(i,0,it);return this;}
Array.prototype.indexOf=function(it){for(var i=0;i<this.length;++i)if(this[i]==it)return i;return-1;}
Array.prototype.remove=function(it){for(var i=0;i<this.length;++i)if(this[i]==it){this.splice(i,1);}return this;}
Array.prototype.removeAt=function(i){this[i]=null;this.splice(i,1);return this;}
Array.prototype.removeIf=function(f,thisp,remAr){var s=thisp||this;for(var i=this.length-1;i>=0;i--)if(f.call(s,this[i],i,this)){if(remAr)remAr.push(this.splice(i,1)[0]);else 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(it,n){for(var i=0;i<this.length;++i)if(this[i]==it){this[i]=n;return;}}
Array.prototype.replaceIf=function(f,n,thisp){var s=thisp||this,i=0,l=this.length;for(;i<l;++i)if(f.call(s,this[i],i,this)){this[i]=n;return;}}
Array.prototype.moveAt=function(index,dx){var i=index+dx;if(i>=0&&i<this.length){var item=this[index];this.splice(index,1);this.splice(i,0,item);}return this;}
Array.prototype.move=function(it,dx){var i=this.indexOf(it);if(i!=-1)this.moveAt(i,dx);return this;}
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,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,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,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,r=[],i=0,l=this.length;for(;i<l;++i)if(f.call(s,this[i],i,this))r.push(this[i]);return r}
Array.prototype.reduce=function(f,b,thisp){for(var i=0,l=this.length;i<l;++i)b=f.call(thisp||this,b,this[i],i,this);return b};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.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,"&");}
String.prototype.escapeHash=function(){return this.replace(/%/g,"%25").replace(/\u00A0/g,"%20").replace(/ /g,"%20");}
String.prototype.unescapeHash=function(){return decodeURI(this);};String.wformat=function(f)
{var a=arguments;return f.replace(/{(\d+)(.*?)}/ig,function($0,$1,$2)
{var arg=a[Number($1)+1];var n=Math.abs(arg);if($2&&!isNaN(n))
{var forms=$2.replace(/\|\|/gm,'\ufffc').split('|');if(forms[0].toUpperCase()==":W")
{var idxForm=CultureInfo.getNumeralForm(n);var form=null;if(idxForm!=-1)
{if(forms.length>2)
{idxForm=n==0?1:idxForm+2;form=forms[idxForm].replace(/\ufffc/gm,'|');}
else if(forms.length>1)
{var sb=[];forms=forms[1].replace(/\ufffc/gm,'|').replace(/\(\(/gm,'\ufd3e').replace(/\)\)/gm,'\ufd3f').split('(');var i=0;for(;i<forms.length-1;++i)
{sb.push(forms[i]);var rp=forms[i+1].indexOf(')');if(rp!=-1)
{sb.push(forms[i+1].substring(0,rp).split(',')[idxForm]);forms[i+1]=forms[i+1].substring(rp+1);}}
sb.push(forms[i]);form=sb.join('').replace(/\ufd3e/gm,'(').replace(/\ufd3f/gm,')');}}
if(form!=null)
return form.replace(/%%/gm,'\ufffc').replace(/%/gm,arg).replace(/\ufffc/gm,'%');}}
return arg;});}
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:Number(this);}
Number.prototype.toMoney=function(fraction,symbol){return wl.Utils.floatToString(this,fraction!=null?fraction:CultureInfo.Currency.decimalDigits,true,true,CultureInfo.Currency.groupSeparator,CultureInfo.Currency.decimalSeparator,symbol);}
Number.fromMoney=function(s){return parseFloat(s.split(CultureInfo.Currency.groupSeparator).join('').replace(CultureInfo.Currency.decimalSeparator,'.').replace('$',''));}
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;};(function(){var to=function(o){if(o.document)o=o.document;return typeof(o.ownerDocument)=="undefined";}
var aoe=function(o,n,h)
{if(!o.wl$eh)o.wl$eh={};if(!o.wl$eh[n])o.wl$eh[n]=[];o.wl$eh[n].push(h);}
var doe=function(o,n,h){if(o.wl$eh&&o.wl$eh[n])o.wl$eh[n].remove(h);}
var foe=function(o,n,e)
{if(!e)e={};if(!e.stop)e.stop=function(){this.stopped=true};if(!e.target)e.target=o;if(o.wl$eh&&o.wl$eh[n]){o.wl$eh[n].clone().each(function(h){var r=h.call(o,e);if(r==true)e.isTrue=true;if(r==false)e.isFalse=true;});}
return e;}
if(typeof(document.addEventListener)!="undefined")
{wl.attachEvent=function(e,n,h){if(to(e))return aoe(e,n,h);if(!h.wl$eh)h.wl$eh=function(e){return h(wl.getEvent(e));};e.addEventListener(n,h.wl$eh,false);}
wl.detachEvent=function(e,n,h){if(to(e))return doe(e,n,h);e.removeEventListener(n,h.wl$eh,false);}
wl.getEvent=function(e){if(!e)e={};if(!e.stop)e.stop=function(){e.stopPropagation();e.preventDefault();};return e;}
wl.fireEvent=function(e,n,ev){if(to(e))return foe(e,n,ev);switch(n){case"change":ev=document.createEvent("HTMLEvents");ev.initEvent(n,false,false);break;case"click":ev=document.createEvent("MouseEvents");ev.initMouseEvent(n,true,true,document.defaultView,1,0,0,0,0,false,false,false,false,0,null);break;default:return;};e.dispatchEvent(ev);}}
else
{wl.attachEvent=function(e,n,h){if(to(e))return aoe(e,n,h);if(!h.wl$eh)h.wl$eh=function(e){return h(wl.getEvent(e));};e.attachEvent("on"+n,h.wl$eh);}
wl.detachEvent=function(e,n,h){if(to(e))return doe(e,n,h);e.detachEvent("on"+n,h.wl$eh);}
wl.getEvent=function(e){if(!e){e=window.event;if(!e)for(var i=0,l=window.frames.length;i<l;++i){try{if(window.frames[i].event)e=window.frames[i].event;}catch(ex){}}if(!e)e={};}if(e&&!e.target)e.target=e.srcElement;if(!e.stop)e.stop=function(){e.cancelBubble=true;};return e;}
wl.fireEvent=function(e,n,ev){if(to(e))return foe(e,n,ev);return e.fireEvent("on"+n);}}
wl.attachOnceEvent=function(e,n,h){var hh=function(){wl.detachEvent(e,n,hh);return h.apply(this,arguments);};wl.attachEvent(e,n,hh,false);}})();if(wl.browser.ie)
{wl.$=document.getElementById;wl.$en=function(type,name){return document.createElement('<'+type+' name="'+name+'">');}}
else
{wl.$=function(id){return document.getElementById(id);}
wl.$en=function(type,name){var el=document.createElement(type);el.setAttribute("name",name);return el;}}
wl.$fld=function(o,f,v)
{var fp=f.split('.'),i=0;if(typeof(v)=="undefined")
{while(o!=null&&i<fp.length)o=o[fp[i++]];return o;}
else
{while(o!=null&&i<fp.length-1)o=o[fp[i++]];if(o)o[fp[i]]=v;}}
if(typeof(window.getComputedStyle)!="function")window.getComputedStyle=function(o){return o.currentStyle;}
var _uIDs=0;wl.uniqueID=function(el){if(!el.id)el.id="_uid"+_uIDs++;return el.id;}
wl.$f=function(){}
wl.$e=function(t,p,c){var e=document.createElement(t);if(p){if(c)p.innerHTML="";p.appendChild(e)}return e}
wl.$t=function(t,p,c){var e=document.createTextNode(t);if(p){if(c)p.innerHTML="";p.appendChild(e)}return e}
wl.$op=function(t,v,p){var o=wl.$e("option");o.innerHTML=t;o.value=v;if(p)p.appendChild(o);return o}
wl.$opt=function(t,v,p){var o=wl.$e("option");wl.$t(t,o);o.value=v;if(p)p.appendChild(o);return o}
wl.$optsep=function(p){var o=wl.$opt("\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014",null,p);o.disabled=true;return o;}
wl.$h=function(id,v,p){var h=wl.$(id);if(!h){h=wl.$e("input");h.id=h.name=id;h.type="hidden";if(p)p.appendChild(h);}h.value=v;return h}
wl.$$=function(id){return wl.$(id).control;};(function(){var ua=navigator.userAgent;var O=document;var F=/(?!.*?opera.*?)msie(?!.*?opera.*?)/i.test(ua);var I=/webkit/i.test(ua);var A={};var J=!F&&!I;var G={};var N=0;var D={trim:/^\s+|\s+$/g,quickTest:/^[^:\[>+~ ,]+$/,typeSelector:/(^[^\[:]+?)(?:\[|\:|$)/,tag:/^(\w+|\*)/,id:/^(\w*|\*)#/,classRE:/^(\w*|\*)\./,attributeName:/(\w+)(?:[!+~*\^$|=])|\w+/,attributeValue:/(?:[!+~*\^$|=]=*)(.+)(?:\])/,pseudoName:/(\:[^\(]+)/,pseudoArgs:/(?:\()(.+)(?:\))/,nthParts:/([+-]?\d)*(n)([+-]\d+)*/i,combinatorTest:/[+>~ ](?![^\(]+\)|[^\[]+\])/,combinator:/\s*[>~]\s*(?![=])|\s*\+\s*(?![0-9)])|\s+/g,recursive:/:(not|has)\((\w+|\*)?([#.](\w|\d)+)*(\:(\w|-)+(\([^\)]+\))?|\[[^\}]+\])*(\s*,\s*(\w+|\*)?([#.](\w|\d)+)*(\:(\w|-)+(\([^\)]+\))?|\[[^\}]+\])*)*\)/gi};var E=function(Q){if(!!(window.attachEvent&&!window.opera)){return function(T){if(T instanceof Array){return T}for(var U=0,S=[],R;R=T[U++];){S[S.length]=R}return S}}else{return function(R){return Array.prototype.slice.call(R)}}}();function B(R,Q){var V=[],U={};if(Q){Q=new RegExp("^"+Q+"$","i")}for(var T=0,S;S=R[T++];){S.uid=S.uid||N++;if(!U[S.uid]&&(!Q||S.nodeName.search(Q)!==-1)){V[V.length]=U[S.uid]=S}}return V}function M(R,Q){if(!R){return null}if(Q==="class"||Q==="className"){return R.className}if(Q==="for"){return R.htmlFor}return R.getAttribute(Q)||R[Q]}function C(R,Y,W,V,U,Z,Q){var c=[];if(!!Q){return Y.test(W.className)?[W]:[]}if(W.getElementsByClassName){c=E(W.getElementsByClassName(R));if(!!V){if(Y.test(W.className)){c[c.length]=W}}if(Z!="*"){c=B(c,Z)}A[U]=c.slice(0);return c}else{if(O.getElementsByClassName){c=E(O.getElementsByClassName(R));if(Z!="*"){c=B(c,Z)}A[U]=c.slice(0);return c}}var X=(Z=="*"&&W.all)?W.all:W.getElementsByTagName(Z);if(!!V){X[X.length]=W}for(var S=0,T;T=X[S++];){if(Y.test(T.className)){c[c.length]=T}}return c}function P(R,X,W,V,Z,Q){var S,c=[];if(!!Q){return M(X,"id")===R?[X]:[]}if(X.getElementById){S=X.getElementById(R)}else{S=O.getElementById(R)}if(S&&M(S,"id")===R){c[c.length]=S;A[V]=c.slice(0);return c}var Y=X.getElementsByTagName(Z);if(!!W){Y[Y.length]=X}for(var T=0,U;U=Y[T++];){if(M(U,"id")===R){c[c.length]=U;break}}return c}function H(T,Z,X,Q){var R,d,c="",e=[],S=[],Y,U,V;D.id.lastIndex=D.typeSelector.lastIndex=D.classRE.lastIndex=0;if(!D.tag.test(T)){T="*"+T}R=D.typeSelector.exec(T)[1];Z=Z instanceof Array?Z.slice(0):[Z];V=Z.length;U=V-1;if(D.id.test(R)){c="id";d=(d=R.match(/^\w+/))?d[0]:"*";R=R.replace(D.id,"")}else{if(D.classRE.test(R)){c="class";d=(d=R.match(D.tag))?d[0]:"*";R=R.replace(D.tag,"");contextRE=G[R+"RegExp"]||(G[R+"RegExp"]=new RegExp("(?:^|\\s)"+R.replace(/\./g,"\\s*")+"(?:\\s|$)"));R=R.replace(/\./g," ")}}while(U>-1){Y=Z[U--];Y.uid=Y.uid||N++;var W=T+Y.uid;if(J&&A[W]){e=e.concat(A[W]);continue}if(c==="id"){S=P(R,Y,X,W,d,Q)}else{if(c==="class"){S=C(R,contextRE,Y,X,W,d,Q)}else{S=E(Y.getElementsByTagName(R));if(!!X&&(Y.nodeName.toUpperCase()===R.toUpperCase()||R==="*")){S[S.length]=Y}}}e=V>1?e.concat(S):S;A[W]=e.slice(0)}return e}pp={query:function(p,k,S,f,d){var e=[];if(!f){p=p.replace(D.trim,"").replace(/(\[)\s+/g,"$1").replace(/\s+(\])/g,"$1").replace(/(\[[^\] ]+)\s+/g,"$1").replace(/\s+([^ \[]+\])/g,"$1").replace(/(\()\s+/g,"$1").replace(/(\+)([^0-9])/g,"$1 $2").replace(/['"]/g,"").replace(/\(\s*even\s*\)/gi,"(2n)").replace(/\(\s*odd\s*\)/gi,"(2n+1)")}if(typeof k==="string"){k=(k=H(k,O)).length>0?k:undefined}k=k||O;k.uid=k.uid||N++;var V=p+k.uid;if(J&&A[V]){return A[V]}D.quickTest.lastIndex=0;if(D.quickTest.test(p)){e=H(p,k,S,d);return(A[V]=e.slice(0))}var v,s,m,i=[],j;v=p.split(/\s*,\s*/g);s=v.length>1?[""]:v;for(var U=0,X=0,q=0,o;v.length>1&&(o=v[U++])!==undefined;){X+=(((l=o.match(/\(/g))?l.length:0)-((r=o.match(/\)/g))?r.length:0));s[q]=s[q]||"";s[q]+=(s[q]===""?o:","+o);if(X===0){q++}}var T=0;while((m=s[T++])!==undefined){D.quickTest.lastIndex=0;if(D.quickTest.test(m)){Y=H(m,k,S,d);e=s.length>1?e.concat(Y):Y;continue}D.combinatorTest.lastIndex=0;if(D.combinatorTest.test(m)){var i,u,W=0,Z,n,h=0,Y;i=m.split(D.combinator);u=i.length;Z=m.match(D.combinator)||[""];n=Z.length;while(W<u){var t,R,Q;t=Z[h++].replace(D.trim,"");R=Y||pp.query(i[W++],k,S,true,d);Q=pp.query(i[W++],t==""||t==">"?R:k,t==""||t==">",true,d);Y=pp.queryCombinator(R,Q,t)}e=s.length>1?e.concat(Y):Y;Y=undefined}else{Y=pp.querySelector(m,k,S,d);e=s.length>1?e.concat(Y):Y}}if(s.length>1){e=B(e)}return(A[V]=e.slice(0))},queryCombinator:function(T,R,X){var f=[],V={},W={},Y={},S={},U=pp.simpleSelector.combinator[X];for(var d=0,Q;Q=T[d++];){Q.uid=Q.uid||N++;V[Q.uid]=Q}for(var Z=0,e;e=R[Z++];){e.uid=e.uid||N++;if(!W[e.uid]&&U(e,V,S,Y)){f[f.length]=e}W[e.uid]=e}return f},querySelector:function(s,q,X,j){var W,m=[],d,u,x,f=true,Z={};W=H(s,q,X,j);d=W.length;u=d-1;var Y,w;if(/:(not|has)/i.test(s)){w=s.match(D.recursive);s=s.replace(D.recursive,"")}if(!(Y=s.match(/:(\w|-)+(\([^\(]+\))*|\[[^\[]+\]/g))){Y=[]}if(w){Y=Y.concat(w)}var AA;while((AA=Y.pop())!==undefined){var R=G[AA],y,k,U,T=[],Q=false,AE=false;m=[];if(R){U=R[0];y=R[1];T=R.slice(2);k=y[U]}else{if(!/^:/.test(AA)){var p=AA.match(D.attributeName);var i=AA.match(D.attributeValue);T[1]=p[1]||p[0];T[2]=i?i[1]:"";U=""+AA.match(/[~!+*\^$|=]/);y=pp.simpleSelector.attribute;k=y[U];G[AA]=[U,y].concat(T)}else{var V=AA.match(D.pseudoArgs);T[1]=V?V[1]:"";U=AA.match(D.pseudoName)[1];y=pp.simpleSelector.pseudos;if(/nth-(?!.+only)/i.test(AA)){var AB,z,AD=T[1],g=G[AD];if(g){AB=g[0];z=g[1]}else{var h=AD.match(D.nthParts);if(h){AB=parseInt(h[1],10)||0;z=parseInt(h[3],10)||0;if(/^\+n|^n/i.test(AD)){AB=1}else{if(/^-n/i.test(AD)){AB=-1}}T[2]=AB;T[3]=z;G[AD]=[AB,z]}}}else{if(/^:contains/.test(AA)){var c=T[1];var AC=G[c];if(AC){T[1]=AC}else{T[1]=G[c]=new RegExp(c)}}}k=y[U];G[AA]=[U,y].concat(T)}}Q=/:(\w|-)+type/i.test(AA);AE=/^:(nth[^-]|eq|gt|lt|first|last)/i.test(AA);if(AE){T[3]=u}var t=W.length,o=t-1;while(o>-1){x=W[o--];if(f){x.peppyCount=o+1}var S=true;T[0]=x;if(AE){T[2]=x.peppyCount}if(!k.apply(y,T)){S=false}if(S){m.push(x)}}W=m;f=false}return m},simpleSelector:{attribute:{"null":function(S,Q,R){return!!M(S,Q)},"=":function(S,Q,R){return M(S,Q)==R},"~":function(S,Q,R){return M(S,Q).match(new RegExp("\\b"+R+"\\b"))},"^":function(S,Q,R){return M(S,Q).indexOf(R)===0},"$":function(T,R,S){var Q=M(T,R);return Q.lastIndexOf(S)===Q.length-S.length},"*":function(S,Q,R){return M(S,Q).indexOf(R)!=-1},"|":function(S,Q,R){return M(S,Q).match("^"+R+"-?(("+R+"-)*("+R+"$))*")},"!":function(S,Q,R){return M(S,Q)!==R}},pseudos:{":root":function(Q){return Q===O.getElementsByTagName("html")[0]?true:false},":nth-child":function(U,Q,W,V,Y){if(!U.nodeIndex){var R=U.parentNode.firstChild,T=0,X;for(;R;R=R.nextSibling){if(R.nodeType==1){X=R;R.nodeIndex=++T}}X.IsLastNode=true;if(T==1){X.IsOnlyChild=true}}var S=U.nodeIndex;if(Q=="first"){return S==1}if(Q=="last"){return!!U.IsLastNode}if(Q=="only"){return!!U.IsOnlyChild}return(!W&&!V&&S==Q)||((W==0?S==V:W>0?S>=V&&(S-V)%W==0:S<=V&&(S+V)%W==0))},":nth-last-child":function(Q,R){return this[":nth-child"](Q,R,a,b)},":nth-of-type":function(R,S,Q){return this[":nth-child"](R,S,a,b,Q)},":nth-last-of-type":function(R,S,Q){return this[":nth-child"](R,S,a,b,Q)},":first-child":function(Q){return this[":nth-child"](Q,"first")},":last-child":function(Q){return this[":nth-child"](Q,"last")},":first-of-type":function(R,S,Q){return this[":nth-child"](R,"first",null,null,Q)},":last-of-type":function(R,S,Q){return this[":nth-child"](R,"last",null,null,Q)},":only-child":function(Q){return this[":nth-child"](Q,"only")},":only-of-type":function(R,S,Q){return this[":nth-child"](R,"only",null,null,Q)},":empty":function(S){for(var R=S.firstChild,Q=0;R!==null;R=R.nextSibling){if(R.nodeType===1||R.nodeType===3){return false}}return true},":not":function(R,Q){return pp.query(Q,R,true,true,true).length===0},":has":function(R,Q){return pp.query(Q,R,true,true,true).length>0},":selected":function(Q){return Q.selected},":hidden":function(Q){return Q.type==="hidden"||Q.style.display==="none"},":visible":function(Q){return Q.type!=="hidden"&&Q.style.display!=="none"},":input":function(Q){return Q.nodeName.search(/input|select|textarea|button/i)!==-1},":radio":function(Q){return Q.type==="radio"},":checkbox":function(Q){return Q.type==="checkbox"},":text":function(Q){return Q.type==="text"},":header":function(Q){return Q.nodeName.search(/h\d/i)!==-1},":enabled":function(Q){return!Q.disabled&&Q.type!=="hidden"},":disabled":function(Q){return Q.disabled},":checked":function(Q){return Q.checked},":contains":function(R,Q){return Q.test((R.textContent||R.innerText||""))},":parent":function(Q){return!!Q.firstChild},":odd":function(Q){return this[":nth-child"](Q,"2n+2",2,2)},":even":function(Q){return this[":nth-child"](Q,"2n+1",2,1)},":nth":function(S,R,Q){return R==Q},":eq":function(S,R,Q){return R==Q},":gt":function(S,R,Q){return Q>R},":lt":function(S,R,Q){return Q<R},":first":function(S,R,Q){return Q==0},":last":function(T,S,R,Q){return R==Q}},combinator:{"":function(T,R,U,S){var Q=T.uid;while((T=T.parentNode)!==null&&!U[T.uid]){if(!!R[T.uid]||!!S[T.uid]){return(S[Q]=true)}}return(U[Q]=false)},">":function(S,Q,T,R){return S.parentNode&&Q[S.parentNode.uid]},"+":function(S,Q,T,R){while((S=S.previousSibling)!==null&&!T[S.uid]){if(S.nodeType===1){return S.uid in Q}}return false},"~":function(T,R,U,S){var Q=T.uid;while((T=T.previousSibling)!==null&&!U[T.uid]){if(!!R[T.uid]||!!S[T.uid]){return(S[Q]=true)}}return(U[Q]=false)}}}};if(O.querySelectorAll){(function(){var Q=pp.query;pp.query=function(S,R){R=R||O;if(R===O){try{return R.querySelectorAll(S)}catch(T){}}return Q.apply(Q,E(arguments))}})()}else{var L=O.addEventListener||O.attachEvent;function K(){A={}}L("DOMAttrModified",K,false);L("DOMNodeInserted",K,false);L("DOMNodeRemoved",K,false)};wl.$css=function(){return Array.wrap(pp.query.apply(this,arguments))}})();wl.navigate=function(url){if(url.toLowerCase().indexOf(wl.logoutPage)==0)window.logout_alert=true;if(url.toLowerCase().indexOf("http")!=0){var i=url.indexOf('/'),u="";if(i==-1)i=url.indexOf('?');if(i==-1)i=url.indexOf('#');if(i!=-1){u=url.substring(i);url=url.substring(0,i);};url=String.format('{0}{2}{1}{3}',wl.baseUrl,wl.baseExt,url,u);}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.alert(wl.logoutMsg,{handler:close_method});}
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=window.opener=null;method();}
if(wl.Remoting.requestCount)wl.ping(closeMethod);else closeMethod();}
wl.ping=function(handler){if(typeof(wl.APIRemoting)!="undefined")new wl.APIRemoting(wl.guids.api.WebGeneral,"Ping",true).setArgument().setHandler(handler).send();}
if(wl.PingInterval)
{var do_ping=function(){window.setTimeout(run_ping,wl.PingInterval);};var run_ping=function(){wl.ping(do_ping);};do_ping();}
wl.attachEvent(window,"unload",function()
{for(var i=0;i<wl.onclose.length;++i){try{wl.onclose[i]();}catch(e){}}
wl.onclose.clear();wl.Remoting.unload();wl.APIRemoting.unload();if(typeof(wl.ServerJob)!="undefined")wl.ServerJob.unload();});wl.$table=function(rows,cols,cellCreator)
{var table=wl.$e("TABLE");var tbody=wl.$e("TBODY");var tr,td;for(var i=0;i<rows;++i)
{tr=wl.$e("TR");for(var j=0;j<cols;++j)
{td=wl.$e("TD");if(cellCreator)cellCreator(i,j,td);tr.appendChild(td);}
tbody.appendChild(tr);}
table.appendChild(tbody);return table;}
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.showModalDialog=function(sURL,vArguments,sFeatures,returner)
{if(vArguments==null)vArguments={};vArguments.window_opener=window.window_opener;vArguments.opener=window.self;if(sFeatures==null)
sFeatures=wl.getModalDialogFeatures(null,null,false,true);var idx=sURL.indexOf('?'),s='',ps='&';if(idx==-1){s='?',ps='',idx=sURL.indexOf('#')-1;if(idx==-2)idx=sURL.length;}
sURL=String.format("{0}{1}popup={2}{3}",sURL.substring(0,idx+1),s,ps,sURL.substring(idx+1));wl.__showModalDialog(sURL,vArguments,sFeatures,returner);vArguments.window_opener=null;vArguments.opener=null;}
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");}
wl.windowOpen=function(sURL,sName,sFeatures,bReplace)
{wl.Utils.assert(!window.window_opener,"window.window_opener is null");var w;try
{if(sURL)
{var idx=sURL.indexOf('?'),s='',ps='&';if(idx==-1){s='?',ps='',idx=sURL.indexOf('#')-1;if(idx==-2)idx=sURL.length;}
sURL=String.format("{0}{1}popup={2}{3}",sURL.substring(0,idx+1),s,ps,sURL.substring(idx+1));}
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.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.alert(wl.logoutMsg,{handler:close_method});}
else close_method();}
Object.prototype.copy=function(toObj)
{for(var p in this)if(this.hasOwnProperty(p))
{if(this[p]==null)toObj[p]=null;else switch(typeof(this[p]))
{case"object":if(this[p].nodeName)toObj[p]=this[p];else toObj[p]=this[p].clone();break;case"string":case"number":case"boolean":toObj[p]=this[p];break;}}}
Object.prototype.clone=function(){var o=new this.constructor();this.copy(o);return o;}
Array.prototype.copy=function(toAr){for(var i=0,l=this.length;i<l;++i)toAr.push(this[i]);}
Array.prototype.clone=function(){var ar=[];this.copy(ar);return ar;}
String.prototype.clone=function(){return this;}
Number.prototype.clone=function(){return this;}
Boolean.prototype.clone=function(){return this;}
Date.prototype.clone=function(){return this;}
wl.Remoting=wl.Class(Object,function(base,type)
{type.requestCount=0;this.constructor=function(url)
{this.url=url;this.handler=null;this.isAsync=true;this.isHidden=false;this.timeout=wl.TimeOut;}
this.setArgument=function(arg){this.eventArgument=arg.replace(this.re,"%2B");return this}
this.setHandler=function(h){this.handler=h;return this}
this.setTimeout=function(t){this.timeout=t;return this}
this.setSync=function(){this.isAsync=false;return this}
this.getUrl=function(){return this.url};var _l=window.location.protocol.toLowerCase()+"//"+window.location.host.toLowerCase();this.getRequestObject=function(url)
{if(url.toLowerCase().indexOf(_l)!=0)return new wl.CrossXMLHttpRequest();if(window.XMLHttpRequest)return new window.XMLHttpRequest();if(window.ActiveXObject)
{try{return new ActiveXObject("Msxml2.XMLHTTP");}
catch(e){try{return new ActiveXObject("Microsoft.XMLHTTP");}catch(e2){}}}
return new wl.CrossXMLHttpRequest();}
this.send=function()
{wl.Remoting.updateStatus(1);this.rq=this.getRequestObject(this.getUrl());if(this.isAsync)
this.rq.onreadystatechange=this.onComplete.bind(this);if(this.eventArgument)
{this.rq.open("POST",this.getUrl(),this.isAsync);this.rq.setRequestHeader("Content-Type","application/x-www-form-urlencoded");this.rq.send(this.eventArgument);}
else
{this.rq.open("GET",this.getUrl(),this.isAsync);this.rq.send(null);}
return this.isAsync?this.onStart():this.onComplete();}
this.abort=function()
{this.rq.abort();this.executed=true;wl.Remoting.updateStatus(-1);if(this._timer){window.clearTimeout(this._timer);this._timer=0;}
this.dispose();}
this.onStart=function()
{if(this._timer)window.clearTimeout(this._timer);if(this.timeout>0)this._timer=window.setTimeout(ontimeout.bind(this),this.timeout);}
var ontimeout=function()
{this.abort();if(this.handler!=null)
this.handler({errCode:504,error:String.format("Timeout {0} seconds",this.timeout/1000)});}
this.onComplete=function()
{var rv=null;if(!this.executed&&this.rq.readyState==4)
{this.executed=true;wl.Remoting.updateStatus(-1);if(this._timer){window.clearTimeout(this._timer);this._timer=0;}
rv=this.parseResponse();if(typeof(this.handler)=="function")
this.handler(rv);this.dispose();}
return rv;}
this.parseResponse=function()
{var rv={errCode:0,xml:this.rq.responseXML,text:this.rq.responseText};if(this.rq.status!=200)
rv.errCode=this.rq.status,rv.error=this.rq.statusText;if(this.rq.getResponseHeader("content-type")=="text/xml")
{if(rv.xml.parseError&&rv.xml.parseError.errorCode!=0&&rv.text!="")
rv.errorCode=rv.xml.parseError.errorCode,rv.error=rv.xml.parseError.reason;}
if(rv.errCode==401)
{if(!rv.error)rv.error="Logout";if(wl.logout)wl.logout();}
if(rv.errCode&&!rv.error)rv.error="Error occured with code "+rv.errCode;return rv;}
this.dispose=function()
{this.rq=null;}
type.updateStatus=function(d){type.requestCount+=d;if(wl.$("progress"))wl.Utils.setNew(wl.$("progress").style,"visibility",type.requestCount?"visible":"hidden");}
type.unload=function(){}});wl.CrossXMLHttpRequest=wl.Class(Object,function(base)
{this.constructor=function()
{this.readyState=0;this.onreadystatechange=null;this.responseXML=null;this.responseText=null;this.status=0;this.statusText="";this.url=null;this.headers=null;}
this.open=function(method,url,isAsync)
{this.url=url;}
this.setRequestHeader=function(){}
this.getResponseHeader=function(header){return this.headers[header];}
this.send=function(arg)
{var path=String.format("{0}{1}callback={2}&{3}",this.url,this.url.indexOf('?')>=0?'&':'?',wl.Utils.createHandler(onreadystatechange.bind(this)),arg);wl.attachScript(path);}
var onreadystatechange=function(result,status)
{this.readyState=4;this.responseText=result;this.headers=status.headers;try
{if(this.getResponseHeader("content-type")=="text/xml")
{if(window.DOMParser)
this.responseXML=(new DOMParser()).parseFromString(result,"text/xml");else
if(window.ActiveXObject)
{var xmldoc=new ActiveXObject("Microsoft.XMLDOM");xmldoc.loadXML(result);this.responseXML=xmldoc;}}
else this.responseXML={parseError:{errorCode:1,reason:"Content isn't xml document"}};}
catch(e){this.responseXML={parseError:{errorCode:e.number||2,reason:e.message}};}
this.status=status.status;this.statusText=status.statusText;if(this.onreadystatechange)this.onreadystatechange();}
this.abort=function(){this.onreadystatechange=null;}});wl.APIRemoting=wl.Class(wl.Remoting,function(base,type)
{var web=[],webs=[];var wrapArgument="format=json&r=[{0}]";this.constructor=function(api,method,bSession)
{this.bSession=bSession!=null?bSession:true;base.constructor.call(this,wl.baseUrl+(this.bSession?"webs.ashx":"web.ashx"));this.api=api;this.method=method;}
this.setArgument=function(request)
{return base.setArgument.call(this,'{'+String.format("api:\"{0}\",method:\"{1}\",body:{2}",this.api,this.method,encodeURIComponent((request||{}).toJsonString()))+'}');}
this.send=function()
{if(!this.isAsync)
{this.eventArgument=String.format(wrapArgument,this.eventArgument);return base.send.call(this);}
(this.bSession?webs:web).push(this);wl.Remoting.updateStatus(1);window.setTimeout(doCall,0);}
this.parseResponse=function(idx)
{var rv=base.parseResponse.call(this);return rv.errCode?rv:rv.fromRawObject(eval(rv.text)[idx||0]);}
var doCall=function()
{if(web.length){doWebCall(web);web=[];}
if(webs.length){doWebCall(webs);webs=[];}
wl.Remoting.updateStatus(-1);}
var doWebCall=function(l)
{var r=new wl.Remoting(l[0].url).setArgument(String.format(wrapArgument,l.map(function(w){return w.eventArgument}).join(','))).setHandler(function(result)
{var isLogout=false;l.each(function(w,i)
{w.rq=r.rq;var rv=result.errCode?result:w.parseResponse(i);if(rv.errCode==401)isLogout=true;if(typeof(w.handler)=="function")w.handler(rv);});l.clear();if(isLogout&&wl.logout)wl.logout();});if(type.allSync)r.setSync();r.send();}
type.unload=function()
{wl.Remoting.updateStatus(1);type.allSync=true;doCall();type.allSync=false;}});Cultures={};CultureInfo={name:"en-US",englishName:"English (United States)",nativeName:"English (United States)"};CultureInfo.Date={formatPatterns:{shortDate:"M/d/yyyy",longDate:"dddd, MMMM dd, yyyy",shortTime:"h:mm tt",longTime:"h:mm:ss tt",editDateTime:"M/d/yyyy H:mm:ss",fullDateTime:"dddd, MMMM dd, yyyy h:mm:ss tt",sortableDateTime:"yyyy-MM-ddTHH:mm:ss",universalSortableDateTime:"yyyy-MM-dd HH:mm:ssZ",rfc1123:"ddd, dd MMM yyyy HH:mm:ss GMT",monthDay:"MMMM dd",yearMonth:"MMMM, yyyy"},dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],abbreviatedDayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],shortestDayNames:["Su","Mo","Tu","We","Th","Fr","Sa"],firstLetterDayNames:["S","M","T","W","T","F","S"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],abbreviatedMonthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],amDesignator:"AM",pmDesignator:"PM",firstDayOfWeek:0,twoDigitYearMax:2029,weekendDays:[0,6],dateElementOrder:"mdy",regexPatterns:{jan:/^jan(uary)?/i,feb:/^feb(ruary)?/i,mar:/^mar(ch)?/i,apr:/^apr(il)?/i,may:/^may/i,jun:/^jun(e)?/i,jul:/^jul(y)?/i,aug:/^aug(ust)?/i,sep:/^sep(t(ember)?)?/i,oct:/^oct(ober)?/i,nov:/^nov(ember)?/i,dec:/^dec(ember)?/i,sun:/^su(n(day)?)?/i,mon:/^mo(n(day)?)?/i,tue:/^tu(e(s(day)?)?)?/i,wed:/^we(d(nesday)?)?/i,thu:/^th(u(r(s(day)?)?)?)?/i,fri:/^fr(i(day)?)?/i,sat:/^sa(t(urday)?)?/i,future:/^next/i,past:/^last|past|prev(ious)?/i,add:/^(\+|after|from)/i,subtract:/^(\-|before|ago)/i,yesterday:/^yesterday/i,today:/^t(oday)?/i,tomorrow:/^tomorrow/i,now:/^n(ow)?/i,millisecond:/^ms|milli(second)?s?/i,second:/^sec(ond)?s?/i,minute:/^min(ute)?s?/i,hour:/^h(ou)?rs?/i,week:/^w(ee)?k/i,month:/^m(o(nth)?s?)?/i,day:/^d(ays?)?/i,year:/^y((ea)?rs?)?/i,shortMeridian:/^(a|p)/i,longMeridian:/^(a\.?m?\.?|p\.?m?\.?)/i,timezone:/^((e(s|d)t|c(s|d)t|m(s|d)t|p(s|d)t)|((gmt)?\s*(\+|\-)\s*\d\d\d\d?)|gmt)/i,ordinalSuffix:/^\s*(st|nd|rd|th)/i,timeContext:/^\s*(\:|a|p)/i},abbreviatedTimeZoneStandard:{GMT:"-000",EST:"-0400",CST:"-0500",MST:"-0600",PST:"-0700"},abbreviatedTimeZoneDST:{GMT:"-000",EDT:"-0500",CDT:"-0600",MDT:"-0700",PDT:"-0800"}};CultureInfo.getNumeralForm=function(n){return(n!=1?1:0);}
CultureInfo.Number={groupSeparator:",",decimalSeparator:".",decimalDigits:2};CultureInfo.Currency={groupSeparator:",",decimalSeparator:".",decimalDigits:2};Cultures[CultureInfo.name]=CultureInfo;Date.getMonthNumberFromName=function(name){var n=CultureInfo.Date.monthNames,m=CultureInfo.Date.abbreviatedMonthNames,s=name.toLowerCase();for(var i=0;i<n.length;i++){if(n[i].toLowerCase()==s||m[i].toLowerCase()==s){return i;}}
return-1;};Date.getDayNumberFromName=function(name){var n=CultureInfo.Date.dayNames,m=CultureInfo.Date.abbreviatedDayNames,o=CultureInfo.Date.shortestDayNames,s=name.toLowerCase();for(var i=0;i<n.length;i++){if(n[i].toLowerCase()==s||m[i].toLowerCase()==s){return i;}}
return-1;};Date.isLeapYear=function(year){return(((year%4===0)&&(year%100!==0))||(year%400===0));};Date.getDaysInMonth=function(year,month){return[31,(Date.isLeapYear(year)?29:28),31,30,31,30,31,31,30,31,30,31][month];};Date.getTimezoneOffset=function(s,dst){return(dst||false)?CultureInfo.Date.abbreviatedTimeZoneDST[s.toUpperCase()]:CultureInfo.Date.abbreviatedTimeZoneStandard[s.toUpperCase()];};Date.prototype.clone=function(){return new Date(this.getTime());};Date.prototype.compareTo=function(date){if(isNaN(this)){throw new Error(this);}
if(date instanceof Date&&!isNaN(date)){return(this>date)?1:(this<date)?-1:0;}else{throw new TypeError(date);}};Date.prototype.equals=function(date){return(this.compareTo(date)===0);};Date.prototype.between=function(start,end){var t=this.getTime();return t>=start.getTime()&&t<=end.getTime();};Date.prototype.addMilliseconds=function(value){this.setMilliseconds(this.getMilliseconds()+value);return this;};Date.prototype.addSeconds=function(value){return this.addMilliseconds(value*1000);};Date.prototype.addMinutes=function(value){return this.addMilliseconds(value*60000);};Date.prototype.addHours=function(value){return this.addMilliseconds(value*3600000);};Date.prototype.addDays=function(value){return this.addMilliseconds(value*86400000);};Date.prototype.addWeeks=function(value){return this.addMilliseconds(value*604800000);};Date.prototype.addMonths=function(value){var n=this.getDate();this.setDate(1);this.setMonth(this.getMonth()+value);this.setDate(Math.min(n,this.getDaysInMonth()));return this;};Date.prototype.addYears=function(value){return this.addMonths(value*12);};Date.prototype.add=function(config){if(typeof config=="number"){this._orient=config;return this;}
var x=config;if(x.millisecond||x.milliseconds){this.addMilliseconds(x.millisecond||x.milliseconds);}
if(x.second||x.seconds){this.addSeconds(x.second||x.seconds);}
if(x.minute||x.minutes){this.addMinutes(x.minute||x.minutes);}
if(x.hour||x.hours){this.addHours(x.hour||x.hours);}
if(x.month||x.months){this.addMonths(x.month||x.months);}
if(x.year||x.years){this.addYears(x.year||x.years);}
if(x.day||x.days){this.addDays(x.day||x.days);}
return this;};Date._validate=function(value,min,max,name){if(typeof value!="number"){throw new TypeError(value+" is not a Number.");}else if(value<min||value>max){throw new RangeError(value+" is not a valid value for "+name+".");}
return true;};Date.validateMillisecond=function(n){return Date._validate(n,0,999,"milliseconds");};Date.validateSecond=function(n){return Date._validate(n,0,59,"seconds");};Date.validateMinute=function(n){return Date._validate(n,0,59,"minutes");};Date.validateHour=function(n){return Date._validate(n,0,23,"hours");};Date.validateDay=function(n,year,month){return Date._validate(n,1,Date.getDaysInMonth(year,month),"days");};Date.validateMonth=function(n){return Date._validate(n,0,11,"months");};Date.validateYear=function(n){return Date._validate(n,1,9999,"seconds");};Date.prototype.set=function(config){var x=config;if(!x.millisecond&&x.millisecond!==0){x.millisecond=-1;}
if(!x.second&&x.second!==0){x.second=-1;}
if(!x.minute&&x.minute!==0){x.minute=-1;}
if(!x.hour&&x.hour!==0){x.hour=-1;}
if(!x.day&&x.day!==0){x.day=-1;}
if(!x.month&&x.month!==0){x.month=-1;}
if(!x.year&&x.year!==0){x.year=-1;}
if(x.millisecond!=-1&&Date.validateMillisecond(x.millisecond)){this.addMilliseconds(x.millisecond-this.getMilliseconds());}
if(x.second!=-1&&Date.validateSecond(x.second)){this.addSeconds(x.second-this.getSeconds());}
if(x.minute!=-1&&Date.validateMinute(x.minute)){this.addMinutes(x.minute-this.getMinutes());}
if(x.hour!=-1&&Date.validateHour(x.hour)){this.addHours(x.hour-this.getHours());}
if(x.month!==-1&&Date.validateMonth(x.month)){this.addMonths(x.month-this.getMonth());}
if(x.year!=-1&&Date.validateYear(x.year)){this.addYears(x.year-this.getFullYear());}
if(x.day!=-1&&Date.validateDay(x.day,this.getFullYear(),this.getMonth())){this.addDays(x.day-this.getDate());}
if(x.timezone){this.setTimezone(x.timezone,x.checkDST);}
if(x.timezoneOffset){this.setTimezoneOffset(x.timezoneOffset,x.checkDST);}
return this;};Date.prototype.clearTime=function(){this.setHours(0);this.setMinutes(0);this.setSeconds(0);this.setMilliseconds(0);return this;};Date.prototype.clearDate=function(){this.setYear(1970);this.setMonth(0);this.setDate(1);return this;};Date.prototype.isLeapYear=function(){var y=this.getFullYear();return(((y%4===0)&&(y%100!==0))||(y%400===0));};Date.prototype.getDaysInMonth=function(){return Date.getDaysInMonth(this.getFullYear(),this.getMonth());};Date.prototype.moveToFirstDayOfMonth=function(){return this.set({day:1});};Date.prototype.moveToLastDayOfMonth=function(){return this.set({day:this.getDaysInMonth()});};Date.prototype.moveToDayOfWeek=function(day,orient){var diff=(day-this.getDay()+7*(orient||0))%7;return this.addDays((diff==0)?(diff+7*(orient||0)):diff);};Date.prototype.moveToMonth=function(month,orient){var diff=(month-this.getMonth()+12*(orient||0))%12;return this.addMonths((diff==0)?(diff+12*(orient||0)):diff);};Date.prototype.getDayOfYear=function(){return Math.floor((this-new Date(this.getFullYear(),0,1))/86400000);};Date.prototype.getWeekOfYear=function(firstDayOfWeek){var y=this.getFullYear(),m=this.getMonth(),d=this.getDate();var dow=firstDayOfWeek||CultureInfo.Date.firstDayOfWeek;var offset=7+1-new Date(y,0,1).getDay();if(offset==8){offset=1;}
var daynum=((Date.UTC(y,m,d,0,0,0)-Date.UTC(y,0,1,0,0,0))/86400000)+1;var w=Math.floor((daynum-offset+7)/7);if(w===dow){y--;var prevOffset=7+1-new Date(y,0,1).getDay();if(prevOffset==2||prevOffset==8){w=53;}else{w=52;}}
return w;};Date.isDST=function(date,timeOffset)
{var month=date.getMonth();if(timeOffset>=240)
{if(month<2)return false;if(month==2)
{var date2=date.clone();if(date2.getDay()!=0)date2.moveToDayOfWeek(0,-1);date2.moveToDayOfWeek(0,-1);return date2.getMonth()==month;}
if(month<10)return true;if(month==10)
{var date2=date.clone();if(date2.getDay()!=0)date2.moveToDayOfWeek(0,-1);return date2.getMonth()!=month;}
return false;}
else
{if(month<2)return false;if(month==2)
{return date.clone().moveToDayOfWeek(0,+1).getMonth()!=month;}
if(month<9)return true;if(month==9)
{return date.clone().moveToDayOfWeek(0,+1).getMonth()==month;}
return false;}}
Date.prototype.setTimezoneOffset=function(offset,checkDST){var here=this.getTimezoneOffset(),there=Number(offset);if(checkDST&&Date.isDST(this,offset))there-=60;this.addMinutes(here-there);return this;};Date.prototype.setTimezone=function(s,checkDST){return this.setTimezoneOffset(Number(Date.getTimezoneOffset(s))*-6/10,checkDST);};Date.prototype.getUTCOffset=function(){var n=this.getTimezoneOffset()*-10/6,r;if(n<0){r=(n-10000).toString();return r[0]+r.substr(2);}else{r=(n+10000).toString();return"+"+r.substr(1);}};Date.prototype.getDayName=function(abbrev){return abbrev?CultureInfo.Date.abbreviatedDayNames[this.getDay()]:CultureInfo.Date.dayNames[this.getDay()];};Date.prototype.getMonthName=function(abbrev){return abbrev?CultureInfo.Date.abbreviatedMonthNames[this.getMonth()]:CultureInfo.Date.monthNames[this.getMonth()];};Date.prototype._toString=Date.prototype.toString;Date.prototype.toString=function(format){var self=this.toUserZone();var p=function p(s){return(s.toString().length==1)?"0"+s:s;};return format?format.replace(/dd?d?d?|MM?M?M?|yy?y?y?|hh?|HH?|mm?|ss?|tt?|zz?z?/g,function(format){switch(format){case"hh":return p(self.getHours()<13?self.getHours():(self.getHours()-12));case"h":return self.getHours()<13?self.getHours():(self.getHours()-12);case"HH":return p(self.getHours());case"H":return self.getHours();case"mm":return p(self.getMinutes());case"m":return self.getMinutes();case"ss":return p(self.getSeconds());case"s":return self.getSeconds();case"yyyy":return self.getFullYear();case"yy":return self.getFullYear().toString().substring(2,4);case"dddd":return self.getDayName();case"ddd":return self.getDayName(true);case"dd":return p(self.getDate());case"d":return self.getDate().toString();case"MMMM":return self.getMonthName();case"MMM":return self.getMonthName(true);case"MM":return p((self.getMonth()+1));case"M":return self.getMonth()+1;case"t":return self.getHours()<12?CultureInfo.Date.amDesignator.substring(0,1):CultureInfo.Date.pmDesignator.substring(0,1);case"tt":return self.getHours()<12?CultureInfo.Date.amDesignator:CultureInfo.Date.pmDesignator;case"zzz":case"zz":case"z":return"";}}):this._toString();};Date.prototype.toUserZone=function()
{var date=this.clone();if(wl.TimeZoneOffset!=null){date.setTimezoneOffset(wl.TimeZoneOffset,true);}
return date;};Date.prototype.fromUserZone=function()
{var date=this.clone();if(wl.TimeZoneOffset!=null)
{var here=date.getTimezoneOffset(),there=Number(wl.TimeZoneOffset);if(Date.isDST(date,wl.TimeZoneOffset))there-=60;date.addMinutes(there-here);}
return date;};(function(){Date.Parsing={Exception:function(s){this.message="Parse error at '"+s.substring(0,10)+" ...'";}};var $P=Date.Parsing;var _=$P.Operators={rtoken:function(r){return function(s){var mx=s.match(r);if(mx){return([mx[0],s.substring(mx[0].length)]);}else{throw new $P.Exception(s);}};},token:function(s){return function(s){return _.rtoken(new RegExp("^\s*"+s+"\s*"))(s);};},stoken:function(s){return _.rtoken(new RegExp("^"+s));},until:function(p){return function(s){var qx=[],rx=null;while(s.length){try{rx=p.call(this,s);}catch(e){qx.push(rx[0]);s=rx[1];continue;}
break;}
return[qx,s];};},many:function(p){return function(s){var rx=[],r=null;while(s.length){try{r=p.call(this,s);}catch(e){return[rx,s];}
rx.push(r[0]);s=r[1];}
return[rx,s];};},optional:function(p){return function(s){var r=null;try{r=p.call(this,s);}catch(e){return[null,s];}
return[r[0],r[1]];};},not:function(p){return function(s){try{p.call(this,s);}catch(e){return[null,s];}
throw new $P.Exception(s);};},ignore:function(p){return p?function(s){var r=null;r=p.call(this,s);return[null,r[1]];}:null;},product:function(){var px=arguments[0],qx=Array.prototype.slice.call(arguments,1),rx=[];for(var i=0;i<px.length;i++){rx.push(_.each(px[i],qx));}
return rx;},cache:function(rule){var cache={},r=null;return function(s){try{r=cache[s]=(cache[s]||rule.call(this,s));}catch(e){r=cache[s]=e;}
if(r instanceof $P.Exception){throw r;}else{return r;}};},any:function(){var px=arguments;return function(s){var r=null;for(var i=0;i<px.length;i++){if(px[i]==null){continue;}
try{r=(px[i].call(this,s));}catch(e){r=null;}
if(r){return r;}}
throw new $P.Exception(s);};},each:function(){var px=arguments;return function(s){var rx=[],r=null;for(var i=0;i<px.length;i++){if(px[i]==null){continue;}
try{r=(px[i].call(this,s));}catch(e){throw new $P.Exception(s);}
rx.push(r[0]);s=r[1];}
return[rx,s];};},all:function(){var px=arguments,_=_;return _.each(_.optional(px));},sequence:function(px,d,c){d=d||_.rtoken(/^\s*/);c=c||null;if(px.length==1){return px[0];}
return function(s){var r=null,q=null;var rx=[];for(var i=0;i<px.length;i++){try{r=px[i].call(this,s);}catch(e){break;}
rx.push(r[0]);try{q=d.call(this,r[1]);}catch(ex){q=null;break;}
s=q[1];}
if(!r){throw new $P.Exception(s);}
if(q){throw new $P.Exception(q[1]);}
if(c){try{r=c.call(this,r[1]);}catch(ey){throw new $P.Exception(r[1]);}}
return[rx,(r?r[1]:s)];};},between:function(d1,p,d2){d2=d2||d1;var _fn=_.each(_.ignore(d1),p,_.ignore(d2));return function(s){var rx=_fn.call(this,s);return[[rx[0][0],r[0][2]],rx[1]];};},list:function(p,d,c){d=d||_.rtoken(/^\s*/);c=c||null;return(p instanceof Array?_.each(_.product(p.slice(0,-1),_.ignore(d)),p.slice(-1),_.ignore(c)):_.each(_.many(_.each(p,_.ignore(d))),px,_.ignore(c)));},set:function(px,d,c){d=d||_.rtoken(/^\s*/);c=c||null;return function(s){var r=null,p=null,q=null,rx=null,best=[[],s],last=false;for(var i=0;i<px.length;i++){q=null;p=null;r=null;last=(px.length==1);try{r=px[i].call(this,s);}catch(e){continue;}
rx=[[r[0]],r[1]];if(r[1].length>0&&!last){try{q=d.call(this,r[1]);}catch(ex){last=true;}}else{last=true;}
if(!last&&q[1].length===0){last=true;}
if(!last){var qx=[];for(var j=0;j<px.length;j++){if(i!=j){qx.push(px[j]);}}
p=_.set(qx,d).call(this,q[1]);if(p[0].length>0){rx[0]=rx[0].concat(p[0]);rx[1]=p[1];}}
if(rx[1].length<best[1].length){best=rx;}
if(best[1].length===0){break;}}
if(best[0].length===0){return best;}
if(c){try{q=c.call(this,best[1]);}catch(ey){throw new $P.Exception(best[1]);}
best[1]=q[1];}
return best;};},forward:function(gr,fname){return function(s){return gr[fname].call(this,s);};},replace:function(rule,repl){return function(s){var r=rule.call(this,s);return[repl,r[1]];};},process:function(rule,fn){return function(s){var r=rule.call(this,s);return[fn.call(this,r[0]),r[1]];};},min:function(min,rule){return function(s){var rx=rule.call(this,s);if(rx[0].length<min){throw new $P.Exception(s);}
return rx;};}};var _generator=function(op){return function(){var args=null,rx=[];if(arguments.length>1){args=Array.prototype.slice.call(arguments);}else if(arguments[0]instanceof Array){args=arguments[0];}
if(args){for(var i=0,px=args.shift();i<px.length;i++){args.unshift(px[i]);rx.push(op.apply(null,args));args.shift();return rx;}}else{return op.apply(null,arguments);}};};var gx="optional not ignore cache".split(/\s/);for(var i=0;i<gx.length;i++){_[gx[i]]=_generator(_[gx[i]]);}
var _vector=function(op){return function(){if(arguments[0]instanceof Array){return op.apply(null,arguments[0]);}else{return op.apply(null,arguments);}};};var vx="each any all".split(/\s/);for(var j=0;j<vx.length;j++){_[vx[j]]=_vector(_[vx[j]]);}}());Date.checkGrammar=function()
{if(Date.Grammar)return;var flattenAndCompact=function(ax){var rx=[];for(var i=0;i<ax.length;i++){if(ax[i]instanceof Array){rx=rx.concat(flattenAndCompact(ax[i]));}else{if(ax[i]){rx.push(ax[i]);}}}
return rx;};Date.Grammar={};Date.Translator={hour:function(s){return function(){this.hour=Number(s);};},minute:function(s){return function(){this.minute=Number(s);};},second:function(s){return function(){this.second=Number(s);};},meridian:function(s){return function(){this.meridian=s.slice(0,1).toLowerCase();};},timezone:function(s){return function(){var n=s.replace(/[^\d\+\-]/g,"");if(n.length){this.timezoneOffset=Number(n);}else{this.timezone=s.toLowerCase();}};},day:function(x){var s=x[0];return function(){this.day=Number(s.match(/\d+/)[0]);};},month:function(s){return function(){this.month=((s.length==3)?Date.getMonthNumberFromName(s):(Number(s)-1));};},year:function(s){return function(){var n=Number(s);this.year=((s.length>2)?n:(n+(((n+2000)<CultureInfo.Date.twoDigitYearMax)?2000:1900)));};},rday:function(s){return function(){switch(s){case"yesterday":this.days=-1;break;case"tomorrow":this.days=1;break;case"today":this.days=0;break;case"now":this.days=0;this.now=true;break;}};},finishExact:function(x){x=(x instanceof Array)?x:[x];var now=new Date();this.year=now.getFullYear();this.month=now.getMonth();this.day=1;this.hour=0;this.minute=0;this.second=0;for(var i=0;i<x.length;i++){if(x[i]){x[i].call(this);}}
this.hour=(this.meridian=="p"&&this.hour<13)?this.hour+12:this.hour;if(this.day>Date.getDaysInMonth(this.year,this.month)){throw new RangeError(this.day+" is not a valid value for days.");}
var r=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second);if(this.timezone){r.set({timezone:this.timezone});}else if(this.timezoneOffset){r.set({timezoneOffset:this.timezoneOffset});}
return r;},finish:function(x){x=(x instanceof Array)?flattenAndCompact(x):[x];if(x.length===0){return null;}
for(var i=0;i<x.length;i++){if(typeof x[i]=="function"){x[i].call(this);}}
if(this.now){return new Date();}
var today=Date.today();var method=null;var expression=!!(this.days!=null||this.orient||this.operator);if(expression){var gap,mod,orient;orient=((this.orient=="past"||this.operator=="subtract")?-1:1);if(this.weekday){this.unit="day";gap=(Date.getDayNumberFromName(this.weekday)-today.getDay());mod=7;this.days=gap?((gap+(orient*mod))%mod):(orient*mod);}
if(this.month){this.unit="month";gap=(this.month-today.getMonth());mod=12;this.months=gap?((gap+(orient*mod))%mod):(orient*mod);this.month=null;}
if(!this.unit){this.unit="day";}
if(this[this.unit+"s"]==null||this.operator!=null){if(!this.value){this.value=1;}
if(this.unit=="week"){this.unit="day";this.value=this.value*7;}
this[this.unit+"s"]=this.value*orient;}
return today.add(this);}else{if(this.meridian&&this.hour){this.hour=(this.hour<13&&this.meridian=="p")?this.hour+12:this.hour;}
if(this.weekday&&!this.day){this.day=(today.addDays((Date.getDayNumberFromName(this.weekday)-today.getDay()))).getDate();}
if(this.month&&!this.day){this.day=1;}
return today.set(this);}}};var _=Date.Parsing.Operators,g=Date.Grammar,t=Date.Translator,_fn;g.datePartDelimiter=_.rtoken(/^([\s\-\.\,\/\x27]+)/);g.timePartDelimiter=_.stoken(":");g.whiteSpace=_.rtoken(/^\s*/);g.generalDelimiter=_.rtoken(/^(([\s\,]|at|on)+)/);var _C={};g.ctoken=function(keys){var fn=_C[keys];if(!fn){var c=CultureInfo.Date.regexPatterns;var kx=keys.split(/\s+/),px=[];for(var i=0;i<kx.length;i++){px.push(_.replace(_.rtoken(c[kx[i]]),kx[i]));}
fn=_C[keys]=_.any.apply(null,px);}
return fn;};g.ctoken2=function(key){return _.rtoken(CultureInfo.Date.regexPatterns[key]);};g.h=_.cache(_.process(_.rtoken(/^(0[0-9]|1[0-2]|[1-9])/),t.hour));g.hh=_.cache(_.process(_.rtoken(/^(0[0-9]|1[0-2])/),t.hour));g.H=_.cache(_.process(_.rtoken(/^([0-1][0-9]|2[0-3]|[0-9])/),t.hour));g.HH=_.cache(_.process(_.rtoken(/^([0-1][0-9]|2[0-3])/),t.hour));g.m=_.cache(_.process(_.rtoken(/^([0-5][0-9]|[0-9])/),t.minute));g.mm=_.cache(_.process(_.rtoken(/^[0-5][0-9]/),t.minute));g.s=_.cache(_.process(_.rtoken(/^([0-5][0-9]|[0-9])/),t.second));g.ss=_.cache(_.process(_.rtoken(/^[0-5][0-9]/),t.second));g.hms=_.cache(_.sequence([g.H,g.mm,g.ss],g.timePartDelimiter));g.t=_.cache(_.process(g.ctoken2("shortMeridian"),t.meridian));g.tt=_.cache(_.process(g.ctoken2("longMeridian"),t.meridian));g.z=_.cache(_.process(_.rtoken(/^(\+|\-)?\s*\d\d\d\d?/),t.timezone));g.zz=_.cache(_.process(_.rtoken(/^(\+|\-)\s*\d\d\d\d/),t.timezone));g.zzz=_.cache(_.process(g.ctoken2("timezone"),t.timezone));g.timeSuffix=_.each(_.ignore(g.whiteSpace),_.set([g.tt,g.zzz]));g.time=_.each(_.optional(_.ignore(_.stoken("T"))),g.hms,g.timeSuffix);g.d=_.cache(_.process(_.each(_.rtoken(/^([0-2]\d|3[0-1]|\d)/),_.optional(g.ctoken2("ordinalSuffix"))),t.day));g.dd=_.cache(_.process(_.each(_.rtoken(/^([0-2]\d|3[0-1])/),_.optional(g.ctoken2("ordinalSuffix"))),t.day));g.ddd=g.dddd=_.cache(_.process(g.ctoken("sun mon tue wed thu fri sat"),function(s){return function(){this.weekday=s;};}));g.M=_.cache(_.process(_.rtoken(/^(1[0-2]|0\d|\d)/),t.month));g.MM=_.cache(_.process(_.rtoken(/^(1[0-2]|0\d)/),t.month));g.MMM=g.MMMM=_.cache(_.process(g.ctoken("jan feb mar apr may jun jul aug sep oct nov dec"),t.month));g.y=_.cache(_.process(_.rtoken(/^(\d\d?)/),t.year));g.yy=_.cache(_.process(_.rtoken(/^(\d\d)/),t.year));g.yyy=_.cache(_.process(_.rtoken(/^(\d\d?\d?\d?)/),t.year));g.yyyy=_.cache(_.process(_.rtoken(/^(\d\d\d\d)/),t.year));_fn=function(){return _.each(_.any.apply(null,arguments),_.not(g.ctoken2("timeContext")));};g.day=_fn(g.d,g.dd);g.month=_fn(g.M,g.MMM);g.year=_fn(g.yyyy,g.yy);g.orientation=_.process(g.ctoken("past future"),function(s){return function(){this.orient=s;};});g.operator=_.process(g.ctoken("add subtract"),function(s){return function(){this.operator=s;};});g.rday=_.process(g.ctoken("yesterday tomorrow today now"),t.rday);g.unit=_.process(g.ctoken("minute hour day week month year"),function(s){return function(){this.unit=s;};});g.value=_.process(_.rtoken(/^\d\d?(st|nd|rd|th)?/),function(s){return function(){this.value=s.replace(/\D/g,"");};});g.expression=_.set([g.rday,g.operator,g.value,g.unit,g.orientation,g.ddd,g.MMM]);_fn=function(){return _.set(arguments,g.datePartDelimiter);};g.mdy=_fn(g.ddd,g.month,g.day,g.year);g.ymd=_fn(g.ddd,g.year,g.month,g.day);g.dmy=_fn(g.ddd,g.day,g.month,g.year);g.date=function(s){return((g[CultureInfo.Date.dateElementOrder]||g.mdy).call(this,s));};g.format=_.process(_.many(_.any(_.process(_.rtoken(/^(dd?d?d?|MM?M?M?|yy?y?y?|hh?|HH?|mm?|ss?|tt?|zz?z?)/),function(fmt){if(g[fmt]){return g[fmt];}else{throw Date.Parsing.Exception(fmt);}}),_.process(_.rtoken(/^[^dMyhHmstz]+/),function(s){return _.ignore(_.stoken(s));}))),function(rules){return _.process(_.each.apply(null,rules),t.finishExact);});var _F={};var _get=function(f){return _F[f]=(_F[f]||g.format(f)[0]);};g.formats=function(fx){if(fx instanceof Array){var rx=[];for(var i=0;i<fx.length;i++){rx.push(_get(fx[i]));}
return _.any.apply(null,rx);}else{return _get(fx);}};g._formats=g.formats(["yyyy-MM-ddTHH:mm:ss","ddd, MMM dd, yyyy H:mm:ss tt","ddd MMM d yyyy HH:mm:ss zzz","d"]);g._start=_.process(_.set([g.date,g.time,g.expression],g.generalDelimiter,g.whiteSpace),t.finish);g.start=function(s){try{var r=g._formats.call({},s);if(r[1].length===0){return r;}}catch(e){}
return g._start.call({},s);};}
Date._parse=Date.parse;Date.parse=function(s){var r=null;if(!s){return null;}
try{Date.checkGrammar();r=Date.Grammar.start.call({},s);}catch(e){return null;}
return((r[1].length===0)?r[0]:null);};Date.getParseFunction=function(fx){Date.checkGrammar();var fn=Date.Grammar.formats(fx);return function(s){var r=null;try{r=fn.call({},s);}catch(e){return null;}
return((r[1].length===0)?r[0]:null);};};Date.parseExact=function(s,fx){return Date.getParseFunction(fx)(s);};var FB_VIEW={Icons:1,List:2,Thumbnails:3};var FILE_TYPE={AutoDetect:0,Binary:1,Image:2,Video:3,Flash:4,Html:5,Pdf:6,Xml:7};var CARRIER={FedEx:1,UPS:2,USPS:3,DHL:4,XpressX:5};var USER_GROUP={Administrators:1,CompanyOwners:2,Employees:3,InsuranceAgents:4};var Locale=wl.Class(Object,function(base)
{this.constructor=function()
{base.constructor.call(this);this.id=0;this.type=0;this.en="";this.isHtml=false;}
this.getValue=function(){return this.en||"";}
this.setValue=function(v){this.en=v;}});var File=wl.Class(Object,function(base,type)
{this.constructor=function(id)
{base.constructor.call(this);this.id=id||0;this.folderID=0;this.fileType=FILE_TYPE.Binary;this.name="";this.extension="";this.contentType="";this.size=0;this.lastWriteTime=new Date();this.width=0;this.height=0;this.title="";}
this.getSizeString=function()
{var size=this.size;var unit="bytes";if(size>1024){size=size/1024;unit="KB";}
if(size>1024){size=size/1024;unit="MB";}
if(size>1024){size=size/1024;unit="GB";}
return wl.Utils.floatToString(size,2,true,true,CultureInfo.Number.groupSeparator,CultureInfo.Number.decimalSeparator)+" "+unit;}
type.resize=function(width,height,maxWidth,maxHeight,getByMax,enlarge)
{if(width&&height)
{var kW=maxWidth/width;var kH=maxHeight/height;var k=getByMax?Math.max(kW,kH):Math.min(kW,kH);if(k<1||enlarge)
{width=parseInt(width*k);height=parseInt(height*k);}}
return{width:width,height:height};}});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());break;}}
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){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());break;}}}}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());break;}}}}
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(o.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;}}
wl.alert=function(text,p)
{if(!p)p={};if(p.title==null)p.title="System information";if(p.mode==null)p.mode=wl.Mode.OK;if(wl.messageBox==null&&document!=null&&document.forms.length!=0)
{wl.messageBox=new wl.MessageBox();wl.messageBox.create();}
if(wl.messageBox&&wl.test_popup_show(wl.$(wl.messageBox.c_id)))
{wl.messageBox.init(text,p.title,p.mode,p.defaultValue,p.mask,p.handler);wl.popup_show(wl.$(wl.messageBox.c_id),{closeWithClick:p.mode>=0});}
else
{var result=null;switch(p.mode)
{case wl.Mode.OK:window.alert(text);break;case wl.Mode.OKCancel:result=window.confirm(text)?wl.Result.OK:wl.Result.Cancel;break;case wl.Mode.YesNo:case wl.Mode.YesNoCancel:result=window.confirm(text)?wl.Result.Yes:wl.Result.No;break;case wl.Mode.Prompt:result=window.prompt(text,p.defaultValue);break;}
if(p.handler)p.handler(result);}}
wl.confirm=function(text,p)
{if(!p)p={};p.mode=wl.Mode.YesNo;if(p.handler){var h=p.handler;p.handler=function(result){h(result==wl.Result.Yes);}}
wl.alert(text,p);}
wl.prompt=function(text,p){if(!p)p={};if(p.defaultValue==null)p.defaultValue="";p.mode=wl.Mode.Prompt;wl.alert(text,p);}
wl.Mode={OK:0,OKCancel:1,YesNo:2,YesNoCancel:3,Prompt:4};wl.Result={OK:0,Cancel:1,Yes:2,No:3};wl.MessageBox=wl.Class(Object,function(base,type)
{this.constructor=function()
{this.handler=null;this.mode=0;}
this.create=function()
{var container=wl.$e("div");container.className="message-box popup-zone";this.c_id=wl.uniqueID(container);document.body.insertBefore(container,document.body.firstChild);this.info=wl.$e("div");this.info.className="message-info";container.appendChild(this.info);this.text=wl.$e("input");this.text.type="text";this.text.className="message-input";container.appendChild(this.text);var buttons=wl.$e("div");buttons.className="message-buttons";container.appendChild(buttons);this.btn_cancel=createButton(wl.S(15)||"Cancel",this.close.bind(this,wl.Result.Cancel));buttons.appendChild(this.btn_cancel);this.btn_ok=createButton(wl.S(10)||"OK",this.close.bind(this,wl.Result.OK));buttons.appendChild(this.btn_ok);this.btn_no=createButton(wl.S(12)||"No",this.close.bind(this,wl.Result.No));buttons.appendChild(this.btn_no);this.btn_yes=createButton(wl.S(11)||"Yes",this.close.bind(this,wl.Result.Yes));buttons.appendChild(this.btn_yes);wl.Utils.enter_action(this.text,default_enter_action.bind(this));}
var createButton=function(text,handler)
{var a=wl.$e("a");a.href="#";a.className="button default-button";a.title=text;a.onclick=handler?a_close.bind(handler):null;var b=wl.$e("b");var bb=wl.$e("b");var bbb=wl.$e("b");bbb.appendChild(document.createTextNode(text));bb.appendChild(bbb);b.appendChild(bb);a.appendChild(b);return a;}
var a_close=function(e){this();wl.getEvent(e).stop();return false;}
var on_focus=function(){this.style.borderWidth="0px";}
var on_blur=function(){this.style.borderWidth="0px";}
var default_enter_action=function(){this.close(wl.Result.OK);}
this.init=function(text,title,mode,defaultValue,mask,handler)
{this.mode=mode;this.handler=handler;this.btn_yes.style.display="none";this.btn_no.style.display="none";this.btn_cancel.style.display="none";this.btn_ok.style.display="none";this.text.style.display="none";this.info.innerHTML=text;var defaultFocus=null;switch(mode)
{case wl.Mode.Prompt:this.text.value=defaultValue;if(mask)wl.mask_attach(this.text,mask,defaultValue);this.text.style.display="";this.btn_cancel.style.display="";this.btn_ok.style.display="";defaultFocus=textFocus;break;case wl.Mode.OKCancel:this.btn_cancel.style.display="";case wl.Mode.OK:this.btn_ok.style.display="";defaultFocus=okFocus;break;case wl.Mode.YesNoCancel:this.btn_cancel.style.display="";case wl.Mode.YesNo:this.btn_no.style.display="";this.btn_yes.style.display="";defaultFocus=yesFocus;break;}
if(defaultFocus)window.setTimeout(defaultFocus,0);}
var textFocus=function(){try{wl.messageBox.text.select();}catch(e){}}
var okFocus=function(){try{wl.messageBox.btn_ok.focus();}catch(e){}}
var yesFocus=function(){try{wl.messageBox.btn_yes.focus();}catch(e){}}
this.close=function(result)
{if(this.mode==wl.Mode.Prompt)
{if(result==wl.Result.OK)
result=this.text.value;else result=null;}
wl.popup_hide();if(this.handler)this.handler(result);}});wl.popupzones=[];wl.popup_show=function(p,options){if(!wl.createPopup())return false;return wl.popup_show(p,options);}
wl.test_popup_show=function(p){return document!=null&&document.forms.length!=0&&wl.popupzones.indexOf(p)==-1;}
wl.createPopup=function()
{if(typeof(wl.popup_hide)=="function")return true;if(document==null||document.forms.length==0)return false;var backzone=wl.$e("div");backzone.className="popup-backzone";var iframe=null;var options=null;if(!wl.browser.option.cssPositionFixed)
{backzone.style.position="absolute";wl._updateScrollBackzone=function()
{var s=wl.Utils.getBodyScroll();backzone.style.left=s.scrollLeft+"px";backzone.style.top=s.scrollTop+"px";wl.popupzones.each(function(p)
{if(p.options.fixed_left==null)return;p.style.left=(s.scrollLeft+p.options.fixed_left)+"px";p.style.top=(s.scrollTop+p.options.fixed_top)+"px";});}
wl._updateResizeBackzone=function()
{var body=wl.Utils.getBodyScroll();backzone.style.width=body.clientWidth+"px";backzone.style.height=body.clientHeight+"px";};}
if(wl.browser.option.selectOpacityBag)
{iframe=wl.$e("iframe");iframe.src="";iframe.style.filter="alpha(opacity:0)";iframe.style.width="100%";iframe.style.height="100%";iframe.scrolling="no";iframe.frameBorder="no";backzone.appendChild(iframe);}
document.body.insertBefore(backzone,document.body.firstChild);var closeWithClick=function(){if(options.closeWithClick)wl.popup_hide();}
var popup_esc_listener=function(e){if(wl.getEvent(e).keyCode==27)closeWithClick();}
var noDragElements=["INPUT","TEXTAREA","SELECT","A","LABEL","OBJECT","EMBED"];var popup_mouse_down=function(e)
{e=wl.getEvent(e);var p=e.target;if(options.noDragContent)
{if(wl.popupzones.indexOf(p)==-1)return;}
else
{while(p&&wl.popupzones.indexOf(p)==-1)
{if(p.tagName&&noDragElements.indexOf(p.tagName.toUpperCase())!=-1)return;p=p.parentNode;}}
if(wl.browser.ie){if(e.button!=1)return;}
else{if(e.button!=0)return;}
while(p&&wl.popupzones.indexOf(p)==-1)p=p.parentNode;var c=wl.Utils.getMouseCoords(e);var o=wl.Utils.getOffset(p);var bc={x:c.x-o.left,y:c.y-o.top};var mousemove=function(e)
{if(p==null){dragend();return;}
e=wl.getEvent(e);wl.Utils.clear_selection();var coords=wl.Utils.getMouseCoords(e);coords.y-=bc.y;coords.x-=bc.x;if(p.options.relativeElement==null)
{var s=wl.Utils.getBodyScroll();coords.y=Math.middle(coords.y-s.scrollTop,0,s.clientHeight-p.offsetHeight);coords.x=Math.middle(coords.x-s.scrollLeft,0,s.clientWidth-p.offsetWidth);if(p.options.fixed_top!=null)
{p.options.fixed_top=coords.y;p.options.fixed_left=coords.x;coords.y+=s.scrollTop;coords.x+=s.scrollLeft;}}
p.style.top=coords.y+"px";p.style.left=coords.x+"px";return false;}
var dragend=function(e)
{p=null;wl.Utils.clear_selection();wl.detachEvent(document,"mouseup",dragend);wl.detachEvent(document,"mousemove",mousemove);if(iframe)
wl.detachEvent(iframe.contentWindow.document,"mousemove",mousemove);}
wl.attachEvent(document,"mouseup",dragend);wl.attachEvent(document,"mousemove",mousemove);if(iframe)
wl.attachEvent(iframe.contentWindow.document,"mousemove",mousemove);e.stop();return true;}
var updateBackzone=function()
{backzone.style.zIndex=wl.popupzones.length<<1;var opacity=0;wl.popupzones.each(function(p){if(opacity<p.options.opacity)opacity=p.options.opacity;});backzone.style.filter="alpha(opacity:"+opacity+")";backzone.style.opacity=opacity/100;}
wl.popup_hide=function()
{var p=wl.popupzones.splice(wl.popupzones.length-1,1)[0];if(p==null)return;if(!p.options.noDrag)wl.detachEvent(p,"mousedown",popup_mouse_down);p.style.display="none";updateBackzone();if(wl.popupzones.length==0)
{wl.detachEvent(document,"keypress",popup_esc_listener);backzone.onclick=null;if(iframe)
iframe.contentWindow.document.onclick=null;if(!wl.browser.option.cssPositionFixed)
{wl.detachEvent(window,"scroll",wl._updateScrollBackzone);wl.detachEvent(window,"resize",wl._updateResizeBackzone);}
backzone.style.display="none";}}
wl.is_popup_show=function(p){return wl.popupzones.indexOf(p)!=-1;}
wl.popup_show=function(p,opt)
{if(wl.popupzones.indexOf(p)!=-1)return false;options=opt||{};if(typeof(options.opacity)=="undefined")options.opacity=50;if(typeof(options.noDragContent)=="undefined")options.noDragContent=true;p.options=options;wl.popupzones.push(p);wl.Utils.addCss(p,"popup-zone");if(!wl.browser.option.cssPositionFixed||options.relativeElement)p.style.position="absolute";updateBackzone();if(wl.popupzones.length==1)
{wl.attachEvent(document,"keydown",popup_esc_listener);backzone.onclick=closeWithClick;if(iframe)
iframe.contentWindow.document.onclick=closeWithClick;backzone.style.display="block";if(!wl.browser.option.cssPositionFixed)
{wl.attachEvent(window,"resize",wl._updateResizeBackzone);wl.attachEvent(window,"scroll",wl._updateScrollBackzone);}}
p.style.display="block";p.style.zIndex=(wl.popupzones.length<<1)+1;if(!options.noDrag)wl.attachEvent(p,"mousedown",popup_mouse_down);if(options.relativeElement)
{var o=wl.Utils.getOffset(options.relativeElement);var ps=options.relativePosition||"auto";switch(ps)
{case"t":case"top":case"tl":case"tr":options.y=o.top-p.offsetHeight;break;default:options.y=o.top+o.height;break;}
switch(ps)
{case"l":case"left":case"tl":case"bl":options.x=o.left+o.width-p.offsetWidth;break;default:options.x=o.left;break;}}
else
{var body=wl.Utils.getBodyScroll();if(options.y==null)options.y=Math.max(0,Math.ceil((body.clientHeight-p.offsetHeight)/2));if(options.x==null)options.x=Math.max(0,Math.ceil((body.clientWidth-p.offsetWidth)/2));options.y=Math.middle(0,options.y,body.clientHeight-p.offsetHeight);options.x=Math.middle(0,options.x,body.clientWidth-p.offsetWidth);if(!wl.browser.option.cssPositionFixed)
{p.options.fixed_top=options.y;p.options.fixed_left=options.x;window.setTimeout(wl._updateScrollBackzone,0);window.setTimeout(wl._updateResizeBackzone,0);}}
p.style.top=options.y+"px";p.style.left=options.x+"px";return true;}
return true;}
wl.Guid=wl.Class(Object,function(base,type)
{this.constructor=function(str)
{if(!str){this.a=this.b=this.c=this.d=this.e=0;return;}
wl.Guid.regexp.lastIndex=0;var items=wl.Guid.regexp.exec(str);this.a=parseInt(items[1],16);this.b=parseInt(items[2],16);this.c=parseInt(items[3],16);this.d=parseInt(items[4],16);this.e=parseInt(items[5],16);}
this.constructor.Null=new this.constructor(null);this.constructor.regexp=/\b([0-9|a-f]{8})\-([0-9|a-f]{4})\-([0-9|a-f]{4})\-([0-9|a-f]{4})\-([0-9|a-f]{12})\b/ig;this.constructor.newGuid=function()
{var guid=new wl.Guid();guid.a=Math.floor(Math.random()*0xFFFFFFFF);guid.b=Math.floor(Math.random()*0xFFFF);guid.c=Math.floor(Math.random()*0xFFFF);guid.d=Math.floor(Math.random()*0xFFFF);guid.e=Math.floor(Math.random()*0xFFFFFFFFFFFF);return guid;}
this.equals=function(guid)
{return this.a==guid.a&&this.b==guid.b&&this.c==guid.c&&this.d==guid.d&&this.e==guid.e;}
this.toString=function()
{var guid=[];guid.push(this.a.toHexString(8));guid.push(this.b.toHexString(4));guid.push(this.c.toHexString(4));guid.push(this.d.toHexString(4));guid.push(this.e.toHexString(12));return"{"+guid.join('-')+"}";}
this.isNull=function()
{return this.a==0&&this.b==0&&this.c==0&&this.d==0;}
this.write=function(writer){writer.write(this.toString())}});wl.Cookie=wl.Class(Object,function()
{this.constructor=function(key)
{this.key=key||"";}
this.set=function(name,value,expires)
{if(expires instanceof Date)expires=expires.toGMTString();document.cookie=String.format("{0}{1}={2}{3}",this.key,name,escape(value),expires?("; expires="+expires):"");}
this.get=function(name)
{var name=this.key+name;var cookies=document.cookie.split("; ");for(var i=0;i<cookies.length;++i)
{var crumb=cookies[i].split("=");if(name==crumb[0])
return crumb.length>1?unescape(crumb[1]):"";}
return null;}
this.remove=function(name)
{document.cookie=String.format("{0}{1}=; expires=Fri, 31 Dec 1999 23:59:59 GMT;",this.key,name);}});wl.Time=wl.Class(Object,function()
{this.constructor=function(t)
{this.time=t||0;}
this.reset=function(d,h,m,s)
{d=d||0;h=h||0;m=m||0;s=s||0;this.time=d*86400+h*3600+m*60+s;}
this.valueOf=function(){return this.time;}
this.clearDays=function(){this.time=this.time%86400;}
this.getTotalDays=function(){return Math.floor(this.time/86400);}
this.getTotalHours=function(){return Math.floor(this.time/3600);}
this.getTotalMinutes=function(){return Math.floor(this.time/60);}
this.getTotalSeconds=function(){return this.time;}
this.getHour=function(){return Math.floor((this.time%86400)/3600);}
this.getMin=function(){return Math.floor((this.time%3600)/60);}
this.getSec=function(){return this.time%60;}
this.addSec=function(s){this.time+=s;}
this.addMin=function(m){this.time+=m*60;}
this.addHour=function(h){this.time+=h*3600;}
this.toString=function(format)
{if(!format)format="H:mm:ss";return format.replace(/dd?|DD?|hh?|HH?|mm?|MM?|ss?/g,formatter.bind(this));}
var p=function(s){return(s.toString().length==1)?"0"+s:s;}
var formatter=function(format)
{switch(format)
{case"hh":return p(this.getHour());case"h":return this.getHour();case"HH":return p(this.getTotalHours());case"H":return this.getTotalHours();case"mm":return p(this.getMin());case"m":return this.getMin();case"MM":return p(this.getTotalMinutes());case"M":return this.getTotalMinutes();case"ss":return p(this.getSec());case"s":return this.getSec();case"DD":case"dd":return p(this.getTotalDays());case"D":case"d":return this.getTotalDays();}}});wl.ElementsPool=wl.Class(Object,function()
{this.constructor=function()
{var pool=wl.$e("div");pool.style.display="none";pool.style.width=pool.style.height="1px";document.forms[0].insertBefore(pool,document.forms[0].firstChild);this.p_id=wl.uniqueID(pool);}
this.put=function(el){if(el.parentNode)el.parentNode.removeChild(el);wl.$(this.p_id).appendChild(el);}
this.get=function(elID){var el=wl.$(elID);el.parentNode.removeChild(el);return el;}
this.putChildren=function(parent){while(parent.firstChild)this.put(parent.firstChild);}});wl.queryElementsPool=function()
{if(window.elementsPool==null)
window.elementsPool=new wl.ElementsPool();return window.elementsPool;}
wl.ResizeManager=wl.Class(Object,function()
{this.constructor=function()
{this.list=[];}
this.attachEvent=function(el,opt,handler)
{if(this.list.some(function(o){return o.el==el&&o.c==handler;}))return;if(!opt)opt={};if(!opt.check)opt.check="both";this.list.push({el:el,w:el.offsetWidth,h:el.offsetHeight,p:opt||{},c:handler});if(this.list.length==1)
{wl.attachEvent(window,"resize",this.check.raise(this));check_timeout.call(this);}
switch(opt.fire)
{case"now":handler();break;case"start":wl.onstart.push(handler);break;case"load":wl.onload.push(handler);break;}}
this.check=function()
{var handlers=[];this.list.each(function(o)
{var h=false;if(["both","width"].indexOf(o.p.check)!=-1&&o.w!=o.el.offsetWidth){o.w=o.el.offsetWidth;h=true;}
if(["both","height"].indexOf(o.p.check)!=-1&&o.h!=o.el.offsetHeight){o.h=o.el.offsetHeight;h=true;}
if(h&&handlers.indexOf(o.c)==-1)handlers.push(o.c);});for(var i=0;i<handlers.length;++i)handlers[i]();}
var check_timeout=function(){this._cc=window.setTimeout(check_timeout.bind(this),1000);this.check();}});wl.resizeManager=new wl.ResizeManager();wl.Controls={};wl.Controls.Control=wl.Class(Object,function()
{this.constructor=function()
{this._disabled=false;wl.attachEvent(window,"unload",this.unload.bind(this));}
this.getContainer=function(){return wl.$(this.c_id);}
this.generate=function(uniqueID)
{this.u_id=uniqueID;this.c_id=uniqueID.split('$').join('_');var c=wl.$(this.c_id);c.control=this;this.ongenerate(c);}
this.generate2=function(c)
{this.c_id=wl.uniqueID(c);c.control=this;this.ongenerate(c);}
this.ongenerate=function(c){}
this.unload=function()
{var c=wl.$(this.c_id);if(c!=null)
{this.onunload();c.control=null;}}
this.onunload=function(){}
this.disable=function(disable)
{if(this._disabled==disable)return;if(!wl.fireEvent(this,"disabling",{disable:disable}).isFalse)
{this._disabled=disable;wl.fireEvent(this,"disable",{disable:disable});this.ondisabled(disable);}}
this.ondisabled=function(disabled){}
this.isDisabled=function(){return this._disabled;}
this.show=function(bShow)
{var c=wl.$(this.c_id);if(c!=null)wl.Utils.setNew(c.style,"display",bShow?"":"none");}});wl.Utils={};wl.Utils_={};wl.Utils.assert=function(){}
wl.attachEvent(document,"keydown",function(e)
{if(e.keyCode==8)
{if(e.target&&e.target.tagName&&e.target.tagName.match(/INPUT|TEXTAREA/i))return;e.stop();return false;}});if(typeof(document.attachEvent)!="undefined")
{document.attachEvent("onclick",function(ev)
{if(ev.type=="click")
{var e=ev.srcElement;if(e&&e.nodeName=="INPUT"&&(e.type=="checkbox"||e.type=="radio"))try{e.blur();}catch(e){}}});}
if(wl.browser.ie)
{wl.Utils.getMouseCoords=function(e)
{var o=wl.Utils.getBodyScroll((e.target||e.srcElement||{}).ownerDocument);return{x:e.clientX+o.scrollLeft-o.clientLeft,y:e.clientY+o.scrollTop-o.clientTop};}}
else
{wl.Utils.getMouseCoords=function(e){return{x:e.pageX,y:e.pageY};}}
wl.Utils.getEventElementOffset=function(e,element)
{var p=wl.Utils.getMouseCoords(e);var o=wl.Utils.getOffset(element);return{left:p.x-o.left,top:p.y-o.top,right:o.left+o.width-p.x-1,bottom:o.top+o.height-p.y-1};}
wl.Utils.enter_action=function(el,action){wl.attachEvent(el,"keypress",wl.Utils_.enter_action.bind(window,action));}
wl.Utils_.enter_action=function(action,e){if(e.keyCode==13){if(action)action(e);e.stop();return false;}}
if(wl.browser.ie)
{wl.Utils.select_action=function(el,action){wl.attachEvent(el,"selectstart",wl.Utils_.select_action.bind(window,action));}
wl.Utils_.select_action=function(action,e){e=wl.getEvent(e);if(action)action(e);return false;}}
else
{wl.Utils.select_action=function(el)
{el.__preventSelection=false;wl.attachEvent(el,"mousemove",wl.Utils_.select_action_mousemove.bind(wl.uniqueID(el)));wl.attachEvent(el,"mousedown",wl.Utils_.select_action_mousedown.bind(wl.uniqueID(el)));}
wl.Utils_.select_action_mousedown=function(e){var el=wl.$(this);if(el)el.__preventSelection=!wl.getEvent(e).target.tagName.match(/INPUT|TEXTAREA/i);}
wl.Utils_.select_action_mousemove=function(e){var el=wl.$(this);if(el&&el.__preventSelection)wl.Utils.clear_selection();}}
wl.Utils.clear_container=function(c){while(c.firstChild)c.removeChild(c.firstChild);}
wl.Utils.clean_container=function(c){for(var i=c.childNodes.length-1;i>=0;--i)if(c.childNodes[i].nodeType!=1)c.removeChild(c.childNodes[i]);}
wl.Utils.select_content=function(el,start,length)
{if(start==null)start=0;if(length==null)length=el.value.length-start;if(el.createTextRange){var range=el.createTextRange();range.moveStart("character",start);range.moveEnd("character",length-el.value.length);range.select();}else if(el.setSelectionRange){el.setSelectionRange(start,length);}}
wl.Utils.clear_selection=function()
{if(window.getSelection){window.getSelection().removeAllRanges();}
else if(document.selection&&document.selection.clear)document.selection.clear();}
wl.Utils.setNew=function(obj,prop,value)
{if(obj[prop]!=value)obj[prop]=value;}
wl.Utils.setNext=function(obj,prop,l)
{if(!(l instanceof Array))l=Array.prototype.slice.call(arguments,2);var i=l.indexOf(obj[prop])+1;if(i>=l.length)i=0;return obj[prop]=l[i];}
wl.Utils.getRequestParams=function()
{if(!window.dialogArguments)window.dialogArguments={}
if(window.location.search!="")
{var p=window.location.search.substring(1).split('&');for(var i=0;i<p.length;++i)
{var param=p[i].split('=');window.dialogArguments[param[0].toLowerCase()]=param[1];}}
return window.dialogArguments;}
wl.Utils.getRadioValue=function(group)
{var buttons=document.forms[0][group];if(buttons!=null)
{if(typeof(buttons.length)!="undefined")
{for(var i=0;i<buttons.length;++i)
if(buttons[i].checked)return buttons[i].value;}
else
{if(buttons.checked)return buttons.value;}}
return null;}
wl.Utils.setRadioValue=function(group,value)
{var buttons=document.forms[0][group];if(buttons!=null)
{if(typeof(buttons.length)!="undefined")
{for(var i=0;i<buttons.length;++i)
buttons[i].checked=buttons[i].value==value;}
else
{buttons.checked=buttons.value==value;}}}
wl.$idmap=function(id){return this.idmap[id]?wl.$(this.idmap[id]):null;}
wl.$$idmap=function(id){return this.idmap[id]?wl.$$(this.idmap[id]):null;}
wl.Utils.isCss=function(el,css)
{return el.className.split(' ').indexOf(css)!=-1;}
wl.Utils.addCss=function(el,css)
{var cls=el.className?el.className.split(' '):[];if(cls.indexOf(css)!=-1)return;cls.push(css);el.className=cls.join(' ');}
wl.Utils.removeCss=function(el,css)
{var cls=el.className?el.className.split(' '):[];var i=cls.indexOf(css);if(i!=-1){cls.removeAt(i);el.className=cls.join(' ');}}
wl.Utils.replaceCss=function(el,css,newCss)
{var cls=el.className?el.className.split(' '):[];var i=cls.indexOf(css);if(i!=-1)cls.removeAt(i);var i=cls.indexOf(newCss);if(i==-1)cls.push(newCss);el.className=cls.join(' ');}
wl.Utils.updateCss=function(el,css,bAdd)
{var cls=el.className?el.className.split(' '):[];var i=cls.indexOf(css);if(bAdd&&i==-1){cls.push(css);el.className=cls.join(' ');}
if(!bAdd&&i!=-1){cls.removeAt(i);el.className=cls.join(' ');}}
wl.inputMasks=[];wl.mask_detach=function(el)
{if(el.__mask_onkeypress)
{wl.detachEvent(el,"keypress",el.__mask_onkeypress);wl.detachEvent(el,"blur",el.__mask_onblur);wl.detachEvent(el,"focus",el.__mask_onfocus);el.__mask_onkeypress=null;el.__mask_onblur=null;el.__mask_onfocus=null;}}
wl.mask_attach=function(el,mask_obj,def_value)
{wl.mask_detach(el);if(typeof(mask_obj)=="string")mask_obj=wl.inputMasks.find(wl.__mask_finder.bind(mask_obj));wl.Utils.assert(!mask_obj,"Input mask undefined");if(!mask_obj)return;if(el.value=="")el.value=def_value!=null?def_value:mask_obj.getDefault();el.value=mask_obj.validate(el.value);el.__mask_onkeypress=wl.__mask_onkeypress.bind(mask_obj);wl.attachEvent(el,"keypress",el.__mask_onkeypress);el.__mask_onfocus=wl.__mask_onfocus.bind(mask_obj);wl.attachEvent(el,"focus",el.__mask_onfocus);el.__mask_onblur=wl.__mask_onblur.bind(mask_obj);wl.attachEvent(el,"blur",el.__mask_onblur);}
wl.__mask_finder=function(it){return this==it.getName();}
wl.__mask_onkeypress=function(e)
{e=wl.getEvent(e);var el=e.target;if(e.which==0)return true;var key=e.which?e.which:e.keyCode;if(e.ctrlKey||e.altKey||(key<41&&key!=32))return true;if(document.selection&&document.selection.createRange){var rng=document.selection.createRange();var rng0=rng.text.length;rng.moveStart('character',-1000000);el.selectionEnd=rng.text.length;el.selectionStart=el.selectionEnd-rng0;}
var str=el.value.substr(0,el.selectionStart)+String.fromCharCode(key)+el.value.substr(el.selectionEnd);if(!this.check(str)){e.stop();return false;}}
wl.__mask_onfocus=function(e){this.focus(wl.getEvent(e).target);}
wl.__mask_onblur=function(e){e=wl.getEvent(e);e.target.value=this.validate(e.target.value);}
wl.InputDouble=wl.Class(Object,function()
{this.constructor=function(name,v,min,max)
{this.name=name;this._v=v;this.min=min;this.max=max;}
this.getName=function(){return this.name;}
this.getDefault=function(){return Math.max(0,this.min);}
this.focus=function(e){if(e.value=="0")e.value="";}
this.check=function(v){if(this._v.indexOf(v)!=-1)return true;var i=Number(v);if(isNaN(i))return false;return Math.middle(this.min,i,this.max)==i;}
this.validate=function(v){return Math.middle(this.min,parseFloat(v)||0,this.max);}});wl.InputInt=wl.Class(Object,function()
{this.constructor=function(name,v,min,max,allowEmpty)
{this.name=name;this.min=min;this.max=max;this._v=v;this.empty=allowEmpty;}
this.getName=function(){return this.name;}
this.getDefault=function(){return this.empty?"":Math.max(this.min,0);}
this.focus=function(e){if(!this.empty&&e.value=="0")e.value="";}
this.check=function(v){if(this._v.indexOf(v)!=-1)return true;var i=parseInt(v);return i.toString()==v&&Math.middle(this.min,i,this.max)==i;}
this.validate=function(v){return(v==""&&this.empty)?v:Math.middle(this.min,parseInt(v)||0,this.max);}});wl.InputMoney=wl.Class(Object,function()
{this.constructor=function(name,v,min,max,fraction)
{this.name=name;this._v=v;this.min=min;this.max=max;this.fraction=fraction;}
this.getName=function(){return this.name;}
this.getDefault=function(){return Math.max(0,this.min).toMoney(this.fraction);}
this.focus=function(e)
{var v=Number.fromMoney(e.value);if(!v)v="";if(e.value!=v){if(wl.browser.ie){var rng=document.selection.createRange();rng.moveStart('textedit',-1);var caret=rng.text.length;var pos=rng.text.split(',').length-1;}
e.value=v;if(wl.browser.ie){rng.move('character',caret-pos);rng.select();}}}
this.check=function(v){if(this._v.indexOf(v)!=-1)return true;var i=Number(v.split(CultureInfo.Currency.groupSeparator).join(''));if(isNaN(i))return false;return Math.middle(this.min,i,this.max)==i;}
this.validate=function(v){return Math.middle(this.min,Number.fromMoney(v)||0,this.max).toMoney(this.fraction);}});wl.inputMasks.push(new wl.InputDouble("double",["","-",CultureInfo.Number.decimalSeparator],-2147483648,2147483647));wl.inputMasks.push(new wl.InputDouble("+double",["",CultureInfo.Number.decimalSeparator],0,2147483647));wl.inputMasks.push(new wl.InputInt("int",["","-"],-2147483648,2147483647,false));wl.inputMasks.push(new wl.InputInt("+int",[""],0,2147483647,false));wl.inputMasks.push(new wl.InputInt("natural",[""],1,2147483647,false));wl.inputMasks.push(new wl.InputInt("digits",[""],0,2147483647,true));wl.inputMasks.push(new wl.InputMoney("money",["",CultureInfo.Currency.decimalSeparator],0,2147483647,2));wl.Utils.floatToString=function(number,fraction,showZero,showSeparator,separatorChar,dotChar,symbol)
{function separate(input,separator)
{var output=[];var len=input.length;for(var i=0;i<len;++i)
{if(i!=0&&(len-i)%3==0)output.push(separator);output.push(input.charAt(i));}
return output.join("");}
if(fraction==null)fraction=0;if(showZero==null)showZero=false;if(showSeparator==null)showSeparator=false;if(separatorChar==null)separatorChar='\'';if(dotChar==null)dotChar='.';if(symbol==null)symbol='';var nums=Math.abs(number).toFixed(fraction).split('.');if(showSeparator)nums[0]=separate(nums[0],separatorChar);if(!showZero)nums[1].trimRight('0');return(number<0?'-':'')+symbol+nums.join(dotChar);}
wl.Utils.setBit=function(flags,bit,state){return state?(flags|bit):(flags&~bit);}
wl.Utils.getBit=function(flags,bit){return(flags&bit)==bit;}
wl.Utils.testEmail=function(email)
{if(!email)return false;wl.Utils_.testEmailRegex.lastIndex=0;return wl.Utils_.testEmailRegex.exec(email)!=null;}
wl.Utils_.testEmailRegex=/\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/ig;(function()
{var initialized=false;var doesNotAddBorder,doesAddBorderForTableAndCells,subtractsBorderForOverflowNotVisible,doesNotIncludeMarginInBodyOffset;var initialize=function()
{if(initialized)return;var body=document.body,container=document.createElement('div'),innerDiv,checkDiv,table,td,prop,bodyMarginTop=body.style.marginTop,html='<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';var rules={position:'absolute',top:0,left:0,margin:0,border:0,width:'1px',height:'1px',visibility:'hidden'};for(prop in rules)container.style[prop]=rules[prop];container.innerHTML=html;body.insertBefore(container,body.firstChild);innerDiv=container.firstChild,checkDiv=innerDiv.firstChild,td=innerDiv.nextSibling.firstChild.firstChild;doesNotAddBorder=(checkDiv.offsetTop!==5);doesAddBorderForTableAndCells=(td.offsetTop===5);innerDiv.style.overflow='hidden',innerDiv.style.position='relative';subtractsBorderForOverflowNotVisible=(checkDiv.offsetTop===-5);body.style.marginTop='1px';doesNotIncludeMarginInBodyOffset=(body.offsetTop===0);body.style.marginTop=bodyMarginTop;body.removeChild(container);initialized=true;}
wl.Utils.getBodyScroll=function(d)
{var b=(d||document).body,e=(d||document).documentElement;return{scrollTop:Math.max(e.scrollTop,b.scrollTop),scrollLeft:Math.max(e.scrollLeft,b.scrollLeft),clientHeight:Math.min(e.clientHeight,b.clientHeight),clientWidth:Math.min(e.clientWidth,b.clientWidth),clientTop:e.clientTop||b.clientTop||0,clientLeft:e.clientLeft||b.clientLeft||0};}
var bodyOffset=function(body)
{initialize();var top=body.offsetTop,left=body.offsetLeft;if(doesNotIncludeMarginInBodyOffset)
{var s=window.getComputedStyle(body,null);top+=parseInt(s.marginTop)||0,left+=parseInt(s.marginLeft)||0;}
return{top:top,left:left};}
if(document.documentElement["getBoundingClientRect"])
{wl.Utils.getOffset=function(e)
{var o;if(!e)o={top:0,left:0};else if(e===e.ownerDocument.body)o=bodyOffset(e);else
{var box=e.getBoundingClientRect(),s=wl.Utils.getBodyScroll(e.ownerDocument);o={top:box.top+s.scrollTop-s.clientTop,left:box.left+s.scrollLeft-s.clientLeft};}
o.width=e.offsetWidth;o.height=e.offsetHeight;return o;}}
else
{wl.Utils.getOffset=function(e)
{var o;if(!e)o={top:0,left:0};else if(e===e.ownerDocument.body)o=bodyOffset(e);else
{initialize();var elem=e,offsetParent=elem.offsetParent,prevOffsetParent=elem,doc=elem.ownerDocument,docElem=doc.documentElement,body=doc.body,prevComputedStyle=window.getComputedStyle(elem,null),top=elem.offsetTop,left=elem.offsetLeft;while((elem=elem.parentNode)&&elem!==body&&elem!==docElem){var computedStyle=window.getComputedStyle(elem,null);top-=elem.scrollTop,left-=elem.scrollLeft;if(elem===offsetParent){top+=elem.offsetTop,left+=elem.offsetLeft;if(doesNotAddBorder&&!(doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(elem.tagName)))
top+=parseInt(computedStyle.borderTopWidth,10)||0,left+=parseInt(computedStyle.borderLeftWidth,10)||0;prevOffsetParent=offsetParent,offsetParent=elem.offsetParent;}
if(subtractsBorderForOverflowNotVisible&&computedStyle.overflow!=="visible")
top+=parseInt(computedStyle.borderTopWidth,10)||0,left+=parseInt(computedStyle.borderLeftWidth,10)||0;prevComputedStyle=computedStyle;}
if(prevComputedStyle.position==="relative"||prevComputedStyle.position==="static")
top+=body.offsetTop,left+=body.offsetLeft;if(prevComputedStyle.position==="fixed")
top+=Math.max(docElem.scrollTop,body.scrollTop),left+=Math.max(docElem.scrollLeft,body.scrollLeft);o={top:top,left:left};}
o.width=e.offsetWidth;o.height=e.offsetHeight;return o;}}})();wl.Utils.attachClickEvent=function(element,clickHandler,dblClickHandler,timeout)
{if(!timeout)timeout=wl.ClickTimeout;if(clickHandler)wl.attachEvent(element,"click",wl.Utils_.attachClickEventHelper1.bind(window,clickHandler,timeout));wl.attachEvent(element,"dblclick",wl.Utils_.attachClickEventHelper3.bind(window,dblClickHandler));}
wl.Utils_.attachClickEventHelper1=function(clickHandler,timeout,e)
{e=wl.getEvent(e);var f=wl.Utils_.attachClickEventHelper2.bind(window,{target:e.target,x:e.x,y:e.y,offsetX:e.offsetX,offsetY:e.offsetY,ctrlKey:e.ctrlKey},clickHandler);e.target.clearClick=window.setTimeout(f,timeout);e.stop();return false;}
wl.Utils_.attachClickEventHelper2=function(e,clickHandler)
{e.stop=function(){};clickHandler(e);e.target=null;}
wl.Utils_.attachClickEventHelper3=function(dblClickHandler,e)
{e=wl.getEvent(e);if(e.target.clearClick)
{window.clearTimeout(e.target.clearClick);e.target.clearClick=null;}
if(dblClickHandler)dblClickHandler(e);e.stop();return false;}
wl.Utils.createHtmlControls=function(td,tags)
{var ctrls=[];var node=td.firstChild;tags.each(function(tag)
{var ctrl=node;while(node&&(node.nodeName.toUpperCase()!=tag.tag.toUpperCase()||(tag.type&&node.type.toLowerCase()!=tag.type.toLowerCase())||(tag.name&&node.name.toLowerCase()!=tag.name.toLowerCase()))){ctrl=node.nextSibling;td.removeChild(node);node=ctrl;}
if(!ctrl)
{ctrl=tag.name?wl.$en(tag.tag,tag.name):wl.$e(tag.tag);if(tag.type)ctrl.type=tag.type;td.appendChild(ctrl);}
for(var p in tag)if(tag.hasOwnProperty(p))
{switch(p)
{case"tag":case"name":case"type":break;case"className":wl.Utils.setNew(ctrl,"className",tag.className);break;case"style":for(var s in tag.style)if(tag.style.hasOwnProperty(s))wl.Utils.setNew(ctrl.style,s,tag.style[s]);break;case"mask":if(tag.mask)wl.mask_attach(ctrl,tag.mask);else wl.mask_detach(ctrl);break;case"text":ctrl.innerHTML="";if(tag.text)ctrl.appendChild(document.createTextNode(tag.text));break;case"options":var refresh=tag.options.length!=ctrl.options.length;if(!refresh){for(var i=0;i<tag.options.length;++i)if(tag.options[i].v!=ctrl.options[i].value){refresh=true;break;}}
if(refresh){wl.Utils.clear_container(ctrl);for(var i=0;i<tag.options.length;++i){var o=wl.$e("option");o.appendChild(document.createTextNode(tag.options[i].t));o.value=tag.options[i].v;ctrl.appendChild(o);}}
break;case"children":wl.Utils.createHtmlControls(ctrl,tag[p]);break;default:ctrl[p]=tag[p];break;}}
ctrls.push(ctrl);node=ctrl.nextSibling;});while(node){var ctrl=node.nextSibling;td.removeChild(node);node=ctrl;}
return ctrls;}
wl.Utils.getHtmlControls=function(td,tags)
{var ctrls=[];var node=td.firstChild;tags.each(function(tag)
{while(node&&(node.nodeName.toUpperCase()!=tag.tag.toUpperCase()||(tag.type&&node.type.toLowerCase()!=tag.type.toLowerCase())||(tag.name&&node.name.toLowerCase()!=tag.name.toLowerCase())))node=node.nextSibling;if(node)ctrls.push(node);});return ctrls;}
wl.Utils.transformTextToHtml=function(t){return t.escapeHTML().replace(/\n/gm,"<br />");}
wl.Utils.selectNumberValue=function(s,v)
{s.value=v;if(s.value!=v)
{for(var i=0;i<s.options.length-1;++i)
if(parseFloat(s.options[i].value)>=v)
{s.selectedIndex=i;return;}
s.selectedIndex=s.options.length-1;}}
wl.Utils.Comparers={string:function(x,y){return(x?x.toLowerCase():'').localeCompare((y?y.toLowerCase():''));},number:function(x,y){if(isNaN(x))return-1;if(isNaN(y))return 1;return x-y;},absnumber:function(x,y){x=Math.abs(x);y=Math.abs(y);if(x==y)return 0;return x>y?1:-1;},boolean:function(x,y){if(x==y)return 0;return x?1:-1;},datetime:function(x,y){if(x.valueOf()==y.valueOf())return 0;return x.valueOf()>y.valueOf()?1:-1;},date:function(x,y){var r=x.getFullYear()-y.getFullYear();if(r==0)r=x.getMonth()-y.getMonth();if(r==0)r=x.getDate()-y.getDate();return r;}};wl.Utils.preloadImages=function(handler)
{var images=[];var cnt=1;var onload=function(){if(--cnt==0&&handler)handler(images);}
var preload=function(src)
{if(src instanceof Array)return src.each(preload);cnt++;var img=new Image();images.push(img);img.onload=onload;img.onerror=onload;img.onabort=onload;img.src=src;};Array.prototype.slice.call(arguments,1).each(preload);onload();}
wl.Utils.getFakeUrl=function(str)
{var sb=[];str.split(/\W+/).each(function(s){if(s)sb.push(s);});return sb.join('-');}
wl.Utils.getScrollStep=function()
{if(wl.browser.ie)return{x:10,y:40};if(wl.browser.gecko)return{x:10,y:13};if(wl.browser.opera)return{x:60,y:60};return{x:40,y:40};}
wl.Utils_.iSH=0;wl.Utils.createHandler=function(handler)
{var name="sh"+(++wl.Utils_.iSH);wl.Utils_[name]=handler;return"wl.Utils_."+name;}
wl.Utils_.msg_cookie=0;wl.message=function()
{var m=wl.$("message");if(!m)return;if(arguments.length==0){wl.Utils.clear_container(m);m.style.visibility="hidden";}
for(var i=0;i<arguments.length;++i)
{if(arguments[i]==null){wl.Utils.clear_container(m);m.style.visibility="hidden";}
else
{var c=wl.$e("div",m);if(typeof(arguments[i])=="string")c.innerHTML=new Date().toString(CultureInfo.Date.formatPatterns.longTime)+": "+arguments[i];else c.appendChild(arguments[i]);m.style.visibility="visible";window.setTimeout(wl.Utils_.msg_hide.bind(wl.uniqueID(c)),10000);}}}
wl.Utils_.msg_hide=function(){var m=wl.$("message");var c=wl.$(this);if(m&&c){m.removeChild(c);if(m.childNodes.length==0)m.style.visibility="hidden";}}
wl.Utils.getCaretPos=function(ta)
{var pos=0,len=0;if(!document.selection)
{pos=ta.selectionStart;len=ta.selectionEnd-ta.selectionStart;}
else
{var sel=document.selection.createRange();var clone=sel.duplicate();len=sel.text.length;sel.collapse(true);clone.moveToElementText(ta);clone.setEndPoint('EndToEnd',sel);pos=clone.text.length;}
return{start:pos,length:len};}
wl.Utils.setCaretPos=function(ta,start,len)
{try{ta.focus();}catch(e){}
if(!document.selection)
{ta.selectionStart=start;ta.selectionEnd=start+len;}
else
{var sel=document.selection.createRange();if(sel.parentElement()==ta)
{sel.moveToElementText(ta);sel.collapse(true);sel.moveEnd("character",start+len);sel.moveStart("character",start);sel.select();}}}
wl.Utils.excludeScripts=function(html,attachScripts,evalScripts)
{if(!attachScripts)attachScripts=[];if(!evalScripts)evalScripts=[];wl.Utils_.exScript.lastIndex=0;return html.replace(wl.Utils_.exScript,function($0,$1,$2)
{if($2)
{evalScripts.push($2);evalScripts.exsID="__exsu"+wl.Utils_.exScriptIdx++;return String.format("<span id='{0}'></span>",evalScripts.exsu);}
wl.Utils_.exScriptLink.lastIndex=0;var src=wl.Utils_.exScriptLink.exec($1);if(src&&src[2])attachScripts.push(src[2]);return"";});}
wl.Utils_.exScriptIdx=0;wl.Utils_.exScript=new RegExp("<script(.*?)>([\\s\\S]*?)</"+"script>","gi");wl.Utils_.exScriptLink=new RegExp("src=\\s*(['\"])(.*?)\\1","i");wl.Utils.runScripts=function(attachScripts,evalScripts)
{var run=function(){if(evalScripts)evalScripts.each(function(s){eval(s.replace(/document.write/g,function(){return(s.exsID&&wl.$(s.exsID))?("wl.$('"+s.exsID+"').innerHTML+="):"";}));});}
if(!attachScripts)attachScripts=[];var ci=0;var inc=function(){if(attachScripts.length==ci)run();else wl.attachScript(attachScripts[ci++],{cache:true,callback:inc});};inc();}
document.createElement("req");wl.Utils.checkRequired=function(container,handler)
{wl.$css("req",container).each(function(r)
{var id=r.id&&r.id.substring("req_".length);if(id)
{var c=wl.$(id);var err=false;if(r.style.visibility!="hidden")
{var v=c?c.value:null;if(v&&c.tagName=="INPUT"&&c.type=="text"&&c.maxLength>0&&v.length>c.maxLength){handler('',v,String.format("Field length cannot exceed {0} characters",c.maxLength));err=true;}
var types=(r.attributes["type"]&&r.attributes["type"].value||"empty").split(',');var messages=r.title.split('\n');var icustom=0;for(var i=0;i<types.length;++i)
{var m=i<messages.length&&messages[i];switch(types[i])
{case"empty":if(c&&v.length==0){handler(id,v,m||String.format(wl.S(610),id));err=true;}break;case"email":if(v&&!wl.Utils.testEmail(v)){handler(id,v,String.format(wl.S(404),v));err=true;}break;case"checked":if(c&&!c.checked){handler(id,v,m||String.format("{0} must be checked",id));err=true;}break;case"custom":if(handler((icustom++>0)?String.format("{0}:{1}",id,icustom):id,v,m||id))err=true;break;}};}
if(c)wl.Utils.updateCss(c,"input_error",err);}});}