<!--

function IsDigit(cCheck){
	return (('0'<=cCheck) && (cCheck<='9'));
}
function IsAlpha(cCheck){
	return ((('a'<=cCheck) && (cCheck<='z')) || (('A'<=cCheck) && (cCheck<='Z')))
}      
function IsaNull(cCheck){
	return(cCheck != " ")
}  
    
function chkform(){



	if(checkspace(document.form.number.value)) {
		document.form.number.focus();
		alert("請填寫彌月卡款式編號！");
		return false;
	}
	
		if(checkspace(document.form.name.value)) {
		document.form.name.focus();
		alert("請填寫連絡人姓名！");
		return false;
	}

	
	if(checkspace(document.form.tel.value)) {
		document.form.tel.focus();
		alert("請填寫連絡電話！");
		return false;
	}
	else{
		if(!IsDigit(document.form.tel.value)){
			document.form.tel.value='';
			document.form.tel.focus();
			alert("電話號碼格式不對！");
			return false;
		}
		
	}
	
		if(checkspace(document.form.email.value)) {
		document.form.email.focus();
		alert("請填寫e-mail！");
		return false;
	}
	else{
		email=document.form.email.value;
		emailerr=0
		for (i=0; i<email.length; i++){
			if ((email.charAt(i) == "@")  & (email.length > 5)){
				emailerr=emailerr+1
			}
		}
		
		if (emailerr != 1){
			alert("e-mail格式不對！");
			document.form.email.focus();
			return false;
		}
	}
	
	if(checkspace(document.form.add.value)) {
		document.form.add.focus();
		alert("請填寫地址！");
		return false;
	}
	
	
		if(checkspace(document.form.babyname.value)) {
		document.form.babyname.focus();
		alert("請填寫小寶貝名字！");
		return false;
	}
	
		if(checkspace(document.form.birthday.value)) {
		document.form.birthday.focus();
		alert("請填寫小寶貝出生年月日！");
		return false;
	}
	
		if(checkspace(document.form.height.value)) {
		document.form.height.focus();
		alert("請填寫小寶貝身高！");
		return false;
	}
	
		if(checkspace(document.form.weight.value)) {
		document.form.weight.focus();
		alert("請填寫小寶貝體重！");
		return false;
	}
	
		if(checkspace(document.form.father.value)) {
		document.form.father.focus();
		alert("請填寫小寶貝爸比！");
		return false;
	}
			if(checkspace(document.form.mother.value)) {
		document.form.mother.focus();
		alert("請填寫小寶貝媽咪！");
		return false;
	}
	
	 if(checkspace(document.form.cord.value)) {
		document.form.cord.focus();
		alert("請填寫驗證碼！");
		return false;
	}

		if(checkspace(document.form.msg.value)) {
		document.form.msg.focus();
		alert("請填寫留言內容！");
		return false;
	}
			
     
	
	document.form.submit();
	//return true;     
}


function checkspace(checkstr) {
	var str = '';
	for(i = 0; i < checkstr.length; i++) {
	str = str + ' ';
	}
	return (str == checkstr);
}

function regInput(obj, reg, inputStr){
	var docSel	= document.selection.createRange()
	if (docSel.parentElement().tagName != "INPUT")	return false
	oSel = docSel.duplicate()
	oSel.text = ""
	var srcRange	= obj.createTextRange()
	oSel.setEndPoint("StartToStart", srcRange)
	var str = oSel.text + inputStr + srcRange.text.substr(oSel.text.length)
	return reg.test(str)
}
//-->
