function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("E-mail不正確!!")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("E-mail不正確!!")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("E-mail不正確!!")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("E-mail不正確!!")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("E-mail不正確!!")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("E-mail不正確!!")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("E-mail不正確!!")
		    return false
		 }

 		 return true					
	}

function ValidateForm(){
	var emailID=document.epaper_frm.email
	
	if ((emailID.value==null)||(emailID.value=="")){
		alert("請填寫你的電子郵件地址")
		emailID.focus()
		return false
	}
	if (echeck(emailID.value)==false){
		emailID.value=""
		emailID.focus()
		return false
	}
	return true
 }
 
function check_contact(){
if (document.contact_frm.d_name.value == "")
{
alert('姓名不能空白！');
return false
}
if (document.contact_frm.d_email.value == "")
{
alert('E-Mail不能空白！');
return false
}
if (echeck(document.contact_frm.d_email.value) == false){
document.contact_frm.d_email.value=""
document.contact_frm.d_email.focus()
return false
}
if (document.contact_frm.d_content.value == "")
{
alert('內容不能空白！');
return false
}
if (document.contact_frm.captcha.value == "")
{
alert('辨識碼不能空白！');
return false
}
return true
}

function check_board(){
if (document.board_frm.b_man.value == "")
{
alert('姓名不能空白！');
return false
}
if (document.board_frm.b_email.value == "")
{
alert('E-Mail不能空白！');
return false
}
if (echeck(document.board_frm.b_email.value) == false){
document.board_frm.b_email.value=""
document.board_frm.b_email.focus()
return false
}
if (document.board_frm.b_content.value == "")
{
alert('內容不能空白！');
return false
}
if (document.board_frm.captcha.value == "")
{
alert('辨識碼不能空白！');
return false
}
return true
}