function chksearch(){
	if(document.srch.qval.value==""){
		alert("請輸入檢索條件!!");
		document.srch.qval.focus();
		return false;
	}
	
	var qvalVal=document.srch.qval.value;
	var xHttp = new ActiveXObject("Msxml2.XMLHTTP.4.0");
	xHttp.open("post", "ASPX/GetGobalStr/bGetGobalStr.aspx?class=SEARCH&keyword="+qvalVal, false);
	xHttp.send(); // 提出資料申請需求
	
	document.srch.submit();
}
function doLogon()
{
	var winFeature = "center:yes;dialogheight:150px;dialogWidth:300px;resizable:no;";
	var result = window.showModalDialog(AppVirtualRoot + "ASPX/Member/Account/fLogon.aspx", null, winFeature);
	top.location.href = AppVirtualRoot + "ASPX/Portal.aspx";
}
function doKeepSession()
{
	xHttp.open("get", AppVirtualRoot + "ASPX/KeepSession.aspx", true);
	xHttp.send(); 
}
function doLogonCheck(type)
{
	xHttp.open("get", AppVirtualRoot + "ASPX/MEMBER/ACCOUNT/bIsLogon.aspx", false);
	xHttp.send();
	if(xHttp.responseText == "0")
	{
		if(type==1)
		{doIndexLogon();}
		else
		{doLogon();}
		
	} 
	top.location.href = AppVirtualRoot + "ASPX/Portal.aspx";
}
function doIndexLogon()
{

	var winFeature = "center:yes;dialogheight:150px;dialogWidth:300px;resizable:no;";
	var result = window.showModalDialog(AppVirtualRoot + "ASPX/Member/Account/fLogon.aspx", null, winFeature);
//	top.location.href = AppVirtualRoot + "index.htm";
}
function doBBSLogon()
{

	xHttp.open("get", AppVirtualRoot + "ASPX/MEMBER/ACCOUNT/bIsLogon.aspx", false);
	xHttp.send();
	if(xHttp.responseText == "0")
	{
		var winFeature = "center:yes;dialogheight:150px;dialogWidth:300px;resizable:no;";
		var result = window.showModalDialog(AppVirtualRoot + "ASPX/Member/Account/fLogon.aspx", null, winFeature);
	}
	top.location.href = AppVirtualRoot + "ASPX/Portal.aspx?type=bbs";	
 
}

var AppVirtualRoot = "/";
var xHttp = new ActiveXObject("Msxml2.XMLHTTP.4.0");
window.setInterval("doKeepSession()", 25000);


