//---------------------검색관련 스크립트---------------------

function spaceTrim(txt){
	if (txt == '')
		return '';
	txt = txt.replace (/\s+/g, ' ');		
	txt = txt.replace (/^\s*|\s*$/g, "");
	return txt;
}

function checkParam (txt) {

	if (txt == '') {
		alert("검색어를 입력하세요.");
		return ;
	}

	if (txt == '*' || txt == '(*)'){
		alert("[" +txt + "]는 검색할 수 없습니다.");
		return ;
	}
	return true;
}

function defaultText(){

	all = document.searchForm;
	all.tempText.focus();
	return false;
}

function totalSearch(){

	sForm = document.searchForm;
	tempTextValue = spaceTrim(sForm.tempText.value);		
	tempTabValue  = 'ALL';		
	tempSearchChk = 'false';													

	if(checkParam(tempTextValue)){	    
		sForm.searchStr.value=tempTextValue;
		sForm.tabSearch.value=tempTabValue;
		sForm.tmpText.value=tempTextValue;
		sForm.reSearchChk.value=tempSearchChk;

		sForm.target = "_blank";
		sForm.action = "/jsp/www/search/searchInfoTotal.jsp"		
		sForm.submit();

	}else{
		defaultText();
	}
}

function notsubmit(){

	sForm = document.searchForm;
	tempTextValue = spaceTrim(sForm.tempText.value);		
	tempTabValue  = 'ALL';		
	tempSearchChk = 'false';	
		
	if(checkParam(tempTextValue)){	    
		sForm.searchStr.value=tempTextValue;
		sForm.tabSearch.value=tempTabValue;
		sForm.tmpText.value=tempTextValue;
		sForm.reSearchChk.value=tempSearchChk;

		sForm.target = "_blank";
		sForm.action = "/jsp/www/search/searchInfoTotal.jsp"	
	
	 }else{
	 	defaultText();
	 }		
}

//---------------------검색관련 스크립트---------------------

function MM_jumpMenu(targ,selObj,restore){
 eval("window.open('"+selObj.options[selObj.selectedIndex].value+"','','')");
 if (restore) selObj.selectedIndex=0;
}
