﻿//-->
System.Class.RegisterNamespace("System.Text");System.Class.RegisterNamespace("System.Text.RegularExpressions.Templates");System.Text.RegularExpressions.Templates.Email=new RegExp("^[A-Z0-9_%-]+(|([\.][A-Z0-9_%-]+)+)@[A-Z0-9_%-]+(|([\.][A-Z0-9_%-]+)+)$","i");System.Text.RegularExpressions.Templates.EmailStrict=new RegExp("^[A-Z0-9_%-]+(|([\.][A-Z0-9_%-]+)+)@[A-Z0-9_%-]+(|([\.][A-Z0-9_%-]+)+)[\.](([0-9]{1,3})|([A-Z]{2,3})|(aero|coop|info|museum|name))$","i");System.Text.RegularExpressions.GetByTag=function(tagName,ignoreCase){var regex=new RegExp("<\s*"+tagName+"[^>]*>(.*?)<\s*/"+tagName+"\s*>","g");regex.ignoreCase=(ignoreCase==true);return regex;};System.Text.RegularExpressions.GetMatch=function(text,matchPattern,variable){var results=new String;if(variable==null)variable="$1";var regex=new RegExp(matchPattern);if(text.match(regex)!=null){var textMatch=text.match(regex)[0];var results=textMatch.replace(regex,variable);}return results;};System.Text.RegularExpressions.GetEscapedPattern=function(s){var pattern=new String();for(var i=0;i<s.length;i++){var hex=s.charCodeAt(i).toString(16);pattern+="\\u"+"0000".substr(0,4-hex.length)+hex+"";}return pattern;};System.Text.RegularExpressions.Trim=function(text,symbols,escapePattern){if(!symbols)symbols=" ";var pattern=symbols;if(escapePattern){pattern=System.Text.RegularExpressions.GetEscapedPattern(symbols);}var trimLeft=new RegExp("^["+pattern+"]+","gm");var trimRight=new RegExp("["+pattern+"]+$","gm");var newText=text.replace(trimLeft,"").replace(trimRight,"");return newText;};System.Text.RegularExpressions.Replace=function(text,findPattern,replacePattern,ignoreCase){var text=new String(text);var regexFind=new RegExp(findPattern,"g");var regexRepl=new RegExp(replacePattern);regexFind.ignoreCase=(ignoreCase==true);return text.replace(regexFind,replacePattern);};System.Text.ControlChars={Tab:0x9,Vt:0xB,Ff:0xC,Space:0x20,Lf:0xA,Bs:0x8,Ht:0x9,Dq:0x22,Sq:0x27,Bh:0x5C};System.Text.UtfSignatures={Utf16Le:0xFFFF,Utf16Be:0xFEFF,Utf8:0xEFBBBF};System.Text.StringBuilder=function(value){this.Type="System.Text.StringBuilder";var _parts=new Array();this.Append=function(value){var results=true;if(typeof(value)=='undefined'){results=false;}else{_parts.push(value);}return results;};this.AppendLine=function(value){return this.Append(value+'\r\n');};this.Clear=function(){if(_parts.length>0){_parts.splice(0,_parts.length);}};this.IsEmpty=function(){return(_parts.length==0);};this.ToString=function(delimiter){return _parts.join(delimiter||'');};this.ToArray=function(delimiter){return _parts;};this.InitializeClass=function(){if(value)this.Append(value);};this.InitializeClass();};System.Class.RegisterClass("System.Text.StringBuilder");System.Class.RegisterNamespace("System.Text.Encoding");System.Text.Encoding.UTF8Encoder=function(){this.Type="System.Text.Encoding.UTF8Encoder";var me=this;this.GetBytes=function(s){var bytes=new Array();var c=new Number;for(var i=0;i<s.length;i++){c=s.charCodeAt(i);if(c<0x80){bytes.push(c);}else if(c<0x800){bytes.push(0xC0|c>>6);bytes.push(0x80|c&0x3F);}else if(c<0x10000){bytes.push(0xE0|c>>12);bytes.push(0x80|c>>6&0x3F);bytes.push(0x80|c&0x3F);}else if(c<0x200000){bytes.push(0xF0|c>>18);bytes.push(0x80|c>>12&0x3F);bytes.push(0x80|c>>6&0x3F);bytes.push(0x80|c&0x3F);}else{bytes.push(0x3F);}}return bytes;};this.GetString=function(bytes){var s=new String;var b=new Number;var b1=new Number;var b2=new Number;var b3=new Number;var b4=new Number;var bE=new Number;var ln=bytes.length;for(var i=0;i<ln;i++){b=bytes[i];if(b<0x80){s+=(b>0)?String.fromCharCode(b):"";}else if(b<0xC0){}else if(b<0xE0){if(ln>i+1){b1=(b&0x1F);i++;b2=(bytes[i]&0x3F);bE=(b1<<6)|b2;s+=String.fromCharCode(bE);}}else if(b<0xF0){if(ln>i+2){b1=(b&0xF);i++;b2=(bytes[i]&0x3F);i++;b3=(bytes[i]&0x3F);bE=(b1<<12)|(b2<<6)|b3;s+=String.fromCharCode(bE);}}else if(b<0xF8){if(ln>i+3){b1=(b&0x7);i++;b2=(bytes[i]&0x3F);i++;b3=(bytes[i]&0x3F);i++;b4=(bytes[i]&0x3F);bE=(b1<<18)|(b2<<12)(b3<<6)|b4;s+=String.fromCharCode(bE);}}else{s+="?"}}return s;};this.InitializeClass=function(){};this.InitializeClass();};System.Text.Encoding.UTF8=new System.Text.Encoding.UTF8Encoder();System.Class.RegisterNamespace("System.Text.Encoding");System.Text.Encoding.UnicodeEncoder=function(){this.Type="System.Text.Encoding.UnicodeEncoder";var me=this;this.GetBytes=function(s){var bytes=new Array();var c=new Number;for(var i=0;i<s.length;i++){c=s.charCodeAt(i);if(c>0xFFFF){bytes.push(0xDC00|c&0x3FF);bytes.push(0xD7C0+(c>>10));}else{bytes.push(c&0xFF);bytes.push(c>>8);}}return bytes;};this.GetString=function(bytes){var s=new String;var b=new Number;var b1=new Number;var b2=new Number;for(var i=0;i<bytes.length;i++){b1=bytes[i];i++;b2=bytes[i];s+=String.fromCharCode((b2<<8)|b1);}return s;};this.InitializeClass=function(){};this.InitializeClass();};System.Text.Encoding.Unicode=new System.Text.Encoding.UnicodeEncoder();System.Class.RegisterNamespace("System.Text.Encoding");System.Text.Encoding.ASCIIEncoder=function(){this.Type="System.Text.Encoding.ASCIIEncoder";var me=this;this.GetBytes=function(s){var bytes=new Array();var c=new Number;for(var i=0;i<s.length;i++){c=s.charCodeAt(i);if(c>0xFF){bytes.push(0x3F);}else{bytes.push(c);}}return bytes;};this.GetString=function(bytes){var s=new String;for(var i=0;i<bytes.length;i++){s+=String.fromCharCode(bytes[i]);}return s;};this.InitializeClass=function(){};this.InitializeClass();};System.Text.Encoding.ASCII=new System.Text.Encoding.ASCIIEncoder();