/* ---------------------------------------------------------------------------------------
   Returns the object.style property
   
   obj = Name (id) of the respective (div) object
--------------------------------------------------------------------------------------- */
function GetObjectStyle(obj)
{
  
  if (document.all)
     {return document.all[obj].style;}
  else if (document.getElementById)
     {return document.getElementById(obj).style;}

}

/* ---------------------------------------------------------------------------------------
   Sets a new background-image reference for an div object
   
   obj = Name (id) of the respective (div) object
--------------------------------------------------------------------------------------- */
function SetDivBgImage(obj, FileName)
{
  DivObject = GetObjectStyle(obj);
  DivObject.backgroundImage = 'url(' + FileName + ')';
}

/* ---------------------------------------------------------------------------------------
   Sets a new image reference for an img object
   
   obj = Name (id) of the respective img object
   FileName = Path and filename of the new picture reference
--------------------------------------------------------------------------------------- */
function SetImageSource(obj, FileName)
{
  document.images[obj].src = FileName;
}

/* ---------------------------------------------------------------------------------------
   Sets a new image reference for an img object
   
   obj = Name (id) of the respective img object
   FileName = Path and filename of the new picture reference
--------------------------------------------------------------------------------------- */
function SetImageTextSource(obj, FileName, vchText, vchPreis)
{
  document.images[obj].src = FileName;
	DivObject = GetObjectStyle('Info');
	Info.innerText = vchText;
	
	DivObject = GetObjectStyle('Preis');
	Preis.innerText = vchPreis;
}
/* ---------------------------------------------------------------------------------------
   Öffnet ein neues Fenster für die Galerie.
--------------------------------------------------------------------------------------- */
 function Galerie(quelle) 
 {	
 		try
		{
			quelle = "../Galerie/"+quelle+".html";
			F = window.open(quelle,"","status=yes, width=820, height=550, top=25,left="+(screen.width/2-450));
			F.focus();
		}
		catch(err)
		{	status=err; }
	}
/* ---------------------------------------------------------------------------------------
   Bild- und Informations RÜCK-lauf
--------------------------------------------------------------------------------------- */
				function BackImage()
			{
				try
				{
					if (CURRENT_PICTURE != 1) 
					{
						CURRENT_PICTURE--;
						
						document.images['Bild'].src = images[CURRENT_PICTURE];
						Text.innerText = text[CURRENT_PICTURE];
						Headline.innerText = head[CURRENT_PICTURE];
						Preis.innerText = preis[CURRENT_PICTURE]
					}
					
					if (CURRENT_PICTURE == 1) 
					{	
						document.images['Bild'].src = images[CURRENT_PICTURE]; 
						Text.innerText = text[CURRENT_PICTURE];
						Headline.innerText = head[CURRENT_PICTURE];
						Preis.innerText = preis[CURRENT_PICTURE]
					}
				}
				catch(err)
				{status=err;}
				return -1;
			}
/* ---------------------------------------------------------------------------------------
   Bild- und Informations VOR-lauf
--------------------------------------------------------------------------------------- */
			function ForwardImage(anzahl)
			{
				try
				{
					if (CURRENT_PICTURE != anzahl) 
					{
						CURRENT_PICTURE++;
						document.images['Bild'].src = images[CURRENT_PICTURE];
						Text.innerText = text[CURRENT_PICTURE];
						Headline.innerText = head[CURRENT_PICTURE];
						Preis.innerText = preis[CURRENT_PICTURE];
					}
					if (CURRENT_PICTURE == anzahl)
					{	
						document.images['Bild'].src = images[CURRENT_PICTURE]; 
						Text.innerText = text[CURRENT_PICTURE];
						Headline.innerText = head[CURRENT_PICTURE];
						Preis.innerText = preis[CURRENT_PICTURE]
					}
				}
				catch(err)
				{status=err;}
				return -1;
			}
/* ---------------------------------------------------------------------------------------
   Setzt die jeweiligen Bilder und Informationen
--------------------------------------------------------------------------------------- */
			function SetInformation(position)
			{
				try
				{
					CURRENT_PICTURE = position;
					document.images['Bild'].src = images[CURRENT_PICTURE]; 
					Text.innerText = text[CURRENT_PICTURE];
					Headline.innerText = head[CURRENT_PICTURE];
					Preis.innerText = preis[CURRENT_PICTURE]
				}
				catch(err)
				{ status = err + "SetInformation"; }
			}
			
/* ---------------------------------------------------------------------------------------
   Zeigt die Liste von Produkten der gewählten Kategorie
--------------------------------------------------------------------------------------- */			
			/*function ShowList(intKategorie)
			{
				try
				{
					 alert("Unser Onlineshop befindet sich noch im Aufbau!\n\nEinige unserer Produkte finden Sie auf:\n\nwww.dawanda.com\n\n");
				}
				catch(err)
				{ status = err + "ShowList"; }
			}		*/	
			
			function ShowList(intKategorie)
			{
				try
				{
					dawanda.style.visibility = "visible";
					kategorie.style.visibility = "hidden";
					 
				}
				catch(err)
				{ status = err + "ShowList"; }
			}	