$(document).ready(function()
{
	var horizontal = 'center';
	
	if (bgAdHorizontal == 'right')
	{
		var horizontal = Math.ceil($(window).width() / 2) + Math.ceil(769 / 2) + 4 + 'px';
	}
	else if (bgAdHorizontal == 'left')
	{
		var horizontal = Math.ceil($(window).width() / 2) - Math.ceil(769 / 2) - bgAdWidth + 'px';
	}
	
	var html = '<div id="bgAd" style="background: url(' + bgAdImageUrl + ') no-repeat ' + horizontal + ' bottom;">&nbsp;</div>';
	$("body").append(html);
	
	$("body").mousemove(function (event)
	{
		if ($(event.target).is("body"))
		{
			$("body").css('cursor', 'pointer');
		}
		else
		{
			$("body").css('cursor', 'auto');
		}
	});
	
	$("body").click(function (event)
	{
		if ($(event.target).is("body"))
		{
			window.open(bgAdClickUrl);
		}
	});
});