function checkEdit(objForm)
{
	/*
	txtg10104 radg10111 radg10112 txtg10102 txtg101031 txtg101032 txtg10113 lstCity lstZone txtg10110
	txtg10107_1 txtg10107_2 txtg10107_3 txtg10106_1 txtg10106_2 txtg10108 selg10114
 	selg10115 selg10116 radg10117 selg10302 radg10303 selg10304 selg10305 
 	*/
	var strAlert = "";
	var strtxtn0102 = objForm.txtg10104.value;
								//姓名
	//性別
	var strGender0Checked = objForm.radg10111[0].checked;
	var strGender1Checked = objForm.radg10111[1].checked;
	//婚姻
	//var strMarriage0Checked = objForm.radg10112[0].checked;
	//var strMarriage1Checked = objForm.radg10112[1].checked;
	//var strtxtg10102 = objForm.txtg10102.value;								//帳號
	var strtxtn6303a = objForm.txtg101031.value;							//密碼
	var strtxtn6303b = objForm.txtg101032.value;							//確認密碼

	var strtxtn0110 = objForm.txtg10113.value;								//E-MAIL	
	//聯絡地址
	var strCity = objForm.lstCity.value;											//縣市
	var strZone = objForm.lstZone.value;											//郵地區號
	var strtxtn0105 = objForm.txtg10110.value;								//地址		

	//辦公電話
	var strtxtn0108A = objForm.txtg10107_1.value;							//區碼
	var strtxtn0108T = objForm.txtg10107_2.value;							//電話
	var strtxtn0108E = objForm.txtg10107_3.value;							//分機
	//住家電話
	var strtxtn0107A = objForm.txtg10106_1.value;							//區碼
	var strtxtn0107T = objForm.txtg10106_2.value;							//電話
	var strtxtn0106 = objForm.txtg10108.value;								//行動電話	
	
	//var strselg10114 = objForm.selg10114.value;								//職業
	//var strselg10115 = objForm.selg10115.value;								//職位
	//var strselg10116 = objForm.selg10116.value;								//教育程度
	
	// 會員姓名
	if (checkEmpty(strtxtn0102) == false)
	{
		strAlert = strAlert + "請輸入：會員姓名\n";
	}
	
	if ((strGender0Checked == false)&&(strGender1Checked == false))
	{
		strAlert = strAlert + "請選擇：性別\n";		
	}
	
	// 生日--------------------------------------------
	var strLSTBeginMonth = objForm.lstBirthMonth.value;
	var strLSTBeginDay = objForm.lstBirthDay.value;
	// 去除0值
	if (strLSTBeginMonth.charAt(0) == '0') strLSTBeginMonth = strLSTBeginMonth.substr(1,1)
	if (strLSTBeginDay.charAt(0) == '0') strLSTBeginDay = strLSTBeginDay.substr(1,1)	
	
	var intLSTBeginYear = parseInt(objForm.lstBirthYear.value);
	var intLSTBeginMonth = parseInt(strLSTBeginMonth);
	var intLSTBeginDay = parseInt(strLSTBeginDay);

	
	// 判斷生日日期的日期格式	
	if ( (intLSTBeginYear != 0) || (intLSTBeginMonth != 0) || (intLSTBeginDay != 0) ) 
	{
	
		if (intLSTBeginYear == 0)
		{
			strAlert = strAlert + "生日的：年份沒選擇\n";
		}
		
		if (intLSTBeginMonth == 0)
		{
			strAlert = strAlert + "生日的：月份沒選擇\n";
		}
		
		if (intLSTBeginDay == 0)
		{
			strAlert = strAlert + "生日的：日期沒選擇\n";
		}
	
		// 判斷2月份的日期格式
		if (intLSTBeginMonth == 2)
		{
			if((intLSTBeginYear%4 == 0)&&(intLSTBeginYear%100 != 0)||(intLSTBeginYear%400 == 0))
			{
				if (intLSTBeginDay > 29)
				{
					strAlert = strAlert + "抱歉！生日 " + (intLSTBeginYear-1911) + "年的" + intLSTBeginMonth + "月沒有" + intLSTBeginDay + "日喔！請重新選擇！\n";
				}
			}
			else
			{
				if (intLSTBeginDay > 28)
				{
					strAlert = strAlert + "抱歉！生日 " + (intLSTBeginYear-1911) + "年的" + intLSTBeginMonth + "月沒有" + intLSTBeginDay + "日喔！請重新選擇！\n";
				}
			}
		}
		
		// 判斷4、6、9、11月份的日期格式
		if ((intLSTBeginMonth == 4)||(intLSTBeginMonth == 6)||(intLSTBeginMonth == 9)||(intLSTBeginMonth == 11))
		{
			if (intLSTBeginDay > 30)
			{
				strAlert = strAlert + "抱歉！生日 " + (intLSTBeginYear-1911) + "年的" + intLSTBeginMonth + "月沒有" + intLSTBeginDay + "日喔！請重新選擇！\n";
			}
		}

	}
	else
	{
		strAlert = strAlert + "請輸入：生日\n";
	}

	// 婚姻
	//if ((strMarriage0Checked == false)&&(strMarriage1Checked == false))
	//{
	//	strAlert = strAlert + "請選擇：婚姻\n";		
	//}
	
	// 身分證字號
	//if (checkEmpty(strtxtg10102) == false)
	//{
	//	strAlert = strAlert + "請輸入：身分證字號\n";
	//}
	//else
	//{
	//	if (checkID(strtxtg10102) == false)
	//	{
	//		strAlert = strAlert + "請注意：身分證字號格式錯誤\n";	
	//	}
	//}
	
	// 確認密碼
	if (checkEmpty(strtxtn6303a) == false)
	{
		strAlert = strAlert + "請輸入：設定密碼\n";
	}
	else
	{
	  if (strtxtn6303a.length < 4 || strtxtn6303a.length >12)
		{
			strAlert = strAlert + "請注意：密碼長度請設定4~12個字元\n";
		}
		else
		{
			if (checkEmpty(strtxtn6303b) == false)
			{
				strAlert = strAlert + "請輸入：密碼確認\n";
			}
			else
			{
				if (strtxtn6303a != strtxtn6303b)
				{
					strAlert = strAlert + "請注意：設定密碼和密碼確認輸入不一致\n";
				}
			}
		}
	}

	// E-Mail
	if (checkEmpty(strtxtn0110) == false)
	{
		strAlert = strAlert + "請輸入：E-Mail\n";
	}
	else
	{
		if (checkEmail(strtxtn0110) == false)
		{
			strAlert = strAlert + "請注意：E-Mail格式錯誤\n";	
		}
	}
	
	// 聯絡地址
	if ((strCity == "請選擇") && (strZone == "請選擇") && (checkEmpty(strtxtn0105) == false)) 
	{
			strAlert = strAlert + "請注意：聯絡地址不完整\n";
	}
	else
	{
			if (strCity == "請選擇")
			{
				strAlert = strAlert + "請選擇：聯絡地址所在縣市\n";
			}
			if (strZone == "請選擇")
			{
				strAlert = strAlert + "請選擇：聯絡地址所在地區\n";
			}
			if (checkEmpty(strtxtn0105) == false)
			{
				strAlert = strAlert + "請注意：聯絡地址輸入不完整\n";	
			}

	}
	
	// 行動電話、辦公電話、住家電話，最少要輸入一個
	if ( (checkEmpty(strtxtn0106) == false) && (checkEmpty(strtxtn0108A) == false) && (checkEmpty(strtxtn0108T) == false) && (checkEmpty(strtxtn0107A) == false) && (checkEmpty(strtxtn0107T) == false) )
	{
		strAlert = strAlert + "請注意：行動電話、辦公電話\n、住家電話，最少要輸入一個\n";
	}
	else
	{
		// 行動電話	
		if (checkMobilePhone(strtxtn0106) == false)
		{
			strAlert = strAlert + "請注意：行動電話輸入錯誤\n";
		}
		
		// 辦公電話
		if ( (checkEmpty(strtxtn0108A) != false) || (checkEmpty(strtxtn0108T) != false) )
		{
			if (checkEmpty(strtxtn0108A) == false) 
			{
				strAlert = strAlert + "請輸入：辦公電話區碼\n";
			}
			else if (checkDAreaCode(strtxtn0108A) == false)
			{
				strAlert = strAlert + "請注意：辦公電話區碼輸入錯誤\n";
			}
			
			if (checkEmpty(strtxtn0108T) == false) 
			{
				strAlert = strAlert + "請輸入：辦公電話\n";
			}
			else if (checkDTelephone(strtxtn0108T) == false)
			{
				strAlert = strAlert + "請注意：辦公電話輸入錯誤\n";
			}

		}	
			
		// 住家電話
		if ( (checkEmpty(strtxtn0107A) != false) || (checkEmpty(strtxtn0107T) != false) )
		{
			if (checkEmpty(strtxtn0107A) == false) 
			{
				strAlert = strAlert + "請輸入：住家電話區碼\n";
			}
			else if (checkDAreaCode(strtxtn0107A) == false)
			{
				strAlert = strAlert + "請注意：住家電話區碼輸入錯誤\n";
			}
			
			if (checkEmpty(strtxtn0107T) == false) 
			{
				strAlert = strAlert + "請輸入：住家電話\n";
			}
			else if (checkDTelephone(strtxtn0107T) == false)
			{
				strAlert = strAlert + "請注意：住家電話輸入錯誤\n";
			}

		}
			
	}
	

	//if (strselg10114 == "請選擇")
	//{
	//	strAlert = strAlert + "請選擇：職業類別\n";
	//}
	
	//if (strselg10115 == "請選擇")
	//{
	//	strAlert = strAlert + "請選擇：職位\n";
	//}

	//if (strselg10116 == "請選擇")
	//{
	//	strAlert = strAlert + "請選擇：教育程度\n";
	//}
	
	//是否有車
	//var strg170Checked = objForm.radg10117[0].checked;
	//var strg171Checked = objForm.radg10117[1].checked;
	
	//if ((strg170Checked == false)&&(strg171Checked == false))
	//{
	//	strAlert = strAlert + "請選擇：目前是否有車\n";		
	//}
	//else
	//{
	
			// 無車
			
			//if (strg171Checked == true)
			//{
			
			//}
			
			
			// 有車
			//if (strg170Checked == true)
			//{
					//var strselg10202 = objForm.selg10202.value;									//廠牌
					//var strselg10203 = objForm.selg10203.value;									//車型
					
					//廠牌
					//if (strselg10202 == '請選擇')
					//{
					//	strAlert = strAlert + "請選擇：廠牌\n";
					//}
					
					// 型號
					//if ((strselg10202 == "Buick") || (strselg10202 == "Cadillac")  || (strselg10202 == "Opel"))
					//{
						//if (strselg10203 == '請選擇')
						//{
						//	strAlert = strAlert + "請選擇：型號\n";
						//}
						
					//}
					
					// 發照日期--------------------------------------------
					//var strLSTMonth = objForm.lstMonth.value;										//發照月
					//var strLSTDay = objForm.lstDay.value;												//發照日
					// 去除0值
					//if (strLSTMonth.charAt(0) == '0') strLSTMonth = strLSTMonth.substr(1,1)
					//if (strLSTDay.charAt(0) == '0') strLSTDay = strLSTDay.substr(1,1)
		
					//var intLSTYear = parseInt(objForm.lstYear.value);			//發照年
					//var intLSTMonth = parseInt(strLSTMonth);
					//var intLSTDay = parseInt(strLSTDay);
		
		
					// 判斷發照日期的日期格式
					//if ( (intLSTYear != 0) || (intLSTMonth != 0) || (intLSTDay != 0) ) 
					//{
					
						//if (intLSTYear == 0)
						//{
							//strAlert = strAlert + "發照日期的：年份沒選擇\n";
						//}
						
						//if (intLSTMonth == 0)
						//{
							//strAlert = strAlert + "發照日期的：月份沒選擇\n";
						//}
						
						//if (intLSTDay == 0)
						//{
							//strAlert = strAlert + "發照日期的：日期沒選擇\n";
						//}
					
						// 判斷2月份的日期格式
						//if (intLSTMonth == 2)
						//{
							//if((intLSTYear%4 == 0)&&(intLSTYear%100 != 0)||(intLSTYear%400 == 0))
							//{
								//if (intLSTDay > 29)
								//{
								//	strAlert = strAlert + "抱歉！發照日期 " + (intLSTYear-1911) + "年的" + intLSTMonth + "月沒有" + intLSTDay + "日喔！請重新選擇！\n";
								//}
							//}
							//else
							//{
								//if (intLSTDay > 28)
								//{
								//	strAlert = strAlert + "抱歉！發照日期 " + (intLSTYear-1911) + "年的" + intLSTMonth + "月沒有" + intLSTDay + "日喔！請重新選擇！\n";
								//}
							//}
						//}
						
						// 判斷4、6、9、11月份的日期格式
						//if ((intLSTMonth == 4)||(intLSTMonth == 6)||(intLSTMonth == 9)||(intLSTMonth == 11))
						//{
							//if (intLSTDay > 30)
							//{
								//strAlert = strAlert + "抱歉！發照日期 " + (intLSTYear-1911) + "年的" + intLSTMonth + "月沒有" + intLSTDay + "日喔！請重新選擇！\n";
							//}
						//}
				
					//}
					//else
					//{
						//strAlert = strAlert + "請輸入：發照日期\n";
					//}
		
			//}
			var strselg10302 = objForm.selg10302.value;
			//var strg103030Checked = objForm.radg10303[0].checked;
			//var strg103031Checked = objForm.radg10303[1].checked;
			//var strselg10304 = objForm.selg10304.value;
			//var strselg10305 = objForm.selg10305.value;
					
			// 購車計劃
			if (checkEmpty(strselg10302) == false) 
			{
				strAlert = strAlert + "請選擇：購車計劃\n";
			}
					
			// 預購車種類
			//if ((strg103030Checked == false)&&(strg103031Checked == false))
			//{
			//	strAlert = strAlert + "請選擇：預購車種類\n";		
			//}
					
			// 預購車廠牌
			//if (strselg10304 == "請選擇")
			//{
			//	strAlert = strAlert + "請選擇：預購車廠牌\n";
			//}

			// 預購車車型
			//if (strselg10305 == "請選擇")
			//{
			//	strAlert = strAlert + "請選擇：預購車車型\n";
			//}
	//}
	

	if (strAlert != "")
	{
		alert(strAlert);
		return false;
	}else{return true;}
	
}		// end checkEdit(objForm)


