function validateStep1(){
	var male=document.getElementById("genderMale");
	var female=document.getElementById("genderFemale");
	var age=document.getElementById("age");

	/*
	var emailId=document.getElementById("emailId");
	var stdCode=document.getElementById("stdCode");
	var telNumber=document.getElementById("telNumber");
	var mobileNo=document.getElementById("mobileNo");
	*/

	var annualSalary=document.getElementById("annualSalary");
	var otherSourceIncome=document.getElementById("otherSourceIncome");
	var taxPaid=document.getElementById("taxPaid");
	
	//var beforeLogin=document.getElementById("chkCustomer");
	//alert("testVal is"+testVal.value);

	//Validate Gender
	if(male.checked==false && female.checked==false){
		alert("Please Select Your Gender");
		return false;
	}

	//To Validate Age

		if(trim(age.value).length==0){
		alert("Please Enter Your Age");
		age.focus();
		age.select();
		return false;
		}
		if(isIntegers(trim(age.value)) == false){
			alert("Please Enter a Valid Age");
			age.focus();
			age.select();
			return false;
		}
		if(age.value <0 || age.value > 100){
			alert("Please Enter age between 0 to 100 Years");
			age.focus();
			age.select();
			return false;
		}
	
	/*
	if(beforeLogin.value=='0'){

		//Validate EmailID
		if(emailId.value.length == 0 || emailId.value.length > 50){
			alert('Please enter your valid E-mail ID');
			emailId.focus();
			emailId.select();
			return false;
		}
		
		if(isEmail(emailId.value)==false){
			alert('Please Enter a Valid Email ID');
			emailId.focus();
			emailId.select();
			return false;
		}

		//Validate Telephone Number
		if(trim(stdCode.value).length==0 && (trim(telNumber.value).length==0) && (trim(mobileNo.value).length==0)) 
		{
			alert("Among the telephone number & mobile number, one is mandatory");
			stdCode.focus();
			stdCode.select();
			return false;
		}
		else if((trim(stdCode.value).length > 0) || (trim(telNumber.value).length > 0)  )
				{
					if(isIntegers(trim(stdCode.value)) == false){
					alert("Please Enter valid Telephone Area Code");
					stdCode.focus();
					stdCode.select();
					return false;
				}
				if(stdCode.value.length > 5){
					alert("Please Enter Telephone Area Code within 5 digits");
					stdCode.focus();
					stdCode.select();
					return false;
				}
				if(isIntegers(trim(telNumber.value)) == false){
					alert("Please Enter Valid Telephone Number");
					telNumber.focus();
					telNumber.select();
					return false;
				}
				if(telNumber.value.length > 10 ){
					alert("Please Enter Telephone Number within 10 digits");
					telNumber.focus();
					telNumber.select();
					return false;
				}
			}
			if((trim(stdCode.value).length > 0) && (trim(telNumber.value).length== 0)){
				alert("Please Enter Telephone Number");
				telNumber.focus();
				telNumber.select();
				return false;
			}
			if((trim(telNumber.value).length > 0) && (trim(stdCode.value).length== 0)){
				alert("Please Enter StdCode Number");
				stdCode.focus();
				stdCode.select();
				return false;
			}

		//Validate Mobile Number
			if(isIntegers(mobileNo.value) == false){
				alert("Please enter valid Mobile Number");
				mobileNo.focus();
				mobileNo.select();
				return false;
			}
			if(mobileNo.value.length > 20){
				alert("Please enter Mobile Number within 20 numbers");
				mobileNo.focus();
				mobileNo.select();
				return false;
			}
		
		}
		*/
		
		if((trim(annualSalary.value).length==0) && (trim(otherSourceIncome.value).length==0)) 
		{
			alert("Among the annual salary & other source income, one is mandatory");
			return false;
		}

		
		if(annualSalary.value.length >10){
			alert("Amount Should be less than or equal to 10 digits");
			annualSalary.focus();
			annualSalary.select();
			return false;
		}
		if(isIntegers(annualSalary.value)==false)
		{
			alert("Please Enter a Valid Amount");
			annualSalary.focus();
			annualSalary.select();
			return false;
		}

		//otherSourceIncome
		if(otherSourceIncome.value.length >10){
			alert("Amount Should be less than or equal to 10 digits");
			otherSourceIncome.focus();
			otherSourceIncome.select();
			return false;
		}
		if(isIntegers(otherSourceIncome.value)==false)
		{
			alert("Please Enter a Valid Amount");
			otherSourceIncome.focus();
			otherSourceIncome.select();
			return false;
		}

		//taxPaid
		if(taxPaid.value.length >10){
			alert("Amount Should be less than or equal to 10 digits");
			taxPaid.focus();
			taxPaid.select();
			return false;
		}
		if(isIntegers(taxPaid.value)==false)
		{
			alert("Please Enter a Valid Amount");
			taxPaid.focus();
			taxPaid.select();
			return false;
		}
		on('deduction'); off('step1');	
}



