var id = new Array();
var desc = new Array();
var quantity = new Array();
var price = new Array();

var consumer_name = "";
var consumer_street = "";
var consumer_plz = "";
var consumer_city = "";
var consumer_telephone = "";
var consumer_email = "";
var consumer_date = "";
var consumer_time = "";
var form_trigger = false;

var counter = 0;

function preselection(system_id, selection){
//define the quantity-string | qunatity_ID or quantity_2_ID
	var quantity_id_string = "";
	if(selection == 1){quantity_id_string = "quantity_";}
	else{if(selection == 2){quantity_id_string = "quantity_2_";}}

	return quantity_id_string;
}

function add_item_presel(system_id, selection){
//get the add_item function with preselection
	var string = preselection(system_id, selection);
	add_item(system_id, string);
}

function set_current_price_presel(system_id, selection){
	var string = preselection(system_id, selection);
	set_current_price(system_id, string, 'current_price_2_');
}

function set_current_price(system_id, quantity_id_string, current_price_string){
//show the current price
	var price_id = 'price_' + system_id;
	var quantity_id = quantity_id_string + system_id;
	var current_price_id = current_price_string + system_id;
	var new_price = document.getElementById(price_id).innerHTML * document.getElementById(quantity_id).value;
	new_price = (Math.round(new_price * 100) / 100);

	//test price - 7 -> 7.00 | 7.1 -> 7.10 | 7.11 -> 7.11
	var price_string = "" + new_price;
	var dot_position = price_string.indexOf(".");
	
	if(dot_position == -1){
		price_string = price_string + ".00";
	}
	else{
		if(price_string.length - (dot_position + 1) <= 1){
			price_string = price_string + "0";
		}
	}

	document.getElementById(current_price_id).innerHTML = "<p>" + price_string + " &euro;</p>";
}

function increase_quantity(system_id){
//increase the quantity in formfield
	var quantity_id = 'quantity_2_' + system_id;
	var current_quantity_id = 'current_quantity_' + system_id;
	var current_quantity = Number(document.getElementById(current_quantity_id).innerHTML);
	
	if(document.getElementById(quantity_id).value < current_quantity)
		{document.getElementById(quantity_id).value = current_quantity}
	document.getElementById(quantity_id).value++;
	
	set_current_price_presel(system_id, 2);
}

function decrease_quantity(system_id){
//decrease the quantity in formfield
	var quantity_id = 'quantity_2_' + system_id;
	var current_quantity_id = 'current_quantity_' + system_id;
	var current_quantity_plus_one = Number(document.getElementById(current_quantity_id).innerHTML) + 1;
	var current_quantity = Number(document.getElementById(current_quantity_id).innerHTML);
	
	if(document.getElementById(quantity_id).value < current_quantity_plus_one)
		{document.getElementById(quantity_id).value = curren_quantity}
	else{document.getElementById(quantity_id).value--;}

	set_current_price_presel(system_id, 2);
}

function test_quantity(system_id){
//check the entered quantity - if failed then show an error message
	var quantity_id = 'quantity_' + system_id;
	var quantity_error_id = 'quantity_error_' + system_id;
	var current_quantity_id = 'current_quantity_' + system_id;
	
	var current_quantity_min_one = Number(document.getElementById(current_quantity_id).innerHTML) - 1;

	if(document.getElementById(quantity_id).value <= current_quantity_min_one){
		document.getElementById(quantity_error_id).innerHTML = "<p style=\"color:#FFFF66\">Hinweis: die Mindestbestellmenge betr&auml;gt " + document.getElementById(current_quantity_id).innerHTML + "</p>";
		return false;
	}
	else{
		document.getElementById(quantity_error_id).innerHTML = "";
		return true;
	}
}

