<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->Koha -- 編目: <!-- TMPL_IF NAME="oldbiblionumtagfield" -->編輯 MARC 記錄號碼 <!-- TMPL_VAR name="bibid" --><!-- TMPL_ELSE -->新增 MARC 記錄<!-- /TMPL_IF --><!-- TMPL_INCLUDE NAME="doc-head-close-addbiblio.inc" -->
<script language="JavaScript" type="text/javascript">
	document.write("<div id=\"loading\">");
	document.write("請稍後...");
	document.write("<\/div>");
</script><!-- TMPL_INCLUDE NAME="masthead.inc" -->
<!-- TMPL_INCLUDE NAME="acqui-topmenu.inc" -->
<!-- TMPL_INCLUDE NAME="intranet-nav-brief.inc" -->


<div id="main">

	<form method="post" name="f" id="f" action="addbiblio.pl">
<h1><!-- TMPL_IF NAME="oldbiblionumtagfield" -->編輯 MARC 記錄號碼<!-- TMPL_VAR name="oldbiblionumber" --><!-- TMPL_ELSE -->Add MARC Record<!-- /TMPL_IF --> With Framework : <!--TMPL_VAR Name="framework" --></h1>



<div class="tabitem">		<input type="hidden" name="op" value="addbiblio" />
		<input type="hidden" name="addfield_field" />
		<input type="hidden" name="frameworkcode" value="<!-- TMPL_VAR NAME="frameworkcode" -->" />
		<input type="hidden" name="oldbiblionumber" value="<!-- TMPL_VAR NAME="oldbiblionumber" -->" />
		<!-- TMPL_IF name="bibid" -->
			<input type="button" value="儲存書目記錄到館藏" onclick="Check(this.form)" accesskey="w" class="submit" />
		<!-- TMPL_ELSE -->
			<input type="button" value="新增書目記錄到館藏" onclick="Check(this.form)" accesskey="w" class="submit" />
		<!-- /TMPL_IF -->
	<input type="button" value="z39.50 查詢" class="submit" onclick="PopupZ3950(); return false;" / ></div>


	<div class="tabs">
		<!-- TMPL_IF name="0XX" -->
		<a href="#" onclick="active(0); return false;" id="link0">0</a>
		<!-- /TMPL_IF -->
		<!-- TMPL_IF name="1XX" -->
		<a href="#" onclick="active(1); return false;" id="link1">1</a>
		<!-- /TMPL_IF -->
		<!-- TMPL_IF name="2XX" -->
		<a href="#" onclick="active(2); return false;" id="link2">2</a>
		<!-- /TMPL_IF -->
		<!-- TMPL_IF name="3XX" -->
		<a href="#" onclick="active(3); return false;" id="link3">3</a>
		<!-- /TMPL_IF -->
		<!-- TMPL_IF name="4XX" -->
		<a href="#" onclick="active(4); return false;" id="link4">4</a>
		<!-- /TMPL_IF -->
		<!-- TMPL_IF name="5XX" -->
		<a href="#" onclick="active(5); return false;" id="link5">5</a>
		<!-- /TMPL_IF -->
		<!-- TMPL_IF name="6XX" -->
		<a href="#" onclick="active(6); return false;" id="link6">6</a>
		<!-- /TMPL_IF -->
		<!-- TMPL_IF name="7XX" -->
		<a href="#" onclick="active(7); return false;" id="link7">7</a>
		<!-- /TMPL_IF -->
		<!-- TMPL_IF name="8XX" -->
		<a href="#" onclick="active(8); return false;" id="link8">8</a>
		<!-- /TMPL_IF -->
		<!-- TMPL_IF name="9XX" -->
		<a href="#" onclick="active(9); return false;" id="link9">9</a>
		<!-- /TMPL_IF -->
	</div>
	
	<div name="0XX" id="0XX" class="tab" style="visibility:visible">
		<!-- TMPL_IF name="duplicatebiblionumber" -->
			<div class="error">
				<p>是複本嗎 <a href="../MARCdetail.pl?bib=<!-- TMPL_VAR name="duplicatebiblionumber" -->" onclick="openWindow('../MARCdetail.pl?bib=<!-- TMPL_VAR name="duplicatebiblionumber" -->&popup=1', '複製書目資料'; return false;)"><!-- TMPL_VAR name="duplicatetitle" --></a>?</p>
				<p>你必須是 :</p>
				<ul>
					<li>假如 <em>是</em> 複本, <a href="additem.pl?biblionumber=<!-- TMPL_VAR name="duplicatebibid" -->">編輯以存在館藏</a> 的記錄。</li>
					<li>假如不是複本，點選<input type="hidden" value="0" id="confirm_not_duplicate" name="confirm_not_duplicate" /> <a href="#" onclick="confirmnotdup(); return false;">確認不是複本</a></li>
				</ul>
			</div>
		<!-- /TMPL_IF -->
		<!-- TMPL_LOOP NAME="0XX" -->
			<!-- TMPL_IF name="tag" -->
				<p class="MARCtag">
				<!-- TMPL_VAR NAME="tag" -->
				<input type="hidden" name="ind_tag" value="<!-- TMPL_VAR NAME="tag" -->" />
				<input type="text" name="indicator" size="3" maxlength="2" value="<!-- TMPL_VAR NAME="indicator" -->" /> - <!-- TMPL_VAR NAME="tag_lib" -->
				<!-- TMPL_IF name="repeatable" -->
					<a href="javascript:AddField('<!-- TMPL_VAR NAME="tag" -->')">+</a>
				<!-- /TMPL_IF -->
				</p>
			<!-- /TMPL_IF -->
			<!-- TMPL_LOOP NAME="subfield_loop" -->
				<p>
					<label class="labelsubfield">
						<b><!-- TMPL_VAR NAME="subfield" --></b>
						<!-- TMPL_IF name="mandatory" --><b><!-- /TMPL_IF -->
						<!-- TMPL_VAR NAME="marc_lib" -->
						<!-- TMPL_IF name="mandatory" --> *</b><!-- /TMPL_IF -->
					</label>
					<!-- TMPL_VAR NAME="marc_value" -->
					<input type="hidden" name="tag" value="<!-- TMPL_VAR NAME="tag" -->" />
					<input type="hidden" name="subfield" value="<!-- TMPL_VAR NAME="subfield" -->"  size="2" maxlength="1" />
					<input type="hidden" name="mandatory" value="<!-- TMPL_VAR NAME="mandatory" -->" />
					<input type="hidden" name="kohafield" value="<!-- TMPL_VAR NAME="kohafield" -->" />
					<input type="hidden" name="tag_mandatory" value="<!-- TMPL_VAR NAME="tag_mandatory" -->" />
				</p>
			<!-- /tmpl_loop -->
		<!-- /tmpl_loop -->
	</div>
	
	<div name="1XX" id="1XX" class="tab">
		<!-- TMPL_LOOP NAME="1XX" -->
			<!-- TMPL_IF name="tag" -->
				<p class="MARCtag">
				<!-- TMPL_VAR NAME="tag" -->
				<input type="hidden" name="ind_tag" value="<!-- TMPL_VAR NAME="tag" -->" />
				<input type="text" name="indicator" size="3" maxlength="2" value="<!-- TMPL_VAR NAME="indicator" -->" /> - <!-- TMPL_VAR NAME="tag_lib" -->
				<!-- TMPL_IF name="repeatable" -->
					<a href="javascript:AddField('<!-- TMPL_VAR NAME="tag" -->')">+</a>
				<!-- /TMPL_IF -->
				</p>
			<!-- /TMPL_IF -->
			<!-- TMPL_LOOP NAME="subfield_loop" -->
				<p>
					<label class="labelsubfield">
						<b><!-- TMPL_VAR NAME="subfield" --></b>
						<!-- TMPL_IF name="mandatory" --><b><!-- /TMPL_IF -->
						<!-- TMPL_VAR NAME="marc_lib" -->
						<!-- TMPL_IF name="mandatory" --> *</b><!-- /TMPL_IF -->
					</label>
					<!-- TMPL_VAR NAME="marc_value" -->
					<input type="hidden" name="tag" value="<!-- TMPL_VAR NAME="tag" -->" />
					<input type="hidden" name="subfield" value="<!-- TMPL_VAR NAME="subfield" -->" />
					<input type="hidden" name="mandatory" value="<!-- TMPL_VAR NAME="mandatory" -->" />
					<input type="hidden" name="kohafield" value="<!-- TMPL_VAR NAME="kohafield" -->" />
					<input type="hidden" name="tag_mandatory" value="<!-- TMPL_VAR NAME="tag_mandatory" -->" /> 
				</p>
			<!-- /tmpl_loop -->
		<!-- /tmpl_loop -->
	</div>
	
	<div name="2XX" id="2XX" class="tab">
		<!-- TMPL_LOOP NAME="2XX" -->
			<!-- TMPL_IF name="tag" -->
				<p class="MARCtag">
				<!-- TMPL_VAR NAME="tag" -->
				<input type="hidden" name="ind_tag" value="<!-- TMPL_VAR NAME="tag" -->" />
				<input type="text" name="indicator" size="3" maxlength="2" value="<!-- TMPL_VAR NAME="indicator" -->" /> - <!-- TMPL_VAR NAME="tag_lib" -->
				<!-- TMPL_IF name="repeatable" -->
					<a href="javascript:AddField('<!-- TMPL_VAR NAME="tag" -->')">+</a>
				<!-- /TMPL_IF -->
				</p>
			<!-- /TMPL_IF -->
			<!-- TMPL_LOOP NAME="subfield_loop" -->
				<p>
					<label class="labelsubfield">
						<b><!-- TMPL_VAR NAME="subfield" --></b>
						<!-- TMPL_IF name="mandatory" --><b><!-- /TMPL_IF -->
						<!-- TMPL_VAR NAME="marc_lib" -->
						<!-- TMPL_IF name="mandatory" --> *</b><!-- /TMPL_IF -->
					</label>
					<!-- TMPL_VAR NAME="marc_value" -->
					<input type="hidden" name="tag" value="<!-- TMPL_VAR NAME="tag" -->" />
					<input type="hidden" name="subfield" value="<!-- TMPL_VAR NAME="subfield" -->" />
					<input type="hidden" name="mandatory" value="<!-- TMPL_VAR NAME="mandatory" -->" />
					<input type="hidden" name="kohafield" value="<!-- TMPL_VAR NAME="kohafield" -->" />
					<input type="hidden" name="tag_mandatory" value="<!-- TMPL_VAR NAME="tag_mandatory" -->" />
				</p>
			<!-- /tmpl_loop -->
		<!-- /tmpl_loop -->
	</div>
	
	<div name="3XX" id="3XX" class="tab">
		<!-- TMPL_LOOP NAME="3XX" -->
			<!-- TMPL_IF name="tag" -->
				<p class="MARCtag">
				<!-- TMPL_VAR NAME="tag" -->
				<input type="hidden" name="ind_tag" value="<!-- TMPL_VAR NAME="tag" -->" />
				<input type="text" name="indicator" size="3" maxlength="2" value="<!-- TMPL_VAR NAME="indicator" -->" /> - <!-- TMPL_VAR NAME="tag_lib" -->
				<!-- TMPL_IF name="repeatable" -->
					<a href="javascript:AddField('<!-- TMPL_VAR NAME="tag" -->')">+</a>
				<!-- /TMPL_IF -->
				</p>
			<!-- /TMPL_IF -->
			<!-- TMPL_LOOP NAME="subfield_loop" -->
				<p>
					<label class="labelsubfield">
						<b><!-- TMPL_VAR NAME="subfield" --></b>
						<!-- TMPL_IF name="mandatory" --><b><!-- /TMPL_IF -->
						<!-- TMPL_VAR NAME="marc_lib" -->
						<!-- TMPL_IF name="mandatory" --> *</b><!-- /TMPL_IF -->
					</label>
					<!-- TMPL_VAR NAME="marc_value" -->
					<input type="hidden" name="tag" value="<!-- TMPL_VAR NAME="tag" -->" />
					<input type="hidden" name="subfield" value="<!-- TMPL_VAR NAME="subfield" -->" />
					<input type="hidden" name="mandatory" value="<!-- TMPL_VAR NAME="mandatory" -->" />
					<input type="hidden" name="kohafield" value="<!-- TMPL_VAR NAME="kohafield" -->" />
					<input type="hidden" name="tag_mandatory" value="<!-- TMPL_VAR NAME="tag_mandatory" -->" />
				</p>
			<!-- /tmpl_loop -->
		<!-- /tmpl_loop -->
	</div>
	
	<div name="4XX" id="4XX" class="tab">
		<!-- TMPL_LOOP NAME="4XX" -->
			<!-- TMPL_IF name="tag" -->
				<p class="MARCtag">
				<!-- TMPL_VAR NAME="tag" -->
				<input type="hidden" name="ind_tag" value="<!-- TMPL_VAR NAME="tag" -->" />
				<input type="text" name="indicator" size="3" maxlength="2" value="<!-- TMPL_VAR NAME="indicator" -->" /> - <!-- TMPL_VAR NAME="tag_lib" -->
				<!-- TMPL_IF name="repeatable" -->
					<a href="javascript:AddField('<!-- TMPL_VAR NAME="tag" -->')">+</a>
				<!-- /TMPL_IF -->
				</p>
			<!-- /TMPL_IF -->
			<!-- TMPL_LOOP NAME="subfield_loop" -->
				<p>
					<label class="labelsubfield">
						<b><!-- TMPL_VAR NAME="subfield" --></b>
						<!-- TMPL_IF name="mandatory" --><b><!-- /TMPL_IF -->
						<!-- TMPL_VAR NAME="marc_lib" -->
						<!-- TMPL_IF name="mandatory" --> *</b><!-- /TMPL_IF -->
					</label>
					<!-- TMPL_VAR NAME="marc_value" -->
					<input type="hidden" name="tag" value="<!-- TMPL_VAR NAME="tag" -->" />
					<input type="hidden" name="subfield" value="<!-- TMPL_VAR NAME="subfield" -->" />
					<input type="hidden" name="mandatory" value="<!-- TMPL_VAR NAME="mandatory" -->" />
					<input type="hidden" name="kohafield" value="<!-- TMPL_VAR NAME="kohafield" -->" />
					<input type="hidden" name="tag_mandatory" value="<!-- TMPL_VAR NAME="tag_mandatory" -->" />
				</p>
			<!-- /tmpl_loop -->
		<!-- /tmpl_loop -->
	</div>
	
	<div name="5XX" id="5XX" class="tab">
		<!-- TMPL_LOOP NAME="5XX" -->
			<!-- TMPL_IF name="tag" -->
				<p class="MARCtag">
				<!-- TMPL_VAR NAME="tag" -->
				<input type="hidden" name="ind_tag" value="<!-- TMPL_VAR NAME="tag" -->" />
				<input type="text" name="indicator" size="3" maxlength="2" value="<!-- TMPL_VAR NAME="indicator" -->" /> - <!-- TMPL_VAR NAME="tag_lib" -->
				<!-- TMPL_IF name="repeatable" -->
					<a href="javascript:AddField('<!-- TMPL_VAR NAME="tag" -->')">+</a>
				<!-- /TMPL_IF -->
				</p>
			<!-- /TMPL_IF -->
			<!-- TMPL_LOOP NAME="subfield_loop" -->
				<p>
					<label class="labelsubfield">
						<b><!-- TMPL_VAR NAME="subfield" --></b>
						<!-- TMPL_IF name="mandatory" --><b><!-- /TMPL_IF -->
						<!-- TMPL_VAR NAME="marc_lib" -->
						<!-- TMPL_IF name="mandatory" --> *</b><!-- /TMPL_IF -->
					</label>
					<!-- TMPL_VAR NAME="marc_value" -->
					<input type="hidden" name="tag" value="<!-- TMPL_VAR NAME="tag" -->" />
					<input type="hidden" name="subfield" value="<!-- TMPL_VAR NAME="subfield" -->" />
					<input type="hidden" name="mandatory" value="<!-- TMPL_VAR NAME="mandatory" -->" />
					<input type="hidden" name="kohafield" value="<!-- TMPL_VAR NAME="kohafield" -->" />
					<input type="hidden" name="tag_mandatory" value="<!-- TMPL_VAR NAME="tag_mandatory" -->" />
				</p>
			<!-- /tmpl_loop -->
		<!-- /tmpl_loop -->
	</div>
	
	<div name="6XX" id="6XX" class="tab">
		<!-- TMPL_LOOP NAME="6XX" -->
			<!-- TMPL_IF name="tag" -->
				<p class="MARCtag">
				<!-- TMPL_VAR NAME="tag" -->
				<input type="hidden" name="ind_tag" value="<!-- TMPL_VAR NAME="tag" -->" />
				<input type="text" name="indicator" size="3" maxlength="2" value="<!-- TMPL_VAR NAME="indicator" -->" /> - <!-- TMPL_VAR NAME="tag_lib" -->
				<!-- TMPL_IF name="repeatable" -->
					<a href="javascript:AddField('<!-- TMPL_VAR NAME="tag" -->')">+</a>
				<!-- /TMPL_IF -->
				</p>
			<!-- /TMPL_IF -->
			<!-- TMPL_LOOP NAME="subfield_loop" -->
				<p>
					<label class="labelsubfield">
						<b><!-- TMPL_VAR NAME="subfield" --></b>
						<!-- TMPL_IF name="mandatory" --><b><!-- /TMPL_IF -->
						<!-- TMPL_VAR NAME="marc_lib" -->
						<!-- TMPL_IF name="mandatory" --> *</b><!-- /TMPL_IF -->
					</label>
					<!-- TMPL_VAR NAME="marc_value" -->
					<input type="hidden" name="tag" value="<!-- TMPL_VAR NAME="tag" -->" />
					<input type="hidden" name="subfield" value="<!-- TMPL_VAR NAME="subfield" -->" />
					<input type="hidden" name="mandatory" value="<!-- TMPL_VAR NAME="mandatory" -->" />
					<input type="hidden" name="kohafield" value="<!-- TMPL_VAR NAME="kohafield" -->" />
					<input type="hidden" name="tag_mandatory" value="<!-- TMPL_VAR NAME="tag_mandatory" -->" />
				</p>
			<!-- /tmpl_loop -->
		<!-- /tmpl_loop -->
	</div>
	
	<div name="7XX" id="7XX" class="tab">
		<!-- TMPL_LOOP NAME="7XX" -->
			<!-- TMPL_IF name="tag" -->
				<p class="MARCtag">
				<!-- TMPL_VAR NAME="tag" -->
				<input type="hidden" name="ind_tag" value="<!-- TMPL_VAR NAME="tag" -->" />
				<input type="text" name="indicator" size="3" maxlength="2" value="<!-- TMPL_VAR NAME="indicator" -->" /> - <!-- TMPL_VAR NAME="tag_lib" -->
				<!-- TMPL_IF name="repeatable" -->
					<a href="javascript:AddField('<!-- TMPL_VAR NAME="tag" -->')">+</a>
				<!-- /TMPL_IF -->
				</p>
			<!-- /TMPL_IF -->
			<!-- TMPL_LOOP NAME="subfield_loop" -->
				<p>
					<label class="labelsubfield">
						<b><!-- TMPL_VAR NAME="subfield" --></b>
						<!-- TMPL_IF name="mandatory" --><b><!-- /TMPL_IF -->
						<!-- TMPL_VAR NAME="marc_lib" -->
						<!-- TMPL_IF name="mandatory" --> *</b><!-- /TMPL_IF -->
					</label>
					<!-- TMPL_VAR NAME="marc_value" -->
					<input type="hidden" name="tag" value="<!-- TMPL_VAR NAME="tag" -->" />
					<input type="hidden" name="subfield" value="<!-- TMPL_VAR NAME="subfield" -->" />
					<input type="hidden" name="mandatory" value="<!-- TMPL_VAR NAME="mandatory" -->" />
					<input type="hidden" name="kohafield" value="<!-- TMPL_VAR NAME="kohafield" -->" />
					<input type="hidden" name="tag_mandatory" value="<!-- TMPL_VAR NAME="tag_mandatory" -->" />
				</p>
			<!-- /tmpl_loop -->
		<!-- /tmpl_loop -->
	</div>
	
	<div name="8XX" id="8XX" class="tab">
		<!-- TMPL_LOOP NAME="8XX" -->
			<!-- TMPL_IF name="tag" -->
				<p class="MARCtag">
				<!-- TMPL_VAR NAME="tag" -->
				<input type="hidden" name="ind_tag" value="<!-- TMPL_VAR NAME="tag" -->" />
				<input type="text" name="indicator" size="3" maxlength="2" value="<!-- TMPL_VAR NAME="indicator" -->" /> - <!-- TMPL_VAR NAME="tag_lib" -->
				<!-- TMPL_IF name="repeatable" -->
					<a href="javascript:AddField('<!-- TMPL_VAR NAME="tag" -->')">+</a>
				<!-- /TMPL_IF -->
				</p>
			<!-- /TMPL_IF -->
			<!-- TMPL_LOOP NAME="subfield_loop" -->
				<p>
					<label class="labelsubfield">
						<b><!-- TMPL_VAR NAME="subfield" --></b>
						<!-- TMPL_IF name="mandatory" --><b><!-- /TMPL_IF -->
						<!-- TMPL_VAR NAME="marc_lib" -->
						<!-- TMPL_IF name="mandatory" --> *</b><!-- /TMPL_IF -->
					</label>
					<!-- TMPL_VAR NAME="marc_value" -->
					<input type="hidden" name="tag" value="<!-- TMPL_VAR NAME="tag" -->" />
					<input type="hidden" name="subfield" value="<!-- TMPL_VAR NAME="subfield" -->" />
					<input type="hidden" name="mandatory" value="<!-- TMPL_VAR NAME="mandatory" -->" />
					<input type="hidden" name="kohafield" value="<!-- TMPL_VAR NAME="kohafield" -->" />
					<input type="hidden" name="tag_mandatory" value="<!-- TMPL_VAR NAME="tag_mandatory" -->" />
				</p>
			<!-- /tmpl_loop -->
		<!-- /tmpl_loop -->
	</div>
	
	<div name="9XX" id="9XX" class="tab">
		<!-- TMPL_LOOP NAME="9XX" -->
			<!-- TMPL_IF name="tag" -->
				<p class="MARCtag">
				<!-- TMPL_VAR NAME="tag" -->
				<input type="hidden" name="ind_tag" value="<!-- TMPL_VAR NAME="tag" -->" />
				<input type="text" name="indicator" size="3" maxlength="2" value="<!-- TMPL_VAR NAME="indicator" -->" /> - <!-- TMPL_VAR NAME="tag_lib" -->
				<!-- TMPL_IF name="repeatable" -->
					<a href="javascript:AddField('<!-- TMPL_VAR NAME="tag" -->')">+</a>
				<!-- /TMPL_IF -->
				</p>
			<!-- /TMPL_IF -->
			<!-- TMPL_LOOP NAME="subfield_loop" -->
				<p>
					<label class="labelsubfield">
						<b><!-- TMPL_VAR NAME="subfield" --></b>
						<!-- TMPL_IF name="mandatory" --><b><!-- /TMPL_IF -->
						<!-- TMPL_VAR NAME="marc_lib" -->
						<!-- TMPL_IF name="mandatory" --> *</b><!-- /TMPL_IF -->
					</label>
					<!-- TMPL_VAR NAME="marc_value" -->
					<input type="hidden" name="tag" value="<!-- TMPL_VAR NAME="tag" -->" />
					<input type="hidden" name="subfield" value="<!-- TMPL_VAR NAME="subfield" -->" />
					<input type="hidden" name="mandatory" value="<!-- TMPL_VAR NAME="mandatory" -->" />
					<input type="hidden" name="kohafield" value="<!-- TMPL_VAR NAME="kohafield" -->" />
					<input type="hidden" name="tag_mandatory" value="<!-- TMPL_VAR NAME="tag_mandatory" -->" />
				</p>
			<!-- /tmpl_loop -->
		<!-- /tmpl_loop -->
	</div>
	
		<div name="hidden" id="hidden" class="tab">
		<!-- TMPL_LOOP NAME="hidden_loop" -->
				<input type="hidden" name="tag" value="<!-- TMPL_VAR NAME="tag" -->" />
				<input type="hidden" name="subfield" value="<!-- TMPL_VAR NAME="subfield" -->" />
				<input type="hidden" name="mandatory" value="<!-- TMPL_VAR NAME="mandatory" -->" />
				<input type="hidden" name="kohafield" value="<!-- TMPL_VAR NAME="kohafield" -->" />
				<input type="hidden" name="tag_mandatory" value="<!-- TMPL_VAR NAME="tag_mandatory" -->" />
		<!-- /TMPL_LOOP -->	<br clear="both" />
		</div>	<br clear="both" />
		<!-- TMPL_IF name="oldbiblionumtagfield" -->
			<input type="hidden" name="tag" value="<!-- TMPL_VAR NAME="oldbiblionumtagfield" -->" />
			<input type="hidden" name="subfield" value="<!-- TMPL_VAR NAME="oldbiblionumtagsubfield" -->" />
			<input type="hidden" name="field_value" value="<!-- TMPL_VAR NAME="oldbiblionumber" -->" />
			<input type="hidden" name="mandatory" value="0" />
			<input type="hidden" name="kohafield" value="<!-- TMPL_VAR NAME="kohafield" -->" />
			<input type="hidden" name="tag" value="<!-- TMPL_VAR NAME="oldbiblioitemnumtagfield" -->" />
			<input type="hidden" name="subfield" value="<!-- TMPL_VAR NAME="oldbiblioitemnumtagsubfield" -->" />
			<input type="hidden" name="field_value" value="<!-- TMPL_VAR NAME="oldbiblioitemnumber" -->" />
			<input type="hidden" name="mandatory" value="0" />
			<input type="hidden" name="kohafield" value="<!-- TMPL_VAR NAME="kohafield" -->" />
			<input type="hidden" name="tag_mandatory" value="<!-- TMPL_VAR NAME="tag_mandatory" -->" />
		<!-- /TMPL_IF -->
	</form>

	</div>
