<!--
// Global Variables
	var g_Form;
	var g_Text;
    var g_codeHelpWindowName = "CodeHelpWindow" ;
    var g_codeHelpWindowOpened = false ;

function initialize( obj )
{
	var form = obj.form;

	for ( i=0 ; i<form.elements.length; i++ ) {
		if ( form.elements[i].type == "text" ) {
			form.elements[i].value = "";
		}
	}
}

function setAction( obj, sAction )
{
	var form = obj.form;
	form.action=sAction;
}

function setActionType( obj, sAction, sTarget )
{
	var form = obj.form;

	form.ACTION_TYPE.value = sAction;
	form.target = sTarget;
	form.submit();
}

// 2005/12/06 otsuki [200510-087] add start
function setAction_form( form, sAction )
{
	form.ACTION_TYPE.value = sAction;
}
// 2005/12/06 otsuki [200510-087] add start

function submitFormData( obj, sAction, sMethod, sTarget, sActionType, screenId )
{
	var form = obj.form;

	form.action = sAction;
	form.method = sMethod;
	form.target = sTarget;
	form.ACTION_TYPE.value = sActionType;
	form.SCREEN_ID.value = screenId;
	form.submit();
}

function openCodeInput( o_Text, codeType )
{
	g_Text = o_Text ;

    modify = checkCodeType( o_Text, codeType ) ;

	codeHelpWindow = checkCodeHelpWindow() ;
	wn = window.open("./codeInput.jsp?CODE_TYPE="+ codeType +"&MODIFY="+ modify, codeHelpWindow, "directories=no,height=300,location=no,menubar=no,outerHeight=300,outerWidth=300,resizable=no,scrollbars=yes,toolbar=no,width=300");
	wn.focus() ;
}
function openCodeHelp( o_Text, codeType )
{
	g_Text = o_Text ;

    modify = checkCodeType( o_Text, codeType ) ;

	codeHelpWindow = checkCodeHelpWindow() ;
	wn = window.open("../jsp/codeInput.jsp?CODE_TYPE="+ codeType +"&MODIFY="+ modify, codeHelpWindow, "directories=no,height=300,location=no,menubar=no,outerHeight=300,outerWidth=300,resizable=no,scrollbars=yes,toolbar=no,width=300");
	wn.focus() ;
}

function setResult( id )
{
	g_Text.value = id ;
}

function setParameter( obj, nam, val )
{
	FORM = obj.form ;
	count = FORM.elements.length ;
	for ( i = 0 ; i < count ; i++ ) {
		obj_input = FORM.elements[i] ;
		if ( obj_input.name == nam ) {
			obj_input.value = val ;
		}
	}
}

function setTarget( obj, sTarget )
{
	var form = obj.form ;
	form.target = sTarget ;
}

function setTextToParent( sendCode )
{
	try {
		parent.opener.setResult( sendCode );
	} catch ( catchID ) {
	}
	close();
}

function checkEnter( keycode )
{
	return ( keycode != 13 ? true : false ) ;
}

function checkCodeHelpWindow()
{
	if ( !g_codeHelpWindowOpened ) {
		wn = window.open('', 'CodeHelpWindow', 'height=300,width=300' );
		wn.close() ;
		g_codeHelpWindowOpened = true ;
	}
	return "CodeHelpWindow" ;
}

function changeDisable( obj )
{
	for ( i=0 ; i<obj.form.elements.length ; i++ ) {
		if ( obj.form.elements[i].type == "button" ) {
			obj.form.elements[i].disabled = true ;
		}
	}
}

function checkCodeType( obj, str )
{
	ret = '' ;
	if ( obj.name == 'itemvalue0' && str == 'CSIRS' ) {
		ret = 'L1' ;
	}
	if ( obj.name == 'itemvalue1' && str == 'CSIRS' ) {
		ret = 'R1' ;
	}

	return ret ;
}
// 20020730 izumi Start [I0011]
function _numCheck( n )
{
	if( n.match(/^[0-9]*$/) || n.match(/^[0-9]+[\.]?[0-9]+$/) ) {
		return true;
	} else {
		return false;
	}

}
// 20020730 izumi End

