f01 = 0
f02 = 0
f03 = 0
f04 = 0
f51 = 0
f52 = 0

fOK = 1

Ba1 = "../Bld/PfL_hr.gif"
Ba2 = "../Bld/PfL_dg.gif"
Bb1 = "../Bld/PfR_hr.gif"
Bb2 = "../Bld/PfR_dg.gif"
Bc1 = "../Bld/Frage02.gif"
Bc2 = "../Bld/Frage01.gif"
Bd1 = "../Bld/Buch02.gif"
Bd2 = "../Bld/Buch01.gif"
Bv1 = "../Bld/ALFA_2.gif"
Bv2 = "../Bld/ALFA_1.gif"
Bz1 = "../Bld/HJP_r.gif"
Bz2 = "../Bld/HJP_go.gif"

aon = new Image(); aon.src = Ba1; aoff = new Image(); aoff.src = Ba2;
bon = new Image(); bon.src = Bb1; boff = new Image(); boff.src = Bb2;
con = new Image(); con.src = Bc1; coff = new Image(); coff.src = Bc2;
don = new Image(); don.src = Bd1; doff = new Image(); doff.src = Bd2;

von = new Image(); von.src = Bv1; voff = new Image(); voff.src = Bv2;
zon = new Image(); zon.src = Bz1; zoff = new Image(); zoff.src = Bz2;

function rollon(imgName)
{
  if ((fOK == 0) || (imgName != "c"))
	{ imgOn = eval(imgName + "on.src"); document.images[imgName].src = imgOn;; }
  else
	{ document.images[imgName].src = don.src;; }
}

function rolloff(imgName)
{
  if ((fOK == 0) || (imgName != "c"))
	{ document.images[imgName].src = eval(imgName + "off.src");; }
  else
	{ document.images[imgName].src = doff.src;; }
}

function Start()
{ 
   if (f_Bld == 0) { document.images["p"].src = "../Bld1/Q_0000.gif" }
   else { document.images["p"].src = p_Bild }
}

function checkCookie()
{
	Start()
}

function WinClose() { top.location.href = L_Nein }

function onF01() { f01 = (f01+1)%2 }
function onF02() { f02 = (f02+1)%2 }
function onF03() { f03 = (f03+1)%2 }

function Rechnen()
{
	if (f04 == 1) { Rechts() }
	else
	{
		if (f01==0 && f02==0 && f03==0) { KeinKreuz() }
		else
		{
			rollon("b")
			f04 = 1
			if (f01==f_1 && f02==f_2 && f03==f_3) { Korrekt() }
			else { Falsch() }
		}
	}
}

function KeinKreuz()
{
	Form01.Korrektur.value = s_Leer
}

function Korrekt()
{
	Form01.Korrektur.value = s_Korrekt
	var1 = parent.frames[0].Form00[(n_Frage - 1)].value 
	if (  (var1 != '?') && (var1 != '.') )
		{  parent.frames[0].Form00[(n_Frage - 1)].value = '.'
			Result()
		}
}

function Falsch()
{
   nTot = f01 + f02 + f03 - nKrz
	if (nTot <  0) { Form01.Korrektur.value = s_Falsch1 }	
	if (nTot == 0) { Form01.Korrektur.value = s_Falsch2 }
	if (nTot >  0) { Form01.Korrektur.value = s_Falsch3 }

	var1 = parent.frames[0].Form00[(n_Frage - 1)].value 
	if (  (var1 != '?') && (var1 != '.') )
		{  parent.frames[0].Form00[(n_Frage - 1)].value = '?'
			Result()
		}
   fOK = 0
   rolloff("c")
}

function Result()
{
	if ( (f01==f_1) && ( nMax >= 1) ) { f51 += 1 } 
	if ( (f02==f_2) && ( nMax >= 2) ) { f51 += 1 } 
	if ( (f03==f_3) && ( nMax >= 3) ) { f51 += 1 } 
	if ( (f01!=f_1) && ( nMax >= 1) ) { f52 += 1 } 
	if ( (f02!=f_2) && ( nMax >= 2) ) { f52 += 1 } 
	if ( (f03!=f_3) && ( nMax >= 3) ) { f52 += 1 } 
	n51 = eval(parent.frames[0].Form00.T51.value)
	parent.frames[0].Form00.T51.value = f51 + n51
	n52 = eval(parent.frames[0].Form00.T52.value)
	parent.frames[0].Form00.T52.value = f52 + n52
}

function Links()
{
	if (n_Frage == 1) { top.location.href = L_Auswahl}
	else { parent.frames[1].location.href = L_Links }
}

function Rechts()
{
	if (n_Frage == 50) { parent.frames[1].location.href = L_Ende}
	else { parent.frames[1].location.href = L_Rechts }
}

function Ende_1() { parent.frames[1].location.href = L_Rechts }

function Ende_2() { top.location.href = L_Auswahl }

function Kommentar() { window.open(L_Kommentar,"Kommentar","width=500,height=300") }

function Copyright() { window.open(L_CR,"Copyright","width=630,height=430") }

function BigBld()
{ 
   if (f_Bld == 0)
      { window.open("../Bld3/Q_0000.htm","Bild","width=630,height=430" ) }
   else
      { window.open(L_Bild,"Bild","width=630,height=430" ) }
}
