function doBenchtest()
{
	var cookieInfo = readCookie("useAnimation");
	
	if(cookieInfo != null && cookieInfo != "undefined")
	{
		if(cookieInfo == "1"){useAnimation = true;$('#lbl_animations').html("Animations: On");}
		if(cookieInfo == "0"){useAnimation = false;$('#lbl_animations').html("Animations: Off");}
	}else{
		t0 = new Date()
		var s = mb100();
		t1 = new Date()
		t = t1.getTime() - t0.getTime()
		if(t > 300)
		{
			useAnimation = false;
			$('#lbl_animations').html("Animations: Off");
			createCookie("useAnimation", "0", 365);
		}else{
			createCookie("useAnimation", "1", 365);
		}
	}
}

function mb100() {
	var dots = 0;
	var res = 100;
	var a1 = -2.50;
	var b1 = -1.75;
	var s  =  3.50;   /* side */
	var x = 0;
	var y = 0;
	var g  = s/res;   /* gap  */
	var i,j,a,b,k;
	
	for (j=0,b=b1; j<res; b+=g,j++) {
		for (i=0,a=a1; i<res; a+=g,i++) {
			k = qset(x,y,a,b);
			if (k > 90) dots++;
		}
	}
	return(dots);
}

  function qset(xx, yy, u, v) {
	  var n 
	  var t, xsqr, ysqr
	  var lim = 100
	  var x = xx
	  var y = yy
 
	  xsqr = x*x
	  ysqr = y*y
	  for (n=0; (n < lim) && (xsqr+ysqr < 4.0); n++) { 
	    t = xsqr - ysqr + u
	    y = 2.0*x*y + v
	    x = t
	    xsqr = t*t
	    ysqr = y*y
	  }
	  return(n)
  }
  
  
function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name) {
	createCookie(name,"",-1);
}