function clearAllCheckbox( formName )
{
	objForm = document.forms[formName] ;

	for ( ix=0 ; ix<objForm.elements.length ; ix++ )
	{
		if ( objForm.elements[ix].type == 'checkbox' )
		{
			objForm.elements[ix].checked = false ;
		}
	}
}

function checkAllCheckbox( formName )
{
	objForm = document.forms[formName] ;

	for ( ix=0 ; ix<objForm.elements.length ; ix++ )
	{
		if ( objForm.elements[ix].type == 'checkbox' )
		{
			objForm.elements[ix].checked = true ;
		}
	}
}

function controlAllCheckbox( formName, myName )
{
	objForm = document.forms[formName] ;

	var status = objForm.elements[myName].checked;
	if( status ){
		checkAllCheckbox(formName);
	}else{
		clearAllCheckbox(formName);
	}
}


var oneTime = true ;
function checkOneTime()
{
	if ( oneTime == false )
	{
		return false; 
	}
	oneTime = false ;
	return true ;
}
function clearOneTime()
{
	oneTime = true ;
}

function submitCheck()
{
	return checkOneTime();
}

var chainFlag = false;
function searchCheck() {
	if(chainFlag) {
		return false;
	}
	chainFlag = true;
	setTimeout(chainClear,5000);
	return true;
}

// 2007/11/1 tsunawaki [200710-001] add start
function outputCheck()
{
	return true ;
}
// 2007/11/1 tsunawaki [200710-001] add end

function chainClear() {
	chainFlag = false;
}

var g_checkedValue = 0;
var g_reservedListWindowOpened = false;
var windowID = "";
var rw;

function printList( sScreen, sId, slv, listType){
		var result = false;
// [200804-033] 2008/09/16 k.ochii change start
//		openReservedListWindow('', '/opac/servlet/opac.OpacInspectionRequestListServlet', 'display_new', sScreen, slv, sId, listType, null, null, null, null);
// [200810-025] 2008/12/15 k.ochii change start
//		openReservedListWindow('', '../servlet/opac.OpacInspectionRequestListServlet', 'display_new', sScreen, slv, sId, listType, null, null, null, null);
		openReservedListWindow('', 'opac.OpacInspectionRequestListServlet', 'display_new', sScreen, slv, sId, listType, null, null, null, null);
// [200810-025] 2008/12/15 k.ochii change end
// [200804-033] 2008/09/16 k.ochii change end
		result = true;
		return result;
}
function openReservedListWindow( obj, url, action, screentype, slv,  targetid, listType, x, y, wx, wy ){
//	top.submitClear();

	var vAction = url + "?ACTION_TYPE=" + action;
	vAction     += "&SCREEN_TYPE=" + screentype;
	vAction     += "&SLV=" + slv;
	vAction     += "&TARGET_ID=" + targetid;
	vAction     += "&OUTPUT_LIST_TYPE=" + listType;

	if( x == null || y == null || wx == null || wy == null ){
		wx = 800;
		wy = 480;
		x = (screen.width  - wx) / 2;
		y = (screen.height - wy) / 2;
	}

	reservedListWindow = checkReservedListWindow();
	if ( rw != null ) {
		rw.close();
	}
// [200810-025] 2008/12/15 k.ochii add start
	vAction = setUrlCriticalPath(vAction) ;
// [200810-025] 2008/12/15 k.ochii add end
	rw = window.open(vAction, reservedListWindow, "left="+x+",top="+y+",width="+wx+",height="+wy);
	rw.focus();
}
function checkReservedListWindow(){
	if ( !g_reservedListWindowOpened ) {
		g_reservedListWindowOpened = true ;
	}
	return getReservedListWindowName();
}
function getReservedListWindowName(){
	return "ReservedListWindow_" + windowID;
}
// [200610-052] 2006/11/20 add start k.ochii
function checkIndicationControl( anchor ){
	var notRequest = getControlData("P");

	var notMessage = getControlData("M");
	
	for (var i = 0; i < notRequest.length; i++) {
		var index = anchor.href.indexOf(notRequest[i]);
		if(index>=0){
			return (alert(notMessage[i]) == false);
		}
	}
	return true;
}

