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="#FF7519"; a7.style.backgroundColor="#FF7519"; a8.style.backgroundColor="#FF7519"; a9.style.backgroundColor="#FF7519"; a15.style.backgroundColor="#FF7519"; a21.style.backgroundColor="#FF7519"; a20.style.backgroundColor="#FF7519"; a19.style.backgroundColor="#FF7519"; a25.style.backgroundColor="#FF7519"; a31.style.backgroundColor="#FF7519"; a32.style.backgroundColor="#FF7519"; a33.style.backgroundColor="#FF7519"; a34.style.backgroundColor="#FF7519"; a28.style.backgroundColor="#FF7519"; a29.style.backgroundColor="#FF7519"; a30.style.backgroundColor="#FF7519"; a36.style.backgroundColor="#FF7519"; a42.style.backgroundColor="#FF7519"; a41.style.backgroundColor="#FF7519"},1500);

setTimeout(function(){a1.style.backgroundColor="#52CCCC"; a7.style.backgroundColor="#52CCCC"; a8.style.backgroundColor="#52CCCC"; a9.style.backgroundColor="#52CCCC"; a15.style.backgroundColor="#52CCCC"; a21.style.backgroundColor="#52CCCC"; a20.style.backgroundColor="#52CCCC"; a19.style.backgroundColor="#52CCCC"; a25.style.backgroundColor="#52CCCC"; a31.style.backgroundColor="#52CCCC"; a32.style.backgroundColor="#52CCCC"; a33.style.backgroundColor="#52CCCC"; a34.style.backgroundColor="#52CCCC"; a28.style.backgroundColor="#52CCCC"; a29.style.backgroundColor="#52CCCC"; a30.style.backgroundColor="#52CCCC"; a36.style.backgroundColor="#52CCCC"; a42.style.backgroundColor="#52CCCC"; a41.style.backgroundColor="#52CCCC"},1900);
}

function showpath(num)
{
square = num
correctpath = document.getElementById(num);
if (square == 1)
{
correctpath.style.backgroundImage="url('img/icepath.half.top.png')";
x=7
}
else if (square == x)
{
document.getElementById(1).style.backgroundImage="url('img/icepath.open.png')";
correctpath.style.backgroundImage="url('img/icepath.half.top.png')";
z=8
}
else if (square == z)
{
document.getElementById(7).style.backgroundImage="url('img/icepath.right.png')";
correctpath.style.backgroundImage="url('img/icepath.half.left.png')";
t=9
}
else if (square == t)
{
document.getElementById(8).style.backgroundImage="url('img/icepath.side.png')";
correctpath.style.backgroundImage="url('img/icepath.half.left.png')";
w=15
}
else if (square == w)
{
document.getElementById(9).style.backgroundImage="url('img/icepath.leftdown.png')";
correctpath.style.backgroundImage="url('img/icepath.half.top.png')";
m=21
}
else if (square == m)
{
document.getElementById(15).style.backgroundImage="url('img/icepath.open.png')";
correctpath.style.backgroundImage="url('img/icepath.half.top.png')";
n=20
}
else if (square == n)
{
document.getElementById(21).style.backgroundImage="url('img/icepath.left.png')";
correctpath.style.backgroundImage="url('img/icepath.half.right.png')";
p=19
}
else if (square == p)
{
document.getElementById(20).style.backgroundImage="url('img/icepath.side.png')";
correctpath.style.backgroundImage="url('img/icepath.half.right.png')";
u=25
}
else if (square == u)
{
document.getElementById(19).style.backgroundImage="url('img/icepath.rightdown.png')";
correctpath.style.backgroundImage="url('img/icepath.half.top.png')";
k=31
}
else if (square == k)
{
document.getElementById(25).style.backgroundImage="url('img/icepath.open.png')";
correctpath.style.backgroundImage="url('img/icepath.half.top.png')";
b=32
}
else if (square == b)
{
document.getElementById(31).style.backgroundImage="url('img/icepath.right.png')";
correctpath.style.backgroundImage="url('img/icepath.half.left.png')";
y=33
}
else if (square == y)
{
document.getElementById(32).style.backgroundImage="url('img/icepath.side.png')";
correctpath.style.backgroundImage="url('img/icepath.half.left.png')";
o=34
}
else if (square == o)
{
document.getElementById(33).style.backgroundImage="url('img/icepath.side.png')";
correctpath.style.backgroundImage="url('img/icepath.half.left.png')";
d=28
}
else if (square == d)
{
document.getElementById(34).style.backgroundImage="url('img/icepath.left.png')";
correctpath.style.backgroundImage="url('img/icepath.half.bottom.png')";
j=29
}
else if (square == j)
{
document.getElementById(28).style.backgroundImage="url('img/icepath.rightdown.png')";
correctpath.style.backgroundImage="url('img/icepath.half.left.png')";
q=30
}
else if (square == q)
{
document.getElementById(29).style.backgroundImage="url('img/icepath.side.png')";
correctpath.style.backgroundImage="url('img/icepath.half.left.png')";
f=36
}
else if (square == f)
{
document.getElementById(30).style.backgroundImage="url('img/icepath.leftdown.png')";
correctpath.style.backgroundImage="url('img/icepath.half.top.png')";
r=42
}
else if (square == r)
{
document.getElementById(36).style.backgroundImage="url('img/icepath.open.png')";
correctpath.style.backgroundImage="url('img/icepath.half.top.png')";
v=41
}
else if (square == v)
{
document.getElementById(42).style.backgroundImage="url('img/icepath.open.png')";
correctpath.style.backgroundImage="url('img/icepath.half.right.png')";
window.location.assign("level.complete19.html")
}
else
{
correctpath.style.backgroundColor="#A00000"
window.location.assign("level.failed.html");
}
}

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