// JavaScript Document


function BoatCheck()
	{
                if ((document.fmBooking.ckbStandard.checked)||(document.fmBooking.ckbDeluxe.checked)||(document.fmBooking.ckbStandardAC.checked))
        	{  
			return true; 
			}
		return false;
	}


function FoodCheck()
	{
        if ((document.fmBooking.ckbVeg.checked)||(document.fmBooking.ckbNonVeg.checked))
        	{  
			return true; 
			}
		return false;
	}


function PersonCheck()
	{
		var doc = document.fmBooking
		
		if(doc.txtKids.value=="")
			{
			doc.txtKids.value="0"
			}

		if((doc.txtPerson.value) != (parseInt(doc.txtAdult.value) + parseInt(doc.txtKids.value)))
			{
			 return false;
			}
		return true;
	}
	
    function PersonCheckAll()
	{
		var doc = document.fmBooking
	    
	    if(doc.txtChild.value=="")
		{
			doc.txtChild.value="0"
		}	
		
		if(doc.txtKids.value=="")
			{
			doc.txtKids.value="0"
			}

		if((doc.txtPerson.value) != (parseInt(doc.txtAdult.value) + parseInt(doc.txtKids.value) + parseInt(doc.txtChild.value)))
			{
			 return false;
			}
		return true;
	}

function checkBooking()
	{

//1	
	var doc = document.fmBooking
	
		if (doc.ddlTitle.value=="0")
			{
			alert("Please select your TITLE");
			doc.ddlTitle.focus();
			return false; 
			} 
	
//2	
	var skName = doc.txtName.value;
		if(skName=="")        
			{
			alert("Please enter your NAME")
			doc.txtName.focus();
			return false; 
			}  
	
				var ValidSkChars = "abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ";
				var IsSkString=true;
				var skChar;
				
				for (i = 0; i < skName.length && IsSkString == true; i++) 
					{ 
					skChar = skName.charAt(i); 
					if (ValidSkChars.indexOf(skChar) == -1) 
						{
						alert("Please enter a Valid NAME")
						doc.txtName.value=""
						doc.txtName.focus();
						return false; 
						}
					}
	
//3	
		if(doc.txtAddress.value=="")        
			{
			alert("Please enter your ADDRESS");
			doc.txtAddress.focus();
			return false; 
			} 
	
//4	
	var skCountry = doc.txtCountry.value;
		if(skCountry=="")        
			{
			alert("Please enter your COUNTRY NAME")
			doc.txtCountry.focus();
			return false; 
			}  
	
				var ValidSkChars = "abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ";
				var IsSkString=true;
				var skChar;
				
				for (i = 0; i < skCountry.length && IsSkString == true; i++) 
					{ 
					skChar = skCountry.charAt(i); 
					if (ValidSkChars.indexOf(skChar) == -1) 
						{
						alert("Please enter a Valid COUNTRY NAME")
						doc.txtCountry.value=""
						doc.txtCountry.focus();
						return false; 
						}
					}
	
//5	  
	var skPhone = doc.txtPhone.value;
		if(skPhone=="")
			{
			alert("Please enter your PHONE No. with Code")
			doc.txtPhone.focus();
			return false; 
			} 

				if((skPhone!="")&&(skPhone.length < 10)||(isNaN(skPhone)))
				{
				alert("Invalid Phone No  -  " + skPhone +"\n\nPlease enter your PHONE No. with Code\nand enter Numbers only ");
				doc.txtPhone.value=""
				doc.txtPhone.focus();
				return false; 
				}

//6
		if(doc.txtEmail.value=="")
			{
			alert("Please enter your E-MAIL ID")
			doc.txtEmail.focus();
			return false; 
			} 

			if(doc.txtEmail.value!="")
				{
				apos=doc.txtEmail.value.indexOf("@");
				dotpos=doc.txtEmail.value.indexOf(".");
				lastpos=doc.txtEmail.value.length-1;
				
				if(apos<1||lastpos-apos<5||dotpos<1||lastpos-dotpos<2)
					{
					alert("Please enter a Valid E-MAIL ID")
					doc.txtEmail.focus();
					return false; 
					}	
				}

//7	
		if (doc.ddlDate.value=="0")
			{
			alert("Please select your DATE OF CRUISE");
			doc.ddlDate.focus();
			return false; 
			} 
	
//8	
		if (doc.ddlMonth.value=="0")
			{
			alert("Please select your MONTH OF CRUISE");
			doc.ddlMonth.focus();
			return false; 
			} 
	
//9	
		if (doc.ddlYear.value=="0")
			{
			alert("Please select your YEAR OF CRUISE");
			doc.ddlYear.focus();
			return false; 
			} 
	
//10	
		if(doc.txtPerson.value=="")
			{
			alert("Please enter No. OF PERSON(S)")
			doc.txtPerson.focus();
			return false; 
			} 
			
			if((doc.txtPerson.value!="")&&(isNaN(doc.txtPerson.value)))
				{
				alert("Invalid No. OF PERSON(S)");
				doc.txtPerson.value=""
				doc.txtPerson.focus();
				return false; 
				}
	
//11	
		if(doc.txtAdult.value=="")
			{
			alert("Please enter No. OF ADULT(S)")
			doc.txtAdult.focus();					
			return false; 
			} 
			
			if((doc.txtAdult.value!="")&&(isNaN(doc.txtAdult.value)))
				{
				alert("Invalid No. OF ADULT(S)");
				doc.txtAdult.value=""
				doc.txtAdult.focus();
				return false; 
				}
			
				
//12
			if((doc.txtKids.value!="")&&(isNaN(doc.txtKids.value)))
				{
				alert("Invalid No. OF KIDS");
				doc.txtKids.value=""
				doc.txtKids.focus();
				return false; 
				}
				
//13	
			if(PersonCheckAll()==false)
				{
				alert("No of persons value doesn't mach with others.")
				doc.txtPerson.focus();
				return false;
				}

//14
		if(BoatCheck()==false)
			{
			alert("Please select HOUSE BOAT CATEGORY");
			doc.ckbStandard.focus();
			return false;
			}
	
//15	
		if(FoodCheck()==false)
			{
			alert("Please select FOOD TYPE");
			doc.ckbVeg.focus();
			return false;
			}
	
	}