// 函數名稱：checkID(strID)
// 輸入參數型態：Str strID
// 輸出資料型態：Str checkID(strID)
// 函數功能說明：確認身分證字號是否輸入正確(回傳true:正確;回傳false/value:錯誤)
// 相關處理邏輯：確認身分證字號是否輸入正確
function checkID(strID)
{
	if (strID != "")
	{
		var strID = strID.toUpperCase();  
		var strEnglishString = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
		var strNumberString = '0123456789';
		var aryNumber = new Array(26);
		aryNumber[0] = 1;
		aryNumber[1] = 10;
		aryNumber[2] = 19;
		aryNumber[3] = 28;
		aryNumber[4] = 37;
		aryNumber[5] = 46;
		aryNumber[6] = 55;
		aryNumber[7] = 64;
		aryNumber[8] = 39;
		aryNumber[9] = 73;
		aryNumber[10] = 82;
		aryNumber[11] = 2;
		aryNumber[12] = 11;
		aryNumber[13] = 20;
		aryNumber[14] = 48;
		aryNumber[15] = 29;
		aryNumber[16] = 38;
		aryNumber[17] = 47;
		aryNumber[18] = 56;
		aryNumber[19] = 65;
		aryNumber[20] = 74;
		aryNumber[21] = 83;
		aryNumber[22] = 21;
		aryNumber[23] = 3;
		aryNumber[24] = 12;
		aryNumber[25] = 30;
		
	  // 若輸入長度不等於10則錯誤
		if (strID.length != 10) {return false;}
	  // 若輸入A123456789則錯誤
		if (strID == "A123456789") {return false;}
		// 將輸入的身分證字號寫入陣列中
		var aryID = new Array(10);
		for (var intCount=0; intCount<10; intCount++) {aryID[intCount] = strID.charAt(intCount);}
		// 比對輸入身分證字號的第1個字是否在A~Z的陣列中
		aryID[0] = strEnglishString.indexOf(aryID[0]);
		if (aryID[0] == -1) {return false;}
		// 比對輸入身分證字號的第2個字是否是1或2
		if (aryID[1] !=1 && aryID[1] !=2) {return false;}
		// 取得英文字母對應的陣列
		var intNumber = aryNumber[aryID[0]] ;
		for (var intCount=1; intCount<10; intCount++)
		{
			aryID[intCount] = strNumberString.indexOf(aryID[intCount]);
		 	if (aryID[intCount] == -1)
		    	return false;
			else
		    	intNumber += aryID[intCount] * (9-intCount);
		}
		intNumber += 1 * aryID[9]
		if (intNumber % 10 != 0)
			return false;
		return true;
	}
}

