function panelnothing() {
}

function setMovie(movie, desc) {
	if(panelmovieshow == 0) {
		$("#panelmovie embed").remove();
		$("#panelmovie").show("slow");
		panelmovieshow = 1;
		$("#player").show("slow");
		setTimeout("setPlayerWithMovie('"+movie+"');", 1500);
	} else {
		setPlayerWithMovie(movie);
	}
	/*$("div#playerinfo div").each(function(index) {
		var el = $(this);
		el.hide();
	});*/
	$("#description_movie").hide();
	$.post(root_path+"/movie_desc.php", { description: desc }, function(data){ $("#description_movie").html(data); });
	$("#description_movie").show("slow");
}

function setPlayerWithMovie(movie) {
	flashembed('player', {
			src: adress_player + adress_play_player, 
			width: 440, 
			height: 245,
			id: 'playerpanel'
		}, {
		config: {
			showMenu: false,
			autoPlay: true, 
			autoBuffering: false, 
			autoRewind:true,
			loop:false,
			controlsOverVideo: 'ease',
			initialScale: 'scale', 
			emailPostUrl: false,
			loop:false,
			emailVideoLink: '',
			embedCode: 'Please contact',
			useEmbeddedButtonImages: false,
			videoFile: movie,
			noVideoClip: { url: adress_player + no_image_player, duration: 10 }
		}}
	);
};

$(function() { 
	$("#another_movie img").each(function(index) {
		var el = $(this);
		el.fadeTo(1, 0.4).filter(".panelmosel").fadeTo(1, 1.0);
		el.hover(
			function() {
				if (!$(this).is(".panelmosel")) $(this).fadeTo(10, 0.8);
			},
			function() {
				if (!$(this).is(".panelmosel")) $(this).fadeTo(500, 0.4);
			}
		);
		el.click(function() {
			$("#another_movie img").not(el).removeClass("panelmosel").fadeTo(500, 0.4);
			$(this).addClass("panelmosel").fadeTo(1, 1.0);
			/*$("#another_movie a").each(function(indexa) {
				if (indexa == index) {
					var el_a = $(this).attr('href');
					$(this).attr({ href: "javascript:panelnothing();" });
					setMovie(el_a);
					setTimeout("$(this).attr({ href: el_a });",1500);
				}
			});*/
		});    
	});
}); 

function hidemovie_panel() {
	if(panelmovieshow == 1) {
		$("#player").hide();
		$("#panelmovie").hide("slow");
		panelmovieshow = 0;
	} else {
		$("#panelmovie").show("slow");
		setTimeout('$("#player").show("slow")', 500);
		panelmovieshow = 1;
	}
};