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 L={F:{1h:1L,13:\';\',1o:\'23.R\',N:l.m,1b:l.m,1e:l.m,N:l.m,1q:l.m,Z:l.m,1m:l.m},1l:{1j:E,k:[],1c:\'\'},19:4(a){5(2.9)3 2;2.1u(a);2.9=$H({});2.o=z.s;2.I=[];2.I[2.o]=2.V();2.8=T;3 2},21:4(){2.Q.20(2.F.1h,2);2.1f=E;2.Q();2.G();2.n(\'N\',[2.8]);3 2},1P:4(c,d,e,f,g,h){5(!2.9)2.19();6 i=$1G(2.1l,h||{},{k:d,1r:e,B:f,p:g});i.p=i.p||c+\'-([\\\\1B-]*)\';5(1z i.p==\'1y\')i.p=S 1t(i.p,i.1c);i.B=i.B||4(a){3 c+\'-\'+a[0]};i.7=i.k.11();2.9.25(c,i);2.n(\'1e\',[c,i]);3{10:4(a){3 2.10(c,a)}.y(2),Y:4(a,b){3 2.Y(c,a,b)}.y(2),X:4(a){3 2.X(c,a)}.y(2),W:4(){3 2.W(c)}.y(2)}},W:4(a){2.n(\'1b\',[a]);2.9.22(a)},10:4(a,b){6 c=2.9.D(a);5(!c||c.7.C(b))3 2;c.7=b;2.G();3 2},Y:4(a,b,c){6 d=2.9.D(a);5(!d||d.7[b]==c)3 2;d.7[b]=c;2.G();3 2},X:4(a,b){6 c=2.9.D(a);6 d=c.7.11();c.7=b;6 e=2.U();c.7=d;3\'#\'+e},Q:4(){5(2.t)3;6 d=2.1k();5(2.8==d)3;5((u.1i||u.O)&&(2.8!==T))2.P(d,E);w 2.8=d;2.9.1g(4(a,b){6 c=d.1W(a.p);5(c){c.1V(0,1);c.1d(a.k);5(!c.C(a.k))a.7=c}w a.7=a.k.11();a.1r(a.7,a.k)});2.n(\'Z\',[d]).n(\'1m\',[d])},U:4(){6 c=[];2.9.1g(4(a,b){5(a.1j&&a.7.C(a.k))3;c.1U(a.B(a.7))});3 c.1Q(2.F.13)},G:4(){5(!2.1f)3 2;6 a=2.U();5((!2.8&&!a)||(2.8==a))3 2;2.P(a);2.n(\'Z\',[a]).n(\'1q\',[a]);3 2},M:4(){5(2.t)2.t=$1O(2.t);w 2.t=2.M.1N(1M,2)},V:4(){6 a=12.18.1K;6 b=a.1J(\'#\')+1;3(b)?a.1I(b):\'\'},1k:4(){6 a=2.V();5(2.q){6 b=2.q.17.x;5(b&&b.r.16==\'8\'){6 c=b.r.1H;5(2.8==a)3 c;2.K=E}w 3 2.15}5(u.O&&z.s!=2.o){2.o=z.s;3 $J(2.I[2.o-1],a)}3 a},P:4(a,b){a=$J(a,\'\');5(u.O){5(!2.A)2.A=S 1a(\'A\',{1F:\'D\'}).14(x.r);2.o=z.s;2.I[2.o]=a;2.M();2.A.1E(\'1D\',\'#\'+a).1C()}w 12.18.1A=a||\'#\';5(u.1i&&(!b||2.K)){5(!2.q){2.q=S 1a(\'q\',{1R:2.F.1o,1S:\'1T: 1x;\'}).14(x.r);2.15=2.8}1w{6 c=2.q.17.x;c.1v();c.1X(\'<R><r 16="8">\'+a+\'</r></R>\');c.1Y();2.K=1Z}1s(e){}}2.8=a},v:$v};L.v(28.1p);L.v(27.1p);26.v({C:4(a){3(2.1n()==a.1n())},1d:4(a){24(6 i=0,j=2.s;i<j;i++)2[i]=$J(2[i],a[i]||T);3 2}});',62,133,'||this|return|function|if|var|values|state|modules|||||||||||defaults|Class|empty|fireEvent|count|regexp|iframe|body|length|timeout|window|extend|else|document|bind|history|form|onGenerate|isSimilar|get|true|options|update||states|pick|istateOld|HistoryManager|observeTimeout|onStart|webkit419|setState|observe|html|new|null|generateState|getHash|unregister|generate|setValue|onStateChange|setValues|copy|top|stateSeparator|injectInside|istate|id|contentWindow|location|initialize|Element|onRegister|regexpParams|complement|onUnregister|started|each|observeDelay|ie|skipDefaultMatch|getState|dataOptions|onObserverChange|toString|iframeSrc|prototype|onUpdate|onMatch|catch|RegExp|setOptions|open|try|hidden|string|typeof|hash|w_|submit|action|setProperty|method|merge|innerText|substr|indexOf|href|100|200|delay|clear|register|join|src|styles|visibility|push|splice|match|write|close|false|periodical|start|remove|blank|for|set|Array|Options|Events'.split('|'),0,{}));

