<%@ page contentType="text/html;charset=UTF-8"%>
<script type="text/javascript" src="${ctxStatic}/mark-new/js/jquery-ui.min.js"></script>
<script type="text/javascript" src="${ctxStatic}/mark-new/js/jquery.mousewheel.min.js"></script>

<link rel="stylesheet" type="text/css" href="${ctxStatic}/jBox/Source/jBox.css">
<script type="text/javascript" src="${ctxStatic}/jBox/Source/jBox.min.js"></script>

<link rel="stylesheet" type="text/css" href="${ctxStatic}/iviewer/jquery.iviewer.css">
<script type="text/javascript" src="${ctxStatic}/iviewer/jquery.iviewer.js"></script>

<script type="text/javascript">
var sheetModal = new jBox('Modal');
$(document).ready(function() {
	$('#left-answer-div').find('iframe').height($(window).height()*0.83);
});
function initSheetPopover(title, sheetServer, sheetUrl, answerUrl) {
	initSheetPopoverContent(sheetServer, sheetUrl.split(','), answerUrl);

	sheetModal.setWidth($(window).width()*0.9);
	sheetModal.setHeight($(window).height()*0.85);
	sheetModal.setTitle(title);
	sheetModal.setContent($('#sheet-view-content'));
	sheetModal.open();
}
function initSheetPopoverContent(sheetServer, sheetUrls, answerUrl){
	if(answerUrl!=undefined && answerUrl.length>0){
		$('#right-sheet-div').removeClass('span12');
		$('#right-sheet-div').addClass('span6');
		$('#left-answer-div').find('iframe').attr('src', answerUrl);
		$('#left-answer-div').show();
	}else{
		$('#right-sheet-div').removeClass('span6');
		$('#right-sheet-div').addClass('span12');
		$('#left-answer-div').find('iframe').attr('src', '');
		$('#left-answer-div').hide();
	}

	$('#right-nav, #right-content').empty();
	for(var i=0;i<sheetUrls.length;i++){
		var url = sheetServer+sheetUrls[i];
		$('#right-nav').append('<li><a href="#sheet_'+i+'" data-toggle="tab">第'+(i+1)+'页</a></li>');
		
		var pane = $('<div class="tab-pane fade" id="sheet_'+i+'" style="overflow: hidden;"><div class="image-holder" style="position: relative;width:100%"></div></div>').appendTo($('#right-content'));
		pane.find('.image-holder').height($(window).height()*0.8);
		pane.find('.image-holder').iviewer({
			src: url,
			zoom: 'fit',
			zoom_min: 20,
			ui_disable: false,
			mousewheel: false
		});
	}
	$('#right-nav a:first').trigger('click');
}
</script>
<div id="sheet-view-content" class="container-fluid" style="display:none">
	<div class="row-fluid">
		<div id="left-answer-div" class="span6" style="overflow:scroll">
			<!--  <object classid="clsid:CA8A9780-280D-11CF-A24D-444553540000" width="100%" height="" border="0" overflow="scroll" scroll="yes">
				<param name="_Version" value="65539">
				<param name="_ExtentX" value="20108">
				<param name="_ExtentY" value="10866">
				<param name="_StockProps" value="0">
				<param name="SRC" id="object-src" value="">
				<object id="object-data" data="" type="application/pdf" width="100%" height=""></object>
			</object>
			-->
			<iframe src="" border="0" scrolling="yes" width="100%"></iframe>
		</div>
		<div id="right-sheet-div" class="span6">
			<ul id="right-nav" class="nav nav-tabs">
			</ul>
			<div id="right-content" class="tab-content">
			</div>
		</div>
	</div>
</div>