var
	// Aktives Produktdetail
	ActiveProductID = '';
	// Aktive Produktfarbe
	ActiveProductColor = '';

function changeCoffeView(framenr)
{
	for(var i=1;i<=7;i++)
	{
		DivID="imgInhaltDiv" + i;
		if ($(DivID))
		{
			//alert("-"+DivID);
			if(i==framenr)
			{
				$(DivID).show();
			} else
			{
				$(DivID).hide();
			}
		}
	
	}	
}	

// Funktion zum Auswählen der Produktfarbvariante.
function swapColor(img, title, ActiveID)
{
	// Bisher aktive Farbvariante wieder inaktiv schalten.
	if (ActiveProductColor != '')
	{
		$('color-' + ActiveProductColor).className = 'box';
		$('color-text-' + ActiveProductColor).className = "color-text";
		
		ActiveProductColor = '';
	}

	// Produktbild tauschen.
	if (IE6)
	{
		$('swap').filters[0].src = img.src;
	} else
	{
		$('swap').src = img.src;
	}

	// Produktfarbvariante aktiv schalten.
	ActiveProductColor = ActiveID;
	$('color-' + ActiveProductColor).className = 'box-active';
	$('color-text-' + ActiveProductColor).className = "color-text-active";
}

// Funktion zum Markieren einer Farbvariante.
function markColor(colorID)
{
	var color = $('color-' + colorID);
	var colortext = $('color-text-' + colorID);
	
	if ((color != null) && (colortext != null))
	{
		ActiveProductColor = colorID;
		
		// Farbauswahlfeld aktiv schalten
		color.className = 'box-active';
		// Text neben Farbauswahlfeld markieren
		colortext.className = 'color-text-active';
	}
}

// Funktion zum Auswählen eines Produktdetails.
function changeDetailView(textID, Status)
{
	if(Status == 'klick')
	{
		if (textID != '')
		{
			// Aktives Produktdetail resetten.
			resetActiveProductDetail();

			// Anzuzeigenden HTML-Code ermitteln.
			var Source = $("textDetail"+textID);
			var Target = $("detailViewer");
			// Bild und Text im Detailviewer updaten.
			if ((Source != null) && (Target != null))
			{
				// Zielframe bekommt den HTML-Code.
				Target.innerHTML = Source.innerHTML;

				// Breite des Bildes fürIE 6 setzen.
				if ($("detail-image"))
				{
					$("detail-image").style.width = 210;
				}

				// Produtkdetail aktiv schalten.
				var ProductDetail = $('link-' + textID);
				
				if (ProductDetail != null)
				{
					ProductDetail.className = 'link-active';
				}
			}
			
			// Aktives Produktdetail merken.
			ActiveProductID = textID;
		}
		 
	} else if (Status=='over')
	{
		// Anzuzeigenden HTML-Code ermitteln.
		var Source = $("textDetail"+textID);
		
		// Bild und Text im Detailviewer updaten.
		if (Source != null)
		{
			// Zielframe bekommt den HTML-Code.
			$("detailViewer").innerHTML = Source.innerHTML;
		}
	}
}

//Funktion zum Auswählen eines Produktdetails (Caffeo und Caffeo Solo).
function changeDetailViewCaffeo(textID, Status)
{
	if(Status == 'klick')
	{
		if (textID != '')
		{
			// Aktives Produktdetail resetten.
			resetActiveProductDetail();

			// Anzuzeigenden HTML-Code ermitteln.
			var Source = $("textDetail"+textID);
			var SourceBild = $("textDetailBild"+textID);
			var Target = $("detailViewer");
			var TargetBild = $("detailViewerBild");

			// Bild und Text im Detailviewer updaten.
			if ((Source != null) && (SourceBild != null) && (Target != null) && (TargetBild != null))
			{
				// Zielframe bekommt den HTML-Code.
				Target.innerHTML = Source.innerHTML;
				// Zielframe bekommt den HTML-Code.
				TargetBild.innerHTML = SourceBild.innerHTML;

				// Breite des Bildes für IE 6 setzen.
				if ($("detail-image"))
				{
					$("detail-image").style.width = 135;
				}

				// Produtkdetail aktiv schalten.
				var ProductDetail = $('link-' + textID);
				
				if (ProductDetail != null)
				{
					ProductDetail.className = 'link-active';
				}

				// Aktives Produktdetail merken.
				ActiveProductID = textID;
			}
		}
		 
	} else if (Status=='over')
	{
		// Anzuzeigenden HTML-Code ermitteln.
		var Source = $("textDetail"+textID);
		
		// Bild und Text im Detailviewer updaten.
		if (Source != null)
		{
			// Zielframe bekommt den HTML-Code.
			$("detailViewer").innerHTML = Source.innerHTML;
		}
	}
}

// Aktives Produktdetail resetten.
function resetActiveProductDetail()
{
	if (ActiveProductID != '')
	{
		// Produtkdetail resetten
		$('link-' + ActiveProductID).className = 'link';
	
		ActiveProductID = '';
	}
}