
function update_cart() {
	porto = 0;
	finalamount = 0;
	
	need_to_change = false;
	need_to_change_first = false;
	
	data_row1 = '';
	data_row2 = '';
	data_row3 = '';
	data_row4 = '';
	data_row5 = '';
	
	// PARKETT A
	
	data1 = '<strong>Eintrittskartengutschein | Parkett A</strong><br/>';
	data2 = '<br/>';
	data3 = '<br/>';
	$('.orderform input[name^="parkett_a"]').each(function() {
		if ($(this).val() != "") {
			data1 += $(this).attr('rel')+'<br/>';
			data2 += ''+$(this).val()+' x '+($(this).attr('id') * 1).toFixed(2)+'<br/>';
			data3 += ''+($(this).val() * $(this).attr('id')).toFixed(2)+' EUR<br/>';
			need_to_change = true;
			need_to_change_first = true;
			finalamount += ($(this).val() * $(this).attr('id'));
		}
	});
	
	if (need_to_change) {
		data_row1 = '<div class="cart_item"><div class="cart_item_1">'+data1+'</div><div class="cart_item_2">'+data2+'</div><div class="cart_item_3">'+data3+'</div><div class="clear"></div></div>';
	}
	
	// PARKETT B
	
	need_to_change = false;
	data1 = '<strong>Eintrittskartengutschein | Parkett B</strong><br/>';
	data2 = '<br/>';
	data3 = '<br/>';
	$('.orderform input[name^="parkett_b"]').each(function() {
		if ($(this).val() != "") {
			data1 += $(this).attr('rel')+'<br/>';
			data2 += ''+$(this).val()+' x '+($(this).attr('id') * 1).toFixed(2)+'<br/>';
			data3 += ''+($(this).val() * $(this).attr('id')).toFixed(2)+' EUR<br/>';
			need_to_change = true;
			need_to_change_first = true;
			finalamount += ($(this).val() * $(this).attr('id'));
		}
	});
	if (need_to_change) {
		data_row2 = '<div class="cart_item"><div class="cart_item_1">'+data1+'</div><div class="cart_item_2">'+data2+'</div><div class="cart_item_3">'+data3+'</div><div class="clear"></div></div>';
	}
	
	// PARKETT C
	
	need_to_change = false;
	data1 = '<strong>Eintrittskartengutschein | Parkett C</strong><br/>';
	data2 = '<br/>';
	data3 = '<br/>';
	$('.orderform input[name^="parkett_c"]').each(function() {
		if ($(this).val() != "") {
			data1 += $(this).attr('rel')+'<br/>';
			data2 += ''+$(this).val()+' x '+($(this).attr('id') * 1).toFixed(2)+'<br/>';
			data3 += ''+($(this).val() * $(this).attr('id')).toFixed(2)+' EUR<br/>';
			need_to_change = true;
			need_to_change_first = true;
			finalamount += ($(this).val() * $(this).attr('id'));
		}
	});
	
	if (need_to_change) {
		data_row3 = '<div class="cart_item"><div class="cart_item_1">'+data1+'</div><div class="cart_item_2">'+data2+'</div><div class="cart_item_3">'+data3+'</div><div class="clear"></div></div>';
	}
	
	// SATT UND LUSTIG
	
	need_to_change = false;
	data1 = '<strong>Eintrittskartengutschein | Satt und Lustig</strong><br/>';
	data2 = '<br/>';
	data3 = '<br/>';
	$('.orderform input[name^="essen_show"]').each(function() {
		if ($(this).val() != "") {
			data1 += $(this).attr('rel')+'<br/>';
			data2 += ''+$(this).val()+' x '+($(this).attr('id') * 1).toFixed(2)+'<br/>';
			data3 += ''+($(this).val() * $(this).attr('id')).toFixed(2)+' EUR<br/>';
			need_to_change = true;
			need_to_change_first = true;
			finalamount += ($(this).val() * $(this).attr('id'));
		}
	});
	
	if (need_to_change) {
		data_row4 = '<div class="cart_item"><div class="cart_item_1">'+data1+'</div><div class="cart_item_2">'+data2+'</div><div class="cart_item_3">'+data3+'</div><div class="clear"></div></div>';
	}
	
	// BRUNCH
	
	need_to_change = false;
	data1 = '<strong>Eintrittskartengutschein | Brunch</strong><br/>';
	data2 = '<br/>';
	data3 = '<br/>';
	$('.orderform input[name^="brunch"]').each(function() {
		if ($(this).val() != "") {
			data1 += $(this).attr('rel')+'<br/>';
			data2 += ''+$(this).val()+' x '+($(this).attr('id') * 1).toFixed(2)+'<br/>';
			data3 += ''+($(this).val() * $(this).attr('id')).toFixed(2)+' EUR<br/>';
			need_to_change = true;
			need_to_change_first = true;
			finalamount += ($(this).val() * $(this).attr('id'));
		}
	});
	
	if (need_to_change) {
		data_row5 = '<div class="cart_item"><div class="cart_item_1">'+data1+'</div><div class="cart_item_2">'+data2+'</div><div class="cart_item_3">'+data3+'</div><div class="clear"></div></div>';
	}
	
	if (need_to_change_first) {
		porto = 3.00;
		$('#shopping_cart_js_calc').html('');
		$('#shopping_cart_js_calc').append(data_row1+data_row2+data_row3+data_row4+data_row5);
				
		$('.porto .cart_item_3').html(str_replace('.', ',', (porto.toFixed(2)+' EUR')));
		$('.gesamt .cart_item_3').html(str_replace('.', ',', ((finalamount+porto).toFixed(2)+' EUR')));
	}
}


