function getTheWindowSize(){
	
	var myXscroll;
	var myYscroll;
	
	if (window.innerHeight && window.scrollMaxY) {	
				myXscroll = document.body.scrollWidth;
				myYscroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){
			myXscroll = document.body.scrollWidth;
			myYscroll = document.body.scrollHeight;
	} else { // code for Mac IE... but also works in Explorer 6 Strict, Mozilla and Safari
			myXscroll = document.body.offsetWidth;
			myYscroll = document.body.offsetHeight;
	}
	
	var windowWidth, windowHeight;
	if (self.innerHeight) {	// all except Explorer
			currentWindowWidth = self.innerWidth;
			currentWindowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
			currentWindowWidth = document.documentElement.clientWidth;
			currentWindowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
			currentWindowWidth = document.body.clientWidth;
			currentWindowHeight = document.body.clientHeight;
	}	
	
	// for small pages with total height less then height of the viewport
	if(myYscroll < windowHeight){
			currentPageHeight = windowHeight;
	} else { 
			currentPageHeight = myYscroll;
	}

	// for small pages with total width less then width of the viewport
	if(myXscroll < windowWidth){	
			currentPageWidth = windowWidth;
	} else {
			currentPageWidth = myXscroll;
	}


	arrayWindowSize = new Array(currentPageWidth,currentPageHeight,currentWindowWidth,currentWindowHeight) 
	return arrayWindowSize;
}

function buildAppWindow(){
	//target the objects on the page
	var objSurround = document.getElementById('surround');
	var objApp = document.getElementById('app');
	
	//grab the current window height
	var arrayPageSize = getTheWindowSize();
	
	//size the ghosted BG to the window height
	objSurround.style.height = (arrayPageSize[1] + 'px');
	objSurround.style.display = 'block';
	objApp.style.display = 'block';
	
	//set the app to float in the middle of the current window
	objApp.style.left = (((arrayPageSize[0]/2)-500) + 'px')
	
	so = new SWFObject('swf/vsemenu.swf', 'vse', '1000', '675', '9', '#0000'); 
	so.addParam('swLiveConnect','true'); 
	so.addParam('allowScriptAccess','true'); 
	so.addParam('wmode','transparent'); 
	so.write('container');
	
	var objClose = document.getElementById('closeEmUp');
	var objCLOSElink = document.createElement('a');
		objCLOSElink.setAttribute('id','closeApp');
		objCLOSElink.setAttribute('href', 'javascript:closeEmUp();void(0);');
		objCLOSElink.innerHTML += '';
	objClose.appendChild(objCLOSElink);
	
}

function closeEmUp(target){
	//document.getElementById('surround').style.display="none";
	//document.getElementById('app').style.display="none";
	window.location="http://experience.acuvue.com";
}


function reposition(){
		//target the objects on the page
	var objApp = document.getElementById('app');
	
	//grab the current window height
	var arrayPageSize = getTheWindowSize();
		
	//set the app to float in the middle of the current window
	objApp.style.left = (((arrayPageSize[0]/2)-500) + 'px');
}
