function randomFromTo(from,to)
{
	return Math.floor(Math.random() * (to - from + 1) + from);
}



function flashPutHref(href)
{
	location.href = href;
}

function showBg()
{
	var bg = document.getElementById('bg');
	
	if ( bg )
	{
		bg.className = 'bg';
	}
}

function resizeBg()
{
	var bg = document.getElementById('bg');
	
	if ( bg )
	{
		var imgW = bgImgW;
		var imgH = bgImgH;
				
		var winW = $(window).width();
		var winH = $(window).height();
		
		widthRatio = imgW / winW;
		heightRatio = imgH / winH;
		
		if ( widthRatio > heightRatio )
		{
			bg.style.width = 'auto';
			bg.style.height = '100%';
		}
		else
		{
			bg.style.width = '100%';
			bg.style.height = 'auto';
		}
	}
}



$(document).ready(function()
{
	var bg = document.getElementById('bg');
	
	if ( bg )
	{
		resizeBg();
		
		showBg();
		
		setInterval("resizeBg()",3000);
	}
});
