Array.prototype.indexOf=function(B){for(var A=0;A<this.length;A++){if(this[A]==B){return A;}}return -1;};Array.prototype.lastIndexOf=function(B){for(var A=this.length-1;A>=0;A--){if(this[A]==B){return A;}}return -1;};Array.prototype.contains=function(A){return this.indexOf(A)!=-1;};Array.prototype.copy=function(){return this.concat();};Array.prototype.insertAt=function(B,A){this.splice(A,0,B);};Array.prototype.insertBefore=function(C,B){var A=this.indexOf(B);if(A==-1){this.push(C);}else{this.splice(A,0,C);}};Array.prototype.insertAfter=function(B,C){var A=this.indexOf(C);if(A==-1){this.push(B);}else{this.splice(A+1,0,B);}};Array.prototype.removeAt=function(A){return this.splice(A,1);};Array.prototype.remove=function(B){var A=this.indexOf(B);while(A!=-1){this.splice(A,1);A=this.indexOf(B);}};Array.prototype.clear=function(){this.length=0;};Array.prototype.isEmpty=function(){return(this.length<=0);};Array.prototype.getLastElement=function(){return this[this.length-1];};Array.prototype.getFirstElement=function(){return this[0];};if(!Array.prototype.forEach){Array.prototype.forEach=function(C,D){var A,B;if(typeof C=="function"){B=this.length;for(A=0;A<B;A++){C.call(D,this[A],A,this);}}return this;};}if(!Array.prototype.find){Array.prototype.find=function(A,D){var B,C,E=[];if(typeof A=="function"){for(B=0;B<this.length;B++){if(A.call(null,this[B],B,this)){if(D){return this[B];}else{E.push(this[B]);}}}}else{return null;}return E;};}if(!Array.prototype.equals){Array.prototype.equals=function(B,A,D){var C;if(this.length!==B.length){return false;}else{if(typeof A=="function"){for(C=0;C<this.length;C++){if(!A.call(D,this[C],B[C],C,this)){return false;}}}else{for(C=0;C<this.length;C++){if(this[C]!==B[C]){return false;}}}}return true;};}Date.monthNames=["January","February","March","April","May","June","July","August","September","October","November","December"];Date.monthAbbreviations=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];Date.dayNames=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];
Date.dayAbbreviations=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];Date.preferAmericanFormat=false;Date.LZ=function(A){return(A<0||A>9?"":"0")+A;};if(!Date.prototype.getFullYear){Date.prototype.getFullYear=function(){var A=this.getYear();return(A<1900?A+1900:A);};}Date.parseString=function(A,V,I){if(typeof (V)=="undefined"||V==null||V==""){var L=["MMM d, y","MMM d,y","y-MMM-d","d-MMM-y","MMM d","MMM-d","d-MMM","MM/DD/YYYY","DD/MM/YYYY","YYYY/MM/DD","yyyy-MM-dd","YYYY-MM-DD"];var C=["M d y","M/d/y","M-d-y","M.d.y","M/d","M-d","MM/DD/YYYY"];var K=["d M y","d/M/y","d-M-y","d.M.y","d/M","d-M","DD/MM/YYYY"];var D=[L,Date.preferAmericanFormat?C:K,Date.preferAmericanFormat?K:C];for(var T=0;T<D.length;T++){var R=D[T];for(var S=0;S<R.length;S++){var W=Date.parseString(A,R[S],I);if(W!=null){return W;}}}return null;}this.isInteger=function(d){for(var c=0;c<d.length;c++){if("1234567890".indexOf(d.charAt(c))==-1){return false;}}return true;};this.getInt=function(j,g,h,f){for(var c=f;c>=h;c--){var d=j.substring(g,g+c);if(d.length<h){return null;}if(this.isInteger(d)){return d;}}return null;};A=A+"";V=V+"";var b=0;var O=0;var Y="";var F="";var a="";var H,G;var J=new Date().getFullYear();var Z=1;var X=1;var B=0;var U=0;var Q=0;var N="";while(O<V.length){Y=V.charAt(O);F="";while((V.charAt(O)==Y)&&(O<V.length)){F+=V.charAt(O++);}if(F=="YYYY"||F=="yyyy"||F=="YY"||F=="yy"||F=="Y"||F=="y"){if(F=="YYYY"||F=="yyyy"){H=4;G=4;}if(F=="YY"||F=="yy"){H=2;G=2;}if(F=="Y"||F=="y"){H=2;G=4;}J=this.getInt(A,b,H,G);if(J==null){return null;}b+=J.length;if(J.length==2){var e=parseInt(parseFloat((new Date()).getFullYear())/100)*100;if(typeof I!="undefined"&&I!=null&&I!=""&&!isNaN(I)){I=parseInt(I);}else{if(typeof I!="undefined"&&I!=null&&String(I).toUpperCase()=="CURRENT YEAR"){I=String((new Date()).getFullYear()).substring(2);I=(I.charAt(0)=="0"?parseInt(I.substring(1)):parseInt(I));}else{I=70;}}if(J>I){J=e-100+(J-0);}else{J=e+(J-0);}}}else{if(F=="MMM"||F=="NNN"){Z=0;var M=(F=="MMM"?(Date.monthNames.concat(Date.monthAbbreviations)):Date.monthAbbreviations);
for(var T=0;T<M.length;T++){var E=M[T];if(A.substring(b,b+E.length).toLowerCase()==E.toLowerCase()){Z=(T%12)+1;b+=E.length;break;}}if((Z<1)||(Z>12)){return null;}}else{if(F=="EE"||F=="E"){var M=(F=="EE"?Date.dayNames:Date.dayAbbreviations);for(var T=0;T<M.length;T++){var P=M[T];if(A.substring(b,b+P.length).toLowerCase()==P.toLowerCase()){b+=P.length;break;}}}else{if(F=="MM"||F=="M"){Z=this.getInt(A,b,F.length,2);if(Z==null||(Z<1)||(Z>12)){return null;}b+=Z.length;}else{if(F=="DD"||F=="dd"||F=="D"||F=="d"){X=this.getInt(A,b,F.length,2);if(X==null||(X<1)||(X>31)){return null;}b+=X.length;}else{if(F=="hh"||F=="h"){B=this.getInt(A,b,F.length,2);if(B==null||(B<1)||(B>12)){return null;}b+=B.length;}else{if(F=="HH"||F=="H"){B=this.getInt(A,b,F.length,2);if(B==null||(B<0)||(B>23)){return null;}b+=B.length;}else{if(F=="KK"||F=="K"){B=this.getInt(A,b,F.length,2);if(B==null||(B<0)||(B>11)){return null;}b+=B.length;B++;}else{if(F=="kk"||F=="k"){B=this.getInt(A,b,F.length,2);if(B==null||(B<1)||(B>24)){return null;}b+=B.length;B--;}else{if(F=="mm"||F=="m"){U=this.getInt(A,b,F.length,2);if(U==null||(U<0)||(U>59)){return null;}b+=U.length;}else{if(F=="ss"||F=="s"){Q=this.getInt(A,b,F.length,2);if(Q==null||(Q<0)||(Q>59)){return null;}b+=Q.length;}else{if(F=="a"||F=="A"){if(A.substring(b,b+2).toLowerCase()=="am"){N="AM";}else{if(A.substring(b,b+2).toLowerCase()=="pm"){N="PM";}else{return null;}}b+=2;}else{if(A.substring(b,b+F.length)!=F){return null;}else{b+=F.length;}}}}}}}}}}}}}}if(b!=A.length){return null;}if(Z==2){if(((J%4==0)&&(J%100!=0))||(J%400==0)){if(X>29){return null;}}else{if(X>28){return null;}}}if((Z==4)||(Z==6)||(Z==9)||(Z==11)){if(X>30){return null;}}if(B<12&&N=="PM"){B=B-0+12;}else{if(B>11&&N=="AM"){B-=12;}}return new Date(J,Z-1,X,B,U,Q);};Date.isValid=function(B,A,C){return(Date.parseString(B,A,C)!=null);};Date.prototype.isBefore=function(A){if(A==null){return false;}return(this.getTime()<A.getTime());};Date.prototype.isAfter=function(A){if(A==null){return false;}return(this.getTime()>A.getTime());
};Date.prototype.isBeforeOrOn=function(A){if(A==null){return false;}return(this.getTime()<=A.getTime());};Date.prototype.isAfterOrOn=function(A){if(A==null){return false;}return(this.getTime()>=A.getTime());};Date.prototype.equals=function(A){if(A==null){return false;}return(this.getTime()==A.getTime());};Date.prototype.equalsIgnoreTime=function(C){if(C==null){return false;}var B=new Date(this.getTime()).clearTime();var A=new Date(C.getTime()).clearTime();return(B.getTime()==A.getTime());};Date.prototype.format=function(a){a=a+"";var J="";var T=0;var e="";var D="";var I=this.getYear()+"";if(I.length<4){I=""+(+I+1900);}var F=this.getMonth();var b=this.getDate();var N=this.getDay();var L=this.getHours();var V=this.getMinutes();var P=this.getSeconds();var R,S,B,Q,f,C,Z,Y,W,O,i,L,g,G,A,X;if(a.toUpperCase()=="UTC"){return Date.UTC(I,F,b,L,V,P);}else{F+=1;}var U=new Object();U["y"]=""+I;U["yyyy"]=I;U["yy"]=I.substring(2,4);U["M"]=F;U["MM"]=Date.LZ(F);U["MMM"]=Date.monthNames[F-1];U["NNN"]=Date.monthAbbreviations[F-1];U["d"]=b;U["dd"]=Date.LZ(b);U["E"]=Date.dayAbbreviations[N];U["EE"]=Date.dayNames[N];U["H"]=L;U["HH"]=Date.LZ(L);if(L==0){U["h"]=12;}else{if(L>12){U["h"]=L-12;}else{U["h"]=L;}}U["hh"]=Date.LZ(U["h"]);U["K"]=U["h"]-1;U["k"]=U["H"]+1;U["KK"]=Date.LZ(U["K"]);U["kk"]=Date.LZ(U["k"]);if(L>11){U["a"]="pm";U["A"]="PM";}else{U["a"]="am";U["A"]="AM";}U["m"]=V;U["mm"]=Date.LZ(V);U["s"]=P;U["ss"]=Date.LZ(P);while(T<a.length){e=a.charAt(T);D="";while((a.charAt(T)==e)&&(T<a.length)){D+=a.charAt(T++);}if(typeof (U[D])!="undefined"){J=J+U[D];}else{J=J+D;}}return J;};Date.prototype.getDayName=function(){return Date.dayNames[this.getDay()];};Date.prototype.getDayAbbreviation=function(){return Date.dayAbbreviations[this.getDay()];};Date.prototype.getMonthName=function(){return Date.monthNames[this.getMonth()];};Date.prototype.getMonthAbbreviation=function(){return Date.monthAbbreviations[this.getMonth()];};Date.prototype.clearTime=function(){this.setHours(0);this.setMinutes(0);
this.setSeconds(0);this.setMilliseconds(0);return this;};Date.prototype.add=function(A,C){if(typeof (A)=="undefined"||A==null||typeof (C)=="undefined"||C==null){return this;}C=+C;if(A=="y"){this.setFullYear(this.getFullYear()+C);}else{if(A=="M"){this.setMonth(this.getMonth()+C);}else{if(A=="d"){this.setDate(this.getDate()+C);}else{if(A=="w"){var B=(C>0)?1:-1;while(C!=0){this.add("d",B);while(this.getDay()==0||this.getDay()==6){this.add("d",B);}C-=B;}}else{if(A=="h"){this.setHours(this.getHours()+C);}else{if(A=="m"){this.setMinutes(this.getMinutes()+C);}else{if(A=="s"){this.setSeconds(this.getSeconds()+C);}}}}}}}return this;};Date.prototype.secondsBetween=function(A){return(this-A)/1000;};Date.prototype.minutesBetween=function(A){return(this-A)/1000/60;};Date.prototype.hoursBetween=function(A){return(this-A)/1000/60/60;};Date.prototype.daysBetween=function(A){return(this-A)/1000/60/60/24;};String.prototype.trim=function(){return this.replace(/^\s*|\s*$/g,"");};String.prototype.startsWith=function(A){return(this.indexOf(A)==0);};String.prototype.endsWith=function(B){var A=this.length-B.length;if(A<0){return false;}return(this.lastIndexOf(B,A)==A);};String.prototype.equals=function(A){return this==A;};String.prototype.equalsIgnoreCase=function(A){return this.toUpperCase()==A.toUpperCase();};String.prototype.contains=function(A){return(this.indexOf(A)!=-1);};String.prototype.isEmpty=function(){var A=/^\s+$/;return(this.length==0||A.test(this));};String.prototype.initCap=function(){return this.substr(0,1).toUpperCase()+this.substr(1);};String.prototype.isAlpha=function(){return/[A-Za-z]/.test(this);};String.prototype.isNumber=function(){return/\d/.test(this);};String.prototype.isAlphaNumeric=function(){return/[a-zA-Z0-9]/.test(this);};String.prototype.parseBoolean=function(){return new RegExp("y|yes|true","gi").test(this);};String.prototype.convertUnicodeToHtmlEntities=function(){var C="";try{for(var A=0;A<this.length;A++){if(this.charCodeAt(A)>127||this.charAt(A)==">"||this.charAt(A)=="<"){C+="&#"+this.charCodeAt(A)+";";
}else{C+=this.charAt(A);}}}catch(B){C=this;}return C;};String.prototype.convertHtmlEntitiesToUnicode=function(){var E="";try{for(var C=0;C<this.length;C++){if(this.charAt(C)=="&"&&this.charAt(C+1)=="#"){var B="";var A=C+2;while(this.charAt(A)!=";"&&!isNaN(parseInt(this.charAt(A)))){B+=this.charAt(A);A++;}if(this.charAt(A)==";"){E+=String.fromCharCode(parseInt(B));C=A;}else{E+=this.charAt(C);}}else{E+=this.charAt(C);}}}catch(D){E=this;}return E;};String.prototype.removeHtml=function(){var A=document.createElement("div");A.innerHTML=this;var B;if(A.innerText){B=A.innerText;}else{B=A.textContent;}delete A;return B;};