
	function Page()
	{
		this.getWindowInnerHeight = function()
		{
			if(document.body.clientHeight)
			{
				return document.body.clientHeight;
			}
			else
			{
				return window.innerHeight;
			}
		}


		this.getWindowInnerWidth = function()
		{
			if(document.body.clientWidth)
			{
				return document.body.clientWidth;
			}
			else
			{
				return window.innerWidth;
			}
		}


		this.flashposition = function()
		{
			var intFlashTopPos  = (this.getWindowInnerHeight() / 2) - (645 / 2);
			var intFlashLeftPos = (this.getWindowInnerWidth() / 2) - (1024 / 2);

			document.getElementById('flash').style.left = intFlashLeftPos;
			document.getElementById('flash').style.top  = intFlashTopPos;

			document.getElementById('checkout').style.left = intFlashLeftPos;
			document.getElementById('checkout').style.top  = intFlashTopPos;
		}


		this.getHistoryStep = function()
		{
			return top.location.href.substr(top.location.href.indexOf('#hb') + 3);
		}


		this.setHistoryStep = function(intLastStep)
		{
			return (intLastHistoryStep = parseInt(intLastStep));
		}


		this.addHistory = function(strHistoryTitle)
		{
			if(strHistoryTitle == undefined) strHistoryTitle = '';

			++intLastHistoryStep;

			dhtmlHistory.add('hb'+ intLastHistoryStep); //, (strHistoryTitle != '' ? {'newTitle':'HugoBoss >> '+ strHistoryTitle} : null)

			return intLastHistoryStep;
		}


		this.hasHistoryStep = function()
		{
			return (top.location.href.indexOf('#hb') >= 0);
		}


		this.setCheckoutData = function(strUrl, strBasket, strGutschein)
		{
			strUrl 			= strUrl || '';
			strBasket 		= strBasket || '';
			strGutschein	= strGutschein || '';

			if(strUrl == '' || strBasket == '')
			{
				return false;
			}
			document.getElementById('submitForm').action 	= strUrl;
			document.getElementById('basket').value			= strBasket;
			document.getElementById('Gutschein').value		= strGutschein;

			//objDebugger.addMessage(">> "+ document.getElementById('submitForm').action +" ][ "+ document.getElementById('basket').value +" ][ "+ document.getElementById('Gutschein').value);
		}


		this.switchModus = function(strMode)
		{
			strMode = strMode || '';
/*
			objDebugger.addMessage("switchMode to: "+ strMode);

			switch(strMode)
			{
				case 'checkout' :
				{
					var objCheckoutObserver = new Timer(1000, 1);

						objCheckoutObserver.addEvent(EVENT_START, {func:function()
						{
							document.cookie='flag=;path=/;domain=.hugoboss-store.com; expires='+ (new Date()).toGMTString();

							if(blnIsIE || blnIsMAC)
							{
								document.getElementById('flash').innerHTML = strCheckoutVal;
							}
							else
							{
								objCheckout.clear();

								objFlash.display(false);
								objCheckout.display(true);
							}
						}});

						objCheckoutObserver.addEvent(EVENT_COMPLETE, {func:function()
						{
							//document.getElementsByName('checkoutframe')[0].name
							document.getElementById('submitForm').submit();
						}});
						objCheckoutObserver.start();
				}; break;

				//case 'regular' : { document.cookie='path=/;domain=.hugoboss-store.com; expires=Tue, 11 Jan 1980 00:00:00 GMT'; }
				//case 'regular' : { document.cookie='flag=checkout;path=/;domain=.hugoboss-store.com; expires=Tue, 11 Jan 1980 00:00:00 GMT'; }
				default :
				{
					objDebugger.addMessage("default go back to shop");
					
					objFlash.backToShop();
				}; break;
			}
			*/
		}


		this.checkResolution = function()
		{
			if(screen.width < intResolutionWidth || screen.height < intResolutionHeight)
			{
				return false;	
			}
			return true;
		}
		
		this.cache = '';

		this.readCookies = function()
		{
			if(document.cookie != '' && document.cookie != this.cache.lastValue)
			{
				this.cache.lastValue = document.cookie;

				var arrCookie = document.cookie.split(';');

				for(var strKey in arrCookie)
				{
					if(typeof(arrCookie[strKey]) != 'string') continue;

					//objDebugger.addMessage("Test: ["+strKey+"] ["+ String(arrCookie[strKey])+"] ");

					var arrTemp = arrCookie[strKey].split('=');

					if(arrTemp[0].toLowerCase() != 'command')
					{
						continue;
					}
					objDebugger.addMessage("Cookie-Command: "+ arrTemp[1]);

					if(arrTemp[1].toLowerCase() == 'flush' || arrTemp[1].toLowerCase() == 'flushback')
					{
						objFlash.flushBasket();
					}

					if(arrTemp[1].toLowerCase() == 'back' || arrTemp[1].toLowerCase() == 'flushback')
					{
						blnStartAtBasket = true;

						//document.cookie='flag=checkout;path=/;domain=.hugoboss-store.com; expires='+ (new Date()).toGMTString();
						//document.cookie='path=/;domain=.hugoboss-store.com; expires='+ (new Date()).toGMTString();

						objDebugger.addMessage("go BACK to shop");

						objFlash.backToShop();

						//if(!document.all)
						if(!blnIsIE && !blnIsMAC)
						{
							objCheckout.clear();
						}
						objDebugger.addMessage("BACK in shop");
					}
/*
					switch(arrTemp[1].toLowerCase())
					{
						case 'flushback': 
						case 'flush' :
						{
							objFlash.flushBasket();
						}; break;

						case 'back' :
						{
							blnStartAtBasket = true;

							//document.cookie='flag=checkout;path=/;domain=.hugoboss-store.com; expires='+ (new Date()).toGMTString();
							//document.cookie='path=/;domain=.hugoboss-store.com; expires='+ (new Date()).toGMTString();

							objDebugger.addMessage("go BACK to shop");

							objFlash.backToShop();
							
							//if(!document.all)
							if(!blnIsIE && !blnIsMAC)
							{
								objCheckout.clear();
							}
							objDebugger.addMessage("BACK in shop");
						}; break;
					}
*/
					document.cookie = arrTemp[0] +"=;path=/;domain=hugoboss-store.com;expires="+ (new Date()).toGMTString();
				}
				this.cache.lastValue = '';
				//document.cookie = arrCookieNew.join('&');
			}
		}

		//document.cookie = "back=;path=/;domain=hugoboss-store.com;expires="+ (new Date()).toGMTString();
		//document.cookie = "command=;path=/;domain=hugoboss-store.com;expires="+ (new Date()).toGMTString();
/*
		var timerCookieListener = new Timer(500, 0);
			timerCookieListener.addEvent(EVENT_UPDATE, {func:function(evt)
			{
				objPage.readCookies();
			}});
			timerCookieListener.start();
		*/
	}