function add_item(system_id, quantity_id_string){
//add an item in a multi-dimensional array - it is not possible to add the same item on another position
	if(test_quantity(system_id) == true){
		var description_id = 'description_' + system_id;
		var quantity_id = quantity_id_string + system_id;
		var price_id = 'price_' + system_id;
		var trigger = false;

		for(var i = 0; i < id.length; i++){
			if(id[i] == system_id){
				id[i] = system_id;
				trigger = true;
				break;
			}
		}
		
		if(trigger == false){
			id[counter] = system_id;
			counter++;
		}
		
		desc[system_id] = document.getElementById(description_id).innerHTML;
		quantity[system_id] = document.getElementById(quantity_id).value;

		var new_price = document.getElementById(quantity_id).value * document.getElementById(price_id).innerHTML;
		new_price = (Math.round(new_price * 100) / 100);
		price[system_id] = new_price;

		show_basket_side();
	}
}

function delete_item(system_id){
//set selected part to "" (empty)
	var newArray = new Array();
	var helper = 0;
	
	for(var i = 0; i < id.length; i++){
		if(id[i] != system_id){
			newArray[helper] = id[i];
			helper++;
		}
	}
	id = newArray;
	show_basket_first_step();
	show_basket_side();
}

function change_item(system_id){
	add_item_presel(system_id, 2, 2);
	show_basket_first_step();
}

function total_price(){
//return total price from the price-array
	var total_price = 0;
	
	for(var i = 0; i < id.length; i++){
		if(id[i] != null){
			var position = id[i];
			total_price = total_price + price[position];
		}
	}

	total_price = total_price + 7;
	total_price = (Math.round(total_price * 100) / 100);

	//test price - 7 -> 7.00 | 7.1 -> 7.10 | 7.11 -> 7.11
	var price_string = "" + total_price;
	var dot_position = price_string.indexOf(".");
	
	if(dot_position == -1){
		price_string = price_string + ".00";
	}
	else{
		if(price_string.length - (dot_position + 1) <= 1){
			price_string = price_string + "0";
		}
	}
	
	return price_string;
}

function show_basket_side(){
//test function to display the whole array
	var string = "<p><b>Ihr Einkaufswagen</b></p><hr />";
	var trigger = false;

	if(id.length >= 1){
		var count_helper = 0;

		for(var i = id.length; i >= 0; i--){
			if(count_helper <= 5){
				if(id[i] != null){
					var position = id[i];
		
					//test price - 7 -> 7.00 | 7.1 -> 7.10 | 7.11 -> 7.11
					var price_string = "" + price[position];
					var dot_position = price_string.indexOf(".");
					
					if(dot_position == -1){
						price_string = price_string + ".00";
					}
					else{
						if(price_string.length - (dot_position + 1) <= 1){
							price_string = price_string + "0";
						}
					}
		
					string = string + "<p>" + desc[position] + "</p>" + "<p style=\"text-align: right; margin-top: 5px\"><i>Preis: " + price_string + " &euro;</i></p><hr />";
				}
			}
			count_helper++;
		}
		trigger = true;
	}
	else{
		string = "<p><b>Ihr Einkaufswagen</b></p><hr /><p><i>Ihr Einkaufswagen ist leer.</i></p>";
	}

	if(trigger == true){
		string = string + "<p style=\"text-align: right; margin-top: 5px\"><b>Gesamtpreis: " + total_price() + " &euro;</b></p>";
		string = string + "<p style=\"text-align: right; margin-top: 5px\"><i>inkl. 7% MwSt. und <br />7 &euro; Anfahrt</i></p><hr />";
	}

	document.getElementById('container_right').innerHTML = string;
}

