$(document).ready(function() {
	fixIE6('.presse');

	$('a').each(function(){
		if (typeof($(this).attr("href")) != 'undefined' &&  $(this).attr("href").search(/etracker/) >= 0) {
			$(this).css({ 'background': 'none' });
		}
	});
	
	$('.views-field-field-image-required-fid').hover(function() {
		$('.social', this).css({ 'display': 'block' });
		fixIE6(this);
	}, function() {
		$('.social', this).css({ 'display': 'none' });
	});
});

function fixIE6(item) {
	if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) {
		var ieversion = new Number(RegExp.$1);
		if (ieversion < 7) {
			$('img', item).ifixpng();
		}
	}
}

// track trailer views
function trackGoogle(state) {
	pageTracker._trackEvent('Video', state, 'Trailer');
	pageTracker2._trackEvent('Video', state, 'Trailer');
}

function open_movie(file) {
	
	$("#content-box").css("visibility", "hidden");
	$("#flash-box").append('<div id="flash"></div>');
	$("#flash-box").show();

	swfobject.createSWF({
       width : 960,
       height : 384,
       wmode : "transparent",
       data : file
    }, {}, "flash");
}

function close_movie() {
	swfobject.removeSWF("flash");
    $("#content-box").css("visibility", "visible");
    $("#flash-box").hide();
}

function resize_movie(direction) {
	if (direction == "down") {
		$(".webtv_movie").animate({height: "382px"}, 1000);
	} else {
		$(".webtv_movie").animate({height: "200px"}, 1000);
	}
}