var _basefont = 16; 
var _ratio = 15 / 10.5; 
var _defaultwidth = 800; 
var _defaultwidthGame = 800; 
var _basefontBigger = 32; 



$(document).ready(function() {
						   
    function changeWindowSizeEvent() {
		var width, height;
		height = $('body').height();
		width = height * _ratio;

		if (width > $('body').width()) {
			width = $('body').width();
			height = width / _ratio;
		}

		$('#smallContainer').width(width);
		$('#smallContainer').height(height);
		
		$('body').css('font-size', _basefont * width / _defaultwidth + 'px');
		$('#game').css('font-size', _basefont * width / _defaultwidthGame + 'px');
		$('#startPage .title').css('font-size', _basefontBigger * width / _defaultwidth + 'px');

    }
	
    $(window).resize(changeWindowSizeEvent);	
    changeWindowSizeEvent();
});