	function eBookOpener() {
		this.winLimitWidth	= 1024;
		this.winLimitHeight	= 768;
		this.winWidth			  = 0;
		this.winHeight			= 0;
		this.winStyle			  = null;
		this.winStyleName		= null;
		this.eBookUrl			  = "http://v2main.trueebook.com/engine/isapi/frame.dll?";
		this.ParameterList	= new Array("bc", "co", "gp", "sbp", "sep", "ui", "ct");
		this.ViewerStyleList= new Array("eBookFull", "eBookCustomer", "eBookDefault");

		this.SetLaunchHTML	= SetLaunchHTML;
		this.GetWinStyle		= GetWinStyle;
		this.OpenBook			  = OpenBook;
	}

	function SetLaunchHTML() {	//	open window in HTML
		var OpenHTML  = "<html>\n";
			 OpenHTML += "<body onload=\"eBook.click()\">\n";
			 OpenHTML += "<a id=\"eBook\" style=\"visibility:hidden\" href=\"" + this.eBookUrl + "\">OpenEBook</a>\n";
			 OpenHTML += "</body>\n";
			 OpenHTML += "</html>";

		return OpenHTML;
	}

	function GetWinStyle() {
    if(screen.width <= this.winLimitWidth || screen.height <= this.winLimitHeight) {	this.winStyle = 0 ; }
    
    switch ( this.winStyle ) {
      case 0  : // full screen window 
                this.winStyleName	= this.ViewerStyleList[0]; 
                this.winTop     = 0 ;                                   
                this.winLeft    = 0 ;
                this.winWidth   =  screen.width  ;
                this.winHeight  =  screen.height ;
                break;
      case 1  : // corporation customer window 
                this.winStyleName	= this.ViewerStyleList[1]; 
            		if(this.winWidth < this.winLimitWidth)		{	this.winWidth	= this.winLimitWidth; }
		            if(this.winHeight < this.winLimitHeight)	{	this.winHeight	= this.winLimitHeight; }
                this.winLeft		= (screen.width  - this.winWidth) / 2;
                this.winTop			= (screen.height - this.winHeight) / 2;
                break;
      default : // user customer window environemnt
                this.winStyleName	= this.ViewerStyleList[2]; 
            		this.winWidth	    = this.winLimitWidth;  
		            this.winHeight	  = this.winLimitHeight;  
                this.winLeft		  = (screen.width  - this.winWidth) / 2;
                this.winTop			  = (screen.height - this.winHeight) / 2;
                break;
		}
		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() {
 		 this.eBookUrl = arguments[0] +  "/engine/isapi/frame.html";

 		this.GetWinStyle();
		var eBookClient = window.open("about:blank", this.winStyleName +"_"+ Math.round(Math.random() * 100), this.winStyle);

		eBookClient.document.write(this.SetLaunchHTML());
		eBookClient.focus();
		eBookClient.document.close();	
	}

	OpenEBook = new eBookOpener();
