$( document ).ready(function() {
$('#reservation_id').on('change', function() {
$name = $(this).find("option:selected").text();
$("#seat-map").fadeIn("slow");
$("#table-map").fadeOut("slow");
$("#set-row").fadeIn("slow");
$("#seattemplate").fadeIn("slow");
$("#amountSeatsDiv").fadeIn("slow");
$("#prices").fadeIn("slow");
$("#payableCulturecard").fadeIn("slow");
$("#concession_div").fadeIn("slow");
$("#price-blue").fadeIn("slow");
$("#price-red").fadeIn("slow");
if($name === "Mit Platzwahl" || $name === "Mit Tischwahl"){
$("#amountSeatsDiv").fadeOut("slow");
}
if($name === "Keine"){
$("#seat-map").fadeOut("slow");
$("#set-row").fadeOut("slow");
$("#seattemplate").fadeOut("slow");
$("#amountSeatsDiv").fadeOut("slow");
$("#prices").fadeOut("slow");
$("#payableCulturecard").fadeOut("slow");
$("#concession_div").fadeOut("slow");
}
if($name === "Ohne Platzwahl"){
$("#seat-map").fadeOut("slow");
$("#set-row").fadeOut("slow");
$("#seattemplate").fadeOut("slow");
$("#price-blue").fadeOut("slow");
$("#price-red").fadeOut("slow");
}
if($name === "Mit Tischwahl"){
$("#table-map").fadeIn("slow");
$("#seat-map").fadeOut("slow");
$("#set-row").fadeOut("slow");
$("#seattemplate").fadeOut("slow");
$("#price-red").fadeOut("slow");
}
});
$('#reservation_id').change();
// var sm = $('#seatMap');
// var init_seatmap = sm.val().split("\n");
// var category_price = [];
// console.log(category_price);
// sm.removeAttr("disabled");
// sm.removeClass("loading");
// $('#seatMap').on('keyup', function() {
// checkValidSeatplan();
// updateCategoryPrice();
// });
//
// function updateCategoryPrice(){
// //
//
// }
//
// function checkValidSeatplan(){
// if(!isValidSeatplan()){
// sm.addClass("invalid");
// $("#update_event_submit").prop('disabled', true);
// }else{
// sm.removeClass("invalid");
// $("#update_event_submit").prop('disabled', false);
// }
// }
//
// function isValidSeatplan(){
// valid = true;
// var splitted = sm.val().split("\r\n");
// for(var i=0; i