answer1 = "maybethistime";
q = new Array();

q['q1'] = 'e0dc75f3328ba7dbe85f870f0c1fd4b7aeccbc37';
q['q2'] = '349597e3f15172ad1f31c5bdbaa2b51057b405a6';
q['q3'] = '776d372d7b7c10d8f4d36206852fc27984d48604';
q['q4'] = '2a368d4db909e2699f222df657539ec9fcb54004';
q['q5'] = 'c29b816c12afce404e46f3d09efd8945a9bed4b0';
q['q6'] = 'ca7e8cb9925b8bb62a08a42515eb551bda621d43';
q['q7'] = '5cbdafae806130f97b957d8cbf615f1944d452f1';
q['q8'] = 'a892b1c4a91b2faa8bf40782fbee01bce88fdc19';
q['q9'] = '5ab05379f7d5a4533733d7b2dde5ef7d56d10d49';
q['q10'] = '7992c7aabf450dda15370c64c8b0b79ce7baafcb';
q['q11'] = '24f09f9e7226ea2a928da3484025965eabb50050';
q['q12'] = '8b9e9a934648758536d3106a56c6ff4ee350231c';
q['q13'] = '01c15c7a0bf3f3543c0e914a77c4f1a0b4a8fd68';
q['q14'] = 'bc27f5e995f5ec4c3e1d766743ffed3d0154ad74';
q['q15'] = 'c7301eadafddf965df137962e101586da33d1a72';
q['q16'] = 'ca0a78fc3967ecf44d1d5e48ab1c457148bd6f7e';
q['q17'] = '776edd7d0df72781062e0adb056bbff4b26da087';
q['q18'] = '8ee76034e3d6f80c0fc3fde87472dbb1301d2108';
q['q19'] = '37eda08b304943e106a551f0e4479af01445fa3f';
q['q20'] = '0d6605e79561404a123e4b600173f2a293f1eea9';
q['q21'] = 'c62de55fa14a99b6113bfd1f88345658364fe5af';
q['q22'] = '40cddc7770def0881f8b8bfcc083153b38604a47';
q['q23'] = 'fa730023b3e32cd3e01af1d4ca6be6c3545c9a58';
q['q24'] = 'cd356c4de194eebefafeaa8929aa9fd60fd1f017';
q['q25'] = '92f62397d2b11b23399e41a2d8f131d6f9148be5';
q['q26'] = 'd6c992747bff14472906f7048172fad3d692a20b';
q['q27'] = '607c84dab7d22a38c7770cef81c596e3d950f2f6';
q['q28'] = 'fa3c723014df55fcd9321ba0300734b4c325ef1d';
q['q29'] = '41a495b1a510f7d6b64b09c647042a7af0b105f3';
q['q30'] = '2c6a6bfd24770d9d886c0946783d79fd9ee8b5f3';
q['q31'] = '5376d2b859efdbbf17d1c2ebf5f24a996d235ead';
q['q32'] = '480cd4eaaadc297160bd7e5da4e7e19b7ebb4388';
q['q33'] = 'dc0c34bd11c882fae18cb95aee724b1294b9ebad';
q['q34'] = '515c442c974b1764f24f32b3fec6baecb34537b2';
q['q35'] = '349002720ff7b0d5b054d3c28c953e38c6d60271';
q['q36'] = '4bc5b0ad352de18c64602575f7ae18c1e7ca4934';
q['q37'] = '269a50a31ae06b3ae762f877a6a435d8b7f7d03b';
q['q38'] = '54033af4afe1df7bcc27c4d9a5f0e99b6ce6e4e7';
q['q39'] = 'd7ce1c890a5432132c1d31597727cad2e5aff477';
q['q40'] = '2984c7396182ad029b6a704e86d4a245ec874d4e';
 

function checkQ(str) {
	if(hex_sha1(document.getElementById(str).value.toUpperCase()) == q[str])
	{
		validate1(str);
	}
	else
	{
		validate2(str);
	}
	
}
function validate1(qstr) {
	if(document.getElementById(qstr).disabled == false) {
	document.getElementById(qstr).disabled = true;
	document.getElementById(qstr).style.border = '2px solid #00FF00'; 
	document.getElementById('correct').innerHTML = document.getElementById('correct').innerHTML*1 + 1;
	document.getElementById('correctB').innerHTML = document.getElementById('correctB').innerHTML*1 + 1;
	}
}

function validate2(qstr) {
	if(document.getElementById(qstr).value=='') {
		document.getElementById(qstr).style.border = '1px solid #A5ACB2'; 
	}
	else
	{
	document.getElementById(qstr).style.border = '2px solid #FF0000'; 
	}
}


/*
 * A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined
 * in FIPS PUB 180-1
 * Version 2.1a Copyright Paul Johnston 2000 - 2002.
 * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
 * Distributed under the BSD License
 * See http://pajhome.org.uk/crypt/md5 for details.
 */

/*
 * Configurable variables. You may need to tweak these to be compatible with
 * the server-side, but the defaults work in most cases.
 */
var hexcase = 0;  /* hex output format. 0 - lowercase; 1 - uppercase        */
var b64pad  = ""; /* base-64 pad character. "=" for strict RFC compliance   */
var chrsz   = 8;  /* bits per input character. 8 - ASCII; 16 - Unicode      */

/*
 * These are the functions you'll usually want to call
 * They take string arguments and return either hex or base-64 encoded strings
 */