// 函數名稱：checkDAreaCode(strDAreaCode)
// 輸入參數型態：Str strDAreaCode
// 輸出資料型態：Str checkDAreaCode(strDAreaCode)
// 函數功能說明：確認區碼是否輸入正確(回傳true:正確;回傳false/value:錯誤)
// 相關處理邏輯：確認區碼是否輸入正確
function checkDAreaCode(strDAreaCode)
{    
  	if(strDAreaCode.length != 0)
    {
  		if(strDAreaCode.length < 2)
  		{
  			return false;
     	}
     	else
     	{
	  		if(strDAreaCode.charAt(0) != "0")
	  		{
		  		return false;
		  	}
		  	else
		  	{
		  		if(isNaN(strDAreaCode))
	  			{
	  				return false;
	  			}
     	 	}
	    }
    }
}

// 函數名稱：checkDTelephone(strDTelephone)
// 輸入參數型態：Str strDTelephone
// 輸出資料型態：Str checkDTelephone(strDTelephone)
// 函數功能說明：確認電話是否輸入正確(回傳true:正確;回傳false/value:錯誤)
// 相關處理邏輯：確認電話是否輸入正確
function checkDTelephone(strDTelephone)
{    
  	if(strDTelephone.length != 0)
    {
  		if(strDTelephone.length < 7)
  		{
  			return false;
     	}
     	else
     	{
	  		if(strDTelephone.charAt(0) == "0")
	  		{
		  		return false;
		  	}
		  	else
		  	{
		  		if(isNaN(strDTelephone))	
	  			{
	  				return false;
	  			}
     	 	}
	    }
    }
}

