// Tamil Crossword Builder // Copyright (C) 2011 Hari Balakrishnan, // Tamil Crossword Builder is free software; you can redistribute it // and/or modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 of // the License, or (at your option) any later version. // This program is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA // 02110-1301, USA. var mAcross; var mDown; var AClues, DClues; var sCluePos = ''; var sMoves = ''; var sToEmail = ''; var sCCEmail = ''; var sTemplateMoves = ['9|9|@#@#@@@@@@@@@#@#@#@#@##@@@@@@@@@@#@#@#@#@#@#@#@#@@@@@@@@@@##@#@#@#@#@@@@@@@@@#@#@', '9|9|#@#@#@#@#@@#@@@@@@#@#@#@#@#@@@@##@@@###@@@###@@@##@@@@#@#@#@#@#@@@@@@#@@#@#@#@#@#', '9|9|#@###@#@#@@@#@@@@@#@#@#@###@@#@@@@@@#@#@#@#@#@@@@@@#@@###@#@#@#@@@@@#@@@#@#@###@#', '9|9|@@@@@#@@#@#@#@#@#@@@@@#@@@@##@##@##@@#@@@@@#@@##@##@##@@@@#@@@@@#@#@#@#@#@@#@@@@@', '9|9|#@#@#@@@##@@@@@#@@#@#@#@###@@@#@@@@@#@#@#@#@#@@@@@#@@@###@#@#@#@@#@@@@@##@@@#@#@#', '9|9|@@@@@#@@@@#@#@#@#@@@@#@@@@@##@#@###@@@@@#@@@@@###@#@##@@@@@#@@@@#@#@#@#@@@@#@@@@@', '9|9|#@#@#@#@#@@@@@@#@@###@#@#@#@@@@#@@@@#@#####@#@@@@#@@@@#@#@#@###@@#@@@@@@#@#@#@#@#', '9|9|#@#@###@#@@@@@#@@@###@#@#@#@@#@@@@@@#@#@#@#@#@@@@@@#@@#@#@#@###@@@#@@@@@#@###@#@#', '10|10|@@@@##@##@@##@@@@@@@@@@@###@#@###@#@@@@@@@@@#@###@@###@#@@@@@@@@@#@###@#@###@@@@@@@@@@@##@@##@##@@@@', '15|15|#@#@#@#@#@#@#@#@@@@@@#@@@@@@@@#@#@#@#@#@#@#@#@@@#@@@@@@@#@@@#@#@#@###@#@#@#@@@@@@#@@@@@@@@###@###@#@#@#@#@@@@#@@@@@#@@@@#@#@#@#@###@###@@@@@@@@#@@@@@@#@#@#@###@#@#@#@@@#@@@@@@@#@@@#@#@#@#@#@#@#@#@@@@@@@@#@@@@@@#@#@#@#@#@#@#@#', '15|15|@@@@@@@#@@@@@@@@#@#@#@#@#@#@#@@@@@@@@#@@@@@@@@#@#@#@#@#@#@#@@@@#@@@@@#@@@@@@#@#@#@#@###@#@@@@@@@#@@@@@@@@####@#@#@#@####@@@@@@@@#@@@@@@@#@###@#@#@#@#@@@@@@#@@@@@#@@@@#@#@#@#@#@#@#@@@@@@@@#@@@@@@@@#@#@#@#@#@#@#@@@@@@@@#@@@@@@@']; var nCurrTemplate = 0; var sGridMode = "Build"; //alternative option = "Fill" var cwGrid; var iCurrX, iCurrY, iCurrAxis = 1; var sHLBarCol='#d9ff93'; var sHLSqCol='#93cc85'; var sNCol='white'; var mFillSymmetric = true; var mNumericMode = false; var mCurrInput; //var cwID = Math.uuid(10,16); /*! Math.uuid.js (v1.4) http://www.broofa.com mailto:robert@broofa.com Copyright (c) 2010 Robert Kieffer Dual licensed under the MIT and GPL licenses. */ (function() { // Private array of chars to use var CHARS = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split(''); Math.uuid = function (len, radix) { var chars = CHARS, uuid = [], i; radix = radix || chars.length; if (len) { // Compact form for (i = 0; i < len; i++) uuid[i] = chars[0 | Math.random()*radix]; } else { // rfc4122, version 4 form var r; // rfc4122 requires these characters uuid[8] = uuid[13] = uuid[18] = uuid[23] = '-'; uuid[14] = '4'; // Fill in random data. At i==19 set the high bits of clock sequence as // per rfc4122, sec. 4.1.5 for (i = 0; i < 36; i++) { if (!uuid[i]) { r = 0 | Math.random()*16; uuid[i] = chars[(i == 19) ? (r & 0x3) | 0x8 : r]; } } } return uuid.join(''); }; })(); function GenerateTemplate(tblCrossword,ddTemplate) { if (ddTemplate.selectedIndex > 0) { var aMoves = sTemplateMoves[ddTemplate.selectedIndex-1].split('|'); GenerateGrid(Number(aMoves[0]),Number(aMoves[1]),tblCrossword,aMoves[2]); } } function GenerateGrid(numAcross, numDown, tblCrossword, sTemplateMoves) { var x; var y; var oTable; var oRow; var oCell; //mAcross = document.getElementById("numAcross").value; //mDown = document.getElementById("numDown").value; //oTable = document.getElementById("tblCrossWord"); mAcross = Number(numAcross); mDown = Number(numDown); oTable = tblCrossword; while (oTable.rows.length > 0) oTable.deleteRow(0); cwGrid = new Array(mDown); for (y=1; y <=mDown; y++) { //create table row oRow = oTable.insertRow(y-1); cwGrid[y]=new Array(mAcross); for (x=1; x<=mAcross;x++) { cwGrid[y][x]=new Array(); cwGrid[y][x][1] = new Array(); // create table cell oCell = oRow.insertCell(x-1); if ((sTemplateMoves != undefined) && (sTemplateMoves.substring((y-1)*mDown+(x-1),(y-1)*mDown+(x-1)+1) == '#')) { SetCellAttribs(oCell,x,y,true); } else { SetCellAttribs(oCell,x,y,false); } } } oRow = oTable.insertRow(mDown); oRow.style.fontSize = "small"; oRow.style.backgroundColor = sHLBarCol; oCell = oRow.insertCell(0); oCell.height = 20; oCell.colSpan = mAcross; oCell.innerHTML = "Save Answers   "; oCell.innerHTML += "Load Answers   "; oCell.innerHTML += "© Hari Balakrishnan - puthirmayam.com"; oCell.style.textAlign = "right"; return true; } function SetCellAttribs(oTableCell,x,y, bIsBlack) { var sText; oTableCell.id = 'T' + x + 'x' + y; oTableCell.height = 30; oTableCell.width = 30; if (bIsBlack) { oTableCell.style.backgroundColor = 'black'; cwGrid[y][x][1][1] = '#'; } else { oTableCell.style.backgroundColor = 'white'; cwGrid[y][x][1][1] = '@'; } oTableCell.ClickHandler = ToggleState; XBrowserAddHandler(oTableCell,"click","ClickHandler"); } function ToggleSymmetry() { mFillSymmetric = !mFillSymmetric; } function ToggleNumericMode() { mNumericMode = !mNumericMode; } function ToggleState(e) { if (sGridMode == "Build") { var x, y, bSymmetricCell; x = Number(this.id.substring(1,this.id.indexOf('x'))); y = Number(this.id.substring(this.id.indexOf('x')+1)); bSymmetricCell = document.getElementById('T' + (mAcross-x+1) + 'x' + (mDown-y+1)); if (this.style.backgroundColor == 'white' ) { this.style.backgroundColor = 'black'; cwGrid[y][x][1][1] = '#'; if (mFillSymmetric && bSymmetricCell) { bSymmetricCell.style.backgroundColor = 'black'; cwGrid[mDown-y+1][mAcross-x+1][1][1] = '#'; } } else { this.style.backgroundColor = 'white'; cwGrid[y][x][1][1] = '@'; if (mFillSymmetric && bSymmetricCell) { bSymmetricCell.style.backgroundColor = 'white'; cwGrid[mDown-y+1][mAcross-x+1][1][1] = '@'; } } } else { MouseMoveXY(this); document.onkeydown = KeyboardPress; } } function XBrowserRemoveHandler(target,eventName,handlerName) { if ( target.removeEventListener ) { target.removeEventListener(eventName, function(e){target[handlerName](e);}, false); } else if ( target.detachEvent ) { target.detachEvent("on" + eventName, function(e){target[handlerName](e);}); } else { var originalHandler = target["on" + eventName]; if ( originalHandler ) { target["on" + eventName] = null; } } } function XBrowserAddHandler(target,eventName,handlerName) { if ( target.addEventListener ) { target.addEventListener(eventName, function(e){target[handlerName](e);}, false); } else if ( target.attachEvent ) { target.attachEvent("on" + eventName, function(e){target[handlerName](e);}); } else { var originalHandler = target["on" + eventName]; if ( originalHandler ) { target["on" + eventName] = function(e){originalHandler(e);target[handlerName](e);}; } else { target["on" + eventName] = target[handlerName]; } } } function GenerateClueSlots(divStep3, divStep4, divClues) { var x, y; var bCluePos; var i = 1; AClues = new Array(); DClues = new Array(); sCluePos = ''; sMoves = ''; for (y=1; y <=mDown; y++) { for (x=1; x<=mAcross;x++) { //if it is a white cell if (document.getElementById('T' + x + 'x' + y).style.backgroundColor == 'white') { bCluePos = false; // am i the start of an across clue? //horizontally, if it is the first cell or first cell after a black cell //but not the last cell or last cell before a black cell, then I am if (((x == 1) || (document.getElementById('T' + (x-1) + 'x' + y).style.backgroundColor == 'black')) && (x != mAcross) && (document.getElementById('T' + (x+1) + 'x' + y).style.backgroundColor != 'black')) { AClues.push(i); bCluePos = true; } //try vertically, if I satisfy the same rules if (((y == 1) || (document.getElementById('T' + x + 'x' + (y-1)).style.backgroundColor == 'black')) && (y != mDown) && (document.getElementById('T' + x + 'x' + (y+1)).style.backgroundColor != 'black')) { DClues.push(i); bCluePos = true; } if (bCluePos) { document.getElementById('T' + x + 'x' + y).innerHTML = "
" + i + "
"; sCluePos += i + ','; i++; } else { document.getElementById('T' + x + 'x' + y).innerHTML = "
"; sCluePos += '0,'; } document.getElementById('T' + x + 'x' + y).innerHTML += '
"; sMoves += '@'; } else { sCluePos += '0,'; sMoves += '#'; } } } if (sCluePos.length > 0) sCluePos = sCluePos.substring(0,sCluePos.length-1); var oClues; var oSource; //divClues = document.getElementById("cellclues"); divClues.innerHTML = 'குறுக்காக:
'; for (x=0;x
'; } divClues.innerHTML += 'நெடுக்காக:
'; for (y=0;y
'; } //Done generating clues. Display the Step3 instructions divStep3.style.display = "block"; divStep4.style.display = "block"; sGridMode = "Fill"; } //HTML Generation Stuff function GenerateHTML() { var sHTML = ''; oSource = document.getElementById("Source"); oSource.style.display = "block"; sHTML += '\n'; sHTML += '\n'; sHTML += '\n'; sHTML += ' ' + document.getElementById('puzzleid').value + '\n'; sHTML += ' \n'; sHTML += ' '; sHTML += ' \n'; sHTML += ' \n'; sHTML += ' \n'; sHTML += ' \n'; sHTML += ' \n'; sHTML += '\n'; sHTML += '\n'; sHTML += '
\n'; sHTML += '

