/*
«js-core» — JavaScript framework, version 2.5.2 (packed)
http://code.google.com/p/js-core/
*/
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('1l.r.j=4(a,b){9(z 3.q!=\'11\'){e i,q=3.q;P(i=0;i<q;i++)a.F(3[i],b||[])}l P(e c 2n 3)9(3.2o(c))a.F(c,b||[]);6 3};1l.r.E=4(b){9(b)b.j(4(a){a[3]=b[3]},[3]);6 3};1l.r.E({2p:4(){6{}.E(3)},2q:4(b){(b?8.o(b):3).j(4(a){1m a[3]},[3]);6 3}});2r.r.E({1E:4(a){e b=3;6 4 2s(){6 b.F(a)}},M:4(){6 3.Q[0]||1n.M},G:4(){e a=3.M();a.G?a.G():a.2t=v},R:4(){e a=3.M();a.R?a.R():a.2u=w},2v:4(){e a=3.M();6 a.2w||a.2x},2y:4(){e a=3.M();6 a.2z||a.2A}});9(!12.r.1o)12.r.1o=4(a,b){e i,q=3.q;P(i=0;i<q;i++)a.S(b,3[i],i,3)};2B.r.E({13:4(){6 3.A(/^\\s+/,\'\')},14:4(){6 3.A(/\\s+$/,\'\')},1p:4(){6 3.A(/\\s{2,}/g,\' \')},N:4(a){9(a){e b=3;8.o(a).j(4(){b=8.N[3](b)});6 b}l 6 8.N[\'1F\'](3)}});e 8={1q:0/*@T+@2C*10%10@*/,N:{2D:4(a){6 a.13()},2E:4(a){6 a.14()},2F:4(a){6 a.1p()},1F:4(a){6 a.13().14()},15:4(a){6 a.1p().13().14()}},H:{},1G:4(a){6 3.H[a]||(3.H[a]=x.2G(a))},16:4(a){6 z a==\'2H\'},u:4(a){6 3.16(a)?3.1G(a):a},k:4(a){e b=a.7||x,17=a.k?b.1H(a.k):(3.1q==5?b.15:b.1H(\'*\'));/*@T 17=$.1I(17);@*/6 17},18:4(a){6 3.16(a)?x.1J(a):a},I:4(a,b,c){6 a.1K(3.18(b),c)},1r:4(a,b,c){1L(a=a[b])9(a.1M==1&&(c?a.19==c.1a():w))6 a},U:4(a,b,c){9(a.1b)a.1b(b,c,v);/*@T a.2I(\'1N\'+b,c.2J().1O(/^4\\s*\\(/)+1?c.1E(a):c);@*/},1c:4(a,b,c){9(a.1P)a.1P(b,c,v);/*@T a.2K(\'1N\'+b,c);@*/},V:4(a,b){6!!(a.1O(\'\\\\b\'+b+\'\\\\b\')+1)},A:4(a,b,c){6 a.A(p 2L(\'\\\\b\'+b+\'\\\\b\'),c||\'\').N([\'15\'])},o:4(a){6 a.O?3.N[\'15\'](a).O(/\\s+/):a},h:4(c){9(c.h.q){e d=[];3.k({7:c.7,k:c.k}).j(4(){e b=w;8.o(c.h).j(4(a){9(!a[3])6 b=v},[3]);9(b)d.B(3)});6 d}l 9(c.7)c.h.j(4(){c.7[3]=c.h[3]})},C:4(c){e d=[];3.k({7:c.7,k:c.k}).j(4(){e b=w;c.h.j(4(a){9(a[3]!=c.h[3])b=v},[3]);9(b)d.B(3)});6 d},1d:4(a,b){e i,W=a.2M,q=W.q,o=[];9(b){9(b.J)b=b.J(\' \');b=b.1a()}P(i=0;i<q;i++)9(W[i].1M==1)9(b?3.V(b,W[i].19):w)o.B(W[i]);6 o},1e:4(a){9(a.k){e b=[];3.o(a.k).j(4(){8.k({7:a.7,k:3}).j(4(){b.B(3)})});6 b}l 6 3.k({7:a.7})},1s:4(b){e c=[],1t=3.16(b.C)?b.C:b.C.J(\' \');8.h({7:b.7,k:b.k,h:b.h}).j(4(){e a=v;8.o(3[b.h]).j(4(){9(8.V(1t,3))a=w});9(a)c.B(3)});6 c},K:4(a,b){9(a.1Q)6 a.1Q[b];l 9(1n.1R)6 x.2N.1R(a,1S).2O(b)},D:{1f:[],X:4(){9(!Q.1g.1T){Q.1g.1T=w;9(8.D.1u)1U(8.D.1u);3.1f.j(4(){3()});3.1f=[]}},1V:4(){e a=4(){8.D.X()};9(x.1b)x.1b(\'2P\',a,v);9(/2Q|2R/i.1W(2S.2T))8.D.1u=1X(4(){9(/2U|1Y/.1W(x.1Z))8.D.X()},10);/*@T x.2V(\'<20 2W="9(3.1Z==\\\'1Y\\\') 8.D.X()" 21=21 2X=2Y:><\\/20>\');@*/8.U(1n,\'2Z\',a)}}};4 G(){Q.1g.G()}4 R(){Q.1g.R()}4 m$(a){3.7=8.u(a)}m$.r={1d:4(a,b){9(a)6 z a==\'1h\'?8.1e({7:3.7}):(b?8.1e({7:3.7,k:a}):8.1d(3.7,a));l 6 8.1d(3.7)},30:4(){6 p m$(3.7.L)},22:4(a){6 p m$(3.7.1v(8.18(a)))},31:4(a){6 p m$(8.I(3.7,a,3.7.1i))},32:4(a){6 p m$(8.I(3.7.L,a,3.7.1w))},23:4(a){6 p m$(8.I(3.7.L,a,3.7))},33:4(a){8.u(a).1v(3.7);6 p m$(a)},34:4(a){e b=8.u(a);8.I(b,3.7,b.1i);6 p m$(a)},35:4(a){e b=8.u(a);6 p m$(8.I(b.L,3.7,b.1w))},1K:4(a){e b=8.u(a);6 p m$(8.I(b.L,3.7,b))},36:4(a){6 p m$(8.1r(3.7,\'1w\',a))},37:4(a){6 p m$(8.1r(3.7,\'38\',a))},39:4(a){6 p m$(3.7.3a(a!==v))},A:4(a){e b=8.18(a);3.7.L.3b(b,3.7);6 p m$(b)},3c:4(a){6 3.23(a).22(3.7)},3d:4(a){6 a?3.A(8.u(a)):3.7},24:4(){1L(3.7.1i)3.7.25(3.7.1i);6 3},3e:4(){9(8.H[3.7.u])1m 8.H[3.7.u];9(3.7.26)3.7.26(w);l 3.7.L.25(3.7);6 v},3f:4(a){9(z a!=\'11\'){3.7.27=a;6 3}l 6 3.7.27},3g:4(a){9(z a!=\'11\'){3.24().7.1v(x.3h(a));6 3}l 6 3.7.3i||3.7.3j},1x:4(a,b){e c=\'3k\';9(b){3.7[c+a]=v;8.1c(3.7,a,G)}l 9(!3.7[c+a]){3.7[c+a]=w;8.U(3.7,a,G)}6 3},U:4(a,b,c){8.U(3.7,a,b);9(z c==\'1h\')3.1x(a,c);6 3},1c:4(a,b,c){8.1c(3.7,a,b);9(z c==\'1h\')3.1x(a,c);6 3},28:4(a,b){9(a&&3.7)a.S(3.7);l 9(b&&!3.7)b();6!!3.7},29:4(b){9(b){e c=v;8.o(b).j(4(a){9(!8.V(a,3))6 c=w},[3.7.y]);6!c}l 6!!3.7.y},2a:4(b){8.o(b).j(4(a){9(!8.V(a.y,3))a.y+=\' \'+3},[3.7]);6 3},1y:4(b){b?8.o(b).j(4(a){a.y=8.A(a.y,3)},[3.7]):3.7.y=\'\';6 3},3l:4(b,c){9(c){e i,1z=8.o(b),2b=8.o(c),q=1z.q;P(i=0;i<q;i++)3.7.y=8.A(3.7.y,1z[i],2b[i])}l 9(b)8.o(b).j(4(a){a.29(3)?a.1y(3):a.2a(3)},[3]);l 3.1y();6 3},h:4(b){9(b.J||b.O){e c=[];8.o(b).j(4(a){c.B(a[3])},[3.7]);6 c.q==1?c[0]:c}l{8.h({7:3.7,h:b});6 3}},2c:4(b){8.o(b).j(4(a){a[3]=1S},[3.7]);6 3},1t:4(a){6 z a!=\'11\'?3.h({C:a}):3.h(\'C\')},2d:4(a,b){6 a.J||a.O?8.h({7:3.7,k:b,h:a}):8.C({7:3.7,k:b,h:a})},2e:4(a,b,c){6 8.1s({7:3.7,k:c,h:a,C:b})},3m:4(b,c){9(b){9(!b.J&&!b.O){e d=v;b.j(4(a){9(a[3]!=b[3])d=w},[3.7]);9(c&&!d)d=3.7.19!=c.1a();6!d}l 6 3.7.19==b.1a()}l 6 3.28()},2f:4(a,b){6 8.1s({7:3.7,k:b,h:\'y\',C:a})},K:4(b){9(b.J||b.O){e c=[];8.o(b).j(4(a){c.B(8.K(a,3))},[3.7]);6 c.q==1?c[0]:c}l{8.h({7:3.7.3n,h:b});6 3}},2g:4(){6 3.K({1A:\'2h\',1B:\'2i\'})},2j:4(a){6 3.K({1A:a||\'3o\',1B:\'1C\'})},1C:4(){6 3.K([\'1A\'])!=\'2h\'&&3.K([\'1B\'])!=\'2i\'},3p:4(a){6 3.1C()?3.2g():3.2j(a)},3q:4(a){6 z a==\'1h\'?(a?3.2c(\'1j\'):3.h({1j:\'1j\'})):!3.h([\'1j\'])},u:4(a){9(a){9(8.H[3.7.u])1m 8.H[3.7.u];3.7.u=a;6 3}l 6 3.7.u},3r:4(a,b){a.F(3.7,b||[]);6 3},3s:4(){6 3.7.3t||p 3u().3v(3.7)}};4 $(a){6 p m$(a)}$.E({t:4(a){6 8.1e({k:a})},n:4(a){6 p m$(x.1J(a))},c:4(a,b){6 m$.r.2f(a,b)},a:4(a,b){6 m$.r.2d(a,b)},f:4(a,b,c){6 m$.r.2e(a,b,c)},X:4(a){8.D.1f.B(a)},3w:4(a,b){a.j(4(){b.S(a,3,a[3])})},1I:4(b){e c=[];9(!8.1q)c=12.r.3x.S(b);l 12.r.1o.S(b,4(a){c.B(a)});6 c}});4 2k(a,b,c){3.E({1D:a,Y:b,Z:c})}2k.r={3y:4(){e a=3;3.2l=1X(4(){a.Y.F(a,a.Z||[])},3.1D);6 3},3z:4(){1U(3.2l);6 3},2m:4(a,b,c){9(b)3.E({1k:{Y:b,Z:c}});e d=3;9(a)3A(4(){d.Y.F(d,d.Z||[]);d.2m(--a);9(!a&&d.1k)d.1k.Y.F(d,d.1k.Z||[])},3.1D);6 3}};8.D.1V();',62,223,'|||this|function||return|node|core|if|||||var|||attr||each|tag|else|_||array|new|length|prototype|||id|false|true|document|className|typeof|replace|push|value|dom|extend|apply|preventDefault|cache|insert|join|css|parentNode|event|trim|split|for|arguments|stopPropagation|call|cc_on|bind|instr|children|ready|fn|arg||undefined|Array|trimLeft|trimRight|all|isstr|list|create|tagName|toUpperCase|addEventListener|unbind|child|tags|init|callee|boolean|firstChild|disabled|callback|Object|delete|window|forEach|trimSpaces|ie|sibling|values|val|timer|appendChild|nextSibling|useDefault|removeClass|array1|display|visibility|visible|time|context|both|incache|getElementsByTagName|makeArray|createElement|insertBefore|while|nodeType|on|search|removeEventListener|currentStyle|getComputedStyle|null|done|clearInterval|check|test|setInterval|complete|readyState|SCRIPT|defer|append|before|empty|removeChild|removeNode|innerHTML|exist|hasClass|addClass|array2|removeAttr|find|findAttr|findClass|hide|none|hidden|show|Timer|interval|repeat|in|hasOwnProperty|copy|compress|Function|_fn|returnValue|cancelBubble|handler|target|srcElement|getKey|charCode|keyCode|String|_jscript_version|left|right|spaces|getElementById|string|attachEvent|toString|detachEvent|RegExp|childNodes|defaultView|getPropertyValue|DOMContentLoaded|KHTML|WebKit|navigator|userAgent|loaded|write|onreadystatechange|src|javascript|load|parent|prepend|after|appendTo|prependTo|insertAfter|next|prev|previousSibling|clone|cloneNode|replaceChild|wrap|el|remove|html|text|createTextNode|innerText|textContent|preventDefaultOn|toggleClass|is|style|block|toggle|enabled|run|serialize|outerHTML|XMLSerializer|serializeToString|foreach|slice|start|stop|setTimeout'.split('|'),0,{}));