function show_basket_first_step(){
//show all selected articles
	var string = "";
	var counter_help = 0;
	var trigger = false;

	string = string + "<p>Hier sehen Sie eine &Uuml;bersicht aller ausgew&auml;hlter Artikel. Sie k&ouml;nnen die Menge f&uuml;r jeden Artikel nochmal ver&auml;ndern oder einen Artikel ganz rausl&ouml;schen.</p>";
	
	for(var i = 0; i < id.length; i++){
		var position = id[i];
		if(desc[position] != null){
			trigger = true;
			if(Math.ceil(counter_help/2) == counter_help/2){
				var bg_color = "#6a778a";
				var picture_kind = "_2";
			}
			else{
				var bg_color = "none";
				var picture_kind = "";
			}
			
			counter_help++;

			string = string + "<div style=\"background-color:" + bg_color + "\" class=\"item_box_first_step\">";
				string = string + "<table>";
					string = string + "<tr>";
						string = string + "<th colspan=\"5\">";
							string = string + "<p style=\"font-size: 12px\">" + desc[position] + "</p>";
						string = string + "</th>";
					string = string + "</tr>";
					string = string + "<tr>";
						string = string + "<th style=\"padding-right: 5px\" width=\"65 px\">";
						string = string + "</th>";
						string = string + "<th align=\"right\" style=\"padding-right: 5px\" width=\"110px\">";
							string = string + "<div class=\"quantity_fields\">";
								string = string + "<form>";
								   string = string + "<p>Menge <input id=\"quantity_2_" + id[i] + "\" type=\"text\" maxlength=\"4\" size=\"1\" onkeyup=\"javascript:set_current_price_presel('" + id[i] + "',\'2\')\" value=\"" + quantity[position] + "\" /></p>";
								string = string + "</form>";
							string = string + "</div>";
							string = string + "<div class=\"quantity_buttons\">";
								string = string + "<a href=\"javascript:increase_quantity('" + id[i] + "')\"><img style=\"border: none\" src=\"images/shop_button_increase.jpg\" alt=\"\" /></a>";
								string = string + "<a href=\"javascript:decrease_quantity('" + id[i] + "')\"><img style=\"border: none\" src=\"images/shop_button_decrease.jpg\" alt=\"\" /></a>";
							string = string + "</div>";
							string = string + "<div style=\"clear:both\"></div>";
						string = string + "</th>";
						string = string + "<th style=\"padding-right: 5px\" width=\"75 px\">";
							string = string + "<div id=\"current_price_2_" + id[i] + "\">";
	
								//test price - 7 -> 7.00 | 7.1 -> 7.10 | 7.11 -> 7.11
								var price_string = "" + price[position];
								var dot_position = price_string.indexOf(".");
								
								if(dot_position == -1){
									price_string = price_string + ".00";
								}
								else{
									if(price_string.length - (dot_position + 1) <= 1){
										price_string = price_string + "0";
									}
								}
	
								string = string + "<p>" + price_string + " &euro;</p>";
							string = string + "</div>";
						string = string + "</th>";
						string = string + "<th style=\"padding-right: 5px\" width=\"75 px\">";
							string = string + "<a href=\"javascript:change_item('" + id[i] + "')\"><img style=\"border: none\" src=\"images/shop_button_change_item" + picture_kind + ".jpg\" alt=\"\" /></a>";
						string = string + "</th>";
						string = string + "<th width=\"90px\">";
							string = string + "<a href=\"javascript:delete_item('" + id[i] + "')\"><img style=\"border: none\" src=\"images/shop_button_delete_item" + picture_kind + ".jpg\" alt=\"\" /></a>";
						string = string + "</th>";
					string = string + "</tr>";
				string = string + "</table>";
			string = string + "</div>";
		}
	}
	
	if(trigger == false){
		string = "<p style=\"text-align: center\">Ihr Warenkorb ist leer.</p><hr />";
		string = string + "<a href=\"javascript:show_accordion()\">";
			string = string + "<img src=\"images/shop_button_backto_shop.jpg\" alt=\"Zur&uuml;ck zum Warenkorb\" style=\"margin-left: auto; margin-right: auto\" />";
		string = string + "</a>";
	}
	else{
		var string2 = "";
		string2 = string2 + "<hr />";
		string2 = string2 + "<p style=\"text-align: right\">Der Gesamtpreis f&uuml;r alle Artikel betr&auml;gt: <b>" + total_price() + " &euro;</b><br />(inkl. 7% MwSt. und 7 &euro; Anfahrt)</p>";

		string2 = string2 + "<hr />";
		string2 = string2 + "<table><tr>";
			string2 = string2 + "<th width=\"220px\" align=\"right\" style=\"padding-right: 10px\">";
				string2 = string2 + "<a href=\"javascript:show_accordion()\">";
					string2 = string2 + "<img src=\"images/shop_button_backto_shop.jpg\" style=\"border: none\" alt=\"Zur&uuml;ck zum Warenkorb\" />";
				string2 = string2 + "</a></th>";
			string2 = string2 + "<th width=\"220px\" align=\"left\" style=\"padding-left: 10px\">";
				string2 = string2 + "<a href=\"javascript:hide_first_step_show_second_step()\">";
					string2 = string2 + "<img src=\"images/shop_button_goto_step2.jpg\" style=\"border: none\" alt=\"Weiter zur Adresseingabe\" />";
				string2 = string2 + "</a></th>";
		string2 = string2 + "</tr></table>";

		string = string + string2;		
	}
	document.getElementById('first_step').innerHTML = string;
}

