var HEIGHT_MIN = 560;
var HEIGHT_MAX = 760;
if ( navigator.userAgent.indexOf('Mac') != -1 ) {
	HEIGHT_MAX = HEIGHT_MAX - 50;
}
var WIDTH_MIN = 980;
var footerHeight = 50;

var allowResize = true;
var resizeInterval;
function resizeWindow(){
	clearInterval(resizeInterval);
	top.window.moveTo(0,0);
	if (document.all) {
		top.window.resizeTo(screen.availWidth, screen.availHeight);
	} else if (document.getElementById || document.layers) {
		if (top.window.outerHeight < screen.availHeight || top.window.outerWidth < screen.availWidth){
			top.window.outerHeight = screen.availHeight;
			top.window.outerWidth = screen.availWidth;
		}
	}
	allowResize = true;
	top.window.onresize = onResizeEvent;
}
function onResizeEvent() {
	clearInterval(resizeInterval);
	resizeInterval = setInterval("resizeWindow()",500);
}
function resizeFooter(param_flashMaskWidth_int, paramFlashTotalWidth_int){
	var footer = MM_findObj("footer");
	var flashcontent = MM_findObj("flashcontent");
	var flashTop = 0;
	var windowHeight = getWindowHeight();
	footer.style.width = (param_flashMaskWidth_int) + 'px';
	if (document.all)	{
		footer.style.width = (param_flashMaskWidth_int + 5) + 'px';
	}
	footer.style.left = Math.round((paramFlashTotalWidth_int - param_flashMaskWidth_int) / 2) + 'px';
	//
	if(windowHeight >= HEIGHT_MAX + footerHeight){
		flashTop = Math.round(Math.abs(windowHeight - HEIGHT_MAX - footerHeight) / 2);
		if(flashTop < 15){
			flashTop = 0;
		}
	}
	flashcontent.style.top = flashTop + 'px';
	footer.style.top = (getFlashHeight() + flashTop) + 'px';
	footer.style.display = "block";
	//alert("footer.style.top=" + footer.style.top);
}

function getFlashWidth() {
	var flashWidth = getWindowWidth();
	if(flashWidth < WIDTH_MIN) {
		flashWidth = WIDTH_MIN;
	}
	return flashWidth;
}
function getFlashHeight() {
	var flashHeight = getWindowHeight();
	if(flashHeight > HEIGHT_MAX) {
		flashHeight = HEIGHT_MAX;
	} else if (flashHeight < HEIGHT_MIN){
		flashHeight = HEIGHT_MIN - footerHeight;
	} else {
		flashHeight -= footerHeight;
	}
	return flashHeight;
}
function getWindowHeight() {
	var windowHeight;
	if (document.all)	{
		windowHeight = document.body.offsetHeight;
	} else {
		windowHeight = window.innerHeight;
	}
	return windowHeight;
}
function getWindowWidth() {
	var windowWidth;
	if (document.all)	{
		windowWidth = document.body.offsetWidth - 29;
	} else {
		windowWidth = window.innerWidth;
	}
	return windowWidth;
}
//