indexShow = new Class({
	initialize: function(sset1, sset2, options){
		// elements are [link1, body1, link2, body2, mainbody]
		this.link1 = $(sset1[0]);
		this.body1 = $(sset2[0]);
		this.link2 = $(sset1[1]);
		this.body2 = $(sset2[1]);
		this.mainbody = $(sset2[2]);
		this.fx1 = new Fx.Styles(this.link1, {duration: 400, transition: Fx.Transitions.linear, wait: false});
		this.fx2 = new Fx.Styles(this.link2, {duration: 400, transition: Fx.Transitions.linear, wait: false});
		this.fbx1 = new Fx.Styles(this.body1, {duration: 400, transition: Fx.Transitions.linear, wait: false});
		this.fbx2 = new Fx.Styles(this.body2, {duration: 400, transition: Fx.Transitions.linear, wait: false});
		this.link1.addEvent('mouseover', this.hover.bind(this, [this.fx2, this.fbx1]));
		this.link1.addEvent('mouseout', this.unhover.bind(this, [this.fx2, this.fbx1]));
		this.link2.addEvent('mouseover', this.hover.bind(this, [this.fx1, this.fbx2]));
		this.link2.addEvent('mouseout', this.unhover.bind(this, [this.fx1, this.fbx2]));
		this.size = this.mainbody.getSize().size;
		this.body1.setStyles({'height': this.size.y, 'position': 'relative', 'top': -1*this.size.y, 'margin-bottom': -1*this.size.y, 'display': 'block', 'background': '#ffffff', 'z-index': '8'});
		this.body2.setStyles({'height': this.size.y, 'position': 'relative', 'top': -1*this.size.y, 'margin-bottom': -1*this.size.y, 'display': 'block', 'background': '#ffffff', 'z-index': '8'});
	},
	hover: function(fx, hbody){
		fx.start({'opacity': 0.3});
		hbody.start({'opacity': 1, 'top': 0});
	},
	unhover: function(fx, hbody){
		fx.start({'opacity': 1});
		hbody.start({'opacity': 0, 'top': -1*this.size.y});
	},
	showDBL: function(){
		this.body1.setStyle('display', 'block'); this.body2.setStyle('display', 'block');
	},
	hideDBL: function(){
		this.body1.setStyle('display', 'none'); this.body2.setStyle('display', 'none');
	}
});

coolCard = new Class({
	Implements: [Options, Events],
	options: {

	},
	initialize: function(elements, options){
		elements.each(function(elm){
			var child = elm.getChildren();
			if (child.length != 2) return;
			var mfx = new Fx.Styles(elm, {duration: 200, transition: Fx.Transitions.linear, wait: false});
			mfx.stage = 0;
			var closer = $$(elm.getElementsByTagName('div')).filter(function(elm){ return elm.className == 'closecard'; })[0];
			closer.addEvent('click', function(event, timered){
				if (timered && !mfx.beIn) return;
				mfx.beIn = false;
				if (mfx.inProcess){
					closer.fireEvent('click', [event, true], 1000);
					return;
				}
				if (mfx.stage == 1){
					mfx.inProcess = true;
					mfx.start({'height': 0}).chain(function(){
						child[0].setStyle('display', 'block');
						child[1].setStyle('display', 'none');
						mfx.start({'height': 210 });
					}).chain(function(){
						mfx.stage = 0;
						mfx.inProcess = false;
					});
				}
			});
			elm.addEvents({'mouseenter': function(event){ mfx.beIn = true; if (mfx.inProcess) return; if (mfx.stage == 0) { mfx.inProcess = true; mfx.start({'height': 0}).chain(function(){ child[0].setStyle('display', 'none'); child[1].setStyle('display', 'block'); mfx.start({'height': 379 }); }).chain(function(){ mfx.stage = 1; mfx.inProcess = false; }); }; }});
		});
	}
});