function getControlData( objName ){
	var form = document.forms["indicationControl"];
	var iElementMax = 0;
	var index = 0;
	for ( i=0 ; i<form.elements.length; i++ ) {
	  index = form.elements[i].name.indexOf(objName);
	  if(index >= 0){
	    iElementMax ++;
	  }
	}
	var notRequest = new Array(iElementMax);
	var iElementCnt = 0;
	for ( i=0 ; i<form.elements.length; i++ ) {
	  index = form.elements[i].name.indexOf(objName);
	  if(index >= 0){
	    notRequest[iElementCnt] = form.elements[i].value;
	    iElementCnt ++;
	  }
	}
	
	return notRequest;
}
// [200610-052] 2006/11/20 add end k.ochii
// [200610-040] 2006/11/13 add start k.ochii
function checCheckBoxCount( obj, targetid ){
	var vform = obj.form;
	var count = 0;
	var checked_count = 0;
	if( vform == null ){
		return checked_count;
	}
	count = vform.elements.length;
	for(var i = 0 ; i < count ; i++){
		if ( (vform.elements[i].type=="checkbox") && (vform.elements[i].name.indexOf(targetid) == 0) ){
			if (vform.elements[i].checked == true){
				checked_count++;
			}
		}
	}
	return checked_count;
}
function openDetailPrintWindow( obj, url, action, screentype, targetid, outputType, x, y, wx, wy ){

	var vform = obj.form;
	var vSlv = vform.SLV.value;
	var vAction = url + "?ACTION_TYPE=" + action;
	vAction     += "&SCREEN_TYPE=" + screentype;
	vAction     += "&SLV=" + vSlv;
	vAction     += "&OUTPUT_TYPE=" + outputType;

	var count = 0;
	var checked_count = 0;
	var checboc_count = 0;
	var cheValue = "";
	
	count = vform.elements.length;
	for(var i = 0 ; i < count ; i++){
		if ( (vform.elements[i].type=="checkbox") && (vform.elements[i].name.indexOf(targetid) == 0) ){
			if (vform.elements[i].checked == true){
				cheValue += "&" + vform.elements[i].name + "=" + vform.elements[i].value;
				checked_count++;
			}
			checboc_count++;
		}
	}
	vAction     += cheValue;

	if( x == null || y == null || wx == null || wy == null ){
		wx = 800;
		wy = 480;
		x = (screen.width  - wx) / 2;
		y = (screen.height - wy) / 2;
	}

	reservedListWindow = checkReservedListWindow();
	if ( rw != null ) {
		rw.close();
	}

// [200810-025] 2008/12/15 k.ochii add start
	vAction = setUrlCriticalPath(vAction) ;
// [200810-025] 2008/12/15 k.ochii add end
	rw = window.open(vAction, reservedListWindow, "left="+x+",top="+y+",width="+wx+",height="+wy + ",scrollbars=yes");
	rw.focus();
}
// [200610-040] 2006/11/13 add end k.ochii
// [200704-072] 2007/09/04 add k.ochii start
var g_ListWindowOpened = false;
function openListWindow( obj, url, action, screentype, screenId, slv,  targetid, listType, x, y, wx, wy ){
//	top.submitClear();

	var vAction = url + "?ACTION_TYPE=" + action;
	vAction     += "&SCREEN_TYPE=" + screentype;
	vAction     += "&SLV=" + slv;
	vAction     += "&TARGET_ID=" + targetid;
	vAction     += "&OUTPUT_LIST_TYPE=" + listType;

	if( x == null || y == null || wx == null || wy == null ){
		wx = 800;
		wy = 480;
		x = (screen.width  - wx) / 2;
		y = (screen.height - wy) / 2;
	}

	windowName = checkListWindow(screenId);
	if ( rw != null ) {
		rw.close();
	}
// [200810-025] 2008/12/15 k.ochii add start
	vAction = setUrlCriticalPath(vAction) ;
// [200810-025] 2008/12/15 k.ochii add end
	rw = window.open(vAction, windowName, "left="+x+",top="+y+",width="+wx+",height="+wy);
	rw.focus();
}
function checkListWindow(screenId){
	if ( !g_ListWindowOpened ) {
		g_ListWindowOpened = true ;
	}
	return getListWindowName(screenId);
}
function getListWindowName(screenId){
	return  screenId + windowID;
}
// [200704-072] 2007/09/04 add k.ochii end