function check_date(){
//check if the entered date is 3 days (min) after the actual date
	var new_date = document.getElementById('date_form').value;
	var jetzt = new Date();
	day = new_date.substr(0,2);
	day = day;
	month = new_date.substr(3,2);
	year = new_date.substr(6,4);
	US_date = month + "/" + day + "/" + year;
	var act_time = jetzt.getTime();
	var new_time = Date.parse(US_date) - (2 * 24 * 60 * 60 * 1000);
	return (new_time > act_time);
}

function valid_form_check(){
//check every field and write in variables
	var trigger_date = false;
	var trigger_form = false;
	var string = "";
	
	if(check_date() == true){trigger_date = true;}
	
	if(document.getElementById('name_form').value != ""){trigger_form_1 = true;}
	else{trigger_form_1 = false;}
	
	if(document.getElementById('street_form').value != ""){trigger_form_2 = true;}
	else{trigger_form_2 = false;}
	
	if(document.getElementById('plz_form').value != ""){trigger_form_3 = true;}
	else{trigger_form_3 = false;}
	
	if(document.getElementById('city_form').value != ""){trigger_form_4 = true;}
	else{trigger_form_4 = false;}
	
	if(document.getElementById('telephone_form').value != ""){trigger_form_5 = true;}
	else{trigger_form_5 = false;}
	
	if(document.getElementById('email_form').value != ""){trigger_form_6 = true;}
	else{trigger_form_6 = false;}

	if(document.getElementById('time_form').value != ""){trigger_form_7 = true;}
	else{trigger_form_7 = false;}

	if(!trigger_form_1 || !trigger_form_2 || !trigger_form_3 || !trigger_form_4 || !trigger_form_5 || !trigger_form_6 || !trigger_form_7){
		trigger_form = false;}
	else{
		trigger_form = true;}
	
	if(trigger_form == false){
		string = string + "<p style=\"color:#FFFF66\">Bitte f&uuml;llen Sie <u>alle</u> Felder aus.</p>";
	}

	if(trigger_date == false){
		string = string + "<p style=\"color:#FFFF66\">Bitte w&auml;hlen Sie ein korrektes Datum (mind. 3 Tage in der Zukunft) oder kontaktieren Sie uns telefonisch.</p>";
	}

	if(trigger_form == true && trigger_date == true){
		string = "";		
		document.getElementById('error_form').innerHTML = string;
	}
	else{document.getElementById('error_form').innerHTML = string;}

	if(trigger_form == true && trigger_date == true){
		consumer_name = document.getElementById('name_form').value;
		consumer_street = document.getElementById('street_form').value;
		consumer_plz = document.getElementById('plz_form').value;
		consumer_city = document.getElementById('city_form').value;
		consumer_telephone = document.getElementById('telephone_form').value;
		consumer_email = document.getElementById('email_form').value;
		consumer_date = document.getElementById('date_form').value;
		consumer_time = document.getElementById('time_form').value;
		form_trigger = true;
	}
	else{
		form_trigger = false;
	}
}

