/**************************************************************************/
/* Waheguru Satnam                                                        */
/* Developed by Hardeep Singh		                                  */
/* Copyright: Hardeep Singh, 2000.					  */
/* EMail    : seeingwithc@hotmail.com					  */
/* Website  : seeingwithc.org                    			  */
/* All rights reserved.							  */
/* The code may not be used without permission.         		  */
/* This code / game MAY NOT be put on websites/ cds without permission    */
/* The ideas expressed in the game MAY NOT be used.                       */
/* The code does not come with any warranties, explicit or implied.	  */
/* The code cannot be distributed without this header.			  */
/**************************************************************************/


var noClicked=new Array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
var noFinal  =new Array(0,1,1,0,1,0,1,1,1,0,0,0,1,1,1,1,1,0,1,1,1,1,0,0,0);
var coFinal  =new Array(0,1,1,0,1,0,1,1,1,0,0,0,1,1,1,1,1,0,1,1,1,1,0,0,0);
var globeI=0,globeJ=0;
var Timer=null;
var compDone=false;
function doSolve()
{
	compDone=true;
	globeI=0; globeJ=0;
	alert("You are going to see the solver bot in action :-)");
	Timer=setTimeout("doTimer()",100);
}
function doTimer()
{
	var i=globeI,j=globeJ;
	if (i>=0 && i<=4 && j>=0 && j<=4) {
		if (noFinal[j*5+i]==1) {
			if (noClicked[j*5+i]%2==0) {
				var ci=i+1,cj=j+1;
				var cellRef=eval("self.document.GameForm.B"+ci+cj);
				cellRef.click();
			}
			
		}
		else {
			if (noClicked[j*5+i]%2==1) {
				var ci=i+1,cj=j+1;
				var cellRef=eval("self.document.GameForm.B"+ci+cj);
				cellRef.click();
			}
		}
	}
	globeJ++;
	if (globeJ>=5) {
		globeI++;
		globeJ=0;
	}
	if (globeI>=7)
		clearTimeout(Timer);
	else
		Timer=setTimeout("doTimer()",100);
}

