//初期設定
Wmax=800;//最大横
Hmax=600;//最大高
Ireko="main";//入れ子のID

//初期設定 終わり
wwindow = screen.availWidth;
hwindow = screen.availHeight;
//moveTo(0,0);
//resizeTo(wwindow,hwindow);
//window.focus();

Check_Microsoft=false;
function checkBrowser()
{var uName = navigator.appName;
if (uName.indexOf("Microsoft") > -1) {Check_Microsoft=true;}}
checkBrowser();
window.onresize=Windowsc;
function Windowsc(){
	
  var a = window.self.document.getElementById(Ireko);
  if(Check_Microsoft){
  var w = window.self.document.body.offsetWidth;
  var h = window.self.document.body.offsetHeight;
  }else{
  var w = window.self.innerWidth
  var h = window.self.innerHeight;}
    
  var wt = Wmax;var ht = Hmax;
    if (w < wt){a.style.width = wt + "px"}else{a.style.width = "100%";};
    if (h < ht){a.style.height = ht + "px";}
	else if(h==ht){a.style.height = ht + "px";}
	else{if(Check_Microsoft){a.style.height = h-4+"px"}else{a.style.height ="100%";}
	}
}

Windowsc();