// ########################################################## 


function checkFeedBack()
	{


	var doc = document.fmFeedBack
	
//1	
	var skName = doc.txtName.value;
		if(skName=="")        
			{
			alert("Please enter your NAME")
			doc.txtName.focus();
			return false; 
			}  
	
				var ValidSkChars = "abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ";
				var IsSkString=true;
				var skChar;
				
				for (i = 0; i < skName.length && IsSkString == true; i++) 
					{ 
					skChar = skName.charAt(i); 
					if (ValidSkChars.indexOf(skChar) == -1) 
						{
						alert("Please enter a Valid NAME")
						doc.txtName.value=""
						doc.txtName.focus();
						return false; 
						}
					}
	
//2
		if(doc.txtEmail.value=="")
			{
			alert("Please enter your E-MAIL ID")
			doc.txtEmail.focus();
			return false; 
			} 

			if(doc.txtEmail.value!="")
				{
				apos=doc.txtEmail.value.indexOf("@");
				dotpos=doc.txtEmail.value.indexOf(".");
				lastpos=doc.txtEmail.value.length-1;
				
				if(apos<1||lastpos-apos<5||dotpos<1||lastpos-dotpos<2)
					{
					alert("Please enter a Valid E-MAIL ID")
					doc.txtEmail.focus();
					return false; 
					}	
				}

//3	  
	var skPhone = doc.txtPhone.value;
		if(skPhone=="")
			{
			alert("Please enter your PHONE No. with Code")
			doc.txtPhone.focus();
			return false; 
			} 

				if((skPhone!="")&&(skPhone.length < 10)||(isNaN(skPhone)))
				{
				alert("Invalid Phone No  -  " + skPhone +"\n\nPlease enter your PHONE No. with Code\nand enter Numbers only ");
				doc.txtPhone.value=""
				doc.txtPhone.focus();
				return false; 
				}

//4	
	var skCountry = doc.txtCountry.value;
		if(skCountry=="")        
			{
			alert("Please enter your COUNTRY NAME")
			doc.txtCountry.focus();
			return false; 
			}  
	
				var ValidSkChars = "abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ";
				var IsSkString=true;
				var skChar;
				
				for (i = 0; i < skCountry.length && IsSkString == true; i++) 
					{ 
					skChar = skCountry.charAt(i); 
					if (ValidSkChars.indexOf(skChar) == -1) 
						{
						alert("Please enter a Valid COUNTRY NAME")
						doc.txtCountry.value=""
						doc.txtCountry.focus();
						return false; 
						}
					}
	
//5
		if(doc.txtMessage.value=="")
			{
			alert("Please enter your MESSAGE")
			doc.txtMessage.focus();
			return false; 
			} 

	}
	
	
	// Start 
	function checkPayment()
	{
		var doc = document.fmBooking

		//1 :  Reference Id 
		
		if(doc.txtRefId.value=="")        
			{
			alert("Please Enter your Reference Id")
			doc.txtRefId.focus();
			return false; 
			}  
	
		//2 :  Title	
		if (doc.ddlTitle.value=="0")
			{
			alert("Please select your TITLE");
			doc.ddlTitle.focus();
			return false; 
			} 
			
		//3 :  Name
		var skName = doc.txtName.value;
		if(skName=="")        
			{
			alert("Please enter your NAME")
			doc.txtName.focus();
			return false; 
			}  
	
			var ValidSkChars = "abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ";
			var IsSkString=true;
			var skChar;
				
			for (i = 0; i < skName.length && IsSkString == true; i++) 
			{ 
				skChar = skName.charAt(i); 
				if (ValidSkChars.indexOf(skChar) == -1) 
				{
					alert("Please enter a Valid NAME")
					doc.txtName.value=""
					doc.txtName.focus();
					return false; 
				}
			}
	
		//4 : Address
		if(doc.txtAddress.value=="")        
			{
			alert("Please enter your ADDRESS");
			doc.txtAddress.focus();
			return false; 
			} 
			
		//5 : City 
		if(doc.txtCity.value=="")        
			{
			alert("Please enter your CITY");
			doc.txtCity.focus();
			return false; 
			} 
			
		//6 : State or Province
		if(doc.txtStateProvince.value=="")        
			{
			alert("Please enter your STATE or PROVINCE");
			doc.txtStateProvince.focus();
			return false; 
			} 
			
		//7 : Zip Code
		if(doc.txtZipcode.value=="")        
			{
			alert("Please enter your ZIP CODE");
			doc.txtZipcode.focus();
			return false; 
			} 
			
		//8 : Country
			if (doc.ddlCountry.value=="0")
			{
			alert("Please select your COUNTRY");
			doc.ddlCountry.focus();
			return false; 
			} 
			
		//9 : Phone Country code
		var skPhone1 = doc.txtPhone1.value;
		if(skPhone1=="")        
			{
			alert("Please enter your COUNTRY CODE");
			doc.txtPhone1.focus();
			return false; 
			} 
			
		if((skPhone1!="")&&(skPhone1.length < 2)||(isNaN(skPhone1)))
			{
				alert("Invalid COUNTRY CODE  -  " + skPhone1 +"\n\nPlease enter your COUNTRY CODE. with Code\nand enter Numbers only ");
				doc.txtPhone1.value="";
				doc.txtPhone1.focus();
				return false; 
			}
			
		
			//10 : Phone Area code
		var skPhone2 = doc.txtPhone2.value;
		if(skPhone2=="")        
			{
			alert("Please enter your AREA CODE");
			doc.txtPhone2.focus();
			return false; 
			} 
			
		if((skPhone2!="")&&(skPhone2.length < 3)||(isNaN(skPhone2)))
			{
				alert("Invalid AREA CODE  -  " + skPhone2 +"\n\nPlease enter your AREA CODE. with Code\nand enter Numbers only ");
				doc.txtPhone2.value="";
				doc.txtPhone2.focus();
				return false; 
			}
			
		//11 : Phone Number
		var skPhone3 = doc.txtPhone3.value;
		if(skPhone3=="")        
			{
			alert("Please enter your TELEPHONE NUMBER");
			doc.txtPhone3.focus();
			return false; 
			} 
			
		if((skPhone3!="")&&(skPhone3.length < 5)||(isNaN(skPhone3)))
			{
				alert("Invalid TELEPHONE NUMBER  -  " + skPhone3 +"\n\nPlease enter your TELEPHONE NUMBER. with Code\nand enter Numbers only ");
				doc.txtPhone3.value="";
				doc.txtPhone3.focus();
				return false; 
			}
/*	var skPhone = doc.txtPhone.value;
		if(skPhone=="")
			{
				alert("Please enter your PHONE No. with Code")
				doc.txtPhone.focus();
				return false; 
			} 

		if((skPhone!="")&&(skPhone.length < 10)||(isNaN(skPhone)))
			{
				alert("Invalid Phone No  -  " + skPhone +"\n\nPlease enter your PHONE No. with Code\nand enter Numbers only ");
				doc.txtPhone.value=""
				doc.txtPhone.focus();
				return false; 
			}
*/
		//12 Email
		if(doc.txtEmail.value=="")
			{
				alert("Please enter your E-MAIL ID")
				doc.txtEmail.focus();
				return false; 
			} 

		if(doc.txtEmail.value!="")
			{
				apos=doc.txtEmail.value.indexOf("@");
				dotpos=doc.txtEmail.value.indexOf(".");
				lastpos=doc.txtEmail.value.length-1;
				
				if(apos<1||lastpos-apos<5||dotpos<1||lastpos-dotpos<2)
					{
						alert("Please enter a Valid E-MAIL ID")
						doc.txtEmail.focus();
						return false; 
					}	
			}
			
		//13 : Amount
			if(doc.txtAmount.value=="")
			{
				alert("Please enter AMOUNT)")
				doc.txtAmount.focus();
				return false; 
			} 
			
			if((doc.txtAmount.value!="")&&(isNaN(doc.txtAmount.value)))
			{
				alert("Invalid AMOUNT");
				doc.txtAmount.value=""
				doc.txtAmount.focus();
				return false; 
			}
		
		//14 Payment Option
		var mx=0;
		for(var x=0;x <doc.rblPayment.length;x++)
		{
			if(mx==0)
			{
				if(doc.rblPayment[x].checked)
					mx=1;			
			}
		}
		
		if(mx==0)
		{
				alert("Please Select The Payment Option");
				doc.rblPayment[0].focus();
				return false; 
			}

	 }
	 //End payment
	 
	 
