/**
 * @author	RubaXa		<trash@rubaxa.org>
 * @created	2007-11-07 20:45
 * @build	2008-12-09
 * @version 2.5μ
 * Ядрышко
 */
var RubaXa={},jsCore={version:2.5,build:4};(function(){var DR=[];var plugins=[];window.$R=function(r,c){window.domReady(function(){jsLoader.require(r,c)})};window.isDomReady=false;window.domReady=function(f){if(typeof(f)!='undefined'){window.isDomReady?f():window._drLength=DR.push(f)}else{window.isDomReady=true;for(var i=0;DR[i];i++)DR[i]()}};window.$PP=function(id,p,o){plugins.push([id,p,o])};domReady(function(){if(n=plugins.length){$R('{plugins}jsPlugins',function(){$P.start('jsPlugins.processing ('+n+')');for(var i=0,p;p=plugins[i];i++){debug.log(p);$P.start(p[0]);jsPlugins.set($F(p[0]),(typeof p[1]=='string'?p[1]:'plugin'),(typeof p[1]=='string'?p[2]:p[1])||{});$P.stop()}$P.stop()})}});window.$P={s:'                                                  ',init:function(){this.clear();if(0&&!/(js-?prof(ile)?|debug=s)/i.test(document.location.href)){$P.start=$P.stop=$P.print=function(){return this}}if(window.profiler){for(var i=0;profiler[i];i+=2){$P.start(profiler[i],profiler[i+1])}}},start:function(s,t){this.p=this.t.push([this.p,s,t||(new Date()).getTime()])-1;this.l=this.o.push(this.p);return this},stop:function(){var i=this.o.splice(--this.l,1)[0];this.p=this.t[i][0];this.t[i][2]=(new Date()).getTime()-this.t[i][2];if(this.p==0)this.t[0][2]+=this.t[i][2];else if(this.p==1)this.t[0][1]+=this.t[i][2];return this},_print:function(p,o,x){var s='',ind=this.s.match(new RegExp('^(.{'+x+'})'))[1];for(var i=o;this.t[i];i++){if(this.t[i][0]==p){s+=ind+'> '+this.t[i][1]+': '+this.t[i][2]/1000 +' ('+ Math.round(this.t[i][2]/this.t[p][2]*100,3)+"%)\n";s+=this._print(i,i,x+4)}}return s},clear:function(){this.t=[[0,0,0]];this.o=[];this.l=0;this.p=0;this.i=0},print:function(){var s=this._print(0,1,1),u=this.t[0][2]-this.t[0][1];(debug||console).log('~~~~~~  jsCore.Profiler  ~~~~~~  ');(debug||console).log(debug.enabled?s.replace(/[\r\n]/g,'<br/>').replace(/\s/g,'&nbsp;'):s);(debug||console).log('~~~~~~ total: '+this.t[0][2]/1000+', sum: ' + this.t[0][1]/1000+', unknow: '+u/1000+' ('+Math.round(u/this.t[0][2]*100,3)+'%) ~~~~~~');this.clear()}};$P.init()})();var HTML=document.getElementsByTagName('HTML')[0],HEAD=HTML.firstChild,BODY=null,undefined;HTML.id='jsHtml';HTML.className+=' jsHtml';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;var 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;for(;i<n;i++){if(i in a){var 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')v=this.value;if(typeof(v)!='string')return v;try{return eval("("+(d?decodeURIComponent(v):v)+")")}catch(e){debug.log(e);return false}};window.userAgent=navigator.userAgent.toLowerCase();bVer=(userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[])[1];var jsCore={browser:{userAgent:userAgent,ver:parseInt(bVer),version:bVer,safari:/webkit/.test(userAgent),opera:/opera/.test(userAgent),msie:/msie/.test(userAgent)&&!/opera/.test(userAgent),mozilla:/mozilla/.test(userAgent)&&!/(compatible|webkit)/.test(userAgent)},F:function(a){return a},random:Math.random(),time:(new Date()).getTime(),version:2,local:/jsLocal|101|gay|pp\.ru|rubaxa|web3|mmm3|ll1/i.test(document.location.href),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},apply:function(O,m,a){switch(a.length){case 1:O[m](a[0]);break;case 2:O[m](a[0],a[1]);break;case 3:O[m](a[0],a[1],a[2]);break;case 4:O[m](a[0],a[1],a[2],a[3]);break;case 5:O[m](a[0],a[1],a[2],a[3],a[4]);break;case 6:O[m](a[0],a[1],a[2],a[3],a[4],a[5]);break;default:O[m]()}},crc32:function(s,c){var 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';var x=y=0;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,p,a;for(;arguments[i];i++){a=arguments[i]||{};for(p in a){if(((v=a[p])!=null)&&(typeof v!='undefined')){d[p]=v}}}v=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(){var a=[];a.push.apply(a,arguments);return m.apply(o,ca.concat(a))}},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;do{if((defined(v)&&((e[a]==v)||(e.getAttribute(a)==v)))||(!defined(v)&&((typeof e[a]!='undefined')||(e.getAttribute(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(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;if(c&&c.constructor!=Function)throw new Error('Second argument must be function in jsCore.wait or jsCore.require');if(!_c){c();return}else var 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;w[j];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++){try{this._wList[n].l[i](o)}catch(err){debug.log(err)}}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;BODY=document.body;jsCore.loaded=true;jsEvent.remove(window,'load',jsCore.ready);jsEvent.remove(window,'DOMContentLoaded',jsCore.ready);Timeout.create(function(){debug.log('<b>jsCore.loaded: true</b>, time: ',jsCore.getTimer()/1000);jsCore.notify('jsCore:ready,jsCore:loaded,document:loaded'.split(','))},5);var r=[];jsCore.disabled=/disabled/i.test(BODY.className);if(/js-component/.test(BODY.innerHTML))r.push('{components}jsComponents');else if(/js-/.test(BODY.innerHTML))r.push('{plugins}jsPlugins');if(r.length)jsCore.wait('loaded:Alias',function(){jsLoader.require(r)})}},unload:function(f){if(f&&f.constructor==Function){jsCore.wait('jsCore:unload',f)}else{jsCore.notify('jsCore:unload');BODY=null;$BODY=null;this.loaded=false;window.onerror=null;jsEvent.remove(window,'unload',jsCore.unload);Interval.destroy();jsCore.destroy(jsLoader);jsCore.destroy(Registry);jsCore.destroy()}},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,$GA=function(e,a){return typeof e[a]=='undefined'?e.getAttribute(a):e[a]},$GV=function(e,a){return $GA($G.apply($G,arguments),a)},$F=jsCore.$,$FS=function(id){return $F(id).style},$clone=jsCore.cloneObject,_apply_=jsCore.apply;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};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);jsClass.collector.push($D(this,'destroy'))};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.parent=jsClass.Base.prototype.parent;if(n){if(n.constructor==String)n=n.split(',');for(var i=0;n[i];i++){window[n[i]]=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];var 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(this[n]){return this[n].apply(this,Array.prototype.slice.call(arguments,1))}return null},destroy:function(){jsCore.destroy(this)}};$E(jsClass.Base,{getInstance:function(){if(!jsClass.instance[this.prototype.classUniqId]){jsClass.instance[this.prototype.classUniqId]=new this}return jsClass.instance[this.prototype.classUniqId]},extend:function(E){for(var c=0,cId,Klass;Klass=arguments[c];c++){cId=Klass.classUniqId;for(var p in Klass.prototype){if((p!='classUniqId')&&(p!='uniqId')&&(p!='parent')){this.prototype[p]=Klass.prototype[p];if(!jsClass.methods[this.classUniqId][p]){jsClass.methods[this.classUniqId][p]=[]};if(jsClass.methods[cId]&&jsClass.methods[cId][p]){jsClass.methods[this.classUniqId][p]=Array.uniq(jsClass.methods[this.classUniqId][p].concat(jsClass.methods[cId][p]))};if(Array.indexOf(jsClass.methods[this.classUniqId][p],cId)==-1){jsClass.methods[this.classUniqId][p].push(cId)};jsClass.__m[this.classUniqId][p]=jsClass.methods[this.classUniqId][p].length}}this.prototype.parentClassUniqId=Klass.classUniqId}return this},setMethods:function(Methods){$E(this.prototype,Methods);return this}});var jsCEvents={pool:{},name:function(n){return'on'+n.substr(0,1).toUpperCase()+n.substr(1)}};jsClass.Base.setMethods({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 pN=jsCEvents.name(n);var args=Array.prototype.slice.call(arguments,1);if(!this[pN]||(this[pN].apply(this,args)!==false)){if(this.__ce_uniqId&&jsCEvents.pool[this.__ce_uniqId][n=n.toLowerCase()]){var h=jsCEvents.pool[this.__ce_uniqId][n];for(var i=0;i<h.length;i++){try{if(h[i]&&h[i].apply(this,args)===false){return false}}catch(e){debug.log('CE->dispatchEvent:',arguments,e);h[i]=null}}h=null;delete h}return}return false}});var jsLoader={cache:!jsCore.local,script:{},aliases:{},css:{},Libraries:{},fL:{},files:{},file:function(u,t){if(!this._h)this._h=document.getElementsByTagName('HEAD')[0].firstChild;if(!this.files[u]){this.files[u]=1;var N=document.createElement(t=(t||'SCRIPT').toUpperCase());if(t=='LINK')N.setAttribute('rel','stylesheet');N.setAttribute('encoding','utf-8');N.setAttribute('type',t=='LINK'?'text/css':'text/javascript');N.setAttribute(t=='LINK'?'href':'src',u+(u.indexOf('?')==-1?'?':'&')+'b='+jsCore.build+(this.cache?'':'&r='+jsCore.getUniqId()));this._h.parentNode.insertBefore(N,this._h);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){if(!this.aliases[n]){this.aliases[n]=(n=='jsCore'||(/^(http:\/\/|\/)/.test(p))?p:this.aliases['jsCore']+p);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()).getTime()};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){if(!this.fL[s])this.fL[s]={t:(new Date()).getTime()};if(this.fL[s])this.fL[s].r=1;jsCore.notify(s)}};var d=document.location.href.toLowerCase().match(/debug=(\w+)($|&|#)/);var debug={_flog:[],enabled:d&&/y|yes|s|show/.test(d[1])};if(debug.enabled){debug._text='';debug.log=function(a){a=Array.prototype.join.call(arguments,' ');this._text=a+'<br />'+this._text};jsCore.wait('loaded:Alias',function(){jsLoader.require('{utils}debug')})}else{debug.log=function(){if(jsCore.local&&window.console&&!console.fake)console.log.apply(console,arguments)}}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 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,'pause':19,'break':3,'alt':18,'ctrl':17,'shift':16,'tab':9,'caps':20,'capslock':20,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))}};jsEvent.add(window,'load',jsCore.ready);jsEvent.add(window,'DOMContentLoaded',jsCore.ready);jsEvent.add(window,'unload',jsCore.unload);if(debug.enabled){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{var s=document.getElementsByTagName('SCRIPT');for(var i=0;s[i];i++){if(s[i].src&&s[i].src.indexOf('jsCore.js')>-1){jsLoader.addAlias('jsCore',s[i].src.split('/jsCore.js')[0]+'/');break}};s=null}if(jsCore.browser.safari)var _safariFixId=Interval.create(function(){debug.log('document.readyState: ',document.readyState);if((document.readyState=='loaded')||(document.readyState=='complete')){Interval.remove(_safariFixId);jsCore.ready()}},100);if($B.msie){document.write('<scr'+'ipt id="jsCore_ie_init" defer="true" '+'src="//:"><\/script>');var S=document.getElementById('jsCore_ie_init');if(S){S.onreadystatechange=function(){if(this.readyState=='complete'){{var S=document.getElementById('jsCore_ie_init');S.parentNode.removeChild(S);S=null}jsCore.ready()}S=null}}};$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):Math.round(Math.random()*min)}return Math.random()}});if(!window.console)window.console={fake:true};if(!window.console.log)window.console.log=function(){debug.log.apply(debug,arguments)};if(window.jsLoaderLoaded&&(jsLoaderLoaded.constructor==Array)){for(var i=0;i<jsLoaderLoaded.length;i++){jsLoader.loaded(jsLoaderLoaded[i])}jsLoaderLoaded=null};
jsLoader.loaded('{jsCore}jsCore');


jsLoader.addAlias('labs','labs/');jsLoader.addAlias('utils','utils/');jsLoader.addAlias('jQuery','jquery/');jsLoader.addAlias('lang.data','build/lang-ru.js');jsLoader.addAlias('plugins','plugins/');jsLoader.addAlias('highlight','plugins/highlight/');jsLoader.addAlias('frameMaker.css','../f/');jsLoader.addAlias('BugTracer.css','../bt/');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('components','components/');jsLoader.addAlias('component.users','components/Users/');jsLoader.addAlias('rubaxa.org','components/rubaxa.org/');jsLoader.addAlias('img.pixel','/i/');jsCore.notify('loaded:Alias');
jsLoader.loaded('{jsCore}Alias');


/**
 * Расширение объекта String
 * @author	RubaXa	<trash@rubaxa.org>
 * @version	1.0
 */
(function(){String._as={"'":new RegExp('(^|[^\\\\])((\\\\)*)\'','g'),'"':new RegExp('(^|[^\\\\])((\\\\)*)"','g')};$E(String,{addSlashes:function(s,q){return String(s).replace(String._as[q=(q||"'")],"$1$2\\"+String._as[q])},trim:function(s){return String(s).replace(/^\s+|\s+$/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).toLowerCase()},repeat:function(s,n){var r='';for(var i=0;i<n;i++){r+=s}return r},toQuery:function(o){var s='';if(o){if(typeof(o)=='string'){s=o}else{for(var p in o){s+='&'+p+'='+encodeURIComponent(o[p])}s=s.substr(1)}}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('=');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||70)+'})','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,p,t){var n=Math.round(n,d).toString().split('.'),x='',i=n[0].length-1;for(;i>=0;i-=3)x=n[0].substr(i-3,i)+x;return x+(n[1]?p+n[1]:'')}})})();;
jsLoader.loaded('{jsCore}String');


/**
 * @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]},empty:function(a){return!a||(a.length==0)},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}});;
jsLoader.loaded('{jsCore}Array');


/**
 * 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;
	
}jsLoader.loaded('{jsCore}swfobject');


/**
 * @class	jsUploader
 * @author	RubaXa		<trash@rubaxa.org>
 * @flash	Muxys
 * @version 2.0a
 * @events	init, hover, tbrowseCancel, securityError, IOErrorm loading, progress, complete, serverAnswer, loaded
 */
jsClass.create('jsUploader').setMethods({__construct:function(o,$B){this.isInit=0;this.params={};this.param($E({maxfiles:0,max_file_size:0,max_summary_size:0,server_url:'/',auto_upload:0,flashUrl:'{utils}uploader.swf',types:[],cursor:1},o||{}));jsCore.ready($D(this,'init'));this.setBrowseBtn($B);this.reset()},init:function(){var url=this.param('flashUrl');if(/^\{/.test(url))url=jsLoader.getFileUrl(url);var div=document.createElement('div');var fo=new SWFObject(url,'fo_'+this.uniqId,'100%','100%','8');div.id='h_'+this.uniqId;window['f'+this.uniqId]=$D(this,'flashEvent');$E(div.style,{position:'absolute',left:'0px',top:'0px',height:'100%',width:'1px',overflow:'hidden',zIndex:1000});BODY.appendChild(div);fo.addParam('wmode','transparent');fo.addParam('allowScriptAccess','always');fo.addVariable('jsHandler','f'+this.uniqId);fo.write('h_'+this.uniqId);fo=null;this.$FlashDIV=jQuery(div);return this},flash:function(m){try{if((m=='setParameter')||(this.dispatchEvent(m,this)!==false)){var FO=document.getElementById('fo_'+this.uniqId);_apply_(FO,m,Array.prototype.slice.call(arguments,1))}}catch(e){debug.log(FO,e)}return this},_eName:function(n){switch(n){case'browse_cancel':n='browseCancel';break;case'security_error':n='securityError';break;case'io_error_occured':n='IOError';break;case'start_uploading':n='loading';break;case'upload_progress':n='progress';break;case'file_upload_completed':n='complete';break;case'server_return_value':n='serverAnswer';break;case'total_upload_completed':n='loaded';break}return n},flashEvent:function(n){var args=Array.prototype.slice.call(arguments,1);switch(n){case'init':{this.isInit=1;this.param(this.params);this.setBrowseBtn();this.dispatchEvent(n,this)}break;case'hover':this.dispatchEvent(n,this,args[0].status);break;case'browse_cancel':this.dispatchEvent(this._eName(n),this);break;case'select':{this.queue.push.apply(this.queue,args[0]);this.rejected.push.apply(this.rejected,args[1]);this.bytesTotal=Array.sum(this.queue,function(F){return F.size*1});this.dispatchEvent(this._eName(n),this,args[0],args[1])}break;case'io_error_occured':{$E(this.getById(args[0].id),{error:1,ie_error:1});this.dispatchEvent(this._eName(n),this,args[0])}break;case'security_error':{$E(this.getById(args[0].id),{error:1,security_error:1});this.dispatchEvent(this._eName(n),this,args[0])}break;case'start_uploading':this.isUpload=1;debug.log(this.param('server_url'));case'upload_progress':case'file_upload_completed':{args[0].uploadPart=args[0].bytes_loaded/args[0].size;$E(this.getById(args[0].id),args[0]);this.bytesLoaded=Array.sum(this.queue,function(F){return F.bytes_loaded*1});if(n=='file_upload_completed'){this.dispatchEvent('progress',this,args[0])}this.dispatchEvent(this._eName(n),this,args[0]);this.dispatchEvent('bytesLoaded',this,this.bytesLoaded)}break;case'server_return_value':{this.dispatchEvent(this._eName(n),this,args[0],args[1])}break;case'total_upload_completed':{this.isUpload=0;this.dispatchEvent(this._eName(n),this)}break}},setBrowseBtn:function($B){this.$BrowseBtn=$B?jQuery($B):this.$BrowseBtn;if(this.$BrowseBtn){if(this.isInit){this.$FlashDIV.css(this.$BrowseBtn.offset()).css({width:this.$BrowseBtn.width(),height:this.$BrowseBtn.height()})}}return this},reset:function(){this.queue=[];this.rejected=[];this.bytesTotal=0;this.bytesLoaded=0;return this},param:function(k,v){if(v||(k&&(k.constructor==Object))){if(v){t=k;k={};k[t]=v}$E(this.params,k);if(this.isInit){for(var n in k){this.flash('setParameter',n,k[n])}}return this}return this.params[k]},browse:function(){return this.flash('browse')},upload:function(){return this.flash('upload')},cancel:function(){return this.flash('cancel').reset()},isEmpty:function(){return this.queue.length},filter:function(f){return Array.filter(this.queue,f)},getById:function(id){return this.queue[Array.search(this.queue,function(F){return F.id==id})]}});;
jsLoader.loaded('{utils}jsUploader');


/*****
 * jQuery JavaScript Library v1.3.1
 * http://jquery.com/
 *
 * Copyright (c) 2009 John Resig
 * Dual licensed under the MIT and GPL licenses.
 * http://docs.jquery.com/License
 *
 * Date: 2009-01-21 20:42:16 -0500 (Wed, 21 Jan 2009)
 * Revision: 6158
 */
if(!window.jQuery){if(!document.nodeType){window.tagName=window.nodeName='WINDOW';document.tagName=document.nodeName='DOCUMENT';window.nodeType=document.nodeType=1}(function(){if(typeof jQuery!="undefined")var _jQuery=jQuery;var jQuery=window.jQuery=function(selector,context){return this instanceof jQuery?this.init(selector,context):new jQuery(selector,context)};if(typeof $!="undefined")var _$=$;window.$=jQuery;var quickExpr=/^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/;jQuery.flash=function(name){return((window.document[name])||((document.embeds&&document.embeds[name])?document.embeds[name]:document.getElementById(name)))};jQuery.fn=jQuery.prototype={init:function(selector,context){selector=selector||document;if(typeof selector=="string"){var m=quickExpr.exec(selector);if(m&&(m[1]||!context)){if(m[1])selector=jQuery.clean([m[1]],context);else{var tmp=document.getElementById(m[3]);if(tmp)if(tmp.id!=m[3])return jQuery().find(selector);else{this[0]=tmp;this.length=1;return this}else selector=[]}}else return new jQuery(context).find(selector)}else if(jQuery.isFunction(selector))return new jQuery(document)[jQuery.fn.ready?"ready":"load"](selector);return this.setArray(selector.constructor==Array&&selector||(selector.jquery||selector.length&&selector!=window&&!selector.nodeType&&selector[0]!=undefined&&selector[0].nodeType)&&jQuery.makeArray(selector)||[selector])},jquery:"1.2.1",size:function(){return this.length},length:0,get:function(num){return num==undefined?jQuery.makeArray(this):this[num]},pushStack:function(a){var ret=jQuery(a);ret.prevObject=this;return ret},setArray:function(a){this.length=0;Array.prototype.push.apply(this,a);return this},each:function(fn,args){return jQuery.each(this,fn,args)},index:function(obj){var pos=-1;this.each(function(i){if(this==obj)pos=i});return pos},attr:function(key,value,type){var obj=key;if(key.constructor==String)if(value==undefined)return this.length&&jQuery[type||"attr"](this[0],key)||undefined;else{obj={};obj[key]=value}return this.each(function(index){for(var prop in obj)jQuery.attr(type?this.style:this,prop,jQuery.prop(this,obj[prop],type,index,prop))})},css:function(key,value){return this.attr(key,value,"curCSS")},text:function(e){if(typeof e!="object"&&e!=null)return this.empty().append(document.createTextNode(e));var t="";jQuery.each(e||this,function(){jQuery.each(this.childNodes,function(){if(this.nodeType!=8)t+=this.nodeType!=1?this.nodeValue:jQuery.fn.text([this])})});return t},wrapAll:function(html){if(this[0])jQuery(html,this[0].ownerDocument).clone().insertBefore(this[0]).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,1,function(a){this.appendChild(a)})},prepend:function(){return this.domManip(arguments,true,-1,function(a){this.insertBefore(a,this.firstChild)})},before:function(){return this.domManip(arguments,false,1,function(a){this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,false,-1,function(a){this.parentNode.insertBefore(a,this.nextSibling)})},end:function(){return this.prevObject||jQuery([])},find:function(t){if(t&&t.append)return t;var data=jQuery.map(this,function(a){return jQuery.find(t,a)});return this.pushStack(/[^+>] [^+>]/.test(t)||t.indexOf("..")>-1?jQuery.unique(data):data)},clone:function(events){var ret=this.map(function(){return this.outerHTML?jQuery(this.outerHTML)[0]:this.cloneNode(true)});var clone=ret.find("*").andSelf().each(function(){if(this[expando]!=undefined)this[expando]=null});if(events===true)this.find("*").andSelf().each(function(i){var events=jQuery.data(this,"events");for(var type in events)for(var handler in events[type])jQuery.event.add(clone[i],type,events[type][handler],events[type][handler].data)});return ret},filter:function(t){return this.pushStack(jQuery.isFunction(t)&&jQuery.grep(this,function(el,index){return t.apply(el,[index])})||jQuery.multiFilter(t,this))},not:function(t){return this.pushStack(t.constructor==String&&jQuery.multiFilter(t,this,true)||jQuery.grep(this,function(a){return(t.constructor==Array||t.jquery)?jQuery.inArray(a,t)<0:a!=t}))},add:function(t){return this.pushStack(jQuery.merge(this.get(),t.constructor==String?jQuery(t).get():t.length!=undefined&&(!t.nodeName||jQuery.nodeName(t,"form"))?t:[t]))},is:function(expr){return expr?jQuery.multiFilter(expr,this).length>0:false},hasClass:function(expr){return this.is("."+expr)},val:function(val){if(val==undefined){if(this.length){var elem=this[0];if(jQuery.nodeName(elem,"select")){var index=elem.selectedIndex,a=[],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){var val=jQuery.browser.msie&&!option.attributes["value"].specified?option.text:option.value;if(one)return val;a.push(val)}}return a}else return this[0].value.replace(/\r/g,"")}}else return this.each(function(){if(val.constructor==Array&&/radio|checkbox/.test(this.type))this.checked=(jQuery.inArray(this.value,val)>=0||jQuery.inArray(this.name,val)>=0);else if(jQuery.nodeName(this,"select")){var tmp=val.constructor==Array?val:[val];jQuery("option",this).each(function(){this.selected=(jQuery.inArray(this.value,tmp)>=0||jQuery.inArray(this.text,tmp)>=0)});if(!tmp.length)this.selectedIndex=-1}else this.value=val})},html:function(val){return val==undefined?(this.length?this[0].innerHTML:null):this.empty().append(val)},replaceWith:function(val){return this.after(val).remove()},eq:function(i){return this.slice(i,i+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments))},map:function(fn){return this.pushStack(jQuery.map(this,function(elem,i){return fn.call(elem,i,elem)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(args,table,dir,fn){var clone=this.length>1,a;return this.each(function(){if(!a){a=jQuery.clean(args,this.ownerDocument);if(dir<0)a.reverse()}var obj=this;if(table&&jQuery.nodeName(this,"table")&&jQuery.nodeName(a[0],"tr"))obj=this.getElementsByTagName("tbody")[0]||this.appendChild(document.createElement("tbody"));jQuery.each(a,function(){var elem=clone?this.cloneNode(true):this;if(!evalScript(0,elem))fn.call(obj,elem)})})}};function evalScript(i,elem){var script=jQuery.nodeName(elem,"script");if(script){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)}else if(elem.nodeType==1)jQuery("script",elem).each(evalScript);return script}jQuery.extend=jQuery.fn.extend=function(){var target=arguments[0]||{},a=1,al=arguments.length,deep=false;if(target.constructor==Boolean){deep=target;target=arguments[1]||{}}if(al==1){target=this;a=0}var prop;for(;a<al;a++)if((prop=arguments[a])!=null)for(var i in prop){if(target==prop[i])continue;if(deep&&typeof prop[i]=='object'&&target[i])jQuery.extend(target[i],prop[i]);else if(prop[i]!=undefined)target[i]=prop[i]}return target};var expando="jQuery"+(new Date()).getTime(),uuid=0,win={};jQuery.extend({noConflict:function(deep){window.$=_$;if(deep)window.jQuery=_jQuery;return jQuery},isFunction:function(fn){return!!fn&&typeof fn!="string"&&!fn.nodeName&&fn.constructor!=Array&&/function/i.test(fn+"")},isXMLDoc:function(elem){return elem.documentElement&&!elem.body||elem.tagName&&elem.ownerDocument&&!elem.ownerDocument.body},globalEval:function(data){data=jQuery.trim(data);if(data){if(window.execScript)window.execScript(data);else if(jQuery.browser.safari)window.setTimeout(data,0);else eval.call(window,data)}},nodeName:function(elem,name){return elem.nodeName&&elem.nodeName.toUpperCase()==name.toUpperCase()},cache:{},data:function(elem,name,data){elem=elem==window?win: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?win: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]}},each:function(obj,fn,args){if(args){if(obj.length==undefined)for(var i in obj)fn.apply(obj[i],args);else for(var i=0,ol=obj.length;i<ol;i++)if(fn.apply(obj[i],args)===false)break}else{if(obj.length==undefined)for(var i in obj)fn.call(obj[i],i,obj[i]);else for(var i=0,ol=obj.length,val=obj[0];i<ol&&fn.call(val,i,val)!==false;val=obj[++i]){}}return obj},prop:function(elem,value,type,index,prop){if(jQuery.isFunction(value))value=value.call(elem,[index]);var exclude=/z-?index|font-?weight|opacity|zoom|line-?height/i;return value&&value.constructor==Number&&type=="curCSS"&&!exclude.test(prop)?value+"px":value},className:{add:function(elem,c){jQuery.each((c||"").split(/\s+/),function(i,cur){if(!jQuery.className.has(elem.className,cur))elem.className+=(elem.className?" ":"")+cur})},remove:function(elem,c){elem.className=c!=undefined?jQuery.grep(elem.className.split(/\s+/),function(cur){return!jQuery.className.has(c,cur)}).join(" "):""},has:function(t,c){return jQuery.inArray(c,(t.className||t).toString().split(/\s+/))>-1}},swap:function(e,o,f){for(var i in o){e.style["old"+i]=e.style[i];e.style[i]=o[i]}f.apply(e,[]);for(var i in o)e.style[i]=e.style["old"+i]},css:function(e,p){if(p=="height"||p=="width"){var old={},oHeight,oWidth,d=["Top","Bottom","Right","Left"];jQuery.each(d,function(){old["padding"+this]=0;old["border"+this+"Width"]=0});jQuery.swap(e,old,function(){if(jQuery(e).is(':visible')){oHeight=e.offsetHeight;oWidth=e.offsetWidth}else{e=jQuery(e.cloneNode(true)).find(":radio").removeAttr("checked").end().css({visibility:"hidden",position:"absolute",display:"block",right:"0",left:"0"}).appendTo(e.parentNode)[0];var parPos=jQuery.css(e.parentNode,"position")||"static";if(parPos=="static")e.parentNode.style.position="relative";oHeight=e.clientHeight;oWidth=e.clientWidth;if(parPos=="static")e.parentNode.style.position="static";e.parentNode.removeChild(e)}});return p=="height"?oHeight:oWidth}return jQuery.curCSS(e,p)},curCSS:function(elem,prop,force){var ret,stack=[],swap=[];function color(a){if(!jQuery.browser.safari)return false;var ret=document.defaultView.getComputedStyle(a,null);return!ret||ret.getPropertyValue("color")==""}if(prop=="opacity"&&jQuery.browser.msie){ret=jQuery.attr(elem.style,"opacity");return ret==""?"1":ret}if(prop.match(/float/i))prop=styleFloat;if(!force&&elem.style[prop])ret=elem.style[prop];else if(document.defaultView&&document.defaultView.getComputedStyle){if(prop.match(/float/i))prop="float";prop=prop.replace(/([A-Z])/g,"-$1").toLowerCase();var cur=document.defaultView.getComputedStyle(elem,null);if(cur&&!color(elem))ret=cur.getPropertyValue(prop);else{for(var a=elem;a&&color(a);a=a.parentNode)stack.unshift(a);for(a=0;a<stack.length;a++)if(color(stack[a])){swap[a]=stack[a].style.display;stack[a].style.display="block"}ret=prop=="display"&&swap[stack.length-1]!=null?"none":document.defaultView.getComputedStyle(elem,null).getPropertyValue(prop)||"";for(a=0;a<swap.length;a++)if(swap[a]!=null)stack[a].style.display=swap[a]}if(prop=="opacity"&&ret=="")ret="1"}else if(elem.currentStyle){var newProp=prop.replace(/\-(\w)/g,function(m,c){return c.toUpperCase()});ret=elem.currentStyle[prop]||elem.currentStyle[newProp];if(!/^\d+(px)?$/i.test(ret)&&/^\d/.test(ret)){var style=elem.style.left;var runtimeStyle=elem.runtimeStyle.left;elem.runtimeStyle.left=elem.currentStyle.left;elem.style.left=ret||0;ret=elem.style.pixelLeft+"px";elem.style.left=style;elem.runtimeStyle.left=runtimeStyle}}return ret},clean:function(a,doc){var r=[];doc=doc||document;jQuery.each(a,function(i,arg){if(!arg)return;if(arg.constructor==Number)arg=arg.toString();if(typeof arg=="string"){arg=arg.replace(/(<(\w+)[^>]*?)\/>/g,function(m,all,tag){return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area)$/i)?m:all+"></"+tag+">"});var s=jQuery.trim(arg).toLowerCase(),div=doc.createElement("div"),tb=[];var wrap=!s.indexOf("<opt")&&[1,"<select>","</select>"]||!s.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||s.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!s.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!s.indexOf("<td")||!s.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!s.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||jQuery.browser.msie&&[1,"div<div>","</div>"]||[0,"",""];div.innerHTML=wrap[1]+arg+wrap[2];while(wrap[0]--)div=div.lastChild;if(jQuery.browser.msie){if(!s.indexOf("<table")&&s.indexOf("<tbody")<0)tb=div.firstChild&&div.firstChild.childNodes;else if(wrap[1]=="<table>"&&s.indexOf("<tbody")<0)tb=div.childNodes;for(var n=tb.length-1;n>=0;--n)if(jQuery.nodeName(tb[n],"tbody")&&!tb[n].childNodes.length)tb[n].parentNode.removeChild(tb[n]);if(/^\s/.test(arg))div.insertBefore(doc.createTextNode(arg.match(/^\s*/)[0]),div.firstChild)}arg=jQuery.makeArray(div.childNodes)}if(0===arg.length&&(!jQuery.nodeName(arg,"form")&&!jQuery.nodeName(arg,"select")))return;if(arg[0]==undefined||jQuery.nodeName(arg,"form")||arg.options)r.push(arg);else r=jQuery.merge(r,arg)});return r},attr:function(elem,name,value){var fix=jQuery.isXMLDoc(elem)?{}:jQuery.props;if(name=="selected"&&jQuery.browser.safari)elem.parentNode.selectedIndex;if(fix[name]){if(value!=undefined)elem[fix[name]]=value;return elem[fix[name]]}else if(jQuery.browser.msie&&name=="style")return jQuery.attr(elem.style,"cssText",value);else if(value==undefined&&jQuery.browser.msie&&jQuery.nodeName(elem,"form")&&(name=="action"||name=="method")){return elem.getAttributeNode?elem.getAttributeNode(name).nodeValue:elem[name]}else if(elem.tagName){if(value!=undefined){if(name=="type"&&jQuery.nodeName(elem,"input")&&elem.parentNode)throw"type property can't be changed";elem.setAttribute(name,value)}if(jQuery.browser.msie&&/href|src/.test(name)&&!jQuery.isXMLDoc(elem))return elem.getAttribute(name,2);return elem.getAttribute(name)}else{if(name=="opacity"&&jQuery.browser.msie){if(value!=undefined){elem.zoom=1;elem.filter=(elem.filter||"").replace(/alpha\([^)]*\)/,"")+(parseFloat(value).toString()=="NaN"?"":"alpha(opacity="+value*100+")")}return elem.filter?(parseFloat(elem.filter.match(/opacity=([^)]*)/)[1])/100).toString():""}name=name.replace(/-([a-z])/ig,function(z,b){return b.toUpperCase()});if(value!=undefined)elem[name]=value;return elem[name]}},trim:function(t){return(t||"").replace(/^\s+|\s+$/g,"")},makeArray:function(a){var r=[];if(typeof a!="array")for(var i=0,al=a.length;i<al;i++)r.push(a[i]);else r=a.slice(0);return r},inArray:function(b,a){for(var i=0,al=a.length;i<al;i++)if(a[i]==b)return i;return-1},merge:function(first,second){if(jQuery.browser.msie){for(var i=0;second[i];i++){if(second[i].nodeType!=8)first.push(second[i])}}else for(var i=0;second[i];i++)first.push(second[i]);return first},unique:function(first){var r=[],done={};try{for(var i=0,fl=first.length;i<fl;i++){var id=jQuery.data(first[i]);if(!done[id]){done[id]=true;r.push(first[i])}}}catch(e){r=first}return r},grep:function(elems,fn,inv){if(typeof fn=="string")fn=eval("false||function(a,i){return "+fn+"}");var result=[];for(var i=0,el=elems.length;i<el;i++)if(!inv&&fn(elems[i],i)||inv&&!fn(elems[i],i))result.push(elems[i]);return result},map:function(elems,fn){if(typeof fn=="string")fn=eval("false||function(a){return "+fn+"}");var result=[];for(var i=0,el=elems.length;i<el;i++){var val=fn(elems[i],i);if(val!==null&&val!=undefined){if(val.constructor!=Array)val=[val];result=result.concat(val)}}return result}});var userAgent=navigator.userAgent.toLowerCase();jQuery.browser={version:(userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[])[1],safari:/webkit/.test(userAgent),opera:/opera/.test(userAgent),msie:/msie/.test(userAgent)&&!/opera/.test(userAgent),mozilla:/mozilla/.test(userAgent)&&!/(compatible|webkit)/.test(userAgent)};var styleFloat=jQuery.browser.msie?"styleFloat":"cssFloat";jQuery.extend({boxModel:!jQuery.browser.msie||document.compatMode=="CSS1Compat",styleFloat:jQuery.browser.msie?"styleFloat":"cssFloat",props:{"for":"htmlFor","class":"className","float":styleFloat,cssFloat:styleFloat,styleFloat:styleFloat,innerHTML:"innerHTML",className:"className",value:"value",disabled:"disabled",checked:"checked",readonly:"readOnly",selected:"selected",maxlength:"maxLength"}});jQuery.each({parent:"a.parentNode",parents:"jQuery.dir(a,'parentNode')",next:"jQuery.nth(a,2,'nextSibling')",prev:"jQuery.nth(a,2,'previousSibling')",nextAll:"jQuery.dir(a,'nextSibling')",prevAll:"jQuery.dir(a,'previousSibling')",siblings:"jQuery.sibling(a.parentNode.firstChild,a)",children:"jQuery.sibling(a.firstChild)",contents:"jQuery.nodeName(a,'iframe')?a.contentDocument||a.contentWindow.document:jQuery.makeArray(a.childNodes)"},function(i,n){jQuery.fn[i]=function(a){var ret=jQuery.map(this,n);if(a&&typeof a=="string")ret=jQuery.multiFilter(a,ret);return this.pushStack(jQuery.unique(ret))}});jQuery.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(i,n){jQuery.fn[i]=function(){var a=arguments;return this.each(function(){for(var j=0,al=a.length;j<al;j++)jQuery(a[j])[n](this)})}});jQuery.each({removeAttr:function(key){jQuery.attr(this,key,"");this.removeAttribute(key)},addClass:function(c){jQuery.className.add(this,c)},removeClass:function(c){jQuery.className.remove(this,c)},toggleClass:function(c){jQuery.className[jQuery.className.has(this,c)?"remove":"add"](this,c)},remove:function(a){if(!a||jQuery.filter(a,[this]).r.length){jQuery.removeData(this);this.parentNode.removeChild(this)}},empty:function(){jQuery("*",this).each(function(){jQuery.removeData(this)});while(this.firstChild)this.removeChild(this.firstChild)}},function(i,n){jQuery.fn[i]=function(){return this.each(n,arguments)}});jQuery.each(["Height","Width"],function(i,name){var n=name.toLowerCase();jQuery.fn[n]=function(h){return this[0]==window?jQuery.browser.safari&&self["inner"+name]||jQuery.boxModel&&Math.max(document.documentElement["client"+name],document.body["client"+name])||document.body["client"+name]:this[0]==document?Math.max(document.body["scroll"+name],document.body["offset"+name]):h==undefined?(this.length?jQuery.css(this[0],n):null):this.css(n,h.constructor==String?h:h+"px")}});window.chars=jQuery.browser.safari&&parseInt(jQuery.browser.version)<417?"(?:[\\w*_-]|\\\\.)":"(?:[\\w\u0128-\uFFFF*_-]|\\\\.)",quickChild=new RegExp("^>\\s*("+chars+"+)"),quickID=new RegExp("^("+chars+"+)(#)("+chars+"+)"),quickClass=new RegExp("^([#.]?)("+chars+"*)");jQuery.extend({expr:{"":"m[2]=='*'||jQuery.nodeName(a,m[2])","#":"a.getAttribute('id')==m[2]",":":{lt:"i<m[3]-0",gt:"i>m[3]-0",nth:"m[3]-0==i",eq:"m[3]-0==i",first:"i==0",last:"i==r.length-1",even:"i%2==0",odd:"i%2","first-child":"a.parentNode.getElementsByTagName('*')[0]==a","last-child":"jQuery.nth(a.parentNode.lastChild,1,'previousSibling')==a","only-child":"!jQuery.nth(a.parentNode.lastChild,2,'previousSibling')",parent:"a.firstChild",empty:"!a.firstChild",contains:"(a.textContent||a.innerText||jQuery(a).text()||'').indexOf(m[3])>=0",visible:'"hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden"',hidden:'"hidden"==a.type||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden"',enabled:"!a.disabled",disabled:"a.disabled",checked:"a.checked",selected:"a.selected||jQuery.attr(a,'selected')",text:"'text'==a.type",radio:"'radio'==a.type",checkbox:"'checkbox'==a.type",file:"'file'==a.type",password:"'password'==a.type",submit:"'submit'==a.type",image:"'image'==a.type",reset:"'reset'==a.type",button:'"button"==a.type||jQuery.nodeName(a,"button")',input:"/input|select|textarea|button/i.test(a.nodeName)",has:"jQuery.find(m[3],a).length",header:"/h\\d/i.test(a.nodeName)",animated:"jQuery.grep(jQuery.timers,function(fn){return a==fn.elem;}).length"}},parse:[/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,/^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,new RegExp("^([:.#]*)("+chars+"+)")],multiFilter:function(expr,elems,not){var old,cur=[];while(expr&&expr!=old){old=expr;var f=jQuery.filter(expr,elems,not);expr=f.t.replace(/^\s*,\s*/,"");cur=not?elems=f.r:jQuery.merge(cur,f.r)}return cur},find:function(t,context){if(typeof t!="string")return[t];if(context&&!context.nodeType)context=null;context=context||document;var ret=[context],done=[],last;while(t&&last!=t){var r=[];last=t;t=jQuery.trim(t);var foundToken=false;var re=quickChild;var m=re.exec(t);if(m){var nodeName=m[1].toUpperCase();for(var i=0;ret[i];i++)for(var c=ret[i].firstChild;c;c=c.nextSibling)if(c.nodeType==1&&(nodeName=="*"||c.nodeName.toUpperCase()==nodeName.toUpperCase()))r.push(c);ret=r;t=t.replace(re,"");if(t.indexOf(" ")==0)continue;foundToken=true}else{re=/^([>+~])\s*(\w*)/i;if((m=re.exec(t))!=null){r=[];var nodeName=m[2],merge={};m=m[1];for(var j=0,rl=ret.length;j<rl;j++){var n=m=="~"||m=="+"?ret[j].nextSibling:ret[j].firstChild;for(;n;n=n.nextSibling)if(n.nodeType==1){var id=jQuery.data(n);if(m=="~"&&merge[id])break;if(!nodeName||n.nodeName.toUpperCase()==nodeName.toUpperCase()){if(m=="~")merge[id]=true;r.push(n)}if(m=="+")break}}ret=r;t=jQuery.trim(t.replace(re,""));foundToken=true}}if(t&&!foundToken){if(!t.indexOf(",")){if(context==ret[0])ret.shift();done=jQuery.merge(done,ret);r=ret=[context];t=" "+t.substr(1,t.length)}else{var re2=quickID;var m=re2.exec(t);if(m){m=[0,m[2],m[3],m[1]]}else{re2=quickClass;m=re2.exec(t)}m[2]=m[2].replace(/\\/g,"");var elem=ret[ret.length-1];if(m[1]=="#"&&elem&&elem.getElementById&&!jQuery.isXMLDoc(elem)){var oid=elem.getElementById(m[2]);if((jQuery.browser.msie||jQuery.browser.opera)&&oid&&typeof oid.id=="string"&&oid.id!=m[2])oid=jQuery('[@id="'+m[2]+'"]',elem)[0];ret=r=oid&&(!m[3]||jQuery.nodeName(oid,m[3]))?[oid]:[]}else{for(var i=0;ret[i];i++){var tag=m[1]=="#"&&m[3]?m[3]:m[1]!=""||m[0]==""?"*":m[2];if(tag=="*"&&(ret[i].nodeName).toLowerCase()=="object")tag="param";r=jQuery.merge(r,(tag=='*'&&ret[i].all)?ret[i].all:ret[i].getElementsByTagName(tag))}if(m[1]=="."){r=jQuery.classFilter(r,m[2])}if(m[1]=="#"){var tmp=[];for(var i=0;r[i];i++)if(r[i].getAttribute("id")==m[2]){tmp=[r[i]];break}r=tmp}ret=r}t=t.replace(re2,"")}}if(t){var val=jQuery.filter(t,r);ret=r=val.r;t=jQuery.trim(val.t)}}if(t)ret=[];if(ret&&context==ret[0])ret.shift();done=jQuery.merge(done,ret);return done},classFilter:function(r,m,not){m=" "+m+" ";var tmp=[];for(var i=0;r[i];i++){var pass=(" "+r[i].className+" ").indexOf(m)>=0;if(!not&&pass||not&&!pass)tmp.push(r[i])}return tmp},filter:function(t,r,not){var last;while(t&&t!=last){last=t;var p=jQuery.parse,m;for(var i=0;p[i];i++){m=p[i].exec(t);if(m){t=t.substring(m[0].length);m[2]=m[2].replace(/\\/g,"");break}}if(!m)break;if(m[1]==":"&&m[2]=="not")r=jQuery.filter(m[3],r,true).r;else if(m[1]==".")r=jQuery.classFilter(r,m[2],not);else if(m[1]=="["){var tmp=[],type=m[3];for(var i=0,rl=r.length;i<rl;i++){var a=r[i],z=a[jQuery.props[m[2]]||m[2]];if(z==null||/href|src|selected/.test(m[2]))z=jQuery.attr(a,m[2])||'';if((type==""&&!!z||type=="="&&z==m[5]||type=="!="&&z!=m[5]||type=="^="&&z&&!z.indexOf(m[5])||type=="$="&&z.substr(z.length-m[5].length)==m[5]||(type=="*="||type=="~=")&&z.indexOf(m[5])>=0)^not)tmp.push(a)}r=tmp}else if(m[1]==":"&&m[2]=="nth-child"){var merge={},tmp=[],test=/(\d*)n\+?(\d*)/.exec(m[3]=="even"&&"2n"||m[3]=="odd"&&"2n+1"||!/\D/.test(m[3])&&"n+"+m[3]||m[3]),first=(test[1]||1)-0,last=test[2]-0;for(var i=0,rl=r.length;i<rl;i++){var node=r[i],parentNode=node.parentNode,id=jQuery.data(parentNode);if(!merge[id]){var c=1;for(var n=parentNode.firstChild;n;n=n.nextSibling)if(n.nodeType==1)n.nodeIndex=c++;merge[id]=true}var add=false;if(first==1){if(last==0||node.nodeIndex==last)add=true}else if((node.nodeIndex+last)%first==0)add=true;if(add^not)tmp.push(node)}r=tmp}else{var f=jQuery.expr[m[1]];if(typeof f!="string")f=jQuery.expr[m[1]][m[2]];f=eval("false||function(a,i){return "+f+"}");r=jQuery.grep(r,f,not)}}return{r:r,t:t}},dir:function(elem,dir){var matched=[];var cur=elem[dir];while(cur&&cur!=document){if(cur.nodeType==1)matched.push(cur);cur=cur[dir]}return matched},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},sibling:function(n,elem){var r=[];for(;n;n=n.nextSibling){if(n.nodeType==1&&(!elem||n!=elem))r.push(n)}return r}});jQuery.event={fixType:function(t){if((t=String(t).toLowerCase())&&(t=='mousewheel')||(t=='dommousescroll')){t=$B.msie?'mousewheel':'DOMMouseScroll'}return t},add:function(element,type,handler,data){type=this.fixType(type);if(jQuery.browser.msie&&element.setInterval!=undefined)element=window;if(!handler.guid)handler.guid=this.guid++;if(data!=undefined){var fn=handler;handler=function(){return fn.apply(this,arguments)};handler.data=data;handler.guid=fn.guid}var parts=type.split(".");type=parts[0];handler.type=parts[1];var events=jQuery.data(element,"events")||jQuery.data(element,"events",{});var handle=jQuery.data(element,"handle",function(){var val;if(typeof jQuery=="undefined"||jQuery.event.triggered)return val;val=jQuery.event.handle.apply(element,arguments);return val});var handlers=events[type];if(!handlers){handlers=events[type]={};if(element.addEventListener)element.addEventListener(type,handle,false);else element.attachEvent("on"+type,handle)}handlers[handler.guid]=handler;this.global[type]=true},guid:1,global:{},remove:function(element,type,handler){var events=jQuery.data(element,"events"),ret,index;type=this.fixType(type);if(typeof type=="string"){var parts=type.split(".");type=parts[0]}if(events){if(type&&type.type){handler=type.handler;type=type.type}if(!type){for(type in events)this.remove(element,type)}else if(events[type]){if(handler)delete events[type][handler.guid];else for(handler in events[type])if(!parts[1]||events[type][handler].type==parts[1])delete events[type][handler];for(ret in events[type])break;if(!ret){if(element.removeEventListener)element.removeEventListener(type,jQuery.data(element,"handle"),false);else element.detachEvent("on"+type,jQuery.data(element,"handle"));ret=null;delete events[type]}}for(ret in events)break;if(!ret){jQuery.removeData(element,"events");jQuery.removeData(element,"handle")}}},trigger:function(type,data,element,donative,extra){data=jQuery.makeArray(data||[]);if(!element){if(this.global[type])jQuery("*").add([window,document]).trigger(type,data)}else{var val,ret,fn=jQuery.isFunction(element[type]||null),evt=!data[0]||!data[0].preventDefault;if(evt)data.unshift(this.fix({type:type,target:element}));data[0].type=type;if(jQuery.isFunction(jQuery.data(element,"handle")))val=jQuery.data(element,"handle").apply(element,data);if(!fn&&element["on"+type]&&element["on"+type].apply(element,data)===false)val=false;if(evt)data.shift();if(extra&&extra.apply(element,data)===false)val=false;if(fn&&donative!==false&&val!==false&&!(jQuery.nodeName(element,'a')&&type=="click")){this.triggered=true;element[type]()}this.triggered=false}return val},handle:function(event){var val;event=jQuery.event.fix(event||window.event||{});var parts=event.type.split(".");event.type=parts[0];var c=jQuery.data(this,"events")&&jQuery.data(this,"events")[event.type],args=Array.prototype.slice.call(arguments,1);args.unshift(event);for(var j in c){args[0].handler=c[j];args[0].data=c[j].data;if(!parts[1]||c[j].type==parts[1]){var tmp=c[j].apply(this,args);if(val!==false)val=tmp;if(tmp===false){event.preventDefault();event.stopPropagation()}}}if(jQuery.browser.msie)event.target=event.preventDefault=event.stopPropagation=event.handler=event.data=null;return val},fix:function(event){var originalEvent=event;event=$clone(originalEvent);event.preventDefault=function(){if(originalEvent.preventDefault)originalEvent.preventDefault();originalEvent.returnValue=false};event.stopPropagation=function(){if(originalEvent.stopPropagation)originalEvent.stopPropagation();originalEvent.cancelBubble=true};if(!event.target&&event.srcElement)event.target=event.srcElement;if(jQuery.browser.safari&&event.target.nodeType==3)event.target=originalEvent.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 e=document.documentElement,b=document.body;event.pageX=event.clientX+(e&&e.scrollLeft||b.scrollLeft||0);event.pageY=event.clientY+(e&&e.scrollTop||b.scrollTop||0)}if(!event.which&&(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}};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){return this.each(function(){jQuery.event.add(this,type,function(event){jQuery(this).unbind(event);return(fn||data).apply(this,arguments)},fn&&data)})},unbind:function(type,fn){return this.each(function(){jQuery.event.remove(this,type,fn)})},trigger:function(type,data,fn){return this.each(function(){jQuery.event.trigger(type,data,this,true,fn)})},triggerHandler:function(type,data,fn){if(this[0])jQuery.event.trigger(type,data,this[0],false,fn);return this},toggle:function(){var a=arguments;return this.click(function(e){this.lastToggle=0==this.lastToggle?1:0;e.preventDefault();return a[this.lastToggle].apply(this,[e])||false})},hover:function(f,g){function handleHover(e){var p=e.relatedTarget;while(p&&p!=this)try{p=p.parentNode}catch(e){p=this};if(p==this)return false;return(e.type=="mouseover"?f:g).apply(this,[e])}return this.mouseover(handleHover).mouseout(handleHover)},ready:function(f){bindReady();if(jQuery.isReady)f.apply(document,[jQuery]);else jQuery.readyList.push(function(){return f.apply(this,[jQuery])});return this}});jQuery.extend({isReady:false,readyList:[],ready:function(){if(!jQuery.isReady){jQuery.isReady=true;if(jQuery.readyList){jQuery.each(jQuery.readyList,function(){this.apply(document)});jQuery.readyList=null}if(jQuery.browser.mozilla||jQuery.browser.opera)document.removeEventListener("DOMContentLoaded",jQuery.ready,false);if(!window.frames.length)jQuery(window).load(function(){jQuery("#__ie_init").remove()})}}});jQuery.each(("blur,focus,load,resize,scroll,unload,click,dblclick,"+"mousedown,mouseup,mousemove,mouseover,mouseout,mousewheel,"+"change,select,submit,keydown,keypress,keyup,error").split(","),function(i,o){jQuery.fn[o]=function(f){return f?this.bind(o,f):this.trigger(o)}});var readyBound=false;function bindReady(){if(readyBound)return;readyBound=true;if(jQuery.browser.mozilla||jQuery.browser.opera)document.addEventListener("DOMContentLoaded",jQuery.ready,false);else if(jQuery.browser.msie){document.write("<scr"+"ipt id=__ie_init defer=true "+"src=//:><\/script>");var script=document.getElementById("__ie_init");if(script)script.onreadystatechange=function(){if(this.readyState!="complete")return;jQuery.ready()};script=null}else if(jQuery.browser.safari)jQuery.safariTimer=setInterval(function(){if(document.readyState=="loaded"||document.readyState=="complete"){clearInterval(jQuery.safariTimer);jQuery.safariTimer=null;jQuery.ready()}},10);jQuery.event.add(window,"load",jQuery.ready)}jQuery.fn.extend({load:function(url,params,callback){if(jQuery.isFunction(url))return this.bind("load",url);var off=url.indexOf(" ");if(off>=0){var selector=url.slice(off,url.length);url=url.slice(0,off)}callback=callback||function(){};var type="GET";if(params)if(jQuery.isFunction(params)){callback=params;params=null}else{params=jQuery.param(params);type="POST"}var self=this;jQuery.ajax({url:url,type:type,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);setTimeout(function(){self.each(callback,[res.responseText,status,res])},13)}});return this},serialize:function(){return jQuery.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return jQuery.nodeName(this,"form")?jQuery.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type))}).map(function(i,elem){var val=jQuery(this).val();return val==null?null:val.constructor==Array?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=(new Date).getTime();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:{global:true,type:"GET",timeout:0,contentType:"application/x-www-form-urlencoded",processData:true,async:true,data:null},lastModified:{},ajax:function(s){var jsonp,jsre=/=(\?|%3F)/g,status,data;s=jQuery.extend(true,s,jQuery.extend(true,{},jQuery.ajaxSettings,s));if(s.data&&s.processData&&typeof s.data!="string")s.data=jQuery.param(s.data);if(s.dataType=="jsonp"){if(s.type.toLowerCase()=="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);s.url=s.url.replace(jsre,"="+jsonp);s.dataType="script";window[jsonp]=function(tmp){data=tmp;success();complete();window[jsonp]=undefined;try{delete window[jsonp]}catch(e){}}}if(s.dataType=="script"&&s.cache==null)s.cache=false;if(s.cache===false&&s.type.toLowerCase()=="get")s.url+=(s.url.match(/\?/)?"&":"?")+"_="+(new Date()).getTime();if(s.data&&s.type.toLowerCase()=="get"){s.url+=(s.url.match(/\?/)?"&":"?")+s.data;s.data=null}if(debug.enabled)debug.log('<b style="color: #000">'+s.type+': '+s.url+'</b> | '+decodeURIComponent(s.data));if(s.global&&!jQuery.active++)jQuery.event.trigger("ajaxStart");if(!s.url.indexOf("http")&&s.dataType=="script"){var head=document.getElementsByTagName("head")[0];var script=document.createElement("script");script.src=s.url;if(!jsonp&&(s.success||s.complete)){var done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){done=true;success();complete();head.removeChild(script)}}}head.appendChild(script);return}var requestDone=false;var xml=window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();xml.open(s.type,s.url,s.async);if(s.data)xml.setRequestHeader("Content-Type",s.contentType);if(s.ifModified)xml.setRequestHeader("If-Modified-Since",jQuery.lastModified[s.url]||"Thu, 01 Jan 1970 00:00:00 GMT");xml.setRequestHeader("X-Requested-With","XMLHttpRequest");if(s.beforeSend)s.beforeSend(xml);if(s.global)jQuery.event.trigger("ajaxSend",[xml,s]);var onreadystatechange=function(isTimeout){if(!requestDone&&xml&&(xml.readyState==4||isTimeout=="timeout")){requestDone=true;if(ival){clearInterval(ival);ival=null}status=isTimeout=="timeout"&&"timeout"||!jQuery.httpSuccess(xml)&&"error"||s.ifModified&&jQuery.httpNotModified(xml,s.url)&&"notmodified"||"success";xml=(jQuery.ajaxResult||jsCore.F)(xml,status,s.dataType);if(status=="success"){try{data=jQuery.httpData(xml,s.dataType)}catch(e){status="parsererror"}}if(status=="success"){var modRes;try{modRes=xml.getResponseHeader("Last-Modified")}catch(e){}if(s.ifModified&&modRes)jQuery.lastModified[s.url]=modRes;if(!jsonp)success()}else jQuery.handleError(s,xml,status);complete();if(s.async)xml=null}};if(s.async){var ival=setInterval(onreadystatechange,13);if(s.timeout>0)setTimeout(function(){if(xml){xml.abort();if(!requestDone)onreadystatechange("timeout")}},s.timeout)}try{xml.send(s.data)}catch(e){jQuery.handleError(s,xml,null,e)}if(!s.async)onreadystatechange();return xml;function success(){if(s.success)s.success(data,status);if(s.global)jQuery.event.trigger("ajaxSuccess",[xml,s])}function complete(){if(s.complete)s.complete(xml,status);if(s.global)jQuery.event.trigger("ajaxComplete",[xml,s]);if(s.global&&!--jQuery.active)jQuery.event.trigger("ajaxStop")}},handleError:function(s,xml,status,e){if(s.error)s.error(xml,status,e);if(s.global)jQuery.event.trigger("ajaxError",[xml,s,e])},active:0,httpSuccess:function(r){try{return!r.status&&location.protocol=="file:"||(r.status>=200&&r.status<300)||r.status==304||jQuery.browser.safari&&r.status==undefined}catch(e){}return false},httpNotModified:function(xml,url){try{var xmlRes=xml.getResponseHeader("Last-Modified");return xml.status==304||xmlRes==jQuery.lastModified[url]||jQuery.browser.safari&&xml.status==undefined}catch(e){}return false},httpData:function(r,type){if(r.__xhr__)return r;var ct=r.getResponseHeader("content-type");var xml=type=="xml"||!type&&ct&&ct.indexOf("xml")>=0;var data=xml?r.responseXML:r.responseText;if(xml&&data.documentElement.tagName=="parsererror")throw"parsererror";if(type=="script")jQuery.globalEval(data);if(type=="json")data=eval("("+data+")");return data},param:function(a){var s=[];if(a.constructor==Array||a.jquery)jQuery.each(a,function(){s.push(encodeURIComponent(this.name)+"="+encodeURIComponent(this.value))});else for(var j in a)if(a[j]&&a[j].constructor==Array)jQuery.each(a[j],function(){s.push(encodeURIComponent(j)+"="+encodeURIComponent(this))});else s.push(encodeURIComponent(j)+"="+encodeURIComponent(a[j]));return s.join("&").replace(/%20/g,"+")}});jQuery.fn.extend({show:function(speed,callback){if(this.__v==1)return this;this.__v=1;if(speed==-1){for(var i=0;this[i];i++)this[i].style.display='';return this}return speed?this.animate({height:"show",width:"show",opacity:"show"},speed,callback):this.filter(":hidden").each(function(){this.style.display=this.oldblock?this.oldblock:"";if(jQuery.css(this,"display")=="none")this.style.display="block"}).end()},hide:function(speed,callback){if(this.__v==2)return this;this.__v=2;if(speed==-1){for(var i=0;this[i];i++)this[i].style.display='none';return this}return speed?this.animate({height:"hide",width:"hide",opacity:"hide"},speed,callback):this.filter(":visible").each(function(){this.oldblock=this.oldblock||jQuery.css(this,"display");if(this.oldblock=="none")this.oldblock="block";this.style.display="none"}).end()},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2){return jQuery.isFunction(fn)&&jQuery.isFunction(fn2)?this._toggle(fn,fn2):fn?this.animate({height:"toggle",width:"toggle",opacity:"toggle"},fn,fn2):this.each(function(){jQuery(this)[jQuery(this).is(":hidden")?"show":"hide"]()})},slideDown:function(speed,callback){return this.animate({height:"show"},speed,callback)},slideUp:function(speed,callback){return this.animate({height:"hide"},speed,callback)},slideToggle:function(speed,callback){return this.animate({height:"toggle"},speed,callback)},fadeIn:function(speed,callback){return this.animate({opacity:"show"},speed,callback)},fadeOut:function(speed,callback){return this.animate({opacity:"hide"},speed,callback)},fadeTo:function(speed,to,callback){return this.animate({opacity:to},speed,callback)},animate:function(prop,speed,easing,callback){var opt=jQuery.speed(speed,easing,callback);return this[opt.queue===false?"each":"queue"](function(){opt=jQuery.extend({},opt);var hidden=jQuery(this).is(":hidden"),self=this;for(var p in prop){if(prop[p]=="hide"&&hidden||prop[p]=="show"&&!hidden)return jQuery.isFunction(opt.complete)&&opt.complete.apply(this);if(p=="height"||p=="width"){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})},queue:function(type,fn){if(jQuery.isFunction(type)){fn=type;type="fx"}if(!type||(typeof type=="string"&&!fn))return queue(this[0],type);return this.each(function(){if(fn.constructor==Array)queue(this,type,fn);else{queue(this,type).push(fn);if(queue(this,type).length==1)fn.apply(this)}})},stop:function(){var timers=jQuery.timers;return this.each(function(){for(var i=0;i<timers.length;i++)if(timers[i].elem==this)timers.splice(i--,1)}).dequeue()}});var queue=function(elem,type,array){if(!elem)return;var q=jQuery.data(elem,type+"queue");if(!q||array)q=jQuery.data(elem,type+"queue",array?jQuery.makeArray(array):[]);return q};jQuery.fn.dequeue=function(type){type=type||"fx";return this.each(function(){var q=queue(this,type);q.shift();if(q.length)q[0].apply(this)})};jQuery.extend({speed:function(speed,easing,fn){var opt=speed&&speed.constructor==Object?speed:{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&easing.constructor!=Function&&easing};opt.duration=(opt.duration&&opt.duration.constructor==Number?opt.duration:{slow:600,fast:200}[opt.duration])||400;opt.old=opt.complete;opt.complete=function(){jQuery(this).dequeue();if(jQuery.isFunction(opt.old))opt.old.apply(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.apply(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.display="block"},cur:function(force){if(this.elem[this.prop]!=null&&this.elem.style[this.prop]==null)return this.elem[this.prop];var r=parseFloat(jQuery.curCSS(this.elem,this.prop,force));return r&&r>-10000?r:parseFloat(jQuery.css(this.elem,this.prop))||0},custom:function(from,to,unit){this.startTime=(new Date()).getTime();this.start=from;this.end=to;this.unit=unit||this.unit||"px";this.now=this.start;this.pos=this.state=0;this.update();var self=this;function t(){return self.step()}t.elem=this.elem;jQuery.timers.push(t);if(jQuery.timers.length==1){var timer=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(timer)},13)}},show:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.show=true;this.custom(0,this.cur());if(this.prop=="width"||this.prop=="height")this.elem.style[this.prop]="1px";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(){var t=(new Date()).getTime();if(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)this.elem.style.display="none";if(this.options.hide||this.options.show)for(var p in this.options.curAnim)jQuery.attr(this.elem.style,p,this.options.orig[p])}if(done&&jQuery.isFunction(this.options.complete))this.options.complete.apply(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.fx.step={scrollLeft:function(fx){fx.elem.scrollLeft=fx.now},scrollTop:function(fx){fx.elem.scrollTop=fx.now},opacity:function(fx){jQuery.attr(fx.elem.style,"opacity",fx.now)},_default:function(fx){fx.elem.style[fx.prop]=fx.now+fx.unit}};$E(jQuery.fn,{innerHeight:function(){return this[0]==window||this[0]==document?this.height():this.css('display')!='none'?this[0].offsetHeight-(parseInt(this.css("borderTopWidth"))||0)-(parseInt(this.css("borderBottomWidth"))||0):this.height()+(parseInt(this.css("paddingTop"))||0)+(parseInt(this.css("paddingBottom"))||0)},innerWidth:function(){return this[0]==window||this[0]==document?this.width():this.css('display')!='none'?this[0].offsetWidth-(parseInt(this.css("borderLeftWidth"))||0)-(parseInt(this.css("borderRightWidth"))||0):this.height()+(parseInt(this.css("paddingLeft"))||0)+(parseInt(this.css("paddingRight"))||0)},outerHeight:function(){return this[0]==window||this[0]==document?this.height():this.css('display')!='none'?this[0].offsetHeight:this.height()+(parseInt(this.css("borderTopWidth"))||0)+(parseInt(this.css("borderBottomWidth"))||0)+(parseInt(this.css("paddingTop"))||0)+(parseInt(this.css("paddingBottom"))||0)},outerWidth:function(maring){return this[0]==window||this[0]==document?this.width():(this.css('display')!='none'?this[0].offsetWidth:this.height()+(parseInt(this.css("borderLeftWidth"))||0)+(parseInt(this.css("borderRightWidth"))||0)+(parseInt(this.css("paddingLeft"))||0)+(parseInt(this.css("paddingRight"))||0))+(maring?(parseInt(this.css("marginLeft"))||0)+(parseInt(this.css("marginRight"))||0):0)},scrollLeft:function(){if(this[0]==window||this[0]==document)return self.pageXOffset||jQuery.boxModel&&document.documentElement.scrollLeft||document.body.scrollLeft;return this[0].scrollLeft},scrollTop:function(){if(this[0]==window||this[0]==document)return self.pageYOffset||jQuery.boxModel&&document.documentElement.scrollTop||document.body.scrollTop;return this[0].scrollTop}});jQuery.fn.offset=function(o){var left=0,top=0,elem=this[0],results,pos='',o=o||{local:0},lLeft=0,lTop=0,local=o.local,sLeft=0,sTop=0,scroll=o.scroll;if(elem)with(jQuery.browser){var absolute=jQuery.css(elem,"position")=="absolute",parent=elem.parentNode,offsetParent=elem.offsetParent,doc=elem.ownerDocument,safari2=safari&&parseInt(version)<522;if(!local&&!scroll&&elem.getBoundingClientRect){box=elem.getBoundingClientRect();add(box.left+Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),box.top+Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));if(msie){var border=jQuery("html").css("borderWidth");border=(border=="medium"||jQuery.boxModel&&parseInt(version)>=7)&&2||border;add(-border,-border)}}else{add(elem.offsetLeft,elem.offsetTop);while(offsetParent){if(o.local&&((pos=jQuery.css(offsetParent,'position'))=='absolute'||pos=='relative'||pos=='fixed')){o.local=0;lLeft=left;lTop=top}add(offsetParent.offsetLeft,offsetParent.offsetTop);if(mozilla&&/^t[d|h]$/i.test(parent.tagName)||!safari2)border(offsetParent);if(safari2&&!absolute&&jQuery.css(offsetParent,"position")=="absolute")absolute=true;offsetParent=offsetParent.offsetParent}while(parent.tagName&&!/^body|html$/i.test(parent.tagName)){if(!/^inline|table-row.*$/i.test(jQuery.css(parent,"display"))){add(-parent.scrollLeft,-parent.scrollTop);sTop+=parseInt(parent.scrollTop);sLeft+=parseInt(parent.scrollLeft)}if(mozilla&&jQuery.css(parent,"overflow")!="visible")border(parent);parent=parent.parentNode}if(safari2&&absolute)add(-doc.body.offsetLeft,-doc.body.offsetTop)}results={top:top,left:left};if(local){results.lTop=lTop;results.lLeft=lLeft}if(scroll){results.sTop=sTop;results.sLeft=sLeft}}return results;function border(elem){add(jQuery.css(elem,"borderLeftWidth"),jQuery.css(elem,"borderTopWidth"))}function add(l,t){left+=parseInt(l)||0;top+=parseInt(t)||0}}})();var $WIN=jQuery(window),$DOC=jQuery(document),$HEAD=jQuery('HEAD'),$BODY=jQuery('BODY')};;
jsLoader.loaded('{jQuery}jquery');


/**
 * @object		jsFix
 * @author		"RubaXa"		<trash@rubaxa.org>
 */
var jsFix={pixel:'{img.pixel}1.gif',ready:function(){this.iPixel=jsLoader.getFileUrl(this.pixel)},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(e[i].getAttribute('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');


/**
 * Необходимые расширения для jQuery
 * @author	"RubaXa"		<trash@rubaxa.org>
 */
var PositionFixedStyleSheets=0;if($B.msie&&(!jQuery.boxModel||parseInt($B.version)<7)){var S=document.createElement('STYLE'),i=0,sS=document.styleSheets;S.setAttribute('type','text/css');HEAD.appendChild(S);for(;sS[i];i++){try{if(!document.location.href.indexOf(sS[i].href)!=-1){PositionFixedStyleSheets=sS[i];break}}catch(e){console.log('PositionFixed',e)}}}$E(jQuery.fn,{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)}}return this},fix:function(c){this.each(function(){jsFix.elm(this,c)});return this},_parents:jQuery.fn.parents,parents:function(r){if(typeof r=='string'){return this._parents(r)}else{var e=[],i=0,p=this[0];while(p&&(p=p.parentNode)&&(i++<r)&&(p!=document.body)){e.push(p)}return jQuery(e)}return this},item:function(i){return jQuery(this[i])},unselectable:function(offOn){if(defined(offOn)){this.each(function(){this.unselectable=offOn;var e=this.getElementsByTagName('*');for(var i=0;e[i];i++){e[i].unselectable=(this.unselectable?'On':'Off');e[i].style['-moz-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:function($T){$T=jQuery($T);if($T){if($T[0].firstChild&&$T[0].parentNode){$T[0].firstChild.parentNode.insertBefore(this[0],$T[0].firstChild)}else{$T.append(this)}}return this},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(this.checked){if(!data[this.name])data[this.name]=[];data[this.name].push(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(PositionFixedStyleSheets){var c=('p-fixed-'+x+'-'+y).replace(/%/g,'pr');if(!Registry.get('PositionFixedStyleSheets_'+c)){if((typeof(x)!='number')&&(x.indexOf('%')>0))x='document.body.clientWidth*'+(parseFloat(x)/100);if((typeof(y)!='number')&&(y.indexOf('%')>0))y='document.body.clientHeight*'+(parseFloat(y)/100);PositionFixedStyleSheets.addRule('.'+c,'position: absolute;'+"left: expression(eval(document.body.scrollLeft+"+x+") + 'px');"+"top: expression(eval(document.body.scrollTop+"+y+") + 'px');");Registry.put('PositionFixedStyleSheets_'+c,true)}this.removePositionFixed();this.each(function(){this.style.position='';this.style.left='';this.style.top='';this.className+=' '+c})}else{this.css({position:'fixed',left:x,top:y})}return this},removePositionFixed:function(){this.each(function(){this.className=this.className.replace(/\s+p-fixed([\d.,pr-]+)/gi,'');this.style.position=''});return this}});;
jsLoader.loaded('{jQuery}extensions');


/**
 * @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({'keyCode':HotKeys.getKeyCode(k),'metaKey':mK,'method':c,'stop':s,'$Elm':jQuery(e)});return this},getKeyCode:function(k){return jsEvent.Key[k]||k.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');


/**
 * @object	Window
 * @author	RubaXa	<trash@rubaxa.org>
 * @version	1.0
 */
var Window=0;window['jsWindow']=1;Window=window['jsWindow'];var wEvents='resize,scroll,blur,focus,unload,keydown,keyup,keypress,'+'sessionStorage,localStorage,globalStorage';wEvents=wEvents.split(',');var CWindow=jsClass.create().setMethods({__construct:function(){var This=this;this.Listeners={};jsCore.each(wEvents,function(i,n){This.Listeners[n]=function(e){jsWindow.dispatchEvent(n,e||window.Event)};jsEvent.add(n.indexOf('key')>-1?document.body:window,n,This.Listeners[n])});This=null},destroy:function(){var This=this;jsCore.each(wEvents,function(i,n){jsEvent.remove(n.indexOf('key')>-1?document.body:window,n,This.Listeners[n])});This=null;jsCore.destroy(This)},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'))}},getWidth:function(){window.width=window.innerWidth?window.innerWidth:(document.documentElement?(document.documentElement.clientWidth||document.body.clientWidth):0);return window.width},getHeight:function(){window.height=window.innerHeight?window.innerHeight:(document.documentElement?(document.documentElement.clientHeight||document.body.clientHeight):0);return window.height},focus:function(){this.dispatchEvent('focus');window.focus()},blur:function(){this.dispatchEvent('blur');window.blur()}});window['jsWindow']=new CWindow();jsCore.each('Left,Top,Width,Height'.split(','),function(i,p){var name='scroll'+p;window['jsWindow'][name]=function(){return document.body[name]}});Window=window['jsWindow'];;
jsLoader.loaded('{jsCore}Window');


window.jsPlugins=(new(jsClass.create().setMethods({__construct:function(){this.elms={}},processing:function(e){jQuery(e).find('.js-plugin').each(function(){this.className=this.className.replace('js-plugin','');jsPlugins.set(this,'plugin')})},set:function(e,name,o){if(!e)return this;if(e.append)e=e[0];if(typeof e=='string')e=$F(e);var uId=jsCore.getUniqId(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(jsLoader.isLoaded(require)||Klass){this.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?(e.append?e[0]:e):false);return(this.elms[uId]&&this.elms[uId][n])?this.elms[uId][n]:false}})));$E(jQuery.fn,{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)!=false)},processPlugins:function(){for(var i=0;this[i];i++)if(/js-plugin/.test(this[i].innerHTML))jsPlugins.processing(this);return this}});jsCore.ready(function(){});;
jsLoader.loaded('{plugins}jsPlugins');


/**
 * @class   LightBox
 * @author  RubaXa 	<trash@rubaxa.org>
 */
jsClass.create('LightBox').setMethods({__construct:function($Box,options){LightBox.count++;$E(this,{position:'fixed',left:'50%',top:'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._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).insertFirst('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');this.callMethod('init')},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=$X[i].getAttribute('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(){if(this.position){this.$Box.css({marginLeft:-this.$Box[0].offsetWidth/2,marginTop:-this.$Box[0].offsetHeight/2})}return this},controlDisable:function(s){this._cDisable=s;return this},html:function(html){this.$Box[0].style.visibility='hidden';this.$Box.html(html).processPlugins();this.initControls(this.$Box);this.fixPos();this.$Box[0].style.visibility='';return this},isVisible:function(){return this.visible},toggle:function(f,s){var e=defined(s,!this.visible)?'show':'hide';if(this.dispatchEvent('before'+String.ucfirst(e),this)!==false){this._visible=this.visible;this.visible=defined(s,!this.visible);this.$Box[0].style.zIndex=1001+LightBox.active;this.$Box[this.visible?'show':'hide']();if(!this.$Fade[0].__lb||(this.$Fade[0].__lb==this.uniqId)){this.$Fade[this.visible?'show':'hide'](-1);this.$Fade[0].__lb=this.visible?this.uniqId:0;this.$Fade[0].style.zIndex=1000+LightBox.active}LightBox.active+=this.visible?1:-1;if(this.visible){this.fixPos();LightBox.last=this;LightBox.open.push(this)}else{LightBox.open=Array.remove(LightBox.open,this,1);LightBox.last=LightBox.open[LightBox.active-1]}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.hide()});;
jsLoader.loaded('{plugins}LightBox');


/**
 * @class	ElementScroller
 * @author	RubaXa	<trash@rubaxa.org>
 * @version	2.0b
 */
jsClass.create('ElementScroller').setMethods({__construct:function($T,o){this.$Target=jQuery($T).css('position','relative');$E(this,{visibleFix:'.visible-fix',visiblePart:'.visible-part',movedPart:'.moved-part',loop:false,animSpeed:20,smart:0,left:'.move-left',right:'.move-right',active:'active',elements:'IMG',selected:'selected',align:'left',blur:false},o);this.$FPart=this.$Target.find(this.visibleFix);this.$VPart=this.$FPart.find(this.visiblePart).css({overflow:'hidden',width:'100%'});this.$MPart=this.$VPart.find(this.movedPart).css({width:'20000px'}).cleenHtml().click($D(this,'fire','Click',0));this.$Left=this.$Target.find(this.left).css({position:'absolute',left:0}).mousedown($D(this,'fire','Start',-1)).bind('dragstart',function(){return false});this.$Right=this.$Target.find(this.right).css({position:'absolute',right:0}).mousedown($D(this,'fire','Start',+1)).bind('dragstart',function(){return false});this._st=0;this.pos=0;this.vector=0;this._dClick=$D(this,'fire','Click',0);this._dStopMove=$D(this,'fire','Stop',0);this._dSmart=$D(this,'_smart');this._dScroll=$D(this,'_scroll',0);this.$Sel=this.$MPart.find(this.elements).attr('isESelm',true).filter('.'+this.selected);this.callMethod('init');if(this.getCount())this.select(this.$Sel[0]||this.$MPart[0].firstChild,true);Window.addEventListener('resize',$D(this,function(){this.redraw()}))},fire:function(n,v,e){if(this.dispatchEvent('before'+n,this,e)!==false){switch(n){case'Click':{this.select(jsCore.elm(e,'isESelm'))}break;case'Start':{this._st=jsCore.getTimer();this.vector=v;this._aId=setInterval(this._dScroll,this.animSpeed);jQuery(BODY).mouseup(this._dStopMove)}break;case'Stop':{clearInterval(this._aId);jQuery(BODY).unbind('mouseup',this._dStopMove);this.pos+=this.vector*(this._dt&&(this._dt<150)?this.eSize*3:0);this._st=0;this._scroll(true)}break}this.dispatchEvent(n,this,e)}return false},_scroll:function(a){if(this._st){this._dt=jsCore.getTimer()-this._st;this.pos+=this.vector*(this.eSize*.1+this._dt/100)}if(this.pos<0)this.pos=0;else if(this.pos>this.mPos)this.pos=this.mPos;if(a){this.$MPart.dequeue().animate({marginLeft:-this.pos},'fast',this._dSmart)}else{$FS(this.$MPart[0]).marginLeft=-this.pos+'px';this._smart()}this.dispatchEvent('scroll',this);return this.redraw(true)},_smart:function(){if(this.smart){if(this._pos!==this.pos){this._pos=this.pos;var c=this.$MPart[0].childNodes,i=0,s;for(;c[i];i++){s=c[i].offsetLeft;if(!c[i].isESsrc&&(s>0&&s<this.vSize)){c[i].src=c[i].getAttribute('xsrc');c[i].isESsrc=1}}c=null}}},_vis:function(s){if(this._isVis!=s){this._isVis=s;this.$Target[s?'show':'hide']();if(s)this.redraw()}return this},isVisible:function(){return!!this._isVis},show:function(){return this._vis(1)},hide:function(){return this._vis(0)},attr:function(k,v){this[k]=v;return this},redraw:function(c){if(c){var l=this.pos>0,r=this.pos<this.mPos;if(this._l!==l)this.$Left[this._l=l?'addClass':'removeClass'](this.active);if(this._r!==r)this.$Right[this._l=r?'addClass':'removeClass'](this.active)}else{var vS=this.$FPart[0].offsetWidth,lc=this.$MPart[0].lastChild,ln=this.getCount(),mS=0,cS=0;this.$MPart[0].style.marginLeft=0;if(ln&&vS>0&&(vS!==this.vSize||ln!==this._ln)){if(this.usePadding)this.$FPart.css('padding','0 '+(cS=this.$Left.width())+'px');vS-=cS*($B.msie?2:1);mS=lc.offsetLeft+(this.eSize=jQuery(lc).width());this._ln=ln;this.vSize=vS;this.cSize=cS;this.mSize=Math.max(mS,vS);this.mPos=this.mSize-vS;this.pos=Math.min(this.pos,this.mPos)}l=null;this._scroll()}return this},select:function($I,f){$I=jQuery($I);if(this.dispatchEvent('beforeSelect',this,$I,f)!==false){if(this.$Sel[0]!=$I[0]){this.$Sel.removeClass(this.selected);(this.$Sel=$I).addClass(this.selected);if(!f){var s=this.$Sel[0].offsetLeft,e=s+this.eSize;if(s-this.cSize<5||e-this.vSize>-5){s=this.pos;this.$MPart[0].style.marginLeft=0;this.pos=this.$Sel[0].offsetLeft-this.vSize/2;this.$MPart[0].style.marginLeft=-s+'px';f=0}}}(f?this.redraw():this._scroll(true)).dispatchEvent('select',this)}return this},getSelected:function(){return this.$Sel},add:function($I,f,s){$I=jQuery($I)[f?'insertFirst':'appendTo'](this.$MPart).show(-1).attr('isESelm',true);this.redraw();if(s)this.select($I);return this},remove:function($I){$I=jQuery($I);if(this.dispatchEvent('beforeRemove',this,$I)!==false){if($I.hasClass(this.selected)){Array.forEach(this.$MPart.find(this.elements),function(E,i,a){if(E==$I[0]){if(E=(a[i+1]||a[i-1])){this.select(E)}return false}},this)}$I.remove();this.redraw().dispatchEvent('remove',this)}return this},getCount:function(){return this.$MPart[0].childNodes.length}});;
jsLoader.loaded('{plugins}ElementScroller');


/**
 * @object	jsCookie
 * @author	"RubaXa"		<trash@rubaxa.org>
 */
var jsCookie={DAY:86400,WEEK:86400*7,MONTH:86400*30,YEAR:86400*365,set:function(key,value,expires,path){if(!value)value=0;if((typeof(expires)!='undefined')&&(expires!==true)){expires='expires='+(new Date((new Date).getTime()+(expires*1000))).toGMTString()+';'}else expires='';this.remove(key);document.cookie=key+'='+value+'; path='+(path||'/')+'; '+expires;return this},get:function(key,def){if(!key)return document.cookie;var keyEx=new RegExp(key+'=');var cookie=document.cookie.split(/;\s+/);for(var i=0,n=cookie.length;i<n;i++){if(keyEx.test(cookie[i])){return cookie[i].split('=')[1]}}return def},has:function(key){var value=this.get(key);return(value&&!((value=='false')||(value=='null')||(value=='')))},remove:function(key){e=(new Date(1)).toGMTString();document.cookie=key+'=null; expires='+e;document.cookie=key+'=null; path=/; expires='+e}};if(window['jsLoader']){};
jsLoader.loaded('{jsCore}jsCookie');


/**
 * @class	Toggle
 * @author	RubaXa	<tarsh@rubaxa.org>
 */
Registry.put('ToggleGroups',{});jsClass.create('Toggle').setMethods({__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;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){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;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,Array.prototype.slice.call(arguments,1))}})}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)!==false)){this.options.state=a;if(a=='show')this.notifyGroup('hide');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);this.dispatchEvent('toggle',this)}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');


/**
 * @class   InputValidator
 * @author  RubaXa 	<trash@rubaxa.org>
 * @events	blur, focus, click, valid
 * Базовый класс для валидации Input'ов, Select'ов и подобного хлама
 */
jsClass.create('InputValidator').setMethods({__construct:function($T,o){InputValidator[this.uniqId]=this;$T=jQuery($T);o=o||{};this.beforeInit($T,o);if(!this.$Group)this.$Group=o.group?jQuery(o.group):this.$Input;this.counters=!!o.group;o.group=undefined;if(this.$Input[0].onclick){o=$E(this.$Input[0].onclick(),o);this.$Input[0].onclick=null}this.$Input[0].ivUniqId=this.uniqId;this.event={};this.name=this.$Input[0].name;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._udv=!this.isPass&&this.dValue!=='';if($B.msie&&this._udv&&this.isPass){this.$FixInput=jQuery('<input type="text" />').insertAfter(this.$Input).hide(-1).val(this.dValue).focus($D(this,'fireEvent','_focus'))}this.callMethod('init');setTimeout($D(this,function(){this.fireEvent(this.inFocus?'focus':'blur');this.initCounters();if(this.inFocus)this.setFocus()}),0)},beforeInit:function($T,o){if(!InputValidator.TAGS[$T[0].tagName.toUpperCase()]){this.$Input=$T.find(o.target||'INPUT,TEXTAREA,SELECT').filter(':first')}else{this.$Input=$T}return this.$Input},bindEvents:function(e){Array.forEach(e.split(','),function(n){this.$Input.bind(n.toLowerCase(),$D(this,'fireEvent',n))},this);return this},initCounters:function(){if(this.counters){this.$Length=this.$Group.find(this.length);this.$Remain=this.$Group.find(this.remain);this._dCounters=$D(this,function(){if(this.$Length[0])this.$Length[0].innerHTML=this.value.length;if(this.$Remain[0])this.$Remain[0].innerHTML=this.maxLength-this.value.length});this.addEventListener('keyUp',this._dCounters);this._dCounters()}},getDefOptions:function(){return{target:'.v-target',errors:0,errNode:0,length:'.length',remain:'.remain',sEmpty:0,sIndex:0,sMinIndex:-1,sMaxIndex:-1,minLength:(this.$Input[0].getAttribute('minlength')||0)*1,maxLength:(this.$Input[0].getAttribute('maxlength')||0)*1,format:(this.$Input[0].getAttribute('format')||0),validator:0,dValue:(this.$Input[0].getAttribute('dValue')||''),defaultValue:(this.$Input[0].getAttribute('defaultValue')||''),inFocus:0,selectOn:0,def:'default',focus:'focus',empty:'empty',valid:'valid',invalid:'invalid'}},changeType:function(t){if(this.$FixInput){this.$FixInput[t=='text'?'show':'hide'](-1);this.$Input[t!='text'?'show':'hide'](-1);try{this.$FixInput[0].focus()}catch(err){}}else if(this.isInput){this.$Input[0].type=t}},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'){this.$Input.focus()}else{if(n=='focus'){this.inFocus=1}else if(n=='blur'){this.inFocus=0}if((n=='focus')||(n=='keyDown')||(n=='change')){this._pV=-1}if(this._udv&&(n=='focus')&&this._isEmpty){this.$Input[0].value='';this.changeType(this.type);this.isDefaultValue=0}this.isClicked=n=='click';this.validate(n,e);this.displayErrors(n);if(this._udv&&(n=='blur')&&this._isEmpty){this.changeType('text');this.$Input[0].value=this.dValue;this.isDefaultValue=1}switch(n){case'blur':case'focus':{if(this.focus)this.$Input[this.inFocus?'addClass':'removeClass'](this.focus);if(this._udv&&this.def)this.$Input[(!this.inFocus&&this._isEmpty)?'addClass':'removeClass'](this.def);if(this.invalid){this.$Group[!this.inFocus&&!this._isValid&&!this._isEmpty?'addClass':'removeClass'](this.invalid)}}break}if(this.selectOn==n.toLowerCase()){this.$Input.select()}if(this.$FixInput)this.$FixInput[0].className=this.$Input[0].className;this.dispatchEvent(n,this,e);if(this._se){this._se=0;return false}}},displayErrors: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._pV>-1)v=this._pV;if((this._isValid!==v)||(e!==this.__e)||(this._pV==-1)){this._pV=-2;this.__e=this._isEmpty=e;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._isValid=v;this.dispatchEvent('valid',this)}return this},validate:function(n,e){},isFocus:function(){return this.inFocus},isEmpty:function(){return this._isEmpty},isValid:function(){return this.notValid?false:this.validate()},attr:function(k,v){if(k.constructor==Object){this.$Input.attr(n);return this}else{return this.$Input.attr(k,v)}},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){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.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)())}};$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){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,{group:P}).get(N,n)}else{V=this.auto(jQuery(N).find('INPUT,SELECT,TEXTAREA'),N)}}return V}});;
jsLoader.loaded('{plugins}InputValidator');


/**
 * @class   InputText
 * @author  RubaXa 	<trash@rubaxa.org>
 * @require	InputValidator
 * Валидатор текстовых полей.
 */
jsClass.create('InputText').extend(InputValidator).setMethods({init:function(){this.bindEvents('blur,focus,click,keyDown,keyPress,keyUp')},validate:function(){var v=this.isDefaultValue?'':this.$Input[0].value,e=this._isEmpty,isValid=this._isValid,l=0,k=ok=this.event.charCode||this.event.keyCode;if((this.value!==v)||(this._pV==-1)){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.setValidate(isValid,e);return(this.minLength||this.format||this.validator)?isValid:true},getSelection:function(){var s={start:0,end:0},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(this.start,this.end);return s},setSelection:function(s,e){if(this.$Input[0].createTextRange){var range=this.$Input[0].createTextRange();range.collapse(true);range.moveEnd('character',e);range.moveStart('character',s);range.select()}else if(this.$Input[0].setSelectionRange){this.$Input[0].setSelectionRange(s,e)}return this},setCaretPos:function(p){return this.setSelection(p,p)}});InputValidator.add('InputText');;
jsLoader.loaded('{plugins}InputText');


/**
 * @class	EditableText
 * @author	RubaXa	<trash@rubaxa.org>
 * @events	onBeforeEdit, onBeforeCancel, onBeforeSave, onEdit, onCancel, onSave
 */
jsClass.create('EditableText').extend(Toggle).setMethods({__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('beforeShow',$D(this,function(TM){return!this.isEdit&&(this.dispatchEvent('beforeEdit',this)!==false)}))},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']()},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');


jsClass.create('LocationSelector').extend(LightBox).setMethods({__construct:function($T,o){window.changeCity=jsCore.F;this.fixFocus=$D(this,function(){try{this.$D[0].focus()}catch(e){}});this.parent('__construct',$T,$E({url:'/mamba.phtml?m=search_place',countryId:0,regionId:0,cityId:0,metroId:0,require:0,depth:0,text:0,select:0,input:0,sValue:'1_1_1',metroNode:0,metroInput:0,haveMetro:[],cTitle:'.title',cSlide:'.slide',cDisabled:'disabled'},o||{}))},init:function(){this.isAnim=($B.msie&&$B.version>6)||$B.safari;this.cache={};this.dNames=['country','region','city','metro'];this.$Title=this.$Box.find(this.cTitle);this.$Slide=this.$Box.find('SELECT').change($D(this,'_select')).end().find(this.cSlide);if(this.text)this.$Text=jQuery(this.text);if(this.metroNode){this.$Metro=jQuery(this.metroNode).click($D(this,function(){this.show();return false}))[this.metroId?'show':'hide'](-1);this.$MetroInp=jQuery(this.metroInput)}if(this.select){this.$Select=jQuery(this.select).change($D(this,'_selOnChange'));this.$Select.change()}if(this.input){this.$Input=jQuery(this.input);var v=this.$Input.val().split('_');for(var i=0,n=v.length;i<n;i++)this[this.dNames[i]+'Id']=v[i]*1}},_selOnChange:function(){if(this.$Select.val()==this.sValue){this.show();return false}else{var v=this.$Select.val().split('_');for(var i=0,n=v.length;i<n;i++){this[this.dNames[i]+'Id']=v[i]*1}}if(this.$Metro){this.$Metro[this.hasMetro(this.cityId)?'show':'hide'](-1)}},_select:function(S){S=jsCore.elm(S);var O=S.options[S.selectedIndex];this[S.name]=O.value*1;if((!this.depth||(this.depth+'Id'!=S.name))&&(((S.name!='cityId')&&(S.name!='metroId'))||((S.name=='cityId')&&(O.getAttribute('metro')==1)))){this.initDialog()}this.validate();O=S=null},validate:function(){var d=this.require&&!this[this.require+'Id'];if(this.__d!==d){this.$Box[this.__d=d?'addClass':'removeClass'](this.cDisabled)}},initDialog:function(){var n=this.getDialogNum();this.$D=this.$Box.find('.SPD-'+(n+1));if(defined(this.cache[n])&&(this.cache[n]!==0)){this.showDialog(n)}else{this.$Box.addClass('is-loading');jQuery.get(this.url,{select:this.dNames[n],countryId:this.countryId,regionId:this.regionId,cityId:this.cityId},$D(this,'showDialog',n));this.disabledHide=1}this.validate();this.$Box[0].className=this.$Box[0].className.replace(/(\s|^)s-\w+(\s|$)/,'$1')+' s-'+this.dNames[n]},getDialogNum:function(){var n;if(!this.countryId)n=0;else if(!this.regionId)n=1;else if(!this.cityId)n=2;else n=3;return n},getResult:function(r){return eval('('+r+')')},showDialog:function(d,r){if(r)this.$Box.removeClass('is-loading');if(r=this.getResult(r)){this.disabledHide=0;this.cache[d]=r.current;this.country=r.country;for(var i=this.$D[0].options.length-1;i>0;i--){this.$D[0].remove(i)}for(var i=0,O,n=r.list.length;i<n;i++){O=new Option(r.list[i].name,r.list[i].oid);O.setAttribute('metro',r.list[i].metro);this.$D[0].options[i+1]=O}}var a={left:-400*d};if(this.__l&&this.isAnim)this.$Slide.dequeue().animate(a,'slow','swing',this.fixFocus);else{this.__l=1;this.$Slide.css(a);this.fixFocus()}this.$Title.html(this.cache[d]);this.$D[0].scrollTop=0;this.$D[0].selectedIndex=0},back:function(){var d=this.getDialogNum();if(this.cityId&&!this.hasMetro(this.cityId))d=2;this.cache[d]=0;this[this.dNames[d]+'Id']=0;this[this.dNames[d-1]+'Id']=0;if(this.depth){for(var i=Math.max(0,Array.indexOf(this.dNames,this.depth)-1);this.dNames[i];i++){this.cache[i]=0;this[this.dNames[i]+'Id']=0}}this.initDialog()},selOpt:function(v){for(var i=0,oV,n=this.$Select[0].options.length;i<n;i++){oV=this.$Select[0].options[i].value;if((v==oV)||((this.$Metro||!this.metroId)&&!v.indexOf(oV))){this.$Select[0].selectedIndex=i;return true}}return false},hide:function(){if(this.__arr){for(var i=0;i<4;i++){this[this.dNames[i]+'Id']=this.__arr[i]}if(this.select&&this.$Select[0]){this.selOpt(this.toValue())}else if(this.input&&this.$Input[0]){this.$Input.val(this.toValue())}if(this.text&&this.$Text[0])this.$Text.html(this.getText())}if(window.Meet&&this.$Select)this.$Select.change();try{Window.focus()}catch(e){};return this.parent('hide')},hasMetro:function(cId){return(Array.indexOf(this.haveMetro,cId)!=-1)},show:function(){var d=this.getDialogNum();this.__arr=this.toArray();this.cache[d]=0;this[this.dNames[d]+'Id']=0;if(!this.hasMetro(this.cityId)){this.cityId=0;this.cache[2]=0}if(this.depth){for(var i=Array.indexOf(this.dNames,this.depth);i<4;i++){this.cache[i]=0;this[this.dNames[i]+'Id']=0}}this.initDialog();return this.parent('show')},finish:function(){if(this.dispatchEvent('finish',this)!==false){if(this.select&&this.$Select[0]){var t=this.getText(),v=this.toValue(),I=this.selOpt(v)?0:this.$Select[0].options.length-1;if(I){if($B.msie){O=new Option(t,v);this.$Select[0].add(O,I)}else{jQuery('<option value="'+v+'">'+t+'</option>').insertBefore(this.$Select[0].options[I])}this.$Select[0].selectedIndex=I;if(window.fSelectCity)fSelectCity.showMetroList(this.cityId)}}if(this.$Metro){this.$Metro[this.metroId?'show':'hide']().html('м. '+this.getMetro());this.$MetroInp.val(this.metroId+'')}this.__arr=this.toArray();return this.hide()}return this},getOptText:function(){return this.$D[0].options[this.$D[0].selectedIndex].text},getMetro:function(){return this.metroId?this.getOptText():''},getText:function(){var d=this.getDialogNum(),v=this.getOptText(),T=this.$Title.text(),t;switch(d){case 0:t='Любой город';break;case 1:t=(this.country||T)+(this.regionId?', '+v:'');break;case 2:t=this.country+', '+(this.cityId?v:T);break;case 3:{t=this.country+', '+(this.$D[0].name=='metroId'?T:v);if(this.metroId&&!(this.$Metro&&this.$Metro[0])){t=T+', м. '+v}}break}return t},toArray:function(){return[this.countryId,this.regionId,this.cityId,this.metroId]},toValue:function(){return this.toArray().join('_')}});
jsLoader.loaded('{mamba.plugins}LocationSelector');


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

