<!--
//#BEGIN會員登入======================================
function check_member() {
	obj = document.getElementById('member_id');
	value = obj.value;
	value = trim(value);
	if(value=="") {
		alert("請輸入帳號!!");
		obj.focus();
		return false;
	}


	obj = document.getElementById('member_pass');
	value = obj.value;
	value = trim(value);
	if(value=="") {
		alert("請輸入密碼!!");
		obj.focus();
		return false;
	}
	return true;
}

function check_member2() {
	obj = document.getElementById('member_id2');
	value = obj.value;
	value = trim(value);
	if(value=="") {
		alert("請輸入帳號!!");
		obj.focus();
		return false;
	}


	obj = document.getElementById('member_pass2');
	value = obj.value;
	value = trim(value);
	if(value=="") {
		alert("請輸入密碼!!");
		obj.focus();
		return false;
	}

	obj = document.getElementById('security_code2');
	value = trim(obj.value);
	if(value=="") {
		alert("請輸入認證碼!!");
		obj.focus();
		return false;
	}

	return true;
}
//#END會員登入======================================



//#BEGIN忘記密碼======================================
function check_forget(type) {
	obj = document.getElementById('forget_id');
	value = trim(obj.value);
	if(value.length==0) {
		alert("請輸入帳號");
		obj.focus();
		return false;
	}


	obj = document.getElementById('forget_email');
	value = trim(obj.value);
	if(value.length==0) {
		alert("請輸入信箱");
		obj.focus();
		return false;
	}
/*
	obj = document.getElementById('forget_sid');
	value = trim(obj.value);
	if(value.length==0) {
		alert("請輸入身分證字號");
		obj.focus();
		return false;
	}
*/

	/*obj = document.getElementById('security_code3');
	value = trim(obj.value);
	if(value=="") {
		alert("請輸入認證碼!!");
		obj.focus();
		return false;
	}*/

	alert('確認中資料中請稍候!!');
	document.regstep1.action += "?type="+type;
	document.regstep1.submit();
}
//#END忘記密碼======================================


//#BEGIN聯絡我們======================================
function contact_check() {

	obj = document.getElementById('name');
	value = trim(obj.value);
	if(value=="") {
		alert("請輸入姓名!!");
		obj.focus();
		return false;
	}


	//email
	obj = document.getElementById('email');
	email = trim(obj.value);
	if(email_check(email)==false) {
		obj.focus();
		return false;
	}




	obj = document.getElementById('security_code3');
	value = trim(obj.value);
	if(value=="") {
		alert("請輸入認證碼!!");
		obj.focus();
		return false;
	}


	//message
	obj1 = document.getElementById('content');
	value1 = trim(obj1.value);
	if(value1=="") {
		obj1.focus();
		alert("請輸入內容!!");
		return false;
	}

	document.getElementById('B1').disabled = '';
	return true;
}
//#END聯絡我們======================================






//#BEGIN討論區======================================
function check_forums() {
/*	obj = document.getElementById('post_name');
	value = trim(obj.value);
	if(value=="") {
		alert("請輸入暱稱!!");
		obj.focus();
		return false;
	}
*/
	obj = document.getElementById('post_subject');
	value = trim(obj.value);
	if(value=="") {
		alert("請輸入主題!!");
		obj.focus();
		return false;
	}


	obj = document.getElementById('security_code');
	value = trim(obj.value);
	if(value=="") {
		alert("請輸入認證碼!!");
		obj.focus();
		return false;
	}


	/*obj = document.getElementById('post_content');
	value = trim(obj.value);
	if(value=="") {
		alert("請輸入內容!!");
		obj.focus();
		return false;
	}*/
	document.getElementById('B1').disabled = true;
	return true;
}
//#END討論區======================================




//#BEGIN 訂閱電子報====================================
function check_email() {
	obj = document.getElementById('edm_email');
	email = trim(obj.value);
	if(email_check(email)==false) {
		obj.focus();
		return false;
	}
	window.open('joinus.php?email='+email, 'other', 'toolbar=no, location=no, directories=no, status=no,menubar=no,scrollbars=no,resizable=no,width=350,height=40');
	obj.value = "";
	return false;
}
//#END 訂閱電子報====================================


//#BEGIN 研討會-我要報名====================================
function discuss_sing(type) {
	if(type!="cancel") {
		document.getElementById('discuss_sign').style.display = "";
		document.getElementById('discuss_sign2').style.display = "none";
	}
	else {
		document.getElementById('discuss_sign').style.display = "none";
		document.getElementById('discuss_sign2').style.display = "";
		location.href = '#';
	}
}
//#END 研討會-我要報名====================================



