var	multilang_win = null;
var	thelp_win = null;
function multilang_open(name)
{
	var	url = "";

	if(multilang_win != null)
		multilang_win.close();

	multilang_win = window.open('', 'multilang_window', 'scrollbars=yes,resizable=yes,toolbar=yes,width=800,height=620');

	if(multilang_win != null)
	{
		//multilang_win.location.href = '../../multilang/print_frame.cgi?v_name=' + name;
		multilang_win.location.href = '/JavaClient/jsp/multilang/index.jsp?v_name=' + name;
		multilang_win.focus();
	}
}

function help_win(num) {
	if(thelp_win != null)
		thelp_win.close();

        thelp_win = window.open('', 'help_window', 'scrollbars=yes,resizable=yes,toolbar=no,width=666,height=600');
        //var url = "../html/help.html#help_" + num;
        var url = "http://211.185.62.18/NEL/Search/Pop_Search_help.htm";

	if(thelp_win != null)
	{
		thelp_win.location.href = url;
		thelp_win.focus();
	}
}

function viewer_win() {
        win = window.open('http://211.185.62.18/FILES/VIEWER/ImgViewerSetup.exe', 'viewer_window', 'scrollbars=yes,resizable=yes,toolbar=no,width=200,height=100');

	setTimeout("win.close()", 3000);
}

function startTime(){
        var time= new Date();
        hours= time.getHours();
        mins= time.getMinutes();
        secs= time.getSeconds();
        closeTime=hours*3600+mins*60+secs;
        closeTime+=5;  // This number is how long the window stays open
        Timer();
}

function Timer(){
        var time= new Date();
        hours= time.getHours();
        mins= time.getMinutes();
        secs= time.getSeconds();
        curTime=hours*3600+mins*60+secs
        if (curTime>=closeTime){
                self.close();}
        else{
                window.setTimeout("Timer()",1000)}
}

function Check_Kwstr(mode)
{
	if(mode == 0)
	{
		if(document.search.simple_kwstr.value.length == 0)
		{
			alert("검색어를 입력하시기 바랍니다.");
			return false;
		}
		document.search.kwStr.value = document.search.simple_kwstr.value;
	}
	else
	{
		var field_cnt = document.search.field_cnt.value;
		if(field_cnt == 1)
		{
			if(document.search.kwStr.value == "" )
			{
				alert("검색어를 입력하시기 바랍니다.!!!");
				return false;
			}
		}
		else
		{
			var find = 0;
			for(var i=0; i < document.all.length; i++)
			{
				var field_name = "" + document.all(i).name + "";
				var pos = field_name.indexOf('kwStr');
				if(pos != -1)
				{
					if(document.all(i).value.length != 0)
						find = 1;
				}
			}
			if(find == 0)
			{
				alert("검색어를 입력하시기 바랍니다.");
				return false;
			}
		}
	}
	return true;
}
