function backgroundScale()
{
	var imageRatio       = 1.75;
/*	var windowHeight     = document.body.clientHeight;*/
	var windowWidth      = document.body.clientWidth;
//	var windowScale      = windowWidth / windowHeight;
	var windowScale      = windowWidth / 60;
	var targetWidth      = 60 * imageRatio;
	var targetWidthFull  = windowWidth;
	var leftPos          = - (targetWidth - windowWidth) / 2;
	var leftPosFull      = 0;

	if (windowScale <= imageRatio)
	{
		jQuery('.background img').attr("width", targetWidth);
		jQuery('.background').css("left", leftPos);
	} 
	else
	{
		jQuery('.background img').attr("width", targetWidthFull);
		jQuery('.background').css("left", leftPosFull);
	}
}

jQuery(window).resize(function()
{
	var imageRatio       = 1.75;
//	var windowHeight     = document.body.clientHeight;
	var windowWidth      = document.body.clientWidth;
//	var windowScale      = windowWidth / windowHeight;
	var windowScale      = windowWidth / 60;
	var targetWidth      = 60 * imageRatio;
	var targetWidthFull  = windowWidth;
	var leftPos          = - (targetWidth - windowWidth) / 2;
	var leftPosFull      = 0;

	if (windowScale <= imageRatio)
	{
		jQuery('.background img').attr("width", targetWidth);
		jQuery('.background').css("left", leftPos);
	} 
	else 
	{
		jQuery('.background img').attr("width", targetWidthFull);
		jQuery('.background').css("left", leftPosFull);
	}
	
	mainBaseResize();
});


function mainBaseResize()
{
	if((jQuery('body').height() >= 800) && (jQuery('#mainBase').height() <= 500)){
		jQuery('#mainBase').height(jQuery('body').height() - 445 + "px");
	}
}

   
jQuery(document).ready(function(){
	backgroundScale(); 
	mainBaseResize();
});
