	var HomepageJSCheck = {
		
		JSSupported: false,
		CookieSupported: false,
		
		XMLHttpFactories: [
		    function () {return new XMLHttpRequest()},
		    function () {return new ActiveXObject("Msxml2.XMLHTTP")},
		    function () {return new ActiveXObject("Msxml3.XMLHTTP")},
		    function () {return new ActiveXObject("Microsoft.XMLHTTP")}
		],
		
		createXMLHTTPObject: function () {
			var xmlhttp = false;
			for (var i=0;i<this.XMLHttpFactories.length;i++) {
				try{
					xmlhttp = this.XMLHttpFactories[i]();
				} catch (e) {
					continue;
				}
				break;
			}
			return xmlhttp;
		},
		
		init: function() {
			if (YAHOO.util.Cookie.get('userId')) {
				this.JSSupported = true;
				this.CookieSupported = true;
			} else if (document.createElement && document.getElementsByTagName && document.getElementsByTagName('*').length>0 && this.createXMLHTTPObject()) {
				this.JSSupported = true;
				
				YAHOO.util.Cookie.set('tmptestvalue','test');
				var testVal = YAHOO.util.Cookie.get('tmptestvalue');
				if (testVal) {
					this.CookieSupported = true;
					YAHOO.util.Cookie.remove('tmptestvalue');
				}

				//window.location = '/index.php?uid=new_homepage';
			}
		}
	}

	HomepageJSCheck.init();

	if (!HomepageJSCheck.JSSupported || !HomepageJSCheck.CookieSupported) {
		document.write('<p class="jserror">');
		document.write('Je nám líto, ale Váš internetový prohlížeč nepodporuje dostatečně nebo má vypnuté následující technologie umožňující využít funkce, které nabízí nová hlavní stránka ATLANTIKU:<br />');
		if (!HomepageJSCheck.JSSupported)
			document.write('- <strong>skriptování v jazyce JavaScript</strong><br />');
		if (!HomepageJSCheck.CookieSupported)
			document.write('- <strong>soubory Cookies</strong>');
		document.write('</p>');
	}