// 2009/04/15 r.saitou [200904-005] add start
var g_aAwsWindowOpened = false;
function openAwsWindow( obj, url, action, command,  x, y, wx, wy, slv, targetid){
//	top.submitClear();

	var vAction = url + "?ACTION_TYPE=" + action;
	vAction     += "&COMMAND=" + command;
	vAction     += "&SLV=" + slv;
	vAction     += "&TARGET_ID=" + targetid;

	if( x == null || y == null || wx == null || wy == null ){
		wx = 800;
		wy = 480;
		x = (screen.width  - wx) / 2;
		y = (screen.height - wy) / 2;
	}
	windowName = checkAwsWindow(command);
	if ( rw != null ) {
		rw.close();
	}
// [200810-025] 2008/12/15 k.ochii add start
	vAction = setUrlCriticalPath(vAction) ;
// [200810-025] 2008/12/15 k.ochii add end
	rw = window.open(vAction, windowName, "left="+x+",top="+y+",width="+wx+",height="+wy);
	rw.focus();
}
function checkAwsWindow(command){
	if ( !g_aAwsWindowOpened ) {
		g_aAwsWindowOpened = true ;
	}
	return getAwsWindowName(command);
}
function getAwsWindowName(command){
	return  command + windowID;
}
// 2009/04/15 r.saitou [200904-005] add end