/*
«js-core AJAX» — extension of «js-core» for using AJAX, version 0.2.1 (packed)
warning: do not use timeout for more then 2 XHR at one time!
*/
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('6 7(){2.5=O.C?f C("P.Q"):f D()}7.g({j:{r:\'h/r\',h:\'h/R\',s:\'l/s, h/s\',t:\'l/t, h/u\',S:\'h/u, l/u\',\'E\':\'l/x-T-U-V\'},F:\'*/*\'}).G={m:6(a,b){},H:6(a){2.g({n:a.n||\'W\',v:a.v||Y.Z,o:a.o!==10,w:a.w||y,z:a.z||y,A:a.A||y,p:a.p||0,B:7.j[a.B]||7.j[\'E\'],k:7.j[a.k]?7.j[a.k]+\', */*\':7.F,9:a.9,3:a.3})},i:6(b){2.H(b);I{2.5.i(2.n,2.v,2.o,2.w,2.z);2.5.m(\'11\',2.k);2.5.m(\'X-12-13\',\'D\');2.5.m(\'14-15\',2.B);J c=2;2.5.16=6(){8(c.5.K==4){8(c.5.L==17||c.5.L==0&&c.9)c.9(c.5.18);19 8(c.3&&!c.M)c.3(c.5.1a)}};2.5.1b(2.A);8(2.o&&2.p)f 1c(2.p,6(a){8(a.5.K!=4){a.M=1d;a.5.1e();8(a.3)a.3(\'1f 1g 1h\')}},[2]).1i(1)}N(3){8(2.3)2.3(3)}}};1j$.G.1k=6(b,c,d){J e=2;f 7().i(b.g({9:6(a){e.r(a);8(c)c.1l(e,a)},3:d}));q 2};$.1m=6(a,b,c){f 7().i(a.g({9:b,3:c}));q 2};$.1n=6(a,b,c){f 7().i(a.g({n:\'1o\',9:b,3:c}));q 2};$.1p=6(b,c,d){f 7().i(b.g({k:\'t\',9:6(a){I{c(1q(\'(\'+a+\')\'))}N(d){8(2.3)2.3(d)}},3:d}));q 2};',62,89,'||this|error||xhr|function|Ajax|if|success||||||new|extend|text|open|type|dataType|application|setRequestHeader|method|async|timeout|return|html|xml|json|javascript|url|user||null|password|data|contentType|ActiveXObject|XMLHttpRequest|default|accept|prototype|config|try|var|readyState|status|aborted|catch|window|Microsoft|XMLHTTP|plain|script|www|form|urlencoded|GET||location|href|false|Accept|Requested|With|Content|Type|onreadystatechange|200|responseText|else|statusText|send|Timer|true|abort|Time|is|out|repeat|_|load|call|get|post|POST|getJSON|eval'.split('|'),0,{}));

