function eBookOpener() {
	this.winLimitWidth 	= 1024;
	this.winLimitHeight = 670;
	this.winWidth       = 0;
	this.winHeight      = 0;
	this.winLeft		= 0;
	this.winTop			= 0;
	this.winString		= null;
	this.Port           = null ; 
	this.Host       	= null;
	this.Service		= null;
	this.eBookUrl       = null;
	this.winStyle		= null;

	this.SetLaunchHTML  = SetLaunchHTML;
	this.OpenBook       = OpenBook;
	this.GetBorderSize  = GetBorderSize;
 	this.IsWinXP        = IsWinXP;
 	this.IsWinXPSP2		= IsWinXPSP2;
 	this.IsWin2k3		= IsWin2k3;
 	this.GetWinStyle	= GetWinStyle;
}

function SetLaunchHTML(arg_URL) {  //  open window in HTML
	var OpenHTML  = "<html>"
		+ "<body onload=\"oLaunch.click()\">"
		+ "<a id=\"oLaunch\" style=\"visibility:hidden\" href=\"" + this.eBookUrl  + arg_URL + "\">OpenEBook</a>"
		+ "</body></html>" ;

	return OpenHTML;
}

  function GetWinStyle() {  
 	this.winWidth   =  screen.width  ;
	this.winHeight  =  screen.height;
	if (screen.width  != screen.availWidth ) {this.winWidth  = screen.width  - 57 } // TaskBar Width
	if (screen.height != screen.availHeight) {this.winHeight = screen.height - 27 } // TaskBar Height

    this.winStyle    = "top=" + this.winTop + ", left=" + this.winLeft + ", width=" + this.winWidth + ", height=" + this.winHeight + ", directories=no, location=no, menubar=no, resizable=no, scrollbars=no, status=no, toolbar=no";
  }


function OpenBook() {
 	var aBorderInfo = this.GetBorderSize();

 	// Set Screen Information
 	this.winWidth   =  screen.width  ;
	this.winHeight  =  screen.height;
	if (screen.width  != screen.availWidth ) { this.winWidth  = screen.width  - 57 } // TaskBar Width
	if (screen.height != screen.availHeight) { this.winHeight = screen.height - 27 } // TaskBar Height


	this.eBookUrl        = this.Host + ":" + this.Port + "/" + this.Service + "/ebook.asp?";
// 	if(this.IsWinXPSP2() == true) {
//	} else {
	 	this.winString = "fullscreen,scrollbars=no";
		var eNewBook = window.open("about:blank", "Kim_Hyeung_Jun", this.winString);
		with(eNewBook) {
			document.write(this.SetLaunchHTML(arguments[0]));
			document.close();
		}
// 	}
}

function GetBorderSize () {
	var aBorderInfo = new Array();
	
	aBorderInfo[0] = (this.IsWinXP()) ? 6  :  5;
	aBorderInfo[1] = (this.IsWinXP()) ? 32 : 24;

	return aBorderInfo;
}

function IsWinXP() {
	if (navigator.userAgent.indexOf("Windows NT 5.1") > 1 ) {return true;} 
	return false; // WinMe, Win9x, Win2k, Win2k  
}

function IsWinXPSP2() {
	if ( navigator.userAgent.indexOf("SV1") > 1 ) {return true;}
	return false;
}

function IsWin2k3(){
	if(navigator.userAgent.indexOf("Windows NT 5.2")> 1){return true;}
	return false;
}

oBook = new eBookOpener();