function cOnClose(){
	if(!gbAllLoaded){return false;}
	top.window.close();
}

function dmmDoMaximize(){
	var aWndName=window.name.split("_");
	var Margin_Width=screen.availWidth-screen.width;
	var Margin_Height=screen.availHeight-screen.height;
	var iWidth=0;
	var iHeight=0;
	if(aWndName[0]=="eBookFull"){
		iWidth=screen.width+giBorderLeft*2;
		iHeight=screen.height+giBorderTop+giBorderLeft;
	}else{
		if(Margin_Height==0){Margin_Height=5;}else{Margin_Height=0;}
		if(Margin_Width==0){Margin_Width=5;}else{Margin_Width=0;}
		iWidth=screen.availWidth+giBorderLeft*2+Margin_Width;
		iHeight=screen.availHeight+giBorderTop+Margin_Height;
	}

	top.window.moveTo(-giBorderLeft,-giBorderTop);
	top.window.resizeTo(iWidth,iHeight);

	with(this.oParentFrame.style){
		position="absolute";
		top=0;
		left=0;
		width=document.body.clientWidth;
		height=document.body.clientHeight;
	}

	this.oMinBtn.style.visibility="visible";
	this.oCloseBtn.style.visibility="visible";
	this.bRestore=true;
}


function dmmDoRestore(){
	var aWndName=window.name.split("_");
	var Margin_Left=0;
	var Margin_Top=0;
	if(aWndName[0]=="eBookFull"){
		if(IsWinXP()){
			Margin_Left=-8;
			Margin_Top=-60;
		}else{
			Margin_Left=-7;Margin_Top=-46;
		}
	}
	top.window.moveTo(parseInt(this.left+Margin_Left),parseInt(this.top+Margin_Top));
	top.window.resizeTo(this.width,this.height+55);

	with(this.oParentFrame.style){
		position="relative";
		left=0;
		top=0;
		width="100%";
		height="100%";
	}
	this.oMinBtn.style.visibility="hidden";
	this.oCloseBtn.style.visibility="hidden";
	this.bRestore=false;
}