function checkAll_chk(objChkBox) { 
	bChecked = (objChkBox.checked) ? true : false
	for (i = 0; i < objChkBox.form.elements.length; i++) {
		if (objChkBox.form.elements[i].name == "chk") {
			objChkBox.form.elements[i].checked = bChecked;
		}
	}
}
  
function unCheck(objChkBox) {
	bChecked = (objChkBox.checked) ? true : false
	if (!bChecked) {
		if (objChkBox.form.searchObject.checked != bChecked) {	//searchObject[1]
			objChkBox.form.searchObject.checked = bChecked;
		}
	}
}
 
//¸î°³ÀÇ checkbox°¡ Ã¼Å©µÇ¾î ÀÖ´ÂÁö È®ÀÎÇÑ´Ù.
function checkFieldCount(objChkName) {
	var checkedFieldCount = 0;
	for (var i = 0 ; i <document.form.elements.length; i++) {
		if (document.form.elements[i].name == objChkName) {
        	if (document.form.elements[i].checked) {
				checkedFieldCount++;
			}
		}
	}
	return checkedFieldCount;
}

function firstOnlyCheckAll() {
	bChecked = true;
	if (checkFieldCount("searchObject") == 0 && checkFieldCount("chk") == 0) {
		for (i = 0; i < document.form.elements.length; i++) {
			if (document.form.elements[i].name == "searchObject" || document.form.elements[i].name == "chk") {
				document.form.elements[i].checked = bChecked;
			}
		}
		prevURL = '<%=httpReferer%>';
		if (prevURL != "") { QueryString(); }	//»ó´ÜÇÁ·¹ÀÓ¿¡¼­ °Ë»ö½Ã¿¡¸¸ µ¿ÀÛÇÏ¶ó !!!
	}
}

function checkQuery(query) {
	if (query.charAt(0) == " ") {
		alert("°Ë»ö¾î ¸Ç ¾Õ¿¡ °ø¹éÀÌ ¿Ã ¼ö ¾ø½À´Ï´Ù.");
		document.form.Query.value = "";
		return false;
	} 

	if (
		query.indexOf( '<' ) != -1 ||
		query.indexOf( '>' ) != -1 || 
		query.indexOf( ';' ) != -1 ||
		query.indexOf( '[' ) != -1 || 
		query.indexOf( ']' ) != -1 ||
		query.indexOf( '{' ) != -1 || 
		query.indexOf( '}' ) != -1 ||
		query.indexOf( '`' ) != -1 || 
		query.indexOf( '=' ) != -1 ||
		query.indexOf( '(' ) != -1 || 
		query.indexOf( ')' ) != -1 ||
		query.indexOf( '^' ) != -1 || 
		query.indexOf( '%' ) != -1 ||
		query.indexOf( '#' ) != -1 || 
		query.indexOf( '$' ) != -1 || 
		query.indexOf( '\\' ) != -1 || 
		query.indexOf( '~' ) != -1 ||
		query.indexOf( '\'' ) != -1 || 
		query.indexOf( '\"' ) != -1
	)
	{
		alert( "°Ë»ö¾î¿¡ Æ¯¼ö¹®ÀÚ¸¦ »ç¿ëÇÏ½Ç ¼ö ¾ø½À´Ï´Ù.");
		document.form.Query.value = "";
		return false;
	}
  	return true;
}

