		window.addEvent('domready', function(){

var html = document.documentElement;

var xm = $('main').getSize();

if(xm.y<html.clientHeight){
	$('main').setStyle('height', html.clientHeight-30);
	$('ctr').setStyle('height', html.clientHeight-140);
	
	var xc = $('ctr').getSize();
	var xr = $('rotar').getSize();
//	alert(xr.y);
	$('rotar').setStyle('margin-top', (xc.y-xr.y)/2);
	
}
//alert("Размер вьюпорта: "+ html.clientWidth +"х"+ html.clientHeight);
/*		var social = $$('.soci');
		social.each(function(item,i){			
			var soc = new Fx.Morph(item, { duration: 2000, transition: Fx.Transitions.Elastic.easeOut, link: 'cancel' });
			item.addEvents({
					'mouseenter': function(e){
						soc.start({
						'background-position': 'left 0px'
						});
					},
					'mouseleave': function(){
						soc.start({
						'background-position': 'left -30px'
						});
					}
				});
		})
			
*/			
/*			var xb = $('nm').getSize();
			var pb = $('nm').getPosition();
			$('arr2').setStyle('left',pb.x-10);
			//
			var sl = new Fx.Morph($('arr2'), { duration: 2000, transition: Fx.Transitions.Elastic.easeOut, link: 'cancel' });
*/			var menuHeadItems = $$('.ml');
			
			menuHeadItems.each(function(item, i){
				var morph = new Fx.Morph(item, { duration: 900, transition: Fx.Transitions.Elastic.easeOut, link: 'cancel' });
				
				morph.start.delay(i * 100, morph, {
					'color': '#e0e0e0',
					'margin-left': 0
				});
				
				item.addEvents({
					'mouseenter': function(e){
						morph.start({
							'color'   : '#a60e2e'
						});
					},
					'mouseleave': function(){
						morph.start({
							'color': ['#a60e2e','#e0e0e0']
						});
					}
				});
			});
		});
