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