// 函數名稱：checkMobilePhone(strMobilePhone)
// 輸入參數型態：Str strMobilePhone
// 輸出資料型態：Str checkMobilePhone(strMobilePhone)
// 函數功能說明：確認行動電話是否輸入正確(回傳true:正確;回傳false/value:錯誤)
// 相關處理邏輯：確認行動電話是否輸入正確
function checkMobilePhone(strMobilePhone)
{    
  	if(strMobilePhone.length != 0)
    {
  		if(strMobilePhone.length < 9)
  		{
  			return false;
     	}
     	else
     	{
	  		if((strMobilePhone.charAt(0) != "0") || (strMobilePhone.charAt(1) != "9"))  		
	  		{
		  		return false;
		  	}
		  	else
		  	{
		  		if(isNaN(strMobilePhone))	
	  			{
	  				return false;
	  			}
     	 	}
	    }
    }
}



// 函數名稱：checkEmpty(strString)
// 輸入參數型態：Str strString
// 輸出資料型態：Str checkEmpty(strString)
// 函數功能說明：確認是否輸入空白鍵(回傳true:正確;回傳false/value:錯誤)
// 相關處理邏輯：若空白鍵的個數和字串的個數相同則錯誤
function checkEmpty(strString)
{
	var intEmptyNo = 0;
	for (var intCount=0 ; intCount<strString.length ; intCount++)
	{
		if (strString.substr(intCount,1) == " ")
		{
			intEmptyNo = intEmptyNo + 1;
		}
		
	}
	
	if (parseInt(strString.length) == parseInt(intEmptyNo))
	{
		return false;
	}
}