// code is art
var codeisart = {
	fix: {
		abbr: function() {
			if(core.ie == 6) document.body.innerHTML = document.body.innerHTML.replace(/<ABBR/g, '<SPAN class="abbr"').replace(/<\/ABBR>/g, '</SPAN>');
		},
		q: function() {
			if(core.ie) $.t('q').each(function(txt) {
				this.appendChild(txt('»'));
				this.insertBefore(txt('«'), this.firstChild);
			}, [function newText(text) {
				return document.createTextNode(text);
			}]);
		}
	},
	bookmarks: {
		services: {
			delicious: {
				name: 'Del.icio.us',
				url: 'http://del.icio.us/post?url={url}&title={title}'
			},
			bobrdobr: {
				name: 'BobrDobr',
				url: 'http://bobrdobr.ru/addext.html?url={url}&title={title}'
			},
			memori: {
				name: 'Memori',
				url: 'http://memori.ru/link/?sm=1&u_data[url]={url}&u_data[name]={title}'
			},
			news2: {
				name: 'News2',
				url: 'http://news2.ru/add_story.php?url={url}'
			},
			vaau: {
				name: 'Ваау!',
				url: 'http://www.vaau.ru/submit/?action=step2&url={url}'
			},
			korica: {
				name: 'Korica',
				url: 'http://korica.info/add_story.php?story_url={url}'
			},
			mrwong: {
				name: 'Mister Wong',
				url: 'http://www.mister-wong.ru/index.php?action=addurl&bm_url={url}&bm_description={title}'
			},
			reddit: {
				name: 'Reddit',
				url: 'http://ru.reddit.com/submit?url={url}&title={title}'
			},
			magmolia: {
				name: 'Ma.gmolia',
				url: 'http://ma.gnolia.com/beta/bookmarklet/add?url={url}&title={title}'
			},
			digg: {
				name: 'Digg',
				url: 'http://digg.com/submit?phase=2&url={url}&title={title}'
			},
			google: {
				name: 'Закладки Google',
				url: 'http://www.google.com/bookmarks/mark?op=add&bkmk={url}&title={title}'
			},
			technorati: {
				name: 'Technorati',
				url: 'http://technorati.com/faves?add={url}'
			},
			moemesto: {
				name: 'Моё место',
				url: 'http://moemesto.ru/post.php?url={url}&title={title}'
			},
			ruspace: {
				name: 'RuSpace',
				url: 'http://www.ruspace.ru/index.php?link=bookmark&action=bookmarkNew&bm=1&url={url}&title={title}'
			},
			linkstore: {
				name: 'LinkStore',
				url: 'http://linkstore.ru/servlet/LinkStore?a=add&url={url}&title={title}'
			},
			yandex: {
				name: 'Яндекс.Закладки',
				url: 'http://zakladki.yandex.ru/userarea/links/addfromfav.asp?bAddLink_x=1&lurl={url}&lname={title}'
			},
			yahoo: {
				name: 'Yahoo',
				url: 'http://myweb2.search.yahoo.com/myresults/bookmarklet?u={url}&t={title}'
			}
		},
		insert: function(id, url, title) {
			var ul = $.n('ul').addClass('sociable');
			$.foreach(this.services, function(key, value) {
				ul.append('li').append('a').addClass(key).attr({href: value.url.replace(/\{url\}/, url).replace(/\{title\}/, title), title: 'Добавить в ' + value.name, rel: 'external nofollow'}).append('span').text(value.name);
			});
			$($.c('entry', 'div')[0]).after(ul.node);
		}		
	},
	feed: function() {
		var feedIcon = $('rss-feed'), timer = new Timer(250, function() {
			feedIcon.toggleClass('hover');
		});
		$('logo').bind('mouseover', function() {
			feedIcon.addClass('hover');
			timer.start();
		}).bind('mouseout', function() {
			timer.stop();
			feedIcon.removeClass('hover');
		});
	},
	tabsIndex: -1,
	tabs: [],
	newTabs: function(node) {
		this.tabsIndex++;
		function Tab() {
			this.pages = [];
		}
		Tab.prototype = {
			active: function(index) {
				this.pages.each(function(index) {
					this.tab.removeClass('active');
					this.content.removeClass('visible').addClass('hidden');
				});
				this.pages[index].tab.addClass('active');
				this.pages[index].content.addClass('visible');
			},
			process: function(node) {
				$(node).child('li').forEach(function(value, index) {
					var obj = {}, switchTab = (function() { codeisart.tabs[this.tabsIndex].active(this.index); }).context(obj);
					obj.extend({tab: $(value.getElementsByTagName('h2')[0].getElementsByTagName('a')[0]).bind('click', switchTab, false), content: $(value.getElementsByTagName('ul')[0]), index: index, tabsIndex: codeisart.tabsIndex});
					this.pages.push(obj);
				}, this);
				this.active(0);
			}
		};
		var tab = new Tab();
		tab.process(node);
		this.tabs.push(tab);
	},
	flashInsert: function(node, url, width, height, flashvars) {
		if(core.ie) $(node).html('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="' + width + '" height="' + height + '"><PARAM name="movie" value="' + url + '" /><PARAM name="wmode" value="transparent" />' + (flashvars ? '<PARAM name="flashvars" value="' + flashvars + '" />' : '') + '</OBJECT>');
		else {
			var flash = $(node).empty().append('object').attr({type: 'application/x-shockwave-flash', data: url, width: width, height: height});
			if(flashvars) flash.append('param').attr({name: 'flashvars', value: flashvars});
			flash.append('param').attr({name: 'wmode', value: 'transparent'});
		}
	},
	lightbox: function() {
		var fileTypes = 'png bmp jpg gif';
		$.c('entry', 'div').each(function() {
			$(this).find('href', 'a').each(function() {
	 			var index = this.href.search(/\.\w{1,3}$/) + 1;
				if(index && (fileTypes.search('\\b' + this.href.substring(index) + '\\b') + 1) && (this.href.search('^http://' + location.hostname) + 1)) {
					$(this).bind('click', function() { codeisart.showImage(this.href); }, false);
				}
			});
		});
	},
	showImage: function(url) {
		$(window).bind('DOMMouseScroll', preventDefault).bind('mousewheel', preventDefault);
		$(document).bind('mousewheel', preventDefault);
		var viewer = $(document.body).append('div').id('lightbox').bind('click', function() { arguments.callee.stopPropagation(); codeisart.enableScroll(); $(this).remove(); }), img = viewer.append('img').attr({src: url}).css({visibility: 'hidden'});
		viewer.node.focus();
		if(core.ie == 6) {
			viewer.css({width: document.body.offsetWidth, height: document.body.offsetHeight});
		}
		$.get({url: 'http://' + location.hostname + '/wp-content/themes/codeisart3/lightbox.php?url=' + url.replace(/^(.*)?wp-content\/uploads\//, '')},
		function(size) {
			size = size.split(',');
			function calc(prop, index) {
				return viewer.node['offset' + prop] > size[index] ? Math.floor((viewer.node['offset' + prop] - size[index]) / 2) + 'px' : 0;
			}
			img.css({visibility: 'visible', top: core.ie == 6 ? (document.documentElement.scrollTop + 20) + 'px' : calc('Height', 1), left: calc('Width', 0), width: size[0] + 'px', height: size[1] + 'px'});
		},
		function() {
			codeisart.enableScroll();
			viewer.remove();
		});
	},
	enableScroll: function() {
		$(window).unbind('DOMMouseScroll', preventDefault).unbind('mousewheel', preventDefault);
		$(document).unbind('mousewheel', preventDefault);
	},
	togglers: function() {
		$.c('cat-item', 'li').each(function() {
			$(this).findClass('children', 'ul').each(function() {
				//var obj = $(this).hide();
				$($(this).hide().parent().child('a')[0]).before('a').addClass('toggler').attr({href: '#', parent: $(this)}).text('+').bind('click', function() {
					var obj = $(this);
					obj.text(obj.text() == '+' ? '−' : '+');
					this.parent.toggle();
				}, false);
			});
		});
	},
	anchors: function() {
		$.c('post', 'div').each(function() {
			$(this).find('href', 'a').each(function(pattern) {
				if(pattern.test(this.href)) {
					$(this).bind('click', function() {
						var anchor = this.href.replace(/^.*?#/, '');
						$(anchor).exist(function() {
							var destination = $(anchor).node.offsetTop, length = destination - document.documentElement.scrollTop, step = Math.floor(Math.abs(length) / 10), scroll = document.documentElement.scrollTop;
							if(step == 0) step++;
							if(length > 0) new Timer(10, function() {
								if(scroll + step < destination) document.documentElement.scrollTop = (scroll += step);
								else {
									this.stop();
									location = '#' + anchor;
								}
							}).start();
							else new Timer(10, function() {
								if(scroll - step > destination) document.documentElement.scrollTop = (scroll -= step);
								else {
									this.stop();
									location = '#' + anchor;
								}
							}).start();
						});
						if($(anchor).exist()) arguments.callee.preventDefault();
					});
				}
			}, [new RegExp('^http:\\/\\/' + location.hostname + '.+?#.+?$')]);
		});
	},
	authorFastInfo: {
		target: null,
    POST: null,
    url: 'http://www.codeisart.ru/author-info.php',
		answers: {},
    request: function() {
      $.getJSON(
        {
          url: this.url,
          method: 'POST',
          data: 'nickname='+encodeURIComponent(this.POST.nickname)
        },
        this.onsuccess,
        this.onerror
      );
    },
    onsuccess: function(data) {
			var self = codeisart.authorFastInfo;
			
			if (!self.answers[self.POST.nickname]) {
				self.answers[self.POST.nickname] = data;
			}
			
			self.infoWindow.pushInfo(data);
    },
    onerror: function(data) {
    },
		load: function(target, data) {
			var self = codeisart.authorFastInfo;
			self.target = target;
			self.infoWindow.createWindow(target);
			if (self.answers[data]) {
				self.onsuccess(self.answers[data]);
				return;
			}
			self.infoWindow.loadingMsg();
			
      self.POST = {nickname: data};
      self.request();
    },
    get: function() {
			var self = this.infoWindow;
			
      $('content').findClass('owner', 'span').each(function() {
        var nickname = $(this).html();
				
        $(this).bind('mouseover', function() {
					var selfSpan = this;
					if (self.action == 'whait')
						self.action = 'open';
						
					setTimeout(function() {
						if (self.action == 'close'){
							self.action = 'open';
							new codeisart.authorFastInfo.load(selfSpan, nickname);
						}
					}, self.timeout);
        });
				
				$(this).bind('click', function() {
					var selfSpan = this;
					if (self.action == 'close'){
						self.action = 'open';
						new codeisart.authorFastInfo.load(selfSpan, nickname);
					}
        });
				
				$(this).bind('mouseout', function() {
					self.action = 'whait';
					setTimeout(function() {	self.destroyWindow();	}, self.timeout);
				}, self.timeout);
      });
    },
		infoWindow:{
			windowId: 'author-info',
			action: 'close',
			timeout: 500,
			createWindow: function(target) {
				$(this.windowId).exist(function(){
					$(this).remove();
				});
				var div = $.n('div').attr({id: this.windowId});
				$(target).parent().after(div.node);
				this.setEvents();
				
				//this.animate.show();
			},
			pushInfo: function(data){
				var div = $(this.windowId);
				div.empty();
				div.append('div').html(data['name']);
				div.append('img').attr({src: data['avatar'], alt: 'avatar'});
				var ul = div.append('ul');
				if (data['icq']) ul.append('li').addClass('icq').html(data['icq']);
				if (data['mail']) ul.append('li').addClass('mail').append('a').attr({href: 'mailto:'+data['mail'], title: 'Отправить письмо'}).html(data['mail']);
				if (data['vkontakte']) ul.append('li').addClass('vkontakte').append('a').attr({href:'http://vkontakte.ru/'+data['vkontakte'], title: 'Вконтакте'}).html('Вконтакте');
				if (data['habrahabr']) ul.append('li').addClass('habrahabr').append('a').attr({href:'http://'+data['habrahabr']+'.habrahabr.ru/', title: 'Хабрацентр'}).html('Хабрахабр');
				if (data['twitter']) ul.append('li').addClass('twitter').append('a').attr({href:'http://www.twitter.com/'+data['twitter'], title: 'Twitter'}).html('twitter');
			},
			loadingMsg: function(){
				var div = $(this.windowId);
				div.empty();
				div.append('span').html('Загрузка...');
			},
			destroyWindow: function() {
				if (this.action == 'whait') {
					this.action = 'close';
					var self = this;
					$(this.windowId).exist(function(){
						//self.animate.hide();
						$(this).remove();
					});
				}
			},
			setEvents: function() {
				var self = this;
				$(this.windowId).bind('mouseout', function() {
					self.action = 'whait';
					setTimeout(function() {	self.destroyWindow();	}, self.timeout);
				});
				
				$(this.windowId).bind('mouseover', function() {
					self.action = 'open';
				});
			},
			animate: {
				windowId: 'author-info',
				opacity: 0,
				show: function() {
					if (core.ie == 0)
						this.showMoz();
					else
						this.showIE();
				},
				hide: function() {
					if (core.ie == 0)
						this.hideMoz();
					else
						this.hideIE();
				},
				showMoz: function() {
					$(this.windowId).css({opacity: this.opacity});
					if (this.opacity >= 1)
						return;
					this.opacity = this.opacity + 0.1;
					var self = this;
					setTimeout(function() { self.showMoz() }, 10);
				},
				hideMoz: function() {
					$(this.windowId).css({opacity: this.opacity});
					if (this.opacity <= 0) {
						$(this.windowId).remove();
						return;
					}
					this.opacity = this.opacity - 0.1;
					var self = this;
					setTimeout(function() { self.hideMoz() }, 10);
				},
				showIE: function() {
					$(this.windowId).css({filter: 'alpha(opacity='+this.opacity+')'});
					if (this.opacity >= 100)
						return;
					this.opacity = this.opacity + 10;
					var self = this;
					setTimeout(function() { self.showIE() }, 10);
				},
				hideIE: function() {
					$(this.windowId).css({filter: 'alpha(opacity='+this.opacity+')'});
					if (this.opacity <= 0) {
						$(this.windowId).remove();
						return;
					}
					this.opacity = this.opacity - 10;
					var self = this;
					setTimeout(function() { self.hideMoz() }, 10);
				}
			}
		}
  }
};

$.ready(function() {
	(function() {
		this.authorFastInfo.get();
		this.fix.q();
		this.fix.abbr();
		this.feed();
		this.newTabs('categories');
		this.togglers();
		if(window.sociablebookmarks) this.bookmarks.insert.apply(this.bookmarks, sociablebookmarks);
		this.lightbox();
		this.anchors();
		this.flashInsert('head-banner-2', 'http://www.codeisart.ru/banners/kinovip468-80.swf', 468, 60);
		//this.flashInsert('head-banner-1', 'http://www.codeisart.ru/banners/yazzle/banner.swf', 468, 60);
		this.flashInsert('sidebar-banner-1', 'http://www.liex.ru/Images/swf/liex3.swf', 125, 125);
	}).call(codeisart);
});