

// Transparent Image Support.
var _imagetransparecy = 0;
var _imageLocation = {x: 0, y: 0};

// image manager
var _imagesMngr;

function init()
{
	_canvasElement = document.getElementById(_canvasId);

	if(_canvasElement == null)
	{
		console.log("Can't find canvas! :(");
	}
	else
	{
		_canvasCtx = _canvasElement.getContext("2d");
		_gameStartTime = new Date().getTime();
		_imagesMngr = new images_manager();
		setInterval(function(){timerUpdate();}, 1000);

		setTimeout(function(){transparentImage();}, 100);
	}
}

function timerUpdate()
{
	
}

function transparentImage()
{
	var img = new Image();
	img.onload = function()
	{
		_canvasCtx.save();

		_canvasCtx.globalAlpha = _imagetransparecy;
		_canvasCtx.drawImage(img, _imageLocation.x, _imageLocation.y);

		_canvasCtx.restore();

		factor = -1;
		if(_imagetransparecy <= 0)
		{
			factor = 1;
		}

		_imagetransparecy += (0.1 * factor);
		setTimeout(function(){transparentImage();}, 100);
	};

	img.src = "splat.png";
}

