



window.addEvent('domready', function(){
									 
	// This script makes mouse over for .btn class
	$(document.body).getElements('span.btn').addEvents({
		'mouseenter': function(){this.addClass('btn-over');},
		'mouseleave': function(){this.removeClass('btn-over');}
	});
	
	
	// This script makes sliding panels
	function make_slider(toggler, panel){
		if (!$(toggler)) return;
		if (!$(panel)) return;
		var hide = arguments[2];

		var myFx = new Fx.Slide(panel, {duration: 666, transition: Fx.Transitions.Expo.easeOut});	
		if(hide) myFx.hide();
		$(toggler).addEvent('click', function(){myFx.toggle();});
	}
	
	
	// Make sliding LOGIN panel
	make_slider('btn-login', 'login-panel', 1);

	// Make sliding VIEW ALL VIDEOS of user
	make_slider('btn-video-viewall', 'user-video', 1);

	// Make sliding VIEW ALL VIDEOS of user
	make_slider('btn-user-video-close', 'user-video', 1);


	// This script allows input fields to toggle their values on blur/focus. USE: title="YOUR_DEFAULT_VALUE"
	var inp_text = $$('.inp input[type=text]');
	for(var i in inp_text) if(inp_text[i].title) if(!inp_text[i].value) inp_text[i].value = inp_text[i].title;
	$$('.inp input[type=text]').addEvents({
		'focus':function(){
			if(this.title == this.value) this.value = '';
		},
		'blur':function(){
			if(!this.value) this.value = this.title;
		}
	});

});
		
		
		
