<!--
function sumtain(){
var	numval=parseInt(arguments[0]);
	with(document.InputForm){
			if(Name1.value!=""){var total=(numval*7/100)+(numval); 
			if(arguments.length==1){
				if(Name2.value!=""){var numsum=parseInt(arguments[0])*2;var total=(numsum*7/100)+(numsum);
					if(Name3.value!=""){var numsum=parseInt(arguments[0])*3;var total=(numsum*7/100)+(numsum);
						if(Name4.value!=""){var numsum=parseInt(arguments[0])*4;var total=(numsum*7/100)+(numsum);}
					}
				}
			}
			}else{total=0;}(total!=0)?fee.value = new NumberFormat(parseInt(total)).toFormatted():fee.value="";
	}
}

function amount10000(){
 if(document.InputForm.Name1.value!=""){
price=10000;
document.InputForm.fee.value=(price*7/100)+price;//รวมแล้ว
document.InputForm.AMOUNT2.value=price*100;//ยังไม่รวมภาษี
 if(document.InputForm.Name2.value!=""){
	num=price*2;
	document.InputForm.fee.value=(num*7/100)+num;
	document.InputForm.AMOUNT2.value=price*100;
	if(document.InputForm.Name3.value!=""){
		num=price*3;
		document.InputForm.fee.value=(num*7/100)+num;
		document.InputForm.AMOUNT2.value=price*100;
			if(document.InputForm.Name4.value!=""){
			num=price*4;
			document.InputForm.fee.value=(num*7/100)+num;
			document.InputForm.AMOUNT2.value=price*100;
		}
	}
 }
}else{
document.InputForm.fee.value="";
}
}//end function




/* ใช้สำหรับงาน phuket*/
function amount_phuket(){
 if(document.InputForm.Name1.value!=""){
num=1800;
ear=200;
if(document.InputForm.radphon[0].checked==true){num=(num)+ear;}else{num=num;}
document.InputForm.fee.value=(num*7/100)+num;//รวมแล้ว
document.InputForm.AMOUNT2.value=num*100;//ยังไม่รวมภาษี
 if(document.InputForm.Name2.value!=""){
	num=1800;
	ear=200;
	ear=ear*2;
	if(document.InputForm.radphon[0].checked==true){num=(num*2)+ear;}else{num=num*2;}
	document.InputForm.fee.value=(num*7/100)+num;
	document.InputForm.AMOUNT2.value=num*100;
	if(document.InputForm.Name3.value!=""){
		num=1800;
		ear=200;
		ear=ear*3;
		if(document.InputForm.radphon[0].checked==true){num=(num*3)+ear;}else{num=num*3;}
		document.InputForm.fee.value=(num*7/100)+num;
		document.InputForm.AMOUNT2.value=num*100;
			if(document.InputForm.Name4.value!=""){
			num=1800;
			ear=200;
			ear=ear*4;
			if(document.InputForm.radphon[0].checked==true){num=(num*4)+ear;}else{num=num*4;}
			document.InputForm.fee.value=(num*7/100)+num;
			document.InputForm.AMOUNT2.value=num*100;
		}
	}
 }
}else{
document.InputForm.fee.value="";
}
}//end function


function Validate(){
sAuthor = document.InputForm.Name1.value
iAuthorLen = sAuthor.length
sPosition = document.InputForm.Position1.value
iPositionLen = sPosition.length
sCompany = document.InputForm.Company.value
iCompanyLen = sCompany.length
sContact1 = document.InputForm.Contact1.value
iContact1Len = sContact1.length
sTelephone = document.InputForm.Telephone.value
iTelephoneLen = sTelephone.length
sEmail = document.InputForm.Email.value
iEmailLen = sEmail.length

if(iAuthorLen == 0) {

alert("Fill in the indicate required fields")
document.InputForm.Name1.focus()
return false

}

if(iPositionLen == 0) {

alert("Fill in the indicate required fields")
document.InputForm.Position1.focus()
return false

}

if(iCompanyLen == 0) {

alert("Fill in the indicate required fields")
document.InputForm.Company.focus()
return false

}

if(iContact1Len == 0) {

alert("Fill in the indicate required fields")
document.InputForm.Contact1.focus()
return false

}

if(iTelephoneLen == 0) {

alert("Fill in the indicate required fields")
document.InputForm.Telephone.focus()
return false

}

if(iEmailLen == 0) {
alert("Fill in the indicate required fields")
document.InputForm.Email.focus()
return false
}

//check to see that at least one char in email is non-blank, @, and .
bOK = false
var bAmp = false
var bPeriod = false

for(var i = 0;i<iEmailLen;i++)
{
if(bOK==false){
if(sEmail.charAt(i) != " " && sEmail.charAt(i) != "." && sEmail.charAt(i) != "@") 
	{
	bOK = true
	if(bAmp== true && bPeriod== true) break
	}
}//end if bok==false

if(sEmail.charAt(i)=="@")
	{
	bAmp = true
	if(bPeriod==true && bOK==true) break
	}

if(sEmail.charAt(i)==".")
	{
	bPeriod = true
	if(bAmp==true && bOK==true) break
	}
} //end for



if(bOK == false || bAmp == false || bPeriod == false) {
	alert("Fill in the indicate required fields")
	document.InputForm.Email.focus()
	return false
}//end if

}//end function

function Cnum(){
if (event.keyCode < 45 || event.keyCode > 57) 
	{
alert("Please insert number only");
event.returnValue = false;
	}}

//-->

