// Browser Window Size and Position
// copyright Stephen Chapman, 3rd Jan 2005, 8th Dec 2005
// you may copy these functions but please keep the copyright notice as well
function pageWidth() {
	return window.innerWidth != null? window.innerWidth : document.documentElement && document.documentElement.clientWidth ?       document.documentElement.clientWidth : document.body != null ? document.body.clientWidth : null;
	} 

var bFirstLoaded = false;

function ChangeWidth() { 
	
	var wid;
		
	wid = pageWidth();

	if (wid > 680) {
		wid = (wid / 2); 
//		if	(BrowserDetect.OS == 'Windows')
//			wid = wid - 10;
//		if	(BrowserDetect.browser == 'Firefox')
//			wid = wid - 5;		
		
		// ie down 5 px 5 right
		if (navigator.appName.indexOf("Internet Explorer") != -1){
		//	document.getElementById("overmenu_btn_shop").style.top = top1 + 5 + 'px';
		//	document.getElementById("overmenu_btn_newsroom").style.top = top2 + 5 + 'px';
			wid = wid + 10;
		}
		
		if (navigator.appVersion.indexOf("Win")!=-1)
			wid = wid - 10;

		if(navigator.userAgent.indexOf("Firefox")!=-1){
			var versionindex=navigator.userAgent.indexOf("Firefox")+8
			if (parseInt(navigator.userAgent.charAt(versionindex))>=1)
			wid = wid - 5;		
		}
		
/*		document.getElementById("overmenu_media").style.left = (wid - 238) + 'px';
		document.getElementById("overmenu_tour").style.left = (wid + 5) + 'px';
		document.getElementById("overmenu_music").style.left = (wid + 58) + 'px';	
		document.getElementById("overmenu_words").style.left = (wid + 125) + 'px';
*/
	if(document.getElementById("homePageFloater"))
			document.getElementById("homePageFloater").style.left =  (wid - 300) + 'px';    // +115 = old ds image			
	} else {
/*		document.getElementById("overmenu_media").style.left 	= '108px';
		document.getElementById("overmenu_tour").style.left 	= '346px';
		document.getElementById("overmenu_music").style.left 	= '400px';
		document.getElementById("overmenu_words").style.left 	= '466px';
	*/
		if(document.getElementById("homePageFloater"))
			document.getElementById("homePageFloater").style.left 	= '41px';		  	// 456 = old ds image 115 + -300 = 415
	}
	
	if(document.getElementById("homePageFloater"))
			document.getElementById("homePageFloater").style.display = 'inherit';
}   


window.onresize = ChangeWidth;
window.onload = ChangeWidth;