var a1 = document.getElementById(1);
var a2 = document.getElementById(2);
var a3 = document.getElementById(3);
var a4 = document.getElementById(4);
var a5 = document.getElementById(5);
var a6 = document.getElementById(6);
var a7 = document.getElementById(7);
var a8 = document.getElementById(8);
var a9 = document.getElementById(9);

var a10 = document.getElementById(10);
var a11 = document.getElementById(11);
var a12 = document.getElementById(12);
var a13 = document.getElementById(13);
var a14 = document.getElementById(14);
var a15 = document.getElementById(15);
var a16 = document.getElementById(16);
var a17 = document.getElementById(17);
var a18 = document.getElementById(18);
var a19 = document.getElementById(19);
var a20 = document.getElementById(20);

var a21 = document.getElementById(21);
var a22 = document.getElementById(22);
var a23 = document.getElementById(23);
var a24 = document.getElementById(24);
var a25 = document.getElementById(25);
var a26 = document.getElementById(26);
var a27 = document.getElementById(27);
var a28 = document.getElementById(28);
var a29 = document.getElementById(29);

var a30 = document.getElementById(30);
var a31 = document.getElementById(31);
var a32 = document.getElementById(32);
var a33 = document.getElementById(33);
var a34 = document.getElementById(34);
var a35 = document.getElementById(35);
var a36 = document.getElementById(36);
var a37 = document.getElementById(37);
var a38 = document.getElementById(38);
var a39 = document.getElementById(39);
var a40 = document.getElementById(40);
var a41 = document.getElementById(41);
var a42 = document.getElementById(42);

function flashpath()
{
setTimeout(function(){a1.style.backgroundColor="#FFFFFF"; a7.style.backgroundColor="#FFFFFF"; a8.style.backgroundColor="#FFFFFF"; a9.style.backgroundColor="#FFFFFF"; a15.style.backgroundColor="#FFFFFF"; a16.style.backgroundColor="#FFFFFF"; a17.style.backgroundColor="#FFFFFF"; a23.style.backgroundColor="#FFFFFF"; a29.style.backgroundColor="#FFFFFF"; a28.style.backgroundColor="#FFFFFF"; a27.style.backgroundColor="#FFFFFF"; a33.style.backgroundColor="#FFFFFF"; a32.style.backgroundColor="#FFFFFF"; a31.style.backgroundColor="#FFFFFF"; a37.style.backgroundColor="#FFFFFF"},1500);

setTimeout(function(){a1.style.backgroundColor="#FF0000"; a7.style.backgroundColor="#FF6A00"; a8.style.backgroundColor="#FF0000"; a9.style.backgroundColor="#FF6A00"; a15.style.backgroundColor="#FF0000"; a16.style.backgroundColor="#FF6A00"; a17.style.backgroundColor="#FFE200"; a23.style.backgroundColor="#FF6A00"; a29.style.backgroundColor="#FF0000"; a28.style.backgroundColor="#FF6A00"; a27.style.backgroundColor="#FFE200"; a33.style.backgroundColor="#2DB000"; a32.style.backgroundColor="#0000FF"; a31.style.backgroundColor="#57007F"; a37.style.backgroundColor="#A70792"},1900);
}

function showpath(num)
{
square = num
correctpath = document.getElementById(num);
if (square == 1)
{
correctpath.style.backgroundImage="url('img/rainbow.open.png')";
x=7
}
else if (square == x)
{
correctpath.style.backgroundImage="url('img/rainbow.open.png')";
z=8
}
else if (square == z)
{
correctpath.style.backgroundImage="url('img/rainbow.open.png')";
t=9
}
else if (square == t)
{
correctpath.style.backgroundImage="url('img/rainbow.open.png')";
w=15
}
else if (square == w)
{
correctpath.style.backgroundImage="url('img/rainbow.open.png')";
m=16
}
else if (square == m)
{
correctpath.style.backgroundImage="url('img/rainbow.open.png')";
n=17
}
else if (square == n)
{
correctpath.style.backgroundImage="url('img/rainbow.open.png')";
p=23
}
else if (square == p)
{
correctpath.style.backgroundImage="url('img/rainbow.open.png')";
u=29
}
else if (square == u)
{
correctpath.style.backgroundImage="url('img/rainbow.open.png')";
k=28
}
else if (square == k)
{
correctpath.style.backgroundImage="url('img/rainbow.open.png')";
b=27
}
else if (square == b)
{
correctpath.style.backgroundImage="url('img/rainbow.open.png')";
y=33
}
else if (square == y)
{
correctpath.style.backgroundImage="url('img/rainbow.open.png')";
o=32
}
else if (square == o)
{
correctpath.style.backgroundImage="url('img/rainbow.open.png')";
d=31
}
else if (square == d)
{
correctpath.style.backgroundImage="url('img/rainbow.open.png')";
j=37
}
else if (square == j)
{
correctpath.style.backgroundImage="url('img/rainbow.open.png')";
window.location.assign("level.complete22.html")
}
else
{
correctpath.style.backgroundColor="#A00000"
window.location.assign("level.failed.html");
}
}

function gameover()
{
correctpath.style.backgroundColor="#A00000"
window.location.assign("level.failed.html");
}