function validateDeductions(){
	
	var premiumPaidAmt=document.getElementById("premiumPaidAmt");
	var ppfInvestAmt=document.getElementById("ppfInvestAmt");
	var savingsInvestAmt=document.getElementById("savingsInvestAmt");
	var nscInterest=document.getElementById("nscInterest");
	var taxHra=document.getElementById("taxHra");
	var pfAmt=document.getElementById("pfAmt");
	var housingLoanPAmt=document.getElementById("housingLoanPAmt");
	var housingLoanIAmt=document.getElementById("housingLoanIAmt");
	var educationLoan=document.getElementById("educationLoan");
	var pensionPlan=document.getElementById("pensionPlan");
	var otherInvAmt=document.getElementById("otherInvAmt");
	var healthPremiumSelf=document.getElementById("healthPremiumSelf");
	var healthPremiumSZ=document.getElementById("healthPremiumSeniorCitizen");
	var healthPremiumParent=document.getElementById("healthPremiumParent");
	var cgPension=document.getElementById("cgPension");

	
		//premiumPaidAmt
		if(premiumPaidAmt.value.length >10){
			alert("Amount Should be less than or equal to 10 digits");
			premiumPaidAmt.focus();
			premiumPaidAmt.select();
			return false;
		}
		if(isIntegers(premiumPaidAmt.value)==false)
		{
			alert("Please Enter a Valid Amount");
			premiumPaidAmt.focus();
			premiumPaidAmt.select();
			return false;
		}

		//ppfInvestAmt
		if(ppfInvestAmt.value.length >10){
			alert("Amount Should be less than or equal to 10 digits");
			ppfInvestAmt.focus();
			ppfInvestAmt.select();
			return false;
		}
		if(isIntegers(ppfInvestAmt.value)==false)
		{
			alert("Please Enter a Valid Amount");
			ppfInvestAmt.focus();
			ppfInvestAmt.select();
			return false;
		}

		//savingsInvestAmt
		if(savingsInvestAmt.value.length >10){
			alert("Amount Should be less than or equal to 10 digits");
			savingsInvestAmt.focus();
			savingsInvestAmt.select();
			return false;
		}
		if(isIntegers(savingsInvestAmt.value)==false)
		{
			alert("Please Enter a Valid Amount");
			savingsInvestAmt.focus();
			savingsInvestAmt.select();
			return false;
		}

		//nscInterest
		if(nscInterest.value.length >10){
			alert("Amount Should be less than or equal to 10 digits");
			nscInterest.focus();
			nscInterest.select();
			return false;
		}
		if(isIntegers(nscInterest.value)==false)
		{
			alert("Please Enter a Valid Amount");
			nscInterest.focus();
			nscInterest.select();
			return false;
		}


		//taxHra
		if(taxHra.value.length >10){
			alert("Amount Should be less than or equal to 10 digits");
			taxHra.focus();
			taxHra.select();
			return false;
		}
		if(isIntegers(taxHra.value)==false)
		{
			alert("Please Enter a Valid Amount");
			taxHra.focus();
			taxHra.select();
			return false;
		}


		//pfAmt
		if(pfAmt.value.length >10){
			alert("Amount Should be less than or equal to 10 digits");
			pfAmt.focus();
			pfAmt.select();
			return false;
		}
		if(isIntegers(pfAmt.value)==false)
		{
			alert("Please Enter a Valid Amount");
			pfAmt.focus();
			pfAmt.select();
			return false;
		}


		//housingLoanPAmt
		if(housingLoanPAmt.value.length >10){
			alert("Amount Should be less than or equal to 10 digits");
			housingLoanPAmt.focus();
			housingLoanPAmt.select();
			return false;
		}
		if(isIntegers(housingLoanPAmt.value)==false)
		{
			alert("Please Enter a Valid Amount");
			housingLoanPAmt.focus();
			housingLoanPAmt.select();
			return false;
		}


		//housingLoanIAmt
		if(housingLoanIAmt.value.length >10){
			alert("Amount Should be less than or equal to 10 digits");
			housingLoanIAmt.focus();
			housingLoanIAmt.select();
			return false;
		}
		if(isIntegers(housingLoanIAmt.value)==false)
		{
			alert("Please Enter a Valid Amount");
			housingLoanIAmt.focus();
			housingLoanIAmt.select();
			return false;
		}


		//educationLoan
		if(educationLoan.value.length >10){
			alert("Amount Should be less than or equal to 10 digits");
			educationLoan.focus();
			educationLoan.select();
			return false;
		}
		if(isIntegers(educationLoan.value)==false)
		{
			alert("Please Enter a Valid Amount");
			educationLoan.focus();
			educationLoan.select();
			return false;
		}


		//pensionPlan
		if(pensionPlan.value.length >10){
			alert("Amount Should be less than or equal to 10 digits");
			pensionPlan.focus();
			pensionPlan.select();
			return false;
		}
		if(isIntegers(pensionPlan.value)==false)
		{
			alert("Please Enter a Valid Amount");
			pensionPlan.focus();
			pensionPlan.select();
			return false;
		}

		//otherInvAmt
		if(otherInvAmt.value.length >10){
			alert("Amount Should be less than or equal to 10 digits");
			otherInvAmt.focus();
			otherInvAmt.select();
			return false;
		}
		if(isIntegers(otherInvAmt.value)==false)
		{
			alert("Please Enter a Valid Amount");
			otherInvAmt.focus();
			otherInvAmt.select();
			return false;
		}

		//healthPremiumSelf
		if(healthPremiumSelf.value.length >10){
			alert("Amount Should be less than or equal to 10 digits");
			healthPremiumSelf.focus();
			healthPremiumSelf.select();
			return false;
		}
		if(isIntegers(healthPremiumSelf.value)==false)
		{
			alert("Please Enter a Valid Amount");
			healthPremiumSelf.focus();
			healthPremiumSelf.select();
			return false;
		}

		//healthPremiumSZ
		if(healthPremiumSZ.value.length >10){
			alert("Amount Should be less than or equal to 10 digits");
			healthPremiumSZ.focus();
			healthPremiumSZ.select();
			return false;
		}
		if(isIntegers(healthPremiumSZ.value)==false)
		{
			alert("Please Enter a Valid Amount");
			healthPremiumSZ.focus();
			healthPremiumSZ.select();
			return false;
		}

		//healthPremiumParent
		if(healthPremiumParent.value.length >10){
			alert("Amount Should be less than or equal to 10 digits");
			healthPremiumParent.focus();
			healthPremiumParent.select();
			return false;
		}
		if(isIntegers(healthPremiumParent.value)==false)
		{
			alert("Please Enter a Valid Amount");
			healthPremiumParent.focus();
			healthPremiumParent.select();
			return false;
		}


		//healthPremiumSZ
		if(cgPension.value.length >10){
			alert("Amount Should be less than or equal to 10 digits");
			cgPension.focus();
			cgPension.select();
			return false;
		}
		if(isIntegers(cgPension.value)==false)
		{
			alert("Please Enter a Valid Amount");
			cgPension.focus();
			cgPension.select();
			return false;
		}
	
}

//Validate Common Method

function isIntegers(s){
	var i;
    for (i = 0; i < s.length; i++){   
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}

function isEmpty(s){ 
	return ((s == null) || (s.length == 0))
}