
function openWindow( clocation, target ) {
	wo = window.open( clocation, target, "menubar=no,toolbar=yes,location=yes,directories=no,status=yes,scrollbars=yes,resizable=yes,width=800,height=700");
	wo.focus();
}

function openSchemaWin( url ) {
	var wo;
	wo = window.open( url, "schema_win", "menubar=yes,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,width=600,height=600");
	wo.focus();
}


function doSubmit( dir ) {
        pos = Number( document.subform.position.value );
        sz  = Number( document.subform.resultSize.value );
        if ( (pos * dir ) < 1 ) {
            pos = pos -  sz;
        } else {
            pos = pos + sz;
        }
        document.subform.position.value = pos;
        document.subform.submit();
}



function openSmallWin( url, wName, w, h) {
     var wo;
//   wo = window.open( url, wName, "menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,width="+w+",height="+h);
     wo = window.open( url, wName, 'location=no,directories=no,scrollbars=yes,menubar=yes,toolbar=yes,resizable=yes,width='+w+',height='+h);
     wo.focus();
}

function nullCheck(value) {
	if (value == "") {
		window.alert("Please input anyword.");
		return false;
	}
	return true;
}

function search_checkData(value, size) {
        if (!size.match(/^[1-9][0-9]*/)) {
		window.alert( "[Display size per page]\nPlease input a numerical value." );
		return false;
	}
	return nullCheck(value);
}

function ResetForm() {
	var element = document.getElementById("xquery_form");
	if (element) {
		element.reset();
	}
}

function ResetForm2() {
	var element = document.getElementById("xpath_form");
	if (element) {
		element.reset();
	}
}


function openWin7() {
	openSmallWin('./xpath_list.html', 'xpath', 500,280);
}