function show_third_step(){
//show a conclusion of all information
	var string = "";
	var counter_help = 0;

	string = string + "<p>Bitte &uuml;berpr&uuml;fen Sie nachfolgend nochmal alle Angaben. Mit einem Klick auf \"Bestellung abschicken\" wird Ihre Bestellung an uns versendet.</p>";
	string = string + "<hr />";
	string = string + "<table>";
	string = string + "<tr style=\"background-color: #6a778a\">";
	string = string + "<th width=\"300px\" style=\"padding-right: 5px; padding-left: 5px\">";
	string = string + "<p><b>Bezeichnung</b></p>";
	string = string + "</th>";
	string = string + "<th width=\"40px\" style=\"padding-right: 5px\" style=\"text-align:center\">";
	string = string + "<p><b>Menge</b></p>";
	string = string + "</th>";
	string = string + "<th width=\"80px\" style=\"text-align:center; padding-right: 5px\">";
	string = string + "<p><b>Preis</b></p>";
	string = string + "</th>";
	string = string + "</tr>";

	for(var i = 0; i < id.length; i++){
		var position = id[i];
		if(desc[position] != null){
			if(Math.ceil(counter_help/2) == counter_help/2){var bg_color = "none";}
			else{var bg_color = "#6a778a";}

			counter_help++;
	
			string = string + "<tr style=\"background-color: " + bg_color + "; padding-left: 5px\">";
			string = string + "<th>";
			string = string + "<p>" + desc[position] + "</p>";
			string = string + "</th>";
			string = string + "<th style=\"text-align: center\">";
			string = string + "<p>" + quantity[position] + "</p>";
			string = string + "</th>";
			string = string + "<th style=\"text-align: right; padding-right: 5px\">";

			//test price - 7 -> 7.00 | 7.1 -> 7.10 | 7.11 -> 7.11
			var price_string = "" + price[position];
			var dot_position = price_string.indexOf(".");
			
			if(dot_position == -1){
				price_string = price_string + ".00";
			}
			else{
				if(price_string.length - (dot_position + 1) <= 1){
					price_string = price_string + "0";
				}
			}

			string = string + "<p>" + price_string + " &euro;</p>";
			string = string + "</th>";
			string = string + "</tr>";
		}
	}
	
	string = string + "<tr><th colspan=\"3\">";
	string = string + "<hr />";
	string = string + "<p style=\"text-align: right\">Der Gesamtpreis f&uuml;r alle Artikel betr&auml;gt: <b>" + total_price() + " &euro;</b><br />(inkl. 7% MwSt. und 7 &euro; Anfahrt)</p>";
	string = string + "</th></tr>";

	string = string + "</table>";
	string = string + "<p style=\"font-size: 12px\"><b>Hinweis:</b> die Kosten f&uuml;r die Serviceausstattung werden extra berechnet. Hierzu wird sich unser Team bei Ihnen nach der Bestellung melden. Um sich bereits einen &Uuml;berblick &uuml;ber die Serviceausstattung verschaffen zu k&ouml;nnen, haben wir hier unsere Partyservice-Mappe f&uuml;r Sie bereitgestellt.</p>";
	
	string = string + "<table><tr><th style=\"padding-right: 10px\">";
	string = string + "<a href=\"servicemappe/partyservice_mappe.pdf\" target=\"_blank\"><img src=\"images/shop_button_pdf.jpg\" style=\"border:0\" alt=\"Servicemappe herunterladen\" /></a>";
	string = string + "</th><th>";
	string = string + "<a href=\"servicemappe/partyservice_mappe.pdf\" target=\"_blank\">Partyservice-Mappe herunterladen</a>";
	string = string + "</th></tr></table>";
	
	string = string + "<a href=\"javascript:show_first_step_hide_third_step()\"><img src=\"images/shop_button_change_item.jpg\" style=\"border: none; margin-left: auto; margin-right: 0px\" alt=\"Weiter zur Adresseingabe\" /></a>";
	
	string = string + "<hr />";
	string = string + "<p>Ihre eingebenen Daten</p>";
	
	string = string + "<table><tr><th style=\"text-align: right; padding-right: 10px\">";
	string = string + "<p>Name</p>";
	string = string + "</th><th>";
	string = string + "<p><b>" + consumer_name + "</b></p>";
	string = string + "</th></tr><tr><th style=\"text-align: right; padding-right: 10px\">";
	string = string + "<p>Stra&szlig;e und Hausnummer</p>";
	string = string + "</th><th>";
	string = string + "<p><b>" + consumer_street + "</b></p>";
	string = string + "</th></tr><tr><th style=\"text-align: right; padding-right: 10px\">";
	string = string + "<p>PLZ und Ort</p>";
	string = string + "</th><th>";
	string = string + "<p><b>" + consumer_plz + " " + consumer_city + "</b></p>";
	string = string + "</th></tr><tr><th style=\"text-align: right; padding-right: 10px\">";
	string = string + "<p>Telefon</p>";
	string = string + "</th><th>";
	string = string + "<p><b>" + consumer_telephone + "</b></p>";
	string = string + "</th></tr><tr><th style=\"text-align: right; padding-right: 10px\">";
	string = string + "<p>Email-Adresse</p>";
	string = string + "</th><th>";
	string = string + "<p><b>" + consumer_email + "</b></p>";
	string = string + "</th></tr>";
	string = string + "<tr><th style=\"text-align: right; padding-right: 10px\">";
	string = string + "<p>Beginn der Veranstaltung</p>";
	string = string + "</th><th>";
	string = string + "<p><b>" + consumer_time + "</b></p>";
	string = string + "</th></tr>";	
	string = string + "<tr><th style=\"text-align: right; padding-right: 10px\">";
	string = string + "<p>Datum der Veranstaltung</p>";
	string = string + "</th><th>";
	string = string + "<p><b>" + consumer_date + "</b></p>";
	string = string + "</th></tr></table>";
	string = string + "<a href=\"javascript:show_second_step_hide_third_step()\"><img src=\"images/shop_button_change_item.jpg\" style=\"border: none; margin-left: auto; margin-right: 0px\" alt=\"Weiter zur Adresseingabe\" /></a>";
	
	string = string + "<hr />";
	
	string = string + "<p>M&ouml;chten Sie uns noch etwas mitteilen?</p>";
	string = string + "<form method=\"post\" action=\"shop_mailer.php\">";
	string = string + "<p style=\"text-align:center\"><textarea name=\"consumer_comment\" id=\"consumer_comment\" rows=\"5\" cols=\"50\">Hier k&ouml;nnen Sie uns etwas mitteilen.</textarea></p>";

/***************************************************************************************************************************************/
	/* String for the hidden fields */
	string = string + "<input type=\"hidden\" name=\"shop_order_name\" value=\"" + consumer_name + "\" />";
	string = string + "<input type=\"hidden\" name=\"shop_order_email\" value=\"" + consumer_email + "\" />";

	var shop_order_string = "";
	
	shop_order_string = shop_order_string + "Folgende Bestellung ist bei Ihnen eingegangen\n\n";
	shop_order_string = shop_order_string + "Name und Adresse\n----------------\n";
	shop_order_string = shop_order_string + "Name: " + consumer_name + "\nStrasse: " + consumer_street + "\nPLZ und Ort: " + consumer_plz + " " + consumer_city + "\n";
	shop_order_string = shop_order_string + "Telefon: " + consumer_telephone + "\nEmail: " + consumer_email + "\nDatum der Veranstaltung: " + consumer_date + "\n";
	shop_order_string = shop_order_string + "Beginn: " + consumer_time + "\n\n\n";
	
	shop_order_string = shop_order_string + "Bestellt wurden folgende Artikel";
	shop_order_string = shop_order_string + "\n---------------------------------------------\n";
	
	for(var i = 0; i < id.length; i++){
		var position = id[i];
		if(desc[position] != null){
			//test price - 7 -> 7.00 | 7.1 -> 7.10 | 7.11 -> 7.11
			var price_string = "" + price[position];
			var dot_position = price_string.indexOf(".");
			
			if(dot_position == -1){
				price_string = price_string + ".00";
			}
			else{
				if(price_string.length - (dot_position + 1) <= 1){
					price_string = price_string + "0";
				}
			}

			shop_order_string = shop_order_string + "Preis: " + price_string + "&euro; -- ";
			shop_order_string = shop_order_string + "Menge: " + quantity[position] + " -- ";
			shop_order_string = shop_order_string + desc[position] + "\n---------------------------------------------\n";
		}
	}
	
	shop_order_string = shop_order_string + "Der Gesamtpreis f&uuml;r alle Artikel betr&auml;gt: " + total_price() + " &euro; (inkl. 7% MwSt. und 7 &euro; Anfahrt)";

	string = string + "<input type=\"hidden\" name=\"shop_order_complete\" value=\"" + shop_order_string + "\" />";
	/***************************************************************************************************************************************/
	
	string = string + "<hr />";

	string = string + "<table><tr>";
	string = string + "<th width=\"220px\" align=\"right\" style=\"padding-right: 10px\">";
	string = string + "<a href=\"javascript:show_second_step_hide_third_step()\">";
	string = string + "<img src=\"images/shop_button_backto_step2.jpg\" style=\"border: none\" alt=\"Zur&uuml;ck zur Adresseingabe\" />";
	string = string + "</a></th>";
	string = string + "<th width=\"220px\" align=\"left\" style=\"padding-left: 10px\">";
	string = string + "<a href=\"#\">";
	string = string + "<input type=\"image\" src=\"images/shop_button_buy_items.jpg\" style=\"border: none\" />"
	string = string + "</a></th>";
	string = string + "</tr></table>";
	string = string + "</form>";
	document.getElementById('third_step').innerHTML = string;
}

