锘縎tring.implement({cnEncode:function(){return encodeURIComponent(this)},cnDecode:function(){return decodeURIComponent(this)},charCode:function(){var e=this.length,t="";for(var n=0;n":">",'"':"""},t=/[&|<|>|"]/g;return this.replace(t,function(t){return e[t]})},escapeBlank:function(){var e;e=this.replace(/\s/g," ");var t=new RegExp("
","g");return e=e.replace(t,"\n"),e},revertBlank:function(){return this.replace(/\n/g,"
")},trimSearch:function(){return DBC2SBC(this.trim()).replace(/[^a-zA-Z0-9\u4E00-\u9FA5 \-\_锛孿']/g,"")}}),Element.implement({appendHTML:function(e,t){if($type(e)!="string")return!1;t=t||"bottom";var n=new Element("div");n.set("html",e);var r=t=="bottom"||t=="top"?$A(n.childNodes):$A(n.childNodes).reverse();return r.each(function(e){$type(e)=="element"&&$(e).inject(this,t)},this),this},css:function(e,t){if($type(e)=="object"){for(var n in e)this.css(n,e[n]);return this}return $chk(t)?(this.setStyle(e,t),this):this.getStyle(e)},attr:function(e,t){if($type(e)=="object"){for(var n in e)this.attr(n,e[n]);return this}return $chk(t)?(this.setProperty(e,t),this):t===""?this.removeProperty(e):this.getProperty(e)},val:function(e){return $chk(e)||e==""?this.set("value",e):this.get("value")},w:function(e){return $chk(e)?this.css("width",e):this.getWidth()},h:function(e){return $chk(e)?this.css("height",e):this.getHeight()},html:function(e){return $chk(e)||e==""?this.set("html",e):this.get("html")},txt:function(e){return $chk(e)||e==""?this.set("text",e):this.get("text")},isDisplayed:function(){return this.getStyle("display")!="none"},isInto:function(){return this.getStyle("position")=="static"},toggle:function(){return this[this.isDisplayed()?"hide":"show"]()},hide:function(){return this.css("display","none")},show:function(e){return this.css("display",e||"block")},visible:function(){return this.css("visibility","visible")},invisible:function(){return this.css("visibility","hidden")},out:function(){return this.css({position:"absolute",top:"-9999px",left:"-9999px"})},into:function(){return this.css("position","static")},swapClass:function(e,t){return this.removeClass(e).addClass(t)}});var $isFun=function(e){return $type(e)==="function"},$isEle=function(e){return $type(e)==="element"},$isObj=function(e){return $type(e)==="object"},$isArr=function(e){return $type(e)==="array"},$isStr=function(e){return $type(e)==="string"},$isNum=function(e){return $type(e)==="number"},$isIe6=function(){return window.XMLHttpRequest?!1:!0}(),DBC2SBC=function(t){var n="";for(i=0;i=65281&&code<=65373?n+=String.fromCharCode(t.charCodeAt(i)-65248):code==12288?n+=String.fromCharCode(t.charCodeAt(i)-12288+32):n+=t.charAt(i);return n},$isRegex=function(e,t,n){return $(e).val().trim().test(t,n||"i")},$isEmpty=function(e,t){t=t||$(e).attr("placeholder");var n=$(e).val().trim();return!n||n===t?!0:!1};$isRegex.extend({EMAIL:"^[a-z0-9._%-]+@[a-z0-9]+(\\.[a-z]{2,4}){1,4}$",URL:"^(http|https|ftp)\\:\\/\\/[a-z0-9\\-\\.]+\\.[a-z]{2,3}(:[a-z0-9]*)?\\/?([a-z0-9\\-\\._\\?\\,\\'\\/\\\\\\+&%\\$#\\=~])*$",MOBILE:"^1\\d{10}$",ZIPCODE:"^\\d{6}$"});var $pageFresh=function(e){window.location.href=e||window.location.href.split("#")[0]},$cursorToEnd=function(e){if(e.createTextRange){var t=e.createTextRange();t.moveStart("character",e.value.length),t.collapse(!0),t.select()}else e.setSelectionRange(e.value.length,e.value.length),e.focus()},$textareaRemind=function(e){$classToggle(e,{eventType:"focus",inCall:function(){this.val().trim()===this.attr("placeholder")&&this.html(""),this.css("color","#555")},outCall:function(){this.val().trim()===""&&(this.html(this.attr("placeholder")),this.css("color","#999"))}})}