
function getPageSize(){
	
	var xScroll, yScroll;
	
	if (window.innerHeight && window.scrollMaxY) {	
		xScroll = document.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}
	
	var windowWidth, windowHeight;
	if (self.innerHeight) {	// all except Explorer
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}	
	
	var yScroll, xScroll;

	if (self.pageYOffset) {
		yScroll = self.pageYOffset;
		xScroll = self.pageXOffset;
	} else if (document.documentElement && document.documentElement.scrollTop){	 // Explorer 6 Strict
		yScroll = document.documentElement.scrollTop;
		xScroll = document.documentElement.scrollLeft;
	} else if (document.body) {// all other Explorers
		yScroll = document.body.scrollTop;
		xScroll = document.body.scrollLeft;
	}
	
	
	arrayPageSize = new Array(windowWidth,windowHeight, yScroll, xScroll) 
	return arrayPageSize;
}

function getData()
{
	
	pageDimensions = getPageSize();
	var centerY = pageDimensions[1] / 2 + pageDimensions[2];
	var centerX = pageDimensions[0] / 2 + pageDimensions[3];
	
	callExternalInterface(centerX, centerY);

} 


function callExternalInterface(centerX, centerY) 
{
    thisMovie("flashUFO").centerStage(centerX, centerY);
}


function thisMovie(movieName) 
{
    
    if (navigator.appName.indexOf("Microsoft") != -1) 
    {
        return window[movieName]
    }
    else 
    {
        return document[movieName]
    }
}



var pageSize = getPageSize();
var minWidth = 995;
var minHeight = 1800;

var windowWidth = pageSize[0] - 20;
var windowHeight = pageSize[1];

var stageWidth = (windowWidth > minWidth) ? windowWidth : minWidth;
var stageHeight = (windowHeight > minHeight) ? windowHeight : minHeight;
