
	var size = 0;
	var label = new Array("menu_shop", "menu_kontakt", "menu_impressum");
	
	for (var i = 0; i <= label.length; i++)
	{
		bild = new Array();
		bild[i] = new Image();
		bild[i].src = "pics/" + label[i] + "_o.gif";
	}
	
	function wechsel(name)
	{
		document.images[name].src = "pics/" + name + "_o.gif";
	}
	
	function zurueck(name)
	{
		if(name != "")
		{
			document.images[name].src = "pics/" + name + ".gif";
		}
	}
	
	function clearField(formular, feld)
	{
		feld = eval("document.forms['" + formular + "']." + feld);
		feld.value = "";
	}		

	function popup(URL, width, height)
	{
		var left = (screen.width/2) - width/2;
		var top = (screen.height/2) - height/2;
	
		fenster = window.open(URL, "PopUp","width=" + width + ",height=" + height + ",left=" + left + ",top=" + top + ", scrollbars=yes");
		fenster.focus();
	}
	
	function setElements(size, add)
	{
		this.size = size + add;
	}
	
	function checkVariant()
	{
		var checkVariant = true;
		
		for(i = 1; i < this.size; i++)
		{
			variantValue = eval("document.variante.elements[" + i + "].value");
			if(variantValue == "")
			{
				checkVariant = false;
				break;
			}
		}

		return checkVariant;
	}
	
	function checkChange()
	{
		var checkVariant = true;
		
		for(i = 1; i < this.size; i++)
		{
			variantValue = eval("document.variante.elements[" + i + "].value");
			variantName = eval("document.variante.elements[" + i + "].name");
			
			if(variantValue == "")
			{
				checkVariant = false;
				break;
			}
		}

		if(checkVariant)
		{
			document.variante.submit();
		}
	}
		
	function checkSubmit()
	{	
		if(!checkVariant())
		{
			alert("Bitte wählen sie alle Optionen aus!");
		}
		else if(checkVariant() && document.addToCart.quantity.value == "")
		{
			alert("Bitte tragen Sie die gewünschte Bestellmenge ein!");
		}
		else
		{			
			document.addToCart.submit();
		}		
	}
