﻿function $(id){return document.getElementById(id)}function $c(t){return document.createElement(t)}function $ct(tn){return document.createTextNode(tn)}function $a(nn,pn){return pn.appendChild(nn)}function $i(nn,rn){return rn.parentNode.insertBefore(nn,rn)}function $r(nn,on){return on.parentNode.replaceChild(nn,on)}function $rm(e){return e.parentNode.removeChild(e)}function cc(){return function(){this._.apply(this,arguments)}}function o2a(o){for(var a=[],c=0;c<o.length;++c)a.push(o[c]);return a}Function.prototype.bind=function(no){var oo=this;return function(){oo.apply(no,o2a(arguments))}};function _t(obj){return typeofobj}_si=setInterval,_ci=clearInterval,_st=setTimeout,_ct=clearTimeout;function print(s,m){var d=$('debug'),i='<div>'+s+'</div>';m?d.innerHTML+=i:d.innerHTML=i}function print_r(o){var k,r='';for(k in o)r+=k+': '+o[k]+'<br />';$('debug').innerHTML=r}for(var k in bs=['MSIE','Firefox','Opera','Safari'])if((np=navigator.userAgent.indexOf(bs[k]))!==-1){_b={id:parseInt(k),name:bs[k],version:k==3?navigator.userAgent.substr(navigator.userAgent.indexOf('Version/')+8,3):navigator.userAgent.substr(np+bs[k].length+1,3),textarea_rows_fix:k==1?-1:0};break}(AP=cc()).prototype={_:function(){this.as=[this[0]()]},0:function(){try{return new XMLHttpRequest()}catch(e){try{return new ActiveXObject('MSXML2.XMLHTTP')}catch(e){try{return new ActiveXObject('Microsoft.XMLHTTP')}catch(e){}}}},1:function(f){var k,a;for(k in this.as)if(this.as[k].readyState===4||this.as[k].readyState===0){a=this.as[k];break}if(!a)this.as.push(a=this[0]());a.onreadystatechange=this[2].bind([a,f]);return a},2:function(){if(this[0].readyState===4&&this[0].status===200)this[1]({data:json_decode(this[0].responseText)}),this[0].abort()},q:function(o){var q=[],k;for(k in o)q.push(urlencode(k)+'='+urlencode(o[k]));return q.join('&');}};ap=new AP;function ajax(a,f,p,t){var ah=ap[1](f);ah.open(p?'POST':'GET',(t?t:'/sofa/ajax.php')+'?'+ap.q(a)+'&_nc='+time(1),true);if(p)ah.setRequestHeader('Content-Type','application/x-www-form-urlencoded');ah.send(p?ap.q(p):null);return ah}document.cookie='ss='+window.screen.width+'x'+window.screen.height;function trim(s){return s.replace(/^\s+/,'').replace(/\s+$/,'')}function htmlspecialchars(s){return s.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;')}function unhtmlspecialchars(s){return s.replace(/&amp;/g,'&').replace(/&lt;/g,'<').replace(/&gt;/g,'>')}chr=String.fromCharCode,urlencode=encodeURIComponent;function json_decode(str){if(str.charAt(0)==='{'&&str.slice(str.length-1,str.length)==='}'||str!=='[]'&&str.charAt(0)==='['&&str.slice(str.length-1,str.length)===']')return eval('('+str+')');else alert('Error #1')}function time(m){var t=new Date().getTime();return m?t:parseInt(t/1000)}function range(n,l,g){return n>=l&&n<=g}function _d(e,d){e.style.display=d||d===undefined?'block':'none'}function _v(e,v){e.style.visibility=v||v===undefined?'inherit':'hidden'}function _o(e,o){if(_b.id===0)e.style.filter='Alpha(Opacity='+o+')';else e.style.opacity=o/100}function _bg(e,b){e.style.background=b||'transparent'}function add(o,e,f){return o.addEventListener?o.addEventListener(e,f,false):o.attachEvent('on'+e,f)}function remove(o,e,f){return o.removeEventListener?o.removeEventListener(e,f,false):o.detachEvent('on'+e,f)}function _mb(e){if(_b.id===0)switch(event.button){case 1:return 1;case 4:return 2;case 2:return 3}else return range(e.which,1,3)?e.which:0}function _mx(e){return window.event?event.x+document.body.scrollLeft-1:e.pageX}function _my(e){return window.event?event.y+document.body.scrollTop-1:e.pageY}function _ox(e){return e?_mx(e)-e.currentTarget.offsetLeft:event.offsetX}function _oy(e){return e?_my(e)-e.currentTarget.offsetTop:event.offsetY}function _kc(e){return window.event?event.keyCode:e.keyCode}function stop(e){if(window.event){event.returnValue=!(event.cancelBubble=true)}else{e.preventDefault();e.stopPropagation()}}function flash(f,e,m){if(m||m===undefined){if(f[1]++===0){var sc=4095,s=273;f[0]=_si(function(){if(!sc||sc===4095)s=-s;cs=(sc+=s).toString(16);e.style.borderLeftColor='#'+(cs.length===3?cs:(cs.length===2?'0'+cs:'00'+cs))},10)}}else if(--f[1]===0){_ci(f[0]);e.style.borderLeftColor=''}}