function update_ticket_cart() {
	porto = 0;
	finalamount = 0;
	
	need_to_change = false;
	need_to_change_first = false;
	
	parkett = false;
	brunch = false;
	
	data_row1 = '';
	data_row2 = '';
	data_row3 = '';
	data_row4 = '';
	data_row5 = '';
	
	// PARKETT A
	
	data1 = '<strong>Eintrittskarten | Parkett A</strong><br/>';
	data2 = '<br/>';
	data3 = '<br/>';
	$('.orderform input[name^="parkett_a"]').each(function() {
		if ($(this).val() != "") {
			parkett = true;
			data1 += $("select#parkett_a_date_selection").val()+'<br/>';
			data2 += ''+$(this).val()+' x '+($(this).attr('id') * 1).toFixed(2)+'<br/>';
			data3 += ''+($(this).val() * $(this).attr('id')).toFixed(2)+' EUR<br/>';
			need_to_change = true;
			need_to_change_first = true;
			finalamount += ($(this).val() * $(this).attr('id'));
		}
	});
	
	if (need_to_change) {
		data_row1 = '<div class="cart_item"><div class="cart_item_1">'+data1+'</div><div class="cart_item_2">'+data2+'</div><div class="cart_item_3">'+data3+'</div><div class="clear"></div></div>';
	}
	
	// PARKETT B
	
	need_to_change = false;
	data1 = '<strong>Eintrittskarten | Parkett B</strong><br/>';
	data2 = '<br/>';
	data3 = '<br/>';
	$('.orderform input[name^="parkett_b"]').each(function() {
		if ($(this).val() != "") {
			parkett = true;
			data1 += $("select#parkett_b_date_selection").val()+'<br/>';
			data2 += ''+$(this).val()+' x '+($(this).attr('id') * 1).toFixed(2)+'<br/>';
			data3 += ''+($(this).val() * $(this).attr('id')).toFixed(2)+' EUR<br/>';
			need_to_change = true;
			need_to_change_first = true;
			finalamount += ($(this).val() * $(this).attr('id'));
		}
	});
	if (need_to_change) {
		data_row2 = '<div class="cart_item"><div class="cart_item_1">'+data1+'</div><div class="cart_item_2">'+data2+'</div><div class="cart_item_3">'+data3+'</div><div class="clear"></div></div>';
	}
	
	// PARKETT C
	
	need_to_change = false;
	data1 = '<strong>Eintrittskarten | Parkett C</strong><br/>';
	data2 = '<br/>';
	data3 = '<br/>';
	$('.orderform input[name^="parkett_c"]').each(function() {
		if ($(this).val() != "") {
			parkett = true;
			data1 += $("select#parkett_c_date_selection").val()+'<br/>';
			data2 += ''+$(this).val()+' x '+($(this).attr('id') * 1).toFixed(2)+'<br/>';
			data3 += ''+($(this).val() * $(this).attr('id')).toFixed(2)+' EUR<br/>';
			need_to_change = true;
			need_to_change_first = true;
			finalamount += ($(this).val() * $(this).attr('id'));
		}
	});
	
	if (need_to_change) {
		data_row3 = '<div class="cart_item"><div class="cart_item_1">'+data1+'</div><div class="cart_item_2">'+data2+'</div><div class="cart_item_3">'+data3+'</div><div class="clear"></div></div>';
	}
	
	// SATT UND LUSTIG
	
	need_to_change = false;
	data1 = '<strong>Eintrittskarten | Satt und Lustig</strong><br/>';
	data2 = '<br/>';
	data3 = '<br/>';
	$('.orderform input[name^="essen_show"]').each(function() {
		if ($(this).val() != "") {
			brunch = true;
			data1 += $(this).attr('rel')+'<br/>';
			data2 += ''+$(this).val()+' x '+($(this).attr('id') * 1).toFixed(2)+'<br/>';
			data3 += ''+($(this).val() * $(this).attr('id')).toFixed(2)+' EUR<br/>';
			need_to_change = true;
			need_to_change_first = true;
			finalamount += ($(this).val() * $(this).attr('id'));
		}
	});
	
	if (need_to_change) {
		data_row4 = '<div class="cart_item"><div class="cart_item_1">'+data1+'</div><div class="cart_item_2">'+data2+'</div><div class="cart_item_3">'+data3+'</div><div class="clear"></div></div>';
	}
	
	// BRUNCH
	
	need_to_change = false;
	data1 = '<strong>Eintrittskarten | Brunch</strong><br/>';
	data2 = '<br/>';
	data3 = '<br/>';
	$('.orderform input[name^="brunch"]').each(function() {
		if ($(this).val() != "") {
			brunch = true;
			data1 += $(this).attr('rel')+'<br/>';
			data2 += ''+$(this).val()+' x '+($(this).attr('id') * 1).toFixed(2)+'<br/>';
			data3 += ''+(($(this).val() * $(this).attr('id'))).toFixed(2)+' EUR<br/>';
			need_to_change = true;
			need_to_change_first = true;
			finalamount += ($(this).val() * $(this).attr('id'));
		}
	});
	
	if (need_to_change) {
		data_row5 = '<div class="cart_item"><div class="cart_item_1">'+data1+'</div><div class="cart_item_2">'+data2+'</div><div class="cart_item_3">'+data3+'</div><div class="clear"></div></div>';
	}
	
	if (need_to_change_first) {
		/*
		if (document.getElementsByName('paying_option_1')[1].checked || document.getElementsByName('paying_option_2')[1].checked) {
			porto = 5.00;
		}*/
		if (parkett == true) {
			if (document.getElementsByName('paying_option_1')[1].checked) {
				porto = 5.00;
			}
		}
		if (brunch == true) {
			if (document.getElementsByName('paying_option_2')[1].checked) {
				porto = 5.00;
			}
		}
		$('#shopping_cart_js_calc').html('');
		$('#shopping_cart_js_calc').append(data_row1+data_row2+data_row3+data_row4+data_row5);
				
		$('.porto .cart_item_3').html(str_replace('.', ',', (porto.toFixed(2)+' EUR')));
		$('.gesamt .cart_item_3').html(str_replace('.', ',', ((finalamount+porto).toFixed(2)+' EUR')));
	}
}

function str_replace(search, replace, subject) {
    return subject.split(search).join(replace);
}