window.loader = {
	'start':function(){
	
		var scrollTop = self.pageYOffset || (document.documentElement && document.documentElement.scrollTop) || (document.body && document.body.scrollTop);
		var top = (window.getHeight()-this.offsetHeight)/2+scrollTop;
		if (!$('mloader')) {
			$(document.body).adopt([
				new Element('div',{
					'id':'mloader',
					'styles':{
						position:'absolute',
						left:0,
						top:0,
						width:'100%',
						height:window.getHeight()+scrollTop,
						textAlign:'center',
						//backgroundColor:'black',
						zIndex:999998,
						opacity:'0.8'
					}
				}),
				new Element('div',{
					'id':'mloader-content',
					'styles':{
						color:'white',
						position:'fixed',
						left:0,
						width:'100%',
						top:window.getHeight()/2,
						textAlign:'center',
						zIndex:999999,
					},
					'html':'<div style="background-color:white; padding:20px 0px; width:100px; margin:auto; border:solid 1px black;"><img src="/resources/mootools/loader/ajax-loader.gif" /><br /><a href="#" onclick="loader.stop();return false;">отмена</a></div>'
				}),
			]);
		};
	},
	'stop':function(){
		if ($('mloader')) {
			$('mloader').destroy();
			$('mloader-content').destroy();
		}
	}
};
