function checkform(){

if(document.getElementById("o_name").value=="")
{alert("請填入訂購人姓名");window.document.getElementById("o_name").focus();return false;}

else if(document.getElementById("o_sex").value=="")
{alert("請選擇性別，方便稱呼!");window.document.getElementById("o_sex").focus();return false;}

else if(document.getElementById("o_tel").value=="")
{alert("請填入訂購人聯絡電話");window.document.getElementById("o_tel").focus();return false;}

else if(document.getElementById("o_mail").value==""){
		alert("請填寫電子郵件!\n以便後續通知送貨訊息!");
		window.document.getElementById("o_mail").focus();
		return false;
	}
	if(!checkmail(document.getElementById("o_mail"))){
		window.document.getElementById("o_mail").focus();
		return false;
	}
	

/*else if(document.getElementById("name").value=="")
{alert("請填入姓名");window.document.getElementById("name").focus();return false;}



else if(document.getElementById("tel").value=="")
{alert("請填入聯絡電話");window.document.getElementById("tel").focus();return false;}

else if(document.getElementById("add").value=="")
{alert("請填入收件地址");window.document.getElementById("add").focus();return false;}

else if(document.getElementById("pay").value=="")
{alert("請選擇付款方式");window.document.getElementById("pay").focus();return false;}*/


	return confirm('確定送出?\n\n請再次確認您的收件資訊\n\n發送後即無法再變更收件資料!!\n\n');
}
function checkmail(myEmail) {
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if(filter.test(myEmail.value)){
		return true;
	}
	alert("電子郵件格式不正確");
	return false;
}