This is a web based solver for Tamil crosswords that lets you directly type Tamil characters using an English keyboard. For example, for "புதிர்", type "puthir". You click on a cell to highlight the word. If a cell is part of both across and down clues, when you click again, it toggles the highlighting. Play with it and send your feedback to puthir<dot>mayam<at>gmail<dot>com.

\n'; sHTML += '\n'; sHTML += ' \n'; sHTML += '\n'; sHTML += '
\n'; sHTML += '\n'; sHTML += '
\n'; sHTML += '
\n'; sHTML += '
\n'; sHTML += '
குறுக்காக:
\n'; for (x=0;x' + AClues[x] + '.' + document.getElementById('AClueText' + AClues[x]).value + '
\n'; } sHTML += '
நெடுக்காக:
\n'; for (y=0;y' + DClues[y] + '.' + document.getElementById('DClueText' + DClues[y]).value + '
\n'; } sHTML += '
\n'; if (!mNumericMode) { sHTML += '\n'; sHTML += GenerateTranslitSchemeHTML(); sHTML += ' '; } sHTML += '\n'; sHTML += GenerateJavascriptHTML(mAcross, mDown, sCluePos, sMoves, 'tblCrossWord2', 'lblContent1',document.getElementById('author').value,Math.uuid(10,16), document.getElementById('sToEmail').value,document.getElementById('sCCEmail').value); sHTML += GeneratePopUpDivs(); sHTML += ''; oSource.innerHTML = sHTML; } function GeneratePopUpDivs() { var sHTML = ''; sHTML += '
'; sHTML += '
'; sHTML += '
'; sHTML += '
'; sHTML += '
'; sHTML += '
'; sHTML += '
'; sHTML += '
'; sHTML += '
'; sHTML += '
நகல் அனுப்புக
'; sHTML += '
'; sHTML += '
'; sHTML += '
'; sHTML += '
<textarea rows="8" cols="40" id="PMcomments" value=""></textarea>
'; sHTML += '
'; sHTML += '
'; sHTML += '
'; sHTML += '
'; sHTML += '
'; sHTML += '
'; return sHTML; } function GenerateJavascriptHTML(mAcross, mDown, sCluePos, sMoves, sTblCrossWord, sDivClues, sAuthor, cwID, sToEmail, sCCEmail) { var sHTML = ''; sHTML += '\n'; return sHTML; } function GenerateTranslitSchemeHTML() { var sHTML = ''; sHTML += '
'; sHTML += ' Transliteration scheme:'; sHTML += ''; sHTML += ''; sHTML += ''; sHTML += ''; sHTML += ''; sHTML += ''; sHTML += ''; sHTML += ''; sHTML += '
உயிர்a : அ|'; sHTML += 'aa, A : ஆ|'; sHTML += 'i : இ|'; sHTML += 'ee,I : ஈ|'; sHTML += 'u : உ|'; sHTML += 'oo,U : ஊ|'; sHTML += 'e : எ|'; sHTML += 'ae, E : ஏ|'; sHTML += 'ai : ஐ|'; sHTML += 'o : ஒ|'; sHTML += 'oa,O : ஓ|'; sHTML += 'au : ஔ|
மெய்'; sHTML += 'k,kh,g : க்|'; sHTML += 'ng,nG : ங்|'; sHTML += 'c,ch,s : ச்|'; sHTML += 'nj,nY : ஞ்|'; sHTML += 'd,t : ட்|'; sHTML += 'N : ண்|'; sHTML += 'dh,th : த்|'; sHTML += 'n-,nt : ந்|'; sHTML += 'b,bh,p : ப்|'; sHTML += 'm : ம்|'; sHTML += 'y : ய்|'; sHTML += 'r : ர்|'; sHTML += 'l : ல்|'; sHTML += 'v,w : வ்|'; sHTML += 'z,zh : ழ்|'; sHTML += 'L : ள்|'; sHTML += 'R : ற்|'; sHTML += 'n : ன்|'; sHTML += 'j : ஜ்|'; sHTML += 'sh : ஷ்|'; sHTML += 'S : ஸ்|'; sHTML += 'h : ஹ்|'; sHTML += '
உயிர்மெய் (மாதிரி)'; sHTML += 'ka : க|'; sHTML += 'kaa,kA : கா|'; sHTML += 'ki : கி|'; sHTML += 'kee, kI : கீ|'; sHTML += 'ku : கு|'; sHTML += 'koo,kU : கூ|'; sHTML += 'ke : கெ|'; sHTML += 'kae,kE : கே|'; sHTML += 'kai : கை|'; sHTML += 'ko : கொ|'; sHTML += 'koa,kO : கோ|'; sHTML += 'kau : கௌ|'; sHTML += 'k: க்|'; sHTML += '
ஆய்தம்H : ஃ
'; return sHTML; } //Fill Mode support function MouseMoveXY(oCell) { iCurrX =parseInt(oCell.id.split('x')[0].substring(1)); iCurrY = parseInt(oCell.id.split('x')[1]); iCurrAxis=iCurrAxis*-1; highlightBar(true); oCell.style.backgroundColor=sHLSqCol; } function KeyCodeGet(e) { var keycode; if (e) keycode=e.which; else keycode=window.event.charCode ||window.event.keyCode; return keycode; } function IsKeyOK(keycode) { if (mNumericMode) { if (keycode>= 48 && keycode <= 57) return true; else return false; } else { if ((keycode>= 65 && keycode <= 90) || keycode == 189) return true; else return false; } } function IsShiftKey(e) { var bShift; if (e) bShift = e.shiftKey; else bShift = window.event.shiftKey; return bShift; } function KeyboardPressedOnInput(e) { var keycode; var sUniTamilChars; keycode=KeyCodeGet(e); if (keycode == 32 || keycode == 9) { mCurrInput.value = print_many_words(mCurrInput.value,false); } return true; } function KeyboardPress(e) { var sChar; var keycode; var sRomTamilChars; var sUniTamilChars; var sDisplayChars; var bShdAdvance; keycode=KeyCodeGet(e); if (keycode==8 || (keycode>36 && keycode<41 data-blogger-escaped-189="" data-blogger-escaped-2="" data-blogger-escaped-3="" data-blogger-escaped-4="" data-blogger-escaped-a="" data-blogger-escaped-about="" data-blogger-escaped-ap="" data-blogger-escaped-arrowkeypressed="" data-blogger-escaped-at="" data-blogger-escaped-badvance="false;" data-blogger-escaped-bshdadvance="" data-blogger-escaped-care="" data-blogger-escaped-char="" data-blogger-escaped-chars="" data-blogger-escaped-decide="" data-blogger-escaped-do="" data-blogger-escaped-e="" data-blogger-escaped-else="" data-blogger-escaped-entire="" data-blogger-escaped-ex.="" data-blogger-escaped-false="" data-blogger-escaped-for="" data-blogger-escaped-function="" data-blogger-escaped-hack="" data-blogger-escaped-icurrx="=undefined)" data-blogger-escaped-if="" data-blogger-escaped-is="" data-blogger-escaped-it="" data-blogger-escaped-key="" data-blogger-escaped-keycode="=" data-blogger-escaped-last="" data-blogger-escaped-mnumericmode="" data-blogger-escaped-modifier="" data-blogger-escaped-modifiers="" data-blogger-escaped-need="" data-blogger-escaped-not="" data-blogger-escaped-null="" data-blogger-escaped-of="" data-blogger-escaped-or="" data-blogger-escaped-pio="" data-blogger-escaped-placechars="" data-blogger-escaped-real="" data-blogger-escaped-return="" data-blogger-escaped-schar="" data-blogger-escaped-sdisplaychars="" data-blogger-escaped-second="" data-blogger-escaped-shouldadvancetonextcell="" data-blogger-escaped-skeyok="" data-blogger-escaped-sromtamilchars="GetEntireString(sChar);" data-blogger-escaped-sshiftkey="" data-blogger-escaped-string="" data-blogger-escaped-sunitamilchars.length="" data-blogger-escaped-sunitamilchars.substring="" data-blogger-escaped-sunitamilchars="" data-blogger-escaped-the="" data-blogger-escaped-then="" data-blogger-escaped-time="" data-blogger-escaped-to="" data-blogger-escaped-transliteration="" data-blogger-escaped-true="" data-blogger-escaped-unicodetamilchars="" data-blogger-escaped-updatecurrentunichars="" data-blogger-escaped-var="" data-blogger-escaped-we="" data-blogger-escaped-what="" data-blogger-escaped-whether="" data-blogger-escaped-word=""> 2) { bAdvance = true; } return bAdvance; } function IsCurrentCellTheLastCell() { var bLast = false; if (iCurrAxis == 1) //horizontal { // if I am the last cell in a row or the last cell before a black cell if ((iCurrX == mAcross) || (cwGrid[iCurrY][iCurrX+1][1][1] == '#')) { bLast = true; } } else { // if I am the last cell in a column or the last cell before a black cell if ((iCurrY == mDown) || (cwGrid[iCurrY+1][iCurrX][1][1] == '#')) { bLast = true; } } return bLast; } function IsCurrentCellTheFirstCell() { var bFirst = false; if (iCurrAxis == 1) //horizontal { // if I am the last cell in a row or the last cell before a black cell if ((iCurrX == 1) || (cwGrid[iCurrY][iCurrX-1][1][1] == '#')) { bFirst = true; } } else { // if I am the last cell in a column or the last cell before a black cell if ((iCurrY == 1) || (cwGrid[iCurrY-1][iCurrX][1][1] == '#')) { bFirst = true; } } return bFirst; } function PlaceChars(sChar,sDisplayChars, bShdAdvance) { if (bShdAdvance) { //if we know that we are a new letter and not a modifier/replacement to a previous letter, irrespective of // number of unicode chars, set it on the current cell. AdvanceToNext(); } document.getElementById('M' + iCurrX + 'x' + iCurrY).innerHTML=sDisplayChars; //store the current input char if ((cwGrid[iCurrY][iCurrX][1][1] == '@') || (IsCurrentCellTheLastCell() && bShdAdvance)) { while (cwGrid[iCurrY][iCurrX][1].length > 1) { cwGrid[iCurrY][iCurrX][1].pop(); } cwGrid[iCurrY][iCurrX][1][1] = sChar; } else //if (IsCurrentCellTheLastCell()) { cwGrid[iCurrY][iCurrX][1].push(sChar); } } function AdvanceToNext() { document.getElementById('T' + iCurrX + 'x' + iCurrY).style.backgroundColor=sHLBarCol; if (iCurrAxis==1) { if (iCurrX 1) { cwGrid[iCurrY][iCurrX][1].pop(); } cwGrid[iCurrY][iCurrX][1][1]= '@'; if (iCurrAxis==1) { if (iCurrX>1) { if (cwGrid[iCurrY][iCurrX-1][1][1] !='#') iCurrX--; } } else { if (iCurrY>1) { if (cwGrid[iCurrY-1][iCurrX][1][1] !='#') iCurrY--; } } break; case 37: i=1; while (iCurrX-i>0) { if (cwGrid[iCurrY][iCurrX-i][1][1] !='#') break; i++; } if (iCurrX-i>0) iCurrX=iCurrX-i; iCurrAxis=1; highlightBar(true); break; case 38: i=1; while (iCurrY-i>0) { if (cwGrid[iCurrY-i][iCurrX][1][1] !='#') break; i++; } if (iCurrY-i>0) iCurrY=iCurrY-i; iCurrAxis=-1; highlightBar(true); break; case 39: i=1; while (iCurrX+i1) { if (cwGrid[iCurrY][iCurrX-1][1][1] !='#') AxisOk=true;} if (iCurrX1) { if (cwGrid[iCurrY-1][iCurrX][1][1] !='#') AxisOk=true;} if (iCurrY=mDown+1) break; } } else { while (cwGrid[iCurrY-i][iCurrX][1][1] !='#') { sID ='T' + iCurrX + 'x' + (iCurrY-i); document.getElementById(sID).style.backgroundColor=sHLBarCol; i++; if (iCurrY-i<=0) break; } //ScrollClues('frDown',cwGrid[iCurrY-i+1][iCurrX][2]); //HighlightClue('D',cwGrid[iCurrY-i+1][iCurrX][2]); i=0; while (cwGrid[iCurrY+i][iCurrX][1][1] !='#') { sID ='T' + iCurrX + 'x' + (iCurrY+i); document.getElementById(sID).style.backgroundColor=sHLBarCol; i++; if (iCurrY+i>=mDown+1) break; } } return true; } function SetInput(inputText,sLang) { mCurrInput = inputText; if (sLang == undefined) { document.onkeydown = KeyboardPressedOnInput; } else { document.onkeydown = null; } } function getCookieVal (offset) { var endstr = document.cookie.indexOf (";", offset); if (endstr == -1) endstr = document.cookie.length; return unescape(document.cookie.substring(offset, endstr)); } function GetCookie (name,DefaultVal) { var arg = name + "="; var alen = arg.length; var clen = document.cookie.length; var i = 0; while (i < clen) { var j = i + alen; if (document.cookie.substring(i, j) == arg) return getCookieVal (j); i = document.cookie.indexOf(" ", i) + 1; if (i == 0) break; } return DefaultVal; } function SetCookie (name, value) { var argv = SetCookie.arguments; var argc = SetCookie.arguments.length; var expires = (argc > 2) ? argv[2] : null; var path = (argc > 3) ? argv[3] : null; var domain = (argc > 4) ? argv[4] : null; var secure = (argc > 5) ? argv[5] : false; document.cookie = name + "=" + escape (value) + ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + ((path == null) ? "" : ("; path=" + path)) + ((domain == null) ? "" : ("; domain=" + domain)) + ((secure == true) ? "; secure" : ""); } function LoadGame() { var sMoves; var x; var y; var z; var iPos; var sChars; sMoves= GetCookie("Moves_" + cwID,""); if (sMoves=="") { alert("There are no saved answers for this crossword puzzle (clearing cookies will erase saved answers)."); return true; } iPos=0; for (y=1; y <=mDown; y++) { for (x=1; x<=mAcross;x++) { if (cwGrid[y][x][1][1]!='#') { document.getElementById('M' + x + 'x' + y).innerHTML=sMoves.split('|')[iPos].split('~')[0]; sChars = sMoves.split('|')[iPos].split('~')[1]; if (sChars != '@') { cwGrid[y][x][1].pop(); for(z=0;z

Comments

Popular posts from this blog

778 maantthidal

776 kadalil

807 poo maNakkum