	function setCookie(c_name,value,expiredays)
	{
		var exdate=new Date();
		exdate.setDate(exdate.getDate()+expiredays);
		document.cookie=c_name+ "=" +escape(value)+
		((expiredays==null) ? "" : ";expires="+exdate.toGMTString())
		+ ";path=/";
	}
    function adjustPageToScreen() {
		var logoWidth = 340;
		var logoHeight = 84;

		var agt=navigator.userAgent.toLowerCase();
		var ie = (agt.indexOf("msie") != -1);
		var compatMode = (document.compatMode && document.compatMode == "BackCompat");
		var screenWidth = 0;
		var screenHeight = 0;
		if (ie && compatMode)
		{
			screenWidth = document.body.clientWidth;
			screenHeight = document.body.clientHeight;
		} else if (ie && !compatMode) {
			screenWidth = document.documentElement.clientWidth;
			screenHeight = document.documentElement.clientHeight;
		} else {
			screenWidth = window.innerWidth;
			screenHeight = window.innerHeight;
		}

		if (screenHeight > 300 && screenHeight < 2000)
		{
			var newLogoWidth = 0;
			var newLogoHeight = 0;
			var newPageHeight = 0;

			if (screenHeight < 700)
			{
				newLogoWidth = logoWidth / 2;
				newLogoHeight = logoHeight / 2;
				newPageHeight = screenHeight - 210;
			} else {
				newLogoWidth = logoWidth;
				newLogoHeight = logoHeight;
				newPageHeight = screenHeight - 250;
			}
			document.getElementById('logo').style.width = newLogoWidth + 'px';
			document.getElementById('logo').style.height = newLogoHeight + 'px';
			document.getElementById('logoImg').style.width = newLogoWidth + 'px';
			document.getElementById('logoImg').style.height = newLogoHeight + 'px';
			document.getElementById('page').style.minHeight = newPageHeight + 'px';
			document.getElementById('pageInner').style.minHeight = newPageHeight + 'px';
			document.getElementById('sideMenu').style.minHeight = ( newPageHeight - 4) + 'px';
			setCookie('browserDims', newPageHeight + ',' + newLogoWidth + ',' + newLogoHeight, 5);
		}
	}
