$P('jsBuild.TOTAL');$P('jsBuild.{jsCore}jsCore');/**
 * @author	RubaXa		<trash@rubaxa.org>
 * @created	2007-11-07 20:45
 * @build	2010-08-04 22:31:11
 * @version 2.9μ
 * Ядрышко
 */
var RubaXa={},jsCore={version:2.9,build:'1280946671'},returnTrue=function(){return true},returnFalse=function(){return false};if(!window.$P){window.$P=function(){};$P.clear=function(){}}$P('jsCore.file');(function(){var DR=[],plugins=[];window.$R=function(r,c){window.domReady(function(){jsLoader.require(r,c)})};window.isDomReady=false;window.domReady=function(f){if(f){window.isDomReady?f():window._drLength=DR.push(f)}else{jsCore.ready();window.isDomReady=true;for(var i=0;DR[i];i++)DR[i]()}};window.$PP=function(id,p,o){if(jsCore.loaded)jsLoader.require('{plugins}jsPlugins',function(){jsPlugins.set(id,p,o)});else plugins.push([id,p,o])};domReady(function(){if(n=plugins.length){$R('{plugins}jsPlugins',function(){for(var i=0,p;p=plugins[i];i++){$P('jsPlugin.'+p[1]);jsPlugins.set($F(p[0]),(typeof p[1]=='string'?p[1]:'plugin'),(typeof p[1]=='string'?p[2]:p[1])||{});$P('jsPlugin.'+p[1],1)}$P('jsPlugin',2)})}})})();var HTML=document.getElementsByTagName('HTML')[0],HEAD=HTML.firstChild,BODY=null,undefined;var defined=function(v,d){return(typeof d=='undefined')?(typeof v!='undefined'):(typeof v=='undefined'?d:v)};var $A=function(a){var r=[];r.push.apply(r,(arguments.length>1)?arguments:a);return r};Array.uniq=function(a){var r=[],i=0,n=a.length,u={};for(;i<n;i++){if(!u[a[i]]){u[a[i]]=1;r.push(a[i])}}delete u;return r};if(!Array.indexOf){Array.indexOf=function(a,e,f){var l=a.length,f=f||0;f=(f<0)?Math.ceil(f):Math.floor(f);if(f<0)f+=l;for(;f<l;f++){if((f in a)&&(a[f]===e))return f}return-1}}Array.search=function(a,f,T){for(var i=0,n=a.length;i<n;i++)if(f.apply(T,[a[i],i]))return i;return-1};if(!Array.filter){Array.filter=function(a,f,This){if(typeof f!='function')throw new TypeError();var r=[],i=0,n=a.length,v;for(;i<n;i++)if(i in a){v=a[i];if(f.call(This,v,i,a))r.push(v)}return r}};Array.remove=function(a,i,s){if(s){i=Array.indexOf(a,i)}else{i=Math.floor(i<0?a.length-i:i);if(i<0)return[]}return a.slice(0,i).concat(a.slice(i+1))};var unserialize=function(v,d){if(typeof v=='undefined'||typeof v!='string'||!v)return v;else if(d)v=decodeURIComponent(v);if(window.JSON&&0)return JSON.parse(v);else if($B.gecko)return new Function("return "+v)();else return eval("("+v+")")};window.userAgent=navigator.userAgent.toLowerCase();var bVer=(userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[])[1];var jsCore={browser:{userAgent:userAgent,ver:parseInt(bVer),version:bVer,safari:/webkit/.test(userAgent),webkit:/webkit/.test(userAgent),opera:/opera/.test(userAgent),msie:!-[1,],mozilla:/mozilla/.test(userAgent)&&!/(compatible|webkit)/.test(userAgent),gecko:/Gecko\//.test(userAgent)},F:function(a){return a},random:Math.random(),time:+new Date(),version:2,local:/jsLocal|pp\.ru|rubaxa|web[34]|mmm3|ll1/i.test(document.location.href)||window.JS_LOCAL,loaded:0,disabled:0,build:jsCore.version+'.'+jsCore.build,currentId:0,unloadConfirm:0,_wList:{},emailRegExp:/^.+@.+\..{2,4}$/i,getNextId:function(){return jsCore.getCounter()},getCounter:function(){return jsCore.currentId++},getUniqId:function(o){return o?(o.uniqId?o.uniqId:(o.uniqId=this.getUniqId())):this.time+this.getCounter()},getTimer:function(){return(new Date()).getTime()-this.time},$:function(id){return typeof id=='string'?document.getElementById(id.replace(/^#/,'')):(id.append?id[0]:id)},apply:function(O,m,a){var r;switch(a.length){case 1:r=O[m](a[0]);break;case 2:r=O[m](a[0],a[1]);break;case 3:r=O[m](a[0],a[1],a[2]);break;case 4:r=O[m](a[0],a[1],a[2],a[3]);break;case 5:r=O[m](a[0],a[1],a[2],a[3],a[4]);break;case 6:r=O[m](a[0],a[1],a[2],a[3],a[4],a[5]);break;default:r=O[m]()}return r},crc32:function(s,c){var i=x=y=0,t='00000000 77073096 EE0E612C 990951BA 076DC419 706AF48F E963A535 9E6495A3 0EDB8832 79DCB8A4 E0D5E91E 97D2D988 09B64C2B 7EB17CBD E7B82D07 90BF1D91 1DB71064 6AB020F2 F3B97148 84BE41DE 1ADAD47D 6DDDE4EB F4D4B551 83D385C7 136C9856 646BA8C0 FD62F97A 8A65C9EC 14015C4F 63066CD9 FA0F3D63 8D080DF5 3B6E20C8 4C69105E D56041E4 A2677172 3C03E4D1 4B04D447 D20D85FD A50AB56B 35B5A8FA 42B2986C DBBBC9D6 ACBCF940 32D86CE3 45DF5C75 DCD60DCF ABD13D59 26D930AC 51DE003A C8D75180 BFD06116 21B4F4B5 56B3C423 CFBA9599 B8BDA50F 2802B89E 5F058808 C60CD9B2 B10BE924 2F6F7C87 58684C11 C1611DAB B6662D3D 76DC4190 01DB7106 98D220BC EFD5102A 71B18589 06B6B51F 9FBFE4A5 E8B8D433 7807C9A2 0F00F934 9609A88E E10E9818 7F6A0DBB 086D3D2D 91646C97 E6635C01 6B6B51F4 1C6C6162 856530D8 F262004E 6C0695ED 1B01A57B 8208F4C1 F50FC457 65B0D9C6 12B7E950 8BBEB8EA FCB9887C 62DD1DDF 15DA2D49 8CD37CF3 FBD44C65 4DB26158 3AB551CE A3BC0074 D4BB30E2 4ADFA541 3DD895D7 A4D1C46D D3D6F4FB 4369E96A 346ED9FC AD678846 DA60B8D0 44042D73 33031DE5 AA0A4C5F DD0D7CC9 5005713C 270241AA BE0B1010 C90C2086 5768B525 206F85B3 B966D409 CE61E49F 5EDEF90E 29D9C998 B0D09822 C7D7A8B4 59B33D17 2EB40D81 B7BD5C3B C0BA6CAD EDB88320 9ABFB3B6 03B6E20C 74B1D29A EAD54739 9DD277AF 04DB2615 73DC1683 E3630B12 94643B84 0D6D6A3E 7A6A5AA8 E40ECF0B 9309FF9D 0A00AE27 7D079EB1 F00F9344 8708A3D2 1E01F268 6906C2FE F762575D 806567CB 196C3671 6E6B06E7 FED41B76 89D32BE0 10DA7A5A 67DD4ACC F9B9DF6F 8EBEEFF9 17B7BE43 60B08ED5 D6D6A3E8 A1D1937E 38D8C2C4 4FDFF252 D1BB67F1 A6BC5767 3FB506DD 48B2364B D80D2BDA AF0A1B4C 36034AF6 41047A60 DF60EFC3 A867DF55 316E8EEF 4669BE79 CB61B38C BC66831A 256FD2A0 5268E236 CC0C7795 BB0B4703 220216B9 5505262F C5BA3BBE B2BD0B28 2BB45A92 5CB36A04 C2D7FFA7 B5D0CF31 2CD99E8B 5BDEAE1D 9B64C2B0 EC63F226 756AA39C 026D930A 9C0906A9 EB0E363F 72076785 05005713 95BF4A82 E2B87A14 7BB12BAE 0CB61B38 92D28E9B E5D5BE0D 7CDCEFB7 0BDBDF21 86D3D2D4 F1D4E242 68DDB3F8 1FDA836E 81BE16CD F6B9265B 6FB077E1 18B74777 88085AE6 FF0F6A70 66063BCA 11010B5C 8F659EFF F862AE69 616BFFD3 166CCF45 A00AE278 D70DD2EE 4E048354 3903B3C2 A7672661 D06016F7 4969474D 3E6E77DB AED16A4A D9D65ADC 40DF0B66 37D83BF0 A9BCAE53 DEBB9EC5 47B2CF7F 30B5FFE9 BDBDF21C CABAC28A 53B39330 24B4A3A6 BAD03605 CDD70693 54DE5729 23D967BF B3667A2E C4614AB8 5D681B02 2A6F2B94 B40BBE37 C30C8EA1 5A05DF1B 2D02EF8D';c=defined(c,0)^(-1);for(var i=0,n=s.length;i<n;i++){y=(c^s.charCodeAt(i))&0xFF;x='0x'+t.substr(y*9,8);c=(c>>>8)^x}return c^(-1)},each:function(o,I,a){if(o){if((o.constructor==Array)||a){for(var i=0,n=o.length;i<n;i++){I(i,o[i])}}else{for(var i in o){I(i,o[i])}}}},extend:function(d,s){var v,i=1,n=arguments.length,p,a;for(;i<n;i++)if(a=arguments[i])for(p in a){if(((v=a[p])!=null)&&(typeof v!='undefined')){d[p]=v}}v=a=null;return d},cloneObject:function(o){var c={};for(var k in o){c[k]=o[k]}return c},delegate:function(o,m){var ca=Array.prototype.slice.call(arguments,2);if(typeof(m)=='string')m=o[m];return function(){return m.apply(o,ca.concat(Array.prototype.slice.call(arguments,0)))}},elm:function(e,a,v){if(e){if(e.append)e=e[0];if(e.target||e.srcElement)e=(e.target||e.srcElement);if(!a||(e==BODY))return e;var _a,_v,_r=v&&v.test;do{_v=typeof v!='undefined';_a=e[a]||e.getAttribute(a)||'';if((_v&&((_a==v)||(_a==v)||(_r&&v.test(_a))))||(!_v&&((_a!=='')&&(_a!==null)))){return e}}while(e&&(e=e.parentNode)&&(e.parentNode!=BODY))}return false},hitTest:function(x,y,c){return(x>=c.x1)&&(c.y1<=y)&&(x<=c.x2)&&(c.y2>=y)},wait:function(w,c){if(!c||c.constructor!=Function)throw new Error('Second argument must be function in jsCore.wait or jsCore.require');if(typeof w=='string')w=w.split(',');var w=Array.filter(w,function(v){if(!this._wList[v=v.toLowerCase()])this._wList[v]={r:0,l:[]};return!this._wList[v].r},this),i=0,_i=0,_c=w.length,n,p,wc;if(!_c){c();return}else wc=function(o){if(++_i>=_c){c(o)}};for(;w[i];i++){p=w[i].split(':');n=w[i].toLowerCase();this._wList[n].l.push(wc);if((p[0]=='file')||(p[0]=='include')||(p[0]=='require')){jsLoader.require(p[1],wc)}}},notify:function(w,o){if(typeof w=='string')w=w.split(',');for(var j=0,p,n,jl=w.length;j<jl;j++){p=w[j].split(':');n=w[j].toLowerCase();if(!this._wList[n])this._wList[n]={r:0,l:[]};if(this._wList[n].l)for(var i=0,ni=this._wList[n].l.length;i<ni;i++)this._wList[n].l[i](o);if(p[0]!='event')this._wList[n]={r:1}}},confirmUnload:function(y,t){if(defined(y)){this.unloadConfirm=y;window.onbeforeunload=y?function(){return(t||false)}:null;jsCore.notify('event:confirmUnload',y)}return this.unloadConfirm},error:function(m,u,l){debug.log('<b style="color: red;">',m,u,l,'</b>')},ready:function(f){if(f&&f.constructor==Function){jsCore.loaded?f():jsCore.wait('jsCore:ready',f)}else{if(jsCore.loaded)return true;if(!document.body)return setTimeout(jsCore.ready,13);BODY=document.body;jsCore.isReady=jsCore.loaded=true;HTML.id='jsHtml';HTML.className+=' jsHtml';$P('jsCore.ready',1);if(1){$P('jsCore.readyList');jsCore.notify('jsCore:ready,jsCore:loaded,document:loaded'.split(','));$P('jsCore.readyList',1)}$P('jsCore',2)}},unload:function(f){if(f&&f.constructor==Function){jsCore.wait('jsCore:unload',f)}else{try{jsCore.notify('jsCore:unload');window.onerror=this.loaded=HTML=HEAD=$HEAD=BODY=$BODY=null;jsEvent.remove(window,'unload',jsCore.unload);Interval.destroy();jsCore.destroy(jsLoader);jsCore.destroy(Registry);jsCore.destroy()}catch(e){}}},destroy:function(o){if(typeof o==undefined){window['jsLoader']=null;window['jsClass']=null;window['jsCore']=null}else{for(var k in o){o[k]=null;delete o[k]}k=null;delete k;o=null;delete o}},isEmail:function(s){return this.emailRegExp.test(s)},request:function(o){o.data=String.toQuery(o.data);o.pid=o.pid||(o.cache?this.crc32(o.data):jsCore.getUniqId());var r='request:'+o.pid;if(!o.cache)this._wList[r]={r:0,l:[]};if(o.success){jsCore.wait(r,$D(null,function(R){if(!o.cache||(o.cache&&defined(R)))jsCore[o.pid]=R;(o.success)(jsCore[o.pid])}))}if(!this._wList[r]||!this._wList[r].r){jsLoader.file(o.url+(/\?/.test(o.url)?'&':'?')+'pid='+o.pid+'&'+o.data+'&_sr_=Y'+(o.cache?'':'&_='+jsCore.getUniqId()))}}};var $E=jsCore.extend,$D=jsCore.delegate,$B=jsCore.browser,$G=jsCore.elm,$SA=function(N,a,v){N[a]=v;a!='className'&&N.setAttribute?N.setAttribute(a,v):0;return N},$AA=function(N,a,v){return $SA(N,a,$GA(N,a)+v)},$RA=function(N,a,r,v){return $SA(N,a,$GA(N,a).replace(r,v))},$DA=function(N,a){N[a]=null;if(!N.nodeType)delete N[a];(N.removeAttribute?N.removeAttribute(a):0);return N},$GA=function(e,a){return typeof e[a]=='undefined'?e.getAttribute&&e.getAttribute(a):e[a]},$GV=function(e,a){return $GA($G.apply($G,arguments),a)},$WTF=function(t){throw t},$F=jsCore.$,$FS=function(id){return $F(id).style},$clone=jsCore.cloneObject,_apply_=jsCore.apply,$onClick=function(Node){Node=$F(Node);var value=Node.onclick&&Node.onclick();$DA(Node,'onclick');return value};jsCore.uniqId=jsCore.getUniqId();Object.extend=$E;Object.clone=$clone;Object.forEach=function(o,f,T){for(var k in o)if(f.call(T,o[k],k,o)==false)break};$CO=function(n){var o=window,i=0;n=n.split('.');for(i=0;i<n.length;i++){if(!o[n[i]])o[n[i]]={};o=o[n[i]]}return o};var jsClass={classes:{},__m:{},methods:{},dependence:{},instance:{},collector:[],create:function(n){var classUniqId=jsCore.getUniqId();var NewClass=function(){this.uniqId=jsCore.getUniqId();this.parentClassUniqId=0;if(this.__construct)this.__construct.apply(this,arguments)};jsCore.each(jsClass.Base,function(k,m){if(k!='prototype'){NewClass[k]=m}});NewClass.classUniqId=NewClass.prototype.classUniqId=classUniqId;jsClass.classes[classUniqId]=NewClass;jsClass.__m[classUniqId]={};jsClass.methods[classUniqId]={};jsClass.dependence[classUniqId]=[];NewClass.extend(jsClass.Base);NewClass.prototype.inherit=function(K,m,args){return K.prototype[m].apply(this,args)};NewClass.prototype.constructor=NewClass;NewClass.prototype.parent=jsClass.Base.prototype.parent;if(n){n='window.'+n;$CO(n.substr(0,n.lastIndexOf('.')))[n.substr(n.lastIndexOf('.')+1)]=jsClass.classes[classUniqId]}return jsClass.classes[classUniqId]},inherit:function(F,T,m){return F.prototype[m].apply(T,(Array.prototype.slice.call(arguments,3)||[]))},destroy:function(){while(this.collector.length){try{this.collector.shift()()}catch(e){}}this.collector=null}};jsClass.Base=function(){};jsClass.Base.classUniqId=jsCore.getUniqId();jsClass.Base.prototype={parent:function(m){var i=--jsClass.__m[this.classUniqId][m],r=jsClass.classes[jsClass.methods[this.classUniqId][m][i<0?jsClass.methods[this.classUniqId][m].length-1:i]].prototype[m].apply(this,Array.prototype.slice.call(arguments,1));jsClass.__m[this.classUniqId][m]++;return r},callMethod:function(n){if(typeof this[n]!='undefined')return this[n].apply(this,Array.prototype.slice.call(arguments,1))},destroy:function(){jsCore.destroy(this)}};$E(jsClass.Base,{getInstance:function(){if(!jsClass.instance[this.classUniqId]){jsClass.instance[this.classUniqId]=new this}return jsClass.instance[this.classUniqId]},extend:function(E){for(var c=0,cId,Klass;Klass=arguments[c];c++){cId=Klass.classUniqId;for(var m in Klass.prototype){if((m!='classUniqId')&&(m!='uniqId')&&(m!='parent')&&(m!='inherit')&&(m!='constructor')){this.prototype[m]=Klass.prototype[m];if(!jsClass.methods[this.classUniqId][m]||jsClass.methods[this.classUniqId][m].constructor!=Array){jsClass.methods[this.classUniqId][m]=[]};if(jsClass.methods[cId]&&jsClass.methods[cId][m]){jsClass.methods[this.classUniqId][m]=Array.uniq(jsClass.methods[this.classUniqId][m].concat(jsClass.methods[cId][m]))};if(Array.indexOf(jsClass.methods[this.classUniqId][m],cId)==-1){jsClass.methods[this.classUniqId][m].push(cId)};jsClass.__m[this.classUniqId][m]=jsClass.methods[this.classUniqId][m].length}}this.prototype.parentClassUniqId=Klass.classUniqId}return this},static:function(m){$E(this,m);return this},methods:function(m){if(m.constructor==Function){m(this.prototype,this)}else $E(this.prototype,m);return this}});var jsCEvents={pool:{},name:function(n){return'on'+n.substr(0,1).toUpperCase()+n.substr(1)}};jsClass.Base.methods({addEventListener:function(n,h){n=n.toLowerCase();if(!this.__ce_uniqId)this.__ce_uniqId=jsCore.getUniqId();if(!jsCEvents.pool[this.__ce_uniqId])jsCEvents.pool[this.__ce_uniqId]={};if(!jsCEvents.pool[this.__ce_uniqId][n])jsCEvents.pool[this.__ce_uniqId][n]=[];jsCEvents.pool[this.__ce_uniqId][n].push(h);return this},removeEventListener:function(n,h){n=n.toLowerCase();if(jsCEvents.pool[this.__ce_uniqId]&&jsCEvents.pool[this.__ce_uniqId][n]){jsCEvents.pool[this.__ce_uniqId][n]=Array.remove(jsCEvents.pool[this.__ce_uniqId][n],h,1)}return this},dispatchEvent:function(n){var r=1,pN=jsCEvents.name(n),a;if(this[pN]&&(this[pN].apply(this,a=Array.prototype.slice.call(arguments,1))===false)){r=0}else if(this.__ce_uniqId&&jsCEvents.pool[this.__ce_uniqId][n=n.toLowerCase()]){var i=0,h=jsCEvents.pool[this.__ce_uniqId][n],il=h.length,a=a||Array.prototype.slice.call(arguments,1);try{for(;i<il;i++)if(h[i]&&h[i].apply(this,a)===false)r=0}catch(e){h[i]=null;debug.log('CE->dispatchEvent:',pN,a,e)}}return!!r}});var jsLoader={cache:!jsCore.local,script:{},aliases:{},css:{},Libraries:{},fL:{},files:{},file:function(u,t,a){if(!this.files[u]){var N=document.createElement(t=t||'SCRIPT');try{a=a||{};if(t=='LINK')a.rel='stylesheet';a.type=t=='LINK'?'text/css':'text/javascript';a.encoding='utf-8';a[t=='LINK'?'href':'src']=u+(u.indexOf('?')==-1?'?':'&')+'b='+jsCore.build+(this.cache?'':'&r='+jsCore.getUniqId());for(var k in a)$SA(N,k,a[k]);HEAD.insertBefore(N,HEAD.firstChild);this.files[u]=1}catch(e){}N=null}},includeCSS:function(n){this.file(this.getFileUrl(n)+'.css','LINK')},getFileUrl:function(n){return this.aliases[this.getAlias(n)]+this.getName(n)},addAlias:function(n,p,notify){if(!this.aliases[n]){this.aliases[n]=(n=='jsCore'||(/^(http:\/\/|\/)/.test(p))?p:this.aliases['jsCore']+p);if(notify)jsCore.notify('alias:'+n)}},getAlias:function(n,d){if(this.aliases[n]){return n}else{var n=n.match(/\{([\w_.\/-]+)\}\.?/i);return(n?n[1]:defined(d,'jsCore'))}},getName:function(r){return r.replace(/\{[\w._\/-]+\}/ig,'')},_require:function(){},require:function(r,c){if(typeof r=='string')r=r.split(',');var r=Array.filter(r,function(v){if(!this.fL[v]){this.fL[v]={r:0,t:+new Date};this.file(this.getFileUrl(v)+'.js')}return!this.fL[v].r},this);c=c||jsCore.F;r.length?jsCore.wait(r,c):c()},isLoaded:function(s){return this.fL[s]&&this.fL[s].r},loaded:function(s,f){if(!this.fL[s])this.fL[s]={t:+new Date};if(this.fL[s])this.fL[s].r=1;if(!f)jsCore.notify(s)}};var d=document.location.href.toLowerCase().match(/debug=(\w+)($|&|#)/);var _log=(jsCore.local&&window.opera&&opera.postError)||jsCore.F;var debug={_flog:[],screen:d&&/y|yes|s|show/.test(d[1]),log:_log,group:_log,groupEnd:_log};if(debug.screen){debug._text='';debug.log=_log=function(a){a=Array.prototype.join.call(arguments,' ');this._text=a+'<br />'+this._text};if(debug.screen)jsCore.wait('loaded:Alias,{jQuery}jquery',function(){jsLoader.require('{utils}debug')})}else if(jsCore.local&&window.console){if(console.log)debug.log=function(){_apply_(console,'log',arguments)};if(console.group)debug.group=function(){console.group.apply(console,arguments)};if(console.groupEnd)debug.groupEnd=function(){console.groupEnd()}};debug.logIF=function(a){if(a)debug.log.apply(debug,Array.prototype.slice.call(arguments,1))};debug.file=function(d){return;if(!this._file){this._file=document.createElement('IMG');$E(this._file.style,{position:'absolute',top:-1000,visibility:'hidden'});this._head=document.getElementsByTagName('HEAD')[0].firstChild}this._flog.push('http://194.67.27.119/js-debug?d='+encodeURIComponent(jsCore.uniqId+"\t"+d));do{this._file=this._file.cloneNode(true);this._file.src=this._flog.shift();this._head.parentNode.insertBefore(this._file,this._head)}while(this._flog.length)};var jsCookie={DAY:86400,WEEK:86400*7,MONTH:86400*30,YEAR:86400*365,set:function(k,v,e,p){if(!v)v=0;if((typeof e!='undefined')&&(e!==true))e='expires='+(new Date((new Date).getTime()+(e*1000))).toGMTString()+';';else e='';this.remove(k);document.cookie=k+'='+v+'; path='+(p||'/')+'; '+e;return this},get:function(k,d){if(!k)return document.cookie;var re=new RegExp(k+'='),c=jsCookie.get().split(/;\s+/);for(var i=0,n=c.length;i<n;i++)if(re.test(c[i]))return c[i].split('=')[1];return d},has:function(k){var v=this.get(k);return(v&&!((v=='false')||(v=='null')||(v=='')))},remove:function(k){e=(new Date(1)).toGMTString();document.cookie=k+'=null; expires='+e;document.cookie=k+'=null; path=/; expires='+e;return this}};var Registry={_data:{},has:function(key){return typeof(this._data[key])!='undefined'},get:function(key){return this._data[key]},put:function(key,value){this._data[key]=value;return this},remove:function(key){this._data[key]=jsCore.undefined;return this},inc:function(key,name,count){this._data[key][name]=this._data[key][name]*1+(count||1)*1;return this},dec:function(key,name,count){this._data[key][name]=this.inc(key,name,count||-1);return this},destroy:function(){jsCore.destroy(this._data);jsCore.destroy(this)}};var Interval={pool:[],create:function(func,mSec,loop){var id;if(loop=defined(loop,true)){id=setInterval(func,mSec||0)}else{id=setTimeout(function(){func();Interval.remove(id)},mSec||0)}this.pool.push(id);return id},remove:function(id){this.pool=Array.remove(this.pool,id,1);clearTimeout(id);clearInterval(id)},destroy:function(){while(this.pool.length)this.remove(this.pool[0]);this.pool=null}};var Timeout={create:function(func,mSec){return Interval.create(func,mSec,false)},remove:function(id){Interval.remove(id)}};var jsEvent={Key:{'up':38,'down':40,'left':37,'right':39,'esc':27,'home':36,'end':35,'pageup':33,'pagedown':34,'ins':45,'del':46,'insert':45,'delete':46,'back':8,'backspace':8,'space':32,'bar':32,'spacebar':32,'enter':13,'cmd':224,'pause':19,'break':3,'alt':18,'ctrl':17,'shift':16,'tab':9,'caps':20,'capslock':20,'plus':107,'minus':109,isControl:function(c){return c<47}},add:function(o,name,listener,captures){if(o){captures=(captures?true:false);o.attachEvent?o.attachEvent('on'+name,listener,captures):o.addEventListener(name,listener,captures)}},remove:function(o,name,listener,captures){if(o){captures=(captures?true:false);o.detachEvent?o.detachEvent('on'+name,listener,captures):o.removeEventListener(name,listener,captures)}},fire:function(e,n){do{jQuery(e).trigger(n)}while((e=e.parentNode)&&(e.parentNode!=document))}};if(debug.screen){window.onerror=function(){jsCore.error.apply(jsCore,arguments);return true}}if(window.jsCoreAlias){if(typeof jsCoreAlias=='string')jsCoreAlias={jsCore:jsCoreAlias};for(var a in jsCoreAlias)jsLoader.addAlias(a,jsCoreAlias[a])}else jsLoader.addAlias('jsCore','http://rubaxa.org/.jsCore/');(function(){jsEvent.add(window,'unload',jsCore.unload);if(document.addEventListener){document.addEventListener('DOMContentLoaded',function(){document.removeEventListener('DOMContentLoaded',arguments.callee,false);jsCore.ready()},false)}else if(document.attachEvent){document.attachEvent('onreadystatechange',function(){if(document.readyState==='complete'){document.detachEvent('onreadystatechange',arguments.callee);jsCore.ready()}});if(document.documentElement.doScroll&&window==window.top)(function(){if(jsCore.isReady)return;try{document.documentElement.doScroll('left')}catch(error){setTimeout(arguments.callee,10);return}jsCore.ready()})()}jsEvent.add(window,'load',jsCore.ready)})();$E(Math,{KB:1024,MB:Math.pow(1024,2),TB:Math.pow(1024,3),sign:function(a){return(a>=0)?1:-1},_round:Math.round,round:function(v,z){return(z&&(z=Math.pow(10,z))?Math._round(v*z)/z:Math._round(v))},rand:function(min,max){if(defined(min)){return defined(max)?min+Math.round(Math.random()*(max-min)):Math.round(Math.random()*min)}return Math.random()},min_max:function(v,m,M){return Math.max(m,Math.min(v,M))}});$E(window,{now:function(){return(new Date).getTime()},scrollTop:function(){return window.$WIN?($WIN.scrollTop()||$HTML.scrollTop()):(document.body&&document.body.scrollTop||0)},scrollLeft:function(){return window.$WIN?($WIN.scrollLeft()||$HTML.scrollLeft()):(document.body&&document.body.scrollLeft||0)},width:function(){return window.innerWidth?window.innerWidth:(document.documentElement?(document.documentElement.clientWidth||document.body&&document.body.clientWidth||0):0)},height:function(){return window.innerHeight?window.innerHeight:(document.documentElement?(document.documentElement.clientHeight||document.body&&document.body.clientHeight||0):0)},reload:function(){location.href=location.href.split('#')[0]}});if(window.jsLoaderLoaded&&(jsLoaderLoaded.constructor==Array)){for(var i=0;i<jsLoaderLoaded.length;i++){jsLoader.loaded(jsLoaderLoaded[i])}jsLoaderLoaded=null}function runOneBy(id,e,u,o){function l(){jQ(id).unbind(e.split('|')[0]);if(typeof u=='string'){if(o&&o.consctructor==Function){o(id)}else{var k=jsLoader.getName(u).split('.'),K=window[k[0]],i=1;for(n=k.length;i<n;i++){K=K[k[i]]}new K(o,id)}}else{u()}};function r(){jsCore.ready(function(){var t=e.split('|'),f=0;jQ(id).bind(t[0],function(){if($GA(this,'_runOneBy')!=1){jQ(id).attr('_runOneBy',1);typeof u=='string'?jsLoader.require(u,l):l()}return!1});if(t[1]){for(var i=1,g;t[i];i++){g=t[i].split('&');f=1;for(var p=0;g[p];p++)if(t[i]!='true'&&location.href.indexOf(g[p])==-1){f=0;break}if(f)break}}if(f)jQ(id).item(0)[t[0]]()})};domReady(function(){jsLoader.isLoaded('{jQuery}extensions')?r():jsLoader.require('{jQuery}extensions',r)})};$PPBy=function(id,e,p,o){runOneBy(id,e,p,function(){jQ(id).setPlugin(p,o)})};var LFade={show:function(){if(this.F){this.timer(1);this.F.display=''}},hide:function(){if(this.F){this.timer();this.F.display='none';LFade.N.innerHTML=''}},timer:function(s){var i=0,s='.....';this.i=clearInterval(this.i);if(s)this.i=setInterval(function(){LFade.N.innerHTML=s.substr(0,i++);if(i>5)i=0},200)}};function loadOneBy(id,e,u,h){if(!e)e='click';if(!u)u=$F(id).href;runOneBy(id,e,function(){LFade.show();jQ.get(u,'_html_=Y',function(R){jQ(R.toText?R.toText():R).appendTo(h||BODY)})})};$P('jsCore.file',1);$P('jsCore.ready');;
jsLoader.loaded('{jsCore}jsCore', 1);$P('jsBuild.{jsCore}jsCore', 1);


$P('jsBuild.{jsCore}Alias');$P('jsCore.Alias');jsLoader.addAlias('labs','labs/');jsLoader.addAlias('utils','utils/');jsLoader.addAlias('jQuery','jquery/');jsLoader.addAlias('project','Projects/Base/');jsLoader.addAlias('lang.data','build/lang-ru.js?a=getLang');jsLoader.addAlias('plugins','plugins/');jsLoader.addAlias('highlight','plugins/highlight/');jsLoader.addAlias('adv.mamba','components/mamba/adv/');jsLoader.addAlias('mamba','components/mamba/');jsLoader.addAlias('mamba.travel','plugins/mamba/travel/');jsLoader.addAlias('mamba.plugins','plugins/mamba/');jsLoader.addAlias('mamba.weborama','plugins/mamba/weborama/');jsLoader.addAlias('mamba.mirtesen','plugins/mamba/mirtesen/');jsLoader.addAlias('mamba.messenger','components/messenger/');jsLoader.addAlias('mamba.project','Projects/mamba.ru/');jsLoader.addAlias('components','components/');jsLoader.addAlias('component.users','components/Users/');jsLoader.addAlias('orbited','components/orbited/');jsLoader.addAlias('rubaxa.org','components/rubaxa.org/');jsLoader.addAlias('101g','plugins/101g/');jsLoader.addAlias('101g.plugins','plugins/101g/');jsLoader.addAlias('lovers','Projects/lovers.ru/');jsLoader.addAlias('lovers.chat','Projects/lovers.ru/chat/');jsLoader.addAlias('lovers.plugins','Projects/lovers.ru/plugins/');jsLoader.addAlias('lovers.messenger','Projects/lovers.ru/messenger/');jsLoader.addAlias('pixelpost','Projects/pixelpost.ru/');jsLoader.addAlias('pixelpost.lego','Projects/pixelpost.ru/Lego/');jsLoader.addAlias('pixelpost.plugins','Projects/pixelpost.ru/Plugins/');jsLoader.addAlias('gay','Projects/gay.ru/');jsLoader.addAlias('gay.test','Projects/gay.ru/Test/');jsLoader.addAlias('gay.staff','Projects/gay.ru/Staff/');jsLoader.addAlias('gay.layers','Projects/gay.ru/Layers/');jsLoader.addAlias('gay.twitter','Projects/gay.ru/Twitter/');jsLoader.addAlias('gay.messenger','Projects/gay.ru/Messenger/');jsLoader.addAlias('img.pixel','/i/');jsLoader.addAlias('evectio','/.jsCore2/');jsCore.notify('loaded:Alias');$P('jsCore.Alias',1);;
jsLoader.loaded('{jsCore}Alias', 1);$P('jsBuild.{jsCore}Alias', 1);


$P('jsBuild.{jsCore}String');/**
 * Расширение объекта String
 * @author	RubaXa	<trash@rubaxa.org>
 * @version	1.0
 */
(function(){String._as={"'":new RegExp('(^|[^\\\\])((\\\\)*)\'','g'),'"':new RegExp('(^|[^\\\\])((\\\\)*)"','g')};$E(String,{_hex:function(h){return h.length<2?h+''+h:h},rgb2hex:function(c){if(typeof c=='string'){if(c.indexOf(',')<0)return'#'+c.replace('#','').replace(/^(\w)(\w)(\w)$/gi,'$1$1$2$2$3$3');c=c.replace(/(rgb\(|\)|\s+)/ig,'').split(',')}else if(c.red){c[0]=c.red;c[1]=c.green;c[2]=c.blue}c=String._hex((c[0]*1).toString(16))+String._hex((c[1]*1).toString(16))+String._hex((c[2]*1).toString(16));return'#'+c},addSlashes:function(s,q){return String(s).replace(String._as[q=(q||"'")],"$1$2\\"+q)},trim:function(s){return String(s).replace(/^([\s\r\n]+)|([\s\r\n]+)$/g,'')},num:function(n,L,i){if(L==null)return'';var x=((n%100<=10)||(n%100>=20))?n%10:0;var l=L.length;if(l==2&&x==1)x=0;else if(l==3&&x>1){x=x<5?2:0}return(i?n+(i&&(i!=1)?i:''):'')+(typeof(L)!='string'?(L[x]||L[(x>1&&x<5)?x:0]||L[x>1?1:0]):L)},ucfirst:function(s){return s.charAt(0).toUpperCase()+s.substr(1)},repeat:function(s,n){var r='',i=0;for(;i<n;i++)r+=s;return r},toQuery:function(o){var s='';if(o){if(typeof o!='string'){s=[],i=0;Object.forEach(o,function(v,k){if(v&&v.constructor==Array)s[i++]=Array.map(v,function(av){return k+'='+encodeURIComponent(av)}).join('&');else s[i++]=k+'='+encodeURIComponent(v)});return s.join('&')}else s=o}return s},toObject:function(s){if(s=String(s)){if(s.indexOf('?')>-1)s=s.split('?')[1];s=s.split('&'),o={};for(var i=0,n=s.length;i<n;i++){s[i]=s[i].split('=');if(s[i][0])o[s[i][0]]=decodeURIComponent(s[i][1])||''}s=null;return o}return{}},html2text:function(h){return String(h).replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;').replace(/"/g,'&quot;')},nl2br:function(t){return String(t).replace(/[\r\n]/g,'<br />')},wordWrap:function(t,m,l,e){t=String(t).replace(new RegExp('(\\S{'+(m||20)+'})','ig'),'$1 ');if(l&&t.length>l){var m=t.match(new RegExp('^(\\S{'+l+'})','ig'));t=(m?m[0]:t.substr(0,l))+e}return t},numberFormat:function(n,d,f,s){var n=Math.round(n,d).toString().split('.');if(s&&n[0].length>3)n[0]=n[0].replace(/(\d{3})+$/g,s+'$1');return n[0]+(n[1]?f+n[1]:'')},sprintf:function(txt){for(var i=1,n=arguments.length;i<n;i++)txt=txt.replace('%s',arguments[i]);return txt},concat:function(){return Array.prototype.join.call(arguments,'')}});jsCore.String=function(s){this.str=s};jsCore.String.prototype=new String;(function(S){Object.forEach(String,function(func,name){if(name[0]!='_')S[name]=function(){return new jsCore.String(arguments.length?func.apply(String,[this.str].concat(arguments)):func.call(String,this.str))}});S.constructor=jsCore.String})(jsCore.String.prototype)})();;
jsLoader.loaded('{jsCore}String', 1);$P('jsBuild.{jsCore}String', 1);


$P('jsBuild.{jsCore}JSON');/**
 * @class	JSON
 * @author	RubaXa	<trash@rubaxa.org>
 * @version	1.0
 */
(function(){var JSON=function(){this.__construct.apply(this,arguments)};JSON.quote='"';JSON.prototype={__construct:function(value){this.value=value},serialize:function(value){this.quoteRE=new RegExp('(^|[^\\\\])((\\\\)*)'+JSON.quote,'g');if(typeof(value)=='undefined')value=this.value;var result='';if(value==null)return'null';switch(typeof(value)){case'object':{if(value){if(value.constructor==Array){result=this.serializeArray(value)}else{result=this.serializeObject(value)}}}break;case'number':result=this.serializeNumber(value);break;case'boolean':result=this.serializeBoolean(value);break;default:result=this.serializeString(value);break}return result},serializeString:function(v){return JSON.quote+String.addSlashes(String(v).replace(/([^\\])'/g,'$1\'').replace(/[\r\n]/g,'\\n'),JSON.quote)+JSON.quote},serializeArray:function(array){var result=[];var value;for(var i=0,n=array.length;i<n;i++){result.push(this.serialize(array[i]))}return'['+result.join(',')+']'},serializeBoolean:function(bool){return new String(bool)},serializeDate:function(date){function f(n){return n<10?'0'+n:n};return'\''+date.getUTCFullYear()+'-'+f(date.getUTCMonth()+1)+'-'+f(date.getUTCDate())+'T'+f(date.getUTCHours())+':'+f(date.getUTCMinutes())+':'+f(date.getUTCSeconds())+'Z\''},serializeNumber:function(number){return isFinite(number)?new String(number):'null'},serializeObject:function(obj){var a=[];if(obj){for(var i in obj){a.push(this.serialize(i)+':'+this.serialize(obj[i]))}}return'{'+a.join(',')+'}'}};jsCore.JSON=new JSON();window.serialize=function(v){return jsCore.JSON.serialize(v)}})();;
jsLoader.loaded('{jsCore}JSON', 1);$P('jsBuild.{jsCore}JSON', 1);


$P('jsBuild.{utils}Lang');/**
 * @object	Lang
 * @author	RubaXa	<trash@rubaxa.org>
 * @version	1.0
 * Объект для работы с разными языками.
 */
var Lang=({data:{},vars:{},locals:[],def:'',path:'',init:function(){this.setDataPath(jsLoader.aliases['lang.data']||'');this.setLocal(window['LANG_DEFAULT']||'RU');return this},setDataPath:function(p){this.path=p},addLocal:function(l,nl){if(typeof(l)=='string')l=l.split(',');for(var i=0;i<l.length;i++){if(!this.data[l[i]=l[i].toUpperCase()]){this.locals.push(l[i]);this.data[l[i]]={}}}if(nl=defined(nl,true))this.load(false,nl.constructor==Function?nl:0);return this},setLocal:function(l){this.def=l.toUpperCase();this.addLocal(l);return this},load:function(v,s){if(v){if(typeof(v)=='string')v=v.split(',');for(var i=0,n=v.length;i<n;i++){if(!this.vars[v[i]]){this.vars[v[i]]=1}}}var r=0,w='';for(var v in this.vars){for(var j=0,nl=this.locals.length;j<nl;j++){if(!this.data[this.locals[j]][v]){this.data[this.locals[j]][v]=1;if(!r)r={};if(!r[this.locals[j]])r[this.locals[j]]=[];r[this.locals[j]].push(v);wId=',lang:'+this.locals[j]+'-'+v}}}if(r){jsCore.request({url:this.path,data:'l='+serialize(r),cache:1,success:$D(this,'add')});if(s)jsCore.wait(wId.substr(1),s)}else if(s){s()}},add:function(d){var n=[];for(var l in d){for(var v in d[l]){this.data[l][v]=d[l][v];n.push('lang:'+l+'-'+v)}}jsCore.notify(n);return this},get:function(v,l){if(v.indexOf('/')>-1){v=v.split('/');l=v[0];v=v[1]}return this.data[l||this.def][v]},fileSize:function(s,L){var x=Math.floor(Math.log(s||1)/Math.log(1024));return L?String.num(Math.round(s/Math.pow(1024,x)),L[x],' '):x}}).init();;
jsLoader.loaded('{utils}Lang', 1);$P('jsBuild.{utils}Lang', 1);
Lang.add({"RU":{"Base":1,"Date":{"months":[["\u044f\u043d\u0432\u0430\u0440\u044c","\u0444\u0435\u0432\u0440\u0430\u043b\u044c","\u043c\u0430\u0440\u0442","\u0430\u043f\u0440\u0435\u043b\u044c","\u043c\u0430\u0439","\u0438\u044e\u043d\u044c","\u0438\u044e\u043b\u044c","\u0430\u0432\u0433\u0443\u0441\u0442","\u0441\u0435\u043d\u0442\u044f\u0431\u0440\u044c","\u043e\u043a\u0442\u044f\u0431\u0440\u044c","\u043d\u043e\u044f\u0431\u0440\u044c","\u0434\u0435\u043a\u0430\u0431\u0440\u044c"],["\u044f\u043d\u0432\u0430\u0440\u044f","\u0444\u0435\u0432\u0440\u0430\u043b\u044f","\u043c\u0430\u0440\u0442\u0430","\u0430\u043f\u0440\u0435\u043b\u044f","\u043c\u0430\u044f","\u0438\u044e\u043d\u044f","\u0438\u044e\u043b\u044f","\u0430\u0432\u0433\u0443\u0441\u0442\u0430","\u0441\u0435\u043d\u0442\u044f\u0431\u0440\u044f","\u043e\u043a\u0442\u044f\u0431\u0440\u044f","\u043d\u043e\u044f\u0431\u0440\u044f","\u0434\u0435\u043a\u0430\u0431\u0440\u044f"]]},"FileSize":{"0":["\u0431\u0430\u0439\u0442","\u0431\u0430\u0439\u0442\u0430"],"1":["\u043a\u0438\u043b\u043e\u0431\u0430\u0439\u0442","\u043a\u0438\u043b\u043e\u0431\u0430\u0439\u0442\u0430"],"2":["\u043c\u0435\u0433\u0430\u0431\u0430\u0439\u0442","\u043c\u0435\u0433\u0430\u0431\u0430\u0439\u0442\u0430"],"3":["\u0433\u0438\u0433\u0430\u0431\u0430\u0439\u0442","\u0433\u0438\u0433\u0430\u0431\u0430\u0439\u0442\u0430"],"4":["\u0442\u0435\u0440\u0430\u0431\u0430\u0439\u0442","\u0442\u0435\u0440\u0430\u0431\u0430\u0439\u0442\u0430"],"short":["B","KB","MB","T"]},"send":"\u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c","pleaseWait":"\u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430 \u043f\u043e\u0434\u043e\u0436\u0434\u0438\u0442\u0435","InternalError":"\u041e\u0449\u0438\u0431\u043a\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0435\u0449\u0435 \u0440\u0430\u0437","sex":{"be":{"M":"\u0431\u044b\u043b","F":"\u0431\u044b\u043b\u0430","MF":"\u0431\u044b\u043b\u0438","FF":"\u0431\u044b\u043b\u0438","MM":"\u0431\u044b\u043b\u0438","T":"\u0431\u044b\u043b\u043e"},"his":{"M":"\u0435\u0433\u043e","F":"\u0435\u0451","MF":"\u0438\u0445","FF":"\u0438\u0445","MM":"\u0438\u0445","T":"\u0435\u0433\u043e"},"add":{"M":"\u0434\u043e\u0431\u0430\u0432\u0438\u043b","F":"\u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0430","MF":"\u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438","FF":"\u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438","MM":"\u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438","T":"\u0434\u043e\u0431\u0430\u0432\u0438\u043b\u043e"}},"unread":["\u043d\u043e\u0432\u044b\u0445","\u043d\u043e\u0432\u043e\u0435","\u043d\u043e\u0432\u044b\u0445"],"messages":["\u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439","\u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435","\u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f"]}});

$P('jsBuild.{jsCore}Date');/**
 * Расширение класса Date
 * @author	"RubaXa"		<trash@rubaxa.org>
 */
$E(Date,{is:function(d){if(d){return d.setTime||/(^\d+$|^((\d{1,4}[-:\s\/]?)+)$)/.test(d+'')}return!1},_timer:(new Date()).getTime(),timeZone:(window.timeZone||window.TIMEZONE||4),getTime:function(){return this.changeNow().getNow().getTime()},getUnixtime:function(){return Math.round(this.getTime()/1000)},setNow:function(time){this._now_=new Date(time);this._today_=new Date(time);this._yesterday_=new Date(time);this._today_.setHours(0);this._today_.setMinutes(0);this._yesterday_.setTime(this._today_.getTime());this._yesterday_.setDate(this._yesterday_.getDate()-1);return this},getNow:function(){return this.changeNow()._now_},changeNow:function(){var n=now();Date.setNow(Date._now_.getTime()+(n-Date._timer));Date._timer=n;return this},_f:function(n){return((n>9)?n:'0'+n)},_parse:Date.parse,parse:function(s){if(s&&s.setTime)return s;try{var D=/^\d+$/.test(s)?new Date(s):Date._parse(s);if(D.constructor!=Date)D=new Date(String(s).replace(/^(\d{4})-(\d{2})-(\d{2})/,'$2/$3/$1'))}catch(e){debug.log('Date',e)}return D}});$E(Date.prototype,{timeZone:Date.timeZone,isNow:function(interval){Date.changeNow();return(Date._now_.getTime()-this.getTime())<=interval},isToday:function(){return(Date._today_.getTime()<this.getTime())},isYesterday:function(){return!this.isToday()&&(Date._yesterday_.getTime()<this.getTime())},setTimeZone:function(z){this.timeZone=z*1;return this},format:function(f){var t=this.getTime(),r='',f=f.split('');this.setTime(t+(this.getTimezoneOffset()+this.timeZone*60)*60000);for(var i=0,n=f.length;i<n;i++){switch(f[i]){case'Y':r+=this.getFullYear();break;case'y':r+=Date._f(this.getFullYear()%100);break;case'N':r+=String.ucfirst(Lang.get('Date').months[1][this.getMonth()]);break;case'n':r+=Lang.get('Date').months[1][this.getMonth()];break;case'M':r+=Date._f(this.getMonth()+1);break;case'm':r+=this.getMonth()+1;break;case'D':r+=Date._f(this.getDate());break;case'd':r+=this.getDate();break;case'H':r+=Date._f(this.getHours());break;case'h':r+=this.getHours();break;case'I':r+=Date._f(this.getMinutes());break;case'i':r+=this.getMinutes();break;case'S':r+=Date._f(this.getSeconds());break;case's':r+=this.getSeconds();break;default:r+=f[i];break}}this.setTime(t);return r},diffYears:function(Y,M,D){if(isNaN(Y)){Y=Date.parse(Y);D=Y.getDate();M=Y.getMonth()+1;Y=Y.getFullYear()}var cM=this.getMonth()+1;Y=this.getFullYear()-Y;if((M>cM)||(D>this.getDate()&&M==cM))Y--;return Y}});Lang.load('Date',function(){Date.setNow(window.time||window.TIME||now());Interval.create(Date.changeNow,60*1000)});;
jsLoader.loaded('{jsCore}Date', 1);$P('jsBuild.{jsCore}Date', 1);


$P('jsBuild.{jsCore}PropertiesMapper');/**
 * @class	PropertiesMapper
 * @author	RubaXa		<trash@rubaxa.org>
 */
jsClass.create('PropertiesMapper').methods({__construct:function(o,n){this.__properties(n||'$',o)},__properties:function(n,d){this.__pn__=n;this.__cpn__='_'+n;this[this.__pn__]=(d||{});this[this.__cpn__]={}},set:function(p,v){this.isChanged=!1;this[this.__cpn__]={};if(typeof p=='string'){var k=p;p={};p[k]=v}for(var k in p){if(this[this.__pn__][k]!==p[k]){this[this.__cpn__][k]=this[this.__pn__][k];this[this.__pn__][k]=p[k];this.isChanged=!0}}if(this.isChanged)this.dispatchEvent('change',this);return this},get:function(n){if(!n)return this[this.__pn__];else if(typeof n=='string')return this[this.__pn__][n];else return Array.extract(this[this.__pn__],n)},cloneProperties:function(){return $E({},this.get())},getChanges:function(){return this[this.__cpn__]},toObject:function(){return $clone(this[this.__pn__])}});;
jsLoader.loaded('{jsCore}PropertiesMapper', 1);$P('jsBuild.{jsCore}PropertiesMapper', 1);


$P('jsBuild.{jQuery}jquery');$P('jQuery.file');$P('jQuery.loaded');(function(){if(!document.nodeType){window.tagName=window.nodeName='WINDOW';document.tagName=document.nodeName='DOCUMENT';window.nodeType=document.nodeType=1}var window=this,undefined,_jQuery=window.jQuery,_$=window.$,jQuery=window.jQuery=window.$=function(selector,context){return new jQuery.fn.init(selector,context)},quickExpr=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,isSimple=/^.[^:#\[\.,]*$/;jQuery.fn=jQuery.prototype={init:function(selector,context){selector=selector||document;if(selector.nodeType){this[0]=selector;this.length=1;this.context=selector;return this}if(typeof selector==="string"){var match=quickExpr.exec(selector);if(match&&(match[1]||!context)){if(match[1])selector=jQuery.clean([match[1]],context);else{var elem=document.getElementById(match[3]);if(elem&&elem.id!=match[3])return jQuery().find(selector);var ret=jQuery(elem||[]);ret.context=document;ret.selector=selector;return ret}}else return jQuery(context).find(selector)}else if(jQuery.isFunction(selector))return jQuery(document).ready(selector);if(selector.selector&&selector.context){this.selector=selector.selector;this.context=selector.context}return this.setArray(jQuery.isArray(selector)?selector:jQuery.makeArray(selector))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(num){return num===undefined?Array.prototype.slice.call(this):this[num]},pushStack:function(elems,name,selector){var ret=jQuery(elems);ret.prevObject=this;ret.context=this.context;if(name==="find")ret.selector=this.selector+(this.selector?" ":"")+selector;else if(name)ret.selector=this.selector+"."+name+"("+selector+")";return ret},setArray:function(elems){this.length=0;Array.prototype.push.apply(this,elems);return this},each:function(callback,args){return jQuery.each(this,callback,args)},index:function(elem){return jQuery.inArray(elem&&elem.jquery?elem[0]:elem,this)},attr:function(name,value,type){var options=name;if(typeof name==="string")if(value===undefined)return this[0]&&jQuery[type||"attr"](this[0],name);else{options={};options[name]=value}return this.each(function(i){for(name in options)jQuery.attr(type?this.style:this,name,jQuery.prop(this,options[name],type,i,name))})},css:function(key,value){if((key=='width'||key=='height')&&parseFloat(value)<0)value=undefined;return this.attr(key,value,"curCSS")},text:function(text){if(typeof text!=="object"&&text!=null)return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(text));var ret="";jQuery.each(text||this,function(){jQuery.each(this.childNodes,function(){if(this.nodeType!=8)ret+=this.nodeType!=1?this.nodeValue:jQuery.fn.text([this])})});return ret},wrapAll:function(html){if(this[0]){var wrap=jQuery(html,this[0].ownerDocument).clone();if(this[0].parentNode)wrap.insertBefore(this[0]);wrap.map(function(){var elem=this;while(elem.firstChild)elem=elem.firstChild;return elem}).append(this)}return this},wrapInner:function(html){return this.each(function(){jQuery(this).contents().wrapAll(html)})},wrap:function(html){return this.each(function(){jQuery(this).wrapAll(html)})},append:function(){return this.domManip(arguments,true,function(elem){if(this.nodeType==1)this.appendChild(elem)})},prepend:function(){return this.domManip(arguments,true,function(elem){if(this.nodeType==1)this.insertBefore(elem,this.firstChild)})},before:function(){return this.domManip(arguments,false,function(elem){this.parentNode.insertBefore(elem,this)})},after:function(){return this.domManip(arguments,false,function(elem){this.parentNode.insertBefore(elem,this.nextSibling)})},end:function(){return this.prevObject||jQuery([])},push:[].push,sort:[].sort,splice:[].splice,find:function(selector){if(this.length===1){var ret=this.pushStack([],"find",selector);ret.length=0;jQuery.find(selector,this[0],ret);return ret}else{return this.pushStack(jQuery.unique(jQuery.map(this,function(elem){return jQuery.find(selector,elem)})),"find",selector)}},clone:function(events){var ret=this.map(function(){if(!jQuery.support.noCloneEvent&&!jQuery.isXMLDoc(this)){var html=this.outerHTML;if(!html){var div=this.ownerDocument.createElement("div");div.appendChild(this.cloneNode(true));html=div.innerHTML}return jQuery.clean([html.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else return this.cloneNode(true)});if(events===true){var orig=this.find("*").andSelf(),i=0;ret.find("*").andSelf().each(function(){if(this.nodeName!==orig[i].nodeName)return;var events=jQuery.data(orig[i],"events");for(var type in events){for(var handler in events[type]){jQuery.event.add(this,type,events[type][handler],events[type][handler].data)}}i++})}return ret},filter:function(selector){return this.pushStack(jQuery.isFunction(selector)&&jQuery.grep(this,function(elem,i){return selector.call(elem,i)})||jQuery.multiFilter(selector,jQuery.grep(this,function(elem){return elem.nodeType===1})),"filter",selector)},closest:function(selector){var pos=jQuery.expr.match.POS.test(selector)?jQuery(selector):null,closer=0;return this.map(function(){var cur=this;while(cur&&cur.ownerDocument){if(pos?pos.index(cur)>-1:jQuery(cur).is(selector)){jQuery.data(cur,"closest",closer);return cur}cur=cur.parentNode;closer++}})},not:function(selector){if(typeof selector==="string")if(isSimple.test(selector))return this.pushStack(jQuery.multiFilter(selector,this,true),"not",selector);else selector=jQuery.multiFilter(selector,this);var isArrayLike=selector.length&&selector[selector.length-1]!==undefined&&!selector.nodeType;return this.filter(function(){return isArrayLike?jQuery.inArray(this,selector)<0:this!=selector})},add:function(selector){return this.pushStack(jQuery.unique(jQuery.merge(this.get(),typeof selector==="string"?jQuery(selector):jQuery.makeArray(selector))))},is:function(selector){return!!selector&&jQuery.multiFilter(selector,this).length>0},hasClass:function(selector){return!!selector&&this.is("."+selector)},val:function(value){if(value===undefined){var elem=this[0];if(elem){if(jQuery.nodeName(elem,'option'))return(elem.attributes.value||{}).specified?elem.value:elem.text;if(jQuery.nodeName(elem,"select")){var index=elem.selectedIndex,values=[],options=elem.options,one=elem.type=="select-one";if(index<0)return null;for(var i=one?index:0,max=one?index+1:options.length;i<max;i++){var option=options[i];if(option.selected){value=jQuery(option).val();if(one)return value;values.push(value)}}return values}return(elem.value||"").replace(/\r/g,"")}return undefined}if(typeof value==="number")value+='';return this.each(function(){if(this.nodeType!=1)return;if(jQuery.isArray(value)&&/radio|checkbox/.test(this.type))this.checked=(jQuery.inArray(this.value,value)>=0||jQuery.inArray(this.name,value)>=0);else if(jQuery.nodeName(this,"select")){var values=jQuery.makeArray(value);jQuery("option",this).each(function(){this.selected=(jQuery.inArray(this.value,values)>=0||jQuery.inArray(this.text,values)>=0)});if(!values.length)this.selectedIndex=-1}else this.value=value})},html:function(value){return value===undefined?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(value)},replaceWith:function(value){return this.after(value).remove()},eq:function(i){return this.slice(i,+i+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(callback){return this.pushStack(jQuery.map(this,function(elem,i){return callback.call(elem,i,elem)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(args,table,callback){if(this[0]){var fragment=(this[0].ownerDocument||this[0]).createDocumentFragment(),scripts=jQuery.clean(args,(this[0].ownerDocument||this[0]),fragment),first=fragment.firstChild;if(first)for(var i=0,l=this.length;i<l;i++)callback.call(root(this[i],first),this.length>1||i>0?fragment.cloneNode(true):fragment);if(scripts)jQuery.each(scripts,evalScript)}return this;function root(elem,cur){return table&&jQuery.nodeName(elem,"table")&&jQuery.nodeName(cur,"tr")?(elem.getElementsByTagName("tbody")[0]||elem.appendChild(elem.ownerDocument.createElement("tbody"))):elem}}};jQuery.fn.init.prototype=jQuery.fn;function evalScript(i,elem){if(elem.src)jQuery.ajax({url:elem.src,async:false,dataType:"script"});else jQuery.globalEval(elem.text||elem.textContent||elem.innerHTML||"");if(elem.parentNode)elem.parentNode.removeChild(elem)}function now(){return+new Date}jQuery.extend=jQuery.fn.extend=function(){var target=arguments[0]||{},i=1,length=arguments.length,deep=false,options;if(typeof target==="boolean"){deep=target;target=arguments[1]||{};i=2}if(typeof target!=="object"&&!jQuery.isFunction(target))target={};if(length==i){target=this;--i}for(;i<length;i++)if((options=arguments[i])!=null)for(var name in options){var src=target[name],copy=options[name];if(target===copy)continue;if(deep&&copy&&typeof copy==="object"&&!copy.nodeType)target[name]=jQuery.extend(deep,src||(copy.length!=null?[]:{}),copy);else if(copy!==undefined)target[name]=copy}return target};var exclude=/z-?index|font-?weight|opacity|zoom|line-?height/i,defaultView=document.defaultView||{},toString=Object.prototype.toString;jQuery.extend({noConflict:function(deep){window.$=_$;if(deep)window.jQuery=_jQuery;return jQuery},isFunction:function(obj){return toString.call(obj)==="[object Function]"},isArray:function(obj){return toString.call(obj)==="[object Array]"},isXMLDoc:function(elem){return elem.nodeType===9&&elem.documentElement.nodeName!=="HTML"||!!elem.ownerDocument&&jQuery.isXMLDoc(elem.ownerDocument)},globalEval:function(data){if(data&&/\S/.test(data)){var head=document.getElementsByTagName("head")[0]||document.documentElement,script=document.createElement("script");script.type="text/javascript";if(jQuery.support.scriptEval)script.appendChild(document.createTextNode(data));else script.text=data;head.insertBefore(script,head.firstChild);head.removeChild(script)}},nodeName:function(elem,name){return elem.nodeName&&elem.nodeName.toUpperCase()==name.toUpperCase()},each:function(object,callback,args){var name,i=0,length=object.length;if(args){if(length===undefined){for(name in object)if(callback.apply(object[name],args)===false)break}else for(;i<length;)if(callback.apply(object[i++],args)===false)break}else{if(length===undefined){for(name in object)if(callback.call(object[name],name,object[name])===false)break}else for(var value=object[0];i<length&&callback.call(value,i,value)!==false;value=object[++i]){}}return object},prop:function(elem,value,type,i,name){if(jQuery.isFunction(value))value=value.call(elem,i);return typeof value==="number"&&type=="curCSS"&&!exclude.test(name)?value+"px":value},className:{add:function(elem,classNames){jQuery.each((classNames||"").split(/\s+/),function(i,className){if(elem.nodeType==1&&!jQuery.className.has(elem.className,className))elem.className+=(elem.className?" ":"")+className})},remove:function(elem,classNames){if(elem.nodeType==1)elem.className=classNames!==undefined?jQuery.grep(elem.className.split(/\s+/),function(className){return!jQuery.className.has(classNames,className)}).join(" "):""},has:function(elem,className){return elem&&jQuery.inArray(className,(elem.className||elem).toString().split(/\s+/))>-1}},swap:function(elem,options,callback){var old={};for(var name in options){old[name]=elem.style[name];elem.style[name]=options[name]}callback.call(elem);for(var name in options)elem.style[name]=old[name]},css:function(elem,name,force,extra){if(name=="width"||name=="height"){var val,props={position:"absolute",visibility:"hidden",display:"block"},which=name=="width"?["Left","Right"]:["Top","Bottom"];function getWH(){val=name=="width"?elem.offsetWidth:elem.offsetHeight;if(extra==="border")return;jQuery.each(which,function(){if(!extra)val-=parseFloat(jQuery.curCSS(elem,"padding"+this,true))||0;if(extra==="margin")val+=parseFloat(jQuery.curCSS(elem,"margin"+this,true))||0;else val-=parseFloat(jQuery.curCSS(elem,"border"+this+"Width",true))||0})}if(elem.offsetWidth!==0)getWH();else jQuery.swap(elem,props,getWH);return Math.max(0,Math.round(val))}return jQuery.curCSS(elem,name,force)},curCSS:function(elem,name,force){var ret,style=elem.style;if(name=="opacity"&&!jQuery.support.opacity){ret=jQuery.attr(style,"opacity");return ret==""?"1":ret}if(name.match(/float/i))name=styleFloat;if(!force&&style&&style[name])ret=style[name];else if(defaultView.getComputedStyle){if(name.match(/float/i))name="float";name=name.replace(/([A-Z])/g,"-$1").toLowerCase();var computedStyle=defaultView.getComputedStyle(elem,null);if(computedStyle)ret=computedStyle.getPropertyValue(name);if(name=="opacity"&&ret=="")ret="1"}else if(elem.currentStyle){var camelCase=name.replace(/\-(\w)/g,function(all,letter){return letter.toUpperCase()});ret=elem.currentStyle[name]||elem.currentStyle[camelCase];if(!/^\d+(px)?$/i.test(ret)&&/^\d/.test(ret)){var left=style.left,rsLeft=elem.runtimeStyle.left;elem.runtimeStyle.left=elem.currentStyle.left;style.left=ret||0;ret=style.pixelLeft+"px";style.left=left;elem.runtimeStyle.left=rsLeft}}return ret},clean:function(elems,context,fragment){context=context||document;if(typeof context.createElement==="undefined")context=context.ownerDocument||context[0]&&context[0].ownerDocument||document;if(!fragment&&elems.length===1&&typeof elems[0]==="string"){var match=/^<(\w+)\s*\/?>$/.exec(elems[0]);if(match)return[context.createElement(match[1])]}var ret=[],scripts=[],div=context.createElement("div");jQuery.each(elems,function(i,elem){if(typeof elem==="number")elem+='';if(!elem)return;if(typeof elem==="string"){elem=elem.replace(/(<(\w+)[^>]*?)\/>/g,function(all,front,tag){return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?all:front+"></"+tag+">"});var tags=elem.replace(/^\s+/,"").substring(0,10).toLowerCase();var wrap=!tags.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!tags.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||tags.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!tags.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!tags.indexOf("<td")||!tags.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!tags.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!jQuery.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];div.innerHTML=wrap[1]+elem+wrap[2];while(wrap[0]--)div=div.lastChild;if(!jQuery.support.tbody){var hasBody=/<tbody/i.test(elem),tbody=!tags.indexOf("<table")&&!hasBody?div.firstChild&&div.firstChild.childNodes:wrap[1]=="<table>"&&!hasBody?div.childNodes:[];for(var j=tbody.length-1;j>=0;--j)if(jQuery.nodeName(tbody[j],"tbody")&&!tbody[j].childNodes.length)tbody[j].parentNode.removeChild(tbody[j])}if(!jQuery.support.leadingWhitespace&&/^\s/.test(elem))div.insertBefore(context.createTextNode(elem.match(/^\s*/)[0]),div.firstChild);elem=jQuery.makeArray(div.childNodes)}if(elem.nodeType)ret.push(elem);else ret=jQuery.merge(ret,elem)});if(fragment){for(var i=0;ret[i];i++){if(jQuery.nodeName(ret[i],"script")&&(!ret[i].type||ret[i].type.toLowerCase()==="text/javascript")){scripts.push(ret[i].parentNode?ret[i].parentNode.removeChild(ret[i]):ret[i])}else{if(ret[i].nodeType===1)ret.splice.apply(ret,[i+1,0].concat(jQuery.makeArray(ret[i].getElementsByTagName("script"))));fragment.appendChild(ret[i])}}return scripts}return ret},attr:function(elem,name,value){if(!elem||elem.nodeType==3||elem.nodeType==8)return undefined;var notxml=!jQuery.isXMLDoc(elem),set=value!==undefined;name=notxml&&jQuery.props[name]||name;if(elem.tagName){var special=/href|src|style/.test(name);if(name=="selected"&&elem.parentNode)elem.parentNode.selectedIndex;if(name in elem&&notxml&&!special){if(set){if(name=="type"&&jQuery.nodeName(elem,"input")&&elem.parentNode)throw"type property can't be changed";if((name=='id'||name=='name'||name=='action'||name=='method')&&elem.tagName=='FORM'){try{$SA(elem,name,value)}catch(e){}}else elem[name]=value}if(jQuery.nodeName(elem,"form")&&elem.getAttributeNode(name))return elem.getAttributeNode(name).nodeValue;if(name=="tabIndex"){var attributeNode=elem.getAttributeNode("tabIndex");return attributeNode&&attributeNode.specified?attributeNode.value:elem.nodeName.match(/(button|input|object|select|textarea)/i)?0:elem.nodeName.match(/^(a|area)$/i)&&elem.href?0:undefined}return elem[name]}if(!jQuery.support.style&&notxml&&name=="style")return jQuery.attr(elem.style,"cssText",value);if(set)elem.setAttribute(name,""+value);var attr=!jQuery.support.hrefNormalized&&notxml&&special?elem.getAttribute(name,2):elem.getAttribute(name);return attr===null?undefined:attr}if(!jQuery.support.opacity&&name=="opacity"){if(set){elem.zoom=1;elem.filter=(elem.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(value)+''=="NaN"?"":"alpha(opacity="+value*100+")")}return elem.filter&&elem.filter.indexOf("opacity=")>=0?(parseFloat(elem.filter.match(/opacity=([^)]*)/)[1])/100)+'':""}name=name.replace(/-([a-z])/ig,function(all,letter){return letter.toUpperCase()});if(set)elem[name]=value;return elem[name]},trim:function(text){return(text||"").replace(/^\s+|\s+$/g,"")},makeArray:function(array){var ret=[];if(array!=null){var i=array.length;if(i==null||typeof array==="string"||jQuery.isFunction(array)||array.setInterval)ret[0]=array;else while(i)ret[--i]=array[i]}return ret},inArray:function(elem,array){for(var i=0,length=array.length;i<length;i++)if(array[i]===elem)return i;return-1},merge:function(first,second){var i=0,elem,pos=first.length;if(!jQuery.support.getAll){while((elem=second[i++])!=null)if(elem.nodeType!=8)first[pos++]=elem}else while((elem=second[i++])!=null)first[pos++]=elem;return first},unique:function(array){var ret=[],done={};try{for(var i=0,length=array.length;i<length;i++){var id=jQuery.data(array[i]);if(!done[id]){done[id]=true;ret.push(array[i])}}}catch(e){ret=array}return ret},grep:function(elems,callback,inv){var ret=[];for(var i=0,length=elems.length;i<length;i++)if(!inv!=!callback(elems[i],i))ret.push(elems[i]);return ret},map:function(elems,callback){var ret=[];for(var i=0,length=elems.length;i<length;i++){var value=callback(elems[i],i);if(value!=null)ret[ret.length]=value}return ret.concat.apply([],ret)}});var userAgent=navigator.userAgent.toLowerCase();jQuery.browser={version:(userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,'0'])[1],safari:/webkit/.test(userAgent),opera:/opera/.test(userAgent),msie:/msie/.test(userAgent)&&!/opera/.test(userAgent),mozilla:/mozilla/.test(userAgent)&&!/(compatible|webkit)/.test(userAgent)};jQuery.each({parent:function(elem){return elem.parentNode},parents:function(elem){return jQuery.dir(elem,"parentNode")},next:function(elem){return jQuery.nth(elem,2,"nextSibling")},prev:function(elem){return jQuery.nth(elem,2,"previousSibling")},nextAll:function(elem){return jQuery.dir(elem,"nextSibling")},prevAll:function(elem){return jQuery.dir(elem,"previousSibling")},siblings:function(elem){return jQuery.sibling(elem.parentNode.firstChild,elem)},children:function(elem){return jQuery.sibling(elem.firstChild)},contents:function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.makeArray(elem.childNodes)}},function(name,fn){jQuery.fn[name]=function(selector){var ret=jQuery.map(this,fn);if(selector&&typeof selector=="string")ret=jQuery.multiFilter(selector,ret);return this.pushStack(jQuery.unique(ret),name,selector)}});jQuery.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(name,original){jQuery.fn[name]=function(selector){var ret=[],insert=jQuery(selector);for(var i=0,l=insert.length;i<l;i++){var elems=(i>0?this.clone(true):this).get();jQuery.fn[original].apply(jQuery(insert[i]),elems);ret=ret.concat(elems)}return this.pushStack(ret,name,selector)}});jQuery.each({removeAttr:function(name){jQuery.attr(this,name,"");if(this.nodeType==1)this.removeAttribute(name)},addClass:function(classNames){jQuery.className.add(this,classNames)},removeClass:function(classNames){jQuery.className.remove(this,classNames)},toggleClass:function(classNames,state){if(typeof state=="undefined")state=!jQuery.className.has(this,classNames);jQuery.className[state?"add":"remove"](this,classNames)},detach:function(selector){return jQuery(this).remove(selector,true)},remove:function(selector,detach){if(!selector||jQuery.filter(selector,[this]).length){if(!detach){jQuery("*",this).add([this]).each(function(){jQuery.event.remove(this);jQuery.removeData(this)})}if(this.parentNode)this.parentNode.removeChild(this)}},empty:function(){jQuery(this).children().remove();while(this.firstChild)this.removeChild(this.firstChild)}},function(name,fn){jQuery.fn[name]=function(){return this.each(fn,arguments)}});function num(elem,prop){return elem[0]&&parseInt(jQuery.curCSS(elem[0],prop,true),10)||0}var expando="jQuery"+now(),uuid=0,windowData={};jQuery.extend({cache:{},data:function(elem,name,data){elem=elem==window?windowData:elem;var id=elem[expando];if(!id)id=elem[expando]=++uuid;if(name&&!jQuery.cache[id])jQuery.cache[id]={};if(data!==undefined)jQuery.cache[id][name]=data;return name?jQuery.cache[id][name]:id},removeData:function(elem,name){elem=elem==window?windowData:elem;var id=elem[expando];if(name){if(jQuery.cache[id]){delete jQuery.cache[id][name];name="";for(name in jQuery.cache[id])break;if(!name)jQuery.removeData(elem)}}else{try{delete elem[expando]}catch(e){if(elem.removeAttribute)elem.removeAttribute(expando)}delete jQuery.cache[id]}},queue:function(elem,type,data){if(elem){type=(type||"fx")+"queue";var q=jQuery.data(elem,type);if(!q||jQuery.isArray(data))q=jQuery.data(elem,type,jQuery.makeArray(data));else if(data)q.push(data)}return q},dequeue:function(elem,type){var queue=jQuery.queue(elem,type),fn=queue.shift();if(!type||type==="fx")fn=queue[0];if(fn!==undefined)fn.call(elem)}});jQuery.fn.extend({data:function(key,value){var parts=key.split(".");parts[1]=parts[1]?"."+parts[1]:"";if(value===undefined){var data=this.triggerHandler("getData"+parts[1]+"!",[parts[0]]);if(data===undefined&&this.length)data=jQuery.data(this[0],key);return data===undefined&&parts[1]?this.data(parts[0]):data}else return this.trigger("setData"+parts[1]+"!",[parts[0],value]).each(function(){jQuery.data(this,key,value)})},removeData:function(key){return this.each(function(){jQuery.removeData(this,key)})},queue:function(type,data){if(typeof type!=="string"){data=type;type="fx"}if(data===undefined)return jQuery.queue(this[0],type);return this.each(function(){var queue=jQuery.queue(this,type,data);if(type=="fx"&&queue.length==1)queue[0].call(this)})},dequeue:function(type){return this.each(function(){jQuery.dequeue(this,type)})}});(function(){var chunker=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,done=0,toString=Object.prototype.toString;var Sizzle=function(selector,context,results,seed){results=results||[];context=context||document;if(context.nodeType!==1&&context.nodeType!==9)return[];if(!selector||typeof selector!=="string"){return results}var parts=[],m,set,checkSet,check,mode,extra,prune=true;chunker.lastIndex=0;while((m=chunker.exec(selector))!==null){parts.push(m[1]);if(m[2]){extra=RegExp.rightContext;break}}if(parts.length>1&&origPOS.exec(selector)){if(parts.length===2&&Expr.relative[parts[0]]){set=posProcess(parts[0]+parts[1],context)}else{set=Expr.relative[parts[0]]?[context]:Sizzle(parts.shift(),context);while(parts.length){selector=parts.shift();if(Expr.relative[selector])selector+=parts.shift();set=posProcess(selector,set)}}}else{var ret=seed?{expr:parts.pop(),set:makeArray(seed)}:Sizzle.find(parts.pop(),parts.length===1&&context.parentNode?context.parentNode:context,isXML(context));set=Sizzle.filter(ret.expr,ret.set);if(parts.length>0){checkSet=makeArray(set)}else{prune=false}while(parts.length){var cur=parts.pop(),pop=cur;if(!Expr.relative[cur]){cur=""}else{pop=parts.pop()}if(pop==null){pop=context}Expr.relative[cur](checkSet,pop,isXML(context))}}if(!checkSet){checkSet=set}if(!checkSet){throw"Syntax error, unrecognized expression: "+(cur||selector)}if(toString.call(checkSet)==="[object Array]"){if(!prune){results.push.apply(results,checkSet)}else if(context.nodeType===1){for(var i=0;checkSet[i]!=null;i++){if(checkSet[i]&&(checkSet[i]===true||checkSet[i].nodeType===1&&contains(context,checkSet[i]))){results.push(set[i])}}}else{for(var i=0;checkSet[i]!=null;i++){if(checkSet[i]&&checkSet[i].nodeType===1){results.push(set[i])}}}}else{makeArray(checkSet,results)}if(extra){Sizzle(extra,context,results,seed);if(sortOrder){hasDuplicate=false;results.sort(sortOrder);if(hasDuplicate){for(var i=1;i<results.length;i++){if(results[i]===results[i-1]){results.splice(i--,1)}}}}}return results};Sizzle.matches=function(expr,set){return Sizzle(expr,null,null,set)};Sizzle.find=function(expr,context,isXML){var set,match;if(!expr){return[]}for(var i=0,l=Expr.order.length;i<l;i++){var type=Expr.order[i],match;if((match=Expr.match[type].exec(expr))){var left=RegExp.leftContext;if(left.substr(left.length-1)!=="\\"){match[1]=(match[1]||"").replace(/\\/g,"");set=Expr.find[type](match,context,isXML);if(set!=null){expr=expr.replace(Expr.match[type],"");break}}}}if(!set){set=context.getElementsByTagName("*")}return{set:set,expr:expr}};Sizzle.filter=function(expr,set,inplace,not){var old=expr,result=[],curLoop=set,match,anyFound,isXMLFilter=set&&set[0]&&isXML(set[0]);while(expr&&set.length){for(var type in Expr.filter){if((match=Expr.match[type].exec(expr))!=null){var filter=Expr.filter[type],found,item;anyFound=false;if(curLoop==result){result=[]}if(Expr.preFilter[type]){match=Expr.preFilter[type](match,curLoop,inplace,result,not,isXMLFilter);if(!match){anyFound=found=true}else if(match===true){continue}}if(match){for(var i=0;(item=curLoop[i])!=null;i++){if(item){found=filter(item,match,i,curLoop);var pass=not^!!found;if(inplace&&found!=null){if(pass){anyFound=true}else{curLoop[i]=false}}else if(pass){result.push(item);anyFound=true}}}}if(found!==undefined){if(!inplace){curLoop=result}expr=expr.replace(Expr.match[type],"");if(!anyFound){return[]}break}}}if(expr==old){if(anyFound==null){throw"Syntax error, unrecognized expression: "+expr}else{break}}old=expr}return curLoop};var Expr=Sizzle.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(elem){return elem.getAttribute("href")}},relative:{"+":function(checkSet,part,isXML){var isPartStr=typeof part==="string",isTag=isPartStr&&!/\W/.test(part),isPartStrNotTag=isPartStr&&!isTag;if(isTag&&!isXML){part=part.toUpperCase()}for(var i=0,l=checkSet.length,elem;i<l;i++){if((elem=checkSet[i])){while((elem=elem.previousSibling)&&elem.nodeType!==1){}checkSet[i]=isPartStrNotTag||elem&&elem.nodeName===part?elem||false:elem===part}}if(isPartStrNotTag){Sizzle.filter(part,checkSet,true)}},">":function(checkSet,part,isXML){var isPartStr=typeof part==="string";if(isPartStr&&!/\W/.test(part)){part=isXML?part:part.toUpperCase();for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){var parent=elem.parentNode;checkSet[i]=parent.nodeName===part?parent:false}}}else{for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){checkSet[i]=isPartStr?elem.parentNode:elem.parentNode===part}}if(isPartStr){Sizzle.filter(part,checkSet,true)}}},"":function(checkSet,part,isXML){var doneName=done++,checkFn=dirCheck;if(!part.match(/\W/)){var nodeCheck=part=isXML?part:part.toUpperCase();checkFn=dirNodeCheck}checkFn("parentNode",part,doneName,checkSet,nodeCheck,isXML)},"~":function(checkSet,part,isXML){var doneName=done++,checkFn=dirCheck;if(typeof part==="string"&&!part.match(/\W/)){var nodeCheck=part=isXML?part:part.toUpperCase();checkFn=dirNodeCheck}checkFn("previousSibling",part,doneName,checkSet,nodeCheck,isXML)}},find:{ID:function(match,context,isXML){if(typeof context.getElementById!=="undefined"&&!isXML){var m=context.getElementById(match[1]);return m?[m]:[]}},NAME:function(match,context,isXML){if(typeof context.getElementsByName!=="undefined"){var ret=[],results=context.getElementsByName(match[1]);for(var i=0,l=results.length;i<l;i++){if(results[i].getAttribute("name")===match[1]){ret.push(results[i])}}return ret.length===0?null:ret}},TAG:function(match,context){return match[1]=='*'&&context.all||context.getElementsByTagName(match[1])}},preFilter:{CLASS:function(match,curLoop,inplace,result,not,isXML){match=" "+match[1].replace(/\\/g,"")+" ";if(isXML){return match}for(var i=0,elem;(elem=curLoop[i])!=null;i++){if(elem){if(not^(elem.className&&(" "+elem.className+" ").indexOf(match)>=0)){if(!inplace)result.push(elem)}else if(inplace){curLoop[i]=false}}}return false},ID:function(match){return match[1].replace(/\\/g,"")},TAG:function(match,curLoop){for(var i=0;curLoop[i]===false;i++){}return curLoop[i]&&isXML(curLoop[i])?match[1]:match[1].toUpperCase()},CHILD:function(match){if(match[1]=="nth"){var test=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(match[2]=="even"&&"2n"||match[2]=="odd"&&"2n+1"||!/\D/.test(match[2])&&"0n+"+match[2]||match[2]);match[2]=(test[1]+(test[2]||1))-0;match[3]=test[3]-0}match[0]=done++;return match},ATTR:function(match,curLoop,inplace,result,not,isXML){var name=match[1].replace(/\\/g,"");if(!isXML&&Expr.attrMap[name]){match[1]=Expr.attrMap[name]}if(match[2]==="~="){match[4]=" "+match[4]+" "}return match},PSEUDO:function(match,curLoop,inplace,result,not){if(match[1]==="not"){if(match[3].match(chunker).length>1||/^\w/.test(match[3])){match[3]=Sizzle(match[3],null,null,curLoop)}else{var ret=Sizzle.filter(match[3],curLoop,inplace,true^not);if(!inplace){result.push.apply(result,ret)}return false}}else if(Expr.match.POS.test(match[0])||Expr.match.CHILD.test(match[0])){return true}return match},POS:function(match){match.unshift(true);return match}},filters:{enabled:function(elem){return elem.disabled===false&&elem.type!=="hidden"},disabled:function(elem){return elem.disabled===true},checked:function(elem){return elem.checked===true},selected:function(elem){elem.parentNode.selectedIndex;return elem.selected===true},parent:function(elem){return!!elem.firstChild},empty:function(elem){return!elem.firstChild},has:function(elem,i,match){return!!Sizzle(match[3],elem).length},header:function(elem){return/h\d/i.test(elem.nodeName)},text:function(elem){return"text"===elem.type},radio:function(elem){return"radio"===elem.type},checkbox:function(elem){return"checkbox"===elem.type},file:function(elem){return"file"===elem.type},password:function(elem){return"password"===elem.type},submit:function(elem){return"submit"===elem.type},image:function(elem){return"image"===elem.type},reset:function(elem){return"reset"===elem.type},button:function(elem){return"button"===elem.type||elem.nodeName.toUpperCase()==="BUTTON"},input:function(elem){return/input|select|textarea|button/i.test(elem.nodeName)}},setFilters:{first:function(elem,i){return i===0},last:function(elem,i,match,array){return i===array.length-1},even:function(elem,i){return i%2===0},odd:function(elem,i){return i%2===1},lt:function(elem,i,match){return i<match[3]-0},gt:function(elem,i,match){return i>match[3]-0},nth:function(elem,i,match){return match[3]-0==i},eq:function(elem,i,match){return match[3]-0==i}},filter:{PSEUDO:function(elem,match,i,array){var name=match[1],filter=Expr.filters[name];if(filter){return filter(elem,i,match,array)}else if(name==="contains"){return(elem.textContent||elem.innerText||"").indexOf(match[3])>=0}else if(name==="not"){var not=match[3];for(var i=0,l=not.length;i<l;i++){if(not[i]===elem){return false}}return true}},CHILD:function(elem,match){var type=match[1],node=elem;switch(type){case'only':case'first':while(node=node.previousSibling){if(node.nodeType===1)return false}if(type=='first')return true;node=elem;case'last':while(node=node.nextSibling){if(node.nodeType===1)return false}return true;case'nth':var first=match[2],last=match[3];if(first==1&&last==0){return true}var doneName=match[0],parent=elem.parentNode;if(parent&&(parent.sizcache!==doneName||!elem.nodeIndex)){var count=0;for(node=parent.firstChild;node;node=node.nextSibling){if(node.nodeType===1){node.nodeIndex=++count}}parent.sizcache=doneName}var diff=elem.nodeIndex-last;if(first==0){return diff==0}else{return(diff%first==0&&diff/first>=0)}}},ID:function(elem,match){return elem.nodeType===1&&elem.getAttribute("id")===match},TAG:function(elem,match){return(match==="*"&&elem.nodeType===1)||elem.nodeName===match},CLASS:function(elem,match){return(" "+(elem.className||elem.getAttribute("class"))+" ").indexOf(match)>-1},ATTR:function(elem,match){var name=match[1],result=Expr.attrHandle[name]?Expr.attrHandle[name](elem):elem[name]!=null?elem[name]:elem.getAttribute(name),value=result+"",type=match[2],check=match[4];return result==null?type==="!=":type==="="?value===check:type==="*="?value.indexOf(check)>=0:type==="~="?(" "+value+" ").indexOf(check)>=0:!check?value&&result!==false:type==="!="?value!=check:type==="^="?value.indexOf(check)===0:type==="$="?value.substr(value.length-check.length)===check:type==="|="?value===check||value.substr(0,check.length+1)===check+"-":false},POS:function(elem,match,i,array){var name=match[2],filter=Expr.setFilters[name];if(filter){return filter(elem,i,match,array)}}}};var origPOS=Expr.match.POS;for(var type in Expr.match){Expr.match[type]=RegExp(Expr.match[type].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var makeArray=function(array,results){array=Array.prototype.slice.call(array);if(results){results.push.apply(results,array);return results}return array};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(e){makeArray=function(array,results){var ret=results||[];if(toString.call(array)==="[object Array]"){Array.prototype.push.apply(ret,array)}else{if(typeof array.length==="number"){for(var i=0,l=array.length;i<l;i++){ret.push(array[i])}}else{for(var i=0;array[i];i++){ret.push(array[i])}}}return ret}}var sortOrder;if(document.documentElement.compareDocumentPosition){sortOrder=function(a,b){var ret=a.compareDocumentPosition(b)&4?-1:a===b?0:1;if(ret===0){hasDuplicate=true}return ret}}else if("sourceIndex"in document.documentElement){sortOrder=function(a,b){var ret=a.sourceIndex-b.sourceIndex;if(ret===0){hasDuplicate=true}return ret}}else if(document.createRange){sortOrder=function(a,b){var aRange=a.ownerDocument.createRange(),bRange=b.ownerDocument.createRange();aRange.selectNode(a);aRange.collapse(true);bRange.selectNode(b);bRange.collapse(true);var ret=aRange.compareBoundaryPoints(Range.START_TO_END,bRange);if(ret===0){hasDuplicate=true}return ret}}(function(){var form=document.createElement("form"),id="script"+(new Date).getTime();form.innerHTML="<input name='"+id+"'/>";var root=document.documentElement;root.insertBefore(form,root.firstChild);if(!!document.getElementById(id)){Expr.find.ID=function(match,context,isXML){if(typeof context.getElementById!=="undefined"&&!isXML){var m=context.getElementById(match[1]);return m?m.id===match[1]||typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id").nodeValue===match[1]?[m]:undefined:[]}};Expr.filter.ID=function(elem,match){var node=typeof elem.getAttributeNode!=="undefined"&&elem.getAttributeNode("id");return elem.nodeType===1&&node&&node.nodeValue===match}}root.removeChild(form)})();(function(){var div=document.createElement("div");div.appendChild(document.createComment(""));if(div.getElementsByTagName("*").length>0){Expr.find.TAG=function(match,context){var results=context.getElementsByTagName(match[1]);if(match[1]==="*"){var tmp=[];for(var i=0;results[i];i++){if(results[i].nodeType===1){tmp.push(results[i])}}results=tmp}return results}}div.innerHTML="<a href='#'></a>";if(div.firstChild&&typeof div.firstChild.getAttribute!=="undefined"&&div.firstChild.getAttribute("href")!=="#"){Expr.attrHandle.href=function(elem){return elem.getAttribute("href",2)}}})();if(document.querySelectorAll)(function(){var oldSizzle=Sizzle,div=document.createElement("div");div.innerHTML="<p class='TEST'></p>";if(div.querySelectorAll&&div.querySelectorAll(".TEST").length===0){return}Sizzle=function(query,context,extra,seed){context=context||document;if(!seed&&context.nodeType===9&&!isXML(context)){try{return makeArray(context.querySelectorAll(query),extra)}catch(e){}}return oldSizzle(query,context,extra,seed)};Sizzle.find=oldSizzle.find;Sizzle.filter=oldSizzle.filter;Sizzle.selectors=oldSizzle.selectors;Sizzle.matches=oldSizzle.matches})();if(document.getElementsByClassName&&document.documentElement.getElementsByClassName)(function(){var div=document.createElement("div");div.innerHTML="<div class='test e'></div><div class='test'></div>";if(div.getElementsByClassName("e").length===0)return;div.lastChild.className="e";if(div.getElementsByClassName("e").length===1)return;Expr.order.splice(1,0,"CLASS");Expr.find.CLASS=function(match,context,isXML){if(typeof context.getElementsByClassName!=="undefined"&&!isXML){return context.getElementsByClassName(match[1])}}})();function dirNodeCheck(dir,cur,doneName,checkSet,nodeCheck,isXML){var sibDir=dir=="previousSibling"&&!isXML;for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){if(sibDir&&elem.nodeType===1){elem.sizcache=doneName;elem.sizset=i}elem=elem[dir];var match=false;while(elem){if(elem.sizcache===doneName){match=checkSet[elem.sizset];break}if(elem.nodeType===1&&!isXML){elem.sizcache=doneName;elem.sizset=i}if(elem.nodeName===cur){match=elem;break}elem=elem[dir]}checkSet[i]=match}}}function dirCheck(dir,cur,doneName,checkSet,nodeCheck,isXML){var sibDir=dir=="previousSibling"&&!isXML;for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){if(sibDir&&elem.nodeType===1){elem.sizcache=doneName;elem.sizset=i}elem=elem[dir];var match=false;while(elem){if(elem.sizcache===doneName){match=checkSet[elem.sizset];break}if(elem.nodeType===1){if(!isXML){elem.sizcache=doneName;elem.sizset=i}if(typeof cur!=="string"){if(elem===cur){match=true;break}}else if(Sizzle.filter(cur,[elem]).length>0){match=elem;break}}elem=elem[dir]}checkSet[i]=match}}}var contains=document.compareDocumentPosition?function(a,b){return a.compareDocumentPosition(b)&16}:function(a,b){return a!==b&&(a.contains?a.contains(b):true)};var isXML=function(elem){return elem.nodeType===9&&elem.documentElement.nodeName!=="HTML"||!!elem.ownerDocument&&isXML(elem.ownerDocument)};var posProcess=function(selector,context){var tmpSet=[],later="",match,root=context.nodeType?[context]:context;while((match=Expr.match.PSEUDO.exec(selector))){later+=match[0];selector=selector.replace(Expr.match.PSEUDO,"")}selector=Expr.relative[selector]?selector+"*":selector;for(var i=0,l=root.length;i<l;i++){Sizzle(selector,root[i],tmpSet)}return Sizzle.filter(later,tmpSet)};jQuery.find=Sizzle;jQuery.filter=Sizzle.filter;jQuery.expr=Sizzle.selectors;jQuery.expr[":"]=jQuery.expr.filters;Sizzle.selectors.filters.hidden=function(elem){return elem.offsetWidth===0||elem.offsetHeight===0};Sizzle.selectors.filters.visible=function(elem){return elem.offsetWidth>0||elem.offsetHeight>0};Sizzle.selectors.filters.animated=function(elem){return jQuery.grep(jQuery.timers,function(fn){return elem===fn.elem}).length};jQuery.multiFilter=function(expr,elems,not){if(not){expr=":not("+expr+")"}return Sizzle.matches(expr,elems)};jQuery.dir=function(elem,dir){var matched=[],cur=elem[dir];while(cur&&cur!=document){if(cur.nodeType==1)matched.push(cur);cur=cur[dir]}return matched};jQuery.nth=function(cur,result,dir,elem){result=result||1;var num=0;for(;cur;cur=cur[dir])if(cur.nodeType==1&&++num==result)break;return cur};jQuery.sibling=function(n,elem){var r=[];for(;n;n=n.nextSibling){if(n.nodeType==1&&n!=elem)r.push(n)}return r};return;window.Sizzle=Sizzle})();jQuery.event={fixType:function(t){return String(t).replace(/mousewheel/i,$B.msie||$B.opera?'mousewheel':'DOMMouseScroll')},add:function(elem,types,handler,data){if(elem.nodeType==3||elem.nodeType==8)return;if(elem.setInterval&&elem!=window)elem=window;if(!handler.guid)handler.guid=this.guid++;if(data!==undefined){var fn=handler;handler=this.proxy(fn);handler.data=data}var events=jQuery.data(elem,"events")||jQuery.data(elem,"events",{}),handle=jQuery.data(elem,"handle")||jQuery.data(elem,"handle",function(){return typeof jQuery!=="undefined"&&!jQuery.event.triggered?jQuery.event.handle.apply(arguments.callee.elem,arguments):undefined});handle.elem=elem;jQuery.each(this.fixType(types).split(/\s+/),function(index,type){var namespaces=type.split(".");type=namespaces.shift();handler.type=namespaces.slice().sort().join(".");var handlers=events[type];if(jQuery.event.specialAll[type])jQuery.event.specialAll[type].setup.call(elem,data,namespaces);if(!handlers){handlers=events[type]={};if(!jQuery.event.special[type]||jQuery.event.special[type].setup.call(elem,data,namespaces)===false){if(elem.addEventListener)elem.addEventListener(type,handle,false);else if(elem.attachEvent)elem.attachEvent("on"+type,handle)}}handlers[handler.guid]=handler;jQuery.event.global[type]=true});elem=null},guid:1,global:{},remove:function(elem,types,handler){if(elem.nodeType==3||elem.nodeType==8)return;types=this.fixType(types);var events=jQuery.data(elem,"events"),ret,index;if(events){if(types===undefined||(typeof types==="string"&&types.charAt(0)=="."))for(var type in events)this.remove(elem,type+(types||""));else{if(types.type){handler=types.handler;types=types.type}jQuery.each(types.split(/\s+/),function(index,type){var namespaces=type.split(".");type=namespaces.shift();var namespace=RegExp("(^|\\.)"+namespaces.slice().sort().join(".*\\.")+"(\\.|$)");if(events[type]){if(handler)delete events[type][handler.guid];else for(var handle in events[type])if(namespace.test(events[type][handle].type))delete events[type][handle];if(jQuery.event.specialAll[type])jQuery.event.specialAll[type].teardown.call(elem,namespaces);for(ret in events[type])break;if(!ret){if(!jQuery.event.special[type]||jQuery.event.special[type].teardown.call(elem,namespaces)===false){if(elem.removeEventListener)elem.removeEventListener(type,jQuery.data(elem,"handle"),false);else if(elem.detachEvent)elem.detachEvent("on"+type,jQuery.data(elem,"handle"))}ret=null;delete events[type]}}})}for(ret in events)break;if(!ret){var handle=jQuery.data(elem,"handle");if(handle)handle.elem=null;jQuery.removeData(elem,"events");jQuery.removeData(elem,"handle")}}},trigger:function(event,data,elem,bubbling){var type=event.type||event;if(!bubbling){event=typeof event==="object"?event[expando]?event:(window.$E||jQuery.extend)(jQuery.Event(type),event):jQuery.Event(type);if(type.indexOf("!")>=0){event.type=type=type.slice(0,-1);event.exclusive=true}if(!elem){event.stopPropagation();if(this.global[type])jQuery.each(jQuery.cache,function(){if(this.events&&this.events[type])jQuery.event.trigger(event,data,this.handle.elem)})}if(!elem||elem.nodeType==3||elem.nodeType==8)return undefined;event.result=undefined;event.target=elem;data=jQuery.makeArray(data);data.unshift(event)}event.currentTarget=elem;var handle=jQuery.data(elem,"handle");if(handle)handle.apply(elem,data);if((!elem[type]||(jQuery.nodeName(elem,'a')&&type=="click"))&&elem["on"+type]&&elem["on"+type].apply(elem,data)===false)event.result=false;if(!bubbling&&elem[type]&&!event.isDefaultPrevented()&&!(jQuery.nodeName(elem,'a')&&type=="click")){this.triggered=true;try{elem[type]()}catch(e){}}this.triggered=false;if(!event.isPropagationStopped()){var parent=elem.parentNode||elem.ownerDocument;if(parent)jQuery.event.trigger(event,data,parent,true)}},handle:function(event){var all,handlers;event=arguments[0]=jQuery.event.fix(event||window.event);event.currentTarget=this;var namespaces=event.type.split(".");event.type=namespaces.shift();all=!namespaces.length&&!event.exclusive;var namespace=RegExp("(^|\\.)"+namespaces.slice().sort().join(".*\\.")+"(\\.|$)");handlers=(jQuery.data(this,"events")||{})[event.type];for(var j in handlers){var handler=handlers[j];if(all||namespace.test(handler.type)){event.handler=handler;event.data=handler.data;var ret=handler.apply(this,arguments);if(ret!==undefined){event.result=ret;if(ret===false){event.preventDefault();event.stopPropagation()}}if(event.isImmediatePropagationStopped())break}}if(window.jsCore)window.jsCore.event=event},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(event){if(event[expando])return event;var originalEvent=event;event=jQuery.Event(originalEvent);for(var i=this.props.length,prop;i;){prop=this.props[--i];event[prop]=originalEvent[prop]}if(!event.target)event.target=event.srcElement||document;if(event.target.nodeType==3)event.target=event.target.parentNode;if(!event.relatedTarget&&event.fromElement)event.relatedTarget=event.fromElement==event.target?event.toElement:event.fromElement;if(event.pageX==null&&event.clientX!=null){var doc=document.documentElement,body=document.body;event.pageX=event.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc.clientLeft||0);event.pageY=event.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc.clientTop||0)}if(!event.which&&((event.charCode||event.charCode===0)?event.charCode:event.keyCode))event.which=event.charCode||event.keyCode;if(!event.metaKey&&event.ctrlKey)event.metaKey=event.ctrlKey;if(!event.which&&event.button)event.which=(event.button&1?1:(event.button&2?3:(event.button&4?2:0)));return event},proxy:function(fn,proxy){proxy=proxy||function(){return fn.apply(this,arguments)};proxy.guid=fn.guid=fn.guid||proxy.guid||this.guid++;return proxy},special:{ready:{setup:bindReady,teardown:function(){}}},specialAll:{live:{setup:function(selector,namespaces){jQuery.event.add(this,namespaces[0],liveHandler)},teardown:function(namespaces){if(namespaces.length){var remove=0,name=RegExp("(^|\\.)"+namespaces[0]+"(\\.|$)");jQuery.each((jQuery.data(this,"events").live||{}),function(){if(name.test(this.type))remove++});if(remove<1)jQuery.event.remove(this,namespaces[0],liveHandler)}}}}};jQuery.Event=function(src){if(!this.preventDefault)return new jQuery.Event(src);if(src&&src.type){this.originalEvent=src;this.type=src.type}else this.type=src;this.timeStamp=now();this[expando]=true};function returnFalse(){return false}function returnTrue(){return true}jQuery.Event.prototype={preventDefault:function(){this.isDefaultPrevented=returnTrue;var e=this.originalEvent;if(!e)return;if(e.preventDefault)e.preventDefault();e.returnValue=false},stopPropagation:function(){this.isPropagationStopped=returnTrue;var e=this.originalEvent;if(!e)return;if(e.stopPropagation)e.stopPropagation();e.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=returnTrue;this.stopPropagation()},isDefaultPrevented:returnFalse,isPropagationStopped:returnFalse,isImmediatePropagationStopped:returnFalse};var withinElement=function(event){var parent=event.relatedTarget;while(parent&&parent!=this)try{parent=parent.parentNode}catch(e){parent=this}if(parent!=this){event.type=event.data;jQuery.event.handle.apply(this,arguments)}};jQuery.each({mouseover:'mouseenter',mouseout:'mouseleave'},function(orig,fix){jQuery.event.special[fix]={setup:function(){jQuery.event.add(this,orig,withinElement,fix)},teardown:function(){jQuery.event.remove(this,orig,withinElement)}}});jQuery.fn.extend({bind:function(type,data,fn){return type=="unload"?this.one(type,data,fn):this.each(function(){jQuery.event.add(this,type,fn||data,fn&&data)})},one:function(type,data,fn){var one=jQuery.event.proxy(fn||data,function(event){jQuery(this).unbind(event,one);return(fn||data).apply(this,arguments)});return this.each(function(){jQuery.event.add(this,type,one,fn&&data)})},unbind:function(type,fn){return this.each(function(){jQuery.event.remove(this,type,fn)})},trigger:function(type,data){return this.each(function(){jQuery.event.trigger(type,data,this)})},triggerHandler:function(type,data){if(this[0]){var event=jQuery.Event(type);event.preventDefault();event.stopPropagation();jQuery.event.trigger(event,data,this[0]);return event.result}},toggle:function(fn){var args=arguments,i=1;while(i<args.length)jQuery.event.proxy(fn,args[i++]);return this.click(jQuery.event.proxy(fn,function(event){this.lastToggle=(this.lastToggle||0)%i;event.preventDefault();return args[this.lastToggle++].apply(this,arguments)||false}))},hover:function(fnOver,fnOut){return this.mouseenter(fnOver).mouseleave(fnOut)},ready:function(fn){bindReady();if(jQuery.isReady)fn.call(document,jQuery);else jQuery.readyList.push(fn);return this},live:function(type,fn){var proxy=jQuery.event.proxy(fn);proxy.guid+=this.selector+type;jQuery(document).bind(liveConvert(type,this.selector),this.selector,proxy);return this},die:function(type,fn){jQuery(document).unbind(liveConvert(type,this.selector),fn?{guid:fn.guid+this.selector+type}:null);return this}});function liveHandler(event){var check=RegExp("(^|\\.)"+event.type+"(\\.|$)"),stop=true,elems=[];jQuery.each(jQuery.data(this,"events").live||[],function(i,fn){if(check.test(fn.type)){var elem=jQuery(event.target).closest(fn.data)[0];if(elem)elems.push({elem:elem,fn:fn})}});elems.sort(function(a,b){return jQuery.data(a.elem,"closest")-jQuery.data(b.elem,"closest")});jQuery.each(elems,function(){if(this.fn.call(this.elem,event,this.fn.data)===false)return(stop=false)});return stop}function liveConvert(type,selector){return["live",type,selector.replace(/\./g,"`").replace(/ /g,"|")].join(".")}jQuery.extend({isReady:false,readyList:[],ready:function(){if(!jQuery.isReady){jQuery.isReady=true;if(jQuery.readyList){jQuery.each(jQuery.readyList,function(){this.call(document,jQuery)});jQuery.readyList=null}jQuery(document).triggerHandler("ready")}}});var readyBound=false;function bindReady(){if(readyBound)return;readyBound=true;$P('jQuery.ready');if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);jQuery.ready();$P('jQuery.loaded',1);$P('jQuery',2)},false)}else if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);jQuery.ready()}});if(document.documentElement.doScroll&&window==window.top)(function(){if(jQuery.isReady)return;try{document.documentElement.doScroll("left")}catch(error){setTimeout(arguments.callee,0);return}jQuery.ready()})()}jQuery.event.add(window,"load",jQuery.ready);$P('jQuery.ready',1)}jQuery.each(("blur,focus,load,resize,scroll,unload,click,dblclick,"+"mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,"+"change,select,submit,keydown,keypress,keyup,error").split(","),function(i,name){jQuery.fn[name]=function(fn){return fn?this.bind(name,fn):this.trigger(name)}});jQuery(window).bind('unload',function(){for(var id in jQuery.cache)if(id!=1&&jQuery.cache[id].handle)jQuery.event.remove(jQuery.cache[id].handle.elem)});(function(){jQuery.support={};var root=document.documentElement,script=document.createElement("script"),div=document.createElement("div"),id="script"+(new Date).getTime();div.style.display="none";div.innerHTML='   <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var all=div.getElementsByTagName("*"),a=div.getElementsByTagName("a")[0];if(!all||!all.length||!a){return}jQuery.support={leadingWhitespace:div.firstChild.nodeType==3,tbody:!div.getElementsByTagName("tbody").length,objectAll:!!div.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!div.getElementsByTagName("link").length,style:/red/.test(a.getAttribute("style")),hrefNormalized:a.getAttribute("href")==="/a",opacity:a.style.opacity==="0.5",cssFloat:!!a.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};script.type="text/javascript";try{script.appendChild(document.createTextNode("window."+id+"=1;"))}catch(e){}root.insertBefore(script,root.firstChild);if(window[id]){jQuery.support.scriptEval=true;delete window[id]}root.removeChild(script);if(div.attachEvent&&div.fireEvent){div.attachEvent("onclick",function(){jQuery.support.noCloneEvent=false;div.detachEvent("onclick",arguments.callee)});div.cloneNode(true).fireEvent("onclick")}jQuery(function(){var div=document.createElement("div");div.style.width=div.style.paddingLeft="1px";document.body.appendChild(div);jQuery.boxModel=jQuery.support.boxModel=div.offsetWidth===2;document.body.removeChild(div).style.display='none'})})();var styleFloat=jQuery.support.cssFloat?"cssFloat":"styleFloat";jQuery.props={"for":"htmlFor","class":"className","float":styleFloat,cssFloat:styleFloat,styleFloat:styleFloat,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};jQuery.fn.extend({_load:jQuery.fn.load,load:function(url,params,callback){if(typeof url!=="string")return this._load(url);var off=url.indexOf(" ");if(off>=0){var selector=url.slice(off,url.length);url=url.slice(0,off)}var type="GET";if(params)if(jQuery.isFunction(params)){callback=params;params=null}else if(typeof params==="object"){params=jQuery.param(params);type="POST"}var self=this;jQuery.ajax({url:url,type:type,dataType:"html",data:params,complete:function(res,status){if(status=="success"||status=="notmodified")self.html(selector?jQuery("<div/>").append(res.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(selector):res.responseText);if(callback)self.each(callback,[res.responseText,status,res])}});return this},serialize:function(){return jQuery.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?jQuery.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(i,elem){var val=jQuery(this).val();return val==null?null:jQuery.isArray(val)?jQuery.map(val,function(val,i){return{name:elem.name,value:val}}):{name:elem.name,value:val}}).get()}});jQuery.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(i,o){jQuery.fn[o]=function(f){return this.bind(o,f)}});var jsc=now();jQuery.extend({get:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data=null}return jQuery.ajax({type:"GET",url:url,data:data,success:callback,dataType:type})},getScript:function(url,callback){return jQuery.get(url,null,callback,"script")},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json")},post:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data={}}return jQuery.ajax({type:"POST",url:url,data:data,success:callback,dataType:type})},ajaxSetup:function(settings){jQuery.extend(jQuery.ajaxSettings,settings)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajaxLoading:function(o,s){if(o.loading){if(o.loading.constructor==Function){o.loading(!!s)}else if(o.loading.substr(0,1)=='#'){jQuery(o.loading)[s?'show':'hide']()}}},ajax:function(s){s=jQuery.extend(true,s,jQuery.extend(true,{},jQuery.ajaxSettings,s));if(!s.loading&&(s.data&&s.data.loading)){s.loading=s.data.loading;s.data.loading=null;delete s.data.loading}var jsonp,jsre=/=\?(&|$)/g,status,data,type=s.type.toUpperCase();if(s.data&&s.processData&&typeof s.data!=="string")s.data=jQuery.param(s.data);if(s.baseData&&String.toQuery)s.data+=(s.data?'&':'')+String.toQuery(s.baseData);if(s.dataType=="jsonp"){if(type=="GET"){if(!s.url.match(jsre))s.url+=(s.url.match(/\?/)?"&":"?")+(s.jsonp||"callback")+"=?"}else if(!s.data||!s.data.match(jsre))s.data=(s.data?s.data+"&":"")+(s.jsonp||"callback")+"=?";s.dataType="json"}if(s.dataType=="json"&&(s.data&&s.data.match(jsre)||s.url.match(jsre))){jsonp="jsonp"+jsc++;if(s.data)s.data=(s.data+"").replace(jsre,"="+jsonp+"$1");s.url=s.url.replace(jsre,"="+jsonp+"$1");s.dataType="script";window[jsonp]=function(tmp){data=tmp;success();complete();window[jsonp]=undefined;try{delete window[jsonp]}catch(e){}if(head)head.removeChild(script)}}if(s.dataType=="script"&&s.cache==null)s.cache=false;if(s.cache===false&&type=="GET"){var ts=now();var ret=s.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+ts+"$2");s.url=ret+((ret==s.url)?(s.url.match(/\?/)?"&":"?")+"_="+ts:"")}if(s.data&&type=="GET"){s.url+=(s.url.match(/\?/)?"&":"?")+s.data;s.data=null}if(debug.screen)debug.log('<b style="color: #000">'+s.type+': '+s.url+'</b> | '+decodeURIComponent(s.data));if(s.global&&!jQuery.active++)jQuery.event.trigger("ajaxStart");var parts=/^(\w+:)?\/\/([^\/?#]+)/.exec(s.url);if(s.dataType=="script"&&type=="GET"&&parts&&(parts[1]&&parts[1]!=location.protocol||parts[2]!=location.host)){var head=document.getElementsByTagName("head")[0];var script=document.createElement("script");script.src=s.url;if(s.scriptCharset)script.charset=s.scriptCharset;if(!jsonp){var done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){done=true;success();complete();script.onload=script.onreadystatechange=null;head.removeChild(script)}}}head.appendChild(script);return undefined}var requestDone=false;var xhr=s.xhr();if(s.username)xhr.open(type,s.url,s.async,s.username,s.password);else xhr.open(type,s.url,s.async);try{if(s.data)xhr.setRequestHeader("Content-Type",s.contentType);if(s.ifModified)xhr.setRequestHeader("If-Modified-Since",jQuery.lastModified[s.url]||"Thu, 01 Jan 1970 00:00:00 GMT");xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");xhr.setRequestHeader("Accept",s.dataType&&s.accepts[s.dataType]?s.accepts[s.dataType]+", */*":s.accepts._default)}catch(e){}if(s.beforeSend&&s.beforeSend(xhr,s)===false){if(s.global&&!--jQuery.active)jQuery.event.trigger("ajaxStop");xhr.abort();return false}if(s.global)jQuery.event.trigger("ajaxSend",[xhr,s]);var onreadystatechange=function(isTimeout){if(xhr.readyState==0){if(ival){clearInterval(ival);ival=null;if(s.global&&!--jQuery.active)jQuery.event.trigger("ajaxStop")}}else if(!requestDone&&xhr&&(xhr.readyState==4||isTimeout=="timeout")){requestDone=true;if(ival){clearInterval(ival);ival=null}status=isTimeout=="timeout"?"timeout":!jQuery.httpSuccess(xhr)?"error":s.ifModified&&jQuery.httpNotModified(xhr,s.url)?"notmodified":"success";xhr=(jQ.ajaxResult||window.jsCore&&jsCore.F)(xhr,status);if(jQuery.ajaxResult||status=="success"){try{data=jQuery.httpData(xhr,s.dataType,s)}catch(e){status="parsererror"}}if(jQuery.ajaxResult||status=="success"){var modRes;try{modRes=xhr.getResponseHeader("Last-Modified")}catch(e){}if(s.ifModified&&modRes)jQuery.lastModified[s.url]=modRes;if(!jsonp)success()}else jQuery.handleError(s,xhr,status);complete();if(isTimeout)xhr.abort();if(s.async)xhr=null}};if(s.async){var ival=setInterval(onreadystatechange,13);if(s.timeout>0)setTimeout(function(){if(xhr&&!requestDone)onreadystatechange("timeout")},s.timeout)}try{xhr.send(s.data);jQuery.ajaxLoading(s,1)}catch(e){jQuery.handleError(s,xhr,null,e)}if(!s.async)onreadystatechange();function success(){if(s.success)s.success(data,status);if(s.global)jQuery.event.trigger("ajaxSuccess",[xhr,s])}function complete(){jQuery.ajaxLoading(s,0);s.loading=null;if(s.complete)s.complete(xhr,status);if(s.global)jQuery.event.trigger("ajaxComplete",[xhr,s]);if(s.global&&!--jQuery.active)jQuery.event.trigger("ajaxStop")}return!s.async&&jQuery.ajaxResult&&jQuery.ajaxResult(xhr,status,s.dataType)||xhr},handleError:function(s,xhr,status,e){if(s.error)s.error(xhr,status,e);if(s.global)jQuery.event.trigger("ajaxError",[xhr,s,e])},active:0,httpSuccess:function(xhr){try{return!xhr.status&&location.protocol=="file:"||(xhr.status>=200&&xhr.status<300)||xhr.status==304||xhr.status==1223}catch(e){}return false},httpNotModified:function(xhr,url){try{var xhrRes=xhr.getResponseHeader("Last-Modified");return xhr.status==304||xhrRes==jQuery.lastModified[url]}catch(e){}return false},httpData:function(xhr,type,s){if(xhr.__xhr__)return xhr;var ct=xhr.getResponseHeader("content-type"),xml=type=="xml"||!type&&ct&&ct.indexOf("xml")>=0,data=xml?xhr.responseXML:xhr.responseText;if(xml&&data.documentElement.tagName=="parsererror")throw"parsererror";if(s&&s.dataFilter)data=s.dataFilter(data,type);if(typeof data==="string"){if(type=="script")jQuery.globalEval(data);if(type=="json")data=window["eval"]("("+data+")")}return data},param:function(a){var s=[];function add(key,value){s[s.length]=encodeURIComponent(key)+'='+encodeURIComponent(value)};if(jQuery.isArray(a)||a.jquery)jQuery.each(a,function(){add(this.name,this.value)});else for(var j in a)if(jQuery.isArray(a[j]))jQuery.each(a[j],function(){add(j,this)});else add(j,jQuery.isFunction(a[j])?a[j]():a[j]);return s.join("&").replace(/%20/g,"+")}});var elemdisplay={},timerId,fxAttrs=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function genFx(type,num){var obj={};jQuery.each(fxAttrs.concat.apply([],fxAttrs.slice(0,num)),function(){obj[this]=type});return obj}jQuery.fn.extend({show:function(speed,callback){if(speed==-1)for(var i=0,l=this.length;i<l;i++)$FS(this[i]).display='';else if(speed){return this.animate(genFx("show",3),speed,callback)}else{for(var i=0,l=this.length;i<l;i++){var old=jQuery.data(this[i],"olddisplay");this[i].style.display=old||"";if(jQuery.css(this[i],"display")==="none"){var tagName=this[i].tagName,display;if(elemdisplay[tagName]){display=elemdisplay[tagName]}else{var elem=jQuery("<"+tagName+" />").appendTo("body");display=elem.css("display");if(display==="none")display="block";elem.remove();elemdisplay[tagName]=display}jQuery.data(this[i],"olddisplay",display)}}for(var i=0,l=this.length;i<l;i++){this[i].style.display=jQuery.data(this[i],"olddisplay")||""}}return this},hide:function(speed,callback){if(speed==-1)for(var i=0,l=this.length;i<l;i++)$FS(this[i]).display='none';else if(speed){return this.animate(genFx("hide",3),speed,callback)}else{for(var i=0,l=this.length;i<l;i++){var old=jQuery.data(this[i],"olddisplay");if(!old&&old!=="none")jQuery.data(this[i],"olddisplay",jQuery.css(this[i],"display"))}for(var i=0,l=this.length;i<l;i++){this[i].style.display="none"}}return this},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2){var bool=typeof fn==="boolean";return jQuery.isFunction(fn)&&jQuery.isFunction(fn2)?this._toggle.apply(this,arguments):fn==null||bool?this.each(function(){var state=bool?fn:jQuery(this).is(":hidden");jQuery(this)[state?"show":"hide"]()}):this.animate(genFx("toggle",3),fn,fn2)},fadeTo:function(speed,to,callback){return this.animate({opacity:to},speed,callback)},animate:function(prop,speed,easing,callback){var optall=jQuery.speed(speed,easing,callback);return this[optall.queue===false?"each":"queue"](function(){var opt=jQuery.extend({},optall),p,hidden=this.nodeType==1&&jQuery(this).is(":hidden"),self=this;for(p in prop){if(prop[p]=="hide"&&hidden||prop[p]=="show"&&!hidden)return opt.complete.call(this);if((p=="height"||p=="width")&&this.style){opt.display=jQuery.css(this,"display");opt.overflow=this.style.overflow}}if(opt.overflow!=null)this.style.overflow="hidden";opt.curAnim=jQuery.extend({},prop);jQuery.each(prop,function(name,val){var e=new jQuery.fx(self,opt,name);if(/toggle|show|hide/.test(val))e[val=="toggle"?hidden?"show":"hide":val](prop);else{var parts=val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),start=e.cur(true)||0;if(parts){var end=parseFloat(parts[2]),unit=parts[3]||"px";if(unit!="px"){self.style[name]=(end||1)+unit;start=((end||1)/e.cur(true))*start;self.style[name]=start+unit}if(parts[1])end=((parts[1]=="-="?-1:1)*end)+start;e.custom(start,end,unit)}else e.custom(start,val,"")}});return true})},stop:function(clearQueue,gotoEnd){var timers=jQuery.timers;if(clearQueue)this.queue([]);this.each(function(){for(var i=timers.length-1;i>=0;i--)if(timers[i].elem==this){if(gotoEnd)timers[i](true);timers.splice(i,1)}});if(!gotoEnd)this.dequeue();return this}});jQuery.each({slideDown:genFx("show",1),slideUp:genFx("hide",1),slideToggle:genFx("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(name,props){jQuery.fn[name]=function(speed,callback){return this.animate(props,speed,callback)}});jQuery.extend({speed:function(speed,easing,fn){var opt=typeof speed==="object"?speed:{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&!jQuery.isFunction(easing)&&easing};opt.duration=jQuery.fx.off?0:typeof opt.duration==="number"?opt.duration:jQuery.fx.speeds[opt.duration]||jQuery.fx.speeds._default;opt.old=opt.complete;opt.complete=function(){if(opt.queue!==false)jQuery(this).dequeue();if(jQuery.isFunction(opt.old))opt.old.call(this)};return opt},easing:{linear:function(p,n,firstNum,diff){return firstNum+diff*p},swing:function(p,n,firstNum,diff){return((-Math.cos(p*Math.PI)/2)+0.5)*diff+firstNum}},timers:[],fx:function(elem,options,prop){this.options=options;this.elem=elem;this.prop=prop;if(!options.orig)options.orig={}}});jQuery.fx.prototype={update:function(){if(this.options.step)this.options.step.call(this.elem,this.now,this);(jQuery.fx.step[this.prop]||jQuery.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style)this.elem.style.display="block"},cur:function(force){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var r=parseFloat(jQuery.css(this.elem,this.prop,force));return r&&r>-10000?r:parseFloat(jQuery.curCSS(this.elem,this.prop))||0},custom:function(from,to,unit){this.startTime=now();this.start=from;this.end=to;this.unit=unit||this.unit||"px";this.now=this.start;this.pos=this.state=0;var self=this;function t(gotoEnd){return self.step(gotoEnd)}t.elem=this.elem;if(t()&&jQuery.timers.push(t)&&!timerId){timerId=setInterval(function(){var timers=jQuery.timers;for(var i=0;i<timers.length;i++)if(!timers[i]())timers.splice(i--,1);if(!timers.length){clearInterval(timerId);timerId=undefined}},13)}},show:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());jQuery(this.elem).show()},hide:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(gotoEnd){var t=now();if(gotoEnd||t>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var done=true;for(var i in this.options.curAnim)if(this.options.curAnim[i]!==true)done=false;if(done){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(jQuery.css(this.elem,"display")=="none")this.elem.style.display="block"}if(this.options.hide)jQuery(this.elem).hide();if(this.options.hide||this.options.show)for(var p in this.options.curAnim)jQuery.attr(this.elem.style,p,this.options.orig[p]);this.options.complete.call(this.elem)}return false}else{var n=t-this.startTime;this.state=n/this.options.duration;this.pos=jQuery.easing[this.options.easing||(jQuery.easing.swing?"swing":"linear")](this.state,n,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};jQuery.extend(jQuery.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(fx){jQuery.attr(fx.elem.style,"opacity",fx.now)},_default:function(fx){if(fx.elem.style&&fx.elem.style[fx.prop]!=null)fx.elem.style[fx.prop]=fx.now+fx.unit;else fx.elem[fx.prop]=fx.now}}});if(document.documentElement["getBoundingClientRect"])jQuery.fn.offset=function(){if(!this[0])return{top:0,left:0};if(this[0]===this[0].ownerDocument.body)return jQuery.offset.bodyOffset(this[0]);var box=this[0].getBoundingClientRect(),doc=this[0].ownerDocument,body=doc.body,docElem=doc.documentElement,clientTop=docElem.clientTop||body.clientTop||0,clientLeft=docElem.clientLeft||body.clientLeft||0,top=box.top+(self.pageYOffset||jQuery.boxModel&&docElem.scrollTop||body.scrollTop)-clientTop,left=box.left+(self.pageXOffset||jQuery.boxModel&&docElem.scrollLeft||body.scrollLeft)-clientLeft;return{top:top,left:left}};else jQuery.fn.offset=function(){if(!this[0])return{top:0,left:0};if(this[0]===this[0].ownerDocument.body)return jQuery.offset.bodyOffset(this[0]);jQuery.offset.initialized||jQuery.offset.initialize();var elem=this[0],offsetParent=elem.offsetParent,prevOffsetParent=elem,doc=elem.ownerDocument,computedStyle,docElem=doc.documentElement,body=doc.body,defaultView=doc.defaultView,prevComputedStyle=defaultView.getComputedStyle(elem,null),top=elem.offsetTop,left=elem.offsetLeft;while((elem=elem.parentNode)&&elem!==body&&elem!==docElem){computedStyle=defaultView.getComputedStyle(elem,null);top-=elem.scrollTop,left-=elem.scrollLeft;if(elem===offsetParent){top+=elem.offsetTop,left+=elem.offsetLeft;if(jQuery.offset.doesNotAddBorder&&!(jQuery.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(elem.tagName)))top+=parseInt(computedStyle.borderTopWidth,10)||0,left+=parseInt(computedStyle.borderLeftWidth,10)||0;prevOffsetParent=offsetParent,offsetParent=elem.offsetParent}if(jQuery.offset.subtractsBorderForOverflowNotVisible&&computedStyle.overflow!=="visible")top+=parseInt(computedStyle.borderTopWidth,10)||0,left+=parseInt(computedStyle.borderLeftWidth,10)||0;prevComputedStyle=computedStyle}if(prevComputedStyle.position==="relative"||prevComputedStyle.position==="static")top+=body.offsetTop,left+=body.offsetLeft;if(prevComputedStyle.position==="fixed")top+=Math.max(docElem.scrollTop,body.scrollTop),left+=Math.max(docElem.scrollLeft,body.scrollLeft);return{top:top,left:left}};jQuery.offset={initialize:function(){if(this.initialized)return;var body=document.body,container=document.createElement('div'),innerDiv,checkDiv,table,td,rules,prop,bodyMarginTop=body.style.marginTop,html='<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';rules={position:'absolute',top:0,left:0,margin:0,border:0,width:'1px',height:'1px',visibility:'hidden'};for(prop in rules)container.style[prop]=rules[prop];container.innerHTML=html;body.insertBefore(container,body.firstChild);innerDiv=container.firstChild,checkDiv=innerDiv.firstChild,td=innerDiv.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(checkDiv.offsetTop!==5);this.doesAddBorderForTableAndCells=(td.offsetTop===5);innerDiv.style.overflow='hidden',innerDiv.style.position='relative';this.subtractsBorderForOverflowNotVisible=(checkDiv.offsetTop===-5);body.style.marginTop='1px';this.doesNotIncludeMarginInBodyOffset=(body.offsetTop===0);body.style.marginTop=bodyMarginTop;body.removeChild(container);this.initialized=true},bodyOffset:function(body){jQuery.offset.initialized||jQuery.offset.initialize();var top=body.offsetTop,left=body.offsetLeft;if(jQuery.offset.doesNotIncludeMarginInBodyOffset)top+=parseInt(jQuery.curCSS(body,'marginTop',true),10)||0,left+=parseInt(jQuery.curCSS(body,'marginLeft',true),10)||0;return{top:top,left:left}}};jQuery.fn.extend({position:function(){var left=0,top=0,results;if(this[0]){var offsetParent=this.offsetParent(),offset=this.offset(),parentOffset=/^body|html$/i.test(offsetParent[0].tagName)?{top:0,left:0}:offsetParent.offset();offset.top-=num(this,'marginTop');offset.left-=num(this,'marginLeft');parentOffset.top+=num(offsetParent,'borderTopWidth');parentOffset.left+=num(offsetParent,'borderLeftWidth');results={top:offset.top-parentOffset.top,left:offset.left-parentOffset.left}}return results},offsetParent:function(){var offsetParent=this[0].offsetParent||document.body;while(offsetParent&&(!/^body|html$/i.test(offsetParent.tagName)&&jQuery.css(offsetParent,'position')=='static'))offsetParent=offsetParent.offsetParent;return jQuery(offsetParent)}});jQuery.each(['Left','Top'],function(i,name){var method='scroll'+name;jQuery.fn[method]=function(val){if(!this[0])return null;return val!==undefined?this.each(function(){this==window||this==document?window.scrollTo(!i?val:jQuery(window).scrollLeft(),i?val:jQuery(window).scrollTop()):this[method]=val}):this[0]==window||this[0]==document?self[i?'pageYOffset':'pageXOffset']||jQuery.boxModel&&document.documentElement[method]||document.body[method]:this[0][method]}});jQuery.each(["Height","Width"],function(i,name){var tl=i?"Left":"Top",br=i?"Right":"Bottom",lower=name.toLowerCase();jQuery.fn["inner"+name]=function(){return this[0]?jQuery.css(this[0],lower,false,"padding"):null};jQuery.fn["outer"+name]=function(margin){return this[0]?jQuery.css(this[0],lower,false,margin?"margin":"border"):null};var type=name.toLowerCase();jQuery.fn[type]=function(size){return this[0]==window?document.compatMode=="CSS1Compat"&&document.documentElement["client"+name]||document.body["client"+name]:this[0]==document?Math.max(document.documentElement["client"+name],document.body["scroll"+name],document.documentElement["scroll"+name],document.body["offset"+name],document.documentElement["offset"+name]):size===undefined?(this.length?jQuery.css(this[0],type):null):this.css(type,typeof size==="string"?size:size+"px")}})})();var $HTML=jQuery(HTML),$WIN=jQuery(window),$DOC=jQuery(document),$HEAD=jQuery('HEAD'),$BODY=jQuery('BODY');if(window.jsLoader){var jQ=(jsCore.jQuery=jQuery)}$P('jQuery.file',1);;
jsLoader.loaded('{jQuery}jquery', 1);$P('jsBuild.{jQuery}jquery', 1);


$P('jsBuild.{utils}HotKeys');/**
 * @object	HotKeys
 * @author	RubaXa	trash@rubaxa.org
 */
window.HotKeys={collection:[],init:function(){jQuery(document).keydown($D(this,'fire'))},add:function(e,h,c,s){var k,mK;if(defined(c)&&(c.constructor!=Function)){s=!!c;c=0}else{s=defined(s,1)}h=h.toLowerCase().split('+');k=h[h.length-1];mK=h.length==1?0:h[0];HotKeys.collection.push({'key':String(k).toUpperCase(),'keyCode':HotKeys.getKeyCode(k),'metaKey':mK,'method':c,'stop':s,'$Elm':jQuery(e)});return this},getKeyCode:function(k){return jsEvent.Key[k]||k.toUpperCase().charCodeAt(0)},fire:function(e){var keys=this.collection,r,rt=true;for(var i=0,n=keys.length;i<n;i++){if((keys[i])&&(keys[i].keyCode==e.keyCode)&&(!keys[i].metaKey||e[keys[i].metaKey+'Key'])){try{r=1;if(keys[i].method)r=keys[i].method(e)!==false;if(r){try{keys[i].$Elm.triggerHandler('focus').triggerHandler('click')}catch(err){};if(!keys[i].stop){switch(keys[i].$Elm[0].tagName){case'A':document.location.href=keys[i].$Elm[0].href;break;case'INPUT':{if((keys[i].$Elm[0].type=='submit')||(keys[i].$Elm[0].type=='image')){keys[i].$Elm.parent('FORM').submit()}}break;case'FORM':keys[i].$Elm.submit();break}}else{r=false}}rt=r&&rt}catch(err){keys[i].method=null;keys[i].$Elm=null;keys[i]=null}}}keys=null;return rt}};jsCore.ready($D(HotKeys,'init'));jQuery.fn.setHotKey=function(h,c,s){HotKeys.add(this[0],h,c,s);return this};;
jsLoader.loaded('{utils}HotKeys', 1);$P('jsBuild.{utils}HotKeys', 1);


$P('jsBuild.{jsCore}Window');/**
 * @object	Window
 * @author	RubaXa	<trash@rubaxa.org>
 * @version	1.0
 * @deprecated
 */
window.Window=new(jsClass.create().methods({open:function(u,p){var p=$E({name:'window'+jsCore.getUniqId(),fullscreen:0,location:1,menubar:1,resizable:1,scrollbars:1,status:1,titlebar:1,toolbar:1,left:'',top:'',width:'',height:''},p);var _p=[];if((p.left=='')&&(p.width>0))p.left=Math.max(0,(screen.width-p.width)/2);if((p.top=='')&&(p.height>0))p.top=Math.max(0,(screen.height-p.height)/2);jsCore.each(p,function(k,v){if(v!=='')_p.push(k+'='+v)});return window.open(u,p.name,_p.join(','))},openPopUp:function(u,p){return this.open(u,$E({location:0,menubar:0,resizable:0,toolbar:0},p))},setTitle:function(t){document.title=t},refresh:function(){document.location.reload()},resize:function(w,h){if(w>screen.width)w=screen.width;if(h>screen.height)h=screen.height;window.resizeTo(w,h)},scrolling:function(enable){if(defined(enable)){document.body.style.overflow=enable?'hidden':''}return this},hasScrolling:function(x){if(x){return(this[x=='X'?'getWidth':'getHeight']()<document.body[x=='X'?'scrollWidth':'scrollHeight'])}else{return(this.hasScrolling('X')||this.hasScrolling('Y'))}}}));;
jsLoader.loaded('{jsCore}Window', 1);$P('jsBuild.{jsCore}Window', 1);


$P('jsBuild.{jsCore}Array');/**
 * @author				RubaXa	<trash@rubaxa.org>
 * @compatibility		JavaScript 1.5+
 * http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Array 
 */
if(!Array.lastIndexOf){Array.lastIndexOf=function(a,e,f){var l=a.length;var f=Number(f);if(isNaN(f)){f=l-1}else{f=(f<0)?Math.ceil(f):Math.floor(f);if(f<0)f+=l;else if(f>=l)f=l-1}for(;f>-1;f--){if((f in a)&&(a[f]===e))return f}return-1}};if(!Array.forEach){Array.forEach=function(a,f,This){if(typeof f!='function')throw new TypeError();for(var i=0,n=a.length;i<n;i++){if(f.call(This,a[i],i,a)==false){break}}}};if(!Array.every){Array.every=function(a,f,This){if(typeof f!='function')throw new TypeError();for(var i=0,n=a.length;i<n;i++){if((i in a)&&!f.call(This,a[i],i,a))return false}return true}};if(!Array.some){Array.some=function(a,f,This){if(typeof f!='function')throw new TypeError();for(var i=0,n=a.length;i<n;i++){if((i in a)&&f.call(This,a[i],i,a))return true}return false}};if(!Array.map){Array.map=function(a,f,This){if(typeof f!='function')throw new TypeError();var l=a.length;var r=new Array(l);for(var i=0;i<l;i++){if(i in a)r[i]=f.call(This,a[i],i,a)}return r}};if(!Array.reduce){Array.reduce=function(a,f,i){if(typeof f!='function')throw new TypeError();var l=a.length;if(l==0&&arguments.length==1)throw new TypeError();var i=0;if(arguments.length>=2){var rv=arguments[1]}else{do{if(i in a){rv=a[i++];break}if(++i>=l)throw new TypeError()}while(true)}for(;i<l;i++){if(i in this)rv=f.call(null,rv,a[i],i,a)}return rv}};if(!Array.reduceRight){Array.reduceRight=function(a,f,i){return this.reduce(a.reverse(),f,i)}};$E(Array,{insert:function(a,v,i){return a.slice(0,i).concat(v).concat(a.slice(i))},push:function(a,v,f){if(f){return[v].concat(a)}else{a.push(v);return a}},create:function(a){return a?(a.constructor==Array?a:[a]):[]},keys:function(a){var k=[];for(var i in a)k.push(i);return k},first:function(a,k){for(var i in a)return k?i:a[i]},firstKey:function(a){return this.first(a,1)},end:function(a){return a[a.length-1]},extract:function(o,p){if(typeof(props)=='string')p=p.split(',');var a=o.constructor==Array;var r=a?[]:{};for(var i=0,n=p.length;i<n;i++){a?r.push(o[p[i]]):r[p[i]]=o[p[i]]}return r},fill:function(a,l,v){var r=[];r.push.apply(r,a);for(var i=0;i<l;i++)r.push(v);return r},replace:function(a,r,i){if(r.constructor!=Array)r=[r];return a.slice(0,i).concat(r,a.slice(i+r.length))},move:function(a,f,t){var i=a[f];return this.insert(this.remove(a,f),i,t)},sum:function(a,F,T){var r=0;for(var i=0,n=a.length;i<n;i++){r+=(F||jsCore.F).call(T,a[i])}return r},shuffle:function(a){var res=$A(a),l=res.length,t,r;while(--l){r=Math.rand(0,l);if(r!=l){t=res[l];res[l]=res[r];res[r]=t}}return res},isEmpty:function(a){return!(a&&a.length)}});jsCore.Array=function(a){if(a)this.setArray(a)};jsCore.Array.prototype=new Array();(function(P,ar){Object.forEach(Array,function(func,name){if(!P[name])P[name]=function(){return func.apply(Array,[this].concat(arguments))}});var helper={concat:1,splice:1,slice:1,sort:1,reverse:1,map:1,forEach:2};Array.forEach(Array.keys(helper).concat('push,shift,join,pop,unshift'.split(','),Array.keys(P)),function(name){if(typeof P[name]=='function'){P['_'+name]=P[name];P[name]=function(){var r=P['_'+name].apply(this,arguments);if((helper[name]&&helper[name]==2)||typeof r=='undefined')return this;else if(helper[name]||r.constructor===Array)return new jsCore.Array(r);return r}}});P.constructor=jsCore.Array;P.add=function(value){this[this.length++]=value;return this};P.toArray=function(){return $A(this)};P.setArray=function(a){this.length=0;this.push.apply(this,a);return this}})(jsCore.Array.prototype,Array.prototype);;
jsLoader.loaded('{jsCore}Array', 1);$P('jsBuild.{jsCore}Array', 1);


$P('jsBuild.{utils}jsFix');/**
 * @object		jsFix
 * @author		"RubaXa"		<trash@rubaxa.org>
 */
var jsFix={pixel:'{img.pixel}1.gif',ready:function(){},elm:function(e,c){if(e&&e.append)e=e[0];if(!e)return;this._elm(e);this.png(e);if(defined(c,1)){var e=e.getElementsByTagName('*');for(var i=0,n=e.length;i<n;i++){this._elm(e[i]);this.png(e[i])}}e=null;delete e},_hasClass:function(e,c){return(new RegExp('(^|\\s)'+c+'($|\\s)')).test(e.className)},_elm:function(e){if(!e.__fixed){e.__fixed=1;switch(e.tagName){case'INPUT':{if(!this._hasClass(e,e.type))e.className+=' '+e.type;if((e.type=='xradio')||(e.type=='checkbox')){jQuery(e).click(jsFix._checkBox);jsFix._checkBox.call(e)}}break;case'SELECT':case'TEXTAREA':{if(!this._hasClass(e,e.tagName.toLowerCase())){e.className+=' '+e.tagName.toLowerCase()}}break}}},_checkBox:function(){this.parentNode.className=this.parentNode.className.replace(/(\s|^)checked(\s|$)/,'$2')+(this.checked?' checked':'')},png:function(e){if($B.msie&&($B.ver<7)){var src;if(this.isPngFile(e.src)){if(e.width&&e.height){e.style.width=e.width;e.style.height=e.height}e.rsrc=e.src;e.src=this.iPixel;e.runtimeStyle.filter='none';e.runtimeStyle.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+e.rsrc+"',sizingMethod='crop')"}else if(e.background&&this.isPngFile(e.background)){e.rsrc=this.getSrc(e.background);e.background='none';e.runtimeStyle.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+e.rsrc+"',sizingMethod='crop')"}else if(e.style.backgroundImage&&this.isPngFile(e.style.backgroundImage)){e.rsrc=this.getSrc(e.style.backgroundImage);e.style.backgroundImage='none';e.runtimeStyle.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+e.rsrc+"',sizingMethod='crop')"}else if(e.currentStyle.backgroundImage&&this.isPngFile(e.currentStyle.backgroundImage)){e.rsrc=this.getSrc(e.currentStyle.backgroundImage);e.currentStyle.backgroundImage='none';e.runtimeStyle.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+e.rsrc+"',sizingMethod='crop')"}}},label:function(e){if($B.msie){if(e[0])e=e[0];e=e.getElementsByTagName('LABEL');for(var i=0,n=e.length;i<n;i++){if($GA(e[i],'htmlFor')){jQuery(e[i]).bind('click',function(){try{var I=jQuery(document.getElementById(this.getAttribute('htmlFor')));if(I[0]){I[0].checked=true;I.click().focus()}I=null}catch(e){}})}}}},isPngFile:function(f){return f&&/\.png$/.test(f)},getSrc:function(s){return(s.indexOf('url(')>-1)?/url\((.*)\)/i.exec(s)[1].replace(/['"]/g, ''):s}};jsCore.ready(function(){jsFix.ready()});;
jsLoader.loaded('{utils}jsFix', 1);$P('jsBuild.{utils}jsFix', 1);


$P('jsBuild.{jQuery}extensions');/**
 * Необходимые расширения для jQuery
 * @author	"RubaXa"		<trash@rubaxa.org>
 */
var PFSSN=0,PFSS_init=jsCore.F,PFSS=0;if($B.msie&&(!jQuery.boxModel||($B.ver<7))){PFSSN=1;PFSS_init=function(){PFSS_init=jsCore.F;var S=document.createElement('STYLE'),i=0,sS=document.styleSheets;try{S.setAttribute('type','text/css');HEAD.insertBefore(S,HEAD.firstChild);for(;sS[i];i++){if(document.location.href.indexOf(sS[i].href)!=-1){PFSS=sS[i];break}}}catch(e){PFSSN=2};S=sS=null}}jsCore.jQuery.fn.extend({F:function(){return this},elm:function(n){return jQuery(this[0].elements[n])},replaceClass:function(s,r){this.each(function(){this.className=this.className.replace(s,r)});return this},cleenHtml:function(lvl){if(this[0]&&this[0].childNodes&&this[0].childNodes.length){for(var n,i=this[0].childNodes.length-1;i>=0;i--){n=this[0].childNodes[i];if(n.nodeType==1){if(isNaN(lvl)?lvl:--lvl)jQuery(n).cleenHtml(lvl)}else{n.parentNode.removeChild(n)}}n=null}return this},fix:function(c){this.each(function(){jsFix.elm(this,c)});return this},_parents:jQuery.fn.parents,parents:function(r,v){if(defined(v)){return jQuery($G(this,r,v))}return this._parents(r)},item:jQuery.fn.eq,unselectable:function(offOn){if(defined(offOn)){this.each(function(){$SA(this,'unselectable',offOn?'On':'Off');var e=this.getElementsByTagName('*');for(var i=0;e[i];i++){$SA(e[i],'unselectable',this.unselectable?'On':'Off');e[i].style['user-select']=e[i].style['-moz-user-select']=e[i].style['-khtml-user-select']=(this.unselectable?'none':'normal')}e=null})}else{return(this[0].unselectable.toLowerCase()=='on')}return this},hitTest:function(e){if(e.constructor==String)e=jQuery(e)[0];else if(e[0])e=e[0];else if(e.target)e=e.target;for(var i=0,a;i<this.length;i++){a=this[i];var x=e;do{if(a==x){a=x=e=null;return true}}while(x=x.parentNode)};a=x=e=null;return false},insertFirst:jQuery.fn.prependTo,toObject:function(f){var data={};this.find('INPUT,TEXTAREA,SELECT').each(function(){try{if(this.name&&(!this.disabled||f)){switch(this.tagName){case'INPUT':case'TEXTAREA':{if(this.type=='checkbox'){if(f||this.checked){if(this.name.indexOf('[]')>0){if(!data[this.name])data[this.name]=[];data[this.name].push(this.checked?this.value:'')}else data[this.name]=this.checked?this.value:''}}else if(this.type=='radio'){if(this.checked)data[this.name]=this.value}else{data[this.name]=((window.InputValidator?InputValidator.get(this):0)||this).value}}break;case'SELECT':data[this.name]=this.options[this.selectedIndex].value;break}}}catch(e){debug.log(e)}});return data},scrollWidth:function(){return(this[0]&&this[0].scrollWidth)?this[0].scrollWidth:0},scrollHeight:function(){return(this[0]&&this[0].scrollHeight)?this[0].scrollHeight:0},setPositionFixed:function(x,y){if(!this[0])return this;if(PFSSN==1){var c=('pfixed'+x+'-'+y).replace(/%/g,'pr');if(!Registry.get(c)){PFSS_init();if(PFSSN==2)return this.setPositionFixed(x,y);if((typeof x!='number')&&(x.indexOf('%')>0))x='window.width()*'+(parseFloat(x)/100);else x=parseInt(x);if((typeof y!='number')&&(y.indexOf('%')>0))y='window.height()*'+(parseFloat(y)/100);else y=parseInt(y);PFSS.addRule('.'+c,'position: absolute;'+"left: expression((window.scrollLeft()+"+x+") + 'px');"+"top: expression((window.scrollTop()+"+y+") + 'px');");Registry.put(c,1)}this.removePositionFixed().addClass(c)}else{this.css({position:PFSSN?'absolute':'fixed',top:y,left:x})}return this},removePositionFixed:function(){if(this[0]){this[0].className=this[0].className.replace(/(\s|^)pfixed([\d.,pr-]+)(\s|$)/gi,'');this[0].style.position=''}return this},replace:function(f){this.replaceWith(f.append?f:f.call(this,this));return this},ajaxSubmit:function(a){var o=this.toObject();if(!a.beforeSubmit||(a.beforeSubmit.call(this,o,this)!==false)){a.data=$E(o,a.data);jQuery.ajax(a)}return this}});;
jsLoader.loaded('{jQuery}extensions', 1);$P('jsBuild.{jQuery}extensions', 1);


$P('jsBuild.{plugins}jsPlugins');window.jQuery=(jsCore.jQuery||window.jQuery);window.jsPlugins=(new(jsClass.create().methods({__construct:function(){this.elms={}},processing:function(e){jQuery(e).find('.js-plugin').removeClass('js-plugin').each(function(){jsPlugins.set(this,'plugin')})},set:function(e,name,o){if(!e)return this;var uId=jsCore.getUniqId(e=$F(e));if(!this.elms[uId])this.elms[uId]={};var x=e.onclick?e.onclick():0;o=o||{};if(typeof x=='string')name=x;else o=$E(x||{},o);e.removeAttribute('click');e.onclick=null;if(name=='plugin'){if(o.plugin){this.set(e,o.plugin,(o.options||o))}else if(o[0]){for(var i=0;o[i];i++){this.set(e,o[i].plugin,o[i].options)}}else{for(var n in o)this.set(e,n,o[n])}}else{var alias=o.__pAlias||jsLoader.getAlias(name,'plugins'),name=jsLoader.getName(name),require='{'+alias+'}'+name,i=0,n=name.split('.'),Klass=window;for(;n[i]&&(Klass=Klass[n[i]]);i++){}if(Klass&&(Klass.constructor==Function)){jsPlugins.elms[uId][name]=new Klass(jQuery(e),o)}else{o.__pAlias=alias;jsLoader.require(require,function(){jsPlugins.set(e,name,o)})}}return this},get:function(e,n){var uId=jsCore.getUniqId(e&&$F(e));return this.elms[uId]&&this.elms[uId][n]}})));jQuery.fn.extend({setPlugin:function(n,o,e,r){if(!e||!this.hasPlugin(n))jsPlugins.set(this[0],n,o);return r?this.getPlugin(n):this},getPlugin:function(n){return jsPlugins.get(this[0],jsLoader.getName(n))},hasPlugin:function(n){return!!jsPlugins.get(this[0],n)},processPlugins:function(){for(var i=0;this[i];i++)if(this[i].innerHTML.indexOf('js-plugin'))jsPlugins.processing(this);return this}});jsCore.ready(function(){jQ('BODY').processPlugins()});;
jsLoader.loaded('{plugins}jsPlugins', 1);$P('jsBuild.{plugins}jsPlugins', 1);


$P('jsBuild.{plugins}LightBox');/**
 * @class   LightBox
 * @author  RubaXa 	<trash@rubaxa.org>
 */
jsClass.create('LightBox').methods({__construct:function($Box,options){LightBox.count++;$E(this,{position:'fixed',pTop:'50%',pLeft:'50%',fadeNode:0,fadeColor:'#000',fadeOpacity:0.6,hideSelects:1,hideObjects:0,visible:0,disabledHide:0,disabledShow:0,disable:0,controls:0,lbControls:'.lb-controls'},options);this.top=this.pTop;this.left=this.pLeft;this._dFire=$D(this,'fireControl');this.$Fade=this.fadeNode?jQuery(this.fadeNode):jQuery('<div></div>').css({opacity:this.fadeOpacity,backgroundColor:this.fadeColor,width:'100%',height:'100%',display:'none'}).setPositionFixed(0,0).appendTo('BODY');this.$Box=jQuery($Box).processPlugins();if(this.position='fixed'){this.$Box.setPositionFixed(this.left,this.top)}else if(this.position){this.$Box.css({position:this.position,left:this.left,top:this.top})}if(this.controls)this.initControls(this.controls.constructor==Array?this.controls:jQuery(this.controls));this.initControls(this.$Box);if($B.msie)this.$BODY=jQuery('BODY');if(this.showBy)jQ(this.showBy).click($D(this,function(){this.show();return false}));if(this.hideBy)$(this.hideBy).click($D(this,function(){this.hide();return false}));this.callMethod('init');LFade.hide();if(this.visible)this.show(true)},custom:function(){var p=['customFunc'];Array.prototype.push.apply(p,arguments);return!(this.callMethod.apply(this,p)!==false)},initControls:function($X,s){for(var i=0;$X[i];i++){if($X[i]&&$X[i].getAttribute&&(c=$GA($X[i],'lightBox'))){c=c.indexOf('{')>-1?eval("("+(c||'{}')+")"):{m:c};if(c&&c.m&&this[c.m]){$X[i].___c=c;jQuery($X[i]).bind($X[i].tagName=='FORM'?'submit':'click',$D(this,this.fireControl))}$X[i].removeAttribute('lightBox');$X[i].lightBox=null}}if(!s&&!this.lbFast&&$X.find)this.initControls($X.find('.lb-control,A'),true)},fireControl:function(e){this.__e=e;this.__c=jsCore.elm(e,'___c');if(!(this._cDisable||e.disabled)&&(this.__c.___c&&this.__c.___c.m&&this[this.__c.___c.m])){return(this[this.__c.___c.m].apply(this,(this.__c.___c.p||[]))===true)}},getEvent:function(){return this.__e},getControl:function(){return this.__c},fixPos:function(a){if(this.position){this.width=this.$Box.outerWidth();this.height=this.$Box.outerHeight();this.dw=this.width/2;this.dh=this.height/2;var s={marginLeft:-this.dw,marginTop:-this.dh},xH=this.height>window.height()-8,xW=this.width>window.width()-8,x=xW||xH;if(PFSSN!=1){this.top=s.top=x?(Math.max(this.dh,window.height()/2)-8*xW+window.scrollTop()+'px'):window.height()/2;this.left=s.left=x?(Math.max(this.dw,window.width()/2)-8*xH+window.scrollLeft()+'px'):this.pLeft;this.abs=x;s.position=x?'absolute':this.position}if(0&&a&&this.isVisible()){this.$Box.css('position',s.position);this.$Box.animate({top:s.top,marginTop:s.marginTop},'fast')}else this.$Box.css(s)}return this},controlDisable:function(s){this._cDisable=!!s;return this},isDisabled:function(){return this._cDisable},html:function(html){$FS(this.$Box[0]).visibility='hidden';this.$Box.html(html).processPlugins();this.initControls(this.$Box);this.fixPos();$FS(this.$Box[0]).visibility='';return this},isVisible:function(){return this.visible},toggle:function(f,s){var d=defined(s,!this.visible)?'':'none',e=!d?'show':'hide';if(this.dispatchEvent('before'+String.ucfirst(e),this)!==false){$FS(this.$Box[0]).zIndex=1100*(LightBox.active+1);if(!this.$Fade[0].__lb||(this.$Fade[0].__lb==this.uniqId)){this.$Fade[0].__lb=!d?this.uniqId:0;this.$Fade.css('zIndex',1000*(LightBox.active+1));f||$B.msie?this.$Fade.css('display',d):this.$Fade[!d?'fadeIn':'fadeOut']('fast')}LightBox.active+=!d?1:-1;var top=this.abs?window.scrollTop():0;if(!d){this.fixPos();$FS(this.$Box[0]).display='';LightBox.last=this;LightBox.open.push(this)}else{$FS(this.$Box[0]).display='none';if(LightBox.open)LightBox.open=Array.remove(LightBox.open,this,1);LightBox.last=LightBox.open[LightBox.active-1]}this._visible=this.visible;this.visible=!d;if(this.$BODY){if(this.hideSelects)this.$BODY[this.visible?'addClass':'removeClass']('hidden-all-selects');if(this.hideObjects)this.$BODY[this.visible?'addClass':'removeClass']('hidden-all-objects')}this.dispatchEvent(e,this)}return this},hide:function(f){return this.disabledHide?this:this.toggle(f,false)},show:function(f){return this.disabledShow?this:this.toggle(f,true)},destroy:function(){LightBox.count--;if(this.isVisible)this.hide()}});LightBox.last=0;LightBox.open=[];LightBox.count=0;LightBox.active=0;$BODY.setHotKey('esc',function(){if(LightBox.active&&!LightBox.last.isDisabled()){LightBox.last.hide()}});jQ(window).resize(function(){if(LightBox.active&&LightBox.last.isVisible()){Array.forEach(LightBox.open,function(L){L.isVisible()&&L.fixPos()})}});LightBox.hideAll=function(){Array.forEach(LightBox.open,function(L){L.isVisible()&&L.hide()})};;
jsLoader.loaded('{plugins}LightBox', 1);$P('jsBuild.{plugins}LightBox', 1);


$P('jsBuild.{plugins}InputValidator');/**
 * @class   InputValidator
 * @author  RubaXa 	<trash@rubaxa.org>
 * @events	blur, focus, click, valid
 * Базовый класс для валидации Input'ов, Select'ов и подобного хлама
 */
jsClass.create('InputValidator').methods({__construct:function($T,o){InputValidator[this.uniqId]=this;$T=jQuery($T);o=o||{};this.beforeInit($T,o);this.$Group=this.$Group||(o.group?jQuery(o.group):this.$Input);this.counters=!!o.group;delete o.group;if(this.$Group[0].onclick){$E(o,this.$Group[0].onclick());this.$Group[0].onclick=null}if(this.$Input[0].onclick){$E(o,this.$Input[0].onclick());this.$Input[0].onclick=null}this.$Input[0].ivUniqId=this.uniqId;this.event={};this.name=this.$Input[0].name.replace('[]','');this.type=(this.$Input[0].type||'text').toLowerCase();this.tagName=this.$Input[0].tagName.toUpperCase();this.isInput=this.tagName=='INPUT';this.isSelect=this.tagName=='SELECT';this.isTextarea=this.tagName=='TEXTAREA';this.isText=this.type=='text';this.isPass=this.type=='password';this.isFile=this.type=='file';this.isImage=this.type=='image';this.isRadio=this.type=='radio';this.isCheckbox=this.type=='checkbox';this.isChecked=this.isSelected=!!this.$Input[0][this.isCheckbox?'checked':'selected'];$E(this,this.getDefOptions(),o);if((this.format&&(typeof this.format=='string'))||(this.validator&&(typeof this.validator=='string'))){if(InputValidator.Formats[this.format]){this.format=InputValidator.Formats[this.format]}else if(InputValidator.Validators[this.validator||this.format]){this.validator=InputValidator.Validators[this.validator||this.format];this.format=0}else{this.format=0;this.validator=0}}this._pV=-1;this.$Error=this.errNode?jQuery(this.errNode):0;this.callMethod('init');this._counters();setTimeout($D(this,function(){if(this.inFocus){this.setFocus();this.fireEvent('focus')}else{this.fireEvent('keyUp')}}),0)},beforeInit:function($T,o){if(InputValidator.TAGS[$T[0].tagName.toUpperCase()]){this.$Input=$T}else{o.group=$T;this.$Input=$T.find(o.target||'INPUT,TEXTAREA,SELECT').filter(':first')}return this.$Input},bindEvents:function(e){Array.forEach(e.split(','),function(n){this.$Input.bind(n.toLowerCase(),$D(this,'fireEvent',n))},this);return this},_counters:function(c){if(c){if(this.$Length&&this.$Length[0])this.$Length[0].innerHTML=this.value.length;if(this.$Remain&&this.$Remain[0])this.$Remain[0].innerHTML=this.maxLength-this.value.length}else if(this.counters){this.$Length=this.$Group.find(this.length);this.$Remain=this.$Group.find(this.remain)}},getDefOptions:function(){return{target:'.v-target',errors:0,errNode:0,length:'.length',remain:'.remain',min:1,sEmpty:0,sIndex:0,sMinIndex:-1,sMaxIndex:-1,minLength:($GA(this.$Input[0],'minlength')||0)*1,maxLength:($GA(this.$Input[0],'maxlength')||0)*1,format:($GA(this.$Input[0],'format')||0),validator:0,dValue:($GA(this.$Input[0],'dValue')||''),defaultValue:($GA(this.$Input[0],'defaultValue')||''),inFocus:0,selectOn:0,valid:'valid',invalid:'invalid'}},fireEvent:function(n,e){this.event=e||this.event||{};this.event.name=n;if(this._st){if(this._st==this.event.type){this._se=this._st=0}return false}if(n=='focus'||n=='blur')this.inFocus=n=='focus';if(n=='focus'||n=='keyDown'||n=='change'||n=='click')this._pV=-1;this.isClicked=n=='click';this.validate(n,e);this._errors(n);switch(n){case'keyUp':this.changed=this._fv!=this.value;break;case'focus':if(this.$RE)this.$RE.html(this._error);if(1||this._bv!=this.value)this._fv=this.value;case'blur':{this._bv=this.value;this.changed=this._fv!=this.value;if(this.focus)this.$Group[this.inFocus?'addClass':'removeClass'](this.focus);if(this.invalid){this._valid(!this.inFocus&&(!this._isValid||!this._pV)&&(!this._isEmpty||this._iE))}}break}if(this.selectOn&&(this.selectOn==n.toLowerCase())){this.$Input.select()}this.dispatchEvent(n,this,e);if(this._se){this._se=0;return false}},_valid:function(v){this.$Group[v?'addClass':'removeClass'](this.invalid)},_errors:function(n){var s=n=='blur',e=this.errors;if(e&&(s||(n=='focus')||(n=='keyUp'))){s&=!this.isEmpty()&&!this.isValid();this.$Error[s?'show':'hide'](-1)[s?'html':'F'](e)}},stopEvent:function(){this._se=1;this._st=this.event.type=='keydown'?'keyup':0;return this},setValidate:function(v,e){if((this._isValid!==!!v)||(!!e!==this.__e)||(this._pV!==this.__pV)){if(this.empty)this.$Group[e?'addClass':'removeClass'](this.empty);if(this.valid)this.$Group[!e&&v&&this._pV?'addClass':'removeClass'](this.valid);if(this.invalid&&!this._isValid&&v)this.$Group.removeClass(this.invalid);this.__e=this._isEmpty=!!e;this._isValid=!!v;this._iE=!this._pV;this.__pV=this._pV;this.dispatchEvent('valid',this)}return this},validate:function(n,e){},isChanged:function(){return!!this.changed},getInput:function(){return this.$Input},isFocus:function(){return!!this.inFocus},isEmpty:function(){return!!this._isEmpty},isValid:function(){return!!(this.notValid?!1:this.validate()&&!!this._pV)},attr:function(k,v){if(k.constructor==Object){this.$Input.attr(n);return this}else{k=this.$Input.attr(k,v);return defined(v)?this:k}},val:function(v){if(defined(v)){this.$Input[0].value=v;this.fireEvent('blur');return this}return this._isEmpty?'':this.value},setFocus:function(){try{this.$Input[0].focus()}catch(e){};return this},setIsValid:function(v,t){if(t){this.$RE=this.$Group.find('.error');this._error=this.$RE.html();this.$RE.html(t)}this._pV=v;this.fireEvent('blur');return this},destroy:function(){}});InputValidator.TAGS={INPUT:1,SELECT:1,TEXTAREA:1};InputValidator.Formats={'int':/^\d*$/,'float':/^\d*((\.|,)\d*)?$/,'wmNumber':/^[a-z]?\d*?$/i};InputValidator.Validators={'int':function(v,V){return InputValidator.Formats.int.test(v=parseInt(v))&&(V.min<=v)&&(V.max>=v)},'phone':function(v,V){return/^(\+\d+\s?)?(\(?\d+\)?\s)?(\d{2,}[-\s]?){3,}$/.test(v)},'email':function(v,V){return jsCore.isEmail(v)},'equal':function(v,V){return(V.valueModifier||jsCore.F)(v)==(typeof V.equal=='String'?V.equal:(V.equal.val||V.equal)())},'location':function(v){return v=='0_0_0'||!/\d+_\d+_0$/.test(v)}};$E(InputValidator,{names:[],add:function(n){this.names.push(n);return this},get:function(N){if(N.append)N=N[0];if(N.ivUniqId)return InputValidator[N.ivUniqId];var V,i=0,n;for(;n=this.names[i]&&!V;i++)V=jsPlugins.get(N,n);return V},getName:function(N){if(N.append)N=N[0];if(N.tagName=='INPUT')return'Input'+String.ucfirst(N.type=='password'?'Text':N.type);else if(N.tagName=='SELECT')return'InputSelect';else if(N.tagName=='TEXTAREA')return'InputText';else throw Error('InputValidator.getName — unknow bred')},auto:function(N,P,opts){if(N.append)N=N[0];var V=this.get(N),n;if(!V){if(N.tagName=='INPUT'||N.tagName=='SELECT'||N.tagName=='TEXTAREA'){n=this.getName(N);V=jsPlugins.set(N,n,$E({group:P},opts)).get(N,n)}else{V=this.auto(jQuery(N).find('INPUT,SELECT,TEXTAREA'),N,opts)}}return V}});;
jsLoader.loaded('{plugins}InputValidator', 1);$P('jsBuild.{plugins}InputValidator', 1);


$P('jsBuild.{plugins}InputText');/**
 * @class   InputText
 * @author  RubaXa 	<trash@rubaxa.org>
 * @require	InputValidator
 * Валидатор текстовых полей.
 */
jsClass.create('InputText').extend(InputValidator).methods({init:function(){this.bindEvents('blur,focus,click,keyDown,keyPress,keyUp')},validate:function(n,e){var v=this.isDefaultValue?'':this.$Input[0].value,e=this._isEmpty,isValid=this._isValid,l=0;if(this.value!==v){l=v.length;e=l==0;if(!e&&((this.format&&!this.format.test(v))||(this.maxLength>0)&&(this.maxLength<l))){var s=this.getSelection();this.val(v=this.value).setCaretPos(s.end-1).stopEvent()}else{isValid=!e}if(this.validator&&!this.validator(v,this)){isValid=0}l=v.length;if(this.minLength)isValid&=this.minLength<=l;e=!l;this.value=v;this._counters(!0);this.setValidate(isValid,e)}return(this.minLength||this.format||this.validator)?isValid:true},getSelection:function(){var s={},l=this.value.length;if(this.$Input[0].createTextRange){var r=document.selection.createRange().duplicate();r.moveEnd('character',l);if(r.text==''){s.start=s.end=l+1}else{s.start=this.value.lastIndexOf(r.text);var r=document.selection.createRange().duplicate();r.moveStart('character',-l);s.end=r.text.length}}else{s.start=this.$Input[0].selectionStart;s.end=this.$Input[0].selectionEnd}s.text=this.value.substring(s.start,s.end);return s},setSelection:function(s,e){if(this.$Input[0].createTextRange){var R=this.$Input[0].createTextRange();R.collapse(true);R.moveEnd('character',e);R.moveStart('character',s);R.select()}else if(this.$Input[0].setSelectionRange){this.$Input[0].setSelectionRange(s,e)}return this},replaceSelection:function(t){var s=this.getSelection(),ins=s.end==s.start;s.end=s.start+t.length;if(document.selection){var R=document.selection.createRange();R.text=t;R.select();R=null}else if(s.start>=0){this.$Input[0].value=this.$Input[0].value.substr(0,s.start)+t+this.$Input[0].value.substr(s.end)}else{this.$Input[0].value+=t;s.start=s.end=this.$Input[0].value.length}if(ins)s.start=s.end;this.setSelection(s.start,s.end);this.validate();return this},setCaretPos:function(p){return this.setSelection(p,p)}});InputValidator.add('InputText');;
jsLoader.loaded('{plugins}InputText', 1);$P('jsBuild.{plugins}InputText', 1);


$P('jsBuild.{plugins}InputRadio');/**
 * @class   InputRadio
 * @author  RubaXa 	<trash@rubaxa.org>
 * @require	InputValidator
 * Валидатор кружочгов.
 */
jsClass.create('InputRadio').extend(InputValidator).methods({beforeInit:function($T,o){this.$Group=($T[0].tagName=='INPUT'?jQuery(o.group):$T);this.$Input=this.$Group.find(o.target||'INPUT[type=radio]');this.count=this.$Input.length;this.radio=this.$Input.filter(':checked')[0];this._isValid=this.isChecked=this.isSelected=!!this.radio;if(this.$Group[0].onclick){$E(this,this.$Group[0].onclick());this.$Group[0].onclick=null}this.bindEvents('click')},validate:function(n,e){var v=this._isValid;this.radio=this.$Input.filter(':checked')[0];this.value=this.radio?this.radio.value:'';this.changed=this.value!=this._value;this._value=this.value;v=this.isChecked=this.isSelected=!!this.radio;if(this.validator)v&=this.validator(this);if(v!==this._isValid||this._isEmpty!==!this.isChecked||this.changed){this._value=this.value;this.setValidate(v,!this.isChecked);this.dispatchEvent('change',this,e||{})}return this._isValid},size:function(){return this.count},getItems:function(){return this.$Input},getSelected:function(){return jQuery(this.radio)},val:function(v){if(defined(v)){this.$Input.filter('[value='+v+']').attr('checked',true);this.validate();return this}else{return this.value}}});InputValidator.add('InputRadio');;
jsLoader.loaded('{plugins}InputRadio', 1);$P('jsBuild.{plugins}InputRadio', 1);


$P('jsBuild.{plugins}InputCheckbox');/**
 * @class   InputCheckbox
 * @author  RubaXa 	<trash@rubaxa.org>
 * @require	InputValidator
 * Валидатор квадратика с галочкой.
 */
jsClass.create('InputCheckbox').extend(InputValidator).methods({beforeInit:function($T,o){this.$Group=($T[0].tagName=='INPUT'?jQuery(o.group):$T);this.$Input=this.$Group.find(o.target||'INPUT[type=checkbox]');this.value=[];this.count=this.$Input.length;this.sCount=this.getSelected().length;this.isChecked=this.isSelected=this.sCount>0;this.bindEvents('click,focus,blur')},_counters:function(c){if(this.counters){this.$Length=this.$Group.find(this.length);this.$Remain=this.$Group.find(this.remain)}else if(c){if(this.$Length&&this.$Length[0])this.$Length[0].innerHTML=this.sCount;if(this.$Remain&&this.$Remain[0])this.$Remain[0].innerHTML=this.count-this.sCount}},validate:function(n,e){this.sCount=0;this.value=null;this.value=[];for(var i=0,n=this.$Input.length;i<n;i++){if(this.$Input[i].checked){this.sCount++;this.value.push(this.$Input[i].value)}}if(this.max&&(this.sCount>=this.max||this.__d)){this.$Input.filter(':not(:checked)').attr('disabled',this.__d=!this.__d)}v=this.sCount>=(this.min||0);if(this.validator)v&=this.validator(this);this.isChecked=this.isSelected=this.sCount>0;this.setValidate(v,!this.sCount);if(this.changed=(this._sCount!==this.sCount)){this._sCount=this.sCount;this._counters(1);this.dispatchEvent('change',this,e)}return this._isValid},setValidate:function(v,e){if(this._pV!=-1)v=this._pV;if((this._isValid!==!!v)||(!!e!==this.__e)||(this._pV!=-1)){if(this.empty)this.$Group[e?'addClass':'removeClass'](this.empty);if(this.valid)this.$Group[!e&&v?'addClass':'removeClass'](this.valid);if(this.invalid&&!this._isValid&&v)this.$Group.removeClass(this.invalid);this.__e=this._isEmpty=!!e;this._isValid=!!v;this._iE=!this._pV;this.dispatchEvent('valid',this)}return this},val:function(v){if(defined(v)){(v===true||v===false)?this.getItems().attr('checked',v):this.getItems().each(function(){this.checked=Array.indexOf(v,this.value)>-1});this.validate();return this}return this.value},size:function(){return this.count},selected:function(){return this.sCount},getItems:function(){return this.$Input},getSelected:function(){return this.getItems().filter(':checked')}});InputValidator.add('InputCheckbox');;
jsLoader.loaded('{plugins}InputCheckbox', 1);$P('jsBuild.{plugins}InputCheckbox', 1);


$P('jsBuild.{plugins}InputSelect');/**
 * @class   InputCheckbox
 * @author  RubaXa 	<trash@rubaxa.org>
 * @require	InputValidator
 * Валидатор спсиков.
 */
jsClass.create('InputSelect').extend(InputValidator).methods({init:function(){this.bindEvents('blur,focus,change')},validate:function(n,e){var i=this.$Input[0].selectedIndex,v=this._isValid,e=this._isEmpty;if(i!==this.index){v=1;if(this.sIndex!=-1)v&=i!=this.sIndex;if(this.sMinIndex!=-1)v&=i>=this.sMinIndex;if(this.sMaxIndex!=-1)v&=i<=this.sMaxIndex;this.index=this.selectedIndex=i;this.option=this.$Input[0].options[this.selectedIndex];this.value=this.option.value;if(this.validator){if(!(v&=this.validator(this.value,this))&&(n=='change')){this.$Group[!v?'addClass':'removeClass'](this.invalid)}}}this.setValidate(v,this.sEmpty==this.value);return this._isValid},val:function(v){if(defined(v)){var O=this.getOptions(),i=0;for(;O[i];i++){if(O[i].value==v){this.selIndex(i);break}}O=null;return this}return this.value},getOptions:function(){return this.$Input[0].options},getSelected:function(){return jQuery(this.option)},selIndex:function(i){if(defined(i)){this.$Input[0].selectedIndex=i;this.$Input[0].options[i].selected=true;return this.validate()}return this.selectedIndex}});InputValidator.add('InputSelect');;
jsLoader.loaded('{plugins}InputSelect', 1);$P('jsBuild.{plugins}InputSelect', 1);


$P('jsBuild.{plugins}InputFile');/**
 * @class   InputFile
 * @author  RubaXa 	<trash@rubaxa.org>
 * @require	InputValidator
 * Валидатор файла.
 */
jsClass.create('InputFile').extend(InputValidator).methods({init:function(){this.bindEvents('blur,focus,change');this.addEventListener('change',function(){this.fireEvent('blur')})},validate:function(n,e){var val=this.$Input[0].value,v=this._isValid,e=!val.length;if((this.value!==val)){if(!e&&this.format){v=this.format.test(val)}else{v=!e}if(this.validator&&!this.validator(val,this)){v=0}this.value=val;this.setValidate(v,e);this.dispatchEvent('change',this,e)}return this._isValid}});InputValidator.add('InputFile');;
jsLoader.loaded('{plugins}InputFile', 1);$P('jsBuild.{plugins}InputFile', 1);


$P('jsBuild.{plugins}FormValidator');/**
 * @class   FormValidator
 * @author  RubaXa 	<trash@rubaxa.org>
 * Валидатор формы
 */
var __ss__=function(n,s,o,r){FormValidator.submitStatus(n,s,o,r)};jsClass.create('FormValidator').methods({__construct:function($F,o){this.$Form=jQuery($F).submit($D(this,'_submit'));this.$Submit=this.$Form.find('INPUT[type=submit]').click($D(this,function(e){this._cSBtn=e.target}));$E(this,FormValidator.defaultOptions,{name:this.$Form.attr('name'),action:(this.$Form.attr('action')||0),method:(this.$Form.attr('method')||'POST').toUpperCase(),xform:1},o);if(this.iFrame){var n='iFrame'+jsCore.getUniqId();this.$iFrame=$('<iframe name="'+n+'" src="about:blank" frameborder="0" style="position: absolute; overflow: hidden; width: 1px; height: 1px;" />').appendTo(this.$Form.attr({target:n,action:this.action+'&_json_=Y&_iframe_=Y'})).load($D(this,function(){var R=$(this.$iFrame[0].contentWindow.document.body).text();if(R&&(R=jQuery.ajaxResult(R,!0,'text/x-json'))){FormValidator.submitStatus(this.name,!0,this.toObject(),R)}}));this.ajax=0}this.name=this.$Form.attr('name',this.name||this.$Form.attr('id')||jsCore.getUniqId()).attr('name');this.eInputOnValid=$D(this,'validate');this.__v={};this.__p=[];this.__pe={};this.cEmpty=0;this.validators=[];this._ignors='';this.disabled=!1;this.initForm();this.__init=function(){this.callMethod('init');this.isReady=!0;this.validate()};FormValidator.add(this);if(this.iForce)this.__init();else setTimeout($D(this,'__init'),5)},initForm:function(){var $V=this.$Form.find(this.input),i=0,E,V;for(;E=$V[i];i++){this.addValidator(InputValidator.auto(E,0,this.inputOptions))}if(this.isReady)this.validate();$V=E=V=null},_submit:function(){return!!((this.__fs||this.submit())&&!this.ajax&&this.isValid())},addValidator:function(V){if(this.dispatchEvent('addValidator',this,V)!==false){this.__v[V.name]=this.validators.push(V);V.addEventListener('blur',this.eInputOnValid).addEventListener('focus',this.eInputOnValid).addEventListener('valid',this.eInputOnValid)}},validate:function(tV,e){var v=0,i=0,V,ce=0,f=0,c=0;if(this.dispatchEvent('beforeValidate',this,e)!==false){v=!this.__p.length;if(v){this.cEmpty=0;this.cNotEmpty=this.validators.length;for(;V=this.validators[i];i++){if(!this.isIgnor(V.name)){if(V.inFocus)f=1;if(V.isEmpty())ce=1;if(v&&!V.isValid())v=0;if(V.event.type=='keyup')c=1}this.cEmpty+=V.isEmpty()?1:0}this.cNotEmpty-=this.cEmpty}else if(tV){this.validateErrors(tV,e);if(v=!this.__p.length)this.validate(tV,e)}v&=(this.dispatchEvent('validate',this,tV,e)!==false);V=null}if((this.__ce!==ce)||(this._isValid!==v)||(this.__f!==f)){if(this.valid)this.$Form[!ce&&v?'addClass':'removeClass'](this.valid);if(this.invalid)this.$Form[!f&&!ce&&!v?'addClass':'removeClass'](this.invalid);this.__f=f;this.__ce=ce;if(this._isValid!==v){if(this.dSubmit)this.$Submit.attr('disabled',!v);this._isValid=v}}if(c)this.dispatchEvent('change',this)},validateErrors:function(){},submitStatus:function(s,o,r){if(this.send)this.$Form.removeClass(this.send);if(s){if(this.enable().dispatchEvent('success',o,r,this)!==false){if(this.clearInputs)this.clear()}}else{if(this.dispatchEvent('error',o,r,this)===true){this.ajax=0;this.$Form[0].submit()}else{this.enable()}}},isActive:function(){return!this.disabled},attr:function(k,v){if(!v&&k&&(k.constructor!==Object)){return this.$Form.attr(k)}this[k]=v;this.$Form.attr(k,v);return this},addIgnor:function(n){n=typeof n=='string'?n.split(','):n;for(var i=0;n[i];i++)if(!this.isIgnor(n[i])){this._isValid=undefined;this._ignors+=n[i]+','}this.validate();return this},delIgnor:function(n){if(defined(n)){n=typeof n=='string'?n.split(','):n;for(var i=0;n[i];i++)if(this.isIgnor(n[i])){this._isValid=undefined;this._ignors=this._ignors.replace(n[i]+',','')}}else{this._isValid=-1;this._ignors=''}this.validate();return this},isIgnor:function(n){return this._ignors&&this._ignors.indexOf(n+',')>-1},toObject:function(f){return this.$Form.toObject(f)},isValid:function(){return!!this._isValid},clear:function(f){if(defined(f)){Array.forEach(typeof f=='string'?f.split:f,function(n){this.elm(n).value=''},this)}else{this.$Form.find(':text,:password,TEXTAREA').val('').keyup().blur()}return this},enable:function(){return this.disable(!1)},disable:function(d){this.disabled=!!defined(d,!0);this.$Submit.attr({disabled:!!((this.dSubmit&&!this._isValid)||this.disabled)})[this.sDisabled?(this.disabled?'addClass':'removeClass'):'F'](this.sDisabled);for(var i=0;V=this.validators[i];i++){V.$Input.attr('readonly',this.disabled)[this.sDisabled?(this.disabled?'addClass':'removeClass'):'F'](this.sDisabled)}return this},submit:function(f){var o=this.toObject();if(this.isActive()&&(this.dispatchEvent('beforeSubmit',this,o)!==false)&&(this.isValid()||!this.dSubmit)&&(this.dispatchEvent('submit',this,o)!==false)){o=this.toObject();this.disable();if(this.send)this.$Form.addClass(this.send);if(this.name&&this.xform)o.XForm=this.name;if(this.ajax){if(this._cSBtn&&this._cSBtn.name)o[this._cSBtn.name]=this._cSBtn.value;jQuery.ajax({url:this.action,type:this.method,data:o,dataType:this.ajaxDataType||FormValidator.ajaxDataType,success:$D(null,__ss__,this.name,1,o),error:$D(null,__ss__,this.name,0,o)})}else{Array.forEach(this.$Form[0].elements,function(i,E){if(E.name)E.value=defined(o[E.name],'')},1);this.__fs=1;this.$Form[0].submit();this.__fs=0}return true}return false},get:function(n){return this.validators[this.__v[n]-1]},elm:function(n){return this.$Form[0][n]},elmVal:function(n){return this.elm(n).value},addError:function(n,t){if(this.__v[n]){this.get(n).setIsValid(0,t)}else if(!this.__pe[n]){this.__pe[n]=1;this.__p.push(n);this.$Form.find('.e-'+n)[t?'html':'F'](t).show();this.validate()}return this},removeError:function(n,v){if(this.__v[n])this.get(n).setIsValid(-1);else if(this.__pe[n]){this.__pe[n]=0;this.__p=Array.remove(this.__p,n,1);this.$Form.find('.e-'+n).hide();this.validate()}return this},isError:function(n){return(this.__v[n]?!this.get(n).isValid():!!this.__pe[n])},getForm:function(){return this.$Form},reset:function(){this.$Form[0].reset();this.validate();return this}});$E(FormValidator,{defaultOptions:{dSubmit:1,valid:'f-valid',invalid:'f-invalid',send:'f-sendForm',input:'.v-target',sDisabled:'disabled',ajax:0,clearInputs:1,inputOptions:0},forms:{},add:function(F){this.forms[F.name]=F},get:function(n){return this.forms[n]},resultPrepare:function(r,s){return r},resultHandler:function(n,s,o,r){},submitStatus:function(n,s,o,r){this.resultHandler(n,s,o,r=this.resultPrepare(r,s));this.forms[n].submitStatus(s,o,r)}});;
jsLoader.loaded('{plugins}FormValidator', 1);$P('jsBuild.{plugins}FormValidator', 1);


$P('jsBuild.{project}Project');/**
 * Разные зарисовки для создания основных объектов в проекте
 * @author	RubaXa	<trash@rubaxa.org>
 */
jsClass.create('RubaXa.Project').extend(PropertiesMapper).methods({__construct:function(p){this.__properties('$',p);this.callMethod('beforeInit');if(this.Ajax)this.Ajax=new this.Ajax(this,this.Ajax.Result);if(this.Forms)$E(FormValidator,this.Forms);if(this.Alert)this.Alert=new this.Alert(this.lang);this.Elms={};this.Pages={};this.Forms={};this.Plugins={};this.callMethod('init')},getName:function(){return this.name},getCurDate:function(){return Date.getNow()},isAuth:function(){return!!this.$.auth},isMyPage:function(){return this.isAuth()&&this.$.vUserId==this.$.aUserId},logout:function(){return this.set({auth:false})},reload:function(){location.href=location.href.split('#')[0]},redirect:function(u){document.location.href=u}});RubaXa.Project.Ajax=jsClass.create().methods({__construct:function(Project,Result){this.parent=function(){return Project};this.Result=Result;jQuery.ajaxSetup({complete:$D(this,'complete'),beforeSend:$D(this,'beforeSend'),data:Project.get('ajaxBaseData')});jQuery.ajaxResult=$D(this,'getResult');jsCore.ready($D(this,'iLoading'))},getLoading:function(){return $('#AjaxLoading').setPositionFixed('5px','5px').css('zIndex',1500)},iLoading:function(){this.$Loading=this.getLoading()},beforeSend:function(R){if(jQuery.active==1)this.loading(1)},complete:function(R){if(jQuery.active==1)this.loading(0);this.parseResult(R)},incActive:function(){jQuery.active++;this.loading(1)},decActive:function(){if(!--jQuery.active)this.loading(0)},parseResult:function(R,t){R=this.getResult(R,'success',t);if(R.isOK()){if(R.isJSON()){if(R.redirect){this.parent().redirect(R.redirect)}else if(defined(R.auth)&&this.parent().isAuth()!=!!parseInt(R.auth)){this.parent().set({auth:parseInt(R.auth)})}}}else if(R.isSysError()){this.parent().Alert.systemError()}this.dispatchEvent('complete',this,R);return R},get:function(){return jQuery.get.apply(jQuery,arguments)},post:function(){return jQuery.post.apply(jQuery,arguments)},send:function(){return jQuery.ajax.apply(jQuery,arguments)},getResult:function(R,s,t){if(typeof R=='string')R={responseText:R};return R.constructor!=this.Result?new this.Result(R,s,t):R},loading:function(s){if(this.$Loading)this.$Loading[s?'show':'hide'](-1)}});RubaXa.Project.Ajax.Result=jsClass.create().methods({__construct:function(R,s,t){this.__=this.getSettings();this.__ok__=(s=='success')||(s===true);this.__xhr__=R;var t=t||this.getResponseHeader('content-type')||'';if(t.indexOf('xml')>-1){this.__xml__=1;this.responseXML=R.responseXML;if(R&&R.responseXML.documentElement.tagName=="parsererror")throw"parsererror"}else{this.responseText=R.responseText;if(t.indexOf('json')>-1){var r;try{r=eval('('+this.responseText+')')}catch(e){r=this.__.evalError;debug.log(e)}$E(this,r);this.__json__=1}else{this.__text__=1}}},getSettings:function(){return{evalError:{status:0,errors:{SYSTEM:true}},errorStatus:0,systemError:'SYSTEM',status:'s',errors:'e',data:'d'}},isOK:function(){return!(this.isER()||this.isSysError())},isER:function(){return!this.__ok__||!!this.getErrors()},isSuccess:function(){return this.isOK()},isError:function(){return this.isER()},isSysError:function(){return this.isXHRError()||this.hasError(this.__.systemError)},getData:function(n){return n?this[n]:this},getErrors:function(){return this[this.__.errors]},hasError:function(n){return!!this.getError(n)},getError:function(n){return(this.getErrors()||{})[n]},isXML:function(){return this.__xml__},isJSON:function(){return this.__json__},isText:function(){return!(this.isJSON()||this.isXML())},toXML:function(){return this.responseXML},toJSON:function(){return this.isJSON()?this:new this.constructor(this.__.evalError)},toText:function(){return this.responseText},tojQuery:function(){return jQuery(this.isText()?this.toText():document.createTextNode(''))},isXHRError:function(){return!this.__ok__},isXHRSuccess:function(){return this.__ok__},getResponseHeader:function(n){return this.__xhr__.getResponseHeader(n)},abort:function(){return this.__xhr__.abort()}});RubaXa.Project.Forms={resultPrepare:function(R,s){return R},resultHandler:function(n,s,o,R){if(R.isER()&&!R.isSysError()){Object.forEach(R.getErrors(),function(v,k){if(this.get(n))this.get(n)&&this.get(n).addError(k)},this)}}};RubaXa.Project.Alert=jsClass.create().methods({__construct:function(){},create:function(t){alert(t)},confirm:function(t,o,c){var s=!0;if(typeof(t)=='string')s=confirm(t);((s?o:c)||jsCore.F)(s);return s},systemError:function(){this.create('Ошибка сервера, попробуйте еще раз')}});jsCore.Project={get:function(P){return this[P.uniqId]},create:function(name,properties){debug.log('jsCore.Project.create: '+name);var P=jsClass.create().extend(RubaXa.Project).methods({beforeInit:function(){this.name=name;this.Ajax=P.Ajax;this.Alert=P.Alert;this.JSON=P.JSON;this.Forms=P.Forms}});P.Ajax=jsClass.create().extend(RubaXa.Project.Ajax);P.Ajax.Result=jsClass.create().extend(RubaXa.Project.Ajax.Result);P.Alert=jsClass.create().extend(RubaXa.Project.Alert);P.JSON={};P.Forms=$E({},RubaXa.Project.Forms);this[P.uniqId]=P;return P}};;
jsLoader.loaded('{project}Project', 1);$P('jsBuild.{project}Project', 1);


$P('jsBuild.{utils}GVar');/**
 * @object	GVar
 * @author	RubaXa	<trash@rubaxa.org>
 */
var GVar=new(jsClass.create().methods({__construct:function(){this.d={}},parse:function(e){GVar.add((e&&(e[0]||e)||document.body).getElementsByTagName('VAR'));return e},add:function(V,name){if(V[0])for(var i=0;V[i];i++)this.add(V[i],name);else if(V&&V.tagName&&!V.__GVar){V.name=name||$GA(V,'name');if(!/#\w+#/.test(V.name)){V.__GVar=1;if(!this.d[V.name])this.d[V.name]=[];this.d[V.name].push(V);this.dispatchEvent('add',V,V.name)}}return this},val:function(n,v){if(defined(v)){if(this.d[n]){this.dispatchEvent(n,v,this.d[n][0].v);for(var i=0,c=this.d[n].length;i<c;i++){this.d[n][i].v=v;switch(this.d[n][i].tagName){case'SELECT':break;case'INPUT':case'TEXTAREA':this.d[n][i].value=v+'';break;default:this.d[n][i].innerHTML=v+'';break}}};return this}else{return this.d[n]?(this.d[n][0].v||this.d[n][0].value||this.d[n][0].innerHTML):''}},set:function(n,v){return this.val(n,v)},inc:function(n,c){return this.val(n,this.val(n)*1+defined(c,1)).val(n)*1},dec:function(n,c){return this.inc(n,-defined(c,1))}}));;
jsLoader.loaded('{utils}GVar', 1);$P('jsBuild.{utils}GVar', 1);


$P('jsBuild.{jQuery}easing');/*****
 * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
 *
 * Uses the built in easing capabilities added In jQuery 1.1
 * to offer multiple easing options
 *
 * TERMS OF USE - jQuery Easing
 * 
 * Open source under the BSD License. 
 * 
 * Copyright В© 2008 George McGinley Smith
 * All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or without modification, 
 * are permitted provided that the following conditions are met:
 * 
 * Redistributions of source code must retain the above copyright notice, this list of 
 * conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright notice, this list 
 * of conditions and the following disclaimer in the documentation and/or other materials 
 * provided with the distribution.
 * 
 * Neither the name of the author nor the names of contributors may be used to endorse 
 * or promote products derived from this software without specific prior written permission.
 * 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 *  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
 * OF THE POSSIBILITY OF SUCH DAMAGE. 
 *
*/
(function($){$.easing['jswing']=$.easing['swing'];$.extend($.easing,{def:'easeOutQuad',swing:function(x,t,b,c,d){return $.easing[$.easing.def](x,t,b,c,d)},easeInQuad:function(x,t,b,c,d){return c*(t/=d)*t+b},easeOutQuad:function(x,t,b,c,d){return-c*(t/=d)*(t-2)+b},easeInOutQuad:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t+b;return-c/2*((--t)*(t-2)-1)+b},easeInCubic:function(x,t,b,c,d){return c*(t/=d)*t*t+b},easeOutCubic:function(x,t,b,c,d){return c*((t=t/d-1)*t*t+1)+b},easeInOutCubic:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t+b;return c/2*((t-=2)*t*t+2)+b},easeInQuart:function(x,t,b,c,d){return c*(t/=d)*t*t*t+b},easeOutQuart:function(x,t,b,c,d){return-c*((t=t/d-1)*t*t*t-1)+b},easeInOutQuart:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t+b;return-c/2*((t-=2)*t*t*t-2)+b},easeInQuint:function(x,t,b,c,d){return c*(t/=d)*t*t*t*t+b},easeOutQuint:function(x,t,b,c,d){return c*((t=t/d-1)*t*t*t*t+1)+b},easeInOutQuint:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t*t+b;return c/2*((t-=2)*t*t*t*t+2)+b},easeInSine:function(x,t,b,c,d){return-c*Math.cos(t/d*(Math.PI/2))+c+b},easeOutSine:function(x,t,b,c,d){return c*Math.sin(t/d*(Math.PI/2))+b},easeInOutSine:function(x,t,b,c,d){return-c/2*(Math.cos(Math.PI*t/d)-1)+b},easeInExpo:function(x,t,b,c,d){return(t==0)?b:c*Math.pow(2,10*(t/d-1))+b},easeOutExpo:function(x,t,b,c,d){return(t==d)?b+c:c*(-Math.pow(2,-10*t/d)+1)+b},easeInOutExpo:function(x,t,b,c,d){if(t==0)return b;if(t==d)return b+c;if((t/=d/2)<1)return c/2*Math.pow(2,10*(t-1))+b;return c/2*(-Math.pow(2,-10*--t)+2)+b},easeInCirc:function(x,t,b,c,d){return-c*(Math.sqrt(1-(t/=d)*t)-1)+b},easeOutCirc:function(x,t,b,c,d){return c*Math.sqrt(1-(t=t/d-1)*t)+b},easeInOutCirc:function(x,t,b,c,d){if((t/=d/2)<1)return-c/2*(Math.sqrt(1-t*t)-1)+b;return c/2*(Math.sqrt(1-(t-=2)*t)+1)+b},easeInElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4}else var s=p/(2*Math.PI)*Math.asin(c/a);return-(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b},easeOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4}else var s=p/(2*Math.PI)*Math.asin(c/a);return a*Math.pow(2,-10*t)*Math.sin((t*d-s)*(2*Math.PI)/p)+c+b},easeInOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d/2)==2)return b+c;if(!p)p=d*(.3*1.5);if(a<Math.abs(c)){a=c;var s=p/4}else var s=p/(2*Math.PI)*Math.asin(c/a);if(t<1)return-.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;return a*Math.pow(2,-10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p)*.5+c+b},easeInBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;return c*(t/=d)*t*((s+1)*t-s)+b},easeOutBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b},easeInOutBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;if((t/=d/2)<1)return c/2*(t*t*(((s*=(1.525))+1)*t-s))+b;return c/2*((t-=2)*t*(((s*=(1.525))+1)*t+s)+2)+b},easeInBounce:function(x,t,b,c,d){return c-$.easing.easeOutBounce(x,d-t,0,c,d)+b},easeOutBounce:function(x,t,b,c,d){if((t/=d)<(1/2.75)){return c*(7.5625*t*t)+b}else if(t<(2/2.75)){return c*(7.5625*(t-=(1.5/2.75))*t+.75)+b}else if(t<(2.5/2.75)){return c*(7.5625*(t-=(2.25/2.75))*t+.9375)+b}else{return c*(7.5625*(t-=(2.625/2.75))*t+.984375)+b}},easeInOutBounce:function(x,t,b,c,d){if(t<d/2)return $.easing.easeInBounce(x,t*2,0,c,d)*.5+b;return $.easing.easeOutBounce(x,t*2-d,0,c,d)*.5+c*.5+b}})})(jsCore.jQuery);;
jsLoader.loaded('{jQuery}easing', 1);$P('jsBuild.{jQuery}easing', 1);


$P('jsBuild.{jQuery}textEffects');/**
 * Эффекты с текстом
 * @author	"RubaXa"		<trash@rubaxa.org>
 * @version	0.1
 */
var TextEffects={queue:{},active:{},add:function($Obj,o){var uId=jsCore.getUniqId($Obj[0]);if(!this.queue[uId])this.queue[uId]=[];this.queue[uId].push(o);if(!this.active[uId]){this.active[uId]=1;this.animate($Obj)}},animate:function($Obj,o){if(!o){var o=$E({text:'',left:0,top:0,inOpacity:0,outOpacity:0,speed:'slow',inSpeed:'slow',outSpeed:'slow',easing:'swing',inEasing:'swing',outEasing:'swing',effect:'slideLeft',inEffect:'slideLeft',outEffect:'slideLeft'},this.queue[jsCore.getUniqId($Obj[0])].shift()||{});if(o.inSpeed==o.outSpeed)o.inSpeed=o.outSpeed=o.speed;if(o.inEasing==o.outEasing)o.inEasing=o.outEasing=o.easing;if(o.inEffect==o.outEffect)o.inEffect=o.outEffect=o.effect}if(o.sleep){o._s=o.sleep;o.sleep=0;Timeout.create($D(this,'animate',$Obj,o),o._s)}else{var p=$Obj.offset();$Obj[0].$Out=$Obj.clone().css({position:'absolute',left:p.left,top:p.top,margin:0}).insertBefore($Obj);$Obj[0].$In=$Obj.clone().html(o.text).css({position:'absolute',left:p.left,top:p.top,opacity:o.inOpacity,margin:0}).insertBefore($Obj);$Obj.css('visibility','hidden');if(/slide/.test(o.outEffect)){var s=/Up|Down/.test(o.outEffect)?'top':'left';var d=/Up|Left/.test(o.outEffect)?-1:1;var a={opacity:o.outOpacity};a[s]=(o['out'+String.ucfirst(s)]||(p[s]+d*$Obj[0].$Out[s=='top'?'height':'width']()));$Obj[0].$Out.animate(a,o.outSpeed,o.outEasing)}if(/slide/.test(o.inEffect)){var s=/Up|Down/.test(o.inEffect)?'top':'left';var d=/Up|Left/.test(o.inEffect)?1:-1;var a={opacity:1};a[s]=p[s];$Obj[0].$In.css(s,o['out'+String.ucfirst(s)]||(p[s]+d*$Obj[0].$Out[s=='top'?'height':'width']())).animate(a,o.inSpeed,o.inEasing,$D(this,'finish',$Obj))}}},finish:function($Obj){var uId=jsCore.getUniqId($Obj[0]);this.active[uId]=this.queue[uId].length;$Obj.html($Obj[0].$In.html()).css('visibility','');$Obj[0].$Out.remove();$Obj[0].$In.remove();$Obj[0].$Out=$Obj[0].$In=null;if(this.active[uId])this.animate($Obj)}};(function($){$.fn.textEffect=function(o){TextEffects.add(this,o);return this}})(jsCore.jQuery||window.jQuery);;
jsLoader.loaded('{jQuery}textEffects', 1);$P('jsBuild.{jQuery}textEffects', 1);


$P('jsBuild.{gay}Gay');/**
 * @object	Gay
 * @author	RubaXa	<trash@rubaxa.org>
 */
var MyProject=jsCore.Project.create('GayRu');MyProject.methods({rating:function(v){if(defined(v)){$('#UI-Rate').find('DIV').html((v=v*1)+'').end()[0].className='Rate-S '+((v>=500)?'b-red':(v>=200?'b-orange':((v>=50)?'b-green':'')))}return isAuth&&$F('#UI-Rate').firstChild.innerHTML*1},balance:function(v){if(defined(v))GVar.val('u'+this.$.aUserId+'.balance',v*1);return isAuth&&this.$.balanceEnabled?GVar.val('u'+this.$.aUserId+'.balance')*1:0},getUrl:function(n){s='';if(n='upload')s='?XForm=UploadPhoto&uId='+PP.getUser().getId()+'&_fl_=Y&s='+this.$.sessionId;return location.href.split('?')[0]+s}});MyProject.Alert.methods({__construct:function(){},isJSON:function(R){if(R&&R.isJSON())return true;this.systemError();return false},create:function(t){if(this.LB){this.$Text.html(t);this.LB.show()}else this.parent('create',t)}});MyProject.JSON.quote='"';MyProject.Ajax.methods({getLoading:function(){},parseResult:function(R,t){R=this.getResult(R,'success',t);this._R=R;if(R.isOK()){if(R.isJSON()){if(R.redirect){LightBox.hideAll();this.parent().redirect(R.redirect)}else if(this.parent().isAuth()!=!!parseInt(R.auth)){LightBox.hideAll();window.reload()}else{if(R.aUser){Gay.rating(R.aUser.rating);Gay.balance(R.aUser.balance)}}}}else if(R.isError()){var Err=R.getErrors();for(var n in Err){this.parent().Alert.create(Err[n])}}return R}});MyProject.Ajax.Result.methods({ok:function(n){return this.isOK()&&this.isJSON()&&!this.isXFormER(n)},isXFormER:function(n){return!!this.getXFormErrors(n)},getXFormErrors:function(n){return n?this.XForms[n]:this.XForms},getSettings:function(){return{evalError:{s:0,e:{SYSTEM:'Ошибка сервера'}},errorStatus:0,systemError:'SYSTEM',status:'s',errors:'e',data:'d'}}});MyProject.Forms.ajaxDataType='json';MyProject.Forms.resultHandler=function(n,s,o,R){if(R.isXFormER()&&!R.xfixed){R.xfixed=1;Object.forEach(R.getXFormErrors(),function(E,F){for(var k in E)this.get(F).addError(k,E[k].error)},this)}};FormValidator.defaultOptions.ajax=1;FormValidator.defaultOptions.clearInputs=0;$E(InputValidator.Validators,{});window.Gay=new MyProject(window.GayData||{});window.Gay.Parad={hover:jsCore.F};Lang.load('Base',function(){domReady(function(){GVar.parse(BODY)});debug.log('jsCore.Project.loaded: GayRu')});Date.prototype.lastAccess=function(){if(this.isNow(5*60000))return'<img src="/i/ru/ico_online_m.gif" />';else return this.format('Был d N Y в H:I')};window.inFocus=true;$(window).bind('focus blur',function(e){window.inFocus=e.type=='focus'});;
jsLoader.loaded('{gay}Gay', 1);$P('jsBuild.{gay}Gay', 1);


$P('jsBuild.{gay}Gay.Forms.Auth');/**
 * @class	Gay.Forms.Auth
 * @author	RubaXa	<trash@rubaxa.org>
 */
jsClass.create('Gay.Forms.Auth').extend(LightBox).methods({__construct:function($B,o){Gay.Auth=this;this.Form=new FormValidator($B,{dSubmit:0,validateErrors:function(V){this.removeError('found')}});this.inherit(LightBox,'__construct',[$B,$E(o,{showBy:'.o-auth'})])},onBeforeShow:function(){if(Gay.ParadLayer)Gay.ParadLayer.hide()},onShow:function(){Gay.Parad.hover(0);if(!this.Form.get('email').isValid()){this.Form.get('email').$Input.focus()}else if(!this.Form.get('pass').isValid()){this.Form.get('pass').$Input.focus()}else{this.Form.$Submit.focus()}},onHide:function(){Gay.Parad.hover(1)},getForm:function(){return this.Form}});;
jsLoader.loaded('{gay}Gay.Forms.Auth', 1);$P('jsBuild.{gay}Gay.Forms.Auth', 1);


$P('jsBuild.{plugins}Toggle');/**
 * @class	Toggle
 * @author	RubaXa	<tarsh@rubaxa.org>
 */
Registry.put('ToggleGroups',{});jsClass.create('Toggle').methods({__construct:function($T,o){this.$Target=jQuery($T);this.options=$E(this.getDefaultOptions(),o);Array.forEach('Show,Hide,Toggle,BeforeShow,BeforeHide,HitTest'.split(','),function(v){this['on'+v]=this.options['on'+v]},this);if(this.options.group){var $Groups=this.$Target.find(this.options.group);if($Groups[0]){var This=this;$Groups.each(function(){jQuery(this).setPlugin('Toggle',This.options)});This=null;this.toggle=function(f,a){this.notifyGroup('toggle',f,a);return this};return true}else{this.add2Group(this.options.group)}$Groups=null}if(this.options.saveState)this.options.state=jsCookie.get(this.options.name);this.build();this.toggle(true,this.options.state);this.$Target.click($D(this,'_onClick'));this.init()},_onClick:function(e){if(this.dispatchEvent('click',e)===false)return false},getDefaultOptions:function(){return{name:this.$Target[0].id,group:0,hideByClick:0,saveState:0,state:'hide',expand:'expand',collapsed:'collapsed',hover:0,show:'.t-show',hide:'.t-hide',toggle:'.t-toggle',element:'.t-element',zIndex:300,parentIndex:3,effect:0,effectSpeed:'fast'}},init:function(){},controller:function(item,e){this[item.__toggleAction||'hide']();if(item.tagName!='INPUT')return false},getAnimateOpts:function(a){var anim={};switch(this.options.effect){case'width':anim.width=a;break;case'height':anim.height=a;break;case'fade':anim.opacity=a;break;default:anim={width:a,height:a,opacity:(a=='show')?1:0};break}return anim},animate:function(a,f){if(!f&&this.options.effect){if(this.options.parentIndex)this.$Elements.parents(this.options.parentIndex).css({zIndex:(a=='show')?this.options.zIndex:''});this.$Elements.animate(this.getAnimateOpts(a),this.options.effectSpeed);return 1}else{this.$Elements[a=='show'?'show':'hide']();return 0}},notifyGroup:function(method){var groups=this.options.group;if(typeof(groups)=='string')groups=groups.split(',');var Group,uniqId=this.uniqId,args=Array.prototype.slice.call(arguments,1);for(var i=0,n=groups.length;i<n;i++){jsCore.each(Registry.get('ToggleGroups')[groups[i].toLowerCase()],function(o,Group){if(Group.uniqId!=uniqId){Group[method].apply(Group,args)}})}Group=null},hoverControl:function(h,e){this.dispatchEvent('hover',this,jQuery(e)[h?'addClass':'removeClass'](this.options.hover))},markAsControl:function(N){if(N.nodeType==1){N.__toggleControl=this.uniqId;for(var i=0,n=N.childNodes.length;i<n;i++){this.markAsControl(N.childNodes[i])}}return this},isControl:function(e){return(e&&((e.__toggleControl)||(e[0]?(e.__toggleControl):(e.target?e.target.__toggleControl:false))))==this.uniqId},_buildC:function($Items,i){Array.forEach($Items,function(Item){this.markAsControl(Item);Item.__toggleAction=!i?'show':(i<2?'hide':'toggle');jQuery(Item).bind('click',$D(this,'controller',Item));if(this.options.hover){jQuery(Item).hover($D(this,'hoverControl',true,Item),$D(this,'hoverControl',false,Item))}},this)},build:function(){Array.forEach([this.options.show,this.options.hide,this.options.toggle],function(rules,i){if(rules){if(rules.append){this._buildC(rules,i)}else{Array.forEach(rules.split(','),function(rule,t){if(rule){this._buildC(rule.charAt(0)=='#'?jQuery(rule):this.$Target.find(rule),i)}},this)}}},this);this.$Elements=null;this.$Elements=[];if(this.options.element.append){this.$Elements=this.options.element}else{var $E;Array.forEach(this.options.element.split(','),function(rule){$E=(rule.charAt(0)=='#'?jQuery(rule):this.$Target.find(rule));if($E[0]){for(var i=0,n=$E.length;i<n;i++)this.$Elements.push($E[i])}},this);$E=null;delete $E;this.$Elements=jQuery(this.$Elements)}return this},setCallback:function(n,f){this[n]=this.options[n]=f;return this},add2Group:function(name){if(name.getGroup)name=name.getGroup();if(name){if(typeof(name)=='string')name=name.split(',');var Groups=Registry.get('ToggleGroups');for(var i=0,n=name.length;i<n;i++){name[i]=name[i].toLowerCase();if(!Groups[name[i]])Groups[name[i]]=[];Groups[name[i]].push(this)}Registry.put('ToggleGroups',Groups);Groups=null}return this},getGroup:function(){return this.options.group},show:function(f){return this.toggle(f,'show')},hide:function(f){return this.toggle(f,'hide')},toggle:function(f,a){var a=(a||(this.isExpand()?'hide':'show'));var e=String.ucfirst(a);if((f||(a!=(this.isExpand()?'show':'hide')))&&(this.dispatchEvent('before'+e,this,jsCore.event)!==false)){this.options.state=a;if(a=='show')this.notifyGroup('hide',f);this.animate(a,f);if(this.options.toggle&&this.options.expand)this.$Target.find(this.options.toggle).andSelf()[this.isExpand()?'addClass':'removeClass'](this.options.expand);if(this.options.toggle&&this.options.collapsed)this.$Target[this.isExpand()?'removeClass':'addClass'](this.options.collapsed);if(this.options.saveState)jsCookie.set(this.options.name,this.options.state,this.options.saveState);this.dispatchEvent(a,this,jsCore.event);this.dispatchEvent('toggle',this,jsCore.event)}return this},isExpand:function(){return(this.options.state=='show')}});Toggle.Broadcast=({pool:[],init:function(){jQuery(document).bind('click',$D(this,'fire',false));return this},add:function(T){this.pool.push(T)},remove:function(T){for(var i=0,n=this.pool.length;i<n;i++){if(this.pool[i].uniqId==T.uniqId){this.pool[i]=null;this.pool=Array.remove(this.pool,i);break}}},fire:function(ignor){for(var i=0,n=this.pool.length;i<n;i++){if(!ignor||(ignor&&(this.pool[i].uniqId!=ignor.uniqId)))this.pool[i].hide()}this.ignor=null}});Toggle.Broadcast.init();;
jsLoader.loaded('{plugins}Toggle', 1);$P('jsBuild.{plugins}Toggle', 1);


$P('jsBuild.{gay}Gay.Forms.Search');/**
 * @class	Gay.Forms.Search
 * @author	RubaXa	<trash@rubaxa.org>
 */
Gay.Forms.Search=jsClass.create().extend().methods({__construct:function($F,o){this.$Form=$F;$E(this,o);new Toggle(this.idExtendSearch,{state:this.esState,onToggle:$D(this,function(T){this.$Form[0].ef.value=T.isExpand()?'Y':''})})}});;
jsLoader.loaded('{gay}Gay.Forms.Search', 1);$P('jsBuild.{gay}Gay.Forms.Search', 1);


$P('jsBuild.{plugins}EditableText');/**
 * @class	EditableText
 * @author	RubaXa	<trash@rubaxa.org>
 * @events	onBeforeEdit, onBeforeCancel, onBeforeSave, onEdit, onCancel, onSave
 */
jsClass.create('EditableText').extend(Toggle).methods({__construct:function($T,o){this.$Target=jQuery($T);$E(this,o=$E({eText:'.et-text',input:'.et-input',block:0,editor:'.et-editor',minHeight:0,maxHeight:0,sIsEmpty:'is-empty',sIsEdit:'is-edit',cEdit:'.et-edit',cSave:'.et-save',cCancel:'.et-cancel'},o));this.isChanged=false;this.$Text=this.$Target.find(this.eText);this.$Block=this.block?this.$Target.find(this.block):this.$Text;this.jsInput=this.$Target.find(this.editor).setPlugin('InputText',{target:this.input,group:this.$Target,onKeyUp:$D(this,function(I){if(this.minHeight||this.maxHeight){this.$CInput[0].value=I.value+'!';var h=this.$CInput[0].scrollHeight+30;if(this.minHeight)h=Math.max(h,this.minHeight);if(this.maxHeight)h=Math.min(h,this.maxHeight);I.$Input.css({height:h})}}),onValid:$D(this,function(I){if(this.$Save)this.$Save[0].disabled=!I.isValid()})},1,1);if(this.minHeight)this.$CInput=this.jsInput.$Input.clone().css({left:0,height:1,position:'absolute',visibility:'hidden'}).insertAfter(this.jsInput.$Input);this.val(this.jsInput.val()||this.$Text.text());this.$Save=this.$Target[!this.sIsEmpty||this.value.length?'F':'addClass'](this.sIsEmpty).find(this.cEdit).click($D(this,'fire','Edit')).end().find(this.cCancel).click($D(this,'fire','Cancel')).end().find(this.cSave).click($D(this,'fire','Save'));this.parent('__construct',$T,this.toToggleOpts(o));this.__edit=$D(this,function(){this.isEdit=false});this.addEventListener('show',$D(this,function(){this.jsInput.setFocus()})).addEventListener('beforeShow',$D(this,function(TM){return!this.isEdit&&(this.dispatchEvent('beforeEdit',this)!==false)}));this.callMethod('init')},toToggleOpts:function(o){return $E({toggle:0,show:o.cEdit,hide:[o.cSave,o.cCancel].join(','),element:o.editor,parentIndex:0},o)},fire:function(n,e){if(this.dispatchEvent('before'+n,this,e)!==false){switch(n=n.toLowerCase()){case'edit':{if(!this.isEdit){if(this.minHeight||this.maxHeight){this.jsInput.$Input.css('height',Math.max(this.minHeight,this.$Target[0].offsetHeight))}this.$Target.removeClass(this.sIsEmpty).addClass(this.sIsEdit);setTimeout(this.__edit,10)}}break;case'save':case'cancel':{this[n]();this.redraw()}break}this.dispatchEvent(n,this,e)}else{return false}},fixIsEdit:function(){clearTimeout(this.__eId);this.__eId=setTimeout(this.__edit,10);return this},animate:function(a,f){if(Toggle.prototype.animate.apply(this,arguments)){this.$Block.animate(this.getAnimateOpts(a=='hide'?'show':'hide'),this.options.effectSpeed)}else this.$Block[a=='hide'?'show':'hide']()},getInput:function(){return this.jsInput},redraw:function(){this.$Target.removeClass(this.sIsEdit)[this.value.length?'removeClass':'addClass'](this.sIsEmpty);return this},isEmpty:function(){return!this.value.length},edit:function(){if(this.fire('edit')!==false){this.show()}return this},save:function(){this.isChanged=(this.value!==this.jsInput.val());return this.val(this.jsInput.val()).hide().fixIsEdit()},cancel:function(){this.isChanged=false;return this.val(this.value).hide().fixIsEdit()},val:function(v){if(defined(v)){this.jsInput.val(this.value=v);this.$Text.html(String.nl2br(v));return this.redraw()}else{return this.value}}});;
jsLoader.loaded('{plugins}EditableText', 1);$P('jsBuild.{plugins}EditableText', 1);


$P('jsBuild.{gay}Gay.Pages.AlbumPhoto');/**
 * @class	Gay.Pages.AlbumPhoto
 * @author	RubaXa	<trash@rubaxa.org>
 */
Gay.Pages.AlbumPhoto=jsClass.create().methods({__construct:function($P,o){this.$Page=$($P);$E(this,o);if(Gay.isAuth())this._iComments();if(Gay.isMyPage()){this._iEdit()}},_iEdit:function(){new EditableText(this.idGreeting,{onSave:$D(this,function(E){this._post(this.greetingUrl,{text:E.val()})})});$(this.idMakeMain).click($D(this,function(){this._post(this.mainUrl,{},function(R){if(R.isOK()){$(this.idMakeMain+','+this.idRemove).hide()}});return false}));$(this.idRemove).click($D(this,function(){Gay.Alert.confirm('Точно?',$D(this,function(){this._post(this.removeUrl,{},function(R){if(R.isOK()){Gay.redirect(this.albumUrl)}})}));return false}))},_iComments:function(){this._iComment(this.$Page);this.$Comment=$(this.idCommentTpl);this.fixFocus=function(){try{$(this).find('TEXTAREA')[0].focus()}catch(e){}};$('#Comments A.answer').click($D(this,function(e){var pId=(e=$G(e,'href')).href.split('#')[1]*1,y=window.height(),sY=window.scrollTop(),bY=$(e).offset().top+$(e).innerWidth(),dY=y+sY-bY;if(dY<200){$HTML.animate({scrollTop:bY+350-y},'fast')}if(pId){$FC=$('#PCF-'+pId);if(!$FC[0]){$FC=$('#PhotoCommentForm').clone().attr('id','PCF-'+pId).appendTo('#C-'+pId)}}else{$FC=$('#PhotoCommentForm')}if(!$FC[0].i){$FC[0].i=1;new FormValidator($FC,{clearInputs:1,init:function(){this.$R=this.$Form.find('INPUT.reset').click($D(this,function(){this.$Form.slideUp('fast')[0]._s=0}));this.elm('parentId').value=this.pId=pId},onSuccess:$D(this,function(o,R,F){if(R.isOK()&&!R.isXFormER()){var c=R.getData().comment;this._iComment(this.$Comment.clone().attr('id','C-'+c.id).find('.c-text').html(c.body).end().find('.c-created').html(c.created).end()[F.pId?'insertBefore':'insertAfter'](F.pId?F.$Form:this.$Comment).slideDown('fast'));F.$R.click()}})})}$FC[($FC[0]._s=!$FC[0]._s)?'slideDown':'slideUp']('fast',this.fixFocus);return false}))},_iComment:function($C){if(!this._removeComment){this._removeComment=$D(this,function(e){var id=$GV(e,'id'),cId=id.split('-')[1];Gay.Alert.confirm('Точно?',$D(this,function(){this._post(this.removeCommentUrl,{cId:cId},function(R){if(R.isOK())$('#'+id).slideUp('fast')})}));return false})}return $C.find(this.cssRemoveComment).click(this._removeComment)},_post:function(u,d,s){d.pId=this.photoId;Gay.Ajax.post(u,d,$D(this,s||jsCore.F))}});;
jsLoader.loaded('{gay}Gay.Pages.AlbumPhoto', 1);$P('jsBuild.{gay}Gay.Pages.AlbumPhoto', 1);


$P('jsBuild.{plugins}Dialog');/**
 * @class	Dialog
 * @author	RubaXa <trash@rubaxa.org>
 */
jsClass.create('Dialog').methods({__construct:function($B,o){Registry.put(this.uniqId,this);this.$Box=this._iBox($($B),o);$E(this,this._opts=this._iOpts(o));this._drSuccess=$D(this,'_requestStatus',true);this._drError=$D(this,'_requestStatus',false);this._NullStep=new Dialog.Step({name:null},this);this.callMethod('init');if(this.loaded)this.run()},_iBox:function($B,o){return $B},_iOpts:function(o){return $E({url:'/',dialog:0,curStep:0,gForm:0,loaded:false,loading:false},o)},_iEvents:function(){this._eBind((this.$Next=this.$Box.find('.d-next')),'click',function(){if(this.dispatchEvent('nextStep',this)!==false)this.nextStep()});this._eBind((this.$Prev=this.$Box.find('.d-prev')),'click',function(){if(this.dispatchEvent('prevStep',this)!==false)this.prevStep()})},_iLoad:function(){this.loading=true;this._request('GET','load',$D(this,function(H){if(H){if(H.substr(0,10)=='<!--DIALOG'){var o=H.substring(11,H.indexOf('DIALOG-->'));if(o&&(o=unserialize(o))){$E(this,o)}}this.loaded=true;this.html(H).run()}else{this.error('Пустой шаг');this.loading=false;this.hide()}}))},_request:function(t,a,d,s){if((arguments.length==3)&&(d.constructor==Function)){s=d;d=0}var d=$E(d||{},this.$Box.toObject());d.dialog=this.dialog;d.action=a;d.step=this._S&&this._S.getName()||this.curStep;d.prevStep=this._S&&this.getPrevStep().getName()||'';d.nextStep=this._S&&this.getNextStep().getName()||'';this.disabled=true;this.$Box.removeClass('is-ready-step');jQuery.ajax({type:t,url:this.url,data:d,success:$D(this,function(R){this.$Box.addClass('is-ready-step');this.disabled=false;(s||this._drSuccess)(R)}),error:this._drError})},_requestStatus:function(s,R){if(s){this._pResult(R,this.getStep(),this.getNextStep());this.setStep(this.getNextStep())}else{this.error('Ошибка сервера')}},_pResult:function(R){},_submit:function(){if(!this.disabled&&this.getStep().isReady()){if(this._ls){this.dispatchEvent('lastStep',this)}else{this._request('POST','post')}}return false},_iStep:function(S){},_changeStep:function(S){if(this.getStep()==S){if(this._fs!==S.isFirst())this.$Box[(this._fs=S.isFirst())?'addClass':'removeClass']('is-first-step');if(this._ls!==S.isLast())this.$Box[(this._ls=S.isLast())?'addClass':'removeClass']('is-last-step');if(this._hs!==!this._ls)this.$Box[(this._hs=!this._ls)?'addClass':'removeClass']('has-next-step');if(this._rs!==S.isReady()){this.$Box[(this._rs=S.isReady())?'addClass':'removeClass']('is-ready-step');this.$Next.attr('disabled',!this._rs);this.$Submit.attr('disabled',!this._rs)}debug.log(S.getName(),'first:',this._fs,'next:',this._hs,'last:',this._ls,' =>',this._hs&&S.getNext().getName())}},_eBind:function($T,n,f,r){$T.bind(n,$D(this,function(e){if(!this.disabled){var rr=f.call(this,e);if(typeof rr=='boolean')r=rr}return!!r}))},error:function(t){alert(t)},html:function(h){this.$Box.html(h).processPlugins();return this},getPrevStep:function(){var S=this.getStep();do{S=S.getPrevStep()}while(S.isSkip());return S},getNextStep:function(){var S=this.getStep();do{S=S.getNextStep()}while(S.isSkip());return S},nextStep:function(){if(this.getStep().isReady())this.setStep(this.getNextStep().getName());return this},prevStep:function(){this.setStep(this.getPrevStep().getName());return this},setStep:function(S){S=this.getStep(S);if(this._S!=S){if(this._S)this._S.hide();this.dispatchEvent('step',this,(this._S=S).show())}return this},getStep:function(s){return(typeof s=='undefined'&&this._S)||(typeof s=='string'?Registry.get(this.uniqId+s):s)},isLoaded:function(){this.loaded},setSteps:function(S){this.Steps=S;return this},loadSteps:function(){var S=this.Steps;for(var i=0,n=S.length;i<n;i++){if(i<n-1&&!S[i].next)S[i].next=S[i+1].name;if(i&&!S[i].prev)S[i].prev=S[i-1].name;this._iStep((new Dialog.Step(S[i],this)).addEventListener('change',$D(this,'_changeStep')))}S=null;return this},run:function(){if(this.loaded&&!this.running){this.running=true;this._iEvents();this.loadSteps();this.$Form=this.$Box.find('FORM').submit($D(this,'_submit'));this.$Submit=this.$Form.find('INPUT[type=submit]');this.setStep(this.curStep||this.Steps[0].name).dispatchEvent('loaded',this)}else if(!this.loaded&&!this.loading){this._iLoad()}return this}});Dialog.Step=jsClass.create().extend(PropertiesMapper).methods({__construct:function(o,P){debug.log('CreateStep: '+o.name);Registry.put((this.parentId=P.uniqId)+o.name,this);this.__properties('$',{name:0,ready:false,sElms:0,hElms:0,skip:false,next:0,prev:0,vis:false});this.set(o);if(this.$.sElms)this.$Show=jQuery(this.$.sElms);if(this.$.hElms)this.$Hide=jQuery(this.$.hElms)},_vis:function(s){if(this.$.vis!==!!s){if(this.$.sElms)this.$Show[s?'show':'hide']();if(this.$.hElms)this.$Hide[s?'hide':'show']();this.set('vis',!!s).dispatchEvent(s?'show':'hide',this)}return this},getParent:function(){return Registry.get(this.parentId)},setSkip:function(s){return this.set('skip',!!s)},setReady:function(r){return this.set('ready',!!r)},isSkip:function(){return this.$.skip},isReady:function(){return this.$.ready},isVisible:function(){return!!this.$.vis},isSelected:function(){return this==this.getParent().getStep()},getName:function(){return this.$.name},show:function(){return this._vis(1)},hide:function(){return this._vis(0)},isFirst:function(){return!this.getPrev()},isLast:function(){return!this.getNext()},hasPrev:function(){return!this.isFirst()},hasNext:function(){return!this.isLast()},getPrev:function(){return this.getParent().getPrevStep()},getNext:function(){return this.getParent().getNextStep()},getPrevStep:function(){return Registry.get(this.parentId+this.$.prev)},getNextStep:function(){return Registry.get(this.parentId+this.$.next)}});;
jsLoader.loaded('{plugins}Dialog', 1);$P('jsBuild.{plugins}Dialog', 1);


$P('jsBuild.{jsCore}swfobject');/**
 * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 */
if( !window.SWFObject )
{
	if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return "";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;
	
	// by RubaXa
	var SWF	=
	{
		defParams: { allowScriptAccess: 'always', menu: false },
		
		
		build: function (Elm/*String*/, p/*Object*/)/*SWFNode*/
		{
			if( typeof Elm == 'string' )Elm = $F( Elm );	// by id
			else if( Elm.append )		Elm = Elm[0];		// jQuery

			var
				  m	= p.movie/*MovieParams*/
				, v	= p.vars||{}/*FlashVars*/
				, p	= $E(this.defParams, p.params)/*Params*/
				, fId, k
				, so= new SWFObject(m.url, fId=(m.name||jsCore.getUniqId()), m.width||'100%', m.height||'100%', m.ver||m.version||'9', m.bg||m.bgColor||m.background)
			;
			for( k in v )	so.addVariable(k, encodeURIComponent( v[k] ));
			for( k in p )	so.addParam(k, p[k]);
			
			so.write( Elm );
			
			return	$F('#'+fId);
		}
	};
	
	
};
jsLoader.loaded('{jsCore}swfobject', 1);$P('jsBuild.{jsCore}swfobject', 1);


$P('jsBuild.{gay}Gay.Parad');/**
 * @class	Gay.Parad
 * @author	RubaXa	<trash@rubaxa.org>
 */
Gay.Parad=jsClass.create().extend(Dialog).methods({init:function(){GVar.parse(this.$Box);this.Win=new LightBox(this.idWin,{onShow:function(){Gay.Parad.hover(!1)},onHide:function(){Gay.Parad.hover(!0)}});this._eBind($(this.idShow),'click',function(){this.run();this.Win.show()});if(this.curStep!='NotAuth'&&this.curStep!='NoPhoto'){this._eBind((this.$COU=$('#ConditionsOfUse')).find('A'),'click',function(){this.setStep('ParadRules')},false);this._eBind(this.$Box.find('.PhotoSelector IMG'),'click',function(e){this.$Box.find('.cur-photo').attr('src',$GV(e,'src')).end().find('INPUT.end').click($D(this,'onLastStep'));this.$SPhoto.removeClass('selected');this.$SPhoto=$($G(e,'tagName','LI')).addClass('selected');this.getStep().setReady(1);this.url=this.url.replace(/\?pId=\d+/i,'')+'?pId='+this.$SPhoto.find('INPUT').val()},true);this.$SPhoto=this.$Box.find('.PhotoSelector LI.selected');if(this.rating>=this.ratingCost){$('#PaymentMethod INPUT').click($D(this,function(e){this.getStep($G(e).name).setSkip(false)}))}}else{this._eBind($('#ParadAuth'),'click',function(){this.Win.hide();Gay.Auth.show()})}if(this.visible)this.Win.show()},onStep:function(){var r=0,n=this.getStep().getName();if(n=='SelectPhoto')this.$COU.show();switch(n){case'ParadRules':this.$COU.hide();break;case'UseRating':r=1;case'PayMethod':case'SelectPhoto':{if(this.getStep('PayMethod'))this.getStep('PayMethod').setSkip(this.rating<this.ratingCost);this.getStep('UseSms').setSkip(r||this.rating>=this.ratingCost);if(this.getStep('UseRating'))this.getStep('UseRating').setSkip(1)}case'UseSms':{var t=String.html2text(String.wordWrap(String.trim(this.$Form[0].greeting.value)));this.$Box.find('.greeting-text')[t?'show':'hide']().find('I').html(t)}break}this.Win.fixPos()},onLastStep:function(){this.Win.hide();if(this.getStep().getName()=='UseRating'){this.rating-=this.ratingCost}if(this.getStep().getName()!='UseSms'){this.setStep('SelectPhoto')}},_pResult:function(R){if(R.isOK()&&(R=R.getData('sms'))){for(var k in R){GVar.val('sms.'+k,R[k])}}}});Gay.Parad.hover=function(s){try{Gay.ParadSWF.hover(!!s)}catch(e){}};;
jsLoader.loaded('{gay}Gay.Parad', 1);$P('jsBuild.{gay}Gay.Parad', 1);


$P('jsBuild.{gay}Gay.AskUser');/**
 * @class	Gay.AskUser
 * @author	RubaXa	<trash@rubaxa.org>
 * Блок, попрописть юзверя заполнить анкету, залить фотки и тд и тп
 */
Gay.AskUser=jsClass.create().methods({__construct:function($B,o){this.$Block=$($B);$E(this,o);this.$Block.find(this.cssLink).click($D(this,function(){if(!this.isSend){this.isSend=1;Gay.Ajax.post(this.url,{uId:Gay.$.vUserId,action:this.action},$D(this,function(R){this.isSend=0;if(R.isOK()){this.$Block.find(this.cssAsk).slideUp('fast').end().find(this.cssDone).slideDown('fast')}}))}return false})).click()}});
jsLoader.loaded('{gay}Gay.AskUser', 1);$P('jsBuild.{gay}Gay.AskUser', 1);


$P('jsBuild.{gay}Gay.SoundManager');/**
 * @class	Gay.SoundManager
 * @author	RubaXa	<trash@rubaxa.org>
 */
jsClass.create('Gay.SoundManager').methods({__construct:function(){this.queue=[];this.activeId=0;jsCore.ready($D(this,'_init'));Interval.create(this._check=$D(this,function(){var c=(jsCookie.get('gSound')||'|0').split('|');this.activeId=c[0];if(!c[0]||(now()-c[1]>1000))jsCookie.set('gSound',(this.activeId=this.uniqId)+'|'+now())}),1500);this._check()},_init:function(){window['sm'+this.uniqId]=$D(this,'_ready');this._flash=SWF.build($('<b style="position: fixed; overflow: hidden; width: 1px; height: 1px; top: 1px; left: 1px;"></b>').appendTo('BODY'),{movie:{url:'/i/GayRuSounds.swf?r=2',width:1,height:1},vars:{onReady:'sm'+this.uniqId}})},_ready:function(){this.loaded=true;while(this.queue.length)this.play(this.queue.shift())},isActive:function(){return this.activeId==this.uniqId},play:function(sound){if(this.isActive()){if(this.loaded)this._flash.play(sound);else this.queue.push(sound)}return this}});;
jsLoader.loaded('{gay}Gay.SoundManager', 1);$P('jsBuild.{gay}Gay.SoundManager', 1);


$P('jsBuild.{components}Comet');/**
 * @class	Comet
 * @author	RubaXa	<trash@rubaxa.org>
 * Adapter class
 */
window.Comet=window.Comet||{};(function(){var _domain=''+document.domain,_provider={},_providers={'Ajax':{url:'?_sr_=Y&AjaxComet=Y',timeout:5*1000,require:'{jsCore}Array'},'Stomp':{require:'{orbited}orbited,{orbited}stomp',hostname:''+_domain,port:80},'Realplexor':{require:'{components}Dklab_Realplexor',domains:['rpl.'+_domain]},_default:Comet._default};$E(this,Comet.channels);this.get=function(name,func){if(!func){func=name;name=_providers._default}var P=_providers[name];jsLoader.require(P.require,function(){if(!_provider[name])_provider[name]=new Comet[name]($E(P,window.COMET_OPTIONS));func(_provider[name])})};this.subscribe=function(provider,channel,func){(arguments.length==2)?this.get(function(P){P.subscribe(provider,channel)}):this.get(provider,function(P){P.subscribe(channel,func)})};this.unsubscribe=function(provider,channel,func){(arguments.length==2)?this.get(function(P){P.unsubscribe(provider,channel)}):this.get(provider,function(P){P.unsubscribe(channel,func)})};window.Comet=this})();jsClass.create('Comet.Provider').methods({send:function(){},subscribe:function(channel,func){},getSubscribes:function(){var result=[];Object.forEach(this._subscribe,function(v,k){if(v>0)result.push(k)});return result},unsubscribe:function(channel,func){}});jsClass.create('Comet.Ajax').extend(Comet.Provider).methods({__construct:function(opts){this._cursor=0;this._result=window[this.uniqId]=$D(this,function(id,R){clearTimeout(this.cId);this.cId=setTimeout(this._check,opts.timeout);if(R=unserialize(R)){var c,e,i;this._cursor=R.cursor;R=R.channels;for(c in R){e=R[c];for(i=e.length;i--;)this.dispatchEvent(c,e[i])}}id=$F('#'+id);if(id)id.parentNode.removeChild(id)});this._check=$D(this,function(){clearTimeout(this.cId);var S=document.createElement('SCRIPT');S.id=jsCore.getUniqId();S.type='text/javascript';S.src=opts.url+'&pid='+S.id+'&cursor='+this._cursor+'&channels='+this._channels.join(',')+'&func='+this.uniqId;HEAD.appendChild(S)});this._channels=[];this._subscribe={}},subscribe:function(channel,func){if(!this._subscribe[channel])this._subscribe[channel]=0;this._counters[channel]++;if(Array.indexOf(this._channels,channel)==-1)this._channels.push(channel);this.addEventListener(channel,func);this._check()},unsubscribe:function(channel,func){if(--this._subscribe[channel]==0)this._channels=Array.remove(this._channels,channel,1);this.removeEventListener(channel,func);this._check()}});jsClass.create('Comet.Stomp').extend(Comet.Provider).methods({__construct:function(opts){$E(Orbited.settings,opts);this.Stomp=new STOMPClient();$E(this.Stomp,{onopen:function(){debug.log('onopen:',arguments)},onerror:function(){debug.log('onerror:',arguments)},onclose:function(){debug.log('onclose:',arguments)},onerrorframe:function(){debug.log('onerrorframe:',arguments)},onmessageframe:$D(this,function(frame){debug.log('onmessageframe:',arguments);this.dispatchEvent('message',frame)}),onconnectedframe:$D(this,function(){debug.log('onconnectedframe:',arguments);this.isConnected=true;this.dispatchEvent('connect',this)})});this._funcs=[];this._subscribe={};$(window).bind('beforeunload',$D(this,function(){this.Stomp.disconnect();this.Stomp.reset()}));this.Stomp.connect("localhost",61613,StompSettings.user,StompSettings.pass)},_func:function(channel,func){var i=-1;if(func.gid)i=Array.search(this._funcs,function(f){return(f.gid==func.gid)&&(f.cid==channel)});else func.gid=jsCore.getUniqId();if(i==-1){var _func=function(frame){if(frame.headers.destination==channel){func(frame.body=unserialize(frame.body))}};_func.gid=func.gid;_func.cid=channel;i=this._funcs.push(_func)-1}return this._funcs[i]},connect:function(func){this.isConnected?func(this):this.addEventListener('connect',func);return this},subscribe:function(channel,func){if(!this._subscribe[channel])this.connect(function(Provider){Provider.Stomp.subscribe(channel)});this._subscribe[channel]++;this.addEventListener('message',this._func(channel,func));return this},unsubscribe:function(channel,func){var remove=[];Array.forEach(this._funcs,function(f,i){if((f.cid==channel)&&((func===null)||(f.gid===func.gid))){this.removeEventListener('message',f);remove.push(i)}},this);for(var i=0;remove[i];i++)this._funcs=Array.remove(this._funcs,remove[i]);if(this._subscribe[channel])this._subscribe[channel]-=remove.length;return this}});jsClass.create('Comet.Realplexor').extend(Comet.Provider).methods({__construct:function(opts){this._engine=new Dklab_Realplexor('http://'+opts.domains[Math.rand(1,opts.domains.length)-1],opts.namespace);this._subscribe={}},subscribe:function(channel,func){if(!this._subscribe[channel])this._subscribe[channel]=0;this._subscribe[channel]++;this._engine.subscribe(channel.replace(/[^\w]/g,''),func);this._engine.execute();return this},unsubscribe:function(channel,func){if(this._subscribe[channel])this._subscribe[channel]-=func?1:this._subscribe[channel];this._engine.subscribe(channel.replace(/[^\w]/g,''),func||null);this._engine.execute();return this}});;
jsLoader.loaded('{components}Comet', 1);$P('jsBuild.{components}Comet', 1);


$P('jsBuild.{gay.messenger}Gay.Messenger.Chat');/**
 * @class	Gay.Messenger.Chat
 * @author	RubaXa	<trash@rubaxa.org>
 */
jsClass.create('Gay.Messenger.Chat').static({get:function(uId){return this[uId]}}).extend(PropertiesMapper).methods({__construct:function($W,o){this.$Win=jQuery($W||this.getTpl());this.$Title=this.$Win.find('.mc-title');this.$Mess=this.$Win.find('.mc-messages');this.$MTpl=this.$Mess.find('DIV');this.$Text=this.$Win.find('TEXTAREA');this.Text=this.$Text[0]?new InputText(this.$Text):0;this.lTime=Date.getNow();this._iEvents();this.__properties('$',{title:'',minimize:false,maximize:false,userId:1,aUserId:1,check:60*1000,interval:60*1000,load:false,readTS:0,offset:0,urlRtmp:'',urlFlash:'',showVideo:false});this.set(o);if(this.$.maximize){this.$Win.hide();this.maximize(1)}else{if(this.$.load)this.load();this.check()}if(this.Text){$('#More U').click($D(this,function(){this.$.offset+=30;this.load(0,0,this.$.offset);return false}));this.$.check=0;this.check(false);Comet.subscribe(Comet.notify,$D(this,function(evt){if(evt.type=='message.print'&&evt.target==this.$.userId){$FS('#OnPrint').display='';clearTimeout(this._opId);this._opId=setTimeout(function(){$FS('#OnPrint').display='none'},5000)}else if(evt.type=='message.add'){var msg=evt.target;if((msg.from_user_id*1)==this.$.userId){jsCookie.set('gNotify',now());msg.unread=0;this.set('readTS',Date.getNow()).read().load(true,[msg]);Gay.SoundManager.getInstance().play('message');this._sendRead(1)}}else if(evt.type=='message.read'){this._sendRead(0);this.set('readTS',Date.getNow()).read()}}));if(window.document.location.hash=='#video'){this.$Win.find('.mc-video-create').click()}$('.smiles I').click($D(this,function(){this.Text.setFocus()})).mousedown($D(this,function(e){this.Text.replaceSelection(' '+e.currentTarget.title+' ')}));Gay.Messenger.Chat[this.$.userId]=this;$(window).bind('beforeunload',$D(this,'_sendRead',1,1));this.Text.addEventListener('keyUp',$D(this,function(){if(now()-(this.sPrint||0)>5000)$.get('?edit=Messenger&action=print&r='+(this.sPrint=now()))}))}},_sendRead:function(s,f){clearTimeout(this._srId);if(s&&!this._srF)this._srF=$D(this,function(){$.get('?edit=Messenger&action=read&uId='+this.$.userId+'&r='+now())});if(s){if(f)this._srF();else this._srId=setTimeout(this._srF,5000)}},getTpl:function(){return jQuery('#MChatWinTpl').clone().attr('id','W-'+this.uniqId).show()},_iEvents:function(){this._dCheck=$D(this,'check',1);this._checker=$D(this,function(R){if(!this.isRefresh){debug.log('Refresh');this.isRefresh=!0;this.$R.addClass('refresha');debug.log('Gay.Ajax.get');if(this.$.check==0)this.check(1);else $.get('/?get=NewMessages',{uId:this.$.userId,ts:this.$.readTS.getTime()},this._dCheck)}});this.$R=$('#Refresh').click(this._checker);this.$Win.setHotKey('ctrl+enter',$D(this,function(){this.submit()})).find('.mc-max').click($D(this,function(){debug.log('max',this.$.maximize);this.maximize(!this.$.maximize);return false})).end().find('.mc-title,.mc-min').click($D(this,function(){debug.log(this.$.minimize);this.set('minimize',!this.$.minimize);return false})).end().find('.mc-close').click($D(this,function(){this.close();return false})).end().find('.mc-submit').click($D(this,'submit')).end().find('.mc-video-create').click($D(this,'videoCreate')).end().click($D(this,function(){this.focus()}))},submit:function(type){if(this.$Text.val().length){var m={body:this.$Text.val(),type:0};this.submitMsg(m)}this.$Text.val('').focus();return false},submitMsg:function(m){m.userId=this.$.userId;m.my=m.unread=1;m.created=Date.getNow();$.post('?edit=Messenger&action=addMessage',m,$D(this,function(R){if(R.isOK()){R=this.check(1,R);if(R.userIsOnline)m.unread=0;this._sendRead(1)}}))},onChange:function(C){for(var k in C._$){switch(k){case'title':this.$Title.html(C.$[k]);break;case'minimize':this.$Win[C.$[k]?'addClass':'removeClass']('minimize');break;case'maximize':this.$Win[C.$[k]?'addClass':'removeClass']('maximize');break}}},_message:function(m){if(m.type=='time'){var D=Date.parse(m.created),p='';if(D.isYesterday())p='вчера';else if(D.isToday())p='сегодня';else p=D.format('d n Y');m.body=p+' в '+D.format('H:I')}return m.body},check:function(l,R){if(l){debug.log('check');this.isRefresh=!1;this.$R.removeClass('refresha');if(R.isOK()){debug.log('getData');if(R.getData)R=R.getData();debug.log('testing');if(R.contact){debug.log('R.contact',R.contact.contact_read_ts);this.set('readTS',Date.parse(R.contact.contact_read_ts)).read()}if(R.messages){this.load(1,R.messages)}this.check();return R}}else{clearTimeout(this.__cId);if(this.$.check>0){this.__cId=setTimeout(this._checker,this.$.check)}}},read:function(){if(this.$Mess[0]){debug.log('read');var m=this.$Mess[0].childNodes,i=0,n=m.length;for(;i<n;i++){if((m[i].tagName=='DIV')&&$GA(m[i],'created')<this.$.readTS.getTime()){$RA(m[i],'className','unread','')}}return this}},maximize:function(s){if(s){try{var win=Window.openPopUp(Gay.get('messengerUrl')+this.$.userId+(this.$.showVideo?'#video':''),{name:'messenger_'+this.$.userId,width:530,height:550});win.focus()}catch(e){debug.log('Chat.maximize: ',e)}this.close()}},focus:function(){this.$Text.focus();return this},getWindow:function(){return this.$Win},addMessage:function(o,forceAdd,fix){if(!forceAdd&&this.$Win.find('#M'+o.id).size())return;var $M=this.$MTpl.clone().show();if(o.type=="1"){if(o.userId==this.$.userId){var tmp=o.body.split(',');tmp=tmp[1]+","+tmp[0];o.body="Включил <a href='#' tag='"+tmp+"' class='mc-video-join'>веб-камеру</a>."}else o.body="Включил веб-камеру. <a href='#' tag='"+o.body+"' class='mc-video-join'>Посмотреть</a>"}o.created=Date.parse(o.created);if((this.lUserId!=o.userId*1)||(o.created.getTime()-this.lTime.getTime()>=this.$.interval)){this.lUserId=o.userId*1;if(o.userId){$M.html((this._hr?'<div class="HR"></div>':'')+'<b class="n">'+(this.$.userId==o.userId?'Я':this.$.title)+', <em class="t">'+(this._message({type:'time',created:o.created}))+'</em></b><span class="b"></span>');this._hr=1}}this.lTime=o.created;$M.attr('id','M'+o.id).attr('created',o.created.getTime()).find('SPAN').html(this._message(o));var cl=['m',o.my?'my':'nmy'],i=2;if(o.type!='0')cl[i++]='type'+o.type;if(o.unread)cl[i++]='unread';$M[0].className=cl.join(' ');if(fix)$M.insertBefore('#M'+this.lastId);else $M.appendTo(this.$Mess);this.$Mess[0].scrollTop=this.$Mess[0].scrollHeight;if(o.type=='1')$M.find('.mc-video-join').click($D(this,'videoJoin'));$M=null;return this},_videoAdd:function(idPlay,idPublish,role){if(this.getWindow().hasClass('video'))return;if(window.outerWidth+150<window.screen.width){window.resizeBy(300,0);if(window.outerWidth+100>=window.screen.width){window.resizeBy(window.screen.width-window.outerWidth-100,0)}}$R('{jsCore}swfobject',$D(this,function(){SWF.build('#mc-video',{movie:{url:this.$.urlFlash,width:408,height:440,version:'10.0.0.0',bg:'#ffffff'},params:{},vars:{trace_flag:'0',idPlay:idPlay,idPublish:idPublish,urlsPlay:this.$.urlRtmp,urlsPublish:this.$.urlRtmp,role:role,bitrate:300}});if(role=="a"){this.submitMsg({body:idPublish+","+idPlay,type:1})}}));this.$Win.find('.mc-video-create').hide();this.getWindow().addClass('video')},videoCreate:function(t){this._videoAdd(this.$.userId,this.$.aUserId,"a")},videoJoin:function(e){ids=$(e.target).attr("tag").split(',');this._videoAdd(ids[0],ids[1],"b")},load:function(l,M,o){if(l){if(M&&M.length){var newLastId=this.lastId==undefined?2000000000:this.lastId;Array.forEach(M.reverse(),function(m){m.id=1*m.id;m.created=Date.parse(m.created);this.addMessage(m,0,this.lastId>=m.id);newLastId=(m.id<newLastId?m.id:newLastId)},this);if(!this.lastId||o){if(o){$('#More')[M.length<30?'hide':'show']();this.$Mess[0].scrollTop=$('#M'+this.lastId).offset().top-$('#M'+M[0].id).offset().top}this.lastId=newLastId}}}else $.get('/?get=MessengerMessages',{uId:this.$.userId,offset:o||0},$D(this,function(R){if(R.isOK())this.load(1,R.getData('messages'),R.getData('offset'))}));return this},close:function(){try{clearTimeout(this.__cId);this.$Win.remove();this.dispatchEvent('close',this)}catch(e){}}});;
jsLoader.loaded('{gay.messenger}Gay.Messenger.Chat', 1);$P('jsBuild.{gay.messenger}Gay.Messenger.Chat', 1);


$P('jsBuild.{gay.messenger}Gay.Messenger.Chat.Manager');/**
 * @class	Gay.Messenger.Chat.Manager
 * @author	RubaXa	<trash@rubaxa.org>
 */
Gay.Messenger.Chat.Manager=jsClass.create().methods({__construct:function(){$E(this,{maxWinWidth:250,rightWinMargin:10});this.wins=[];this.check={};this.bindWin(false,false,false)},rebuild:function(){for(var i=0;i<this.wins.length;i++){this.wins[i].getWindow().css({right:i*(this.maxWinWidth+this.rightWinMargin),width:this.maxWinWidth})}return this},setWin:function($W){this.$Win=jQuery($W);return this},bindWin:function(P,data,ns){if(!isAuth)return;jQ('.m-chat',P||document.body).click($D(this,function(e){if(!data){e=$G(e);var h=(e.href||e.parentNode.href);if(h&&(h.indexOf('/messages/?')==-1)){return true}e=$($G(e,'className',/m-chat/))}if(e||data){var d=data||unserialize($GV(e,'chat'));this.add(d);if(!data&&(e.hasClass('has-new-msg')||(e=e.find('.has-new-msg'))[0])){Gay.MNotify.decUnread(d.unread);e.removeClass('has-new-msg').html(String.num(d.messages,Lang.get('messages'),' '));d.unread=0}if(!ns)return false}}))},get:function(i){return this.wins[i]},add:function(C){if(this.check[C.userId]){this.get(this.check[C.userId]-1).focus()}else{C=new Gay.Messenger.Chat(0,C);if(!C.$.maximize){C.addEventListener('close',$D(this,'remove'));this.$Win.append(C.getWindow());this.check[C.$.userId]=this.wins.push(C.focus())}C=null}return this.rebuild()},remove:function(C){this.check[C.$.userId]=0;this.wins=Array.remove(this.wins,C,1);return this.rebuild()}});jsCore.ready(function(){Gay.Messenger.Chat.Manager.getInstance()});;
jsLoader.loaded('{gay.messenger}Gay.Messenger.Chat.Manager', 1);$P('jsBuild.{gay.messenger}Gay.Messenger.Chat.Manager', 1);


$P('jsBuild.{gay}Gay.Notify');/**
 * @object	Gay.Notify
 * @author	RubaXa	<trash@rubaxa.org>
 */
Gay.Notify=({_init:function(){this.queue=[];this.items=[];this.uniqId=jsCore.getUniqId();$(window).focus($D(this,function(){window.inFocus=!0;var t=jsCookie.get('gNotify')||0;while(this.queue.length){var N=this.queue.shift();if(N[0]>t)this.add(N[1],N[2])}}));return this},_upd:function($X){var i,x,r=!!$X;if(!r)for(i=this.items.length,x=10;i--;){this.items[i].dequeue().animate({right:x,opacity:1},'fast');x+=this.items[i].outerWidth()+10}if(r||(window.width()-x<100)){do{$X=$X||this.items.shift();x-=$X.outerWidth();$X.animate({bottom:-$X.outerHeight(),opacity:0},'easeOutBack',function(){$(this).remove()})}while(!r&&(window.width()-x<100))}},_close:function(e){var id=$GV(e.currentTarget,'id'),idx=Array.search(this.items,function($I){return $I[0].id==id});if(idx!=-1){this._upd(this.items[idx]);this.items=Array.remove(this.items,idx);this._upd()}else{(e=$(e.currentTarget)).animate({bottom:-e.outerHeight(),opacity:0},'easeOutBack',function(){$(this).remove()})}return false},_message:function(type,data){return'<a href="/user/messages/?uId=#id#" title="#name#, #age#, #location#" class="m-chat"><img src="#photo#" /></a>'.replace(/#(\w+)#/g,function(a,b){return data[b]})},_gift:function(type,data){return String.sprintf('<div title="%s" class="Gifts%s"><div class="m-chat Gift %s"></div></div>',data.greeting||'',data.size,data.name)},_bigplus:function(type,data){return String.sprintf('<img class="m-chat" src="/i/i/plus10.gif" width="47" height="44" />',data.size,data.name);return $N},add:function(type,data){if(window.inFocus){type=type.toLowerCase();var id='n-'+type+data.id,$N=$('#'+id),$F,i=0,x=0;if($N[0]){$N=$N.append('<div class="br-5 bs-5-666 pAbs ge-notify ne-'+type+'"></div>').children('DIV');$F=$N.item(0);x=10;for(i=$N.length;i--;){$N.item(i).css({zIndex:999-i,width:$F.width(),height:$F.height(),right:x+=3})}$N.parent().width($F.outerWidth()+x)}else{$N=$(String.sprintf('<div class="g-notify n-%s"><i class="pAbs close"></i><div class="ge-notify ne-%s br-5 bs-5-666 pAbs">%s</div></div>',type,type,this['_'+type](type,data))).appendTo('BODY');$F=$N.find('>DIV');$N.attr('id','n-'+type+data.id).css({bottom:10}).css({right:-$N.outerWidth(),zIndex:999,width:$F.outerWidth(),height:$F.outerHeight()}).click($D(this,'_close'));if(type=='message'||type=='bigplus'||type=='gift'){Gay.Messenger.Chat.Manager.getInstance().bindWin($N,{userId:(data.user_id_from||data.user_id||data.id),maximize:!0},true)}this.items.push($N)}$F=$N=null;jsCookie.set('gNotify',now());this._upd()}else{this.queue.push([now(),type,data])}return this},sound:function(name){name=name||'default';if(Sounds[name])Gay.SoundManager.getInstance().play(name);return this}})._init();;
jsLoader.loaded('{gay}Gay.Notify', 1);$P('jsBuild.{gay}Gay.Notify', 1);


$P('jsBuild.{gay.messenger}Gay.Messenger.Notify');/**
 * @object	Gay.Messenger.Notify
 * @author	RubaXa	<trash@rubaxa.org>
 */
jsClass.create('Gay.Messenger.Notify').methods({__construct:function($B,o){this.$Box=$($B);$E(this,{unread:0,idCountText:0,cssHasUnreadMess:0,simpleQueueName:''},o);this.$CText=$(this.idCountText);this.$UMess=$(this.cssHasUnreadMess);this._dChecker=$D(this,'_checker');this._dResult=$D(this,'_result');Comet.subscribe(Comet.notify,$D(this,function(evt){switch(evt.type){case'sound':Gay.Notify.sound(evt.target);break;case'talk.invite':this._iTalk(evt.target);Gay.Notify.sound('talk');break;case'message.add':Gay.Notify.sound(evt.sound).add(evt.subtype,evt.notify);case'message.read':this.setUnread(evt.unread);if(window.inFocus&&window.Project&&/contacts/.test(location.href))Project.PageBuilder.reload();break}}));Gay.MNotify=this},_iTalk:function(t){this.$Talk=$(this.idTalk).show().find('INPUT[type=submit]').click($D(this,function(e){if(e.target.className.indexOf('ok')>-1){location.href=this.talkUrl+t}else this.$Talk.hide();return false})).end();Timeout.create($D(this,function(){this.$Talk.hide()}),this.talkExpire*1000)},setUnread:function(u){this.unread=u=Math.max(0,u*1);this.$UMess[u?'show':'hide']();this.$CText.html(u?'<strong>'+String.num(u,Lang.get('unread'),' ')+'</strong>':'новых пока нет')},decUnread:function(u){this.setUnread(this.unread-(u||0)*1)}});;
jsLoader.loaded('{gay.messenger}Gay.Messenger.Notify', 1);$P('jsBuild.{gay.messenger}Gay.Messenger.Notify', 1);


/***
 * И этот JS-builder написан тоже мной (RubaXa <trash@rubaxa.org>)
 * с использованием http://dean.edwards.name/packer/ 
 * всем приятного дня!
 */

$P('jsBuild.TOTAL', 1);$P('jsBuild', 2);