window.addEvent('domready', function() {
	var status = {
		'true': 'open',
		'false': 'close'
	};
	
	try{

		var myVerticalSlide = new Fx.Slide('vertical_slide');
		myVerticalSlide.hide();
		$('showHideLogin').addEvent('click', function(e){
			if(status[myVerticalSlide.open] == 'open'){
				
				$('showHideLogin').set('html', 'вход');
				e.stop();
				myVerticalSlide.slideOut();
				
			}
			else{

				$('showHideLogin').set('html', 'затвори');
				e.stop();
				myVerticalSlide.slideIn();
			}
		});
		
		if(status[myVerticalSlide.open] == 'open'){
			$('showHideLogin').set('html', 'затвори');
		}
		else{
			$('showHideLogin').set('html', 'вход');
		}
	}
	catch(err){}
	
	//FADE OUT MOUSE OVER
	//---------------------------------
	var el = $$('.myElement'),
		color = el.getStyle('backgroundColor');
	
	// We are setting the opacity of the element to 0.5 and adding two events
	$$('.myElement').set('opacity', 1).addEvents({
		mouseenter: function(){
			// This morphes the opacity and backgroundColor
			this.morph({
				'opacity': 0,
				'background-color': '',
				'duration': 200
			});
		},
		mouseleave: function(){
			// Morphes back to the original style
			this.morph({
				opacity: 1,
				backgroundColor: color,
				'duration': 200
			});
		}
	});
		//FADE OUT MOUSE OVER BUTTONS
	//---------------------------------
	var el = $$('.myElement1'),
		color = el.getStyle('backgroundColor');
	
	// We are setting the opacity of the element to 0.5 and adding two events
	$$('.myElement1').set('opacity', 1).addEvents({
		mouseenter: function(){
			// This morphes the opacity and backgroundColor
			this.morph({
				'opacity': 0.5,
				'background-color': '',
				'duration': 500
			});
		},
		mouseleave: function(){
			// Morphes back to the original style
			this.morph({
				opacity: 1,
				backgroundColor: color,
				'duration': 500
			});
		}
	});
	//TIP TOOl
	//---------------------------------
	var Tips1 = new Tips($$('.Tips1'));
	var Tips2 = new Tips($$('.Tips2'));
	//BACKGROUND
	//---------------------------------
	//var bodyElement = $(document.body).set('opacity', 0.4);;
	//$('.myElement').set('opacity', 1);

	
});
