function getWidth()
{
	var w = 0;
	
	if( document.documentElement && document.documentElement.clientWidth ) {
		w = document.documentElement.clientWidth;
	}
	else if( document.body && document.body.clientWidth ) {
		w = document.body.clientWidth;
	}
	else if( window.innerWidth ) {
		w = window.innerWidth - 18;
	}
	
	return w;
}

function getHeight()
{
	var h = 0;
	
	if( document.documentElement && document.documentElement.clientHeight ) {
		h = document.documentElement.clientHeight;
	}
	else if( document.body && document.body.clientHeight ) {
		h = document.body.clientHeight;
	}
	else if( window.innerHeight ) {
		h = window.innerHeight - 18;
	}
	
	return h;
}

function doResize()
{
	var w = getWidth();
	var h = getHeight();
	var o = Math.ceil((w - 960) / 2);
	
	$("#logo").width(Math.max(o + 340, 340)).height(h);
	$("#ribon").width(Math.max(o + 100, 100)).css("left", Math.max(o, 0) * -1).height(h / 2);
}

$(window).resize(doResize);
$(document).ready(doResize);
