

function MM_swapImgRestore() { 
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { 
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { 
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { 
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function VRPic_showCurrentLeftPage()
{
	var CurrentPageL = document.VRPic_eBook.public_GetCurrentLeftPageNum();
	var CurrentPageR = document.VRPic_eBook.public_GetCurrentRightPageNum();
	var TotalPage = document.VRPic_eBook.public_GetTotalPageNum();
	if(CurrentPageL>TotalPage || CurrentPageL == 0) CurrentPageL = "0";
	if(CurrentPageR>TotalPage || CurrentPageR == 0) CurrentPageR = "0";
	current_page.innerText = CurrentPageL + "-" + CurrentPageR + "/" + TotalPage;
}

function VRPic_goToInputPage()
{
	document.VRPic_eBook.public_GotoInPutPageNumber(movePage.value);
	movePage.value="";
}

function VRPic_pressFirstPage()
{
	document.VRPic_eBook.public_PressButtonFirstPage();
}

function VRPic_pressPrevPage()
{
	document.VRPic_eBook.public_PressButtonPrevPage();
	VRPic_showCurrentLeftPage();
}

function VRPic_pressNextPage()
{
	document.VRPic_eBook.public_PressButtonNextPage();
	VRPic_showCurrentLeftPage();
}

function VRPic_pressEndPage()
{
	document.VRPic_eBook.public_PressButtonEndPage();
}

function VRPic_pressInitialize()
{
	document.VRPic_eBook.public_PressButtonInit();
}

function VRPic_pressZoomInNormalMode()
{
	document.VRPic_eBook.public_PressButtonZoomIn();
}

function VRPic_pressZoomInWindowMode()
{
	document.VRPic_eBook.public_PressButtonZoomWindow();
}

function VRPic_pressPrintLeftPage()
{
	document.VRPic_eBook.public_PrintPage(0);
}

function VRPic_pressPrintPage(number)
{
	var string;

	if(number == 0)
		string = document.VRPic_eBook.pubic_GetLeftPageImageName();
	else
		string = document.VRPic_eBook.pubic_GetRightPageImageName();

	var width1 = document.VRPic_eBook.public_GetImageOriginalWidth();
	var height1 = document.VRPic_eBook.public_GetImageOriginalHeight();
	if (width1 < 340) {
		width1 = width1/2;
		height1 = height1/2;
	} else {
		zoomoutx = 3400 / width1;
		width1 = width1 * zoomoutx / 10;
		height1 = height1 * zoomoutx / 10;
	}
	if (height1 < 470) {
		width1 = width1/2;
		height1 = height1/2;
	} else {
		zoomoutx = 4500 / height1;
		width1 = width1 * zoomoutx / 10;
		height1 = height1 * zoomoutx / 10;
	}
	if (height1 > 60) 
	str = 'height=240';
	else
	str = 'width=170';
	printWindow=window.open("","",'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=740,height=600,left=200,top=80');
	printWindow.document.writeln("<html>");
	printWindow.document.writeln("<head>");
	printWindow.document.writeln("</head>");
	printWindow.document.writeln("<body>");

	printWindow.document.writeln("<center>");
	printWindow.document.writeln("<table border='0' cellspacing='0' cellpadding='0' topmargin='0' marginwidth='0' marginheight='0'>");
	printWindow.document.writeln("<tr>");

	printWindow.document.writeln("<td><img src=\"" + string + "0.jpg\" " + str + "></td>");
	printWindow.document.writeln("<td><img src=\"" + string + "1.jpg\" " + str + "></td>");
	printWindow.document.writeln("<td><img src=\"" + string + "2.jpg\" " + str + "></td>");
	printWindow.document.writeln("<td><img src=\"" + string + "3.jpg\" " + str + "></td>");
	printWindow.document.writeln("</tr><tr>");
	printWindow.document.writeln("<td><img src=\"" + string + "4.jpg\" " + str + "></td>");
	printWindow.document.writeln("<td><img src=\"" + string + "5.jpg\" " + str + "></td>");
	printWindow.document.writeln("<td><img src=\"" + string + "6.jpg\" " + str + "></td>");
	printWindow.document.writeln("<td><img src=\"" + string + "7.jpg\" " + str + "></td>");
	printWindow.document.writeln("</tr><tr>");
	printWindow.document.writeln("<td><img src=\"" + string + "8.jpg\" " + str + "></td>");
	printWindow.document.writeln("<td><img src=\"" + string + "9.jpg\" " + str + "></td>");
	printWindow.document.writeln("<td><img src=\"" + string + "10.jpg\" " + str + "></td>");
	printWindow.document.writeln("<td><img src=\"" + string + "11.jpg\" " + str + "></td>");
	printWindow.document.writeln("</tr><tr>");
	printWindow.document.writeln("<td><img src=\"" + string + "12.jpg\" " + str + "></td>");
	printWindow.document.writeln("<td><img src=\"" + string + "13.jpg\" " + str + "></td>");
	printWindow.document.writeln("<td><img src=\"" + string + "14.jpg\" " + str + "></td>");
	printWindow.document.writeln("<td><img src=\"" + string + "15.jpg\" " + str + "></td>");

	printWindow.document.writeln("</tr>");
	printWindow.document.writeln("</table>");
	printWindow.document.writeln("</center>");

	printWindow.document.writeln("</body>");
	printWindow.document.writeln("</html>");
	printWindow.location.reload();

	printWindow.print();
	printWindow.setTimeout("window.close()",800);
}

function VRPic_pressHelpPage()
{
    window.open("img/ibooksjpn/help.htm","",'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=416,height=500');
}

function VRPic_goToInputPage2(page)
{
	document.VRPic_eBook.public_GotoInPutPageNumber(page);
}

function menu(form)
{
	location.href = form.url.options[form.url.selectedIndex].value;
}
function showblockdiag()
{
this.iframeresult.resizeTo(149,93);
     this.spanresult.style.visibility="visible";
}
