	var newWind
	var isNav,ns4,isIE,ie4

	if (navigator.appName == "Netscape") {
		isNav = true;
	} else {
		isIE = true;
	}
	
	function popup(urlstr){
		window.open("popup_zh.asp?showpage="+urlstr,"popup", "toolbar=0,height=450,width=450,top=50,left=50,resizable=yes");
	}

	function popup2(urlstr){
		window.open("popup_zh.asp?showpage="+urlstr,"popup", "toolbar=0,height=580,width=798,top=0,left=0,resizable=yes");
	}
	
	function popup3(urlstr,w,h,feather){
		var str;
		if(feather==""){
			str = "toolbar=0,height="+h+",width="+w+",top=0,left=0,resizable=yes";
		}else{
			str = "toolbar=0,height="+h+",width="+w+",top=0,left=0,resizable=yes,"+feather;
		}
		window.open("popup_zh.asp?showpage="+urlstr,"popup", str);
	}
	
	
	function popupchart(urlstr){
		window.open("popup_zh2.asp?showpage="+urlstr,"ecchart", "toolbar=0,height=540,width=790,top=0,left=0,resizable=yes");
	}

	function makeNewWindow(urlstr,winName,features,leftx,topx,widthx, heightx){
		
		
		var tmpFeatures=features.replace(" ","");
		if (tmpFeatures.length>0){
			tmpFeatures = tmpFeatures + ",left="+leftx+",top="+topx+",width="+widthx+",height="+heightx;
		}else{
			tmpFeatures = "left="+leftx+",top="+topx+",width="+widthx+",height="+heightx;
		}
		
		//newWind=window.open("popup_en2.asp?showpage="+urlstr,winName,tmpFeatures);
		

		
		newWind=window.open("",winName,tmpFeatures);
		newWind.resizeTo (parseInt(widthx)+8,parseInt(heightx)+30+8);
		
		
		
		if (urlstr.search("popup_zh")>=0){
			newWind.location=urlstr;		
		}else{
			newWind.location="popup_zh2.asp?showpage="+urlstr;
		}
		
		
		if (newWind != null && newWind.opener == null) {
			newWind.opener = self;
		}
	}

	function getcookie(name) {

		var arg = name + "=";
		var alen = arg.length;
		var clen = document.cookie.length;
		var i = 0;
		while (i < clen) {
			var j = i + alen;
			if (document.cookie.substring(i, j) == arg) {
				offset=j;
				var endstr = document.cookie.indexOf (";", offset);
				if (endstr == -1) endstr = document.cookie.length;
				return unescape (document.cookie.substring(offset, endstr));
			}
			i = document.cookie.indexOf(" ", i) + 1;
			if (i == 0) break;
		}
		return null;
	}
	
	function setCookie(optionname,optionvalue) {

		var expires = new Date();
		expires.setTime(expires.getTime() + 30 * 14 * 24 * 60 * 60 *1000);
		st = optionname +"=" +optionvalue +"; expires=" +expires.toGMTString();
		document.cookie=st;
		
	
	}
		
	function checkLogin(){
	
		var useridstr=document.memberlogin.userid.value;
		var pwdstr=document.memberlogin.pwd.value;
	
		if (useridstr.length<=0 || pwdstr<=0){
			alert("請輸入正確的用戶名稱和密碼。");
			return false;
		}else{
			//document.memberlogin.action="include/checklogin.asp";
			//document.memberlogin.submit();
			return true;
		}
	}
	
	function init(){
	     document.memberlogin.userid.focus();
	}