function show_third_step_hide_second_step(){
	document.getElementById('shop_picture').innerHTML = "<img src=\"images/shop_3_step.jpg\" alt=\"Shop dritte Seite\" />";
	document.getElementById('third_step').style.display = 'block';
	document.getElementById('second_step').style.display = 'none';
}

function show_first_step_hide_second_step(){
	document.getElementById('shop_picture').innerHTML = "<img src=\"images/shop_1_step.jpg\" alt=\"Shop erste Seite\" />";
	document.getElementById('first_step').style.display = 'block';
	document.getElementById('second_step').style.display = 'none';	
}

function hide_first_step_show_second_step(){
	document.getElementById('shop_picture').innerHTML = "<img src=\"images/shop_2_step.jpg\" alt=\"Shop zweite Seite\" />";
	document.getElementById('first_step').style.display = 'none';

	document.getElementById('second_step').style.display = 'block';
}

function hide_second_step_show_third_step(){
	valid_form_check();
	if(form_trigger == true){
		document.getElementById('shop_picture').innerHTML = "<img src=\"images/shop_3_step.jpg\" alt=\"Shop dritte Seite\" />";
		document.getElementById('third_step').style.display = 'block';
		show_third_step();
		document.getElementById('second_step').style.display = 'none';
	}
}

