var ab=0;var bb=new Array(97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122);var cb=null;var db;var eb=false;function fb(){for(var i=0;i<bb.length;i++)document.getElementById("x"+bb[i]).style.background="white";document.getElementById("time").firstChild.nodeValue="0";ab=0;eb=false;gb();}
function hb(ib){clearTimeout(db);if(cb!=null&&ib==true){var jb=((new Date().getTime()-cb)/1000).toFixed(2);kb(jb);document.getElementById("time").firstChild.nodeValue=jb;gb();}
eb=true;cb=null;}
function lb(){var mb=new Date().getTime();document.getElementById("time").firstChild.nodeValue=Math.round((mb-cb)/1000);db=setTimeout(lb,1000);}
function kb(nb){var ob=pb();if(nb<ob||ob==0){var qb=new Date();qb.setTime(qb.getTime()+(365*24*3600*1000));document.cookie="alfabetet="+nb+"; expires="+qb.toGMTString();}
}
function pb(){var ob=getCookieData("alfabetet");if(ob==false)ob=0;return parseFloat(ob);}
function gb(){document.getElementById("best").firstChild.nodeValue=pb();}
function sb(){document.cookie="alfabetet=100.0; expires=Thu, 01-Jan-70 00:00:01 GMT";document.getElementById("best").firstChild.nodeValue="0";}
function tb(ub){ub=(ub)?ub:((window.event)?window.event:null);if(ub&&ub.charCode!=0){var vb=(ub.charCode)?ub.charCode:ub.keyCode;if(!vb in bb)return true;if(vb==32){hb();fb();return false;}
if(eb){if(confirm("Game over. Play again?"))fb();return false;}
if(vb==bb[ab]||vb==bb[ab]-32){if(cb==null){cb=new Date().getTime();lb();}
document.getElementById("x"+bb[ab]).style.background="green";if(ab==bb.length-1)hb(true);ab++;}
else
document.getElementById("x"+bb[ab]).style.background="red";return false;}
return true;}