<script language="JavaScript" type="text/javascript">
function loading(){
	document.getElementById("loading").style.display = "none";
}
function _(s) { return s } // dummy function for gettext
function confirmnotdup(){
	document.getElementById("confirm_not_duplicate").value = 1;
	var checkform =	document.getElementById("f");
	Check(checkform);
}
function active(numlayer)
{
	for (i=0; i <= 9 ; i++ ) {
		ong = i+"XX";
		link = "link"+i;
		if (numlayer==i) {
			with(document){
			document.getElementById(ong).style.visibility="visible";
			document.getElementById(link).style.color="#000066";
			document.getElementById(link).style.backgroundColor="#FFFFCC";
			}
		} else {
			with(document){
			document.getElementById(ong).style.visibility="hidden";
			if (document.getElementById(link)) {
			document.getElementById(link).style.color="#669999";
			document.getElementById(link).style.backgroundColor="#D8DEB8";
			}
			}
		}
	}
}
active(0);
function Check(f) {
	// Scan for nonempty fields
	var field_is_nonempty_p = new Array();
	for (i=0 ; i<f.field_value.length ; i++) {
	    field_is_nonempty_p[f.tag[i].value] = 0;
	}
	for (i=0 ; i<f.field_value.length ; i++) {
	    if (f.field_value[i].value.length != 0) {
		field_is_nonempty_p[f.tag[i].value] += 1;
	    }
	}

	// Scan for missing mandatory subfields
	var total_missing_mandatory_subfields = 0;
	var missing_mandatory_subfields = new Array();
	for (i=0 ; i<f.field_value.length-2 ; i++) {
		if (f.field_value[i].value.length==0 && f.mandatory[i].value==1) {
		    // We should not flag an error unless the tag is also
		    // mandatory, or if something else in the tag is entered

		    if (f.tag_mandatory[i].value == 1 || field_is_nonempty_p[f.tag[i].value]) {
			document.getElementById("error"+i).style.backgroundColor="#FF0000";
			total_missing_mandatory_subfields++;
			if (document.getElementById("error"+i).parentNode.tagName == "B")
			{
				missing_mandatory_subfields.push(document.getElementById("error"+i).innerHTML + " (tab " +  document.getElementById("error"+i).parentNode.parentNode.parentNode.parentNode.id.substr(0,1) + ")");
			}
			else
			{
				missing_mandatory_subfields.push(document.getElementById("error"+i).innerHTML + " (tab " +  document.getElementById("error"+i).parentNode.parentNode.parentNode.id.substr(0,1) + ")");
			}

			}
		} else {
// 			alert("I = "+i);
			document.getElementById("error"+i).style.backgroundColor="#FFFFCC";
		}
	}

	// Scan for missing mandatory tags
	var total_missing_mandatory_tags = 0;
	var seen_mandatory_tag_p = new Array();
	var missing_mandatory_tags = new Array();
	for (i=0 ; i<f.field_value.length ; i++) {
	    var j = f.tag[i].value;
	    if (!field_is_nonempty_p[j] && f.tag_mandatory[i].value == 1) {
		if (seen_mandatory_tag_p[j] != 1) {
		    seen_mandatory_tag_p[j] = 1;
		    total_missing_mandatory_tags++;
 		    if (document.getElementById("error"+i).parentNode.tagName == "B")
		    {
				missing_mandatory_tags.push(document.getElementById("error"+i).innerHTML + " (tab " +  document.getElementById("error"+i).parentNode.parentNode.parentNode.parentNode.id.substr(0,1) + ")");
		    }
		    else
		    {
				missing_mandatory_tags.push(document.getElementById("error"+i).innerHTML + " (tab " +  document.getElementById("error"+i).parentNode.parentNode.parentNode.id.substr(0,1) + ")");
			}
		}
		document.getElementById("error"+i).style.backgroundColor="#ffff00";
	    }
	}

	var total_errors = total_missing_mandatory_tags + total_missing_mandatory_subfields;
	var alertString2;
	if (total_errors!=0) {
		alertString2  = _("表格無法寄送，因為接下來的問題");
		alertString2 += "\n------------------------------------------------------------------------------------\n";
		alertString2 += "\n- "+ total_missing_mandatory_tags +_(" 必要欄位是空的");
		for (i=0; i<missing_mandatory_tags.length; i++)
		{
			alertString2 += "\n--->"+ missing_mandatory_tags[i];
		}
  		alertString2 += "\n- "+ total_missing_mandatory_subfields +_(" 必要欄位是空的 (請看粗體分欄)");
		for (i=0; i<missing_mandatory_subfields.length; i++)
		{
			alertString2 += "\n--->"+ missing_mandatory_subfields[i];
		}
		alert(alertString2);
	} else {
		document.forms['f'].submit();
	}
}
function Dopop(link,i) {
	defaultvalue=document.forms['f'].field_value[i].value;
	newin=window.open(link+"&result="+defaultvalue,"value builder",'width=550,height=550,toolbar=false,scrollbars=yes');
}

