var MWAlert 

window.addEvent('domready', function() {

	var mySlide = new Fx.Slide('headerhide').hide();  
 		
    	$('openheader').addEvent('click', function(e){
			e = new Event(e);
			mySlide.toggle(); 
			e.stop();
		});
	
	var mySlide2 = new Fx.Slide('headerhide2').hide();  
 		
    	$('openheader2').addEvent('click', function(e){
			e = new Event(e);
			mySlide2.toggle(); 
			e.stop();
		});
		


	// Fancy Show / Hide
	Element.implement({
		fancyShow: function() {
			this.fade('in');
		},
		fancyHide: function() {
			this.fade('out');
		}
	});

	// Smooth Scroll
 	new SmoothScroll({ duration:700 }, window); 
	
	// Remove Unloaded Images
	$$('img').addEvent('error',function() {
		this.dispose();
	});

	//Alert box
	 MWAlert = new Roar({position: 'bottomLeft',duration:5000});
	// Login
	if($("login_button")){
		$("login_button").addEvent('click',function(){	
			var theModal = new FbModal({id: 'login_window',width:400,showActionButton:true,
			onShow: function(){
				this.loadContent("/felhasznalo/login/form.html");
				this.container.setStyle('display', 'block').fade(1);
			},
			onHide: function(){(
				function(){
					this.setStyle('display', 'none');
				}).delay(600, this.container.fade(0));
			}
			}).show();
		});	
	}		
});

