﻿function getINNERWIDTH(){
	if(window.opera) {
		return window.innerWidth;			//o6,o7
	} else if(document.all) {
		return document.body.clientWidth;	//e4,e5,e6
	} else if(document.layers) {
		return window.innerWidth;			//n4
	} else if(document.getElementById) {
		if ( window.innerHeight < document.body.scrollHeight ) {
			return window.innerWidth-16;	//n6,n7,m1,s1
		} else {
			return window.innerWidth;
		}
	}
	return null;
}
function getINNERHEIGHT(){
	if(window.opera) {
		return window.innerHeight;			//o6,o7
	} else if(document.all) {
		return document.body.clientHeight;	//e4,e5,e6
	} else if(document.layers) {
		return  window.innerHeight;			//n4
	} else if(document.getElementById) {
		if ( window.innerWidth < document.body.scrollWidth ) {
			return window.innerHeight-16;	//n6,n7,m1,s1
		} else {
			return window.innerHeight;
		}
	}
	return null;
}
function resizeToLAYER(layName,width,height){
	var tg;
	if(navigator.userAgent.search("Opera(\ |\/)6") != -1 ){  //o6
		tg = document.getElementById(layName);
		if (tg == undefined) return;
		tg.style.pixelWidth  = width;
		tg.style.pixelHeight = height;
	} else if(document.getElementById){ //e5,e6,n6,n7,m1,s1,o7
		tg = document.getElementById(layName);
		if (tg == undefined) return;
		tg.style.width  = width+'px';
		tg.style.height = height+'px';
	} else if(document.all){            //e4
		tg = document.all(layName);
		if (tg == undefined) return;
		tg.style.pixelWidth  = width;
		tg.style.pixelHeight = height;
	} else if(document.layers){         //n4
		tg = document.layers[layName];
		if (tg == undefined) return;
		tg.resizeTo(width,height);
	}
}
function resizeFlash() {
	resizeToLAYER('main',Math.max(940,getINNERWIDTH()),Math.max(580,getINNERHEIGHT()));
	resizeToLAYER('main',Math.max(940,getINNERWIDTH()),Math.max(580,getINNERHEIGHT()));
}