function initialisierung()
	{
	// alert ("initialisierung");  
	(f1=f2=f3=f4=f5=f6=1000) ;
	grey();
	//document.QuickCheck.Ergebnis.value=" ";
	show(Ergebnis_leer, "Auswertungs_Text");
	// var txt = "Sie haben in Spalte <b>" + x + "</b> geklickt.";
	show(" <div align='center'>" +  Ergebnis_Farbe + " <b> 0.00 </b>", "Wertung");
	}

function pruefung()
	{
	// alert ("pruefung");  
	var rohwert = (f1+f2+f3+f4+f5+f6) ;
	if (rohwert > 1000)
		{
		alert("Bitte füllen Sie den Quick Check vollständig aus!") ;
		}
	else
		{
		auswertung() ;
		}
	}

function auswertung()
	{
	// alert ("auswertung");  
	// runden auf 2 Stellen nach dem Komma
	var Ergebnis = Math.round(   ( ( f1 +f2 + f3 +f4 +f5 +f6 ) / 6)*100  )    /100 ;
 	//document.QuickCheck.Ergebnis.value=Ergebnis;
 	show(" <div align='center'> " +  Ergebnis_Farbe + " <b>"+ Ergebnis +"</b>", "Wertung");
 	//
 	//show(Ergebnis, "Wertung");
	
	if (Ergebnis <2.33)
		{
		green();
		show(Ergebnis_Farbe + Ergebnis_green, 'Auswertungs_Text');
		//document.QuickCheck.Ergebnis_Text.value = Ergebnis_green
		}
	else
		{
		
			if (Ergebnis >3.66)
			{
			red();
			//document.QuickCheck.Ergebnis_Text.value = Ergebnis_red
			//document.writeln('<TR><TD VALIGN="TOP" ALIGN="left" class="Auswertung">neu !!!!</TD></tr>\n');	
			show(Ergebnis_Farbe  +Ergebnis_red, 'Auswertungs_Text');
			}
			else
			{
			yellow();
			show(Ergebnis_Farbe + Ergebnis_yellow, 'Auswertungs_Text');
			//document.QuickCheck.Ergebnis_Text.value = Ergebnis_yellow
			}	
              }
	
	
	// alert ("Bitte senden Sie mir nun Ihre Ergebnisse per Mail zu, indem Sie die 2. Taste drücken!");
	}
	

function red()
	{
   changeImages  ( /*CMP*/'Ampel',/*URL*/"../Bilder/Ampel_red.bmp")  
	}
	
function yellow()
	{
  changeImages  ( /*CMP*/'Ampel',/*URL*/"../Bilder/Ampel_yellow.bmp")  
	}
	
function green()
	{
  changeImages  ( /*CMP*/'Ampel',/*URL*/"../Bilder/Ampel_green.bmp")  
   }
   
   function grey()
	{
  changeImages  ( /*CMP*/'Ampel',/*URL*/"../Bilder/Ampel_grey.bmp")  
	}

// Bilder Link aendern
function changeImages() {
	d = document;
	if (d.images) {
		var img;
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			img = null;
			if (d.layers) {img = findElement(changeImages.arguments[i],0);}
			else {img = d.images[changeImages.arguments[i]];}
			if (img) {img.src = changeImages.arguments[i+1];}
		}
	}
}

// zeigt in der Tabellen Zelle mit id den Text Cell_Text an
function show(Cell_Text, id){
  
  objElem = getLayerRef(id);
  if(document.layers){
    with(objElem.document){
      open(); write(Cell_Text);close();
    }
  } else if(objElem.innerHTML){
    objElem.innerHTML =Cell_Text;
  }
}


function getLayerRef (id, document) {
  if (!document)
    document = window.document;
  if (document.layers) {
    for (var l = 0; l < document.layers.length; l++)
      if (document.layers[l].id == id)
        return document.layers[l];
    for (var l = 0; l < document.layers.length; l++) {
      var result = getLayerRef(id, document.layers[l].document);
      if (result)
        return result;
    }
    return null;
  }
  else if (document.all) {
    return document.all[id];
  }
  else if (document.getElementById) {
    return document.getElementById(id);
  } else {
    return null;
  }
}


