swidth = 170;
entry_height = 118;
side_width = 170;

function blogresize(margin){
	var wh = window.innerHeight?window.innerHeight:document.body.clientHeight;
	document.getElementById("mainFrame").style.height = wh-margin;

}
function navresize(margin){
	var ww = window.innerWidth?window.innerWidth:document.body.clientWidth;
	document.getElementById("naviFrame").style.width = ww-margin;

}
function recoverAll(){
	parent.document.getElementById("topFrame").style.display="block";
	parent.document.getElementById("topFrame").style.height = entry_height;
	parent.document.getElementById("mainFrame").style.display="block";
	parent.document.getElementById("leftFrame").style.display="block";
	parent.document.getElementById("navFrame").style.display="block";
	parent.document.getElementById("recovery").style.display="none";
	if(window.opera) widthset(side_width);
	blogresize(150);
	MM_swapImgRestore();
}

//For Opera
function widthset(margin){
	var ww = window.innerWidth?window.innerWidth:document.body.clientWidth;
	document.getElementById("topFrame").style.width = ww-margin;
	document.getElementById("navFrame").style.width = ww-margin;
	document.getElementById("mainFrame").style.width = ww-margin;

}
function widthresize(myEvents){
	if(window.opera){
	var ww = window.innerWidth?window.innerWidth:document.body.clientWidth;
	margin = swidth;
	document.getElementById("topFrame").style.width = ww-margin;
	document.getElementById("navFrame").style.width = ww-margin;
	document.getElementById("mainFrame").style.width = ww-margin;
	}
	marginbuttonresize();
}

function marginbuttonresize(){
	var ww = window.innerWidth?window.innerWidth:document.body.clientWidth;
	margin = (window.screen.width<1024)?480:633;
	naviFrame.document.getElementById("mbutton").style.width = (ww-swidth-margin)+"px";

}

function key_Press(e){
  alert(getKEYCODE(e));
}

function getKEYCODE(e){
    if(document.layers)              return  e.which        //n4
    else if(document.all)            return  event.keyCode  //e4,e5,e6
    else if(document.getElementById) return  e.charCode     //n6,moz
}

window.onresize = widthresize;
//document.onkeypress = key_Press;