// [200804-006] 2008/04/24 k.ochii add start
function openExportRefworksWindow( obj, url, action, screentype, targetid, outputType, x, y, wx, wy ){
	var vform = obj.form;
	var vSlv = vform.SLV.value;
	var vAction = url + "?ACTION_TYPE=" + action;
	vAction     += "&SCREEN_TYPE=" + screentype;
	vAction     += "&SLV=" + vSlv;
	vAction     += "&OUTPUT_TYPE=" + outputType;

	var count = 0;
	var checked_count = 0;
	var checboc_count = 0;
	var cheValue = "";
	
	count = vform.elements.length;
	for(var i = 0 ; i < count ; i++){
		if ( (vform.elements[i].type=="checkbox") && (vform.elements[i].name.indexOf(targetid) == 0) ){
			if (vform.elements[i].checked == true){
				cheValue += "&" + vform.elements[i].name + "=" + vform.elements[i].value;
				checked_count++;
			}
			checboc_count++;
		}
	}
	vAction     += cheValue;


	openExportRefworks(vAction, x, y, wx, wy );
}
function openExportRefworksWindowForm( form, url, action, screentype, targetid, outputType, x, y, wx, wy ){
	var vform = form;
	var vSlv = vform.SLV.value;
	var vAction = url + "?ACTION_TYPE=" + action;
	vAction     += "&SCREEN_TYPE=" + screentype;
	vAction     += "&SLV=" + vSlv;
	vAction     += "&OUTPUT_TYPE=" + outputType;

	var count = 0;
	var checked_count = 0;
	var checboc_count = 0;
	var cheValue = "";
	
	count = vform.elements.length;
	for(var i = 0 ; i < count ; i++){
		if ( (vform.elements[i].type=="checkbox") && (vform.elements[i].name.indexOf(targetid) == 0) ){
			if (vform.elements[i].checked == true){
				cheValue += "&" + vform.elements[i].name + "=" + vform.elements[i].value;
				checked_count++;
			}
			checboc_count++;
		}
	}
	vAction     += cheValue;

	openExportRefworks(vAction, x, y, wx, wy );
}
function openExportRefworks(vAction, x, y, wx, wy ){
	if( x == null || y == null || wx == null || wy == null ){
		wx = 420;
		wy = 130;
		x = (screen.width  - wx) / 2;
		y = (screen.height - wy) / 2;
	}

// [200810-025] 2008/12/15 k.ochii add start
	vAction = setUrlCriticalPath(vAction) ;
// [200810-025] 2008/12/15 k.ochii add end

	window.open(vAction, "_blank", "left="+x+",top="+y+",width="+wx+",height="+wy);
}
// [200804-006] 2008/04/24 k.ochii add end
// [200810-025] 2008/12/15 k.ochii add start
function setUrlCriticalPath(url){
	var urlDocument = document.URL;
	var urlOpen = url;
	var index = -1;
	var indexStart = -1;
	var sessionId = "";
	
	index = urlDocument.lastIndexOf("/");
	if(index == -1){
		return urlOpen;
	}
	
	urlOpen = urlDocument.substring(0,index+1) + urlOpen ;
	
	urlOpen = setUrlJsessionId(urlOpen);
	
	return urlOpen;
}
function setUrlJsessionId(url){
	var urlPath = document.URL;
	var indexStart = -1;
	var indexEnd = -1;
	var sessionStart = ";jsessionid=";
	var sessionEnd = "?";
	var sessionId = "";
	var sessionUrl = url;
	
	indexStart = urlPath.indexOf(sessionStart);
	if(indexStart == -1){
		return sessionUrl;
	}
	
	var urlTmp = urlPath.substring(indexStart) ;
	indexEnd = urlTmp.indexOf(sessionEnd);
	if(indexEnd != -1){
		sessionId = urlTmp.substring(0,indexEnd);
	}else{
		sessionId = urlTmp;
	}
	
	indexStart = sessionUrl.indexOf("?");
	if(indexStart != -1){
		sessionUrl = sessionUrl.substring(0,indexStart) + sessionId + sessionUrl.substring(indexStart);
	}else{
		sessionUrl = sessionUrl + sessionId;
	}

	return sessionUrl;
}
// [200810-025] 2008/12/15 k.ochii add end

