function SendForm()
{
		
		var f = document.form;

		if(f.Email.value.length <4){
				Warncheck(f.Email," Email  more than 4 Character")
		}else if(!check_email(f.Email.value)){
				Warncheck(f.Email,"  Email ")
		}else if(Trim(f.Password.value)){
				WarnInput(f.Password," Password ")
		}else if(f.Password.value.length < 5){
				WarnInput(f.Password," Password more than 4 Charactrer ")
		}else if(Trim(f.Password2.value)){
				WarnInput(f.Password2," Re - Type Password ")
		}else if(f.Password2.value.length < 5){
				WarnInput(f.Password2," Re - Type Password More Than 4 Character ")
		}else if(f.Password.value != f.Password2.value){
				Warncheck(f.Password2," Password and Re-Type Password ")
				Warncheck(f.Password2," Password and Re-Type Password ")
		}else if(Trim(f.Name.value)){
				WarnInput(f.Name," FirstName ")
		}else if(Trim(f.SurName.value)){
				WarnInput(f.SurName," LastName ")
		}else if(Trim(f.BirthDay.value)){
				Warnselbox(f.BirthDay," BirthDay ")
		}else if(Trim(f.BirthMonth.value)){
				Warnselbox(f.BirthMonth," BirthMonth ")
		}else if(Trim(f.BirthYear.value)){
				Warnselbox(f.BirthYear," BirthYeary ")
		}else if(Trim(f.Nationality.value)){
				WarnInput(f.Nationality," Nationality ")		
		}else if(Trim(f.Religion.value)){
				WarnInput(f.Religion," Religion ")			
		}else if(Trim(f.Occupation.value)){
				WarnInput(f.Occupation," Occupation ")
		}else if(Trim(f.Position.value)){
				WarnInput(f.Position," Position ")			
		}else if(Trim(f.CompanyName.value)){
				WarnInput(f.CompanyName," Company Name ")			
		}else if(Trim(f.Address.value)){
				WarnInput(f.Address,"  Address ")
		}else if(Trim(f.PostCode.value)){
				WarnInput(f.PostCode,"  PostCode ")
		}else if(Trim(f.Tel1.value)){
				WarnInput(f.Tel1,"  Tel1 ")
	//	}else if(Trim(f.Tel2.value)){
	//			WarnInput(f.Tel2,"  Tel2 ")
	//	}else if(Trim(f.Faxa.value)){
	//			WarnInput(f.Faxa,"  Fax ")
	//	}else if(Trim(f.Emer_Name.value)){
	//			WarnInput(f.Emer_Name,"  Emergency Name ")
	//	}else if(Trim(f.Emer_Relate.value)){
	//			WarnInput(f.Emer_Relate,"  RelationShip ")
	//	}else if(Trim(f.Emer_Phone.value)){
	//			WarnInput(f.Emer_Phone,"  Phone ")
	//	}else if(Trim(f.Airling1.value)){
	//			WarnInput(f.Airling1,"  Airlling Club Membership  ")
	//	}else if(Trim(f.Membership1.value)){
	//			WarnInput(f.Membership1,"  Membership No  ")
	//	}else if(f.Email2.value.length <4){
	//			Warncheck(f.Email2," Accept Email  more than 4 Character")
	//	}else if(!check_email(f.Email2.value)){
	//			Warncheck(f.Email2,"  Accept Email ")
		}else{
			f.method = "post"
			f.action = "SdbsResultCode.asp"
			f.submit();
		}
}

