
var index=0;
var aImages = new Array();
							
function preload() 
	{
	if (!document.images) 
		{
		return;
		}
											
	for (var i=0; i<aNewsfiles.length; i++) 
		{
		aImages[i] = new Image();
		aImages[i].src = aNewsfiles[i];
		}
		
	Timer = setTimeout('change()' , 0001);
	}
	
function randInt(min,max)
	{
   var div = (max - min) + 1
   var randNum = Math.random()
   for (var i = 0; i <= div - 1; i++)
      {
      if (randNum >= i / div && randNum < (i+1) / div)
      {return i + min}
      }
	}

function change()
	{
	//index++;
	//if (index==aNewsfiles.length)
	//	index=0;
	index=randInt(0,aNewsfiles.length-1);
	
	document.BildNeuheiten.src=aNewsfiles[index];
	document.BildNeuheiten.alt=aNewstext[index];
	document.getElementById("LinkNeuheiten").href=aNewslink[index];
	
	Timer = setTimeout('change()' , 3000);
	}

function resetSearch(){
	document.getElementById('Lebensbereich').selectedIndex = 0;
	document.getElementById('Licht').selectedIndex = 0;
	document.getElementById('Boden').selectedIndex = 0;
	document.getElementById('Bluetenfarbe').selectedIndex = 0;
	document.getElementById('Bluetezeit').selectedIndex = 0;
	document.getElementById('Pflanzengruppe').selectedIndex = 0;
	document.getElementById('Freitext').value='';
	document.getElementById('bebildert').checked=false;

	document.BildLebensbereich.src="/images/shop_auswahl_alle.jpg";
	document.Lichtverhaeltnis.src="/images/button_licht_boden_leer.gif";
	document.Bodenverhaeltnis.src="/images/button_licht_boden_leer.gif";
	return false;
	}
	
function resetSearchForAutocomplete(){
	document.getElementById('Lebensbereich').selectedIndex = 0;
	document.getElementById('Licht').selectedIndex = 0;
	document.getElementById('Boden').selectedIndex = 0;
	document.getElementById('Bluetenfarbe').selectedIndex = 0;
	document.getElementById('Bluetezeit').selectedIndex = 0;
	document.getElementById('Pflanzengruppe').selectedIndex = 0;
	//document.getElementById('Freitext').value='';
	document.getElementById('bebildert').checked=false;

	document.BildLebensbereich.src="/images/shop_auswahl_alle.jpg";
	document.Lichtverhaeltnis.src="/images/button_licht_boden_leer.gif";
	document.Bodenverhaeltnis.src="/images/button_licht_boden_leer.gif";
	return false;
	}
	
function changeImageLebensbereich(){
	if (document.Suche.Lebensbereich.selectedIndex == 0){
		document.BildLebensbereich.src="/images/shop_auswahl_alle.jpg";
	}
	else if (document.Suche.Lebensbereich.selectedIndex == 1){
		document.BildLebensbereich.src="/images/shop_auswahl_beet.jpg";
	}
	else if (document.Suche.Lebensbereich.selectedIndex == 2){
		document.BildLebensbereich.src="/images/shop_auswahl_freiflaeche.jpg";
	}
	else if (document.Suche.Lebensbereich.selectedIndex == 3){
		document.BildLebensbereich.src="/images/shop_auswahl_gehoelzrand.jpg";
	}
	else if (document.Suche.Lebensbereich.selectedIndex == 4){
		document.BildLebensbereich.src="/images/shop_auswahl_gehoelz.jpg";
	}
	else if (document.Suche.Lebensbereich.selectedIndex == 5){
		document.BildLebensbereich.src="/images/shop_auswahl_steinanlagen.jpg";
	}
	else if (document.Suche.Lebensbereich.selectedIndex == 6){
		document.BildLebensbereich.src="/images/shop_auswahl_wasser.jpg";
	}
	else if (document.Suche.Lebensbereich.selectedIndex == 7){
		document.BildLebensbereich.src="/images/shop_auswahl_wasserrand.jpg";
	}
	else if (document.Suche.Lebensbereich.selectedIndex == 8){
		document.BildLebensbereich.src="/images/shop_auswahl_kletterpflanze.jpg";
	}
	else if (document.Suche.Lebensbereich.selectedIndex == 9){
		document.BildLebensbereich.src="/images/shop_auswahl_kraeuter.jpg";
	}
	else if (document.Suche.Lebensbereich.selectedIndex == 10){
		document.BildLebensbereich.src="/images/shop_auswahl_grabgestaltung.jpg";
	}
	else if (document.Suche.Lebensbereich.selectedIndex == 11){
		document.BildLebensbereich.src="/images/shop_auswahl_bodendecker.jpg";
	}
}

function changeImageLicht(){
	if (document.Suche.Licht.selectedIndex == 0){
		document.Lichtverhaeltnis.src="/images/button_licht_boden_leer.gif";
	}
	else if (document.Suche.Licht.selectedIndex == 1){
		document.Lichtverhaeltnis.src="/images/button_sonnig.gif";
	}
	else if (document.Suche.Licht.selectedIndex == 2){
		document.Lichtverhaeltnis.src="/images/button_halbschattig.gif";
	}
	else if (document.Suche.Licht.selectedIndex == 3){
		document.Lichtverhaeltnis.src="/images/button_schattig.gif";
	}
}

function changeImageBoden(){
	if (document.Suche.Boden.selectedIndex == 0){
		document.Bodenverhaeltnis.src="/images/button_licht_boden_leer.gif";
	}
	else if (document.Suche.Boden.selectedIndex == 1){
		document.Bodenverhaeltnis.src="/images/button_trocken.gif";
	}
	else if (document.Suche.Boden.selectedIndex == 2){
		document.Bodenverhaeltnis.src="/images/button_frisch.gif";
	}
	else if (document.Suche.Boden.selectedIndex == 3){
		document.Bodenverhaeltnis.src="/images/button_feucht.gif";
	}
}

// Bestellvorgang Step 3
function PopUp(breite,hoehe,Ziel) 
{
var params="width="+breite+",height="+hoehe+",toolbar=yes,locationbar=no,directories=no,scrollbars=yes,status=no,menubar=no,resizable=yes"+",left="+(screen.width-breite) / 2+",top="+(screen.height-hoehe) / 2+",screenX="+(screen.width-breite) / 2+",screenY="+(screen.height-hoehe) / 2
var url=Ziel;

  var newwindow = open(url,"Hilfe",params);
  if (newwindow != null)
  {
	  newwindow.focus();
	}		
}

// Shop-Einzelartikel
function PopUp2(breite,hoehe,Ziel) 
{
var params="width="+breite+",height="+hoehe+",toolbar=no,locationbar=no,directories=no,scrollbars=no,status=no,menubar=no,resizable=no"+",left="+(screen.width-breite) / 2+",top="+(screen.height-hoehe) / 2+",screenX="+(screen.width-breite) / 2+",screenY="+(screen.height-hoehe) / 2
var url=Ziel;

  var newwindow = open(url,"Hilfe",params);
  if (newwindow != null)
  {
	  newwindow.focus();
	}		
}