function QueryString() {
	if (document.form.Query.value == "") {
		document.form.Query.focus();
		alert("°Ë»ö¾î¸¦ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
		return false;
	}

	if (checkQuery(document.form.Query.value)) {
		// °á°ú³» °Ë»ö
	//	if (document.form.RQR.checked == true) {
			//document.form.Query.value = '<%=Query%>' + " & " + document.form.Query.value;
	//		document.form.PriorQuery.value += '<%=Query%>' + '$'; //2004-12-04 rambar
	//		document.form.PriorField.value += '<%=SearchItem%>' + '$';//2004-12-04 rambar
	//	}
	//	else
	   {
			document.form.PriorQuery.value = '';//2004-12-04 rambar
			document.form.PriorField.value = '';//2004-12-04 rambar
		}
		document.form.submit();

	// Query°¡ °ø¹é, ¸Ç¾Õ½ºÆäÀÌ½º, Æ¯¼ö¹®ÀÚ °¡ Æ÷ÇÔµÇ¸é µ¹Áö¸¶ !!!
	//	loadSearch();
	}
}

function checkEnter() {
	if (event.keyCode==13) {
		QueryString();
		return false;
	}
}

function move0(query, index, loc) {
	document.form.action = "documentsearch0.asp";
	document.form.method = "post";
	document.form.IndexName.value = index;
	document.form.locations.value = loc;
	document.form.submit();
}

function move1(query, index, loc) {
	document.form.action = "documentsearch1.asp";
	document.form.method = "post";
	document.form.IndexName.value = index;
	document.form.locations.value = loc;
	document.form.submit();
}


function move2(query, index, loc) {
	document.form.action = "documentsearch2.asp";
	document.form.method = "post";
	document.form.IndexName.value = index;
	document.form.locations.value = loc;
	document.form.submit();
}

function move3a(query, index, loc) {
	document.form.action = "documentsearch3a.asp";
	document.form.method = "post";
	document.form.IndexName.value = index;
	document.form.locations.value = loc;
	document.form.submit();
}

function move3b(query, index, loc) {
	document.form.action = "documentsearch3b.asp";
	document.form.method = "post";
	document.form.IndexName.value = index;
	document.form.locations.value = loc;
	document.form.submit();
}

function move3c(query, index, loc) {
	document.form.action = "documentsearch3c.asp";
	document.form.method = "post";
	document.form.IndexName.value = index;
	document.form.locations.value = loc;
	document.form.submit();
}

function move3d(query, index, loc) {
	document.form.action = "documentsearch3d.asp";
	document.form.method = "post";
	document.form.IndexName.value = index;
	document.form.locations.value = loc;
	document.form.submit();
}

function move3e(query, index, loc) {
	document.form.action = "documentsearch3e.asp";
	document.form.method = "post";
	document.form.IndexName.value = index;
	document.form.locations.value = loc;
	document.form.submit();
}

function move3f(query, index, loc) {
	document.form.action = "documentsearch3f.asp";
	document.form.method = "post";
	document.form.IndexName.value = index;
	document.form.locations.value = loc;
	document.form.submit();
}

function move3g(query, index, loc) {
	document.form.action = "documentsearch3g.asp";
	document.form.method = "post";
	document.form.IndexName.value = index;
	document.form.locations.value = loc;
	document.form.submit();
}

function move3h(query, index, loc) {
	document.form.action = "documentsearch3h.asp";
	document.form.method = "post";
	document.form.IndexName.value = index;
	document.form.locations.value = loc;
	document.form.submit();
}

function move4(query, index, loc) {
	document.form.action = "documentsearch4.asp";
	document.form.method = "post";
	document.form.IndexName.value = index;
	document.form.locations.value = loc;
	document.form.submit();
}

function move5(query, index, loc) {
	document.form.action = "documentsearch5.asp";
	document.form.method = "post";
	document.form.IndexName.value = index;
	document.form.locations.value = loc;
	document.form.submit();
}

function move6(query, index, loc) {
	document.form.action = "documentsearch6.asp";
	document.form.method = "post";
	document.form.IndexName.value = index;
	document.form.locations.value = loc;
	document.form.submit();
}

function move7(query, index, loc) {
	document.form.action = "documentsearch7.asp";
	document.form.method = "post";
	document.form.IndexName.value = index;
	document.form.locations.value = loc;
	document.form.submit();
}

function move8(query, index, loc) {
	document.form.action = "documentsearch8.asp";
	document.form.method = "post";
	document.form.IndexName.value = index;
	document.form.locations.value = loc;
	document.form.submit();
}

function move9(query, index, loc) {
	document.form.action = "documentsearch9.asp";
	document.form.method = "post";
	document.form.IndexName.value = index;
	document.form.locations.value = loc;
	document.form.submit();
}
function move10(query, index, loc) {
	document.form.action = "documentsearch10.asp";
	document.form.method = "post";
	document.form.IndexName.value = index;
	document.form.locations.value = loc;
	document.form.submit();
}
function move11(query, index, loc) {
	document.form.action = "documentsearch11.asp";
	document.form.method = "post";
	document.form.IndexName.value = index;
	document.form.locations.value = loc;
	document.form.submit();
}
function move12(query, index, loc) {
	document.form.action = "documentsearch12.asp";
	document.form.method = "post";
	document.form.IndexName.value = index;
	document.form.locations.value = loc;
	document.form.submit();
}
function move13(query, index, loc) {
	document.form.action = "documentsearch13.asp";
	document.form.method = "post";
	document.form.IndexName.value = index;
	document.form.locations.value = loc;
	document.form.submit();
}
function move14(query, index, loc) {
	document.form.action = "documentsearch14.asp";
	document.form.method = "post";
	document.form.IndexName.value = index;
	document.form.locations.value = loc;
	document.form.submit();
}
function move16(query, index, loc) {
	document.form.action = "documentsearch16.asp";
	document.form.method = "post";
	document.form.IndexName.value = index;
	document.form.locations.value = loc;
	document.form.submit();
}

function move17(query, index, loc) {
	document.form.action = "documentsearch17.asp";
	document.form.method = "post";
	document.form.IndexName.value = index;
	document.form.locations.value = loc;
	document.form.submit();
}
function move15(query, index, loc) {
	document.form.action = "documentsearch15.asp";
	document.form.method = "post";
	document.form.IndexName.value = index;
	document.form.locations.value = loc;
	document.form.submit();
}

function move19(query, index, loc) {
	document.form.action = "documentsearch19.asp";
	document.form.method = "post";
	document.form.IndexName.value = index;
	document.form.locations.value = loc;
	document.form.submit();
}

function move20(query, index, loc) {
	document.form.action = "documentsearch20.asp";
	document.form.method = "post";
	document.form.IndexName.value = index;
	document.form.locations.value = loc;
	document.form.submit();
}

function move22(query, index, loc) {
	document.form.action = "documentsearch22.asp";
	document.form.method = "post";
	document.form.IndexName.value = index;
	document.form.locations.value = loc;
	document.form.submit();
}

function move23(query, index, loc) {
	document.form.action = "documentsearch23.asp";
	document.form.method = "post";
	document.form.IndexName.value = index;
	document.form.locations.value = loc;
	document.form.submit();
}

function move101(query, index, loc) {
	document.form.action = "documentsearch101.asp";
	document.form.method = "post";
	document.form.IndexName.value = index;
	document.form.locations.value = loc;
	document.form.submit();
}

function move102(query, index, loc) {
	document.form.action = "documentsearch102.asp";
	document.form.method = "post";
	document.form.IndexName.value = index;
	document.form.locations.value = loc;
	document.form.submit();
}

function loadSearch() {
	document.all.hidepage.style.visibility='visible';
}
