<!--
//
function Validate_thai_eng(){
sAuthor = document.InputForm.Name1.value
iAuthorLen = sAuthor.length
sPosition1 = document.InputForm.Position1.value
iPosition1Len = sPosition1.length

iAuthorLen2 = document.InputForm.Name2.value.length
iPosition2Len2 = document.InputForm.Position2.value.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("กรุณากรอกชื่อ-นามสกุล")
document.InputForm.Name1.focus()
return false
}

if(iPosition1Len == 0) {
alert("กรุณากรอกตำแหน่งของท่าน")
document.InputForm.Position1.focus()
return false
}

if(iAuthorLen2 == 0) {
alert("กรุณากรอกชื่อ-นามสกุล\n(ภาษาอังกฤษ)")
document.InputForm.Name2.focus()
return false
}

if(iPosition2Len2 == 0) {
alert("กรุณากรอกตำแหน่งของท่าน\n(ภาษาอังกฤษ)")
document.InputForm.Position2.focus()
return false
}

if(iCompanyLen == 0) {
alert("กรุณากรอกCompany")
document.InputForm.Company.focus()
return false
}

if(iContact1Len == 0) {
alert("กรุณากรอกContact details")
document.InputForm.Contact1.focus()
return false
}

if(iTelephoneLen == 0) {
alert("กรุณากรอกTelephone No.")
document.InputForm.Telephone.focus()
return false
}

if(iEmailLen == 0) {
alert("กรุณากรอก email")
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("กรุณากรอก email")
	document.InputForm.Email.focus()
	return false
}//end if

}//end function

function Validate(){
sAuthor = document.InputForm.Name1.value
iAuthorLen = sAuthor.length
sPosition1 = document.InputForm.Position1.value
iPosition1Len = sPosition1.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("* กรุณากรอกข้อมูล ")
document.InputForm.Name1.focus()
return false

}

if(iPosition1Len == 0) {

alert("* กรุณากรอกข้อมูล ")
document.InputForm.Position1.focus()
return false

}

if(iCompanyLen == 0) {

alert("* กรุณากรอกข้อมูล ")
document.InputForm.Company.focus()
return false
}

if(iContact1Len == 0) {

alert("* กรุณากรอกข้อมูล ")
document.InputForm.Contact1.focus()
return false

}

if(iTelephoneLen == 0) {

alert("* กรุณากรอกข้อมูล ")
document.InputForm.Telephone.focus()
return false

}

if(iEmailLen == 0) {
alert("กรุณากรอก อีเมล์")
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("กรุณากรอก email")
	document.InputForm.Email.focus()
	return false
}//end if
	
}//end function


function Cnum(){
if (event.keyCode < 45 || event.keyCode > 57) 
	{
event.returnValue = false;
}}//

function Pattama500(){
if (document.InputForm.Name1.value.length != 0)
{

		if (document.InputForm.Name1.value.length != 0){
			Num = 750;
			document.InputForm.fee.value = Num;
			}else{
		document.InputForm.fee.value = "";
			}
		if (document.InputForm.Name2.value.length != 0){
			Nvalue = document.InputForm.fee.value;
			document.InputForm.fee.value = 1500;
			}
		if (document.InputForm.Name3.value.length != 0){
			Nvalue = document.InputForm.fee.value;
			document.InputForm.fee.value = 2250;
			}
		if (document.InputForm.Name4.value.length != 0){
			Nvalue = document.InputForm.fee.value;
		document.InputForm.fee.value = 3000;
			}
}//end if begin
else{
	document.InputForm.fee.value = "";
}
}
-->

