var canvas = document.getElementById("cvboard");
var g = new Game();

window.addEventListener("load", function() {
	g.Start();
});

document.addEventListener("keydown", function(event) {
    g.keyPress(event); 
});

canvas.addEventListener('click', function(event) {
    g.clickedMouse(event);
});

function generate() : void
{
	g.Start();
}

function closeWindow()
{
	document.getElementById('setup').innerHTML = "";
	document.getElementById('setup').style.display = "none";
	return true;
}

/*var cookie = readCookie('vangamemapsave')
if(cookie)
{
	console.log("hallo daar " +cookie);
	eraseCookie('vangamemapsave');
} else {
	var map = saveMap();
	createCookie('vangamemapsave', map, 1);
}*/