//#BEGIN研討會報名======================================
function check_discuss_sign() {
	obj = document.getElementById('subject_n[1]');
	value = trim(obj.value);
	if(value=="") {
		alert("請輸入姓名!!");
		obj.focus();
		return false;
	}


	obj = document.getElementById('mtitle_n[1]');
	value = trim(obj.value);
	if(value=="") {
		alert("請輸入職稱!!");
		obj.focus();
		return false;
	}



	obj = document.getElementById('phone_n[1]');
	value = trim(obj.value);
	if(value=="") {
		alert("請輸入電話!!");
		obj.focus();
		return false;
	}

	//email
	obj = document.getElementById('email_n[1]');
	email = trim(obj.value);
	if(email_check(email)==false) {
		obj.focus();
		return false;
	}
	for(i=2; i<=document.getElementById('person_num').value;i++) {
		obj = document.getElementById('email_n['+i+']');
		email = trim(obj.value);
		if(email) {
			if(email_check(email)==false) {
				obj.focus();
				return false;
			}
		}
	}

/*
	obj = document.getElementById('num');
	value = trim(obj.value);
	if(value=="") {
		alert("請輸入報名人數!!");
		obj.focus();
		return false;
	}
	else if(!isnum(value)) {
		alert("請輸入正確的報名人數!!");
		obj.focus();
		return false;
	}
	obj2 = document.getElementById('info2');
	value2 = trim(obj2.value);

	if(value>1) {
		if(value2=="") {
			alert("請輸入其他報名者資訊!!");
			obj.focus();
			return false;
		}
		else if(value2.length<10) {
			alert("請輸入詳細的其他報名者資訊!!");
			obj.focus();
			return false;
		}
	}
*/


	obj = document.getElementById('company');
	value = trim(obj.value);
	if(value=="") {
		alert("請輸入公司全銜!!");
		obj.focus();
		return false;
	}


	obj = document.getElementById('company_no');
	value = trim(obj.value);
	if(value!="") {
		//alert("請輸入公司統編!!");
		//obj.focus();
		//return false;
		if(value.length!="8") {
			alert("公司統編為8碼!!");
			obj.focus();
			return false;
		}
		else if(!isnum(value)) {
			alert("請輸入正確的公司統編!!");
			obj.focus();
			return false;
		}
	}


	//address
	obj3 = document.getElementById('address');
	value3 = trim(obj3.value);
	if(value3=="") {
		alert("請輸入公司地址!!");
		obj3.focus();
		return false;
	}



	/*obj = document.getElementById('security_code3');
	value = trim(obj.value);
	if(value=="") {
		alert("請輸入認證碼!!");
		obj.focus();
		return false;
	}*/



	document.getElementById('B1').disabled = '';
	return true;
}
//#END研討會報名======================================


function del_check(para, showtext) {
	if(!showtext) showtext = "刪除";
	r_value = confirm("確定要"+showtext+"??");  //確定要刪除??
	if(r_value==true) {
		location.href = para;
	}
	else return false;
}


