//查看试卷答案模块
var object_view = function(option, success) {
	var object = new ObjectView(option);
	success();
	return object;
}

function ObjectView(option) {
	this.markControl = option.markControl;
	this.list = option.list;
	this.init();
}

ObjectView.prototype.init = function() {
	if(this.list == undefined) {
		return;
	}
	for(var i = 0; i < this.list.length; i++) {
		var title = this.list[i].title;
		var url = this.list[i].url;
		if(title != undefined && url != undefined && title.length > 0 && url.length > 0) {
			var container = getDom(this.container_dom, this.markControl).appendTo(this.markControl.container.centerContent);
			container.height(this.markControl.container.centerContent.height());
			container.width(this.markControl.container.centerContent.width());
			this.markControl.addNavGroup(title, container);
			this.render(container, url);
		}
	}
}

ObjectView.prototype.render = function(container, url) {
	var dom = $(this.content_dom);
	dom[0].width = container.width();
	dom[0].height = container.height() * 0.9;
	dom.find('object')[0].width = container.width();
	dom.find('object')[0].height = container.height() * 0.9;
	dom.find('#object-src').val(url);
	dom.find('object')[0].data = url;
	container.append(dom);
}

ObjectView.prototype.container_dom = '<div></div>';

ObjectView.prototype.content_dom = '<object classid="clsid:CA8A9780-280D-11CF-A24D-444553540000" width="" height="" border="0">\
<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 data="" type="application/pdf" width="" height=""></object>\
</object>';