function resize() {
	if (window.attachEvent) {
		var minWidth = 1000,
			minHeight = 590;
		 
		var width = $(window).width() < minWidth ? minWidth : '100%',
			height = $(window).height() < minHeight ? minHeight : '100%';
	
		$(document.body).width(width);
		$('#content').width(width);
	  
		$(document.body).height(height);
		$('#content').height(height);
	}
}

function conversion() {
	$(document.body).append(
			$('<iframe/>').css({width: 1, height: 1, position: 'absolute', top: 0, left: 0})
				.attr('src', 'conversion.html?' + Math.random()));
	return;
}

function regulament() {
    var regulamentWindow = window.open('/regulament.html','regulament', "height=600,width=500,status=no,toolbar=no,menubar=no,location=no,scrollbars=yes");
	regulamentWindow.moveTo(parseInt(screen.width / 2, 10) - 250, parseInt(screen.height / 2, 10) - 300);
}

//Document Read
$(document).ready(function() {

	var path = '/';
	var flashvars = {SRVPATH: path, code: (code ? code : '') };
	
	swfobject.embedSWF(path + "swf/main.swf", "content", "100%", "100%", "9.0.0", false, flashvars, {bgcolor: "#000",AllowScriptAccess:"always",AllowFullScreen:"true",base:path}, {id:'content', name:'content'});
	if (!swfobject.hasFlashPlayerVersion('9'))
		window.location.href = '/noflash';
});

$(window)
	.load(resize)
	.resize(resize);