$(document).ready(function() {
	
	// Group selection
	$('.group_wrapper').unbind('mouseenter').bind('mouseenter', function() {
		$('.title', this).removeClass('inactive').addClass('active');
		$(this).stop().animate({
			'height': '176px'
		});
	});
	
	$('.group_wrapper').unbind('mouseleave').bind('mouseleave', function() {
		$('.title', this).removeClass('active').addClass('inactive');
		$(this).stop().animate({
			'height': '31px'
		});
	});
	
	// Group selection item hover
	$('.menu_overlay').css({
		'opacity': '0.3'
	});

	$('.item').unbind('mouseenter').bind('mouseenter', function() {
		$('.menu_overlay', this).stop().animate({
			'width': '229px'
		}, 250);
	});
	
	$('.item').unbind('mouseleave').bind('mouseleave', function() {
		$('.menu_overlay', this).stop().animate({
			'width': '0px'
		});
	});
	
	
	// Image wrapper
	$('.shutter').css({
		'opacity': '0.3'
	});
	$('.image_wrapper').unbind('mouseenter').bind('mouseenter', function() {
		$('.shutter', this).stop().animate({
			'height': '200px'
		}, 250);
	});
	
	$('.image_wrapper').unbind('mouseleave').bind('mouseleave', function() {
		$('.shutter', this).stop().animate({
			'height': '0px'
		});
	});
	
	
	// Links
	$('.link').unbind('mouseenter').bind('mouseenter', function() {
		$(this).stop().animate({
			'backgroundPosition': '8px 6px'
		}, 100);
	});
	
	$('.link').unbind('mouseleave').bind('mouseleave', function() {
		$(this).stop().animate({
			'backgroundPosition': '0px 6px'
		});
	});
	
	
	
	/* Recommendation BEG */
	$("#fe_recommend").click(function () {
		$("#recommendation_container").animate({
			'top': '-420px',
			'height' : '380px'
		}, 700);
	});

	$("#hide_recommendation").click(function () {
		$("#recommendation_container").animate({
			'top': '0px',
			'height' : '0px'
		}, 700);
	});

	var recommendation_message = '';
	$('#recommendation_message').keyup(function(ekey) {
		$('#recommendation_msg_count').text(100 - $(this).val().length);
		if (recommendation_message.length >= 100 && ekey.which != 8 && ekey.which != 46) {
			$(this).val(recommendation_message);
		} else {
			recommendation_message = $(this).val();
		}
	});


	$("#send_recommendation").click(function () {
		$('<input>')
			.css('display', 'none')
			.attr({
				name: 'recommendation_sent',
				value: 'sent_true'
			})
			.appendTo('#form_recommendation')
		;

		$('#form_recommendation').attr({
			'method': 'post'
		}).submit();
	});
	/* Recommendation END */

});

/* IE 6 message */
function checkIE6() {
	if ($.browser.msie && parseInt($.browser.version, 10) < 7) {
		$("#ie6error").css({
			'display': 'block'
		});
		$('#currentBrowserVersion').text($.browser.version);

		$("#ie6error div").click(function () {
			$("#ie6error").css({
				'display': 'none'
			});
		});
	}
}
/* IE 6 message END */

function getMovieObjOfId(movieName) {

	var isIE = navigator.appName.indexOf("Microsoft") != -1;
	var flObj = (isIE) ? window[movieName] : document[movieName];

	return flObj;
}