function hex_sha1(s){return binb2hex(core_sha1(str2binb(s),s.length * chrsz));}
function b64_sha1(s){return binb2b64(core_sha1(str2binb(s),s.length * chrsz));}
function str_sha1(s){return binb2str(core_sha1(str2binb(s),s.length * chrsz));}
function hex_hmac_sha1(key, data){ return binb2hex(core_hmac_sha1(key, data));}
function b64_hmac_sha1(key, data){ return binb2b64(core_hmac_sha1(key, data));}
function str_hmac_sha1(key, data){ return binb2str(core_hmac_sha1(key, data));}

/*
 * Perform a simple self-test to see if the VM is working
 */
function sha1_vm_test()
{
  return hex_sha1("abc") == "a9993e364706816aba3e25717850c26c9cd0d89d";
}

/*
 * Calculate the SHA-1 of an array of big-endian words, and a bit length
 */
function core_sha1(x, len)
{
  /* append padding */
  x[len >> 5] |= 0x80 << (24 - len % 32);
  x[((len + 64 >> 9) << 4) + 15] = len;

  var w = Array(80);
  var a =  1732584193;
  var b = -271733879;
  var c = -1732584194;
  var d =  271733878;
  var e = -1009589776;

  for(var i = 0; i < x.length; i += 16)
  {
    var olda = a;
    var oldb = b;
    var oldc = c;
    var oldd = d;
    var olde = e;

    for(var j = 0; j < 80; j++)
    {
      if(j < 16) w[j] = x[i + j];
      else w[j] = rol(w[j-3] ^ w[j-8] ^ w[j-14] ^ w[j-16], 1);
      var t = safe_add(safe_add(rol(a, 5), sha1_ft(j, b, c, d)),
                       safe_add(safe_add(e, w[j]), sha1_kt(j)));
      e = d;
      d = c;
      c = rol(b, 30);
      b = a;
      a = t;
    }

    a = safe_add(a, olda);
    b = safe_add(b, oldb);
    c = safe_add(c, oldc);
    d = safe_add(d, oldd);
    e = safe_add(e, olde);
  }
  return Array(a, b, c, d, e);

}

/*
 * Perform the appropriate triplet combination function for the current
 * iteration
 */
function sha1_ft(t, b, c, d)
{
  if(t < 20) return (b & c) | ((~b) & d);
  if(t < 40) return b ^ c ^ d;
  if(t < 60) return (b & c) | (b & d) | (c & d);
  return b ^ c ^ d;
}

/*
 * Determine the appropriate additive constant for the current iteration
 */
function sha1_kt(t)
{
  return (t < 20) ?  1518500249 : (t < 40) ?  1859775393 :
         (t < 60) ? -1894007588 : -899497514;
}

/*
 * Calculate the HMAC-SHA1 of a key and some data
 */
function core_hmac_sha1(key, data)
{
  var bkey = str2binb(key);
  if(bkey.length > 16) bkey = core_sha1(bkey, key.length * chrsz);

  var ipad = Array(16), opad = Array(16);
  for(var i = 0; i < 16; i++)
  {
    ipad[i] = bkey[i] ^ 0x36363636;
    opad[i] = bkey[i] ^ 0x5C5C5C5C;
  }

  var hash = core_sha1(ipad.concat(str2binb(data)), 512 + data.length * chrsz);
  return core_sha1(opad.concat(hash), 512 + 160);
}

/*
 * Add integers, wrapping at 2^32. This uses 16-bit operations internally
 * to work around bugs in some JS interpreters.
 */
function safe_add(x, y)
{
  var lsw = (x & 0xFFFF) + (y & 0xFFFF);
  var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
  return (msw << 16) | (lsw & 0xFFFF);
}

/*
 * Bitwise rotate a 32-bit number to the left.
 */
function rol(num, cnt)
{
  return (num << cnt) | (num >>> (32 - cnt));
}

/*
 * Convert an 8-bit or 16-bit string to an array of big-endian words
 * In 8-bit function, characters >255 have their hi-byte silently ignored.
 */
function str2binb(str)
{
  var bin = Array();
  var mask = (1 << chrsz) - 1;
  for(var i = 0; i < str.length * chrsz; i += chrsz)
    bin[i>>5] |= (str.charCodeAt(i / chrsz) & mask) << (32 - chrsz - i%32);
  return bin;
}

/*
 * Convert an array of big-endian words to a string
 */
function binb2str(bin)
{
  var str = "";
  var mask = (1 << chrsz) - 1;
  for(var i = 0; i < bin.length * 32; i += chrsz)
    str += String.fromCharCode((bin[i>>5] >>> (32 - chrsz - i%32)) & mask);
  return str;
}

/*
 * Convert an array of big-endian words to a hex string.
 */
function binb2hex(binarray)
{
  var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef";
  var str = "";
  for(var i = 0; i < binarray.length * 4; i++)
  {
    str += hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8+4)) & 0xF) +
           hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8  )) & 0xF);
  }
  return str;
}

/*
 * Convert an array of big-endian words to a base-64 string
 */
function binb2b64(binarray)
{
  var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
  var str = "";
  for(var i = 0; i < binarray.length * 4; i += 3)
  {
    var triplet = (((binarray[i   >> 2] >> 8 * (3 -  i   %4)) & 0xFF) << 16)
                | (((binarray[i+1 >> 2] >> 8 * (3 - (i+1)%4)) & 0xFF) << 8 )
                |  ((binarray[i+2 >> 2] >> 8 * (3 - (i+2)%4)) & 0xFF);
    for(var j = 0; j < 4; j++)
    {
      if(i * 8 + j * 6 > binarray.length * 32) str += b64pad;
      else str += tab.charAt((triplet >> 6*(3-j)) & 0x3F);
    }
  }
  return str;
}
