function BrowserCheck(){var a=navigator.appName;this.mac=navigator.appVersion.indexOf("Mac")!=-1;this.b=a=="Netscape"?"ns":a=="Microsoft Internet Explorer"?"ie":a;this.version=navigator.appVersion;this.v=parseInt(this.version);this.ns=this.b=="ns"&&this.v>=5;this.ns5=this.b=="ns"&&this.v==5;this.ns6=this.b=="ns"&&this.v==5;this.ie=this.b=="ie"&&this.v>=4;this.ie4=this.version.indexOf("MSIE 4")>0;this.ie5=this.version.indexOf("MSIE 5")>0;if(this.mac)this.ie=this.ie5;this.ie5mac=this.ie5&&this.mac;
this.min=this.ns||this.ie}is=new BrowserCheck;if(is.min==false||is.ie5mac)alert("Your browser can't handle this page. You need NS6 or IE5 on Windows, or NS6 on Mac.");function PageDim(){this.W=600;this.H=400;if(is.ns)this.W=window.innerWidth;if(is.ie)this.W=document.body.clientWidth;if(is.ns)this.H=window.innerHeight;if(is.ie)this.H=document.body.clientHeight}var pg=null;
function SuppressBackspace(a){thisKey=is.ns?a.keyCode:window.event.keyCode;var b=false;if(thisKey==13)if(document.getElementById("FeedbackDiv").style.display!="none"){HideFeedback();b=true}if(thisKey==8)b=true;if(b==true)if(is.ie){window.event.returnValue=false;window.event.cancelBubble=true}else a.preventDefault()}var NavLightColor="#fff7bf",NavShadeColor="#7f7740",NavBarColor="#FFFFCC",FuncLightColor="#ffbf7f",FuncShadeColor="#7f4000",ExBGColor="#FFFFCC";
function NavBtnOver(a){a.style.padding="1px 3px 3px 1px";a.style.borderLeftColor=NavLightColor;a.style.borderTopColor=NavLightColor;a.style.borderRightColor=NavShadeColor;a.style.borderBottomColor=NavShadeColor}function NavBtnOut(a){a.style.borderColor=NavBarColor;a.style.padding="2px 2px 2px 2px"}
function NavBtnDown(a){a.style.borderLeftColor=NavShadeColor;a.style.borderTopColor=NavShadeColor;a.style.borderRightColor=NavLightColor;a.style.borderBottomColor=NavLightColor;a.style.padding="3px 1px 1px 3px"}function FuncBtnOver(a){a.style.padding="2px 7px 4px 5px";a.style.borderLeftColor=FuncLightColor;a.style.borderTopColor=FuncLightColor;a.style.borderRightColor=FuncShadeColor;a.style.borderBottomColor=FuncShadeColor}
function FuncBtnOut(a){a.style.borderColor="#FFFFCC";a.style.padding="3px 6px 3px 6px"}function FuncBtnDown(a){a.style.borderLeftColor=FuncShadeColor;a.style.borderTopColor=FuncShadeColor;a.style.borderRightColor=FuncLightColor;a.style.borderBottomColor=FuncLightColor;a.style.padding="4px 5px 2px 7px"}
var topZ=100,CorrectIndicator="RICHTIG",IncorrectIndicator="FALSCH",YourScoreIs="Punktestand: ",CorrectResponse="Richtig. Gut gemacht.",IncorrectResponse="Du hast Fehler gemacht. Versuch es noch einmal. <br>",TotalUnfixedLeftItems=0,TotCorrectChoices=0,Penalties=0,DefaultResponse="[strDefaultResponse]",ReadingURL="[ReadingURL]",TempReading="",TableOpener='<form name="QForm">';TableOpener+='<table border="0">';var IRow='<tr><td><span class="LeftItem">';IRow+="[strLeftItem]</span>&nbsp;&nbsp;&nbsp;&nbsp;</td>";
IRow+='<td><span class="RightItem">';IRow+="[strRightItem]</span></td>";IRow+='<td>&nbsp;&nbsp;&nbsp;<span class="CorrectMark">[Mark]</span>';IRow+="</td></tr>";TableCloser="</table></form>";var DropDownList="",Exercise="";function Shuffle(a){Temp=[];for(var b=a.length,c=b,d=0;d<b;d++)Temp[d]=a[d];for(d=0;d<b;d++){Num=Math.floor(c*Math.random());a[d]=Temp[Num];for(var e=Num;e<c;e++)Temp[e]=Temp[e+1];c--}return a}
function WriteFeedback(a){a=a+"<br /><br />";document.getElementById("FeedbackContent").innerHTML=a;a=document.getElementById("FeedbackDiv");topZ++;a.style.zIndex=topZ;pg=new PageDim;a.style.left=Math.floor(pg.W/5)+"px";a.style.width=Math.floor(pg.W/5)+"px";a.style.top=is.ns?Math.floor(pg.H/5)+window.pageYOffset+"px":Math.floor(pg.H/5)+document.body.scrollTop+"px";if(is.ie)for(var b=0;b<document.all.length;b++)if(document.all[b].id.substring(0,3)=="sel")document.all[b].style.display="none";a.style.display=
"block";RefreshImages()}function HideFeedback(){document.getElementById("FeedbackContent").innerHTML="";document.getElementById("FeedbackDiv").style.display="none";if(is.ie)for(var a=0;a<document.all.length;a++)if(document.all[a].id.substring(0,3)=="sel")document.all[a].style.display="inline"}function WriteToInstructions(a){a='<span class="FeedbackText">'+a+"</span>";document.getElementById("InstructionsDiv").innerHTML=a;RefreshImages()}
function BuildSelector(){DropDownList='<select id="sel[INum]" name="sel[INum]">';DropDownList+='<option value="??? ">??? </option>';for(var a=0;a<RItems.length;a++)DropDownList+='<option value="'+EscapeDoubleQuotes(RItems[a][0])+'">'+RItems[a][0]+"</option>";DropDownList+="</select>"}Imgs=[];function PreloadImages(){for(var a=PreloadImages.arguments,b=0;b<a.length;b++){Imgs[b]=new Image;Imgs[b].src=a[b]}}
function RefreshImages(){for(var a=0;a<document.images.length;a++)if(document.images[a].name.substring(0,6)!="NavBar")document.images[a].src=document.images[a].src}
function StartUp(){if(is.ns)window.addEventListener("keypress",SuppressBackspace,false);else{document.attachEvent("onkeydown",SuppressBackspace);window.attachEvent("onkeydown",SuppressBackspace)}PreloadImages();for(var a=false,b=0;b<I.length;b++)if(I[b][2]<1){I[b][0].length>0&&TotalUnfixedLeftItems++;a=false;for(var c=0;c<RItems.length;c++)if(I[b][1]==RItems[c][0]){a=true;RItems[c][1][RItems[c][1].length]=b}if(a==false){RItems[RItems.length]=[];RItems[RItems.length-1][0]=I[b][1];RItems[RItems.length-
1][1]=[];RItems[RItems.length-1][1][0]=b}}RItems=Shuffle(RItems);for(b=0;b<RItems.length;b++)for(c=0;c<RItems[b][1].length;c++)I[RItems[b][1][c]][3]=b;BuildSelector();CreateStatusArrays();BuildExercise();DisplayExercise(Exercise)}
function BuildExercise(){var a="";Exercise="";for(var b=0;b<I.length;b++)if(I[b][0].length>0){a=IRow;a=ReplaceStuff("[strLeftItem]",I[b][0],a);a=I[b][2]<1&&Status[b][0]<1?ReplaceStuff("[strRightItem]",DropDownList,a):ReplaceStuff("[strRightItem]",I[b][1],a);a=I[b][2]<1&&Status[b][1]>0?Status[b][0]<1?ReplaceStuff("[Mark]",IncorrectIndicator,a):ReplaceStuff("[Mark]",CorrectIndicator,a):ReplaceStuff("[Mark]","",a);a=ReplaceStuff("[INum]",b,a);Exercise+=a}Exercise=TableOpener+Exercise+TableCloser};
