// JavaScript Document
function toDelete(url,str,str1,str2){ 
	if(confirm("是否要刪除該筆資料?")) 
		window.location.href=url+'?'+str+'&'+str1+'&'+str2; 
}

//判斷是否包含中文字
function ischinese(s){
	var ret=false;
	for(var i=0;i<s.length;i++)
	ret = ret || (s.charCodeAt(i)>=10000);
	return ret;
}

function check_item()
{	
	if (check_str(document.login.id.value) == "False") // 檢查帳號欄位
	{
		alert("帳號錯誤");
		return false;
	}
	else if (check_str(document.login.pwd.value) == "False") // 檢查密碼欄位
	{
		alert("密碼錯誤");
		return false;
	}
	else
	{
		document.login.submit();
	}
}

function check_item1()
{	
	if (check_str(document.login1.id.value) == "False") // 檢查帳號欄位
	{
		alert("帳號錯誤");
		return false;
	}
	else if (check_str(document.login1.pwd.value) == "False") // 檢查密碼欄位
	{
		alert("密碼錯誤");
		return false;
	}
	else
	{
		document.login1.submit();
	}
}

// 檢查所輸入的字串只能是英文和數字組成
function check_str(str)
{
	if (str.length == 0)
	{
		return "False";
	}
	else
	{
		for (I = 0; I < str.length; I++)
		{
			if (str.substr(I,1).match(/[a-zA-Z0-9]/))
			{

			}
			else
			{
				return "False";
				break;
			}
		}
	}
}