smTelescope = new Class({
	initialize: function(elements, menus, options){
		this.elements = elements;
		this.len = this.elements.length;
		menus = menus[0].getChildren();
		this.menus = menus;

		if (menus.length != this.len || this.len == 0) return;
		this.mfx = [];
		this.mxfx = [];
		this.activeI = 0;
		smT = this;
		this.elements.each(function(elm, id){
			smT.mfx[id] = new Fx.Styles(elm, {duration: 200, transition: Fx.Transitions.linear, wait: false});
		});
		this.menus.each(function(elm, id){
			elm.addEvents({ 'click': smT.show.bind(smT, [id]), 'mouseover': function(event){ elm.addClass('hover'); }, 'mouseout': function(event){ elm.removeClass('hover'); } });
			//			smT.mxfx[id] = new Fx.Styles(elm, {duration: 200, transition: Fx.Transitions.linear, wait: false});
		});
	},
	show: function(lvl){
		smT = this;
		if (this.activeI == lvl) return;
		this.mfx[this.activeI].start({'opacity': 0}).chain(function(){ smT.elements[smT.activeI].setStyle('display', 'none'); smT.menus[smT.activeI].removeClass('active'); smT.elements[lvl].setStyles({'opacity': 0, 'display': 'block'}); smT.mfx[lvl].start({'opacity': 1}).chain(function(){ smT.menus[lvl].addClass('active'); smT.activeI = lvl; }); });
	}
});

myFooter = new Class({
	Implements: [Options, Events],
	options: {
		stWhite: false
	},
	initialize: function(ftoggle, footblock, options){
		this.ftoggle = ftoggle;
		this.footblock = footblock;
		this.fxtog = new Fx.Styles(this.ftoggle, {duration: 400, transition: Fx.Transitions.linear, wait: false});
		this.fxblock = new Fx.Styles(this.footblock, {duration: 200, transition: Fx.Transitions.linear, wait: false});
	},
	setStage: function(stWhite){
		var myFTR = this;
		if (stWhite == this.options.stWhite) return;
		if (stWhite){
			this.fxblock.start({'opacity': 0}).chain(function(){ myFTR.ftoggle.className = "tfoot footwhite"; myFTR.fxblock.start({'opacity': 1}); });
			this.fxtog.start({'background-color': '#FFFFFF'});
		}else{
			this.fxblock.start({'opacity': 0}).chain(function(){ myFTR.ftoggle.className = "tfoot footred"; myFTR.fxblock.start({'opacity': 1}); });
			this.fxtog.start({'background-color': '#75131E'});
		}
		this.options.stWhite = stWhite;
	}
});
myFooter.implement(new Options);

topMenu = new Class({
	options: {
		activeElm: 0
	},
	initialize: function(container, options){
		ttopMenu = this;
		this.elements = $$(container.getElementsByTagName('a'));
		this.pnames = [];
		this.elements.each(function(elm, id){
			ttopMenu.pnames[id] = parseInt(elm.title);
			elm.removeAttribute('title');
		});
	},
	setActive: function(pathname){
		var myInd = this.pnames.indexOf(pathname);
		if (myInd == -1) return;
		if (myInd == this.options.activeElm) return;
		this.elements[this.options.activeElm].removeClass('active');
		this.elements[myInd].addClass('active');
		this.options.activeElm = myInd;
	}
});
topMenu.implement(new Options);