// JET Packages START 
function checkPackage()
{
	var doc = document.fmBooking;
	
	//1
	if (doc.ddlTitle.value=="0")
	{
		alert("Please select your TITLE");
		doc.ddlTitle.focus();
		return false; 
	} 
	
	//2	
	var skName = doc.txtName.value;
	if(skName=="")        
	{
		alert("Please enter your NAME");
		doc.txtName.focus();
		return false; 
	}  
	
	var ValidSkChars = "abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ";
	var IsSkString=true;
	var skChar;
				
	for (i = 0; i < skName.length && IsSkString == true; i++) 
	{ 
		skChar = skName.charAt(i); 
		if (ValidSkChars.indexOf(skChar) == -1) 
		{
			alert("Please enter a Valid NAME");
			doc.txtName.value="";
			doc.txtName.focus();
			return false; 
		}
	}
	
	//3	
	if(doc.txtAddress.value=="")        
		{
			alert("Please enter your ADDRESS");
			doc.txtAddress.focus();
			return false; 
		} 
	
	//4	
	var skCountry = doc.txtCountry.value;
	if(skCountry=="")        
	{
		alert("Please enter your COUNTRY NAME")
		doc.txtCountry.focus();
		return false; 
	}  
	
	var ValidSkChars = "abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ";
	var IsSkString=true;
	var skChar;
				
	for (i = 0; i < skCountry.length && IsSkString == true; i++) 
	{ 
		skChar = skCountry.charAt(i); 
		if (ValidSkChars.indexOf(skChar) == -1) 
		{
			alert("Please enter a Valid COUNTRY NAME");
			doc.txtCountry.value="";
			doc.txtCountry.focus();
			return false; 
		}
	}
	
	//5	  
	var skPhone = doc.txtPhone.value;
	if(skPhone=="")
	{
		alert("Please enter your PHONE No. with Code");
		doc.txtPhone.focus();
		return false; 
	} 

	if((skPhone!="")&&(skPhone.length < 10)||(isNaN(skPhone)))
	{
		alert("Invalid Phone No  -  " + skPhone +"\n\nPlease enter your PHONE No. with Code\nand enter Numbers only ");
		doc.txtPhone.value="";
		doc.txtPhone.focus();
		return false; 
	}

	//6
	if(doc.txtEmail.value=="")
	{
		alert("Please enter your E-MAIL ID");
		doc.txtEmail.focus();
		return false; 
	} 

	if(doc.txtEmail.value!="")
	{
		apos=doc.txtEmail.value.indexOf("@");
		dotpos=doc.txtEmail.value.indexOf(".");
		lastpos=doc.txtEmail.value.length-1;
				
		if(apos<1||lastpos-apos<5||dotpos<1||lastpos-dotpos<2)
		{
			alert("Please enter a Valid E-MAIL ID");
			doc.txtEmail.focus();
			return false; 
		}	
	}

	//7	
	if (doc.ddlDate.value=="0")
	{
		alert("Please select your DATE OF CRUISE");
		doc.ddlDate.focus();
		return false; 
	} 
	
	//8	
	if (doc.ddlMonth.value=="0")
	{
		alert("Please select your MONTH OF CRUISE");
		doc.ddlMonth.focus();
		return false; 
	} 
	
	//9	
	if (doc.ddlYear.value=="0")
	{
		alert("Please select your YEAR OF CRUISE");
		doc.ddlYear.focus();
		return false; 
	} 
			
	//10
	if (doc.ddlTravel.value=="0")
	{
		alert("Please select your TRAVEL FROM");
		doc.ddlTravel.focus();
		return false; 
	} 

	//11
    if (doc.ddlPackage.value=="0")
	{
		alert("Please select your J2K PACKAGE");
		doc.ddlPackage.focus();
		return false; 
	} 
	
	//12	
	if(doc.txtPerson.value=="")
	{
		alert("Please enter No. OF PERSON(S)");
		doc.txtPerson.focus();
		return false; 
	} 
			
	if((doc.txtPerson.value!="")&&(isNaN(doc.txtPerson.value)))
	{
		alert("Invalid No. OF PERSON(S)");
		doc.txtPerson.value="";
		doc.txtPerson.focus();
		return false; 
	}
	
	//13	
	if(doc.txtAdult.value=="")
	{
		alert("Please enter No. OF ADULT(S)");
		doc.txtAdult.focus();					
		return false; 
	} 
			
	if((doc.txtAdult.value!="")&&(isNaN(doc.txtAdult.value)))
	{
		alert("Invalid No. OF ADULT(S)");
		doc.txtAdult.value="";
		doc.txtAdult.focus();
		return false; 
	}
					
	//14
	if((doc.txtKids.value!="")&&(isNaN(doc.txtKids.value)))
	{
		alert("Invalid No. OF KIDS");
		doc.txtKids.value="";
		doc.txtKids.focus();
		return false; 
	}
		
	//15	
    if(PersonCheck()==false)
	{
		alert("No of persons value doesn't mach with others.");
		doc.txtPerson.focus();
		return false;
	}

}
// JET Packages END



