function checkData(frm){
	var Qname=frm.Qname.value;
	var qtype=frm.qtype.value;
	if(Qname==''){ 
		alert("查詢內容不應為空白!");
		frm.Qname.focus();
		return false;}
	var dicNo;
	var temp=frm.dic;
	for(i=0; i<=temp.length ;i++)
	{if (temp[i].checked)
		{dicNo=temp[i].value;/* alert('dicNoFor='+dicNo) */; break;}
	}
	var str="Query2.asp";
	var features="width=600,height=400,resizable=yes,scrollbars=yes"
		//alert(str+"?Qname="+Qname+"&Qtype="+qtype+"&dic="+dicNo+"&nonFromLink=yes");
	window.open(str+"?Qname="+Qname+"&Qtype="+qtype+"&dic="+dicNo+"&nonFromLink=yes","NewWinID",features);
	return false;
}
function checkDownload(frm)
{ if(frm.setting.checked)
	setCookie('NoShow', 'yes');
  else
	{ /*alert('Not checked');//do nothing!.*/}
}	

function getCurrent()
{	var today,Hours,Minutes,Seconds
	today=new Date()
	Hours=today.getHours()
	Minutes=today.getMinutes()
	Seconds=today.getSeconds()
		return today+Hours+Minutes+Seconds
}
function showDialg()
{
strFeatures="dialogWidth=280px;dialogHeight=280px;"
			+"center=no;help=no;status=no";
window.showModelessDialog("downloadDic.htm","myDialog",strFeatures);
}

		function setCookie(cookie_name, cookie_value, path, domain, secure) {
			var path_ = ((path == null) ? "" : ("; path=" + path));
			var domain_ = ((domain == null) ? "" : ("; domain=" + domain));
			var secure_ = ((secure == true) ? "; secure" : "");
			document.cookie = cookie_name + "=" + escape(cookie_value)
					+ "; expires=Thu, 31-Dec-2020 23:00:00 GMT"
					+ path_ + domain_ + secure_;
		}

		function getCookie(cookie_name) {
			var cookieBeg, cookieEnd;
			var cookieTmp = document.cookie;

			// look for the cookie
			cookieBeg = cookieTmp.indexOf(cookie_name, 0);
			if (cookieBeg < 0) return null;	   // 傳回值 null 代表沒有任何 Cookie
			else cookieBeg += cookie_name.length + 1; //加1是為了那等號

			// get value of the cookie
			cookieEnd = cookieTmp.indexOf(";", cookieBeg);
			if (cookieEnd <0) cookieend = cookieTmp.length;

			// return value of the cookie
			return unescape(cookieTmp.substring(cookieBeg, cookieEnd));
		}

		function delCookie(cookie_name) {
			document.cookie = cookie_name + "=" + "killme; expires=Tue, 01-Aug-2000 00:00:00 GMT";
		}
