$(document).ready(function() {

	hideInputValue($('#login_input_email'));
	hideInputValue($('#login_input_password'));
	
	
	$('#navigation ul > li').hover(
		function() {
			$('.dropdown', this).slideDown(100); 
			//$(this).addClass("active");
		},
		function() { 
			$('.dropdown', this).slideUp(150); 
			//$(this).removeClass("active");
		}
	);
	
	
	
	var introMore = $('#intro_more');
	var introMoreButtonP = $('#intro_more_button');
	var introMoreButton = introMoreButtonP.children('a');
	var originalButton = introMoreButton.text();
	var intro = $('#intro');
	var originalHeight = intro.height() + 20;
	var tinyHeight = 143;

	intro.height(tinyHeight);	
	introMore.hide();
	introMoreButtonP.show();

	/*
	introMoreButton.toggle(function() {
		intro.animate({ 'height' : originalHeight });
		introMore.fadeIn();
		introMoreButton.text('kevesebb');
		return false;
	}, function() {
		introMore.fadeOut();
		intro.animate({ 'height' : tinyHeight });
		introMoreButton.text(originalButton);
		return false;
	});
	*/
	
	
	$('#splash').cycle('fade');
	
	$('#video_selector ul li a').click(function() {
		var video = $(this).attr('class');
		$('#player div').hide();
		$('#player .' + video).show();
		return false;
	});

});



function hideInputValue(element, defaultValue) {


	if (defaultValue == undefined) {
		defaultValue = element.val();
	}
	
	element.focus(function() {
		if (this.value == defaultValue) {
			this.value = '';
		}
	});
	
	element.blur(function() {
		if (this.value == '' || this.value == defaultValue) {
			this.value = defaultValue;
		}
	});

}