function show_first_step_hide_third_step(){
	document.getElementById('shop_picture').innerHTML = "<img src=\"images/shop_1_step.jpg\" alt=\"Shop erste Seite\" />";
	document.getElementById('third_step').style.display = 'none';

	show_basket_first_step();

	document.getElementById('first_step').style.display = 'block';
}

function show_second_step_hide_third_step(){
	document.getElementById('shop_picture').innerHTML = "<img src=\"images/shop_2_step.jpg\" alt=\"Shop zweite Seite\" />";
	document.getElementById('third_step').style.display = 'none';

	document.getElementById('second_step').style.display = 'block';
}

function hide_accordion_show_first_step(){
	document.getElementById('shop_picture').innerHTML = "<img src=\"images/shop_1_step.jpg\" alt=\"Shop erste Seite\" />";
	document.getElementById('shop_accordion').style.display = 'none';

	show_basket_first_step();

	document.getElementById('first_step').style.display = 'block';

	var string = "<a href=\"javascript:show_accordion()\">";
	string = string + "<img src=\"images/shop_button_back_to_shop.jpg\" alt=\"zum Shop\" style=\"margin-top: 5px; margin-left: auto; margin-right: auto\" />";
	string = string + "</a>";
	document.getElementById('basket_button').innerHTML = string;
}

function show_accordion(){
	document.getElementById('shop_picture').innerHTML = "<img src=\"images/catering_shop.jpg\" alt=\"Angebote und Shop\" />";
	document.getElementById('shop_accordion').style.display = 'block';
	document.getElementById('first_step').style.display = 'none';
	document.getElementById('second_step').style.display = 'none';
	document.getElementById('third_step').style.display = 'none';

	var string = "<a href=\"javascript:hide_accordion_show_first_step()\">";
	string = string + "<img src=\"images/shop_button_show_basket.jpg\" alt=\"zum Warenkorb\" style=\"margin-top: 5px; margin-left: auto; margin-right: auto\" />";
	string = string + "</a>";
	document.getElementById('basket_button').innerHTML = string;
}
