	function eBookOpener() {
                // Canon start --------------------
		// this.winLimitWidth	= 1024;
		// this.winLimitHeight	= 768;
		this.winLimitWidth	= 1014;
		this.winLimitHeight	= 711;
                // Canon end --------------------
		this.winWidth			= 0;
		this.winHeight			= 0;
		this.winStyle			= null;
		this.winStyleName		= null;

this.Port="80";
this.eBookUrl			  = "http://bb1.jtb.co.jp:"+this.Port+"/engine/isapi/frame.dll?";

		this.ParameterList	= new Array("bn", "bc", "co", "gp", "sbp", "sep", "ui", "ct");
		this.ViewerStyleList	= new Array("eBookFull", "eBookCustomer", "eBookDefault");

		this.GetOpenHTML		= GetOpenHTML;
		this.GetArguments		= GetArguments;
		this.GetWinStyle		= GetWinStyle;
		this.openbook			= openbook;
	}


	function GetOpenHTML(argString) {	//	open window in HTML
		var OpenHTML  = "<html>\n";
			 OpenHTML += "<body onload=\"eBook.click()\">\n";
			 OpenHTML += "<a id=\"eBook\" style=\"visibility:hidden\" href=\"" + this.eBookUrl + argString + "\">ebook</a>\n";
			 OpenHTML += "</body>\n";
			 OpenHTML += "</html>";

		return OpenHTML;
	}


	function GetArguments(argParameter) {
		var Parameter		= "";
		if(argParameter.length) {
			for(var i=0;i<argParameter.length;i++) {
				if(argParameter[i] != "") {	Parameter += this.ParameterList[i] + "=" + argParameter[i] + "&"; }
			}
			Parameter += "ul=" + navigator.browserLanguage;
			return Parameter;
		}	else {
			return false;
		}
	}


	function GetWinStyle() {
		var BrowserPatchInfo = navigator.appMinorVersion.split(";");
		if(navigator.appVersion.search("MSIE 6.0")) {
			for(var i=0;i<BrowserPatchInfo.length;i++) {
				if(BrowserPatchInfo[i] == "SP1")	{	this.winStyle = 0; }
			}
		}

		if(screen.width <= this.winLimitWidth || screen.height <= this.winLimitHeight) {	this.winStyle = 1; }
		
		if(this.winStyle) {
			this.winStyle = "fullscreen";
			this.winStyleName	= this.ViewerStyleList[0];
			return false;
		}	else if(this.winWidth > 0 && this.winHeight > 0) {
			this.winStyleName	= this.ViewerStyleList[1];
		}	else {
			this.winStyleName	= this.ViewerStyleList[2];
		}

		if(this.winWidth < this.winLimitWidth)		{	this.winWidth	= this.winLimitWidth; }
		if(this.winHeight < this.winLimitHeight)	{	this.winHeight	= this.winLimitHeight; }

                // Canon start --------------------
		// this.winLeft			= (screen.width - this.winWidth) / 2;
		// this.winTop				= (screen.height - this.winHeight) / 2;
		this.winLeft			= (screen.width - this.winWidth - 10) / 2;
		this.winTop				= (screen.height - this.winHeight - 57) / 2;
		// Canon end ----------------------

		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";
	}


	//	Book open function : bc, co, gp, sbp, sep, ct, ui
	function openbook() {

                // Canon start --------------------
		ebook.winStyle = null; // 1: specified IE Size. 0: full screen mode.
		ebook.winWidth = 1014;
		ebook.winHeight= 711;
		// Canon end ----------------------

		var Parameter = this.GetArguments(arguments);
		if(!Parameter) {
			alert("service fail!!");
			return false;
		}

		if(this.winStyle == null) {	this.GetWinStyle(); }
		var eBookViewer = window.open("about:blank", this.winStyleName, this.winStyle);
			 eBookViewer.document.write(this.GetOpenHTML(Parameter));
			 eBookViewer.document.close();	
	}


	ebook = new eBookOpener();