function PopupZ3950() {
    var strQuery="";
	var error = 0;
	for (i=0 ; i<document.forms['f'].field_value.length ; i++) {
		if (document.forms['f'].kohafield[i].value == "biblioitems.isbn"){
			if(document.forms['f'].field_value[i].value.length>0) {
		    strQuery += "&isbn="+document.forms['f'].field_value[i].value;
		} else {
			error++;
		}
		}
		if (document.forms['f'].kohafield[i].value == "biblio.title"){
			if(document.forms['f'].field_value[i].value.length>0) {
		    strQuery += "&title="+document.forms['f'].field_value[i].value;
		} else {
			error++;
		}
		}
		if (document.forms['f'].kohafield[i].value == "biblio.author"){
			if(document.forms['f'].field_value[i].value.length>0) {
		    strQuery += "&author="+document.forms['f'].field_value[i].value;
		} else { 
			error++;
		}
		}
		if (document.forms['f'].kohafield[i].value == "biblioitems.issn"){
			if(document.forms['f'].field_value[i].value.length>0) {
		    strQuery += "&issn="+document.forms['f'].field_value[i].value;
		} else {
			error++;
		}
		}
	}
	if(error < 4){
	newin=window.open("../z3950/search.pl?bibid=<!-- TMPL_VAR NAME="bibid" -->"+strQuery,"z3950 查詢",'width=640,height=400,location=yes,toolbar=no,scrollbars=yes');
	} else {
		alert("為了執行 z39.50 查詢，你至少要輸入: \n\n 國際標準書號 (ISBN)\n 國際標準期刊號 (ISSN)\n 題名\n 作者\n");
	}
}

function Changefwk(FwkList) {
  var fwk = FwkList.options[FwkList.selectedIndex].value;
  window.location = "addbiblio.pl?oldbiblionumber=<!--TMPL_VAR Name="oldbiblionumber"-->&frameworkcode="+fwk;
}

function AddField(field) {
	document.forms['f'].op.value = "addfield";
	document.forms['f'].addfield_field.value=field;
	document.f.submit();
}
</script></body>
</html>
