﻿// JScript File
// (C)K&G Software Ltd 2008, www.kgsoft.co.uk
var gv_kgroot="";
function ixPageLoad(){if(window.screen.width>800) document.getElementById('main_tab').width="800px";gv_kgroot=String.fromCharCode(104,116,116,112,58,47,47,119,119,119,46,107,103,115,111,102,116,46,99,111,46,117,107,47);}
function sudoku_pay(){var pidNode=document.getElementById('sudoku_selpid');if(pidNode.selectedIndex==0) { alert("Please select a product!");  return false; }
document.getElementsByName('item_name')[0].value=pidNode.options[pidNode.selectedIndex].label;return true;}
function buyLicense(){var httpr = newHttpRequest(gv_kgroot+String.fromCharCode(115,117,100,111,107,117,46,97,115,112,120,63,99,109,100,61,103,116,108,107),false);if(httpr==null) { alert("Error occurred!"); return false; }
httpr.send(null);var eleCN = document.getElementById('lkey1');var eleDone=document.getElementById('lpdone1');var kc=httpr.responseText;var lc=kc.split('-');eleCN.value=String.fromCharCode(89,111,117,32,76,105,99,101,110,115,101,32,75,101,121,32,105,115,58,32) + lc[0];eleDone.value=gv_kgroot+String.fromCharCode(108,112,100,111,110,101,46,104,116,109,63,107,99,61)+kc;var eleItem = document.getElementById('iname1');eleItem.value="TETRIS-"+lc[0];return true;}
function mixString(mstr){return mstr;}
function initlpdone(){var divk=document.getElementById('lkey');var qstr=window.location.search;var kd=qstr.indexOf('=');if(kd<0) divk.innerHTML="License Key: ERROR";else {var key_code=qstr.substring(kd+1);var km=key_code.indexOf('-');if(km<1)divk.innerHTML="License Key: ERROR";else {var l_key=key_code.substring(0,km);if(l_key.length!=6)divk.innerHTML="License Key: ERROR";else {divk.innerHTML="License Key: Verifying...";var urll=gv_kgroot+String.fromCharCode(115,117,100,111,107,117,46,97,115,112,120,63,99,109,100,61,97,100,100,108,107,38,107,99,61)+key_code;var httpr = newHttpRequest(urll,true);if( httpr==null )return;httpr.onreadystatechange=function() {if (httpr.readyState==4) {if(httpr.responseText=="1") divk.innerHTML="License Key: "+l_key;else divk.innerHTML="License Key: ERROR";}
}
if(httpr) httpr.send(null);}
}
}
}
function addDownload(prodName){var urll=gv_kgroot+String.fromCharCode(115,117,100,111,107,117,46,97,115,112,120,63,99,109,100,61,97,100,100,108,111,97,100,38,112,110,61)+prodName;var httpr = newHttpRequest(urll,true);if(httpr) httpr.send(null);}
