
//resizeBackground
var img = document.getElementById('imgBg');
window.onresize = function()	{adjustRatio(img);}
//document.onload = function(){	adjustRatio(img);}
var imageratio = img.height / img.width;

function adjustRatio(img)
{
var winheight = (document.body.clientHeight === undefined)?window.innerHeight:document.body.clientHeight;
var winwidth = (document.body.clientWidth === undefined)?window.innerWidth:document.body.clientWidth;
winratio = winheight / winwidth;

if(winratio < imageratio)
{
img.style.height = '100%';
img.style.width = 'auto';
}
else
{
img.style.width = '100%';
img.style.height = 'auto';
}
}
setTimeout("adjustRatio(img)",1);
