var $$=document,$id=function($){return $$.getElementById($)},$name=function($){return $$.getElementsByName($)},$tag=function($){return $$.getElementsByTagName($)},$cet=function($){return $$.createElement($)},Avarin={ver:"0.1",by:"qass"};Avarin.ajax=new function(){function _(){try{return new ActiveXObject("Msxml2.XMLHTTP")}catch($){try{return new ActiveXObject("Microsoft.XMLHTTP")}catch($){try{return new XMLHttpRequest()}catch($){return false}}}}function $(A){if(!A)return null;var C=A.length,_=[];for(var D=0,$;D<C;D++)if(($=B(A[D])))_[_.length]=$;return(_.length<1)?null:_.join("&")}function B(_){if(_.name.length<1)return null;var C,B;switch(_.type.toLowerCase()){case"select-one":B=_.selectedIndex,C=_.options[B].value.length>0?_.options[B].value:_.options[B].text;return(B>=0&&C.length>0)?A(_.name,[C]):null;break;case"select-multiple":B=_.length,C=[];for(var E=0,D,$;E<B;E++){D=_.options[E],$=D.value.length>0?D.value:D.text;if(D.selected&&$.length>0)C[C.length]=$}return(C.length>0)?A(_.name,C):null;break;case"checkbox":case"radio":return(_.checked&&_.value.length>0)?A(_.name,[_.value]):null;break;case"submit":case"reset":return null;break;default:return(_.value.length>0)?A(_.name,[_.value]):null}}function A(_,$){for(var A=0;A<$.length;A++)$[A]=encodeURIComponent($[A]);return _+"="+$.join(",")}this.random=null;this.query=function(F,E,C){var A=_(),D="GET";if(this.random)F+=this.random();!C||C.length<1?C=null:D="POST";if(!A){if(C){C.method="POST";C.action=F;C.submit()}else document.location.href=F;return}try{A.onreadystatechange=function(){if(A.readyState==4||A.readyState=="complete")if(A.status==200||A.status==0){if(E)E(A.responseText);A=null;delete A;return}};A.open(D,F,true);if(C)A.setRequestHeader("Content-Type","application/x-www-form-urlencoded");A.send($(C))}catch(B){E("");A=null;alert(B)}}};Avarin.popbox=function(){var S,P=false,R=false,$,_=0,M=0,B=0,D=0,L=0,N=0,I=0,E=0,J=0,G=0,Q,O,H,K;function A(B,_){var A=_?["paddingLeft","paddingRight"]:["paddingTop","paddingBottom"],$=0;for(var C=0;C<A.length;C++)$+=parseInt(($$.all?B.currentStyle[A[C]]:window.getComputedStyle(B,null).getPropertyValue(A[C].replace(/([A-Z])/g,"-$1").toLowerCase())).replace(/px/,""));return $}function T(){var A,$,D,C,B={},_=["onselectstart","ondragstart","onmousemove","onmouseup"];return function(E){E=E||window.event,A=E.button==2;if(!A)return;D=E.clientX-I,C=E.clientY-J;for(var F=0;F<_.length;F++)B[_[F]]=$$[_[F]];$$.onselectstart=$$.ondragstart=function(){return false};$$.onmouseup=function(){for(var E=0;E<_.length;E++)this[_[E]]=B[_[E]];if($){var D=this,C=D.oncontextmenu;D.oncontextmenu=function(){return false};window.setTimeout(function(){D.oncontextmenu=C},50)}A=$=false};$$.onmousemove=function(_){_=_||window.event;if(A){$=true;try{I=_.clientX-D,J=_.clientY-C;S.style.left=I+"px",S.style.top=J+"px"}catch(_){}}return false}}}function F(){S.style.width=L+"px",S.style.height=N+"px",S.style.left=I+"px",S.style.top=J+"px"}function C(){try{S.style.width=_+"px",S.style.height=M+"px",S.parentNode.removeChild(S),S=null}catch($){}}return{box:null,speed:15,opened:false,follow:true,target:false,move:false,onopen:null,onclose:null,onmove:null,onopened:null,onclosed:function(){C()},setBody:function(_){$=_;if($!=$$.body)$.style.position="relative"},setXY:function(B,_,A,$){Q=B,O=_,H=A,K=$},dispose:C,nodeXY:function($,_){var B=0,A=0;_=_||window;while($&&$!=_){B+=$.offsetLeft,A+=$.offsetTop;$=$.offsetParent}return{x:B,y:A}},winXY:function(_,B){var $=$$.documentElement,A={x:0,y:$$.body.scrollTop+$$.documentElement.scrollTop};_=((window.innerWidth||($&&$.clientWidth)||$$.body.clientWidth)-(_||0))/2,B=((window.innerHeight||($&&$.clientHeight)||$$.body.clientHeight)-(B||0))/2;if(A.x<(A.x+_))A.x+=_;if(A.y<(A.y+B))A.y+=B;return{x:parseInt(A.x),y:parseInt(A.y)}},open:function(R){if(S)C();if(!(S=R||this.box))return;S.style.position="absolute",S.style.display="block",S.style.overflow="hidden",S.style.margin="0px";var P=this.winXY();if(!$){$=$$.body;I=E=P.x,J=G=P.y}$.appendChild(S);_=S.clientWidth-A(S,true),M=S.clientHeight-A(S);P=this.winXY(S.clientWidth,S.clientHeight);B=H||P.x,D=K||P.y;if(!this.follow)L=N=0;if(this.target){I=Q||E;J=O||G}F();if(this.move)S.onmousedown=T();if(this.onopen)this.onopen();this.loop(_,M,B,D,this.onopened),this.opened=true},close:function(){if(!S)return;S.style.overflow="hidden";if(this.onclose)this.onclose();this.loop(0,0,Q||E,O||G,this.onclosed),this.opened=false},loop:function(D,B,_,A,C){if(P)window.clearInterval(P),P=false;var E=this,G=E.speed;if(G>D)G=D;if(G<1)G=E.speed||1;var $=(D-L)/G,K=((B-N)/G),M=(_-I)/G,H=(A-J)/G;P=window.setInterval(function(){G--;if(G==0){window.clearInterval(P),P=false,L=D,N=B,I=_,J=A;F();S.style.overflow="";if(C)C()}else{var R=L+$,Q=N+K,T=I+M,O=J+H;L=R>0?R:0,N=Q>0?Q:0,I=T>0?T:0,J=O>0?O:0;F();if(E.onmove)E.onmove()}},G)}}};Avarin.UBB=function(A){var _=A,$,C=!!$$.all;function B(){_.onselect=_.onclick=_.onkeyup=function(){if(this.createTextRange)$=this.document.selection.createRange().duplicate()}}if(_)B();return{setFocus:function($){if(!$)return;else _=$;B()},insert:function(D,A){if(!_)return;_.focus();var B=false,F;A=A||"";if(C){var J=_.document.selection;if(J&&J.type=="Text"){B=J.createRange();if(A)D+=B.text}}else if(_.selectionStart!="undefined"){var H=_.value,G=_.selectionStart,I=_.selectionEnd;if(A)D+=H.substring(G,I);F=true}D+=A;if(B)B.text=D;else if($){var E=$.text;$.text+=(E.charAt(E.length-2)==" ")?(D+" "):D}else if(F){_.value=H.substring(0,G)+D+H.substring(I),_.selectionStart=G,_.selectionEnd=G+D.length;H=null}else _.value+=D}}};Avarin.tools={trim:function($){return!$?"":String($).replace(/(^[\s\n\t\r]*)|([\s\n\r\t]*$)/g,"").replace(/\r/g,"")},HTMLEncode:function($){return($||"").replace(/\&/g,"&amp;").replace(/\>/g,"&gt;").replace(/\</g,"&lt;").replace(/\"/g,"&quot;").replace(/\'/g,"&#39;")},HTMLDecode:function($){return($||"").replace(/\&amp;/g,"&").replace(/\&gt;/g,">").replace(/\&lt;/g,"<").replace(/\&quot;/g,"\"").replace(/\&#39;/g,"'")},lengthW:function($){$=this.trim($);if(!$)return 0;var _=0,A=$.length,C;for(var B=0;B<A;B++){C=$.charCodeAt(B);if(C<0||C>255)_+=2;else _++}return _},check:{username:function($){if(typeof($)!="string")return false;$=this.trim($);if(this.lengthW($)<3||$.length>24)return false;if(/[^\w\u3400-\u4DBF\u4E00-\u9FAF]/g.test($))return false;return $},password:function($){if(!$)return false;$=this.trim($);if($.length<6||$.length>16)return false;if(/[^\x20-\x7e]/g.test($))return false;return $},fileType:function($){if(!$||!($=($=$.split("."))[$.length-1]))return"";var _=new RegExp($,"ig");switch(true){case _.test("|exe|com|bat|dll|"):return"exe";break;case _.test("|ace|arj|rar|cab|lzh|jar|zip|7z|"):return"zip";break;case _.test("|doc|docx|txt|rtf|wri|pdf|"):return"doc";break;case _.test("|bmp|gif|jpg|jpeg|png|tif|"):return"img";break;case _.test("|swf|"):return"swf";break;case _.test("|aac|asf|asx|avi|aiff|wmv|wmp|wm|wvx|wax|wmx|wma|mp4|mpg|mpeg|m3u|mid|wav|mp3|mpa|mp2|m1a|m2a|pls|"):return"wmp";break;case _.test("|amr|3gp|3gpp|3g2|3gp2|ra|rm|ram|rmvb|rpm|rt|rp|smi|smil|"):return"rm";break;case _.test("|mov|vod|qt|"):return"qt";break;default:return $}}},resetFile:function(B,_,$,C){_=!_?"":" width=\""+_+"\"",$=!$?"":" height=\""+$+"\"";var A=C||this.check.fileType(B);switch(A){case"img":return"<img border=\"0\" onload=\"Avarin.tools.resizeImage(this, true)\" src=\""+B+"\""+_+$+"\" alt=\""+B+"\"/>";break;case"swf":return"<object type=\"application/x-shockwave-flash\" data=\""+B+"\""+_+$+"><param name=\"movie\" value=\""+B+"\"/><param name=\"quality\" value=\"high\"/><param name=\"wmode\" value=\"transparent\"/></object>";break;case"wmp":return"<object classid=\"clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95\" codebase=\"http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,0,02,902\" type=\"application/x-oleobject\" standby=\"Loading...\""+_+$+"><param name=\"FileName\" value=\""+B+"\" /><param name=\"ShowStatusBar\" value=\"-1\" /><param name=\"AutoStart\" value=\"false\" /><embed type=\"application/x-mplayer2\" pluginspage=\"http://www.microsoft.com/Windows/MediaPlayer/\" src=\""+B+"\" autostart=\"true\""+_+$+"/></object>";break;case"rm":return"<object classid=\"clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA\""+_+$+"\"><param name=\"SRC\" value=\""+B+"\"/><param name=\"CONTROLS\" VALUE=\"ImageWindow\"/><param name=\"CONSOLE\" value=\"one\"/><param name=\"AUTOSTART\" value=\"false\"/><embed src=\""+B+"\" nojava=\"true\" controls=\"ImageWindow\" console=\"one\""+_+$+"\"></object><br /><object classid=\"clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA\""+_+"\" height=\"32\" /><param name=\"CONTROLS\" value=\"StatusBar\" /><param name=\"AUTOSTART\" value=\"false\" /><param name=\"CONSOLE\" value=\"one\" /><embed src=\""+B+"\" nojava=\"true\" controls=\"StatusBar\" console=\"one\""+_+"\" height=\"24\" /></object><br /><object classid=\"clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA\""+_+"\" height=\"32\" /><param name=\"CONTROLS\" value=\"ControlPanel\"/><param name=\"AUTOSTART\" value=\"false\"/><param name=\"CONSOLE\" value=\"one\" /><embed src=\""+B+"\" nojava=\"true\" controls=\"ControlPanel\" console=\"one\""+_+"\" height=\"24\" autostart=\"false\" loop=\"false\" /></object>";break;case"qt":return"<embed src=\""+B+"\" autoplay=\"false\" loop=\"false\" controller=\"true\" playeveryframe=\"false\" cache=\"false\" scale=\"TOFIT\" bgcolor=\"#000000\" kioskmode=\"false\" targetcache=\"false\" pluginspage=\"http://www.apple.com/quicktime/\"/>";break;default:return A}},resizeImage:function(D,_,$,A){var E=$||D.parentNode.offsetWidth||D.offsetWidth,C=A||D.offsetHeight;if(E==0&&C==0)return;var H=new Image();H.src=D.src;var G=H.width||0,F=H.height||0;if((C<F||E<G)&&_==true&&D.parentNode.nodeName!="A"){if(!this.resizePOP)this.resizePOP=Avarin.popbox();var B=this.resizePOP;B.move=true;D.onclick=function(){H.onclick=function(){B.close()};B.box=$cet("div"),B.box.appendChild(H),B.box.style.cssText="background:#fff;padding:10px;border:1px solid #666;width:"+H.width+"px;height:"+H.height+"px;";B.speed=0,B.open()};D.style.cursor=H.style.cursor="pointer"}if(E>G)E=G;if(C>F)C=F;E=E/G;C=C/F;if(E<C){G*=E;F*=E}else{G*=C;F*=C}G+="px",F+="px";D.width=G;D.height=F;D.style.width=G,D.style.height=F}}