$("#ok").click(function(){var a=$.trim($("#uname").val());if(a.length<=0){$("#err_hs_name").text("Please enter your name.");return false}else{$("#ok").val("Submitting your score...");$("#ok").attr("disabled","disabled")}var c=$("#cgameid").val(),d=$("#hscore").val(),e=$("#umoves").val(),f=$("#useconds").val(),g=$("#userscore").text();if($.trim($("#uname").val()).length==0){$("#err_hs_name").text("Please enter your name.");return false}else{$.modal.impl.close();$.getJSON(_mainRoot+"puzzle/sliding/widget/savescore.php",
{gid:c,highestscore:d,userscore:g,username:a,moves:e,seconds:f},function(b){$("#certlink").css("display","block");$("#viewcertificateURL").css("display","block");var h=_mainRoot+"puzzle/sliding/cert/?usi="+b[0].certificateINFO;b=b[0].userscore;$("#maxscore").text(b);$("#viewcertificateURL").attr("href",h)})}});$("#uname").keypress(function(a){if(a.which&&a.which==13||a.keyCode&&a.keyCode==13){$("#ok").click();return false}else return true});