var prero=0; var preco=0; function cellclk(i,j) { var pfield; var pfield1; pfield=document.getElementById(“c”+i+”_”+j);if (pfield.className!=”digitbl”){ pfield.className=”digit_highlightwh”; if (preco!=0){ pfield1=document.getElementById(“c”+prero+”_”+preco);pfield1.className=”digit”;}selco=preco; prero=i;preco=j; if (selco==j){te=pfield.value;pfield.value=pfield1.value;pfield1.value=te; prero=0;preco=0; pfield.className=”digit”; }}}function dispans(r,c){var pfield; var ans; ans=””;for(i=1;i<=r;i++){for(j=1;j<=c;j++){pfield=document.getElementById("c"+i+"_"+j);ans=ans+pfield.value;}}pfield=document.getElementById("ans"); pfield.value=ans; }function loadboard(r,c) { var pfield;var cid; var te; for(i=1;i<=r;i++){ for(j=1;j<=c;j++){cid="c"+i+"_"+j; te=getCookie(cid); if (te!=null && te!="") { pfield=document.getElementById(cid); pfield.value=te; } }}}function saveboard(r,c){var pfield; var cid;for(i=1;i<=r;i++){for(j=1;j<=c;j++){cid="c"+i+"_"+j;pfield=document.getElementById(cid);document.cookie=cid+"="+pfield.value;}}alert ("Board saved Successfully");} function getCookie(c_name){var i,x,y,ARRcookies=document.cookie.split(";");for (i=0;i<ARRcookies.length;i++){ x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("=")); y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1); x=x.replace(/^\s+|\s+$/g,""); if (x==c_name) { return unescape(y); } }}

Advertisements