function openRespons(id) {
	reactie = $("#reactietxt_" + id).html();
	
	reactie_field = "<textarea class=\"respons_field\" name=\"bericht\" id=\"bericht\">" + reactie + "</textarea>";
	$("#reactietxt_" + id).html(reactie_field);

	$("#reactief_" + id).css("display", "none");
	$("#reactief_" + id + "_opslaan").css("display", "block");
}

function editRespons(id) {
	
	var currentTime = new Date();
	
	params = {
	type: "edit",
	id: id, 
	bericht: $("#bericht").val()
	};

	$.post("ajax_respons.php",
   	params,
   	function(data){
   		$("#reactietxt_" + id).html(data);
   	}
 	);
	
 	$("#reactief_" + id).css("display", "block");
	$("#reactief_" + id + "_opslaan").css("display", "none");
}

function deleteRespons(id) {
	//removing FCK editor produces errors, therefore only hide it...
	$("#chapter_" + id).css("display", "none");
	$("#chapter_title_" + id).remove();
	
	//ajax call to delete chapter
	params = {
	id: id,
	type: "del"
	};

	$.get("ajax_chapter.php",
   	params,
   	function(data){
   	
   	}
 	);
}

function emptyField(name, value) {
	value = unescape(value);
	
	if($("#" + name).val() == value) {
		$("#" + name).val("");
	}
}

function orakelNext(page) {
	nextpage = page + 1;
	$("#questiondivider" + page).hide();
	$("#questiondivider" + nextpage).show();
	
	goToTop("top_filmorakel")
}

function goToTop(top) {
	currenturl = document.location.href;
	if(currenturl.indexOf(top) != -1) {
		currenturl.replace("#" + top, "");
	}
	document.location.href = currenturl + "#" + top;
}
 
/*
$().ready(function() {
	
	$('#chapterlist').Sortable(
		{
			tag :			'div',
			accept : 		'chapteritem',
			axis:			'vertically',
			//helperclass : 	'chapterhelper',
			//activeclass : 	'chapteractive',
			//hoverclass : 	'chapterhover',
			fx:				200,
			opacity:		0.4,
			revert:			true
		}
	);
	
});
*/

window.onload = function(){
	
	var options = {
		animate:			false,
        autoplayMovies:     false
    };
	
	Shadowbox.init(options);

};