//新增報名人數
function add_discuss_peron() {
		table_obj = document.getElementById('table_discuss_data');
		order = parseInt(document.getElementById('person_num').value);
		//若超過十人, 不能再增加
		if(order>8) {
			document.getElementById('show_add_peron').innerHTML = "";
		}
		document.getElementById('person_num').value = order+1;



		//第一行
		order2 = order*5+3; //原本前面有3行
		order = order+1;
		var td_obj_0, td_obj_1, td_obj_2, td_obj_3;
		var tr1 = table_obj.insertRow( order2 );
		td_obj_0=tr1.insertCell(0);
		td_obj_0.setAttribute("id", "sign_td"+order2+"_1");
		td_obj_0.setAttribute("colspan", 4);
		td_obj_0.setAttribute("width", 400);
		td_obj_0.setAttribute("align", "left");
		td_obj_0.setAttribute("class", "line2 word13coffee");
		td_obj_0.innerHTML = "<img src=\"images/arrow3.gif\" width=\"13\" height=\"13\"> 報名資訊"+order;//+" (限同公司)";
		document.getElementById('sign_td'+order2+'_1').className = "line2 word13coffee";


		var tr2 = table_obj.insertRow( order2+1 );
		td_obj_0=tr2.insertCell(0);
		td_obj_1=tr2.insertCell(1);
		td_obj_2=tr2.insertCell(2);
		td_obj_3=tr2.insertCell(3);
		td_obj_0.setAttribute("id", "sign_td"+(order2+1)+"_1");
		td_obj_0.setAttribute("width", "100");
		td_obj_0.setAttribute("class", "left greentd");
		td_obj_0.innerHTML = "<img src=\"images/arrow4.gif\" width=\"10\" height=\"5\"> 姓名";
		document.getElementById('sign_td'+(order2+1)+'_1').className = "left greentd";
		td_obj_1.setAttribute("id", "sign_td"+(order2+1)+"_2");
		td_obj_1.setAttribute("width", "199");
		td_obj_1.setAttribute("class", "td-padding");
		td_obj_1.innerHTML = "<input name=\"subject_n["+order+"]\" id=\"subject_n["+order+"]\" type=\"text\" size=\"25\">";
		document.getElementById('sign_td'+(order2+1)+'_2').className = "td-padding";
		td_obj_2.setAttribute("id", "sign_td"+(order2+1)+"_3");
		td_obj_2.setAttribute("width", "100");
		td_obj_2.setAttribute("class", "left greentd");
		td_obj_2.innerHTML = "<img src=\"images/arrow4.gif\" width=\"10\" height=\"5\"> 職稱";
		document.getElementById('sign_td'+(order2+1)+'_3').className = "left greentd";
		td_obj_3.setAttribute("id", "sign_td"+(order2+1)+"_4");
		td_obj_3.setAttribute("width", "199");
		td_obj_3.setAttribute("class", "td-padding");
		td_obj_3.innerHTML = "<input name=\"mtitle_n["+order+"]\" id=\"mtitle_n["+order+"]\" type=\"text\" size=\"25\">";


		var tr3 = table_obj.insertRow( order2+2 );
		td_obj_0=tr3.insertCell(0);
		td_obj_1=tr3.insertCell(1);
		td_obj_2=tr3.insertCell(2);
		td_obj_3=tr3.insertCell(3);
		td_obj_0.setAttribute("id", "sign_td"+(order2+2)+"_1");
		td_obj_0.setAttribute("width", "100");
		td_obj_0.setAttribute("class", "left greentd");
		td_obj_0.innerHTML = "<img src=\"images/arrow4.gif\" width=\"10\" height=\"5\"> 電話";
		document.getElementById('sign_td'+(order2+2)+'_1').className = "left greentd";
		td_obj_1.setAttribute("id", "sign_td"+(order2+2)+"_2");
		td_obj_1.setAttribute("width", "199");
		td_obj_1.setAttribute("class", "td-padding");
		td_obj_1.innerHTML = "<input name=\"phone_n["+order+"]\" id=\"phone_n["+order+"]\" type=\"text\" size=\"25\">";
		document.getElementById('sign_td'+(order2+2)+'_2').className = "td-padding";
		td_obj_2.setAttribute("id", "sign_td"+(order2+2)+"_3");
		td_obj_2.setAttribute("width", "100");
		td_obj_2.setAttribute("class", "left greentd");
		td_obj_2.innerHTML = "<img src=\"images/arrow4.gif\" width=\"10\" height=\"5\"> 傳真";
		document.getElementById('sign_td'+(order2+2)+'_3').className = "left greentd";
		td_obj_3.setAttribute("id", "sign_td"+(order2+2)+"_4");
		td_obj_3.setAttribute("width", "199");
		td_obj_3.setAttribute("class", "td-padding");
		td_obj_3.innerHTML = "<input name=\"fax_n["+order+"]\" id=\"fax_n["+order+"]\" type=\"text\" size=\"25\">";
		document.getElementById('sign_td'+(order2+2)+'_4').className = "td-padding";

		var tr4 = table_obj.insertRow( order2+3 );
		td_obj_0=tr4.insertCell(0);
		td_obj_1=tr4.insertCell(1);
		td_obj_2=tr4.insertCell(2);
		td_obj_3=tr4.insertCell(3);
		td_obj_0.setAttribute("id", "sign_td"+(order2+3)+"_1");
		td_obj_0.setAttribute("class", "left greentd");
		td_obj_0.innerHTML = "<img src=\"images/arrow4.gif\" width=\"10\" height=\"5\"> 電子信箱";
		document.getElementById('sign_td'+(order2+3)+'_1').className = "left greentd";
		td_obj_1.setAttribute("id", "sign_td"+(order2+3)+"_2");
		td_obj_1.setAttribute("class", "td-padding");
		td_obj_1.innerHTML = "<input name=\"email_n["+order+"]\" id=\"email_n["+order+"]\" type=\"text\" size=\"25\">";
		document.getElementById('sign_td'+(order2+3)+'_2').className = "td-padding";
		td_obj_2.setAttribute("id", "sign_td"+(order2+3)+"_3");
		td_obj_2.setAttribute("class", "left greentd");
		td_obj_2.innerHTML = "<img src=\"images/arrow4.gif\" width=\"10\" height=\"5\"> 飲食";
		document.getElementById('sign_td'+(order2+3)+'_3').className = "left greentd";
		td_obj_3.setAttribute("id", "sign_td"+(order2+3)+"_4");
		td_obj_3.setAttribute("class", "td-padding td-padding word13blue2");
		td_obj_3.innerHTML = "<input type=\"radio\" name=\"food_n["+order+"]\" id=\"food_n["+order+"]\" value=\"1\" checked>免<input type=\"radio\" name=\"food_n["+order+"]\" id=\"food_n["+order+"]\" value=\"2\">葷<input type=\"radio\" name=\"food_n["+order+"]\" id=\"food_n["+order+"]\" value=\"2\">素";
		document.getElementById('sign_td'+(order2+3)+'_4').className = "td-padding td-padding word13blue2";

		var tr5 = table_obj.insertRow( order2+4 );
		td_obj_0=tr5.insertCell(0);
		td_obj_0.setAttribute("colspan", "4");
		td_obj_0.innerHTML = "&nbsp;";
}
//新增報名人數



//刪除圖片
function del_picture(href, picture_name) {
	r_value = confirm("確定要刪除圖片!!\r\n注意! 尚未更新的資料將會遺失!!"); //確定要刪除??
	if(r_value==true) {
		document.regstep1.action = href+"&pname="+picture_name;
		document.regstep1.submit();
	}
	else return false;
}

-->