
$(document).ready(function () {

	// index effect  just ply with cover class
		$("div.cover").css({ opacity: 0 });
		$('.boxgrid.captionfull').hover(function(){
					$(".cover", this).stop().animate({opacity: .8 ,top:'160px'},{queue:false,duration:500});
				}, function() {
					$(".cover", this).stop().animate({top:'260px'},{queue:false,duration:500});
				});

	
	
	// end index effect


	$("div.accordion h3:first").addClass("active_tab");
	$("div.accordion div.saison_tab").hide();
	$("div.accordion h3").click(function(){
		$(this).next("div").slideToggle("slow")
		.siblings("div:visible").slideUp("slow");
		$(this).toggleClass("active_tab");
		$(this).siblings("h3").removeClass("active_tab");
	});




	$('select#episodeslist').change(function(){
			
			window.location.href = window.location.href.substring(0,window.location.href.indexOf("=")+1)+jQuery('#episodeslist option:selected').val()+".html";
		
			return false;
			
		});
		
	$('#basic-modal a.basic').click(function (e) {
		e.preventDefault();
		$('#basic-modal-content').modal();
	});
	
	
$('a#edit_film').click(function () {
	var film_id = $('input#film_id').val();
	var film_titre = $('input#film_titre').val();
	var film_photo = $('input#film_photo').val();
	var film_genre = $('input#film_genre').val();
	var film_duration = $('input#film_duration').val();
	var film_acteurs = $('input#film_actors').val();
	var film_production_year = $('input#film_production_year').val();
	var film_date_add = $('input#film_date_add').val();
	var film_synopsis = $('textarea#film_synopsis').val();


	$('#ajax_form_m4').fadeOut('slow');
	$('div#loading_image').fadeIn('slow');
		
	 $.ajax({
			type: "POST",
			url: "ajax.edit.php",
			cache: true,
			data: "video_id="+film_id+"&titre="+film_titre+"&photo="+film_photo+"&annee="+film_production_year+"&acteurs="+film_acteurs+"&duree="+film_duration+"&genres="+film_genre+"&synopsis="+film_synopsis+"&type_action=update",       
			
			success: function(msg){
			$('#loading_image').fadeOut('slow');
			$('p#response_msg').html(msg);
			$('p#response_msg').fadeIn('slow');
			setTimeout("location.reload(true);",1000);
			}
			
		
	   
	 });


	
});


});

