
var picn=0;
var bo="boxxx.gif";
var ch="chboxxx.gif";
var ds = new Array();
pict=new Image(12,12);
box=new Image();
//box.src=bo;
var last=30;
var expDays = 90;
var exp = new Date(); 
exp.setTime(exp.getTime() + (expDays*24*60*60*1000));
// define an array ***********************************88888
var ks = new Array();
ks[0]=1;
for (i=1;i<last;i++){
ks[i]=2*ks[i-1]
}
// initialization of boxes **********************************
function zorch(){
var dcode = GetCookie("donhit");
if(isNaN(dcode))dcode=0;
var dada=dcode-0;
if(typeof dada !="number") dada=0;
for (i=0;i<last;i++){
ds[i]=dada%2;
dada=(dada-ds[i])/2;
}
}
// tell box what state it is in ********************************
function show(ims){
var bung=zorch();
if(ds[ims] == '0'){
pict=bo}
else {
pict=ch
}
//document.images["box"].src=pict;
//alert("pict"+pict);
return pict;
}
// reset a clicked box ****************************************
function reset(ims){
var gnu;
if(ds[ims] =='0'){gnu=ch;ds[ims]='1'} else {gnu=bo;ds[ims]='0'} ;
var dcode = GetCookie("donhit");
if(isNaN(dcode))dcode=0;
var bing=dcode-0;
if(typeof bing !="number") bing=0;
bing=bing+(2*ds[ims]-1)*ks[ims];
dcode=bing;
SetCookie ('donhit', dcode, exp);
document.images["box"].src=gnu;
//alert('gnu'+gnu);
}
// *****************************************
// short cut to setting cookie *********************************
function set(ds){
SetCookie ('donhit', ds, exp);
}
// retrieve cookie value ****************************************
function getCookieVal (offset) {  
var endstr = document.cookie.indexOf (";", offset);  
if (endstr == -1)    
endstr = document.cookie.length;  
var bug = unescape(document.cookie.substring(offset, endstr));
return bug;
}
// get cookie value *********************************************
function GetCookie (name) {  
var arg = name + "=";  
var alen = arg.length;  
var clen = document.cookie.length;  
for (i=0;i < clen;i++) {
var j = i + alen;
if(j>clen)break;
if (document.cookie.substring(i, j) == arg)      
{
var bag= getCookieVal (j);
return bag;    
}
}  
return null;
}
// Set Cookie value **********************************************
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" : "");
}
// delete cookie *************************************************
function DeleteCookie (name) {  
var exp = new Date();  
exp.setTime (exp.getTime() - 1);  
// This cookie is history  
var cval = GetCookie (name);  
document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
}





function hello(fname)
{
	zork = "str"+ parent.location;
if(zork.indexOf("frame") != -1)
{
	parent.guide.location = fname;
}
if(zork.indexOf("htm") == -1)
{
parent.guide.location = fname;
}
}
var pic=1;
function hella(fname,picn)
{
pic=0+picn;
	zork = "str"+ parent.location;
if(zork.indexOf("frame") != -1)
{
	parent.guide.location = fname;
setTimeout('parent.guide.document.images[pic].src="here.gif"',100);
}
if(zork.indexOf("htm") == -1)
{
parent.guide.location = fname;
setTimeout('parent.guide.document.images[pic].src="here.gif"',100);
}
}
