var af={X:"sdkcell",I:"sdkmsgsolved",J:"sdkmsgunsolved",H:"sdkmsgnoworkopera",t:"#808080",z:"#FF0000",w:"#6A5ACD",v:"#C71585",M:5,m:"X",ah:new Array(0)};function wait(N){var B=new Date();var A=null;do{A=new Date();}while(A-B<N);};function d(ad){this.ad=ad;this.M=af.M;this.cells=new Array(0);for(var O=0;O<this.ad.length;O++){var o=this.ad.charAt(O);if(o==af.m){continue;}var n=document.getElementById(af.X+O);this.cells.push(new c(this,n,o));}};d.prototype.C=function(){for(var O=0;O<this.cells.length;O++){if(!this.cells[O].D()){return false;}}return true;};d.prototype.ak=function(){this.r();var R=document.getElementById(af.I);var S=document.getElementById(af.J);if(this.C()){R.style.display="inline";}else{S.style.display="inline";}};d.prototype.r=function(){var R=document.getElementById(af.I);var S=document.getElementById(af.J);var Q=document.getElementById(af.H);R.style.display="none";S.style.display="none";Q.style.display="none";};d.prototype.ab=function(){var emptyCells=new Array(0);for(var O=0;O<this.cells.length;O++){var l=this.cells[O];if(!l.F()){emptyCells.push(O);}}if(emptyCells.length==0){return;}var W=Math.floor(Math.random()*emptyCells.length);var G=this.cells[emptyCells[W]];G.ac(true);};d.prototype.ac=function(){for(var O=0;O<this.cells.length;O++){this.cells[O].ac();}};d.prototype.Z=function(){for(var O=0;O<this.cells.length;O++){this.cells[O].clear();}};d.prototype.f=function(g){if(window.opera){this.r();var Q=document.getElementById(af.H);Q.style.display="inline";return;}for(var O=0;O<this.cells.length;O++){this.cells[O].aa(g?this.M:1);}};d.prototype.aj=function(j){for(var O=0;O<this.cells.length;O++){this.cells[O].aj(j);}};function c(Y,P,ad){this.Y=Y;this.P=P;this.P.maxLength=1;this.ad=ad;this.k=false;if(this.P.value==null||this.P.value==""){this.P.readOnly=false;}var l=this;this.P.onkeyup=function(){l.T();};this.P.onkeypress=onCellEvent;this.P.oncontextmenu=function(){return false;};this.P.ondrop=function(){return false;};this.P.ondragdrop=function(){return false;};this.P.oncut=function(){return false;};this.P.onpaste=function(){return false;};};function onCellEvent(e){if(e==null){e=window.event;}var keyCode=(e.keyCode?e.keyCode:e.which);var P=(e.target?e.target:e.srcElement);if(keyCode==13||keyCode==32){return false;}var L=String.fromCharCode(keyCode);if(P.value.indexOf(L)>=0){return false;}return true;};c.prototype.T=function(){if(this.P.readOnly){return;}this.Y.r();var value=(this.P.value?this.P.value:"");if(value.length>1){this.P.style.color=af.w;}else{var ai=!this.k||this.D();this.P.style.color=(ai?af.t:af.z);}var ae=(value.length>0?value.length-1:0);var V=Math.max(35,100-ae*20)+"%";this.P.style.fontSize=V;this.P.style.height=V;};c.prototype.F=function(){return(this.P.value&&this.P.value!="");};c.prototype.D=function(){return(this.P.value.toUpperCase()==this.ad.toUpperCase());};c.prototype.ac=function(K){this.P.value=this.ad;if(K){this.P.style.color=af.v;af.ah.push(this);window.setTimeout("af.ah.shift().T();",1000);}else{this.T();}};c.prototype.clear=function(){if(this.P.readOnly){return;}this.P.value="";};c.prototype.aa=function(maxLength){if(this.P.readOnly){return;}this.P.maxLength=maxLength;var value=(this.P.value?this.P.value:"");if(value.length>this.P.maxLength){this.P.value="";}};c.prototype.aj=function(j){this.k=j;this.T();} 