function SendFormedit()
{
		var f = document.form;
//		 if(Trim(f.Password.value)){
//				WarnInput(f.Password," Password ")
//		}else if(f.Password.value.length < 5){
//				WarnInput(f.Password," Password more than 4 Charactrer ")
		if(Trim(f.Name.value)){
				WarnInput(f.Name," FirstName ")
		}else if(Trim(f.SurName.value)){
				WarnInput(f.SurName," LastName ")
		}else if(Trim(f.BirthDay.value)){
				Warnselbox(f.BirthDay," BirthDay ")
		}else if(Trim(f.BirthMonth.value)){
				Warnselbox(f.BirthMonth," BirthMonth ")
		}else if(Trim(f.BirthYear.value)){
				Warnselbox(f.BirthYear," BirthYeary ")
		}else if(Trim(f.Nationality.value)){
				WarnInput(f.Nationality," Nationality ")		
		}else if(Trim(f.Religion.value)){
				WarnInput(f.Religion," Religion ")			
		}else if(Trim(f.Occupation.value)){
				WarnInput(f.Occupation," Occupation ")
		}else if(Trim(f.Position.value)){
				WarnInput(f.Position," Position ")			
		}else if(Trim(f.CompanyName.value)){
				WarnInput(f.CompanyName," Company Name ")			
		}else if(Trim(f.Address.value)){
				WarnInput(f.Address,"  Address ")
		}else if(Trim(f.PostCode.value)){
				WarnInput(f.PostCode,"  PostCode ")
		}else if(Trim(f.Tel1.value)){
				WarnInput(f.Tel1,"  Tel1 ")
	//	}else if(Trim(f.Tel2.value)){
	//			WarnInput(f.Tel2,"  Tel2 ")
	//	}else if(Trim(f.Faxa.value)){
	//			WarnInput(f.Faxa,"  Fax ")
	//	}else if(Trim(f.Emer_Name.value)){
	//			WarnInput(f.Emer_Name,"  Emergency Name ")
	//	}else if(Trim(f.Emer_Relate.value)){
	//			WarnInput(f.Emer_Relate,"  RelationShip ")
	//	}else if(Trim(f.Emer_Phone.value)){
	//			WarnInput(f.Emer_Phone,"  Phone ")
	//	}else if(Trim(f.Airling1.value)){
	//			WarnInput(f.Airling1,"  Airlling Club Membership  ")
	//	}else if(Trim(f.Membership1.value)){
	//			WarnInput(f.Membership1,"  Membership No  ")
		}else{
			f.method = "post"
			f.action = "SdbsResultCode.asp"
			f.submit();
		}
}

function chk_changepassword()
{
		var f = document.formchangepasswd;
		if(Trim(f.OldPassword.value)){
				WarnInput(f.OldPassword," Password ")
		}else if(f.Password.value.length < 5){
				WarnInput(f.Password," Password more than 4 Charactrer ")
		}else if(Trim(f.Password2.value)){
				WarnInput(f.Password2," Re - Type Password ")
		}else if(f.Password2.value.length < 5){
				WarnInput(f.Password2," Re - Type Password More Than 4 Character ")
		}else if(f.Password.value != f.Password2.value){
				Warncheck(f.Password2," Password and Re-Type Password ")
		}else{
			f.method = "post";
			f.submit();
		}
}

		function checknumber(val){
		var anum=/(^\d+$)|(^\d+\.\d+$)/
		if (anum.test(val))
		testresult=true
		else{
		testresult=false
		}
		return (testresult)
		}

function check_character(ch){
	var len, digit;
	if(ch == " "){ 
      		 len=0;
    	}else{
    		 len = ch.length;
	}
	for(var i=0 ; i<len ; i++)
	{
		digit = ch.charAt(i)
		if( (digit >= "a" && digit <= "z")  || (digit >="0" && digit <="9") || (digit >="A" && digit <="Z")){
			;	
		}else{
			return false;					
		}		
	}		
	return true;
}	

function CheckUserName()
{
    var NewWin;
    var f = document.form;
    id = f.UserName.value;
    src = "CheckDuplicateUser.asp?UserName="+id+"";
    NewWin = window.open(src,"chkid","toolbar=no,location=no,status=no,scrollbars=auto,top=40,left=40,width=300,height=200,resizable=no");
    NewWin.window.focus();
}




function chk_con()
		{
				f = document.form;
				f.action = "SdbsRegister.asp";
				f.method="post"
				f.submit();
		}
