home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2002 September
/
Chip_2002-09_cd1.bin
/
tema
/
neural
/
webtest
/
Slovniky
/
fotbal
/
top.js
< prev
next >
Wrap
Text File
|
2001-06-21
|
11KB
|
1 lines
pganscount=4;imgsubdir='img/';AsSubdir='';QsSubdir='fig/';QsHead='<h2>';AsHead='<h2>';QsBottom='</h2>\nTento v²raz znamenß:';AsBottom='</h2>\nTento v²raz znamenß:';BadFontStart='<b><font color="navy">';BadFontEnd='</font></b>';BadFontText='modr²m tuΦn²m pφsmem';var x=new Array(new Array("PokraΦovat",0,0),new Array("I - Hracφ plocha",1,18),new Array("II - MφΦ",19,28),new Array("III - HrßΦi",29,40),new Array("VÜechna slovφΦka",1,40));var D=new Array('rozm∞ry','hracφ plocha','pomeznφ Φßra','brankovß Φßra','dΘlka','Üφ°ka','mezinßrodnφ utkßnφ (mno₧. Φφslo)','vyznaΦenφ','Φßry','·zemφ','ohraniΦujφcφ Φßry','st°edovß Φßra','st°edovß znaΦka','brankovΘ ·zemφ','pokutovΘ ·zemφ','branky','brankovΘ tyΦe','b°evno','mφΦ','kulat²','zhotoven² z k∙₧e','obvod','vßha','hra, utkßnφ','tlak','v²m∞na','poÜkozen² mφΦ','hra je p°eruÜena','hrßΦi','dv∞ dru₧stva','sestßvajφcφ','jedenßct','brankß°','mΘn∞ ne₧','sedm','sout∞₧','nßhradnφci','pravidla, hernφ °ßd','rozhodΦφ','st°φdßnφ');var B=new Array("");var r=new Array('dimensions','field of play','touch line','goal line','length','width','international matches','markings','lines','area','boundary lines','halfway line','centre mark','goal area','penalty area','goals','goalposts','crossbar','ball','spherical','made of leather','circumference','weight','match','pressure','replacement','defective ball','the match is stopped','players','two teams','consisting','eleven','goalkeeper','fewer than','seven','competition','substitutes','rules','referee','substitution');var q=new Array("");var s1=new Array("");var U=false;var u1=true;var b1=x.length;var t=Math.min(Math.max(D.length,B.length),Math.max(r.length,q.length));var l=new Array();var p=0;var b=new Array(0,0,0,0,0,0);var W=false;var c=new Array(t+1);var s=new Array(t+1);var v=new Array(t+1);var g=new Array(pganscount);var M=new Array(pganscount);var I=new Array(pganscount);var z=pganscount;var f=0;var A=0;var E=0;var G=0;var m1=new String('abcdefghijklmnopqrstuvwxyz');var V=1000000;function O1(x1,C1){return x1-C1}function J(item){return((item!=null)&&(typeof(item)!='string')&&(item.length!=null))}function H(F){for(i=0;i<F.length;i++)F[i]=Number(F[i])}function S1(){for(i=0;i<=t;i++)c[i]=i-1;}function K1(){E=0;G=0;A=0;for(a=0;a<=t;a++){s[a]=0;v[a]=0;}}function J1(){JoinedPasses=p;for(a=0;a<l.length;a++)JoinedPasses+="/"+l[a].join("_");n("FPasses",JoinedPasses,2);n("FQSP",c.join("/"),2);n("FQS1",v.join("/"),2);n("FQS0",s.join("/"),2);n("FLastRes",E+'/'+G+'/'+A,2)}function G1(){res=true;cock=C("FPasses");if(cock){passes=cock.split("/");l=[];p=0;for(a=1;a<passes.length;a++){l[a-1]=passes[a].split("_");H(l[a-1])}p=Number(passes[0]);if(p<l.length){b=l[p];}else{b=[0];res=false}}else{res=false}cock=C("FQSP");if(cock){c=cock.split("/");H(c)}else{res=false}cock=C("FQS1");if(cock){v=cock.split("/");H(v)}else{res=false}cock=C("FQS0");if(cock){s=cock.split("/");H(s)}else{res=false}cock=C("FLastRes");if(cock){lastres=cock.split("/");H(lastres)}else{res=false}if(lastres.length>=3){E=lastres[0];G=lastres[1];A=lastres[2];}else{res=false}return res}function H1(){n("FPasses","",0);n("FQSP","",0);n("FQS1","",0);n("FQS0","",0);n("FLastRes","",0)}function v1(){return(C("FPasses")!=null)}function j1(m,y){tmp=c[m];c[m]=c[y];c[y]=tmp}function p1(e,d){expand=d-e;for(a=e;a<=d;a++){rnd=Math.round(Math.random()*expand)+e;if(rnd!=a)j1(a,rnd)}}function z1(e,d,d1,a1,e1){m=d;if(!d1)d1=V;if(!a1)a1=V;if(!e1)e1=V;while(m>=e){if((s[c[m]]>=d1)||(v[c[m]]>=a1)||(s[c[m]]+v[c[m]]>=e1)){d--;for(y=m;y<=d;y++)j1(y,y+1);}m--;}return d-e+1}function M1(){W=!W;Dir=AsSubdir;AsSubdir=QsSubdir;QsSubdir=Dir;Big=r;r=D;D=Big;Big=q;q=B;B=Big;Head=AsHead;AsHead=QsHead;QsHead=Head;Head=AsBottom;AsBottom=QsBottom;QsBottom=Head}function F1(h){list=h.elements[0];return list.options[list.selectedIndex].value}function i1(a,S){res=(S)?B[c[a]]:D[c[a]];if(J(res)){rnd=Math.round(Math.random()*(res.length-1));res=res[rnd]}return(res==null)?"":res}function f1(o,a,S){if(U){F=(S)?q[c[o]]:r[c[o]];if(F==null)return"";else arritem=F[g[a]]}else{arritem=(S)?q[c[g[a]]]:r[c[g[a]]];if(J(arritem)){rnd=Math.round(Math.random()*(arritem.length-1));arritem=arritem[rnd]}}return(arritem==null)?"":arritem}function R(w,u){if(J(w)){if(J(u)){for(i=0;i<w.length;i++)for(j=0;j<u.length;j++)if(w[i]==u[j])return true}else{for(i=0;i<w.length;i++)if(w[i]==u)return true}}else{if(J(u)){for(j=0;j<u.length;j++)if(w==u[j])return true}else{if(w==u)return true}}return false}function R1(K,L){return((R(r[K],r[L])&&R(q[K],q[L]))||(R(D[K],D[L])&&R(B[K],B[L])))}function D1(k1,P,Z){if(U){curransarray=c[k1];curranscount=Math.max((r[curransarray]==null)?0:r[curransarray].length,(q[curransarray]==null)?0:q[curransarray].length);for(a=0;a<curranscount;a++)g[a]=a;f=s1[curransarray]}else{curranscount=pganscount;g[0]=k1;f=0;for(a=1;a<curranscount;a++){ansrange=Z-P;somesame=true;while(somesame){rnd=Math.round(Math.random()*ansrange)+P;somesame=false;for(subidx=0;(subidx<a)&&!somesame;subidx++)if(R1(c[g[subidx]],c[rnd]))somesame=true}g[a]=rnd}}if(!(U&&u1)){for(a=0;a<curranscount;a++){rnd=Math.round(Math.random()*(curranscount-1));if(rnd!=a){tmp=g[a];g[a]=g[rnd];g[rnd]=tmp;if(f==a)f=rnd;else if(f==rnd)f=a}}if(f>=pganscount){rnd=Math.round(Math.random()*(pganscount-1));tmp=g[f];g[f]=g[rnd];g[rnd]=tmp;f=rnd}}return(curranscount<pganscount)?curranscount:pganscount}function t1(Q,L1){k=true;getnewquest=true;advancequest=false;switch(b[0]){case 1:if(Q){o=b[1];if(b[10]||!b[6])A++;if(L1){k=true;getnewquest=true;if(b[10]||!b[6]){v[c[o]]++;E++;}b[6]=0}else{k=b[7];getnewquest=b[7];if(b[10]||!b[6]){s[c[o]]++;G++;}b[6]=(b[7])?0:-1}advancequest=getnewquest;}else{b[6]=1;k=true;getnewquest=false;advancequest=false;}}return[getnewquest,advancequest,k]}function E1(N1,N){do{trynextpass=false;switch(b[0]){case 0:trynextpass=true;res=false;break;case 1:if(N){if(b[6]==-1)b[6]=1;else b[6]=0;if(W==!b[9])M1()}if(!b[1]){b[1]=b[2];if(b[8])p1(b[2],b[3])}else{if(N1)b[1]++}if(b[1]>b[3]){newqcount=z1(b[2],b[3],b[11],b[12],b[13]);b[3]=b[2]+newqcount-1;b[1]=b[2];if(b[8])p1(b[2],b[3])}res=(b[1]<=b[3]);trynextpass=!res;break;default:trynextpass=true;res=false;}if(trynextpass){p++;if(p<l.length){b=l[p]}else{trynextpass=false}}}while(!res&&trynextpass)if(res)z=D1(b[1],b[4],b[5]);return res}function T1(o,k){if(k)checkpar="true";else checkpar="false";with(parent.frames[2].document){open('text/html','replace');writeln('<html>');writeln('<meta http-equiv="Content-Type" content="text/html; charset=windows-1250">');writeln('<body bgcolor="white">');if(k)writeln('<script language="JavaScript">function VAJ(ansidx) { parent.frames[0].X(this.form, true, false, ansidx) }</script>');writeln('<form name="InputForm">');Qimg=i1(o,true);Qtext=i1(o,false);if(Qimg.length)writeln('<img src="'+QsSubdir+Qimg+'" align="right">');if(QsHead.length)writeln(QsHead);if(Qtext.length)writeln(Qtext);if(QsBottom.length)writeln(QsBottom);for(a=0;a<z;a++){M[a]=f1(o,a,true);I[a]=f1(o,a,false)}Aimgs=0;Atexts=0;for(a=0;a<z;a++){if(M[a].length)Aimgs++;if(I[a].length)Atexts++}if(Aimgs){writeln('<center><table width="90%" border="0" cellpadding="5" cellspacing="0" align="center"><tr>');for(a=0;a<z;a++){writeln('<td align="center" valign="middle">');if(M[a].length)writeln('<img src="'+AsSubdir+M[a]+'">');if(Atexts)writeln('<br>');if(I[a].length)writeln(I[a]);writeln('</td>')}writeln('</tr><tr>');for(a=0;a<z;a++){write('<td align="center">');if((!k)&&(a==f))write(BadFontStart);write(m1.charAt(a)+')');if((!k)&&(a==f))write(BadFontEnd);writeln('</td>')}writeln('</tr></table></center><br>')}else{writeln('<ol type="a">');for(a=0;a<z;a++){if((!k)&&(a==f))writeln(BadFontStart);if(k)write('<a href=javascript:VAJ(',a+1,')>');write('<li>');if(k)write('</a>');writeln(' '+I[a]);if((!k)&&(a==f))writeln(BadFontEnd)}writeln('</ol>')}if(k){writeln('Vyberte prosφm odpov∞∩: ');writeln('<select name="ansselect">');for(a=0;a<z;a++)write('<option value="',1+a,'">'+m1.charAt(a)+') ');writeln('</select>');writeln('a stiskn∞te tlaΦφtko ')}else{writeln('Sprßvnß odpov∞∩ je vytiÜt∞na '+BadFontStart+BadFontText+'.'+BadFontEnd+' ')}writeln('<input type="button" value=" DalÜφ " onClick="parent.frames[0].X(this.form, '+checkpar+', false, 0)">');writeln('<input type="button" value=" Konec " onClick="parent.frames[0].g1(this.form, true, false)">');writeln('<p><b>Status:<b><table cellpadding="1" bgcolor="white">');writeln('<tr><td>Answer</td>');for(i=b[2];i<=b[3];i++)writeln('<td bgcolor="linen" align="center">',1+c[i],'</td>');writeln('</tr>');writeln('<tr><td>Correct</td>');for(i=b[2];i<=b[3];i++)writeln('<td bgcolor="linen" align="center">',v[c[i]],'</td>');writeln('</tr>');writeln('<tr><td>Missed</td>');for(i=b[2];i<=b[3];i++)writeln('<td bgcolor="linen" align="center">',s[c[i]],'</td>');writeln('</tr>');writeln('</table>');writeln('</form></body></html>');close()}}function X(h,Q,r1,Y){if(r1||!b[1]){Processing=[true,!b[1],true];N=true}else{if(Q&&!Y)Y=F1(h);Processing=t1(Q,(Y==1+f));N=false}A1();if(Processing[0])if(!E1(Processing[1],N)){g1(h,false,true);return;}T1(b[1],Processing[2])}function l1(h,e,d,P1,w1,Q1){e=Number(e);if(isNaN(e)||(e<1))e=1;d=Number(d);if(isNaN(d)||(d>t))d=t;if(d<e)d=e;acceptbadN=Number(P1);shuffledN=Number(w1);swappedN=Number(Q1);S1();K1();selsect=n1(h);if(selsect){P=x[selsect][1];Z=x[selsect][2];l=[];TestPass=0;passpoints=[e];passpoint=1;for(a=0;a<b1;a++){secstart=x[a][1];if((e<=secstart)&&(secstart<=d)){passpoints[passpoint]=secstart;passpoint++}}passpoints[passpoint]=d+1;passpoint++;passpoints.sort(O1);for(a=0;a<passpoint-1;a++){if(passpoints[a]<passpoints[a+1]){l[TestPass]=new Array(1,0,passpoints[a],passpoints[a+1]-1,P,Z,0,acceptbadN,shuffledN,swappedN,0,0,2,0);TestPass++;}}p=0;b=l[p];}else{G1()}X(h,false,true,0)}function g1(h,B1,I1){if(I1)H1();if(B1)J1();parent.frames[2].location.href='theend.htm';}function A1(){with(parent.frames[1].document){open('text/html','replace');writeln('<html>');writeln('<meta http-equiv="Content-Type" content="text/html; charset=windows-1250">');writeln('<body background="'+imgsubdir+'bg.gif">');writeln('<font size=+1 color="brown"><center>');writeln('<b>Otßzek: ',A,' Sprßvn∞: ',E,' Chyb: ',G,'<br>');if(A>0)score=String(Math.floor(100*E/A))+'%';else score='';writeln('┌sp∞Ünost: ',score,'<br>');writeln('</body></html>');close()}}function q1(_){_.writeln('<select name="SelectSect" onChange="parent.frames[0].h1(this.form)">');for(a=(v1())?0:1;a<b1;a++){_.writeln('<option value="',a,'">',x[a][0])}_.writeln('</select>')}function n1(h){list=h.SelectSect;return Number(list.options[list.selectedIndex].value)}function h1(h){selsect=n1(h);if((selsect<0)||(selsect>b1))selsect=1;h.c1.value=(selsect)?x[selsect][1]:' ';h.c2.value=(selsect)?x[selsect][2]:' '}