fullAjax = new Class({
	options: {
		activeElm: 0,
		historyKey: ':',
		defHKey: ['/', '/index/'],
		nHeight: '70px',
		defTitle: '',
		beforeRollIn: Class.empty, // Constructor 1
		afterRollIn: Class.empty, // Constructor 2
		beforeRollOut: Class.empty, // Destructor 1
		afterRollOut: Class.empty // Destructor 2
	},
	initialize: function(headelm, bodyelm, options){
		var tfA = this;
		this.tmpdiv = new Element('div');
		this.headelm = headelm;
		this.bodyelm = bodyelm;
		this.headfx = new Fx.Styles(this.headelm, {duration: 340, transition: Fx.Transitions.linear, wait: false});
		this.bodyfx = new Fx.Styles(this.bodyelm, {duration: 350, transition: Fx.Transitions.linear, wait: false});
		this.setOptions(options);

		this.baseURL = (arr=/^http:\/\/([a-z0-9\.]+)/.exec(document.URL))?arr[1]:'';

		this.adoptAnchors(document.body); // !!!
		this.phiden = 0; // stage of effects 0 - elements are shown; 1 - elements are moving out; 2 - elements are moving in
		this.ploaded = true; // stage of loading false - still loading; true - loaded
		this.aPath = ""; // active path

		this.HStarted = false;
		this.scriptLoaded = false; // Is the script loaded properly ?

		this.history = HistoryManager.register(// arguments are (key, defaults, onMatch, onGenerate, regexp, options)
		this.options.historyKey,
		// Array with default values, here index 0 is the current page index
		this.options.defHKey,
		// onMatch, callback when the state changed
		function(values) {
			if (!tfA.HStarted && values[0] == "/") return;
			tfA.open(values[0]);
		}.bind(this),
		// onGenerate, callback that returns the string for the hash
		function(values) {
			return [tfA.options.historyKey, '', values[0], ''].join('');
		}.bind(this),
		// RegExp for the hash value, works
		this.options.historyKey + '(([a-z0-9_\\/]+))');
		this.$events = {};
	},
	open: function(path){
		var tfA = this;
		if (!this.ploaded || (this.phiden != 0)){ this.history.setValue(0, this.aPath); return; }
		this.ploaded = false; this.phiden = 1;
		this.fireEvent('beforeRollOut');
		var newPage = new Ajax('/getajax.php', {'method': 'post', 'data': {'p': path}, 'evalScripts': true, 'onComplete': function(text){
			tfA.aPath = path;
			tfA.tmpdiv.setHTML(text);
			tfA.adoptAnchors(tfA.tmpdiv);
			tfA.ploaded = true;
			tfA.showattempt();
		}}).request();
		tfA.scriptLoaded = false;
		var screenX = window.getSize().size.x;
		var wdt1 = (screenX + 940)/2, wdt2 = (screenX + 820)/2;
		tfA.headfx.start({'left': wdt1}).chain(function(){ document.body.className = 'preload'; tfA.headelm.setStyle('left', '-' + wdt1 + 'px'); });
		tfA.bodyfx.start({'left': -1*wdt2}).chain(function(){ tfA.phiden = 2; tfA.bodyelm.setStyle('left', wdt2 + 'px'); tfA.fireEvent('afterRollOut'); tfA.showattempt(); });
	},
	adoptAnchors: function(elm){
		var tfA = this;
		var noext='((\.[a-z0-9]{3})$|^javascript\:|http:\/\/)'
		var anchors = $$(elm.getElementsByTagName('a'));
		anchors.each(function(elm){
			var mhref = elm.getProperty('href');
			if (arr=/^((\w+):\/\/)?((\w+):?(\w+)?@)?([^\/\?:]+):?(\d+)?(\/?[^\?#]+)?\??([^#]+)?#?(\w*)/.exec(mhref)) if (arr[6] == tfA.baseURL) mhref = arr[8];
			//			if (mhref.test('.\'))
			if (!mhref || mhref.test(noext)) return;
			elm.setProperty('href', '#:' + mhref);
		});
	},
	showattempt: function(){
		if ((this.phiden != 2) || !this.ploaded || !this.scriptLoaded) return;
		tfA = this;
		tfA.phiden = 3;
		var elms = $$(tfA.tmpdiv.getChildren()).filter(function(item, index){ return item.tagName == "DIV"; });
		tfA.headelm.setHTML(elms[0].innerHTML);
		tfA.bodyelm.setHTML(elms[1].innerHTML);
		document.body.className = '';
		tfA.fireEvent('beforeRollIn');
		tfA.headfx.start({'left': 0});
		tfA.bodyfx.start({'left': 0}).chain(function(){ document.body.className = ''; if (tfA.phiden != 3) return; tfA.phiden = 0; tfA.fireEvent('afterRollIn'); });
	},
	setTitle: function(newTitle){ document.title = ((newTitle != '')?(newTitle + " :: "):'') + this.options.defTitle; }
});
fullAjax.implement(new Events, new Options, new Chain);

function sendmail(mform){
	mform = $(mform);
	var elm = mform.getParent().getNext();
	elm.setHTML('<img src="/images/pr1.gif" />');
	elm.getParent().addClass('cresp');
	var myAjax = new Ajax('/_admindata/run/sendmail.php', {method: 'post', data: {'myname': mform.myname.value, 'myemail': mform.mymail.value, 'message': mform.message.value, 'person': mform.person.value}, onComplete: function(data){ elm.setHTML(data); elm.getParent().addClass('cresp'); }}).request();
}

function bform(elm){
	var eform = $('cardform' + elm).getParent().getParent();
	eform.removeClass('cresp');
}

var szNormal = -400, szSmall = -410, szFull = 0; // Для трех вкладок. Для большего числа значения генерируются автоматически
var myFoot, myTop, myAjax, myTips;
window.addEvent('domready', function(){
	// Top menu
	myTop = new topMenu($$('.tbmenu .d1')[0]);
	// And footer:
	myFoot = new myFooter($('ftoggle'), $('footblock'));
	// And the whole class
	myAjax = new fullAjax($('headblock'), $('cnblock'), {});
	
	myTips = new Tips(document.getElements('var'), {'className': 'custom', 'preloadInsert': document.getElement('.hiddenclass')});
	HistoryManager.start();
	myAjax.HStarted = true;
});