// 函數名稱：checkEmail(strEmail)
// 輸入參數型態：Str strEmail
// 輸出資料型態：Str checkEmail(strEmail)
// 函數功能說明：確認Email格式是否輸入正確(回傳true:正確;回傳false/value:錯誤)
// 相關處理邏輯：確認Email格式是否輸入正確
function checkEmail(strEmail)
{
	if (strEmail != "")
	{
		if(strEmail.indexOf('@')==-1||strEmail.indexOf('@')==1||strEmail.indexOf('@')==strEmail.length||strEmail.indexOf('.')==-1||strEmail.indexOf('.')==1||strEmail.indexOf('.')==strEmail.length||strEmail.length-strEmail.indexOf('.')<4||strEmail.indexOf('\'')!=-1)
		{
			return false;
		}
	}
}

// 函數名稱：checkInt(obj)
// 輸入參數型態：Int obj
// 輸出資料型態：Str checkInt(obj)
// 函數功能說明：確認帳號是否輸入正確(回傳true:正確;回傳false/value:錯誤)
// 相關處理邏輯：確認是否為數字
function checkInt(obj)
{
	var re = /^\d+$/;
		
	if (checkEmpty(obj.value) != false)	{
		if (!re.test(obj.value)) {
			alert('只能輸入數字!!');
			obj.value = "";
			obj.select();
			return false;
		}
	}	
	return true;
}