// [200804-038] 2008/07/17 k.ochii add start
/* Input Asynchronous */
if (!Asynchronous) {
	var Asynchronous = {};
}
/*-- KeyCodes -----------------------------------------*/
Asynchronous.Key = {
	SPCACE:   32
	,SPCACE_HARF:   32
	,SPCACE_FULL:   12288
};
/*-- Asynchronous.SearchNumberDisplay ------------------------------------*/
Asynchronous.SearchNumberDisplay = function() {
	this.initialize.apply(this, arguments);
};
Asynchronous.SearchNumberDisplay.prototype = {
	initialize: function(input, output, form, url, actionType, message) {
		this.input = this._getElement(input);
		this.output = this._getElement(output);
		this.form = form;
		this.url = url;
		this.errMessage = message;
		this.actionType = actionType;

		// reg event
		this._addEvent(this.input, 'keyup', this._bindEvent(this.keyupEvent));
		this._addEvent(this.input, 'blur', this._bind(this.inputBlur));
		// init
		this.clearOutput();
	},

	inputBlur: function() {
		if (this.timerId) clearTimeout(this.timerId);
		this.timerId = null;
		this.timerIdBlur = setTimeout(this._bind(this.clearOutput), 500);
	},

	clearOutput: function() {
		this.output.innerHTML = '';
		this.output.style.display = 'none';
	},

	keyupEvent: function(event) {
		var varInputData = this.input.value;
		var varCodeAt = varInputData.charCodeAt (varInputData.length - 1)
		if((event.keyCode == Asynchronous.Key.SPCACE || event.charCode == Asynchronous.Key.SPCACE)
			&& (varCodeAt == Asynchronous.Key.SPCACE_HARF || varCodeAt == Asynchronous.Key.SPCACE_FULL) ){
			var varParam = this.getParameter();
			this.searchAjax(varParam);
			return ;
		}
	},

	// Utils
	_getElement: function(element) {
		return (typeof element == 'string') ? document.getElementById(element) : element;
	},
	_addEvent: (window.addEventListener ?
		function(element, type, func) {
			element.addEventListener(type, func, false);
		} :
		function(element, type, func) {
			element.attachEvent('on' + type, func);
		}),
	_bind: function(func) {
		var self = this;
		var args = Array.prototype.slice.call(arguments, 1);
		return function(){ func.apply(self, args); };
	},
	_bindEvent: function(func) {
		var self = this;
		var args = Array.prototype.slice.call(arguments, 1);
		return function(event){ event = event || window.event; func.apply(self, [event].concat(args)); };
	},

	searchAjax: function(paramList) {
		// init
		this.clearOutput();
		new Ajax.Request(this.url,
		{
			method: 'post',
			onSuccess: this._bindEvent(this.getDataSearch),
			onFailure: this._bindEvent(this.showErrMsg),
			onException: this._bindEvent(this.showErrMsg),
			postBody: paramList,
			encoding: ''
		});
	},

	getDataSearch: function(data){
		var response = data.responseXML.getElementsByTagName('data');
		var itemErr = response[0].getElementsByTagName('ERR_MESSAGE');
		var itemErrMessage="";
		if(itemErr[0] != null){
			if(itemErr[0].firstChild != null){
				itemErrMessage = itemErr[0].firstChild.nodeValue;
				alert(itemErrMessage);
				return;
			}
		}

		this.suggestIndexList = [];
		var search = response[0].getElementsByTagName('Search');
		var dataListAll = [];
		for(i = 0; i < search.length; i++){
			var allCnt = search[i].getElementsByTagName('AllCnt');
			var allCntValue = allCnt[0].firstChild.nodeValue;
			dataListAll.push(allCntValue);
		}
		for (var i = 0, length = dataListAll.length; i < length; i++) {
			var element = document.createElement(this.listTagName);
			element.innerHTML = dataListAll[i];
			this.output.appendChild(element);
		}
		this.output.style.display = '';
	},
	showErrMsg: function(){
		alert(this.errMessage);
		return ;
	},
	getParameter : function(){
		var actionTypeBack = $(this.form).ACTION_TYPE.value;
		$(this.form).ACTION_TYPE.value = this.actionType;
		var varParam = Form.serialize(this.form);
		$(this.form).ACTION_TYPE.value = actionTypeBack;
		return varParam;
	}
};
// [200804-038] 2008/07/16 k.ochii add end
// [200810-028] 2008/12/25 add tsunawaki start
function transCharacter( data , mode) {
	work='';
	for (lp=0;lp<data.length;lp++) {
		unicode=data.charCodeAt(lp);
		if ((0xff0f<unicode) && (unicode<0xff1a)) {
			work+=String.fromCharCode(unicode-0xfee0);
		} else if ((0xff20<unicode) && (unicode<0xff3b)) {
			work+=String.fromCharCode(unicode-0xfee0);
		} else if ((0xff40<unicode) && (unicode<0xff5b)) {
			work+=String.fromCharCode(unicode-0xfee0);
		} else {
			work+=String.fromCharCode(unicode);
		}
	}
	if(mode == "0"){
		work=work.toUpperCase();
	}
	else if(mode == "1"){
		work=work.toLowerCase();
	}
	return work;
}
// [200810-028] 2008/12/25 add tsunawaki end
// -->
