function openGuestBook(datasource,width,height){ 
	window.open(datasource,'reply',
	'toolbar=no,menubar=no,location=no,status=no,scrollbars=yes,resizable=no,width='+ width +',height='+ height +'\'')
}

function CheckForm(){
	
	if(document.form.name.value=="")
	{
		alert("請輸入您的暱稱！");
		document.form.name.focus();
		return false;
	}
	/* 性別判斷 BEGIN */
	var selected = false
	var len = form.gender.length
	for (var i=0 ; i < len ; i++)
	{
		if(document.form.gender[i].checked){
			selected = true
		}
	}
	if(selected == false)
	{
		alert("請選擇您的性別！");
		return false
	}
	/* 性別判斷 END */
	if(document.form.email.value!=="")
	{

		if(!checkmail(document.form.email))
			{
			document.form.email.focus();
			return false;
			} 
			
			function checkmail(myEmail) {
			if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(myEmail.value)){
			return (true)
			}
			alert("抱歉，您的E-mail格式不正確!")
			return (false)
			}
	}
	if(document.form.content.value=="")
	{
		alert("請輸入留言內容");
		document.form.content.focus();
		return false;
	}
}
