﻿
//******************* FUNCTION FOR THE SIMPLE TERM PLAN ***************************************
    function ChangeDOB()
    {
    var chkReturn=true;
        if(document.form1.txtName.value=="" || document.form1.txtName.value==null)
        {
            alert("Please enter your/Customer's name");
            document.form1.txtName.focus();
            return false;
        }
		if(document.form1.txtAdvisor_code.value=="" || document.form1.txtAdvisor_code.value==null)
    {
        alert("Please enter Advisor/Employee Code");
        document.form1.txtAdvisor_code.focus();        
        return false;
    }
        if(document.form1.txtAdvisor.value=="" || document.form1.txtAdvisor.value==null)
        {
            alert("Please enter advisor's name");
            document.form1.txtAdvisor.focus();
            return false;
        }
        if(document.form1.Sex.selectedIndex==0)
        {
            alert("Please select Your sex");
            document.form1.Sex.focus();
            return false;
        }
        if(document.form1.DOBDD.selectedIndex==0 ) //|| document.form1.DOBMM.selectedIndex==0 || document.form1.DOBYYYY.selectedIndex==0)
        {
            alert("Please select your date of birth");
            document.form1.DOBDD.focus();
            return false;
        }
        if( document.form1.DOBMM.selectedIndex==0 )//|| document.form1.DOBYYYY.selectedIndex==0)
        {
            alert("Please select your date of birth");
            document.form1.DOBMM.focus();
            return false;
        }
        if(document.form1.DOBYYYY.selectedIndex==0)
        {
            alert("Please select your date of birth");
            document.form1.DOBYYYY.focus();
            return false;
        }        
        if(document.form1.DOCDD.selectedIndex==0 ) //|| document.form1.DOCMM.selectedIndex==0 || document.form1.DOCYYYY.selectedIndex==0)
        {
            alert("Please select your Policy Commencement Date");
            document.form1.DOCDD.focus();
            return false;
        }
        if( document.form1.DOCMM.selectedIndex==0 )//|| document.form1.DOCYYYY.selectedIndex==0)
        {
            alert("Please select your Policy Commencement Date");
            document.form1.DOCMM.focus();
            return false;
        }
        if(document.form1.DOCYYYY.selectedIndex==0)
        {
            alert("Please select your Policy Commencement Date");
            document.form1.DOCYYYY.focus();
            return false;
        }        
        var msg="";
        invalid=false;
        days = getDays((document.form1.DOCMM.selectedIndex-1),document.form1.DOCYYYY.value)
        if(document.form1.DOCDD.value > days)
        {
            msg=msg+"The Policy Commencement Date is Invalid\n";
            invalid="true";
        }
        dt=date_diff();
        //alert(dt);
        if(dt >= 184)
        {
            msg=msg+"The Policy Commencement Date cannot be backdated by more than 6 months\n";
            invalid="true";
        }
        if(invalid=="true")
        {
            alert(msg);
            document.form1.DOCMM.focus();
            return false;
        }
        //dATE CHECK
        var today=new Date();
        var pdate=new Date(document.form1.DOCYYYY.value,document.form1.DOCMM.selectedIndex-1,document.form1.DOCDD.selectedIndex);
        if(pdate>today)
        {
            alert("Policy Commencement date can not be more than current date");
            document.form1.DOCMM.focus();
            return false;
        }  
        chkReturn=CheckDateForSimpleTermPlan();
        return chkReturn;
    }

    function CheckDateForSimpleTermPlan()
    {
        var poc=calage(document.form1.DOBYYYY.value,document.form1.DOBMM.selectedIndex,document.form1.DOBDD.value);   
        if(poc<18 || poc>44)
        {
            alert("Invalid Age.The minimum and maximum Age at entry under this plan is 18 years and 44 years respectively.");
            document.form1.DOBYYYY.focus();
            return false;
        }
        
        msg="";
        invalid="false";
        days = getDays((document.form1.DOBMM.selectedIndex-1),document.form1.DOBYYYY.value);
        if(document.form1.DOBDD.value > days )
        {
            alert("The Birth Date is Invalid");
            document.form1.DOBMM.focus();
            return false;
        }

        //dATE CHECK
        msg="";
        invalid="false";
        days = getDays((document.form1.DOBMM.selectedIndex-1),document.form1.DOBYYYY.value);
        if(document.form1.DOBDD.value > days)
        {
            msg=msg+"The Birth Date is Invalid\n";
            invalid="true";
        }
        if(invalid=="true")
        {
            alert(msg);
            document.form1.DOCMM.focus();
            return false;
        }
        return true;
    }
//*******************FUNCTION FOR SIMPLE TERM PLAN ***************************************

//**************************FUNCTION FOR CONNECT TO LIFE PLAN ***********************************
function ChangeDOBConnecttoLife()
{
    if(document.form1.txtName.value=="" || document.form1.txtName.value==null)
    {
        alert("Please enter your/Customer's name");
        document.form1.txtName.focus();        
        return false;
    }
	if(document.form1.txtAdvisor_code.value=="" || document.form1.txtAdvisor_code.value==null)
    {
        alert("Please enter Advisor/Employee Code");
        document.form1.txtAdvisor_code.focus();        
        return false;
    }
	
	if(document.form1.txtAdvisor_code.value=="" || document.form1.txtAdvisor_code.value==null)
    {
        alert("Please enter Advisor/Employee Code");
        document.form1.txtAdvisor_code.focus();        
        return false;
    }
    if(document.form1.txtAdvisor.value=="" || document.form1.txtAdvisor.value==null)
    {
        alert("Please enter advisor's name");
        document.form1.txtAdvisor.focus();
        return false;
    }
    if(document.form1.DOBDD.selectedIndex==0 ) //|| document.form1.DOBMM.selectedIndex==0 || document.form1.DOBYYYY.selectedIndex==0)
    {
        alert("Please select your date of birth");
        document.form1.DOBDD.focus();
        return false;
    }
    if(document.form1.DOBMM.selectedIndex==0 ) //|| document.form1.DOBMM.selectedIndex==0 || document.form1.DOBYYYY.selectedIndex==0)
    {
        alert("Please select your date of birth");
        document.form1.DOBMM.focus();
        return false;
    }
    if(document.form1.DOBYYYY.selectedIndex==0 ) //|| document.form1.DOBMM.selectedIndex==0 || document.form1.DOBYYYY.selectedIndex==0)
    {
        alert("Please select your date of birth");
        document.form1.DOBYYYY.focus();
        return false;
    }
    if(document.form1.DOCDDd.selectedIndex==0 ) //|| document.form1.DOCMM.selectedIndex==0 || document.form1.DOCYYYY.selectedIndex==0)
    {
        alert("Please select your Policy Commencement Date");
        document.form1.DOCDDd.focus();
        return false;
    }
    if( document.form1.DOCMMm.selectedIndex==0 )//|| document.form1.DOCYYYY.selectedIndex==0)
    {
        alert("Please select your Policy Commencement Date");
        document.form1.DOCMMm.focus();
        return false;
    }
    if(document.form1.DOCYYYYy.selectedIndex==0)
    {
        alert("Please select your Policy Commencement Date");
        document.form1.DOCYYYYy.focus();
        return false;
    }
   
    
    if(document.form1.SEX.selectedIndex==0 ) //|| document.form1.DOBMM.selectedIndex==0 || document.form1.DOBYYYY.selectedIndex==0)
    {
        alert("Please select Sex");
        document.form1.SEX.focus();
        return false;
    }
    if(document.form1.MODE.selectedIndex==0)
    {
        alert("Please select Premium Mode");
        document.form1.MODE.focus();
        return false;
    }
    if(document.form1.FPUR.selectedIndex==0)
    {
        alert("Please select purchase option");
        document.form1.FPUR.focus();
        return false;
    }
    if(document.form1.PTTFP.selectedIndex==0)
    {
        alert("Please select Plan Type at the time of First Purchase");
        document.form1.PTTFP.focus();
        return false;
    }
    if(document.form1.SAVAL.selectedIndex==0)
    {
        alert("Please select Sum Assured");
        document.form1.SAVAL.focus();
        return false;
    } 
    var chk=true;
    chk=CheckCon2LifeAgeOnPurOption();  
    return chk;   
     var msg="";
    invalid="false";
    var today=new Date();
    var pdate=new Date(document.form1.DOCYYYYy.value,document.form1.DOCMMm.selectedIndex-1,document.form1.DOCDDd.selectedIndex);
    if(pdate>today)
    {
        alert("Policy Commencement Date can not be more than current date");
        return false;
    }         
   var days = getDays((document.form1.DOCMMm.selectedIndex-1),document.form1.DOCYYYYy.value);
    if(document.form1.DOCDDd.value > days)
    {
        msg=msg+"The Policy Commencement Date is Invalid\n";
        invalid="true";
    }
    dt=date_diff1();
    if(dt >= 184)
    {
        msg=msg+"The Policy Commencement Date cannot be back dated by more than 6 months\n";
        invalid="true"; 
    }
    if(invalid=="true")
    {
        alert(msg);
        return false;
    }
}

function CheckCon2LifeAgeOnPurOption()
{
    var poc=calage(document.form1.DOBYYYY.value,document.form1.DOBMM.selectedIndex,document.form1.DOBDD.value);
	if (document.form1.FPUR.value == "First Purchase")
	{
		if (poc < 18 || poc > 45)
		{
			alert("Invalid age. The minimum and maximum age at entry under this plan is 18 years and 45 years respectively");				
			return false;
		}
	}
	if (document.form1.FPUR.value == "Second Purchase")
	{
		if (poc < 19 || poc > 46)
		{
			alert("Invalid age. The minimum and maximum age at entry under this plan is 19 years and 46 years respectively");			
			return false;
		}
	}

	if (document.form1.FPUR.value == "Third Purchase")
	{
		if (poc < 20 || poc > 47)
		{      
			alert("Invalid age. The minimum and maximum age at entry under this plan is 20 years and 47 years respectively");				
			return false;
		}
	}

 
    msg="";
    invalid="false";
    days = getDays((document.form1.DOBMM.selectedIndex-1),document.form1.DOBYYYY.value);
    if(document.form1.DOBDD.value > days )
    {
        msg=msg+"The Birth Date is Invalid\n";
        invalid="true";
    }   
    if(invalid=="true")
    {
        alert(msg);
        return false;
    } 
}
//**************************END FUNCTION FOR CONNECT TO LIFE PLAN ***********************************


//*************** FUNCTION FOR THE CHILD PLAN JAVASCRIPT***********************************************
    function ChangeDOBChildPlan()
    {    
        var chkReturn=true;    
		//var  days;
		
        if(document.form1.txtName.value=="" || document.form1.txtName.value==null)
        {
            alert("Please enter your/Customer's name");
            document.form1.txtName.focus();
            return false;
        }
		if(document.form1.txtAdvisor_code.value=="" || document.form1.txtAdvisor_code.value==null)
    {
        alert("Please enter Advisor/Employee Code");
        document.form1.txtAdvisor_code.focus();        
        return false;
    }
        if(document.form1.txtAdvisor.value=="" || document.form1.txtAdvisor.value==null)
        {
            alert("Please enter advisor's name");
            document.form1.txtAdvisor.focus();
            return false;
        }
        if(document.form1.DOBDD.selectedIndex==0 ) //|| document.form1.DOBMM.selectedIndex==0 || document.form1.DOBYYYY.selectedIndex==0)
        {
            alert("Please select your Date of Birth");
            document.form1.DOBDD.focus();
            return false;
        }        
        if( document.form1.DOBMM.selectedIndex==0 )//|| document.form1.DOBYYYY.selectedIndex==0)
        {
            alert("Please select your Date of Birth");
            document.form1.DOBMM.focus();
            return false;
        }
        if(document.form1.DOBYYYY.selectedIndex==0)
        {
            alert("Please select your Date of Birth");
            document.form1.DOBYYYY.focus();
            return false;
        }
      /* var days = getDays((document.form1.DOBMM.value-1),document.form1.DOBYYYY.value);
        if(document.form1.DOBDD.value > days )
        {
            msg=msg+"The Birth Date is Invalid\n";
            invalid="true";
        }
        if(invalid=="true")
        {
            alert(msg);
            document.form1.DOCMM.focus();
            return false;
        }
        */
        if(document.form1.DOCDD.selectedIndex==0 ) //|| document.form1.DOCMM.selectedIndex==0 || document.form1.DOCYYYY.selectedIndex==0)
        {
            alert("Please select your Policy Commencement Date");
            document.form1.DOCDD.focus();
            return false;
        }
        if( document.form1.DOCMM.selectedIndex==0 )//|| document.form1.DOCYYYY.selectedIndex==0)
        {
            alert("Please select your Policy Commencement Date");
            document.form1.DOCMM.focus();
            return false;
        }
        if(document.form1.DOCYYYY.selectedIndex==0)
        {
            alert("Please select your Policy Commencement Date");
            document.form1.DOCYYYY.focus();
            return false;
        }
		
		
		
		
		
        
        if(document.form1.Sex.selectedIndex<1)
        {
            alert("Please select your sex");
            document.form1.Sex.focus();
            return false;
        }
        if(document.form1.Term.selectedIndex==0)
        {
            alert("Please enter Policy Term");
            document.form1.Term.focus();
            return false;
        }
        chkReturn=CheckChildPlanTerm();
        if(chkReturn==false)
        {
            return chkReturn;
        }
        if(document.form1.Mode.selectedIndex==0)
        {
            alert("Please select your Premium Mode");
            document.form1.Mode.focus();
            return false;
        }
        if(document.form1.SA.value=="")
        {
            alert("Please enter your Basic Sum Assured");
            document.form1.SA.focus();
            return false;
        }
        
        if(parseFloat(document.form1.SA.value)<25000)
        {
            alert("Minimum Sum Assured should be 25000");
            document.form1.SA.focus();
            return false;
        }
        
        if(document.form1.chkaccidentrider.checked==true)
        {
			//alert("hi");
			
		    var age=parseInt(document.form1.ADBRAge.value);
            var termr=parseInt(document.form1.ADBRTerm.value);
            var baseval=parseInt(document.form1.Term.value);
            var asa=parseFloat(document.form1.ADBRSA.value);
            var sumassured=parseFloat(document.form1.SA.value);
			
            if(document.form1.ADBRAge.value=="" ||document.form1.ADBRAge.value==0||document.form1.ADBRAge.value==null)
            {
                alert("Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Age.");
                document.form1.ADBRAge.focus();
                document.form1.ADBRAge.select();
                return false;
            } 
           
            if(age==0)
            {
                alert("Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Age.");
                document.form1.ADBRAge.focus();
                document.form1.ADBRAge.select();
                return false;
            }
            if(age<20 || age>60)
            {
                alert("Reliance Accidental Death and Total and Permanent Disablement Rider Age should be between 20 years and 60 years respectively. ");
                document.form1.ADBRAge.focus();
                document.form1.ADBRAge.select();
                return false;
            } 
            
            
            if(document.form1.ADBRTerm.value==""||document.form1.ADBRTerm.value==0||document.form1.ADBRTerm.value==null || termr==0)
            {
                alert("Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Term.");
                document.form1.ADBRTerm.focus();
                document.form1.ADBRTerm.select();
                return false;
            }           
            if(termr<5 || termr>baseval)
            {
              alert("Reliance Accidental Death and Total and Permanent Disablement Rider Term should be between 5 and "+baseval);
                document.form1.ADBRTerm.focus();
                document.form1.ADBRTerm.select();
                return false;
            } 
            
            if(document.form1.ADBRSA.value==""||document.form1.ADBRSA.value==0||document.form1.ADBRSA.value=="" || asa==0)
            {
                alert("Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Sum Assured.");
                document.form1.ADBRSA.focus();
                document.form1.ADBRSA.select();
                return false;
            }            
            if(asa<25000 || asa>5000000)
            {
                alert("Reliance Accidental Death and Total and Permanent Disablement Rider Sum Assured should be between Rs.25000 and Rs.5000000.");
                document.form1.ADBRSA.focus();
                document.form1.ADBRSA.select();
                return false;
            }
            if(asa> sumassured)
            {
                alert("Reliance Accidental Death and Total and Permanent Disablement Rider Sum Assured should be less than or equal to basic Sum Assured.");
                document.form1.ADBRSA.focus();
                document.form1.ADBRSA.select();
                return false;
            }
        }
       
        if(document.form1.chkccrider.checked== true)
        {
            var termr=parseInt(document.form1.CCRTerm.value);
            var baseval=parseInt(document.form1.Term.value);
            var asa=parseFloat(document.form1.CCRSA.value);
            var sumassured=parseFloat(document.form1.SA.value);
            var age=parseInt(document.form1.CCRAge.value);
            
            if(document.form1.CCRAge.value==""||document.form1.CCRAge.value==0||document.form1.CCRAge.value==null || age==0)
            {
                alert("Please enter Reliance New Critical Conditions Rider Age.");
                document.form1.CCRAge.focus();
                document.form1.CCRAge.select();
                return false;
            }          
            if(age<20 || age>55)
            {
                alert("Reliance New Critical Conditions Rider Age should be between 20 and 55");
                document.form1.CCRAge.focus();
                document.form1.CCRAge.select();
                return false;
            }    
            
            
            if(document.form1.CCRTerm.value==""||document.form1.CCRTerm.value==0||document.form1.CCRTerm.value==null || termr==0)
            {
                alert("Please enter Reliance New Critical Conditions Rider Term.");
                document.form1.CCRTerm.focus();
                document.form1.CCRTerm.select();
                return false;
            }          
            if(termr<5 || termr>baseval)
            {
                alert("Reliance New Critical Conditions Rider Term should be between 5 and "+baseval);
                document.form1.CCRTerm.focus();
                document.form1.CCRTerm.select();
                return false;
            } 
            
            
            if(document.form1.CCRSA.value==""||document.form1.CCRSA.value==0||document.form1.CCRSA.value==null || asa==0)
            {
                alert("Please enter Reliance New Critical Conditions Rider Sum Assured");
                document.form1.CCRSA.focus();
                document.form1.CCRSA.select();
                return false;
            }  
			
			 if(sumassured<100000)
            {
				
                alert("You are not eligible to opt for Reliance New Critical Conditions Rider. ");
				document.form1.chkccrider.checked=false;
				chkccRiderChildPlanMain();
                document.form1.SA.focus();
                document.form1.SA.select();
                return false;
            }
			
            if(asa<100000 || asa>1000000)
            {
                alert("Reliance New Critical Conditions Rider Sum Assured should be between Rs.100000 and Rs.1000000");
                document.form1.CCRSA.focus();
                document.form1.CCRSA.select();
                return false;
            }
           
        }  
		 if(document.form1.chkFBIR.checked==true)
        { 
			//alert("hello");
            var age=parseInt(document.form1.FIBRAge.value);
           
           // var baseval=parseFloat(document.form1.Term.value);
            var baseSA=parseFloat(document.form1.SA.value);
            var baseAge=parseFloat(document.form1.Age.value);
            var asa=parseFloat(document.form1.FIBRSA.value);
			//alert(baseAge);
            if(age==0||document.form1.FIBRAge.value==""||document.form1.FIBRAge.value==null||document.form1.FIBRAge.value==0)
            {
                alert("Please enter Reliance Life Insurance Family Income benefit Rider Age.");
                document.form1.FIBRAge.focus();
                document.form1.FIBRAge.select();
                return false;
            }  
			 var termr=parseInt(document.form1.FIBRTerm.value);
           if(termr==0||document.form1.FIBRTerm.value==""||document.form1.FIBRTerm.value==null||document.form1.FIBRTerm.value==0)
            {
                alert("Please enter the term for Reliance Life Insurance Family Income benefit Rider.");
                document.form1.FIBRTerm.focus();
                document.form1.FIBRTerm.select();
                return false;
            }
         	 if(document.form1.FIBRPTerm.value=="-Select-"||document.form1.FIBRTerm.selectedIndex==0)
            {
                alert("Please Select the term for Reliance Life Insurance Family Income benefit Rider.");
                document.form1.FIBRPTerm.focus();
                //document.form1.FIBRTerm.select();
                return false;
            }
            if(asa==0||document.form1.FIBRSA.value==""||document.form1.FIBRSA.value==null||document.form1.FIBRSA.value==0)
            {
                alert("Please enter sum assured for Reliance Life Insurance Family Income benefit Rider.");
                document.form1.FIBRSA.focus();
                document.form1.FIBRSA.select();
                return false;
            } 
			
			 if(age<18 || age>61)
	  		 {
			alert("Invalid Rider Age. Please enter Reliance Life Insurance Family Income Benefit Rider Age in between 18 and 60");
			document.form1.FIBRAge.focus();
		 	document.form1.FIBRAge.select();
			return false;
	  		 } 
			 if(baseSA<100000)
                {
                    document.form1.chkFBIR.checked=false;
alert("You are not eligible for Reliance Life Insurance Family Income Benefit Rider as Minimum Sum Assured should be 1,00,000.");           
                   chkAgeRiderFBIR_BASIC();
				    return false;
                }
			 if(asa<100000 || asa>1000000)
            {
         alert("Reliance Life Insurance Family Income Benefit Rider sum assured should be Minimum 1,00,000 and Max 10,00,000. ");
                document.form1.FIBRSA.focus();
                document.form1.FIBRSA.select();
                return false;
            }
            if(asa>parseFloat(document.form1.SA.value))
            {
				alert("Reliance Life Insurance Family Income Benefit Rider sum assured should be less than or equal to the base sum assured subject to Minimum 1,00,000 and Max 10,00,000. ");  
                
                document.form1.FIBRSA.focus();
                document.form1.FIBRSA.select();
                return false;
            }
				
			 
			if(age<baseAge)
			{
				
				  alert("Reliance Life Insurance Family Income benefit Rider Age Should Be Greater Than Or Equal To Base Age.");
				  document.form1.FIBRAge.focus();
                document.form1.FIBRAge.select();
				return false;
			}
        }
  		var poc=calage(document.form1.DOBYYYY.value,document.form1.DOBMM.selectedIndex,document.form1.DOBDD.value);      
        if(poc<20 || poc>60)
        {
           alert("Invalid Age.The minimum and maximum Age at entry under this plan between 20 years and 60 years respectively.");
            document.form1.DOBYYYY.focus();
            return false;
        }
        msg="";
        invalid="false";
        days = getDays((document.form1.DOBMM.selectedIndex-1),document.form1.DOBYYYY.value);
		
		
        msg="";
        invalid="false";
        var today=new Date();
        var pdate=new Date(document.form1.DOCYYYY.value,document.form1.DOCMM.selectedIndex-1,document.form1.DOCDD.selectedIndex);
        if(pdate>today)
        {
            alert("Policy Commencement Date can not be more than current date");
            document.form1.DOCMM.focus();
            return false;
        }
        days = getDays((document.form1.DOCMM.selectedIndex-1),document.form1.DOCYYYY.value)
        if(document.form1.DOCDD.value > days)
        {
            msg=msg+"The Policy Commencement Date is Invalid\n";
            invalid="true";
        }
        dt=date_diff1();      
        if(dt >= 184)
        {
            msg=msg+"The policy Commencement Date cannot be back dated by more than 6 months\n";
            invalid="true"; 
        }
        if(invalid=="true")
        {
            alert(msg);
            document.form1.DOCMM.focus();
            return false;
        }
		
        return chkReturn;
    }

    var age;
    function CheckChildPlanTerm()
    {
        if (document.form1.DOBDD.selectedIndex!=0 && document.form1.DOBMM.selectedIndex!=0 && document.form1.DOBYYYY.selectedIndex!=0)
	    {
	      DOBYYYY = document.form1.DOBYYYY[document.form1.DOBYYYY.selectedIndex].value;
	      DOBMM = document.form1.DOBMM[document.form1.DOBMM.selectedIndex].value;
	      DOBDD = document.form1.DOBDD[document.form1.DOBDD.selectedIndex].value;
	            if(DOBMM=="Jan")
	            {
	                DOBMM=1;
	            }
	            else if(DOBMM=="Feb")
	            {
	                DOBMM=2;
	            }
	            else if(DOBMM=="Mar")
	            {
	                DOBMM=3;
	            }
	             else if(DOBMM=="Apr")
	            {
	                DOBMM=4;
	            }
	            else if(DOBMM=="May")
	            {
	                DOBMM=5;
	            }
	             else if(DOBMM=="Jun")
	            {
	                DOBMM=6;
	            }
	            else if(DOBMM=="Jul")
	            {
	                DOBMM=7;
	            }
	            else if(DOBMM=="Aug")
	            {
	                DOBMM=8;
	            }
	             else if(DOBMM=="Sep")
	            {
	                DOBMM=9;
	            }
	            else if(DOBMM=="Oct")
	            {
	                DOBMM=10;
	            }
	            else if(DOBMM=="Nov")
	            {
	                DOBMM=11;
	            }
	            else if(DOBMM=="Dec")
	            {
	                DOBMM=12;
	            }	                
    	        
            var birthdate = new Date(DOBYYYY, DOBMM-1, DOBDD) //Month is 0-11 in JavaScript
            curdate=new Date();
            var one_day=1000*60*60*24;
            age = parseInt(Math.floor((curdate.getTime()- birthdate.getTime())/(one_day))/365.25);

            var max_t = Math.min(20,70-age);
            
            if(document.form1.Term.value<5 && max_t==5 && document.form1.DOBYYYY.value==1949)
            {
                alert("Policy Term should be 5");
                document.form1.Term.focus();
                return false;
            }        	
            if(document.form1.Term.value<5 || document.form1.Term.value>max_t)
            {
                alert("Policy Term should be between 5 to "+max_t);
                document.form1.Term.focus();
                return false;
            }  	  
	    }	
	    return true;	
    }
//*****************NOT IN USE*********************
function reloadPolicyTerm(mterm)
{
	var k = 1;	
	document.form1.term.length =1;	
	for( i=5;i<=mterm; i++){
		var newOpt1 = new Option(i,i);
		document.form1.term.options[k] = newOpt1;
		k++;
	}	
}
//*****************END OF NOT IN USE*********************
//*************** END FUNCTION FOR THE CHILD PLAN JAVASCRIPT***********************************************



//************************* FUNCTION FOR THE TERM PLAN *********************************

    function ChangeDOBTermPlan()
    {
        var chkReturn=true;
        if(document.form1.txtName.value=="" || document.form1.txtName.value==null)
        {
            alert("Please enter your/Customer's name");
            document.form1.txtName.focus();
            return false;
        }
		if(document.form1.txtAdvisor_code.value=="" || document.form1.txtAdvisor_code.value==null)
  		  {
        alert("Please enter Advisor/Employee Code");
        document.form1.txtAdvisor_code.focus();        
        return false;
  		  }
		
        if(document.form1.txtAdvisor.value=="" || document.form1.txtAdvisor.value==null)
        {
            alert("Please enter advisor's name");
            document.form1.txtAdvisor.focus();
            return false;
        }
        if(document.form1.Sex.selectedIndex==0)
        {
            alert("Please select Your sex");
            document.form1.Sex.focus();
            return false;
        }
        if(document.form1.DOBDD.selectedIndex==0 ) //|| document.form1.DOBMM.selectedIndex==0 || document.form1.DOBYYYY.selectedIndex==0)
        {
            alert("Please select your date of birth");
            document.form1.DOBDD.focus();
            return false;
        }
        if( document.form1.DOBMM.selectedIndex==0 )//|| document.form1.DOBYYYY.selectedIndex==0)
        {
            alert("Please select your date of birth");
            document.form1.DOBMM.focus();
            return false;
        }
        if(document.form1.DOBYYYY.selectedIndex==0)
        {
            alert("Please select your date of birth");
            document.form1.DOBYYYY.focus();
            return false;
        }
        
        //*********************Age Validataion ***********************************
        msg="";
        invalid="false";
        days = getDays((document.form1.DOBMM.selectedIndex-1),document.form1.DOBYYYY.value);

        if(document.form1.DOBDD.value > days )
        {
            msg=msg+"The Birth Date is Invalid\n";
            invalid="true";
        }
        
        var poc=calage(document.form1.DOBYYYY.value,document.form1.DOBMM.selectedIndex,document.form1.DOBDD.value);
        if(poc<21 || poc>60)
        {
            alert("Invalid Age.The minimum and maximum Age at entry under this plan is 21 years and 60 years respectively.");
            document.form1.DOBYYYY.focus();
            return false;
        }        
        //*********************End of Age Validation *******************************
        
        if(document.form1.DOCDD.selectedIndex==0 ) //|| document.form1.DOCMM.selectedIndex==0 || document.form1.DOCYYYY.selectedIndex==0)
        {
            alert("Please select your policy Commencement Date");
            document.form1.DOCDD.focus();
            return false;
        }
        if( document.form1.DOCMM.selectedIndex==0 )//|| document.form1.DOCYYYY.selectedIndex==0)
        {
            alert("Please select your Policy Commencement Date");
            document.form1.DOCMM.focus();
            return false;
        }
        if(document.form1.DOCYYYY.selectedIndex==0)
        {
            alert("Please select your Policy Commencement Date");
            document.form1.DOCYYYY.focus();
            return false;
        }
        //****************** Plolicy Commencement Date *********************************
        var msg="";
        invalid=false;
        var today=new Date();
        var pdate=new Date(document.form1.DOCYYYY.value,document.form1.DOCMM.selectedIndex-1,document.form1.DOCDD.selectedIndex);
        if(pdate>today)
        {
            alert("Policy Commencement Date can not be greater than current date");
            document.form1.DOCYYYY.focus();
            return false;
        }  
        days = getDays((document.form1.DOCMM.selectedIndex-1),document.form1.DOCYYYY.value)
        if(document.form1.DOCDD.value > days)
        {
            msg=msg+"The Policy Commencement Date is Invalid\n";
            invalid="true";
        }
        dt=date_diff();

        if(dt > 185)
        {
            msg=msg+"The Policy Commencement Date cannot be back dated by more than 6 months\n";
            invalid="true";
        }
        if(invalid=="true")
        {
            alert(msg);
            document.form1.DOCMM.focus();
            return false;
        }      
        //****************** END Policy Commencement Date *********************************
        
        if(document.form1.Term.value=="" || document.form1.Term.value==null)
        {
            alert("Please enter your Policy Term");
            document.form1.Term.focus();
            return false;
        } 
        chkReturn=loadterm();
        if(chkReturn==false)
        {
            return chkReturn;
        }        
        if(document.form1.Mode.selectedIndex==0)
        {
            alert("Please select your Premium Payment Mode");
            document.form1.Mode.focus();
            return false;
        }
        if(document.form1.SA.value=="" || document.form1.SA.value==null)
        {
            alert("Please enter your basic Sum Assured");
            document.form1.SA.focus();
            return false;
        }
        if(document.form1.SA.value<250000)
        {
            alert("Minimum Sum Assured should be 250000.");
            document.form1.SA.focus();
            return false;
        }   

        //Age Rider

        if(document.form1.chkaccidentrider.checked==true)
        {
            var termr=parseInt(document.form1.ADBRTerm.value);
            var baseval=parseInt(document.form1.Term.value);
            var asa=parseFloat(document.form1.ADBRSA.value);
            var SA=parseFloat(document.form1.SA.value);
            if(document.form1.ADBRAge.value=="" || document.form1.ADBRAge.value==null||document.form1.ADBRAge.value==0)
            {
                alert("Please enter Reliance Accidental Death and Total and Permanent Disablement Rider age");
                document.form1.ADBRAge.focus();
                document.form1.ADBRAge.select();
                return false;
            }
            var age=parseInt(document.form1.ADBRAge.value);
            if(age==0)
            {
                alert("Please enter Reliance Accidental Death and Total and Permanent Disablement Rider age");
                document.form1.ADBRAge.focus();
                document.form1.ADBRAge.select();
                return false;
            }
            if(age<21 || age>60)
            {
              alert("Reliance Accidental Death and Total and Permanent Disablement Rider age should be between 21 and 60 Years");
                document.form1.ADBRAge.focus();
                document.form1.ADBRAge.select();
                return false;
            } 
            
            if(document.form1.ADBRTerm.value=="" || document.form1.ADBRTerm.value==null||document.form1.ADBRTerm.value==0)
            {
                alert("Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Term");
                document.form1.ADBRTerm.focus();
                document.form1.ADBRTerm.select();
                return false;
            }
            if(termr==0)
            {
                alert("Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Term");
                document.form1.ADBRTerm.focus();
                document.form1.ADBRTerm.select();
                return false;
            }
            if(termr<5 || termr>baseval)
            {
                alert("Reliance Accidental Death and Total and Permanent Disablement Rider Term should be between 5 and "+baseval);
                document.form1.ADBRTerm.focus();
                document.form1.ADBRTerm.select();
                return false;
            } 
            
            
            if(document.form1.ADBRSA.value=="" || document.form1.ADBRSA.value==null||document.form1.ADBRSA.value==0)
            {
                alert("Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Sum Assured");
                document.form1.ADBRSA.focus();
                document.form1.ADBRSA.select();
                return false;
            }          
            if(asa==0)
            {
                alert("Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Sum Assured");
                document.form1.ADBRSA.focus();
                document.form1.ADBRSA.select();
                return false;
            }
            if(asa<25000 || asa>5000000 || asa>SA)
            {
                alert("Reliance Accidental Death and Total and Permanent Disablement Rider Sum Assured should be between Rs. 25000 and 5000000");
                document.form1.ADBRSA.focus();
                document.form1.ADBRSA.select();
                return false;
            }
        } 
		
        return chkReturn;
    }
    
    function loadterm()
    {
	if (document.form1.DOBDD.selectedIndex!=0 && document.form1.DOBMM.selectedIndex!=0 && document.form1.DOBYYYY.selectedIndex!=0)
	{
	  DOBYYYY = document.form1.DOBYYYY[document.form1.DOBYYYY.selectedIndex].value;
	  DOBMM = document.form1.DOBMM[document.form1.DOBMM.selectedIndex].value;
	  DOBDD = document.form1.DOBDD[document.form1.DOBDD.selectedIndex].value;
	        if(DOBMM=="Jan")
	        {
	            DOBMM=1;
	        }
	        else if(DOBMM=="Feb")
	        {
	            DOBMM=2;
	        }
	        else if(DOBMM=="Mar")
	        {
	            DOBMM=3;
	        }
	         else if(DOBMM=="Apr")
	        {
	            DOBMM=4;
	        }
	        else if(DOBMM=="May")
	        {
	            DOBMM=5;
	        }
	         else if(DOBMM=="Jun")
	        {
	            DOBMM=6;
	        }
	        else if(DOBMM=="Jul")
	        {
	            DOBMM=7;
	        }
	        else if(DOBMM=="Aug")
	        {
	            DOBMM=8;
	        }
	         else if(DOBMM=="Sep")
	        {
	            DOBMM=9;
	        }
	        else if(DOBMM=="Oct")
	        {
	            DOBMM=10;
	        }
	        else if(DOBMM=="Nov")
	        {
	            DOBMM=11;
	        }
	        else if(DOBMM=="Dec")
	        {
	            DOBMM=12;
	        }	                
	        
        var birthdate = new Date(DOBYYYY, DOBMM-1, DOBDD) //Month is 0-11 in JavaScript
        curdate=new Date();
        var one_day=1000*60*60*24;
        age = parseInt(Math.floor((curdate.getTime()- birthdate.getTime())/(one_day))/365.25);

        var max_t = Math.min(30,65-age);
        
        if(document.form1.Term.value<5 && max_t==5 && document.form1.DOBYYYY.value==1949)
        {
            alert("Policy Term should be 5");
            document.form1.Term.focus();
            return false;
        }  	 
        	
        if(document.form1.Term.value<5 || document.form1.Term.value>max_t)
        {
            alert("Policy Term should be between 5 to "+max_t);
            document.form1.Term.focus();
            return false;
        }  	  
	}	
	return true;	
}


function reloadPolicyTerm(mterm)
{
	var k = 1;	
	document.form1.Term.length =1;	
    if(document.form1.Term.value<5 || document.form1.Term.value>mterm)
    {
        alert("Policy Term should be between 5 to "+mterm);
        return false;
    }
    return true;
}
//************************* END FUNCTION FOR THE TERM PLAN *********************************


//******************************** FUNCTION FOR THE SUPER FIVE PLUS **************************************
    function CheckRiderSpecialEndownment()
    {
        if(document.form1.txtName.value=="" || document.form1.txtName.value==null)
        {
            alert("Please enter your/Customer's  name");
            document.form1.txtName.focus();
            return false;
        }
		
		if(document.form1.txtAdvisor_code.value=="" || document.form1.txtAdvisor_code.value==null)
    {
        alert("Please enter Advisor/Employee Code");
        document.form1.txtAdvisor_code.focus();        
        return false;
    }
        if(document.form1.txtAdvisor.value=="" || document.form1.txtAdvisor.value==null)
        {
            alert("Please enter advisor's Name");
            document.form1.txtAdvisor.focus();
            return false;
        }
        if(document.form1.Sex.selectedIndex==0)
        {
            alert("Please select Your Sex");
            document.form1.Sex.focus();
            return false;
        }
        if(document.form1.DOBDD.selectedIndex==0 ) //|| document.form1.DOBMM.selectedIndex==0 || document.form1.DOBYYYY.selectedIndex==0)
        {
            alert("Please select your Date of Birth");
            document.form1.DOBDD.focus();
            return false;
        }
        if( document.form1.DOBMM.selectedIndex==0 )//|| document.form1.DOBYYYY.selectedIndex==0)
        {
            alert("Please select your Date of Birth");
            document.form1.DOBMM.focus();
            return false;
        }
        if(document.form1.DOBYYYY.selectedIndex==0)
        {
            alert("Please select your Date of Birth");
            document.form1.DOBYYYY.focus();
            return false;
        }
        msg="";
        invalid="false";
        days = getDays((document.form1.DOBMM.selectedIndex-1),document.form1.DOBYYYY.value);
        if(document.form1.DOBDD.value > days )
        {
            msg=msg+"The Birth Date is Invalid\n";
            invalid="true";
        }
        if(invalid=="true")
        {
            alert(msg);
            return false;
        }
        var poc=calage(document.form1.DOBYYYY.value,document.form1.DOBMM.selectedIndex,document.form1.DOBDD.value);
        if(poc<12 || poc>65)
        {
            alert("Invalid Age.The minimum and maximum Age at entry under this plan is 12 years and 65 years respectively.");
            document.form1.DOBYYYY.focus();
            return false;
        }
        
        if(document.form1.DOCDD.selectedIndex==0 ) //|| document.form1.DOCMM.selectedIndex==0 || document.form1.DOCYYYY.selectedIndex==0)
        {
            alert("Please select your Policy Commencement Date");
            document.form1.DOCDD.focus();
            return false;
        }
        if( document.form1.DOCMM.selectedIndex==0 )//|| document.form1.DOCYYYY.selectedIndex==0)
        {
            alert("Please select your policy Commencement date");
            document.form1.DOCMM.focus();
            return false;
        }
        if(document.form1.DOCYYYY.selectedIndex==0)
        {
            alert("Please select your policy Commencement date");
            document.form1.DOCYYYY.focus();
            return false;
        }
        var today=new Date();
        var pdate=new Date(document.form1.DOCYYYY.value,document.form1.DOCMM.selectedIndex-1,document.form1.DOCDD.selectedIndex);
        if(pdate>today)
        {
            alert("Policy Commencement date can not be greater than current date");
            document.form1.DOCMM.focus();
            return false;
        }
        days = getDays((document.form1.DOCMM.selectedIndex-1),document.form1.DOCYYYY.value)
        if(document.form1.DOCDD.value > days)
        {
            msg=msg+"The Policy Commencement Date is Invalid\n";
            invalid="true";
        }
        dt=date_diff();       
        if(dt >= 184)
        {
            msg=msg+"The policy commencement date cannot be back dated by more than 6 months\n";
            document.form1.DOCMM.focus();
            invalid="true";
        }
        if(invalid=="true")
        {
            alert(msg);
            return false;
        }
        if(document.form1.Term.selectedIndex==0)
        {
            alert("Please select Your Policy Term");
            document.form1.Term.focus();
            return false;
        }
        if(document.form1.Mode.selectedIndex==0)
        {
            alert("Please select your Premium Payment  Mode");
            document.form1.Mode.focus();
            return false;
        }
        if(document.form1.SA.value=="")
        {
            alert("Please enter your basic sum assured");
            document.form1.SA.focus();
            return false;
        }      

       
        if(document.form1.SA.value<25000)
        {
            alert("- Minimum Sum Assured should be 25000.");
            document.form1.SA.focus();
            return false;
        }
        if(document.form1.chkaccidentrider.checked==true)
        {
            var age=parseInt(document.form1.ADBRAGE.value);
            var termr=parseInt(document.form1.ADBRTERM.value);
            var baseval=parseInt(document.form1.Term.value);
            var asa=parseInt(document.form1.ADBRSA.value);
            if(document.form1.ADBRAGE.value=="" ||document.form1.ADBRAGE.value==0||document.form1.ADBRAGE.value==null || age==0)
            {
                alert("Please enter Reliance Accidental Death and Total & Permanent Disablement Rider age.");
                document.form1.ADBRAGE.focus();
                document.form1.ADBRAGE.select();
                return false;
            } 
            if(age<18 || age>60)
            {
                alert("Reliance Accidental Death and Total and Permanent Disablement Rider Age should be between 18 and 60");
                document.form1.ADBRAGE.focus();
                document.form1.ADBRAGE.select();
                return false;
            }            
            if(document.form1.ADBRTERM.value==""||document.form1.ADBRTERM.value==0||document.form1.ADBRTERM.value==null || termr==0)
            {
                alert("Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Term.");
                document.form1.ADBRTERM.focus();
                document.form1.ADBRTERM.select();
                return false;
            } 
            if(termr<5 || termr>baseval)
            {
                alert("Reliance Accidental Death and Total and Permanent Disablement Rider Term should be between 5 and "+baseval);
                document.form1.ADBRTERM.focus();
                document.form1.ADBRTERM.select();
                return false;
            } 
            
            if(document.form1.ADBRSA.value==""||document.form1.ADBRSA.value==0||document.form1.ADBRSA.value=="" || asa==0)
            {
                alert("Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Sum Assured.");
                document.form1.ADBRSA.focus();
                document.form1.ADBRSA.select();
                return false;
            }            
            if(asa<25000 || asa>5000000)
            {
                alert("Reliance Accidental Death and Total and Permanent Disablement Rider Sum Assured should be between Rs. 25000 and 5000000");
                document.form1.ADBRSA.focus();
                document.form1.ADBRSA.select();
                return false;
            }
            if(asa>parseFloat(document.form1.SA.value))
            {
                alert("Reliance Accidental Death and Total and Permanent Disablement Rider Sum Assured should not exceed Basic Sum Assured");
                document.form1.ADBRSA.focus();
                document.form1.ADBRSA.select();
                return false;
            }
        }
        
        if(document.form1.chkccrider.checked==true)
        {
            var age=parseInt(document.form1.CCRAGE.value);
            var termr=parseInt(document.form1.CCRTERM.value);
            var baseval=parseInt(document.form1.Term.value);
            var asa=parseInt(document.form1.CCRSA.value);
            if(document.form1.CCRAGE.value==""||document.form1.CCRAGE.value==0||document.form1.CCRAGE.value==null || age==0)
            {
                alert("Please enter Reliance Critical Condition Rider Age.");
                document.form1.CCRAGE.focus();
                document.form1.CCRAGE.select();
                return false;
            }           
            if(age<18 || age>55)
            {
                alert("Reliance Critical Condtion Rider Age should be between 18 and 55");
                document.form1.CCRAGE.focus();
                document.form1.CCRAGE.select();
                return false;
            } 
            if(document.form1.CCRTERM.value==""||document.form1.CCRTERM.value==0||document.form1.CCRTERM.value==null || termr==0)
            {
                alert("Please enter Reliance Critical Condition Rider Term.");
                document.form1.CCRTERM.focus();
                document.form1.CCRTERM.select();
                return false;
            }
            if(termr<5 || termr>baseval)
            {
                alert("Reliance Critical Condtion Rider Term should be between 5 and "+baseval);
                document.form1.CCRTERM.focus();
                document.form1.CCRTERM.select();
                return false;
            } 
            
            if(document.form1.CCRSA.value==""||document.form1.CCRSA.value==0||document.form1.CCRSA.value==null || asa==0)
            {
                alert("Please enter Reliance Critical Condition Rider Sum Assured");
                document.form1.CCRSA.focus();
                document.form1.CCRSA.select();
                return false;
            }           
            if(asa<100000 || asa>1000000)
            {
                alert("Reliance Critical Condtion Rider Sum Assured should be between 100000 and 1000000");
                document.form1.CCRSA.focus();
                document.form1.CCRSA.select();
                return false;
            }
            if(asa>parseFloat(document.form1.SA.value))
            {
                alert("Reliance Critical Condtion Rider Sum Assured should not exceed Basic Sum Assured");
                document.form1.CCRSA.focus();
                document.form1.CCRSA.select();
                return false;
            }
        }
		
		//document.form1.FIBRTerm.readOnly =true;
		
		 if(document.form1.chkFBIR.checked==true)
        {
            var age=parseInt(document.form1.FIBRAge.value);
            var termr=parseInt(document.form1.FIBRTerm.value);
            var baseval=parseInt(document.form1.Term.value);
            var asa=parseFloat(document.form1.FIBRSA.value);
			var baseSA=parseFloat(document.form1.SA.value);
            if(document.form1.FIBRAge.value==""||document.form1.FIBRAge.value==0||document.form1.FIBRAge.value==null || age==0)
            {
                alert("Please enterReliance Life Insurance Family Income benefit Rider Age.");
                document.form1.FIBRAge.focus();
                document.form1.FIBRAge.select();
                return false;
            }           
            if(age<18 || age>61)
            {
                alert("Reliance Life Insurance Family Income benefit Rider Age should be between 18 and 60");
                document.form1.FIBRAge.focus();
                document.form1.FIBRAge.select();
                return false;
            } 
            if(document.form1.FIBRTerm.value==""||document.form1.FIBRTerm.value==0||document.form1.FIBRTerm.value==null || termr==0)
            {
                alert("Please enter Reliance Life Insurance Family Income benefit Rider Term.");
                document.form1.FIBRTerm.focus();
                document.form1.FIBRTerm.select();
                return false;
            }
            if(termr<5 )
			{
                alert("Reliance Life Insurance Family Income benefit Rider Term should be greater than or equal to 5. ");
                document.form1.FIBRTerm.focus();
                document.form1.FIBRTerm.select();
                return false;
            } 
			if(termr > baseval)
			{
				alert("Reliance Life Insurance Family Income benefit Rider Term should be less than or equal to Basic plan Policy Term. ");
                document.form1.FIBRTerm.focus();
                document.form1.FIBRTerm.select();
                return false;
			}
           if(document.form1.FIBRPTerm.value=="-Select-"||document.form1.FIBRPTerm.selectedIndex==0||document.form1.FIBRPTerm.value==null )
            {
                alert("Please select Premium Paying Term for Reliance Life Insurance Family Income benefit Rider.");
                document.form1.FIBRPTerm.focus();
                //document.form1.FIBRTerm.select();
                return false;
            }
            if(document.form1.FIBRSA.value==""||document.form1.FIBRSA.value==0||document.form1.FIBRSA.value==null || asa==0)
            {
                alert("Please enter Reliance Life Insurance Family Income benefit Rider Sum Assured");
                document.form1.FIBRSA.focus();
                document.form1.FIBRSA.select();
                return false;
            } 
			
			  if(baseSA<100000)
                {
                    document.form1.chkFBIR.checked=false;
alert("You are not eligible for Reliance Life Insurance Family Income Benefit Rider as Minimum Sum Assured should be 1,00,000.");           
                   chkAgeRiderFBIR_BASIC();
				    return false;
                }
			 if(asa<100000 || asa>1000000)
            {
         alert("Reliance Life Insurance Family Income Benefit Rider sum assured should be Minimum 1,00,000 and Max 10,00,000. ");
                document.form1.FIBRSA.focus();
                document.form1.FIBRSA.select();
                return false;
            }
            if(asa>parseFloat(document.form1.SA.value))
            {
				alert("Reliance Life Insurance Family Income Benefit Rider sum assured should be less than or equal to the base sum assured subject to Minimum 1,00,000 and Max 10,00,000. ");  
                
                document.form1.FIBRSA.focus();
                document.form1.FIBRSA.select();
                return false;
            }
				
			if(age<baseAge)
			{
				
				  alert("Reliance Life Insurance Family Income benefit Rider Age Should Be Greater Than Or Equal To Base Age.");
				  document.form1.FIBRAge.focus();
                document.form1.FIBRAge.select();
				return false;
			}
        }
		
   }
//******************************** END FUNCTION FOR THE SUPER FIVE PLUS **************************************

//******************************* FUNCTION RELIANCE GOLDEN YEAR BASIC PLAN VALUE ******************************
function change_SASGYPBasicval()
{
   var val;
   var amt_inst_pre = document.form1.IP.value;
   if ( document.form1.Mode.value == "" ){val = 0;};
   if ( document.form1.Mode.value == "Yearly" ){val = 1;};
   if ( document.form1.Mode.value == "Half Yearly" ){val = 2;};
   if ( document.form1.Mode.value == "Quarterly" ){val = 4;};
   if ( document.form1.Mode.value == "Monthly" ){val = 12;};
	if(document.form1.IP.value!="" && document.form1.Term.value!="")
	{
        document.form1.SA.value=document.form1.SA1.value;
	}
	else
	{
	    document.form1.SA.value=document.form1.SA1.value;		
	}
}
function change_ImmanPvalue()
{
 
}
function blankfundBasic()
    {
        if(document.form1.NMMF.value=="" || document.form1.NMMF.value==null)
        {
            document.form1.NMMF.value=0;
        } 
        if(document.form1.NBF.value=="" || document.form1.NBF.value==null)
        {
            document.form1.NBF.value=0;
        } 
        if(document.form1.NGF.value=="" || document.form1.NGF.value==null)
        {
            document.form1.NGF.value=0;
        } 
        if(document.form1.NEF.value=="" || document.form1.NEF.value==null)
        {
            document.form1.NEF.value=0;
        } 
        if(document.form1.NPEF.value=="" || document.form1.NPEF.value==null)
        {
            document.form1.NPEF.value=0; 
        } 
        if(document.form1.NIF.value=="" || document.form1.NIF.value==null)
        {
            document.form1.NIF.value=0; 
        } 
        if(document.form1.NENF.value=="" || document.form1.NENF.value==null)
        {
            document.form1.NENF.value=0;
        } 
        if(document.form1.NMF.value=="" || document.form1.NMF.value==null)
        {
            document.form1.NMF.value=0; 
        }
    }
    function blankfundBasicMGBasic()
    {
        if(document.form1.FundD.value=="" || document.form1.FundD.value==null)
        {
            document.form1.FundD.value=0;
        } 
        if(document.form1.FundE.value=="" || document.form1.FundE.value==null)
        {
            document.form1.FundE.value=0;
        } 
        if(document.form1.FundF.value=="" || document.form1.FundF.value==null)
        {
            document.form1.FundF.value=0;
        } 
       
    }
    
    function cal_premBasic()
    {
        var p=document.form1.IP.value;
        if(p=="")
        {
            document.form1.A_Prem.value=0;
        }
        var m=document.form1.Mode.value;
        if(m=="Quarterly")
        {
            if(p=="")
            {
                document.form1.A_Prem.value=0;
            }
            else
            {
                var md=4;
                document.form1.A_Prem.value=(md) * (p);
            }
        }
        if(m=="Monthly")
        {
            if(p=="")
            {
                document.form1.A_Prem.value=0;
            }
            else
            {
                var md=12;
                document.form1.A_Prem.value=(md) * (p);
                //document.form1.A_Prem1.value=(md) * (p);
                 
       
            }
        }
        if(m=="Yearly" || m=="1")
        {
            if(p=="")
            {
                document.form1.A_Prem.value=0;
            }
            else
            {
                var md=1;
                document.form1.A_Prem.value=(md) * (p);
            }        
        }
        if(m=="Half Yearly")
        {
            if(p=="")
            {
                document.form1.A_Prem.value=0;
            }
            else
            {
                var md=2;
                document.form1.A_Prem.value=(md) * (p);
            }
        }
      
        document.form1.A_Prem1.value=document.form1.A_Prem.value;
       
    }

function changeanulprm()
{
document.form1.A_Prem1.value=document.form1.A_Prem.value;   
}
function changeanulprm1()
{
document.form1.A_Prem1.value=document.form1.A_Prem.value;
}
    function RSGYPBasic()
    {
        var mode = (document.form1.Mode.value);
        var ann_prm = parseInt(document.form1.A_Prem.value);
        var min_SA = (ann_prm * 5);
        var max_SA = (ann_prm * 50);

        if(document.form1.txtName.value=="" || document.form1.txtName.value==null)
        {
            alert("Please enter your/Customer's name.");
            document.form1.txtName.focus();
            return false;
        }
        if(document.form1.txtAdvisor.value=="" || document.form1.txtAdvisor.value==null)
        {
            alert("Please enter your/Advisor name");
            document.form1.txtAdvisor.focus();
            return false;
        }
        if(document.form1.Sex.value=="Select")
        {
            alert("Please select your Sex");
            document.form1.Sex.focus();
            return false;
        }
        if(document.form1.Age.value=="Select")
        {
            alert("Please select your Age");
            document.form1.Age.focus();
            return false;
        }
        if(document.form1.Term.value=="" || document.form1.Term.value==null)
        {
            alert("Please enter Policy Term");
            document.form1.Term.focus();
            return false;
        }
        if(document.form1.Term.value<16)
        {
            alert("Minimum Policy Term should be 16");
            document.form1.Term.focus();
            return false;
        }        
        if(document.form1.Mode.value=="Select" || document.form1.Mode.value=="-Select-")
        {
            alert("Please select Mode of Premium Payment");
            document.form1.Mode.focus();
            return false;
        }
        if(document.form1.IP.value=="" || document.form1.IP.value==null || document.form1.IP.value==0)
        {
            alert("Please Enter Installment Premium");
            document.form1.IP.focus();
            return false;
        }
//        if(document.form1.Mode.value=="Yearly" && document.form1.IP.value!="")
//        {
//            if(parseInt(document.form1.IP.value)<20000)
//            {
//            alert("minimum Installment Premium for Yearly is 20000.", "RELIANCE SUPER GOLDEN YEAR PLAN-PLUS ");
//            document.form1.IP.focus();
//            return false;
//            }
//        }
//        else if(document.form1.Mode.value=="Half Yearly" && document.form1.IP.value!="")
//        {
//            if(parseInt(document.form1.IP.value)<10000)
//            {
//            alert("minimum Installment Premium for Half Yearly is 10000.", "RELIANCE SUPER GOLDEN YEAR PLAN-PLUS ");
//            document.form1.IP.focus();
//            return false;
//            }
//        }
//        else if(document.form1.Mode.value=="Quarterly" && document.form1.IP.value!="")           
//        {
//            if(parseInt(document.form1.IP.value)<5000)
//            {
//            alert("minimum Installment Premium for Quarterly is 5000.", "RELIANCE SUPER GOLDEN YEAR PLAN-PLUS ");
//            document.form1.IP.focus();
//            return false;
//            }
//        }
//        else if(document.form1.Mode.value=="Monthly" && document.form1.IP.value!="")            
//        {
//            if(parseInt(document.form1.IP.value)<2000)
//            {
//            alert("minimum Installment Premium for Monthly is 2000.", "RELIANCE SUPER GOLDEN YEAR PLAN-PLUS");
//            document.form1.IP.focus();
//            return false;
//            }
//        }

        if(document.form1.SA1.value=="" || document.form1.SA1.value==null || document.form1.SA1.value==0)
        {
            alert("Please enter basic Sum Assured.");
            document.form1.SA1.focus();
            return false;
        }         
        
        if(document.form1.ChkADTPD.checked==true)
        { 
            var age=parseFloat(document.form1.ADBRAge.value);
            var termr=parseFloat(document.form1.ADBRTerm.value);
            var baseval=parseFloat(document.form1.Term.value);
            var baseSA=parseFloat(document.form1.SA.value);
            var baseAge=parseFloat(document.form1.Age.value);
            var asa=parseFloat(document.form1.ADBRSA.value);
            if(age==0 || document.form1.ADBRAge.value=="" || document.form1.ADBRAge.value==null)
            {
                alert("Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Age.");
                document.form1.ADBRAge.focus();
                document.form1.ADBRAge.select();
                return false;
            }  
//            if(age<18 ||age>60)
//            {
//            alert("Invalid Rider Age. Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Age should be between 18 to 60");
//                document.form1.ADBRAge.focus();
//                document.form1.ADBRAge.select();
//                return false;
//            }            
//            if(age!=baseAge)
//            {    
//                alert("Invalid Rider Age. Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Age should be "+baseAge);
//                document.form1.ADBRAge.focus();
//                document.form1.ADBRAge.select();
//                return false;
//            }
            
            
            //term nd sa
            if(termr==0 || document.form1.ADBRTerm.value=="" || document.form1.ADBRTerm.value==null)
            {
                alert("Please enter the term for Reliance Accidental Death and Total and Permanent Disablement Rider.");
                document.form1.ADBRTerm.focus();
                document.form1.ADBRTerm.select();
                return false;
            }
//            if(termr<5 || termr>baseval)
//            {
//                alert("Reliance Accidental Death and Total and Permanent Disablement Rider should be between 5 and "+baseval);
//                document.form1.ADBRTerm.focus();
//                document.form1.ADBRTerm.select();
//                return false;
//            } 
            
            if(asa==0 || document.form1.ADBRSA.value=="" || document.form1.ADBRSA.value==null)
            {
                alert("Please enter sum assured for Reliance Accidental Death and Total and Permanent Disablement Rider.");
                document.form1.ADBRSA.focus();
                document.form1.ADBRSA.select();
                return false;
            }   
//            if(asa<25000)
//            {
//                alert("Minimum Sum Assured for Reliance Accidental Death and Total and Permanent Disablement Rider should be Rs.25000");
//                document.form1.ADBRSA.focus();
//                document.form1.ADBRSA.select();
//                return false;
//            }
//            if(asa<baseSA || asa>5000000)
//            {
//                alert("Reliance Accidental Death and Total and Permanent Disablement Rider Sum Assured should be between Rs."+baseSA+" and Rs.5000000");
//                document.form1.ADBRSA.focus();
//                document.form1.ADBRSA.select();
//                return false;
//            }

        }
        if(document.form1.chkTermliferider.checked==true)
        { 
            var age=parseFloat(document.form1.TLBRAge.value);
            var termr=parseFloat(document.form1.TLBRTerm.value);
            var baseSA=parseFloat(document.form1.SA.value);
            var asa=parseFloat(document.form1.TLBRSA.value);
            var baseterm=parseFloat(document.form1.Term.value);
            var baseAge=parseFloat(document.form1.Age.value);
            
            if(age==0 || document.form1.TLBRAge.value=="" || document.form1.TLBRAge.value==null)
            {
                alert("Please enter the age for Reliance Term Life Insurance Benefit Rider.");
                document.form1.TLBRAge.focus();
                document.form1.TLBRAge.select();
                return false;
            }  
//            if(age<18 ||age>59)
//            {
//            alert("Invalid Rider Age. Please enter Reliance Term Life Insurance Benefit Rider Age should be between 18 to 59");
//                document.form1.ADBRAge.focus();
//                document.form1.ADBRAge.select();
//                return false;
//            }            
//            if(age!=baseAge)
//            { 
//                alert("Invalid Rider Age. Please enter Reliance Term Life Insurance Benefit Rider Age should be "+baseAge);
//                document.form1.TLBRAge.focus();
//                document.form1.TLBRAge.select();
//                return false;
//            }
            
            
            //term and sa
            if(termr==0 || document.form1.TLBRTerm.value=="" || document.form1.TLBRTerm.value==null)
            {
                alert("Please enter the term for Reliance Term Life Insurance Benefit Rider.");
                document.form1.TLBRTerm.focus();
                document.form1.TLBRTerm.select();
                return false;
            }
//            if(termr<5 || termr>30)
//            {
//                alert("Term for Reliance Term Life Insurance Benefit Rider should be between 5 and 30");
//                document.form1.TLBRTerm.focus();
//                document.form1.TLBRTerm.select();
//                return false;
//            } 
            
            if(asa==0 || document.form1.TLBRSA.value=="" || document.form1.TLBRSA.value==null)
            {
                alert("Please enter sum assured for Reliance Term Life Insurance Benefit Rider.");
                document.form1.TLBRSA.focus();
                document.form1.TLBRSA.select();
                return false;
            }           
//            if(asa<25000 || asa>baseSA)
//            {
//                alert("Reliance Term Life Insurance Benefit Rider Sum Assured should be between 25000 and "+baseSA);
//                document.form1.TLBRSA.focus();
//                document.form1.TLBRSA.select();
//                return false;
//            }
        }
        if(document.form1.chkmajor.checked==true)
        { 
            var age=parseFloat(document.form1.MSBRAge.value);
            var termr=parseFloat(document.form1.MSBRTerm.value);
            var baseSA=parseFloat(document.form1.SA.value);
            var asa=parseFloat(document.form1.MSBRSA.value);
            var baseAge=parseFloat(document.form1.Age.value);
           
            if(age==0 || document.form1.MSBRAge.value=="" || document.form1.MSBRAge.value==null)
            {
                alert("Please enter the age for Reliance New Major Surgical Benefit Rider.");
                document.form1.MSBRAge.focus();
                document.form1.MSBRAge.select();
                return false;
            }
//            if(age<18 || age>55)
//            {
//                 alert("Invalid Rider Age. Reliance New Major Surgical Benefit Rider Age should be between 18 to 55");
//                    document.form1.MSBRAge.focus();
//                    document.form1.MSBRAge.select();
//                    return false;
//            } 
//            if(age!=baseAge)
//                {
//                    alert("Invalid Rider Age. Reliance New Major Surgical Benefit Rider Age should be equal to the basic age and basic age should not be greater than 55 for this rider");
//                    document.form1.MSBRAge.focus();
//                    document.form1.MSBRAge.select();
//                    return false;
//                }
            //term and sa
            if(termr==0 || document.form1.MSBRTerm.value=="" || document.form1.MSBRTerm.value==null)
            {
                alert("Please enter the term for Reliance New Major Surgical Benefit Rider.");
                document.form1.MSBRTerm.focus();
                document.form1.MSBRTerm.select();
                return false;
            }
//            if(termr<5 || termr>25)
//            {
//                alert("Term for Reliance New Major Surgical Benefit Rider should be between 5 and 25.");
//                document.form1.MSBRTerm.focus();
//                document.form1.MSBRTerm.select();
//                return false;
//            }             
            if(asa==0 || document.form1.MSBRSA.value=="" || document.form1.MSBRSA.value==null)
            {
                alert("Please enter sum assured for Reliance New Major Surgical Benefit Rider.");
                document.form1.MSBRSA.focus();
                document.form1.MSBRSA.select();
                return false;
            }
//            if(asa<10000 || asa>Math.min(baseSA,500000))
//            {
//                alert("Reliance New Major Surgical Benefit Rider Sum Assured should be between Rs.10000 and "+"Rs."+Math.min(baseSA,500000));
//                document.form1.MSBRSA.focus();
//                document.form1.MSBRSA.select();
//                return false;
//            }
        }
        if(document.form1.chkccrider.checked==true)
        { 
            var age=parseFloat(document.form1.CCRAge.value);
            var termr=parseFloat(document.form1.CCRTerm.value);
            var baseSA=parseFloat(document.form1.SA.value);
            var asa=parseFloat(document.form1.CCRSA.value);
            var baseAge=parseFloat(document.form1.Age.value);
            if(age==0 || document.form1.CCRAge.value=="" || document.form1.CCRAge.value==null)
            {
                alert("Please enter the age for Reliance New Critical Conditions (25) Rider.");
                document.form1.CCRAge.focus();
                document.form1.CCRAge.select();
                return false;
            }
//            if(age<18 || age>55)
//            {
//               alert("Invalid Rider Age.Reliance New Critical Conditions (25) Rider Age should be equal to the basic age and basic age should be between 18 to 55");
//                    document.form1.MSBRAge.focus();
//                    document.form1.MSBRAge.select();
//                    return false;
//            } 
//               if(age!=baseAge)
//                {
//                    alert("Invalid Rider Age.Reliance New Critical Conditions (25) Rider Age should be equal to the basic age and basic age should not be greater than 55 for this rider");
//                    document.form1.MSBRAge.focus();
//                    document.form1.MSBRAge.select();
//                    return false;
//                }
            //term and sa
            if(termr==0 || document.form1.CCRTerm.value=="" || document.form1.CCRTerm.value==null)
            {
                alert("Please enter the term for Reliance New Critical Conditions (25) Rider.");
                document.form1.CCRTerm.focus();
                document.form1.CCRTerm.select();
                return false;
            }
//            if(termr<5 || termr>25)
//            {
//                alert("Term for Reliance New Critical Conditions (25) Rider should be between 5 and 25.");
//                document.form1.CCRTerm.focus();
//                document.form1.CCRTerm.select();
//                return false;
//            } 
            
            if(asa==0 || document.form1.CCRSA.value=="" || document.form1.CCRSA.value==null)
            {
                alert("Please enter sum assured for Reliance New Critical Conditions (25) Rider.");
                document.form1.CCRSA.focus();
                document.form1.CCRSA.select();
                return false;
            }
//            if(asa<10000 || asa>Math.min(baseSA,2000000))
//            {
//                alert("Reliance New Critical Conditions (25) Rider Sum Assured should be between Rs.10000 and Rs."+Math.min(baseSA,2000000));
//                document.form1.CCRSA.focus();
//                document.form1.CCRSA.select();
//                return false;
//            }
        }
        return true;
    }

    function chkAgeRiderSGYPADBBasic()
	{
        if(document.form1.ChkADTPD.checked==true)
        {
           document.form1.ADBRAge.readOnly =true;
           document.form1.ADBRTerm.readOnly =false;
		   document.form1.ADBRPTerm.readOnly =true;
           document.form1.ADBRSA.readOnly =false;
           document.form1.ADBRAge.disabled =false;
           document.form1.ADBRTerm.disabled =false;
		   document.form1.ADBRPTerm.disabled =false;
           document.form1.ADBRSA.disabled =false;	 
        }
        else if(document.form1.ChkADTPD.checked==false)
        {
           document.form1.ADBRAge.readOnly =true;
           document.form1.ADBRTerm.readOnly =true;
		    document.form1.ADBRPTerm.readOnly =true;
           document.form1.ADBRSA.readOnly =true; 
           document.form1.ADBRAge.disabled =true;
           document.form1.ADBRTerm.disabled =true;
		    document.form1.ADBRPTerm.disabled =true;
           document.form1.ADBRSA.disabled =true;
           document.form1.ADBRAge.value =0;
           document.form1.ADBRTerm.value =0;
		   document.form1.ADBRPTerm.value =0;
           document.form1.ADBRSA.value =0; 
        }
	}
	 
	function chkAgeRiderSGYPTERMBasic()
	{
	//alert("Hi");
        if(document.form1.chkTermliferider.checked==true)
        {
           document.form1.TLBRAge.readOnly =true;
           document.form1.TLBRTerm.readOnly =false;
		   document.form1.TLBRPTerm.readOnly =true;
           document.form1.TLBRSA.readOnly =false;
           document.form1.TLBRAge.disabled =false;
           document.form1.TLBRTerm.disabled =false;
		   document.form1.TLBRPTerm.disabled =false;
           document.form1.TLBRSA.disabled =false;	 
        }
        else if(document.form1.chkTermliferider.checked==false)
        {
            document.form1.TLBRAge.readOnly =true;
            document.form1.TLBRTerm.readOnly =true;
			document.form1.TLBRPTerm.readOnly =true;
            document.form1.TLBRSA.readOnly =true; 
            document.form1.TLBRAge.disabled =true;
            document.form1.TLBRTerm.disabled =true;
			 document.form1.TLBRPTerm.disabled =true;
            document.form1.TLBRSA.disabled =true;
            document.form1.TLBRAge.value =0;
            document.form1.TLBRTerm.value =0;
			 document.form1.TLBRPTerm.value =0;
            document.form1.TLBRSA.value =0; 
        }
	}
	
	function chkAgeRiderSGYPmsbBasic()
	{
        if(document.form1.chkmajor.checked==true)
        {
            document.form1.MSBRAge.readOnly =true;
            document.form1.MSBRTerm.readOnly =false;
			 document.form1.MSBRPTerm.readOnly =true;
            document.form1.MSBRSA.readOnly =false;
            document.form1.MSBRAge.disabled =false;
            document.form1.MSBRTerm.disabled =false;
			document.form1.MSBRPTerm.disabled =false;
            document.form1.MSBRSA.disabled =false;

        }
        else if(document.form1.chkmajor.checked==false)
        {
            document.form1.MSBRAge.readOnly =true;
            document.form1.MSBRTerm.readOnly =true; 
			 document.form1.MSBRPTerm.readOnly =true; 
            document.form1.MSBRSA.readOnly =true;
            document.form1.MSBRAge.disabled =true;
            document.form1.MSBRTerm.disabled =true;
			document.form1.MSBRPTerm.disabled =true;
            document.form1.MSBRSA.disabled =true; 
            document.form1.MSBRAge.value =0;
            document.form1.MSBRTerm.value =0;
			document.form1.MSBRPTerm.value =0;
            document.form1.MSBRSA.value =0; 
        }
	}
    function chkAgeRiderSGYPCCBasic()
    {
        if(document.form1.chkccrider.checked==true)
        {
            document.form1.CCRAge.readOnly =true;
            document.form1.CCRTerm.readOnly =false;
			document.form1.CCRPTerm.readOnly =true;
            document.form1.CCRSA.readOnly =false;
            document.form1.CCRAge.disabled =false;
            document.form1.CCRTerm.disabled =false;
			document.form1.CCRPTerm.disabled =false;
            document.form1.CCRSA.disabled =false;

        }
        else if(document.form1.chkccrider.checked==false)
        {
            document.form1.CCRAge.readOnly =true;
            document.form1.CCRTerm.readOnly =true;
			 document.form1.CCRPTerm.readOnly =true;
            document.form1.CCRSA.readOnly =true;
            document.form1.CCRAge.disabled =true;
            document.form1.CCRTerm.disabled =true;
			document.form1.CCRPTerm.disabled =true;
            document.form1.CCRSA.disabled =true; 
            document.form1.CCRAge.value =0;
            document.form1.CCRTerm.value =0;
			document.form1.CCRPTerm.value =0;
            document.form1.CCRSA.value =0; 
        }
    }   

//*********************************** END OF ******************************************************************


//**************************SUPER GOLDEN YEAR TERM 10 PLAN *****************************************************


    
function SuperGoldenYearTerm10Plan()
    {
    
        var mode = (document.form1.Mode.value);
        var ann_prm = parseInt(document.form1.A_Prem.value);
        var min_SA = (ann_prm * 5);
        var max_SA = (ann_prm * 50);

        if(document.form1.txtName.value=="" || document.form1.txtName.value==null)
        {
            alert("Please enter your/Customer's name.");
            document.form1.txtName.focus();
            return false;
        }
        if(document.form1.txtAdvisor.value=="" || document.form1.txtAdvisor.value==null)
        {
            alert("Please enter your/Advisor name");
            document.form1.txtAdvisor.focus();
            return false;
        }
        if(document.form1.Sex.value=="Select")
        {
            alert("Please select your Sex");
            document.form1.Sex.focus();
            return false;
        }
        if(document.form1.Age.value=="Select")
        {
            alert("Please select your Age");
            document.form1.Age.focus();
            return false;
        }
        if(document.form1.MODETYPE.value=="Select")
        {
            alert("Please select Premium Paying Type");
            document.form1.MODETYPE.focus();
            return false;
        }
        if((document.form1.MODETYPE.value=="Single Premium") && (document.form1.AP.value=="" || document.form1.AP.value==null || document.form1.AP.value=="0"))
        {
            alert("Please enter Amount of Single Premium");
            document.form1.AP.focus();
            return false;
        }
        if((document.form1.MODETYPE.value=="Regular Premium") && (document.form1.Mode.selectedIndex==0))
        {
            alert("Please select Mode of Premium Payment");
            document.form1.Mode.focus();
            return false;
        }
        if((document.form1.MODETYPE.value=="Regular Premium") && (document.form1.IP.value=="" || document.form1.IP.value==null || document.form1.IP.value==0))
        {
            alert("Please enter installment premium");
            document.form1.IP.focus();
            return false;
        }
        if((document.form1.MODETYPE.value=="Single Premium") && parseFloat(document.form1.AP.value)<30000)
        {
            alert("Minimum Single premium should be 30000");
            document.form1.AP.focus();
            return false;
        }
//        if(document.form1.MODETYPE.value!="Single Premium" && document.form1.Mode.value=="Yearly" && document.form1.IP.value!="")
//        {
//            if(parseInt(document.form1.IP.value)<20000)
//            {
//            alert("minimum Installment Premium for Yearly is 20000.", "RELIANCE SUPER GOLDEN YEAR PLAN-PLUS ");
//            document.form1.IP.focus();
//            return false;
//            }
//        }
//        else if(document.form1.MODETYPE.value!="Single Premium" && document.form1.Mode.value=="Half Yearly" && document.form1.IP.value!="")
//        {
//            if(parseInt(document.form1.IP.value)<10000)
//            {
//            alert("minimum Installment Premium for Half Yearly is 10000.", "RELIANCE SUPER GOLDEN YEAR PLAN-PLUS ");
//            document.form1.IP.focus();
//            return false;
//            }
//        }
//        else if(document.form1.MODETYPE.value!="Single Premium" && document.form1.Mode.value=="Quarterly" && document.form1.IP.value!="")           
//        {
//            if(parseInt(document.form1.IP.value)<5000)
//            {
//            alert("minimum Installment Premium for Quarterly is 5000.", "RELIANCE SUPER GOLDEN YEAR PLAN-PLUS ");
//            document.form1.IP.focus();
//            return false;
//            }
//        }
//        else if(document.form1.MODETYPE.value!="Single Premium" && document.form1.Mode.value=="Monthly" && document.form1.IP.value!="")            
//        {
//            if(parseInt(document.form1.IP.value)<2000)
//            {
//            alert("minimum Installment Premium for Monthly is 2000.", "RELIANCE SUPER GOLDEN YEAR PLAN-PLUS");
//            document.form1.IP.focus();
//            return false;
//            }
//        }       
////////        if(document.form1.ChkADTPD.checked==true)
////////        { 
////////            var age=parseFloat(document.form1.ADBRAge.value);
////////            var termr=parseFloat(document.form1.ADBRTerm.value);
////////            var baseval=parseFloat(document.form1.Term.value);
////////            var baseSA=parseFloat(document.form1.SA.value);
////////            var asa=parseFloat(document.form1.ADBRSA.value);
////////            if(age==0)
////////            {
////////                alert("Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Age.");
////////                document.form1.ADBRAge.focus();
////////                document.form1.ADBRAge.select();
////////                return false;
////////            }
////////            if(age<18 || age>60)
////////            {
////////                alert("Invalid Rider Age. Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Age between 18 and 60.");
////////                document.form1.ADBRAge.focus();
////////                document.form1.ADBRAge.select();
////////                return false;
////////            } 
////////            
////////            //term nd sa
////////            if(termr==0)
////////            {
////////                alert("Please enter the term for Reliance Accidental Death and Total and Permanent Disablement Rider.");
////////                document.form1.ADBRTerm.focus();
////////                document.form1.ADBRTerm.select();
////////                return false;
////////            }
////////            if(termr<5 )
////////            {
////////                alert("Minimum Term for Reliance Accidental Death and Total and Permanent Disablement Rider should be 5");
////////                document.form1.ADBRTerm.focus();
////////                document.form1.ADBRTerm.select();
////////                return false;
////////            } 
////////            
////////            if(asa==0)
////////            {
////////                alert("Please enter sum assured for Reliance Accidental Death and Total and Permanent Disablement Rider.");
////////                document.form1.ADBRSA.focus();
////////                document.form1.ADBRSA.select();
////////                return false;
////////            }          

//////////            if(asa<baseSA || asa>5000000)
//////////            {
//////////                alert("Reliance Accidental Death and Total and Permanent Disablement Rider Sum Assured should be between Rs."+baseSA+" and Rs.5000000");
//////////                document.form1.ADBRSA.focus();
//////////                document.form1.ADBRSA.select();
//////////                return false;
//////////            }

////////        }
////////        if(document.form1.chkTermliferider.checked==true)
////////        { 
////////            var age=parseFloat(document.form1.TLBRAge.value);
////////            var termr=parseFloat(document.form1.TLBRTerm.value);
////////            var baseSA=parseFloat(document.form1.SA.value);
////////            var asa=parseFloat(document.form1.TLBRSA.value);
////////            var baseterm=parseFloat(document.form1.Term.value);
////////            if(age==0)
////////            {
////////                alert("Please enter the age for Reliance Term Life Insurance Benefit Rider.");
////////                document.form1.TLBRAge.focus();
////////                document.form1.TLBRAge.select();
////////                return false;
////////            }
////////            if(age<18 || age>59)
////////            {
////////                alert("Invalid Rider Age. Please enter Reliance Term Life Insurance Benefit Rider Age between 18 and 59.");
////////                document.form1.TLBRAge.focus();
////////                document.form1.TLBRAge.select();
////////                return false;
////////            } 
////////            
////////            //term and sa
////////            if(termr==0)
////////            {
////////                alert("Please enter the term for Reliance Term Life Insurance Benefit Rider.");
////////                document.form1.TLBRTerm.focus();
////////                document.form1.TLBRTerm.select();
////////                return false;
////////            }
////////            if(termr<5 || termr>30)
////////            {
////////                alert("Term for Reliance Term Life Insurance Benefit Rider should be between 5 and 30");
////////                document.form1.TLBRTerm.focus();
////////                document.form1.TLBRTerm.select();
////////                return false;
////////            } 
////////            
////////            if(asa==0)
////////            {
////////                alert("Please enter sum assured for Reliance Term Life Insurance Benefit Rider.");
////////                document.form1.TLBRSA.focus();
////////                document.form1.TLBRSA.select();
////////                return false;
////////            }           
//////////            if(asa!=baseSA)
//////////            {
//////////                alert("Reliance Term Life Insurance Benefit Rider Sum Assured should be equal to the basic Sum Assured.");
//////////                document.form1.TLBRSA.focus();
//////////                document.form1.TLBRSA.select();
//////////                return false;
//////////            }
////////        }
////////        if(document.form1.chkmajor.checked==true)
////////        { 
////////            var age=parseFloat(document.form1.MSBRAge.value);
////////            var termr=parseFloat(document.form1.MSBRTerm.value);
////////            var baseSA=parseFloat(document.form1.SA.value);
////////            var asa=parseFloat(document.form1.MSBRSA.value);
////////            if(age==0)
////////            {
////////                alert("Please enter the age for Reliance New Major Surgical Benefit Rider.");
////////                document.form1.MSBRAge.focus();
////////                document.form1.MSBRAge.select();
////////                return false;
////////            }
////////            if(age<18 || age>55)
////////            {
////////                alert("Invalid Rider Age. Please enter Reliance New Major Surgical Benefit Rider Age between 18 and 55.");
////////                document.form1.MSBRAge.focus();
////////                document.form1.MSBRAge.select();
////////                return false;
////////            } 
////////            
////////            //term and sa
////////            if(termr==0)
////////            {
////////                alert("Please enter the term for Reliance New Major Surgical Benefit Rider.");
////////                document.form1.MSBRTerm.focus();
////////                document.form1.MSBRTerm.select();
////////                return false;
////////            }
////////            if(termr<5 || termr>25)
////////            {
////////                alert("Term for Reliance New Major Surgical Benefit Rider should be between 5 and 25.");
////////                document.form1.MSBRTerm.focus();
////////                document.form1.MSBRTerm.select();
////////                return false;
////////            }             
////////            if(asa==0)
////////            {
////////                alert("Please enter sum assured for Reliance New Major Surgical Benefit Rider.");
////////                document.form1.MSBRSA.focus();
////////                document.form1.MSBRSA.select();
////////                return false;
////////            }
//////////            if(asa<10000 || asa>Math.min(baseSA,500000))
//////////            {
//////////                alert("Reliance New Major Surgical Benefit Rider Sum Assured should be between Rs.10000 and "+"Rs."+Math.min(baseSA,500000));
//////////                document.form1.MSBRSA.focus();
//////////                document.form1.MSBRSA.select();
//////////                return false;
//////////            }
////////        }
////////        if(document.form1.chkccrider.checked==true)
////////        { 
////////            var age=parseFloat(document.form1.CCRAge.value);
////////            var termr=parseFloat(document.form1.CCRTerm.value);
////////            var baseSA=parseFloat(document.form1.SA.value);
////////            var asa=parseFloat(document.form1.CCRSA.value);
////////            if(age==0)
////////            {
////////                alert("Please enter the age for Reliance New Critical Conditions (25) Rider.");
////////                document.form1.CCRAge.focus();
////////                document.form1.CCRAge.select();
////////                return false;
////////            }
////////            if(age<18 || age>55)
////////            {
////////                alert("Invalid Rider Age. Please enter Reliance New Critical Conditions (25) Rider Age between 18 and 55.");
////////                document.form1.CCRAge.focus();
////////                document.form1.CCRAge.select();
////////                return false;
////////            } 

////////            //term and sa
////////            if(termr==0)
////////            {
////////                alert("Please enter the term for Reliance New Critical Conditions (25) Rider.");
////////                document.form1.CCRTerm.focus();
////////                document.form1.CCRTerm.select();
////////                return false;
////////            }
////////            if(termr<5 || termr>25)
////////            {
////////                alert("Term for Reliance New Critical Conditions (25) Rider should be between 5 and 25.");
////////                document.form1.CCRTerm.focus();
////////                document.form1.CCRTerm.select();
////////                return false;
////////            } 
////////            
////////            if(asa==0)
////////            {
////////                alert("Please enter sum assured for Reliance New Critical Conditions (25) Rider.");
////////                document.form1.CCRSA.focus();
////////                document.form1.CCRSA.select();
////////                return false;
////////            }
//////////            if(asa<10000 || asa>Math.min(baseSA,2000000))
//////////            {
//////////                alert("Reliance New Critical Conditions (25) Rider Sum Assured should be between Rs.10000 and Rs."+Math.min(baseSA,2000000));
//////////                document.form1.CCRSA.focus();
//////////                document.form1.CCRSA.select();
//////////                return false;
//////////            }
        //}
        return true;
    }
//**************************************************************************************************************


//*************************** SUPER GOLDEN YEAR VALUE TERM 10 PLAN **********************************************
function GYPValueTerm10Plan()
    {
        var mode = (document.form1.Mode.value);
        var ann_prm = parseInt(document.form1.A_Prem.value);
        var min_SA = (ann_prm * 5);
        var max_SA = (ann_prm * 50);

        if(document.form1.txtName.value=="" || document.form1.txtName.value==null)
        {
            alert("Please enter your/Customer's name.");
            document.form1.txtName.focus();
            return false;
        }
        if(document.form1.txtAdvisor.value=="" || document.form1.txtAdvisor.value==null)
        {
            alert("Please enter your/Advisor name");
            document.form1.txtAdvisor.focus();
            return false;
        }
        if(document.form1.Sex.value=="Select")
        {
            alert("Please select your Sex");
            document.form1.Sex.focus();
            return false;
        }
        if(document.form1.Age.value=="Select")
        {
            alert("Please select your Age");
            document.form1.Age.focus();
            return false;
        }
//        if(document.form1.Term.value=="" || document.form1.Term.value==null)
//        {
//            alert("Please enter Policy Term");
//            document.form1.Term.focus();
//            return false;
//        }
//        if(document.form1.Term.value<16)
//        {
//            alert("Minimum Policy Term should be 16");
//            document.form1.Term.focus();
//            return false;
//        }        
        if(document.form1.Mode.value=="Select")
        {
            alert("Please select Mode of Premium Payment");
            document.form1.Mode.focus();
            return false;
        }
        if(document.form1.IP.value=="" || document.form1.IP.value==null || document.form1.IP.value==0)
        {
            alert("Please Enter Installment Premium");
            document.form1.IP.focus();
            return false;
        }
       
       
        if(document.form1.SA1.value=="" || document.form1.SA1.value==null || document.form1.SA1.value==0)
        {
            alert("Please enter basic Sum Assured.");
            document.form1.SA1.focus();
            return false;
        }         
        
        if(document.form1.ChkADTPD.checked==true)
        { 
            var age=parseFloat(document.form1.ADBRAge.value);
            var termr=parseFloat(document.form1.ADBRTerm.value);
            var baseval=parseFloat(document.form1.Term.value);
            var baseSA=parseFloat(document.form1.SA.value);
            var asa=parseFloat(document.form1.ADBRSA.value);
            
            if(age==0 || document.form1.ADBRAge.value=="" || document.form1.ADBRAge.value==null)
            {
                alert("Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Age.");
                document.form1.ADBRAge.focus();
                document.form1.ADBRAge.select();
                return false;
            }
//            if(age<18 || age>60)
//            {
//                alert("Invalid Rider Age. Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Age between 18 and 60.");
//                document.form1.ADBRAge.focus();
//                document.form1.ADBRAge.select();
//                return false;
//            } 
            
            //term nd sa
            if(termr==0 || document.form1.ADBRTerm.value=="" || document.form1.ADBRTerm.value==null)
            {
                alert("Please enter the term for Reliance Accidental Death and Total and Permanent Disablement Rider.");
                document.form1.ADBRTerm.focus();
                document.form1.ADBRTerm.select();
                return false;
            }
//            if(termr<5 )
//            {
//                alert("Reliance Accidental Death and Total and Permanent Disablement Rider should be 5");
//                document.form1.ADBRTerm.focus();
//                document.form1.ADBRTerm.select();
//                return false;
//            } 
           
            if(asa==0 || document.form1.ADBRSA.value=="" || document.form1.ADBRSA.value==null)
            {
                alert("Please enter sum assured for Reliance Accidental Death and Total and Permanent Disablement Rider.");
                document.form1.ADBRSA.focus();
                document.form1.ADBRSA.select();
                return false;
            }          
//            if(asa<25000)
//            {
//                alert("Minimum Sum Assured for Reliance Accidental Death and Total and Permanent Disablement Rider should be Rs.25000");
//                document.form1.ADBRSA.focus();
//                document.form1.ADBRSA.select();
//                return false;
//            }
//            if(asa<baseSA || asa>5000000)
//            {
//                alert("Reliance Accidental Death and Total and Permanent Disablement Rider Sum Assured should be between Rs."+baseSA+" and Rs.5000000");
//                document.form1.ADBRSA.focus();
//                document.form1.ADBRSA.select();
//                return false;
//            }

        }
        if(document.form1.chkTermliferider.checked==true)
        { 
            var age=parseFloat(document.form1.TLBRAge.value);
            var termr=parseFloat(document.form1.TLBRTerm.value);
            var baseSA=parseFloat(document.form1.SA.value);
            var asa=parseFloat(document.form1.TLBRSA.value);
            var baseterm=parseFloat(document.form1.Term.value);
            if(age==0 || document.form1.TLBRAge.value=="" || document.form1.TLBRAge.value==null)
            {
                alert("Please enter the age for Reliance Term Life Insurance Benefit Rider.");
                document.form1.TLBRAge.focus();
                document.form1.TLBRAge.select();
                return false;
            }
//            if(age<18 || age>59)
//            {
//                alert("Invalid Rider Age. Please enter Reliance Term Life Insurance Benefit Rider Age between 18 and 59.");
//                document.form1.TLBRAge.focus();
//                document.form1.TLBRAge.select();
//                return false;
//            } 
            
            //term and sa
            if(termr==0 || document.form1.TLBRTerm.value=="" || document.form1.TLBRTerm.value==null)
            {
                alert("Please enter the term for Reliance Term Life Insurance Benefit Rider.");
                document.form1.TLBRTerm.focus();
                document.form1.TLBRTerm.select();
                return false;
            }
//            if(termr<5 || termr>10)
//            {
//                alert("Term for Reliance Term Life Insurance Benefit Rider should be between 5 and 10");
//                document.form1.TLBRTerm.focus();
//                document.form1.TLBRTerm.select();
//                return false;
//            } 
//            
            if(asa==0 || document.form1.TLBRSA.value=="" || document.form1.TLBRSA.value==null)
            {
                alert("Please enter sum assured for Reliance Term Life Insurance Benefit Rider.");
                document.form1.TLBRSA.focus();
                document.form1.TLBRSA.select();
                return false;
            }           
//            if(asa<25000 || asa>baseSA)
//            {
//                alert("Reliance Term Life Insurance Benefit Rider Sum Assured should be between 25000 and basic Sum Assured.");
//                document.form1.TLBRSA.focus();
//                document.form1.TLBRSA.select();
//                return false;
//            }
        }
        if(document.form1.chkmajor.checked==true)
        { 
            var age=parseFloat(document.form1.MSBRAge.value);
            var termr=parseFloat(document.form1.MSBRTerm.value);
            var baseSA=parseFloat(document.form1.SA.value);
            var asa=parseFloat(document.form1.MSBRSA.value);
            if(age==0 || document.form1.MSBRAge.value=="" || document.form1.MSBRAge.value==null)
            {
                alert("Please enter the age for Reliance New Major Surgical Benefit Rider.");
                document.form1.MSBRAge.focus();
                document.form1.MSBRAge.select();
                return false;
            }
//            if(age<18 || age>55)
//            {
//                alert("Invalid Rider Age. Please enter Reliance New Major Surgical Benefit Rider Age between 18 and 55.");
//                document.form1.MSBRAge.focus();
//                document.form1.MSBRAge.select();
//                return false;
//            } 
            
            //term and sa
            if(termr==0 || document.form1.MSBRTerm.value=="" || document.form1.MSBRTerm.value==null)
            {
                alert("Please enter the term for Reliance New Major Surgical Benefit Rider.");
                document.form1.MSBRTerm.focus();
                document.form1.MSBRTerm.select();
                return false;
            }
//            if(termr<5 || termr>10)
//            {
//                alert("Term for Reliance New Major Surgical Benefit Rider should be between 5 and 10.");
//                document.form1.MSBRTerm.focus();
//                document.form1.MSBRTerm.select();
//                return false;
//            }             
            if(asa==0 || document.form1.MSBRSA.value=="" || document.form1.MSBRSA.value==null)
            {
                alert("Please enter sum assured for Reliance New Major Surgical Benefit Rider.");
                document.form1.MSBRSA.focus();
                document.form1.MSBRSA.select();
                return false;
            }
//            if(asa<10000 || asa>Math.min(baseSA,500000))
//            {
//                alert("Reliance New Major Surgical Benefit Rider Sum Assured should be between Rs.10000 and "+"Rs."+Math.min(baseSA,500000));
//                document.form1.MSBRSA.focus();
//                document.form1.MSBRSA.select();
//                return false;
//            }
        }
        if(document.form1.chkccrider.checked==true)
        { 
            var age=parseFloat(document.form1.CCRAge.value);
            var termr=parseFloat(document.form1.CCRTerm.value);
            var baseSA=parseFloat(document.form1.SA.value);
            var asa=parseFloat(document.form1.CCRSA.value);
            if(age==0 || document.form1.CCRAge.value=="" || document.form1.CCRAge.value==null)
            {
                alert("Please enter the age for Reliance New Critical Conditions (25) Rider.");
                document.form1.CCRAge.focus();
                document.form1.CCRAge.select();
                return false;
            }
//            if(age<18 || age>55)
//            {
//                alert("Invalid Rider Age. Please enter Reliance New Critical Conditions (25) Rider Age between 18 and 55.");
//                document.form1.CCRAge.focus();
//                document.form1.CCRAge.select();
//                return false;
//            } 

            //term and sa
            if(termr==0 || document.form1.CCRTerm.value=="" || document.form1.CCRTerm.value==null)
            {
                alert("Please enter the term for Reliance New Critical Conditions (25) Rider.");
                document.form1.CCRTerm.focus();
                document.form1.CCRTerm.select();
                return false;
            }
//            if(termr<5 || termr>10)
//            {
//                alert("Term for Reliance New Critical Conditions (25) Rider should be between 5 and 10.");
//                document.form1.CCRTerm.focus();
//                document.form1.CCRTerm.select();
//                return false;
//            } 
            
            if(asa==0 || document.form1.CCRSA.value=="" || document.form1.CCRSA.value==null)
            {
                alert("Please enter sum assured for Reliance New Critical Conditions (25) Rider.");
                document.form1.CCRSA.focus();
                document.form1.CCRSA.select();
                return false;
            }
//            if(asa<10000 || asa>Math.min(baseSA,2000000))
//            {
//                alert("Reliance New Critical Conditions (25) Rider Sum Assured should be between Rs.10000 and Rs."+Math.min(baseSA,2000000));
//                document.form1.CCRSA.focus();
//                document.form1.CCRSA.select();
//                return false;
//            }
        }
        return true;
    }

//****************************************************************************************************************

//***************** SUPER INVESTASSURE BASIC PLAN***************************************

function SuperInvestAssureBasic()
    {
        var mode = (document.form1.Mode.value);
        var ann_prm = parseInt(document.form1.A_Prem.value);
        var min_SA = (ann_prm * 5);
        var max_SA = (ann_prm * 50);

        if(document.form1.txtName.value=="" || document.form1.txtName.value==null)
        {
            alert("Please enter your/Customer's name.");
            document.form1.txtName.focus();
            return false;
        }
        if(document.form1.txtAdvisor.value=="" || document.form1.txtAdvisor.value==null)
        {
            alert("Please enter your/Advisor name");
            document.form1.txtAdvisor.focus();
            return false;
        }
        if(document.form1.Sex.value=="Select")
        {
            alert("Please select your Sex");
            document.form1.Sex.focus();
            return false;
        }
        if(document.form1.Age.value=="Select")
        {
            alert("Please select your Age");
            document.form1.Age.focus();
            return false;
        }
        if(document.form1.Term.value=="Select")
        {
            alert("Please select Policy Term");
            document.form1.Term.focus();
            return false;
        }         
        if(document.form1.Mode.value=="Select")
        {
            alert("Please select Mode of Premium Payment");
            document.form1.Mode.focus();
            return false;
        }
        if(document.form1.IP.value=="" || document.form1.IP.value==null || document.form1.IP.value==0)
        {
            alert("Please Enter Installment Premium");
            document.form1.IP.focus();
            return false;
        }
        if(document.form1.SA1.value=="" || document.form1.SA1.value==null || document.form1.SA1.value==0)
        {
            alert("Please enter basic Sum Assured.");
            document.form1.SA1.focus();
            return false;
        }         
        
        if(document.form1.ChkADTPD.checked==true)
        { 
            var age=parseFloat(document.form1.ADBRAge.value);
            var termr=parseFloat(document.form1.ADBRTerm.value);
            var baseval=parseFloat(document.form1.Term.value);
            var baseSA=parseFloat(document.form1.SA.value);
            var asa=parseFloat(document.form1.ADBRSA.value);
            var baseTerm=parseFloat(document.form1.Term.value);
            if(age==0 || document.form1.ADBRAge.value=="" || document.form1.ADBRAge.value==null)
            {
                alert("Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Age.");
                document.form1.ADBRAge.focus();
                document.form1.ADBRAge.select();
                return false;
            }
//            if(age<18 || age>60)
//            {
//                alert("Invalid Rider Age. Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Age between 18 and 60.");
//                document.form1.ADBRAge.focus();
//                document.form1.ADBRAge.select();
//                return false;
//            } 
            
            //term nd sa
            if(termr==0 || document.form1.ADBRTerm.value=="" || document.form1.ADBRTerm.value==null)
            {
                alert("Please enter the term for Reliance Accidental Death and Total and Permanent Disablement Rider.");
                document.form1.ADBRTerm.focus();
                document.form1.ADBRTerm.select();
                return false;
            }
//            if(termr<5 || termr>baseTerm)
//            {
//                alert("Reliance Accidental Death and Total and Permanent Disablement Rider should be between 5 and " + baseTerm);
//                document.form1.ADBRTerm.focus();
//                document.form1.ADBRTerm.select();
//                return false;
//            } 
            
            if(asa==0 || document.form1.ADBRSA.value=="" || document.form1.ADBRSA.value==null)
            {
                alert("Please enter sum assured for Reliance Accidental Death and Total and Permanent Disablement Rider.");
                document.form1.ADBRSA.focus();
                document.form1.ADBRSA.select();
                return false;
            }      
//            if(asa<25000)
//            {
//                alert("Minimum Sum Assured for Reliance Accidental Death and Total and Permanent Disablement Rider should be Rs.25000");
//                document.form1.ADBRSA.focus();
//                document.form1.ADBRSA.select();
//                return false;
//            }
//            if(asa<baseSA || asa>5000000)
//            {
//                alert("Reliance Accidental Death and Total and Permanent Disablement Rider Sum Assured should be between Rs."+baseSA+" and Rs.5000000");
//                document.form1.ADBRSA.focus();
//                document.form1.ADBRSA.select();
//                return false;
//            }

        }
        if(document.form1.chkTermliferider.checked==true)
        { 
            var age=parseFloat(document.form1.TLBRAge.value);
            var termr=parseFloat(document.form1.TLBRTerm.value);
            var baseSA=parseFloat(document.form1.SA.value);
            var asa=parseFloat(document.form1.TLBRSA.value);
            var baseterm=parseFloat(document.form1.Term.value);
             var baseTerm=parseFloat(document.form1.Term.value);
            if(age==0 || document.form1.TLBRAge.value=="" || document.form1.TLBRAge.value==null)
            {
                alert("Please enter the age for Reliance Term Life Insurance Benefit Rider.");
                document.form1.TLBRAge.focus();
                document.form1.TLBRAge.select();
                return false;
            }
//            if(age<18 || age>59)
//            {
//                alert("Invalid Rider Age. Please enter Reliance Term Life Insurance Benefit Rider Age between 18 and 59.");
//                document.form1.TLBRAge.focus();
//                document.form1.TLBRAge.select();
//                return false;
//            } 
            
            //term and sa
            if(termr==0 || document.form1.TLBRTerm.value=="" || document.form1.TLBRTerm.value==null)
            {
                alert("Please enter the term for Reliance Term Life Insurance Benefit Rider.");
                document.form1.TLBRTerm.focus();
                document.form1.TLBRTerm.select();
                return false;
            }
//            if(termr<5 || termr>Math.min(30,baseTerm))
//            {
//                alert("Term for Reliance Term Life Insurance Benefit Rider should be between 5 and "+ Math.min(30,baseTerm));
//                document.form1.TLBRTerm.focus();
//                document.form1.TLBRTerm.select();
//                return false;
//            } 
            
            if(asa==0 || document.form1.TLBRSA.value=="" || document.form1.TLBRSA.value==null)
            {
                alert("Please enter sum assured for Reliance Term Life Insurance Benefit Rider.");
                document.form1.TLBRSA.focus();
                document.form1.TLBRSA.select();
                return false;
            }          
//            if(asa<25000 || asa>baseSA)
//            {
//                alert("Reliance Term Life Insurance Benefit Rider Sum Assured should be between 25000 and " + baseSA);
//                document.form1.TLBRSA.focus();
//                document.form1.TLBRSA.select();
//                return false;
//            }
        }
        if(document.form1.chkmajor.checked==true)
        { 
            var age=parseFloat(document.form1.MSBRAge.value);
            var termr=parseFloat(document.form1.MSBRTerm.value);
            var baseSA=parseFloat(document.form1.SA.value);
            var asa=parseFloat(document.form1.MSBRSA.value);
            var baseTerm=parseFloat(document.form1.Term.value);
            if(age==0 || document.form1.MSBRAge.value=="" || document.form1.MSBRAge.value==null)
            {
                alert("Please enter the age for Reliance New Major Surgical Benefit Rider.");
                document.form1.MSBRAge.focus();
                document.form1.MSBRAge.select();
                return false;
            }
//            if(age<18 || age>55)
//            {
//                alert("Invalid Rider Age. Please enter Reliance New Major Surgical Benefit Rider Age between 18 and 55.");
//                document.form1.MSBRAge.focus();
//                document.form1.MSBRAge.select();
//                return false;
//            } 
            
            //term and sa
            if(termr==0 || document.form1.MSBRTerm.value=="" || document.form1.MSBRTerm.value==null)
            {
                alert("Please enter the term for Reliance New Major Surgical Benefit Rider.");
                document.form1.MSBRTerm.focus();
                document.form1.MSBRTerm.select();
                return false;
            }
//            if(termr<5 || termr>Math.min(25,baseTerm))
//            {
//                alert("Term for Reliance New Major Surgical Benefit Rider should be between 5 and "+Math.min(25,baseTerm));
//                document.form1.MSBRTerm.focus();
//                document.form1.MSBRTerm.select();
//                return false;
//            }             
            if(asa==0 || document.form1.MSBRSA.value=="" || document.form1.MSBRSA.value==null)
            {
                alert("Please enter sum assured for Reliance New Major Surgical Benefit Rider.");
                document.form1.MSBRSA.focus();
                document.form1.MSBRSA.select();
                return false;
            }
//            if(asa<10000 || asa>Math.min(baseSA,500000))
//            {
//                alert("Reliance New Major Surgical Benefit Rider Sum Assured should be between Rs.10000 and "+"Rs."+Math.min(baseSA,500000));
//                document.form1.MSBRSA.focus();
//                document.form1.MSBRSA.select();
//                return false;
//            }
        }
        if(document.form1.chkccrider.checked==true)
        { 
            var age=parseFloat(document.form1.CCRAge.value);
            var termr=parseFloat(document.form1.CCRTerm.value);
            var baseSA=parseFloat(document.form1.SA.value);
            var asa=parseFloat(document.form1.CCRSA.value);
            if(age==0 || document.form1.CCRAge.value=="" || document.form1.CCRAge.value==null)
            {
                alert("Please enter the age for Reliance New Critical Conditions (25) Rider.");
                document.form1.CCRAge.focus();
                document.form1.CCRAge.select();
                return false;
            }
//            if(age<18 || age>55)
//            {
//                alert("Invalid Rider Age. Please enter Reliance New Critical Conditions (25) Rider Age between 18 and 55.");
//                document.form1.CCRAge.focus();
//                document.form1.CCRAge.select();
//                return false;
//            } 

            //term and sa
            if(termr==0 || document.form1.CCRTerm.value=="" || document.form1.CCRTerm.value==null)
            {
                alert("Please enter the term for Reliance New Critical Conditions (25) Rider.");
                document.form1.CCRTerm.focus();
                document.form1.CCRTerm.select();
                return false;
            }
//            if(termr<5 || termr>Math.min(25,baseTerm))
//            {
//                alert("Term for Reliance New Critical Conditions (25) Rider should be between 5 and "+Math.min(25,baseTerm));
//                document.form1.CCRTerm.focus();
//                document.form1.CCRTerm.select();
//                return false;
//            } 
       
            if(asa==0 || document.form1.CCRSA.value=="" || document.form1.CCRSA.value==null)
            {
                alert("Please enter sum assured for Reliance New Critical Conditions (25) Rider.");
                document.form1.CCRSA.focus();
                document.form1.CCRSA.select();
                return false;
            }
//            if(asa<10000 || asa>Math.min(baseSA,2000000))
//            {
//                alert("Reliance New Critical Conditions (25) Rider Sum Assured should be between Rs.10000 and Rs."+Math.min(baseSA,2000000));
//                document.form1.CCRSA.focus();
//                document.form1.CCRSA.select();
//                return false;
//            }
        }
        return true;
    }

//***************************************************************************************


//***************** RELIANCE GOLDEN YEAR BASIC PLAN ***************************************

function SuperGoldenYearBasicPlan()
    {
        var mode = (document.form1.Mode.value);
        var ann_prm = parseInt(document.form1.A_Prem.value);
        var min_SA = (ann_prm * 5);
        var max_SA = (ann_prm * 50);

        if(document.form1.txtName.value=="" || document.form1.txtName.value==null)
        {
            alert("Please enter your/Customer's name.");
            document.form1.txtName.focus();
            return false;
        }
        if(document.form1.txtAdvisor.value=="" || document.form1.txtAdvisor.value==null)
        {
            alert("Please enter your/Advisor name");
            document.form1.txtAdvisor.focus();
            return false;
        }
        if(document.form1.Sex.value=="Select")
        {
            alert("Please select your Sex");
            document.form1.Sex.focus();
            return false;
        }
        if(document.form1.Age.value=="Select")
        {
            alert("Please select your Age");
            document.form1.Age.focus();
            return false;
        }
         if(document.form1.Term.value=="")
        {
            alert("Please enter your Term");
            document.form1.Term.focus();
            return false;
        }     
        if(document.form1.Term.value<16)
        {
            alert("Minimum Term should be 16");
            document.form1.Term.focus();
            return false;
        }        
        if(document.form1.MODETYPE.value=="Select")
        {
            alert("Please select Premium Paying Type");
            document.form1.MODETYPE.focus();
            return false;
        }
        
         if(document.form1.MODETYPE.value=="Single Premium" &&(document.form1.AP.value=="" || document.form1.AP.value==null || document.form1.AP.value==0))
        {
            alert("Please enter Amount of Single Premium");
            document.form1.AP.focus();
            return false;
        }
        if(document.form1.MODETYPE.value=="Regular Premium" && document.form1.Mode.value=="Select")
        {
            alert("Please select Mode of Premium Payment");
            document.form1.Mode.focus();
            return false;
        }
        if(document.form1.MODETYPE.value=="Regular Premium" && (document.form1.IP.value=="" || document.form1.IP.value==null || document.form1.IP.value==0))
        {
            alert("Please enter installment premium");
            document.form1.IP.focus();
            return false;
        }
        if(document.form1.MODETYPE.value=="Single Premium" && document.form1.AP.value<50000)
        {
            alert("Minimum Amount of Single Premium should be 50000");
            document.form1.AP.focus();
            return false;
        }      
    }    
//*****************************************************************************************


// *************************** SUPER AUTOMATIC INVESTMENT BASIC PLAN ***********************
function ShowHideFundAIPBASIC()
    {   
        if (document.form1.FundOpt.value == "Tailor Made")
        {
            document.getElementById("Fund1").style.visibility = "visible";
            document.getElementById("Fund2").style.visibility = "visible";
            document.getElementById("Fund3").style.visibility = "visible";
            document.getElementById("Fund4").style.visibility = "visible";
            document.getElementById("Fund5").style.visibility = "visible";
            document.getElementById("Fund6").style.visibility = "visible";
            document.getElementById("Fund7").style.visibility = "visible";
            document.getElementById("Fund8").style.visibility = "visible";
            
            
            document.getElementById("Fund1").style.display="block";
            document.getElementById("Fund2").style.display="block";
            document.getElementById("Fund3").style.display="block";
            document.getElementById("Fund4").style.display="block";
            document.getElementById("Fund5").style.display="block";
            document.getElementById("Fund6").style.display="block"; 
            document.getElementById("Fund7").style.display="block";
            document.getElementById("Fund8").style.display="block";   
            document.getElementById("FundValue").value="2"; 
            
            document.getElementById("Fund1").value="0";
            document.getElementById("Fund2").value="0";
            document.getElementById("Fund3").value="0";
            document.getElementById("Fund4").value="0";
            document.getElementById("Fund5").value="0";
            document.getElementById("Fund6").value="0";
            document.getElementById("Fund7").value="0";
            document.getElementById("Fund8").value="0";       
        }
        else 
        {
            document.getElementById("Fund1").style.visibility = "hidden";
            document.getElementById("Fund2").style.visibility = "hidden";
            document.getElementById("Fund3").style.visibility = "hidden";
            document.getElementById("Fund4").style.visibility = "hidden";
            document.getElementById("Fund5").style.visibility = "hidden";
            document.getElementById("Fund6").style.visibility = "hidden";
            document.getElementById("Fund7").style.visibility = "hidden";
            document.getElementById("Fund8").style.visibility = "hidden";
            
            document.getElementById("Fund1").style.display="none";
            document.getElementById("Fund2").style.display="none";
            document.getElementById("Fund3").style.display="none";
            document.getElementById("Fund4").style.display="none";
            document.getElementById("Fund5").style.display="none";
            document.getElementById("Fund6").style.display="none" 
            document.getElementById("Fund7").style.display="none";
            document.getElementById("Fund8").style.display="none";
            
            document.getElementById("Fund1").value="0";
            document.getElementById("Fund2").value="0";
            document.getElementById("Fund3").value="0";
            document.getElementById("Fund4").value="0";
            document.getElementById("Fund5").value="0";
            document.getElementById("Fund6").value="0";
            document.getElementById("Fund7").value="0";
            document.getElementById("Fund8").value="0";
              
            document.getElementById("FundValue").value="1";            
        }
    }
    
    function ShowHidePlanRider()
    {   
        if (document.form1.PType.value == "Regular Premium" || document.form1.PType.value =="Limited Premium")
        {
            document.getElementById("rider1").style.visibility = "visible";
            document.getElementById("rider2").style.visibility = "visible";
            document.getElementById("rider3").style.visibility = "visible";
            document.getElementById("rider4").style.visibility = "visible";
            document.getElementById("rider5").style.visibility = "visible";
            
            document.getElementById("rider1").style.display="block";
            document.getElementById("rider2").style.display="block";
            document.getElementById("rider3").style.display="block";
            document.getElementById("rider4").style.display="block";
            document.getElementById("rider5").style.display="block";
            
            document.form1.AP.value=0;
		  
		  document.getElementById("ridreg1").style.visibility = "visible" 
		  document.getElementById("ridreg2").style.visibility = "visible" 
		  document.getElementById("ridreg3").style.visibility = "visible" 
		 // document.getElementById("ridreg4").style.visibility = "visible" 
		  document.getElementById("ridreg1").style.display="block"
		  document.getElementById("ridreg2").style.display="block"
		  document.getElementById("ridreg3").style.display="block"
		 // document.getElementById("ridreg4").style.display="block"
             document.getElementById("singprem").style.visibility = "hidden" 
		  document.getElementById("singprem").style.display="none"
		  

        }
        else 
        {
            document.getElementById("rider1").style.visibility = "hidden";
            document.getElementById("rider2").style.visibility = "hidden";
            document.getElementById("rider3").style.visibility = "hidden";
            document.getElementById("rider4").style.visibility = "hidden";
            document.getElementById("rider5").style.visibility = "hidden";

            document.getElementById("rider1").style.display="none";
            document.getElementById("rider2").style.display="none";
            document.getElementById("rider3").style.display="none";
            document.getElementById("rider4").style.display="none";
            document.getElementById("rider5").style.display="none";
            
          
		  document.form1.A_Prem.value="0";
		  document.getElementById("singprem").style.visibility = "visible" 
		  document.getElementById("singprem").style.display="block"
		  document.getElementById("ridreg1").style.visibility = "hidden" 
		  //document.getElementById("ridreg1").style.display="block"
		  document.getElementById("ridreg2").style.visibility = "hidden" 
		  document.getElementById("ridreg3").style.visibility = "hidden" 
		  // document.getElementById("ridreg4").style.visibility = "hidden" 
		  document.getElementById("ridreg1").style.display="none"
		  document.getElementById("ridreg2").style.display="none"
		  document.getElementById("ridreg3").style.display="none"
		   //document.getElementById("ridreg4").style.display="none"
//		    document.form1.Mode.remove(4);
//            document.form1.Mode.remove(3);
//            document.form1.Mode.remove(2); 
//            document.form1.Mode.remove(0); 
            document.form1.A_Prem1.value=="0";
              document.form1.A_Prem.value=="0";
        }
       
    }
    function blankfundBasicForAIPBASIC()
    {
        if(document.form1.NMMF.value=="" || document.form1.NMMF.value==null)
        {
            document.form1.NMMF.value=0;
        } 
        if(document.form1.NCBF.value=="" || document.form1.NCBF.value==null)
        {
            document.form1.NCBF.value=0;
        } 
        if(document.form1.NGF.value=="" || document.form1.NGF.value==null)
        {
            document.form1.NGF.value=0;
        } 
        if(document.form1.NEF.value=="" || document.form1.NEF.value==null)
        {
            document.form1.NEF.value=0;
        } 
        if(document.form1.NPEF.value=="" || document.form1.NPEF.value==null)
        {
            document.form1.NPEF.value=0; 
        } 
        if(document.form1.NIF.value=="" || document.form1.NIF.value==null)
        {
            document.form1.NIF.value=0; 
        } 
        if(document.form1.NENF.value=="" || document.form1.NENF.value==null)
        {
            document.form1.NENF.value=0;
        } 
        if(document.form1.NMF.value=="" || document.form1.NMF.value==null)
        {
            document.form1.NMF.value=0; 
        }
    }
    
    
     function blankfundBasicForRLIC_NBF()
    {
        if(document.form1.NMMF.value=="" || document.form1.NMMF.value==null)
        {
            document.form1.NMMF.value=0;
        } 
        if(document.form1.NCBF.value=="" || document.form1.NCBF.value==null)
        {
            document.form1.NCBF.value=0;
        } 
        if(document.form1.NGF.value=="" || document.form1.NGF.value==null)
        {
            document.form1.NGF.value=0;
        } 
        if(document.form1.NEF.value=="" || document.form1.NEF.value==null)
        {
            document.form1.NEF.value=0;
        } 
        if(document.form1.NPEF.value=="" || document.form1.NPEF.value==null)
        {
            document.form1.NPEF.value=0; 
        } 
        if(document.form1.NIF.value=="" || document.form1.NIF.value==null)
        {
            document.form1.NIF.value=0; 
        } 
        if(document.form1.NBF.value=="" || document.form1.NBF.value==null)
        {
            document.form1.NBF.value=0;
        } 
        if(document.form1.NMF.value=="" || document.form1.NMF.value==null)
        {
            document.form1.NMF.value=0; 
        }
    }
    function SuperAutomaticInvestmentBasic()
    {    
        var mode = (document.form1.Mode.value);
        var ann_prm = parseInt(document.form1.A_Prem.value);
        var min_SA = (ann_prm * 5);
        var max_SA = (ann_prm * 50);

        if(document.form1.txtName.value=="" || document.form1.txtName.value==null)
        {
            alert("Please enter your/Customer's name.");
            document.form1.txtName.focus();
            return false;
        }
        if(document.form1.txtAdvisor.value=="" || document.form1.txtAdvisor.value==null)
        {
            alert("Please enter your/Advisor name");
            document.form1.txtAdvisor.focus();
            return false;
        }
        if(document.form1.Sex.value=="Select")
        {
            alert("Please select your Sex");
            document.form1.Sex.focus();
            return false;
        }
        if(document.form1.Age.value=="Select")
        {
            alert("Please select your Age");
            document.form1.Age.focus();
            return false;
        }
        if(document.form1.Term.value=="Select")
        {
            alert("Please select Policy Term");
            document.form1.Term.focus();
            return false;
        }
        if(document.form1.PType.value=="Select")
        {
            alert("Please select Premium Paying Type");
            document.form1.PType.focus();
            return false;
        }        
        if((document.form1.PType.value=="Regular Premium" || document.form1.PType.value=="Limited Premium") && document.form1.Mode.value=="Select")
        {
            alert("Please select Mode of Premium Payment");
            document.form1.Mode.focus();
            return false;
        }
         
        if((document.form1.PType.value=="Regular Premium" || document.form1.PType.value=="Limited Premium")&&(document.form1.IP.value=="" || document.form1.IP.value==null || document.form1.IP.value==0))
        {
            alert("Please Enter Installment Premium");
            document.form1.IP.focus();
            return false;
        }
////        if(document.form1.PType.value=="Single Premium" && (document.form1.AP.value<50000))
////        {
////            alert("Minimum Single Premium Should be 50000");
////            document.form1.AP.focus();
////            return false;
////        }
        
        
////        if(document.form1.PType.value=="Regular Premium" && document.form1.Mode.value=="Yearly" && document.form1.IP.value!="")
////        {
////            if(parseInt(document.form1.IP.value)<20000)
////            {
////            alert("minimum Installment Premium for Yearly is 20000.", "RELIANCE SUPER GOLDEN YEAR PLAN-PLUS ");
////            document.form1.IP.focus();
////            return false;
////            }
////        }
////        else if(document.form1.PType.value=="Regular Premium" && document.form1.Mode.value=="Half Yearly" && document.form1.IP.value!="")
////        {
////            if(parseInt(document.form1.IP.value)<10000)
////            {
////            alert("minimum Installment Premium for Half Yearly is 10000.", "RELIANCE SUPER GOLDEN YEAR PLAN-PLUS ");
////            document.form1.IP.focus();
////            return false;
////            }
////        }
////        else if(document.form1.PType.value=="Regular Premium" && document.form1.Mode.value=="Quarterly" && document.form1.IP.value!="")           
////        {
////            if(parseInt(document.form1.IP.value)<5000)
////            {
////            alert("minimum Installment Premium for Quarterly is 5000.", "RELIANCE SUPER GOLDEN YEAR PLAN-PLUS ");
////            document.form1.IP.focus();
////            return false;
////            }
////        }
////        else if(document.form1.PType.value=="Regular Premium" && document.form1.Mode.value=="Monthly" && document.form1.IP.value!="")            
////        {
////            if(parseInt(document.form1.IP.value)<2000)
////            {
////            alert("minimum Installment Premium for Monthly is 2000.", "RELIANCE SUPER GOLDEN YEAR PLAN-PLUS");
////            document.form1.IP.focus();
////            return false;
////            }
////        }
////        
////        if(document.form1.PType.value=="Limited Premium" && document.form1.Mode.value=="Yearly" && document.form1.IP.value!="")
////        {
////            if(parseInt(document.form1.IP.value)<25000)
////            {
////            alert("minimum Installment Premium for Yearly is 25000.", "RELIANCE SUPER GOLDEN YEAR PLAN-PLUS ");
////            document.form1.IP.focus();
////            return false;
////            }
////        }
////        else if(document.form1.PType.value=="Limited Premium" && document.form1.Mode.value=="Half Yearly" && document.form1.IP.value!="")
////        {
////            if(parseInt(document.form1.IP.value)<12500)
////            {
////            alert("minimum Installment Premium for Half Yearly is 12500.", "RELIANCE SUPER GOLDEN YEAR PLAN-PLUS ");
////            document.form1.IP.focus();
////            return false;
////            }
////        }
////        else if(document.form1.PType.value=="Limited Premium" && document.form1.Mode.value=="Quarterly" && document.form1.IP.value!="")           
////        {
////            if(parseInt(document.form1.IP.value)<6250)
////            {
////            alert("minimum Installment Premium for Quarterly is 6250.", "RELIANCE SUPER GOLDEN YEAR PLAN-PLUS ");
////            document.form1.IP.focus();
////            return false;
////            }
////        }
////        else if(document.form1.PType.value=="Limited Premium" && document.form1.Mode.value=="Monthly" && document.form1.IP.value!="")            
////        {
////            if(parseInt(document.form1.IP.value)<2500)
////            {
////            alert("minimum Installment Premium for Monthly is 2500.", "RELIANCE SUPER GOLDEN YEAR PLAN-PLUS");
////            document.form1.IP.focus();
////            return false;
////            }
////        }
        if(document.form1.SA1.value=="" || document.form1.SA1.value==null || document.form1.SA1.value==0)
        {
            alert("Please enter sum assured");
            document.form1.SA1.focus();
            return false;
        }
        
        if(document.form1.FundOpt.value=="-Select-")
        {
            alert("Please select Name of the fund");
            document.form1.FundOpt.focus();
            return false;
        }             
        
        if(document.form1.ChkADTPD.checked==true)
        { 
            var age=parseFloat(document.form1.ADBRAge.value);
            var termr=parseFloat(document.form1.ADBRTerm.value);
            var baseval=parseFloat(document.form1.Term.value);
            var baseSA=parseFloat(document.form1.SA.value);
            var asa=parseFloat(document.form1.ADBRSA.value);
            if(age==0 || document.form1.ADBRAge.value=="" || document.form1.ADBRAge.value==null)
            {
                alert("Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Age.");
                document.form1.ADBRAge.focus();
                document.form1.ADBRAge.select();
                return false;
            }
//            if(age<18 || age>60)
//            {
//                alert("Invalid Rider Age. Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Age between 18 and 60.");
//                document.form1.ADBRAge.focus();
//                document.form1.ADBRAge.select();
//                return false;
//            } 
            
            //term nd sa
            if(termr==0 || document.form1.ADBRTerm.value=="" || document.form1.ADBRTerm.value==null)
            {
                alert("Please enter the term for Reliance Accidental Death and Total and Permanent Disablement Rider.");
                document.form1.ADBRTerm.focus();
                document.form1.ADBRTerm.select();
                return false;
            }
//            if(document.form1.PType.value=="Limited Premium")
//            {
//                if(termr<5 || termr>baseval-5)
//                {
//                    alert("Reliance Accidental Death and Total and Permanent Disablement Rider Term should be between 5 and "+ (baseval-5));
//                    document.form1.ADBRTerm.focus();
//                    document.form1.ADBRTerm.select();
//                    return false;
//                }
//            } 
//            else if(document.form1.PType.value=="Regular Premium")
//            {
//                if(termr<5 || termr>baseval)
//                {
//                    alert("Reliance Accidental Death and Total and Permanent Disablement Rider Term should be between 5 and "+ baseval);
//                    document.form1.ADBRTerm.focus();
//                    document.form1.ADBRTerm.select();
//                    return false;
//                }
//            }
            
            
            if(asa==0 || document.form1.ADBRSA.value=="" || document.form1.ADBRSA.value==null)
            {
                alert("Please enter sum assured for Reliance Accidental Death and Total and Permanent Disablement Rider.");
                document.form1.ADBRSA.focus();
                document.form1.ADBRSA.select();
                return false;
            }   
////            
////            if(asa<25000)
////            {
////                alert("Minimum Sum Assured for Reliance Accidental Death and Total and Permanent Disablement Rider should be Rs.25000");
////                document.form1.ADBRSA.focus();
////                document.form1.ADBRSA.select();
////                return false;
////            }       

////            if(asa<baseSA || asa>5000000)
////            {
////                alert("Reliance Accidental Death and Total and Permanent Disablement Rider Sum Assured should be between Rs."+baseSA+" and Rs.5000000");
////                document.form1.ADBRSA.focus();
////                document.form1.ADBRSA.select();
////                return false;
////            }

        }
        if(document.form1.chkTermliferider.checked==true)
        { 
            var age=parseFloat(document.form1.TLBRAge.value);
            var termr=parseFloat(document.form1.TLBRTerm.value);
            var baseSA=parseFloat(document.form1.SA.value);
            var asa=parseFloat(document.form1.TLBRSA.value);
            var baseterm=parseFloat(document.form1.Term.value);
            if(age==0 || document.form1.TLBRAge.value=="" || document.form1.TLBRAge.value==null)
            {
                alert("Please enter the age for Reliance Term Life Insurance Benefit Rider.");
                document.form1.TLBRAge.focus();
                document.form1.TLBRAge.select();
                return false;
            }
//            if(age<18 || age>59)
//            {
//                alert("Invalid Rider Age. Please enter Reliance Term Life Insurance Benefit Rider Age between 18 and 59.");
//                document.form1.TLBRAge.focus();
//                document.form1.TLBRAge.select();
//                return false;
//            } 
//            
            //term and sa
            if(termr==0 || document.form1.TLBRTerm.value=="" || document.form1.TLBRTerm.value==null)
            {
                alert("Please enter the term for Reliance Term Life Insurance Benefit Rider.");
                document.form1.TLBRTerm.focus();
                document.form1.TLBRTerm.select();
                return false;
            }
            
////            if(document.form1.PType.value=="Limited Premium")
////            {
////                if(termr<5 || termr>Math.min(baseval-5,30))
////                {
////                    alert("Reliance Term Life Insurance Benefit Rider should be between 5 and  "+ Math.min(baseval-5,30));
////                    document.form1.TLBRTerm.focus();
////                    document.form1.TLBRTerm.select();
////                    return false;
////                }
////            } 
////            else if(document.form1.PType.value=="Regular Premium")
////            {
////                if(termr<5 || termr>Math.min(baseval,30))
////                {
////                    alert("Reliance Term Life Insurance Benefit Rider should be between 5 and  "+Math.min(baseval,30));
////                    document.form1.TLBRTerm.focus();
////                    document.form1.TLBRTerm.select();
////                    return false;
////                }
////            }           
            
            if(asa==0 || document.form1.TLBRSA.value=="" || document.form1.TLBRSA.value==null)
            {
                alert("Please enter sum assured for Reliance Term Life Insurance Benefit Rider.");
                document.form1.TLBRSA.focus();
                document.form1.TLBRSA.select();
                return false;
            }           
////            if(asa<25000 || asa>baseSA)
////            {
////                alert("Reliance Term Life Insurance Benefit Rider Sum Assured should be between 25000 and "+baseSA);
////                document.form1.TLBRSA.focus();
////                document.form1.TLBRSA.select();
////                return false;
////            }
        }
        if(document.form1.chkmajor.checked==true)
        { 
            var age=parseFloat(document.form1.MSBRAge.value);
            var termr=parseFloat(document.form1.MSBRTerm.value);
            var baseSA=parseFloat(document.form1.SA.value);
            var asa=parseFloat(document.form1.MSBRSA.value);
             var baseval=parseFloat(document.form1.Term.value);
            if(age==0 || document.form1.MSBRAge.value=="" || document.form1.MSBRAge.value==null)
            {
                alert("Please enter the age for Reliance New Major Surgical Benefit Rider.");
                document.form1.MSBRAge.focus();
                document.form1.MSBRAge.select();
                return false;
            }
//            if(age<18 || age>55)
//            {
//                alert("Invalid Rider Age. Please enter Reliance New Major Surgical Benefit Rider Age between 18 and 55.");
//                document.form1.MSBRAge.focus();
//                document.form1.MSBRAge.select();
//                return false;
//            } 
//            
            //term and sa
            if(termr==0 || document.form1.MSBRTerm.value=="" || document.form1.MSBRTerm.value==null)
            {
                alert("Please enter the term for Reliance New Major Surgical Benefit Rider.");
                document.form1.MSBRTerm.focus();
                document.form1.MSBRTerm.select();
                return false;
            }
////            if(document.form1.PType.value=="Limited Premium")
////            {
////                if(termr<5 || termr>Math.min(baseval-5,25))
////                {
////                    alert("Reliance New Major Surgical Benefit Rider should be between 5 and "+ Math.min(baseval-5,25));
////                    document.form1.MSBRTerm.focus();
////                    document.form1.MSBRTerm.select();
////                    return false;
////                }
////            } 
////            else if(document.form1.PType.value=="Regular Premium")
////            {
////                if(termr<5 || termr>Math.min(baseval,25))
////                {
////                    alert("Reliance New Major Surgical Benefit Rider should be between 5 and "+Math.min(baseval,25));
////                    document.form1.MSBRTerm.focus();
////                    document.form1.MSBRTerm.select();
////                    return false;
////                }
////            }                   
            if(asa==0 || document.form1.MSBRSA.value=="" || document.form1.MSBRSA.value==null)
            {
                alert("Please enter sum assured for Reliance New Major Surgical Benefit Rider.");
                document.form1.MSBRSA.focus();
                document.form1.MSBRSA.select();
                return false;
            }
////            if(asa<10000 || asa>Math.min(baseSA,500000))
////            {
////                alert("Reliance New Major Surgical Benefit Rider Sum Assured should be between Rs.10000 and "+"Rs."+Math.min(baseSA,500000));
////                document.form1.MSBRSA.focus();
////                document.form1.MSBRSA.select();
////                return false;
////            }
        }
        if(document.form1.chkccrider.checked==true)
        { 
            var age=parseFloat(document.form1.CCRAge.value);
            var termr=parseFloat(document.form1.CCRTerm.value);
            var baseSA=parseFloat(document.form1.SA.value);
            var asa=parseFloat(document.form1.CCRSA.value);
            var baseval=parseFloat(document.form1.Term.value);
            
            if(age==0 || document.form1.CCRAge.value=="" || document.form1.CCRAge.value==null)
            {
                alert("Please enter the age for Reliance New Critical Conditions (25) Rider.");
                document.form1.CCRAge.focus();
                document.form1.CCRAge.select();
                return false;
            }
////            if(age<18 || age>55)
////            {
////                alert("Invalid Rider Age. Please enter Reliance New Critical Conditions (25) Rider Age between 18 and 55.");
////                document.form1.CCRAge.focus();
////                document.form1.CCRAge.select();
////                return false;
////            } 

            //term and sa
            if(termr==0 || document.form1.CCRTerm.value=="" || document.form1.CCRTerm.value==null)
            {
                alert("Please enter the term for Reliance New Critical Conditions (25) Rider.");
                document.form1.CCRTerm.focus();
                document.form1.CCRTerm.select();
                return false;
            }
////            if(document.form1.PType.value=="Limited Premium")
////            {
////                if(termr<5 || termr>Math.min(baseval-5,25))
////                {
////                    alert("Reliance New Critical Conditions (25) Rider should be between 5 and "+ Math.min(baseval-5,25));
////                    document.form1.CCRTerm.focus();
////                    document.form1.CCRTerm.select();
////                    return false;
////                }
////            } 
////            else if(document.form1.PType.value=="Regular Premium")
////            {
////                if(termr<5 || termr>Math.min(baseval,25))
////                {
////                    alert("Reliance New Critical Conditions (25) Rider should be between 5 and "+Math.min(baseval,25));
////                    document.form1.CCRTerm.focus();
////                    document.form1.CCRTerm.select();
////                    return false;
////                }
////            }          
            
//            if(termr<5 || termr>30)
//            {
//                alert("Term for Reliance New Critical Conditions (25) Rider should be between 5 and 25.");
//                document.form1.CCRTerm.focus();
//                document.form1.CCRTerm.select();
//                return false;
//            } 
            
            if(asa==0 || document.form1.CCRSA.value=="" || document.form1.CCRSA.value==null)
            {
                alert("Please enter sum assured for Reliance New Critical Conditions (25) Rider.");
                document.form1.CCRSA.focus();
                document.form1.CCRSA.select();
                return false;
            }
//            if(asa<10000 || asa>Math.min(baseSA,2000000))
//            {
//                alert("Reliance New Critical Conditions (25) Rider Sum Assured should be between Rs.10000 and Rs."+Math.min(baseSA,2000000));
//                document.form1.CCRSA.focus();
//                document.form1.CCRSA.select();
//                return false;
//            }
        }
        return true;
    }


    
//********************************************************************************************

//*************************** RELIANCE SUPER AUTOMATIC INVESTMENT TERM 10 PLAN ***************************

function SuperAutomaticInvestmentBasicTerm10Plan()
    {
        var mode = (document.form1.Mode.value);
        var ann_prm = parseInt(document.form1.A_Prem.value);
        var min_SA = (ann_prm * 5);
        var max_SA = (ann_prm * 50);

        if(document.form1.txtName.value=="" || document.form1.txtName.value==null)
        {
            alert("Please enter your/Customer's name.");
            document.form1.txtName.focus();
            return false;
        }
        if(document.form1.txtAdvisor.value=="" || document.form1.txtAdvisor.value==null)
        {
            alert("Please enter your/Advisor name");
            document.form1.txtAdvisor.focus();
            return false;
        }
        if(document.form1.Sex.value=="Select")
        {
            alert("Please select your Sex");
            document.form1.Sex.focus();
            return false;
        }
        if(document.form1.Age.value=="Select")
        {
            alert("Please select your Age");
            document.form1.Age.focus();
            return false;
        }
        if(document.form1.Term.value=="" || document.form1.Term.value==null)
        {
            alert("Please enter Policy Term");
            document.form1.Term.focus();
            return false;
        }
        if(document.form1.MODETYPE.value=="Select")
        {
            alert("Please select Premium Paying Type");
            document.form1.MODETYPE.focus();
            return false;
        }        
        if(document.form1.Mode.value=="Select")
        {
            alert("Please select Mode of Premium Payment");
            document.form1.Mode.focus();
            return false;
        }
         
        if((document.form1.MODETYPE.value=="Regular Premium") && (document.form1.IP.value=="" || document.form1.IP.value==null || document.form1.IP.value==0))
        {
            alert("Please enter Installment Premium");
            document.form1.IP.focus();
            return false;
        }
        
        if(document.form1.MODETYPE.value=="Single Premium" && (document.form1.AP.value==""|| document.form1.AP.value==null || document.form1.AP.value==0))
        {
            alert("Please enter Amount of Single Premium");
            document.form1.AP.focus();
            return false;
        }
        
        if(document.form1.MODETYPE.value=="Single Premium" && (document.form1.AP.value<30000))
        {
            alert("Minimum Amount of Single Premium Should be 30000");
            document.form1.AP.focus();
            return false;
        }
        
        if(document.form1.SA1.value=="" || document.form1.SA1.value==null)
        {
            alert("Please enter sum assured");
            document.form1.SA1.focus();
            return false;
        }
        
        if(document.form1.FundOpt.value=="-Select-")
        {
            alert("Please select Name of the fund");
            document.form1.FundOpt.focus();
            return false;
        }
        if((document.form1.MODETYPE.value=="Regular Premium" || document.form1.MODETYPE.value=="Limited Premium" ) && (document.form1.IP.value=="" || document.form1.IP.value==null || document.form1.IP.value=="0"))
        {
            alert("Please enter Installment Premium");
            document.form1.IP.focus();
            return false;
        }
        
        
        
////        if((document.form1.MODETYPE.value=="Regular Premium" || document.form1.MODETYPE.value=="Limited Premium" ) && document.form1.Mode.value=="Yearly" && document.form1.IP.value!="")
////        {
////            if(parseInt(document.form1.IP.value)<20000)
////            {
////            alert("minimum Installment Premium for Yearly is 20000.", "RELIANCE SUPER GOLDEN YEAR PLAN-PLUS ");
////            document.form1.IP.focus();
////            return false;
////            }
////        }
////        else if((document.form1.MODETYPE.value=="Regular Premium" || document.form1.MODETYPE.value=="Limited Premium" ) && document.form1.Mode.value=="Half Yearly" && document.form1.IP.value!="")
////        {
////            if(parseInt(document.form1.IP.value)<10000)
////            {
////            alert("minimum Installment Premium for Half Yearly is 10000.", "RELIANCE SUPER GOLDEN YEAR PLAN-PLUS ");
////            document.form1.IP.focus();
////            return false;
////            }
////        }
////        else if((document.form1.MODETYPE.value=="Regular Premium" || document.form1.MODETYPE.value=="Limited Premium" ) && document.form1.Mode.value=="Quarterly" && document.form1.IP.value!="")           
////        {
////            if(parseInt(document.form1.IP.value)<5000)
////            {
////            alert("minimum Installment Premium for Quarterly is 5000.", "RELIANCE SUPER GOLDEN YEAR PLAN-PLUS ");
////            document.form1.IP.focus();
////            return false;
////            }
////        }
////        else if((document.form1.MODETYPE.value=="Regular Premium" || document.form1.MODETYPE.value=="Limited Premium" ) && document.form1.Mode.value=="Monthly" && document.form1.IP.value!="")            
////        {
////            if(parseInt(document.form1.IP.value)<2000)
////            {
////            alert("minimum Installment Premium for Monthly is 2000.", "RELIANCE SUPER GOLDEN YEAR PLAN-PLUS");
////            document.form1.IP.focus();
////            return false;
////            }
////        }

        if(document.form1.SA1.value=="" || document.form1.SA1.value==null || document.form1.SA1.value==0)
        {
            alert("Please enter basic Sum Assured.");
            document.form1.SA1.focus();
            return false;
        }         
        
        if(document.form1.ChkADTPD.checked==true)
        { 
            var age=parseFloat(document.form1.ADBRAge.value);
            var termr=parseFloat(document.form1.ADBRTerm.value);
            var baseval=parseFloat(document.form1.Term.value);
            var baseSA=parseFloat(document.form1.SA.value);
            var asa=parseFloat(document.form1.ADBRSA.value);
            if(age==0 || document.form1.ADBRAge.value=="" || document.form1.ADBRAge.value==null)
            {
                alert("Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Age.");
                document.form1.ADBRAge.focus();
                document.form1.ADBRAge.select();
                return false;
            }
//            if(age<18 || age>60)
//            {
//                alert("Invalid Rider Age. Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Age between 18 and 60.");
//                document.form1.ADBRAge.focus();
//                document.form1.ADBRAge.select();
//                return false;
//            } 
            
            //term nd sa
            if(termr==0 || document.form1.ADBRTerm.value=="" || document.form1.ADBRTerm.value==null)
            {
                alert("Please enter the term for Reliance Accidental Death and Total and Permanent Disablement Rider.");
                document.form1.ADBRTerm.focus();
                document.form1.ADBRTerm.select();
                return false;
            }
//            if(termr<5 || termr>10)
//            {
//                alert("Reliance Accidental Death and Total and Permanent Disablement Rider should be between 5 and 10");
//                document.form1.ADBRTerm.focus();
//                document.form1.ADBRTerm.select();
//                return false;
//            } 
            
            if(asa==0 || document.form1.ADBRSA.value=="" || document.form1.ADBRSA.value==null)
            {
                alert("Please enter sum assured for Reliance Accidental Death and Total and Permanent Disablement Rider.");
                document.form1.ADBRSA.focus();
                document.form1.ADBRSA.select();
                return false;
            }          
//            if(asa<25000 )
//            {
//                alert("Mimimum Sum Assured for Reliance Accidental Death and Total and Permanent Disablement Rider should be Rs.25000");
//                document.form1.ADBRSA.focus();
//                document.form1.ADBRSA.select();
//                return false;
//            }
//            if(asa<baseSA || asa>5000000)
//            {
//                alert("Reliance Accidental Death and Total and Permanent Disablement Rider Sum Assured should be between Rs."+baseSA+" and Rs.5000000");
//                document.form1.ADBRSA.focus();
//                document.form1.ADBRSA.select();
//                return false;
//            }

        }
        if(document.form1.chkTermliferider.checked==true)
        { 
            var age=parseFloat(document.form1.TLBRAge.value);
            var termr=parseFloat(document.form1.TLBRTerm.value);
            var baseSA=parseFloat(document.form1.SA.value);
            var asa=parseFloat(document.form1.TLBRSA.value);
            var baseterm=parseFloat(document.form1.Term.value);
            if(age==0 || document.form1.TLBRAge.value=="" || document.form1.TLBRAge.value==null)
            {
                alert("Please enter the age for Reliance Term Life Insurance Benefit Rider.");
                document.form1.TLBRAge.focus();
                document.form1.TLBRAge.select();
                return false;
            }
//            if(age<18 || age>59)
//            {
//                alert("Invalid Rider Age. Please enter Reliance Term Life Insurance Benefit Rider Age between 18 and 59.");
//                document.form1.TLBRAge.focus();
//                document.form1.TLBRAge.select();
//                return false;
//            } 
            
            //term and sa
            if(termr==0 || document.form1.TLBRTerm.value=="" || document.form1.TLBRTerm.value==null)
            {
                alert("Please enter the term for Reliance Term Life Insurance Benefit Rider.");
                document.form1.TLBRTerm.focus();
                document.form1.TLBRTerm.select();
                return false;
            }
//            if(termr<5 || termr>10)
//            {
//                alert("Term for Reliance Term Life Insurance Benefit Rider should be between 5 and 10");
//                document.form1.TLBRTerm.focus();
//                document.form1.TLBRTerm.select();
//                return false;
//            } 
//            
            if(asa==0 || document.form1.TLBRSA.value=="" || document.form1.TLBRSA.value==null)
            {
                alert("Please enter sum assured for Reliance Term Life Insurance Benefit Rider.");
                document.form1.TLBRSA.focus();
                document.form1.TLBRSA.select();
                return false;
            }           
//            if(asa<25000 || asa>=baseSA)
//            {
//                alert("Reliance Term Life Insurance Benefit Rider Sum Assured should be between 25000 and " + baseSA);
//                document.form1.TLBRSA.focus();
//                document.form1.TLBRSA.select();
//                return false;
//            }
        }
        if(document.form1.chkmajor.checked==true)
        { 
            var age=parseFloat(document.form1.MSBRAge.value);
            var termr=parseFloat(document.form1.MSBRTerm.value);
            var baseSA=parseFloat(document.form1.SA.value);
            var asa=parseFloat(document.form1.MSBRSA.value);
            if(age==0 || document.form1.MSBRAge.value=="" || document.form1.MSBRAge.value==null)
            {
                alert("Please enter the age for Reliance New Major Surgical Benefit Rider.");
                document.form1.MSBRAge.focus();
                document.form1.MSBRAge.select();
                return false;
            }
//            if(age<18 || age>55)
//            {
//                alert("Invalid Rider Age. Please enter Reliance New Major Surgical Benefit Rider Age between 18 and 55.");
//                document.form1.MSBRAge.focus();
//                document.form1.MSBRAge.select();
//                return false;
//            } 
            
            //term and sa
            if(termr==0 || document.form1.MSBRTerm.value=="" || document.form1.MSBRTerm.value==null)
            {
                alert("Please enter the term for Reliance New Major Surgical Benefit Rider.");
                document.form1.MSBRTerm.focus();
                document.form1.MSBRTerm.select();
                return false;
            }
//            if(termr<5 || termr>10)
//            {
//                alert("Term for Reliance New Major Surgical Benefit Rider should be between 5 and 10.");
//                document.form1.MSBRTerm.focus();
//                document.form1.MSBRTerm.select();
//                return false;
//            }             
            if(asa==0 || document.form1.MSBRSA.value=="" || document.form1.MSBRSA.value==null)
            {
                alert("Please enter sum assured for Reliance New Major Surgical Benefit Rider.");
                document.form1.MSBRSA.focus();
                document.form1.MSBRSA.select();
                return false;
            }
//            if(asa<10000 || asa>Math.min(baseSA,500000))
//            {
//                alert("Reliance New Major Surgical Benefit Rider Sum Assured should be between Rs.10000 and "+"Rs."+Math.min(baseSA,500000));
//                document.form1.MSBRSA.focus();
//                document.form1.MSBRSA.select();
//                return false;
//            }
        }
        if(document.form1.chkccrider.checked==true)
        { 
            var age=parseFloat(document.form1.CCRAge.value);
            var termr=parseFloat(document.form1.CCRTerm.value);
            var baseSA=parseFloat(document.form1.SA.value);
            var asa=parseFloat(document.form1.CCRSA.value);
            if(age==0 || document.form1.CCRAge.value=="" || document.form1.CCRAge.value==null)
            {
                alert("Please enter the age for Reliance New Critical Conditions (25) Rider.");
                document.form1.CCRAge.focus();
                document.form1.CCRAge.select();
                return false;
            }
//            if(age<18 || age>55)
//            {
//                alert("Invalid Rider Age. Please enter Reliance New Critical Conditions (25) Rider Age between 18 and 55.");
//                document.form1.CCRAge.focus();
//                document.form1.CCRAge.select();
//                return false;
//            } 

            //term and sa
            if(termr==0 || document.form1.CCRTerm.value=="" || document.form1.CCRTerm.value==null)
            {
                alert("Please enter the term for Reliance New Critical Conditions (25) Rider.");
                document.form1.CCRTerm.focus();
                document.form1.CCRTerm.select();
                return false;
            }
//            if(termr<5 || termr>10)
//            {
//                alert("Term for Reliance New Critical Conditions (25) Rider should be between 5 and 10.");
//                document.form1.CCRTerm.focus();
//                document.form1.CCRTerm.select();
//                return false;
//            } 
            
            if(asa==0 || document.form1.CCRSA.value=="" || document.form1.CCRSA.value==null)
            {
                alert("Please enter sum assured for Reliance New Critical Conditions (25) Rider.");
                document.form1.CCRSA.focus();
                document.form1.CCRSA.select();
                return false;
            }
//            if(asa<10000 || asa>Math.min(baseSA,2000000))
//            {
//                alert("Reliance New Critical Conditions (25) Rider Sum Assured should be between Rs.10000 and Rs."+Math.min(baseSA,2000000));
//                document.form1.CCRSA.focus();
//                document.form1.CCRSA.select();
//                return false;
//            }
        }
        return true;
    }

//********************************************************************************************************

//*******************SUPER GOLDEN YEAR PLUS TERM 10 PLAN *****************************************
 function SuperGoldenYearPlusTerm10Plan()
    {
        var mode = (document.form1.Mode.value);
        var ann_prm = parseInt(document.form1.A_Prem.value);
        var min_SA = (ann_prm * 5);
        var max_SA = (ann_prm * 50);

        if(document.form1.txtName.value=="" || document.form1.txtName.value==null)
        {
            alert("Please enter your/Customer's name.");
            document.form1.txtName.focus();
            return false;
        }
        if(document.form1.txtAdvisor.value=="" || document.form1.txtAdvisor.value==null)
        {
            alert("Please enter your/Advisor name");
            document.form1.txtAdvisor.focus();
            return false;
        }
        if(document.form1.Sex.value=="Select")
        {
            alert("Please select your Sex");
            document.form1.Sex.focus();
            return false;
        }
        if(document.form1.Age.value=="Select")
        {
            alert("Please select your Age");
            document.form1.Age.focus();
            return false;
        }
        if(document.form1.Term.value=="" || document.form1.Term.value==null)
        {
            alert("Please enter Policy Term");
            document.form1.Term.focus();
            return false;
        }
//        if(document.form1.Term.value<16)
//        {
//            alert("Minimum Policy Term should be 16");
//            document.form1.Term.focus();
//            return false;
//        }        
        if(document.form1.Mode.value=="Select")
        {
            alert("Please select Mode of Premium Payment");
            document.form1.Mode.focus();
            return false;
        }
        if(document.form1.IP.value=="" || document.form1.IP.value==null || document.form1.IP.value==0)
        {
            alert("Please Enter Installment Premium");
            document.form1.IP.focus();
            return false;
        }
////        if(document.form1.Mode.value=="Yearly" && document.form1.IP.value!="")
////        {
////            if(parseInt(document.form1.IP.value)<20000)
////            {
////            alert("minimum Installment Premium for Yearly is 20000.", "RELIANCE SUPER GOLDEN YEAR PLAN-PLUS ");
////            document.form1.IP.focus();
////            return false;
////            }
////        }
////        else if(document.form1.Mode.value=="Half Yearly" && document.form1.IP.value!="")
////        {
////            if(parseInt(document.form1.IP.value)<10000)
////            {
////            alert("minimum Installment Premium for Half Yearly is 10000.", "RELIANCE SUPER GOLDEN YEAR PLAN-PLUS ");
////            document.form1.IP.focus();
////            return false;
////            }
////        }
////        else if(document.form1.Mode.value=="Quarterly" && document.form1.IP.value!="")           
////        {
////            if(parseInt(document.form1.IP.value)<5000)
////            {
////            alert("minimum Installment Premium for Quarterly is 5000.", "RELIANCE SUPER GOLDEN YEAR PLAN-PLUS ");
////            document.form1.IP.focus();
////            return false;
////            }
////        }
////        else if(document.form1.Mode.value=="Monthly" && document.form1.IP.value!="")            
////        {
////            if(parseInt(document.form1.IP.value)<2000)
////            {
////            alert("minimum Installment Premium for Monthly is 2000.", "RELIANCE SUPER GOLDEN YEAR PLAN-PLUS");
////            document.form1.IP.focus();
////            return false;
////            }
////        }

        if(document.form1.SA1.value=="" || document.form1.SA1.value==null || document.form1.SA1.value==0)
        {
            alert("Please enter basic Sum Assured.");
            document.form1.SA1.focus();
            return false;
        }         
        
        if(document.form1.ChkADTPD.checked==true)
        { 
            var age=parseFloat(document.form1.ADBRAge.value);
            var termr=parseFloat(document.form1.ADBRTerm.value);
            var baseval=parseFloat(document.form1.Term.value);
            var baseSA=parseFloat(document.form1.SA.value);
            var asa=parseFloat(document.form1.ADBRSA.value);
            if(age==0 || document.form1.ADBRAge.value=="" || document.form1.ADBRAge.value==null)
            {
                alert("Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Age.");
                document.form1.ADBRAge.focus();
                document.form1.ADBRAge.select();
                return false;
            }
//            if(age<18 || age>60)
//            {
//                alert("Invalid Rider Age. Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Age between 18 and 60.");
//                document.form1.ADBRAge.focus();
//                document.form1.ADBRAge.select();
//                return false;
//            } 
            
            //term nd sa
            if(termr==0 || document.form1.ADBRTerm.value=="" || document.form1.ADBRTerm.value==null)
            {
                alert("Please enter the term for Reliance Accidental Death and Total and Permanent Disablement Rider.");
                document.form1.ADBRTerm.focus();
                document.form1.ADBRTerm.select();
                return false;
            }
//            if(termr<5 || termr>10)
//            {
//                alert("Reliance Accidental Death and Total and Permanent Disablement Rider should be between 5 and 10");
//                document.form1.ADBRTerm.focus();
//                document.form1.ADBRTerm.select();
//                return false;
//            } 
            
            if(asa==0 || document.form1.ADBRSA.value=="" || document.form1.ADBRSA.value==null)
            {
                alert("Please enter sum assured for Reliance Accidental Death and Total and Permanent Disablement Rider.");
                document.form1.ADBRSA.focus();
                document.form1.ADBRSA.select();
                return false;
            }
//            if(asa<25000)
//            {
//                alert("Minimum Sum Assured for Reliance Accidental Death and Total and Permanent Disablement Rider should be Rs.25000");
//                document.form1.ADBRSA.focus();
//                document.form1.ADBRSA.select();
//                return false;
//            }          

//            if(asa<baseSA || asa>5000000)
//            {
//                alert("Reliance Accidental Death and Total and Permanent Disablement Rider Sum Assured should be between Rs."+baseSA+" and Rs.5000000");
//                document.form1.ADBRSA.focus();
//                document.form1.ADBRSA.select();
//                return false;
//            }

        }
        if(document.form1.chkTermliferider.checked==true)
        { 
            var age=parseFloat(document.form1.TLBRAge.value);
            var termr=parseFloat(document.form1.TLBRTerm.value);
            var baseSA=parseFloat(document.form1.SA.value);
            var asa=parseFloat(document.form1.TLBRSA.value);
            var baseterm=parseInt(document.form1.Term.value);
            if(age==0 || document.form1.TLBRAge.value=="" || document.form1.TLBRAge.value==null)
            {
                alert("Please enter the age for Reliance Term Life Insurance Benefit Rider.");
                document.form1.TLBRAge.focus();
                document.form1.TLBRAge.select();
                return false;
            }
//            if(age<18 || age>59)
//            {
//                alert("Invalid Rider Age. Please enter Reliance Term Life Insurance Benefit Rider Age between 18 and 59.");
//                document.form1.TLBRAge.focus();
//                document.form1.TLBRAge.select();
//                return false;
//            } 
            
            //term and sa
            if(termr==0 || document.form1.TLBRTerm.value=="" || document.form1.TLBRTerm.value==null)
            {
                alert("Please enter the term for Reliance Term Life Insurance Benefit Rider.");
                document.form1.TLBRTerm.focus();
                document.form1.TLBRTerm.select();
                return false;
            }
//            if(termr<5 || termr>10)
//            {
//                alert("Term for Reliance Term Life Insurance Benefit Rider should be between 5 and 10");
//                document.form1.TLBRTerm.focus();
//                document.form1.TLBRTerm.select();
//                return false;
//            } 
            
            if(asa==0 || document.form1.TLBRSA.value=="" || document.form1.TLBRSA.value==null)
            {
                alert("Please enter sum assured for Reliance Term Life Insurance Benefit Rider.");
                document.form1.TLBRSA.focus();
                document.form1.TLBRSA.select();
                return false;
            }           
//            if(asa < 25000 || asa>baseSA)
//            {
//                alert("Reliance Term Life Insurance Benefit Rider Sum Assured should be between 25000 and " + baseSA);
//                document.form1.TLBRSA.focus();
//                document.form1.TLBRSA.select();
//                return false;
//            }
        }
        if(document.form1.chkmajor.checked==true)
        { 
            var age=parseFloat(document.form1.MSBRAge.value);
            var termr=parseFloat(document.form1.MSBRTerm.value);
            var baseSA=parseFloat(document.form1.SA.value);
            var asa=parseFloat(document.form1.MSBRSA.value);
            if(age==0 || document.form1.MSBRAge.value=="" || document.form1.MSBRAge.value==null)
            {
                alert("Please enter the age for Reliance New Major Surgical Benefit Rider.");
                document.form1.MSBRAge.focus();
                document.form1.MSBRAge.select();
                return false;
            }
//            if(age<18 || age>55)
//            {
//                alert("Invalid Rider Age. Please enter Reliance New Major Surgical Benefit Rider Age between 18 and 55.");
//                document.form1.MSBRAge.focus();
//                document.form1.MSBRAge.select();
//                return false;
//            } 
            
            //term and sa
            if(termr==0 || document.form1.MSBRTerm.value=="" || document.form1.MSBRTerm.value==null)
            {
                alert("Please enter the term for Reliance New Major Surgical Benefit Rider.");
                document.form1.MSBRTerm.focus();
                document.form1.MSBRTerm.select();
                return false;
            }
//            if(termr<5 || termr>10)
//            {
//                alert("Term for Reliance New Major Surgical Benefit Rider should be between 5 and 10.");
//                document.form1.MSBRTerm.focus();
//                document.form1.MSBRTerm.select();
//                return false;
//            }             
            if(asa==0 || document.form1.MSBRSA.value=="" || document.form1.MSBRSA.value==null)
            {
                alert("Please enter sum assured for Reliance New Major Surgical Benefit Rider.");
                document.form1.MSBRSA.focus();
                document.form1.MSBRSA.select();
                return false;
            }
//            if(asa<10000 || asa>Math.min(baseSA,500000))
//            {
//                alert("Reliance New Major Surgical Benefit Rider Sum Assured should be between Rs.10000 and "+"Rs."+Math.min(baseSA,500000));
//                document.form1.MSBRSA.focus();
//                document.form1.MSBRSA.select();
//                return false;
//            }
        }
        if(document.form1.chkccrider.checked==true)
        { 
            var age=parseFloat(document.form1.CCRAge.value);
            var termr=parseFloat(document.form1.CCRTerm.value);
            var baseSA=parseFloat(document.form1.SA.value);
            var asa=parseFloat(document.form1.CCRSA.value);
            if(age==0 || document.form1.CCRAge.value=="" || document.form1.CCRAge.value==null)
            {
                alert("Please enter the age for Reliance New Critical Conditions (25) Rider.");
                document.form1.CCRAge.focus();
                document.form1.CCRAge.select();
                return false;
            }
//            if(age<18 || age>55)
//            {
//                alert("Invalid Rider Age. Please enter Reliance New Critical Conditions (25) Rider Age between 18 and 55.");
//                document.form1.CCRAge.focus();
//                document.form1.CCRAge.select();
//                return false;
//            } 

            //term and sa
            if(termr==0 || document.form1.CCRTerm.value=="" || document.form1.CCRTerm.value==null)
            {
                alert("Please enter the term for Reliance New Critical Conditions (25) Rider.");
                document.form1.CCRTerm.focus();
                document.form1.CCRTerm.select();
                return false;
            }
//            if(termr<5 || termr>10)
//            {
//                alert("Term for Reliance New Critical Conditions (25) Rider should be between 5 and 10.");
//                document.form1.CCRTerm.focus();
//                document.form1.CCRTerm.select();
//                return false;
//            } 
            
            if(asa==0 || document.form1.CCRSA.value=="" || document.form1.CCRSA.value==null)
            {
                alert("Please enter sum assured for Reliance New Critical Conditions (25) Rider.");
                document.form1.CCRSA.focus();
                document.form1.CCRSA.select();
                return false;
            }
//            if(asa<10000 || asa>Math.min(baseSA,2000000))
//            {
//                alert("Reliance New Critical Conditions (25) Rider Sum Assured should be between Rs.10000 and Rs."+Math.min(baseSA,2000000));
//                document.form1.CCRSA.focus();
//                document.form1.CCRSA.select();
//                return false;
//            }
        }
        return true;
    }
//***************************************************************************************************

//************************** SUPER GOLDEN YEARS PLUS BASIC PLAN **************************************
function SuperGoldenYearPlusBasicPlan()
    {
        var mode = (document.form1.Mode.value);
        var ann_prm = parseInt(document.form1.A_Prem.value);
        var min_SA = (ann_prm * 5);
        var max_SA = (ann_prm * 50);

        if(document.form1.txtName.value=="" || document.form1.txtName.value==null)
        {
            alert("Please enter your/Customer's name.");
            document.form1.txtName.focus();
            return false;
        }
        if(document.form1.txtAdvisor.value=="" || document.form1.txtAdvisor.value==null)
        {
            alert("Please enter your/Advisor name");
            document.form1.txtAdvisor.focus();
            return false;
        }
        if(document.form1.Sex.value=="Select")
        {
            alert("Please select your Sex");
            document.form1.Sex.focus();
            return false;
        }
        if(document.form1.Age.value=="Select")
        {
            alert("Please select your Age");
            document.form1.Age.focus();
            return false;
        }
        if(document.form1.Term.value=="" || document.form1.Term.value==null || document.form1.Term.value==0)
        {
            alert("Please select Policy Term");
            document.form1.Term.focus();
            return false;
        }  
        if(document.form1.Term.value<16)
        {
            alert("Minimum Policy Term should be 16");
            document.form1.Term.focus();
            return false;
        }   
                   
        if(document.form1.Mode.value=="Select")
        {
            alert("Please select Mode of Premium Payment");
            document.form1.Mode.focus();
            return false;
        }
        if(document.form1.IP.value=="" || document.form1.IP.value==null || document.form1.IP.value==0)
        {
            alert("Please Enter Installment Premium");
            document.form1.IP.focus();
            return false;
        }
//        if(document.form1.Mode.value=="Yearly" && document.form1.IP.value!="")
//        {
//            if(parseInt(document.form1.IP.value)<20000)
//            {
//            alert("minimum Installment Premium for Yearly is 20000.", "RELIANCE SUPER GOLDEN YEAR PLAN-PLUS ");
//            document.form1.IP.focus();
//            return false;
//            }
//        }
//        else if(document.form1.Mode.value=="Half Yearly" && document.form1.IP.value!="")
//        {
//            if(parseInt(document.form1.IP.value)<10000)
//            {
//            alert("minimum Installment Premium for Half Yearly is 10000.", "RELIANCE SUPER GOLDEN YEAR PLAN-PLUS ");
//            document.form1.IP.focus();
//            return false;
//            }
//        }
//        else if(document.form1.Mode.value=="Quarterly" && document.form1.IP.value!="")           
//        {
//            if(parseInt(document.form1.IP.value)<5000)
//            {
//            alert("minimum Installment Premium for Quarterly is 5000.", "RELIANCE SUPER GOLDEN YEAR PLAN-PLUS ");
//            document.form1.IP.focus();
//            return false;
//            }
//        }
//        else if(document.form1.Mode.value=="Monthly" && document.form1.IP.value!="")            
//        {
//            if(parseInt(document.form1.IP.value)<2000)
//            {
//            alert("minimum Installment Premium for Monthly is 2000.", "RELIANCE SUPER GOLDEN YEAR PLAN-PLUS");
//            document.form1.IP.focus();
//            return false;
//            }
//        }

        if(document.form1.SA1.value=="" || document.form1.SA1.value==null || document.form1.SA1.value==0)
        {
            alert("Please enter basic Sum Assured.");
            document.form1.SA1.focus();
            return false;
        }         
        
        if(document.form1.ChkADTPD.checked==true)
        { 
            var age=parseInt(document.form1.ADBRAge.value);
            var termr=parseInt(document.form1.ADBRTerm.value);
            var baseval=parseInt(document.form1.Term.value);
            var baseSA=parseFloat(document.form1.SA.value);
            var asa=parseFloat(document.form1.ADBRSA.value);
            if(age==0 || document.form1.ADBRAge.value=="" || document.form1.ADBRAge.value==null)
            {
                alert("Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Age.");
                document.form1.ADBRAge.focus();
                document.form1.ADBRAge.select();
                return false;
            }
//            if(age<18 || age>60)
//            {
//                alert("Invalid Rider Age. Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Age between 18 and 60.");
//                document.form1.ADBRAge.focus();
//                document.form1.ADBRAge.select();
//                return false;
//            } 
            
            //term nd sa
            if(termr==0 || document.form1.ADBRTerm.value=="" || document.form1.ADBRTerm.value==null)
            {
                alert("Please enter the term for Reliance Accidental Death and Total and Permanent Disablement Rider.");
                document.form1.ADBRTerm.focus();
                document.form1.ADBRTerm.select();
                return false;
            }
//            if(termr<5 || termr>baseval )
//            {
//                alert("Reliance Accidental Death and Total and Permanent Disablement Rider should be between 5 and " + baseval);
//                document.form1.ADBRTerm.focus();
//                document.form1.ADBRTerm.select();
//                return false;
//            } 
            
            if(asa==0 || document.form1.ADBRSA.value=="" || document.form1.ADBRSA.value==null)
            {
                alert("Please enter sum assured for Reliance Accidental Death and Total and Permanent Disablement Rider.");
                document.form1.ADBRSA.focus();
                document.form1.ADBRSA.select();
                return false;
            }     
//            if(asa<25000)
//            {
//                alert("Minimum Sum Assured for Reliance Accidental Death and Total and Permanent Disablement Rider should be Rs.25000");
//                document.form1.ADBRSA.focus();
//                document.form1.ADBRSA.select();
//                return false;
//            }     

//            if(asa<baseSA || asa>5000000)
//            {
//                alert("Reliance Accidental Death and Total and Permanent Disablement Rider Sum Assured should be between Rs."+baseSA+" and Rs.5000000");
//                document.form1.ADBRSA.focus();
//                document.form1.ADBRSA.select();
//                return false;
//            }

        }
        if(document.form1.chkTermliferider.checked==true)
        { 
            var age=parseFloat(document.form1.TLBRAge.value);
            var termr=parseFloat(document.form1.TLBRTerm.value);
            var baseSA=parseFloat(document.form1.SA.value);
            var asa=parseFloat(document.form1.TLBRSA.value);
            var baseterm=parseFloat(document.form1.Term.value);
            if(age==0 || document.form1.TLBRAge.value=="" || document.form1.TLBRAge.value==null)
            {
                alert("Please enter the age for Reliance Term Life Insurance Benefit Rider.");
                document.form1.TLBRAge.focus();
                document.form1.TLBRAge.select();
                return false;
            }
//            if(age<18 || age>59)
//            {
//                alert("Invalid Rider Age. Please enter Reliance Term Life Insurance Benefit Rider Age between 18 and 59.");
//                document.form1.TLBRAge.focus();
//                document.form1.TLBRAge.select();
//                return false;
//            } 
            
            //term and sa
            if(termr==0 || document.form1.TLBRTerm.value=="" || document.form1.TLBRTerm.value==null)
            {
                alert("Please enter the term for Reliance Term Life Insurance Benefit Rider.");
                document.form1.TLBRTerm.focus();
                document.form1.TLBRTerm.select();
                return false;
            }
//            if(termr<5 || termr>Math.min(30,baseterm))
//            {
//                alert("Term for Reliance Term Life Insurance Benefit Rider should be between 5 and " + Math.min(30,baseterm));
//                document.form1.TLBRTerm.focus();
//                document.form1.TLBRTerm.select();
//                return false;
//            } 
//            
            if(asa==0 || document.form1.TLBRSA.value=="" || document.form1.TLBRSA.value==null)
            {
                alert("Please enter sum assured for Reliance Term Life Insurance Benefit Rider.");
                document.form1.TLBRSA.focus();
                document.form1.TLBRSA.select();
                return false;
            }           
//            if(asa<25000 || asa>baseSA)
//            {
//                alert("Reliance Term Life Insurance Benefit Rider Sum Assured should be between 25000 and "+baseSA);
//                document.form1.TLBRSA.focus();
//                document.form1.TLBRSA.select();
//                return false;
//            }
        }
        if(document.form1.chkmajor.checked==true)
        { 
            var age=parseFloat(document.form1.MSBRAge.value);
            var termr=parseFloat(document.form1.MSBRTerm.value);
            var baseSA=parseFloat(document.form1.SA.value);
            var asa=parseFloat(document.form1.MSBRSA.value);
            var baseterm=parseFloat(document.form1.Term.value);
            if(age==0 || document.form1.MSBRAge.value=="" || document.form1.MSBRAge.value==null)
            {
                alert("Please enter the age for Reliance New Major Surgical Benefit Rider.");
                document.form1.MSBRAge.focus();
                document.form1.MSBRAge.select();
                return false;
            }
//            if(age<18 || age>55)
//            {
//                alert("Invalid Rider Age. Please enter Reliance New Major Surgical Benefit Rider Age between 18 and 55.");
//                document.form1.MSBRAge.focus();
//                document.form1.MSBRAge.select();
//                return false;
//            } 
            
            //term and sa
            if(termr==0 || document.form1.MSBRTerm.value=="" || document.form1.MSBRTerm.value==null)
            {
                alert("Please enter the term for Reliance New Major Surgical Benefit Rider.");
                document.form1.MSBRTerm.focus();
                document.form1.MSBRTerm.select();
                return false;
            }
//            if(termr<5 || termr>Math.min(25,baseterm))
//            {
//                alert("Term for Reliance New Major Surgical Benefit Rider should be between 5 and " + Math.min(25,baseterm));
//                document.form1.MSBRTerm.focus();
//                document.form1.MSBRTerm.select();
//                return false;
//            }             
            if(asa==0 || document.form1.MSBRSA.value=="" || document.form1.MSBRSA.value==null)
            {
                alert("Please enter sum assured for Reliance New Major Surgical Benefit Rider.");
                document.form1.MSBRSA.focus();
                document.form1.MSBRSA.select();
                return false;
            }
//            if(asa<10000 || asa>Math.min(baseSA,500000))
//            {
//                alert("Reliance New Major Surgical Benefit Rider Sum Assured should be between Rs.10000 and "+"Rs."+Math.min(baseSA,500000));
//                document.form1.MSBRSA.focus();
//                document.form1.MSBRSA.select();
//                return false;
//            }
        }
        if(document.form1.chkccrider.checked==true)
        { 
            var age=parseFloat(document.form1.CCRAge.value);
            var termr=parseFloat(document.form1.CCRTerm.value);
            var baseSA=parseFloat(document.form1.SA.value);
            var asa=parseFloat(document.form1.CCRSA.value);
            var baseterm=parseFloat(document.form1.Term.value);
            if(age==0 || document.form1.CCRAge.value=="" || document.form1.CCRAge.value==null)
            {
                alert("Please enter the age for Reliance New Critical Conditions (25) Rider.");
                document.form1.CCRAge.focus();
                document.form1.CCRAge.select();
                return false;
            }
//            if(age<18 || age>55)
//            {
//                alert("Invalid Rider Age. Please enter Reliance New Critical Conditions (25) Rider Age between 18 and 55.");
//                document.form1.CCRAge.focus();
//                document.form1.CCRAge.select();
//                return false;
//            } 

            //term and sa
            if(termr==0 || document.form1.CCRTerm.value=="" || document.form1.CCRTerm.value==null)
            {
                alert("Please enter the term for Reliance New Critical Conditions (25) Rider.");
                document.form1.CCRTerm.focus();
                document.form1.CCRTerm.select();
                return false;
            }
//            if(termr<5 || termr>Math.min(25,baseterm))
//            {
//                alert("Term for Reliance New Critical Conditions (25) Rider should be between 5 and " + Math.min(25,baseterm));
//                document.form1.CCRTerm.focus();
//                document.form1.CCRTerm.select();
//                return false;
//            } 
            
            if(asa==0 || document.form1.CCRSA.value=="" || document.form1.CCRSA.value==null)
            {
                alert("Please enter sum assured for Reliance New Critical Conditions (25) Rider.");
                document.form1.CCRSA.focus();
                document.form1.CCRSA.select();
                return false;
            }
//            if(asa<10000 || asa>Math.min(baseSA,2000000))
//            {
//                alert("Reliance New Critical Conditions (25) Rider Sum Assured should be between Rs.10000 and Rs."+Math.min(baseSA,2000000));
//                document.form1.CCRSA.focus();
//                document.form1.CCRSA.select();
//                return false;
//            }
        }
        return true;
    }

//*****************************************************************************************************



//************************** Reliance Super InvestAssure Plus Term 10 Plan **************************************
function RelianceSuperInvestAssurePlusTerm10Plan()
    {
        var mode = (document.form1.Mode.value);
        var ann_prm = parseInt(document.form1.A_Prem.value);
        var min_SA = (ann_prm * 5);
        var max_SA = (ann_prm * 50);

        if(document.form1.txtName.value=="" || document.form1.txtName.value==null)
        {
            alert("Please enter your/Customer's name.");
            document.form1.txtName.focus();
            return false;
        }
        if(document.form1.txtAdvisor.value=="" || document.form1.txtAdvisor.value==null)
        {
            alert("Please enter your/Advisor name");
            document.form1.txtAdvisor.focus();
            return false;
        }
        if(document.form1.Sex.value=="Select")
        {
            alert("Please select your Sex");
            document.form1.Sex.focus();
            return false;
        }
        if(document.form1.Age.value=="Select")
        {
            alert("Please select your Age");
            document.form1.Age.focus();
            return false;
        }
//        if(document.form1.Term.value=="" || document.form1.Term.value==null)
//        {
//            alert("Please enter Policy Term");
//            document.form1.Term.focus();
//            return false;
//        }
//        if(document.form1.Term.value<16)
//        {
//            alert("Minimum Policy Term should be 16");
//            document.form1.Term.focus();
//            return false;
//        }        
        if(document.form1.Mode.value=="Select")
        {
            alert("Please select Mode of Premium Payment");
            document.form1.Mode.focus();
            return false;
        }
        if(document.form1.IP.value=="" || document.form1.IP.value==null || document.form1.IP.value==0)
        {
            alert("Please Enter Installment Premium");
            document.form1.IP.focus();
            return false;
        }
       
        if(document.form1.SA1.value=="" || document.form1.SA1.value==null || document.form1.SA1.value==0)
        {
            alert("Please enter basic Sum Assured.");
            document.form1.SA1.focus();
            return false;
        }         
        
        if(document.form1.ChkADTPD.checked==true)
        { 
            var age=parseFloat(document.form1.ADBRAge.value);
            var termr=parseFloat(document.form1.ADBRTerm.value);
            var baseval=parseFloat(document.form1.Term.value);
            var baseSA=parseFloat(document.form1.SA.value);
            var asa=parseFloat(document.form1.ADBRSA.value);
            if(age==0 || document.form1.ADBRAge.value=="" || document.form1.ADBRAge.value==null)
            {
                alert("Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Age.");
                document.form1.ADBRAge.focus();
                document.form1.ADBRAge.select();
                return false;
            }
//            if(age<18 || age>60)
//            {
//                alert("Invalid Rider Age. Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Age between 18 and 60.");
//                document.form1.ADBRAge.focus();
//                document.form1.ADBRAge.select();
//                return false;
//            } 
            
            //term nd sa
            if(termr==0 || document.form1.ADBRTerm.value=="" || document.form1.ADBRTerm.value==null)
            {
                alert("Please enter the term for Reliance Accidental Death and Total and Permanent Disablement Rider.");
                document.form1.ADBRTerm.focus();
                document.form1.ADBRTerm.select();
                return false;
            }
//            if(termr<5 )
//            {
//                alert("Minimum Term for Reliance Accidental Death and Total and Permanent Disablement Rider should be 5");
//                document.form1.ADBRTerm.focus();
//                document.form1.ADBRTerm.select();
//                return false;
//            } 
            
            if(asa==0 || document.form1.ADBRSA.value=="" || document.form1.ADBRSA.value==null)
            {
                alert("Please enter sum assured for Reliance Accidental Death and Total and Permanent Disablement Rider.");
                document.form1.ADBRSA.focus();
                document.form1.ADBRSA.select();
                return false;
            }          
//            if(asa<25000)
//            {
//                alert("Minimum Sum Assured for Reliance Accidental Death and Total and Permanent Disablement Rider should be Rs.25000");
//                document.form1.ADBRSA.focus();
//                document.form1.ADBRSA.select();
//                return false;
//            }
//            if(asa<baseSA || asa>5000000)
//            {
//                alert("Reliance Accidental Death and Total and Permanent Disablement Rider Sum Assured should be between Rs."+baseSA+" and Rs.5000000");
//                document.form1.ADBRSA.focus();
//                document.form1.ADBRSA.select();
//                return false;
//            }

        }
        if(document.form1.chkTermliferider.checked==true)
        { 
            var age=parseFloat(document.form1.TLBRAge.value);
            var termr=parseFloat(document.form1.TLBRTerm.value);
            var baseSA=parseFloat(document.form1.SA.value);
            var asa=parseFloat(document.form1.TLBRSA.value);
            var baseterm=parseFloat(document.form1.Term.value);
            if(age==0 || document.form1.TLBRAge.value=="" || document.form1.TLBRAge.value==null)
            {
                alert("Please enter the age for Reliance Term Life Insurance Benefit Rider.");
                document.form1.TLBRAge.focus();
                document.form1.TLBRAge.select();
                return false;
            }
//            if(age<18 || age>59)
//            {
//                alert("Invalid Rider Age. Please enter Reliance Term Life Insurance Benefit Rider Age between 18 and 59.");
//                document.form1.TLBRAge.focus();
//                document.form1.TLBRAge.select();
//                return false;
//            } 
            
            //term and sa
            if(termr==0 || document.form1.TLBRTerm.value=="" || document.form1.TLBRTerm.value==null)
            {
                alert("Please enter the term for Reliance Term Life Insurance Benefit Rider.");
                document.form1.TLBRTerm.focus();
                document.form1.TLBRTerm.select();
                return false;
            }
//            if(termr<5 || termr>10)
//            {
//                alert("Term for Reliance Term Life Insurance Benefit Rider should be between 5 and 10");
//                document.form1.TLBRTerm.focus();
//                document.form1.TLBRTerm.select();
//                return false;
//            } 
            
            if(asa==0 || document.form1.TLBRSA.value=="" || document.form1.TLBRSA.value==null)
            {
                alert("Please enter sum assured for Reliance Term Life Insurance Benefit Rider.");
                document.form1.TLBRSA.focus();
                document.form1.TLBRSA.select();
                return false;
            }           
//            if(asa<25000 || asa>baseSA)
//            {
//                alert("Reliance Term Life Insurance Benefit Rider Sum Assured should be between 25000 and "+baseSA);
//                document.form1.TLBRSA.focus();
//                document.form1.TLBRSA.select();
//                return false;
//            }
        }
        if(document.form1.chkmajor.checked==true)
        { 
            var age=parseFloat(document.form1.MSBRAge.value);
            var termr=parseFloat(document.form1.MSBRTerm.value);
            var baseSA=parseFloat(document.form1.SA.value);
            var asa=parseFloat(document.form1.MSBRSA.value);
            if(age==0 || document.form1.MSBRAge.value=="" || document.form1.MSBRAge.value==null)
            {
                alert("Please enter the age for Reliance New Major Surgical Benefit Rider.");
                document.form1.MSBRAge.focus();
                document.form1.MSBRAge.select();
                return false;
            }
//            if(age<18 || age>55)
//            {
//                alert("Invalid Rider Age. Please enter Reliance New Major Surgical Benefit Rider Age between 18 and 55.");
//                document.form1.MSBRAge.focus();
//                document.form1.MSBRAge.select();
//                return false;
//            } 
            
            //term and sa
            if(termr==0 || document.form1.MSBRTerm.value=="" || document.form1.MSBRTerm.value==null)
            {
                alert("Please enter the term for Reliance New Major Surgical Benefit Rider.");
                document.form1.MSBRTerm.focus();
                document.form1.MSBRTerm.select();
                return false;
            }
//            if(termr<5 || termr>10)
//            {
//                alert("Term for Reliance New Major Surgical Benefit Rider should be between 5 and 10.");
//                document.form1.MSBRTerm.focus();
//                document.form1.MSBRTerm.select();
//                return false;
//            }             
            if(asa==0 || document.form1.MSBRSA.value=="" || document.form1.MSBRSA.value==null)
            {
                alert("Please enter sum assured for Reliance New Major Surgical Benefit Rider.");
                document.form1.MSBRSA.focus();
                document.form1.MSBRSA.select();
                return false;
            }
//            if(asa<10000 || asa>Math.min(baseSA,500000))
//            {
//                alert("Reliance New Major Surgical Benefit Rider Sum Assured should be between Rs.10000 and "+"Rs."+Math.min(baseSA,500000));
//                document.form1.MSBRSA.focus();
//                document.form1.MSBRSA.select();
//                return false;
//            }
        }
        if(document.form1.chkccrider.checked==true)
        { 
            var age=parseFloat(document.form1.CCRAge.value);
            var termr=parseFloat(document.form1.CCRTerm.value);
            var baseSA=parseFloat(document.form1.SA.value);
            var asa=parseFloat(document.form1.CCRSA.value);
            if(age==0 || document.form1.CCRAge.value=="" || document.form1.CCRAge.value==null)
            {
                alert("Please enter the age for Reliance New Critical Conditions (25) Rider.");
                document.form1.CCRAge.focus();
                document.form1.CCRAge.select();
                return false;
            }
//            if(age<18 || age>55)
//            {
//                alert("Invalid Rider Age. Please enter Reliance New Critical Conditions (25) Rider Age between 18 and 55.");
//                document.form1.CCRAge.focus();
//                document.form1.CCRAge.select();
//                return false;
//            } 

            //term and sa
            if(termr==0 || document.form1.CCRTerm.value=="" || document.form1.CCRTerm.value==null)
            {
                alert("Please enter the term for Reliance New Critical Conditions (25) Rider.");
                document.form1.CCRTerm.focus();
                document.form1.CCRTerm.select();
                return false;
            }
//            if(termr<5 || termr>10)
//            {
//                alert("Term for Reliance New Critical Conditions (25) Rider should be between 5 and 10.");
//                document.form1.CCRTerm.focus();
//                document.form1.CCRTerm.select();
//                return false;
//            } 
            
            if(asa==0 || document.form1.CCRSA.value=="" || document.form1.CCRSA.value==null)
            {
                alert("Please enter sum assured for Reliance New Critical Conditions (25) Rider.");
                document.form1.CCRSA.focus();
                document.form1.CCRSA.select();
                return false;
            }
//            if(asa<10000 || asa>Math.min(baseSA,2000000))
//            {
//                alert("Reliance New Critical Conditions (25) Rider Sum Assured should be between Rs.10000 and Rs."+Math.min(baseSA,2000000));
//                document.form1.CCRSA.focus();
//                document.form1.CCRSA.select();
//                return false;
//            }
        }
        return true;
    }

//*****************************************************************************************************


//************************** Reliance Super Market Return Basic Plan **************************************
function RelianceSuperMarketReturnBasicPlan()
    {
        var mode = (document.form1.Mode.value);
        var ann_prm = parseInt(document.form1.A_Prem.value);
        var min_SA = (ann_prm * 5);
        var max_SA = (ann_prm * 50);

        if(document.form1.txtName.value=="" || document.form1.txtName.value==null)
        {
            alert("Please enter your/Customer's name.");
            document.form1.txtName.focus();
            return false;
        }
        if(document.form1.txtAdvisor.value=="" || document.form1.txtAdvisor.value==null)
        {
            alert("Please enter your/Advisor name");
            document.form1.txtAdvisor.focus();
            return false;
        }
        if(document.form1.Sex.value=="Select")
        {
            alert("Please select your Sex");
            document.form1.Sex.focus();
            return false;
        }
        if(document.form1.Age.value=="Select")
        {
            alert("Please select your Age");
            document.form1.Age.focus();
            return false;
        }
        if(document.form1.Term.value=="Select")
        {
            alert("Please Select Policy Term");
            document.form1.Term.focus();
            return false;
        }
        if(document.form1.MODETYPE.value=="Select")
        {
            alert("Please Enter Premium Paying Type");
            document.form1.MODETYPE.focus();
            return false;
        }
        
//      if(document.form1.Term.value<16)
//        {
//            alert("Minimum Policy Term should be 16");
//            document.form1.Term.focus();
//            return false;
//        }        
        if(document.form1.MODETYPE.value=="Regular Premium" && document.form1.Mode.value=="Select")
        {
            alert("Please select Mode of Premium Payment");
            document.form1.Mode.focus();
            return false;
        }
        if(document.form1.MODETYPE.value=="Regular Premium" && (document.form1.IP.value=="" || document.form1.IP.value==null || document.form1.IP.value==0))
        {
            alert("Please Enter Installment Premium");
            document.form1.IP.focus();
            return false;
        }
        
        if(document.form1.MODETYPE.value=="Single Premium" && (document.form1.AP.value=="" || document.form1.AP.value==null || document.form1.AP.value==0))
        {
            alert("Please Enter Amount of Single Premium");
            document.form1.AP.focus();
            return false;
        }
        
//        if(document.form1.MODETYPE.value=="Single Premium" && document.form1.AP.value<50000)
//        {
//            alert("Minimum Amount of Single Premium should be 50000");
//            document.form1.AP.focus();
//            return false;
//        }
        if(document.form1.SA1.value=="" || document.form1.SA1.value==null || document.form1.SA1.value==0)
        {
            alert("Please enter basic Sum Assured.");
            document.form1.SA1.focus();
            return false;
        }         
        
        if(document.form1.ChkADTPD.checked==true)
        { 
            var age=parseFloat(document.form1.ADBRAge.value);
            var termr=parseFloat(document.form1.ADBRTerm.value);
            var baseval=parseFloat(document.form1.Term.value);
            var baseSA=parseFloat(document.form1.SA.value);
            var asa=parseFloat(document.form1.ADBRSA.value);
            if(age==0 || document.form1.ADBRAge.value=="" || document.form1.ADBRAge.value==null)
            {
                alert("Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Age.");
                document.form1.ADBRAge.focus();
                document.form1.ADBRAge.select();
                return false;
            }
//            if(age<18 || age>60)
//            {
//                alert("Invalid Rider Age. Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Age between 18 and 60.");
//                document.form1.ADBRAge.focus();
//                document.form1.ADBRAge.select();
//                return false;
//            } 
            
            //term nd sa
            if(termr==0 || document.form1.ADBRTerm.value=="" || document.form1.ADBRTerm.value==null)
            {
                alert("Please enter the term for Reliance Accidental Death and Total and Permanent Disablement Rider.");
                document.form1.ADBRTerm.focus();
                document.form1.ADBRTerm.select();
                return false;
            }         
//            if(termr<5 || termr>baseval)
//            {
//                alert("Reliance Accidental Death and Total and Permanent Disablement Rider Term should be between 5 and "+ baseval);
//                document.form1.ADBRTerm.focus();
//                document.form1.ADBRTerm.select();
//                return false;
//            }
           
            
            if(asa==0 || document.form1.ADBRSA.value=="" || document.form1.ADBRSA.value==null)
            {
                alert("Please enter sum assured for Reliance Accidental Death and Total and Permanent Disablement Rider.");
                document.form1.ADBRSA.focus();
                document.form1.ADBRSA.select();
                return false;
            }  
//            if(asa<25000)
//            {
//                alert("Minimum Sum Assured for Reliance Accidental Death and Total and Permanent Disablement Rider should be Rs.25000");
//                document.form1.ADBRSA.focus();
//                document.form1.ADBRSA.select();
//                return false;
//            }        

//            if(asa<baseSA || asa>5000000)
//            {
//                alert("Reliance Accidental Death and Total and Permanent Disablement Rider Sum Assured should be between Rs."+baseSA+" and Rs.5000000");
//                document.form1.ADBRSA.focus();
//                document.form1.ADBRSA.select();
//                return false;
//            }

        }
        if(document.form1.chkTermliferider.checked==true)
        { 
            var age=parseFloat(document.form1.TLBRAge.value);
            var termr=parseFloat(document.form1.TLBRTerm.value);
            var baseSA=parseFloat(document.form1.SA.value);
            var asa=parseFloat(document.form1.TLBRSA.value);
            var baseterm=parseFloat(document.form1.Term.value);
            if(age==0 || document.form1.TLBRAge.value=="" || document.form1.TLBRAge.value==null)
            {
                alert("Please enter the age for Reliance Term Life Insurance Benefit Rider.");
                document.form1.TLBRAge.focus();
                document.form1.TLBRAge.select();
                return false;
            }
////            if(age<18 || age>59)
////            {
////                alert("Invalid Rider Age. Please enter Reliance Term Life Insurance Benefit Rider Age between 18 and 59.");
////                document.form1.TLBRAge.focus();
////                document.form1.TLBRAge.select();
////                return false;
////            } 
            
            //term and sa
            if(termr==0 || document.form1.TLBRTerm.value=="" || document.form1.TLBRTerm.value==null)
            {
                alert("Please enter the term for Reliance Term Life Insurance Benefit Rider.");
                document.form1.TLBRTerm.focus();
                document.form1.TLBRTerm.select();
                return false;
            }           
//            if(termr<5 || termr>Math.min(baseval,30))
//            {
//                alert("Reliance Term Life Insurance Benefit Rider should be between 5 and  "+Math.min(baseval,30));
//                document.form1.TLBRTerm.focus();
//                document.form1.TLBRTerm.select();
//                return false;
//            }                  
            
            if(asa==0 || document.form1.TLBRSA.value=="" || document.form1.TLBRSA.value==null)
            {
                alert("Please enter sum assured for Reliance Term Life Insurance Benefit Rider.");
                document.form1.TLBRSA.focus();
                document.form1.TLBRSA.select();
                return false;
            }           
////            if(asa<25000 || asa>baseSA)
////            {
////                alert("Reliance Term Life Insurance Benefit Rider Sum Assured should be between 25000 and "+baseSA);
////                document.form1.TLBRSA.focus();
////                document.form1.TLBRSA.select();
////                return false;
////            }
        }
        if(document.form1.chkmajor.checked==true)
        { 
            var age=parseFloat(document.form1.MSBRAge.value);
            var termr=parseFloat(document.form1.MSBRTerm.value);
            var baseSA=parseFloat(document.form1.SA.value);
            var asa=parseFloat(document.form1.MSBRSA.value);
            if(age==0 || document.form1.MSBRAge.value=="" || document.form1.MSBRAge.value==null)
            {
                alert("Please enter the age for Reliance New Major Surgical Benefit Rider.");
                document.form1.MSBRAge.focus();
                document.form1.MSBRAge.select();
                return false;
            }
////            if(age<18 || age>55)
////            {
////                alert("Invalid Rider Age. Please enter Reliance New Major Surgical Benefit Rider Age between 18 and 55.");
////                document.form1.MSBRAge.focus();
////                document.form1.MSBRAge.select();
////                return false;
////            } 
            
            //term and sa
            if(termr==0 || document.form1.MSBRTerm.value=="" || document.form1.MSBRTerm.value==null)
            {
                alert("Please enter the term for Reliance New Major Surgical Benefit Rider.");
                document.form1.MSBRTerm.focus();
                document.form1.MSBRTerm.select();
                return false;
            }
            
//            if(termr<5 || termr>Math.min(baseval,25))
//            {
//                alert("Reliance New Major Surgical Benefit Rider should be between 5 and "+Math.min(baseval,25));
//                document.form1.MSBRTerm.focus();
//                document.form1.MSBRTerm.select();
//                return false;
//            }
                         
            if(asa==0 || document.form1.MSBRSA.value=="" || document.form1.MSBRSA.value==null)
            {
                alert("Please enter sum assured for Reliance New Major Surgical Benefit Rider.");
                document.form1.MSBRSA.focus();
                document.form1.MSBRSA.select();
                return false;
            }
//            if(asa<10000 || asa>Math.min(baseSA,500000))
//            {
//                alert("Reliance New Major Surgical Benefit Rider Sum Assured should be between Rs.10000 and "+"Rs."+Math.min(baseSA,500000));
//                document.form1.MSBRSA.focus();
//                document.form1.MSBRSA.select();
//                return false;
//            }
        }
        if(document.form1.chkccrider.checked==true)
        { 
            var age=parseFloat(document.form1.CCRAge.value);
            var termr=parseFloat(document.form1.CCRTerm.value);
            var baseSA=parseFloat(document.form1.SA.value);
            var asa=parseFloat(document.form1.CCRSA.value);
            if(age==0 || document.form1.CCRAge.value=="" || document.form1.CCRAge.value==null)
            {
                alert("Please enter the age for Reliance New Critical Conditions (25) Rider.");
                document.form1.CCRAge.focus();
                document.form1.CCRAge.select();
                return false;
            }
            if(age<18 || age>55)
            {
                alert("Invalid Rider Age. Please enter Reliance New Critical Conditions (25) Rider Age between 18 and 55.");
                document.form1.CCRAge.focus();
                document.form1.CCRAge.select();
                return false;
            } 

            //term and sa
            if(termr==0 || document.form1.CCRTerm.value=="" || document.form1.CCRTerm.value==null)
            {
                alert("Please enter the term for Reliance New Critical Conditions (25) Rider.");
                document.form1.CCRTerm.focus();
                document.form1.CCRTerm.select();
                return false;
            }            
//            if(termr<5 || termr>Math.min(baseval,25))
//            {
//                alert("Reliance New Critical Conditions (25) Rider should be between 5 and "+Math.min(baseval,25));
//                document.form1.CCRTerm.focus();
//                document.form1.CCRTerm.select();
//                return false;
//            }
//               
            if(asa==0 || document.form1.CCRSA.value=="" || document.form1.CCRSA.value==null)
            {
                alert("Please enter sum assured for Reliance New Critical Conditions (25) Rider.");
                document.form1.CCRSA.focus();
                document.form1.CCRSA.select();
                return false;
            }
//            if(asa<10000 || asa>Math.min(baseSA,2000000))
//            {
//                alert("Reliance New Critical Conditions (25) Rider Sum Assured should be between Rs.10000 and Rs."+Math.min(baseSA,2000000));
//                document.form1.CCRSA.focus();
//                document.form1.CCRSA.select();
//                return false;
//            }
        }
        return true;
    }
function ShowHidePlanRiderMar()
    {   
        if (document.form1.MODETYPE.value == "Regular Premium" || document.form1.MODETYPE.value =="Limited Premium")
        {
            document.getElementById("rider1").style.visibility = "visible";
            document.getElementById("rider2").style.visibility = "visible";
            document.getElementById("rider3").style.visibility = "visible";
            document.getElementById("rider4").style.visibility = "visible";
            document.getElementById("rider5").style.visibility = "visible";
            
            document.getElementById("rider1").style.display="block";
            document.getElementById("rider2").style.display="block";
            document.getElementById("rider3").style.display="block";
            document.getElementById("rider4").style.display="block";
            document.getElementById("rider5").style.display="block";
            
        }
        else 
        {
            document.getElementById("rider1").style.visibility = "hidden";
            document.getElementById("rider2").style.visibility = "hidden";
            document.getElementById("rider3").style.visibility = "hidden";
           document.getElementById("rider4").style.visibility = "hidden";
            document.getElementById("rider5").style.visibility = "hidden";

            document.getElementById("rider1").style.display="none";
            document.getElementById("rider2").style.display="none";
            document.getElementById("rider3").style.display="none";
            document.getElementById("rider4").style.display="none";
            document.getElementById("rider5").style.display="none";
        }
    }
//*****************************************************************************************************

//************************** Reliance Super Market Return Term 10 Plan **************************************
function RelianceSuperMarketReturnTerm10Plan()
    {
        var mode = (document.form1.Mode.value);
        var ann_prm = parseInt(document.form1.A_Prem.value);
        var min_SA = (ann_prm * 5);
        var max_SA = (ann_prm * 50);

        if(document.form1.txtName.value=="" || document.form1.txtName.value==null)
        {
            alert("Please enter your/Customer's name.");
            document.form1.txtName.focus();
            return false;
        }
        if(document.form1.txtAdvisor.value=="" || document.form1.txtAdvisor.value==null)
        {
            alert("Please enter your/Advisor name");
            document.form1.txtAdvisor.focus();
            return false;
        }
        if(document.form1.Sex.value=="Select")
        {
            alert("Please select your Sex");
            document.form1.Sex.focus();
            return false;
        }
        if(document.form1.Age.value=="Select")
        {
            alert("Please select your Age");
            document.form1.Age.focus();
            return false;
        }
//        if(document.form1.Term.value=="" || document.form1.Term.value==null)
//        {
//            alert("Please enter Policy Term");
//            document.form1.Term.focus();
//            return false;
//        }
//        if(document.form1.Term.value<16)
//        {
//            alert("Minimum Policy Term should be 16");
//            document.form1.Term.focus();
//            return false;
//        }        
////        if(document.form1.Mode.value=="Select")
////        {
////            alert("Please select Mode of Premium Payment");
////            document.form1.Mode.focus();
////            return false;
////        }
////        if(document.form1.IP.value=="" || document.form1.IP.value==null || document.form1.IP.value==0)
////        {
////            alert("Please Enter Installment Premium");
////            document.form1.IP.focus();
////            return false;
////        }
////        
////        if(document.form1.MODETYPE.value=="Single Premium" && document.form1.IP.value<30000)
////        {
////            alert("Minimum Installment Premium should be 30000");
////            document.form1.IP.focus();
////            return false;
////        }
////        
////        if(document.form1.MODETYPE.value=="Regular Premium" && document.form1.Mode.value=="Yearly" && document.form1.IP.value!="")
////        {
////            if(parseFloat(document.form1.IP.value)<12000)
////            {
////            alert("minimum Installment Premium for Yearly is 12000.", "RELIANCE SUPER GOLDEN YEAR PLAN-PLUS ");
////            document.form1.IP.focus();
////            return false;
////            }
////        }
////        else if(document.form1.MODETYPE.value=="Regular Premium" && document.form1.Mode.value=="Half Yearly" && document.form1.IP.value!="")
////        {
////            if(parseFloat(document.form1.IP.value)<6000)
////            {
////            alert("minimum Installment Premium for Half Yearly is 6000.", "RELIANCE SUPER GOLDEN YEAR PLAN-PLUS ");
////            document.form1.IP.focus();
////            return false;
////            }
////        }
////        else if(document.form1.MODETYPE.value=="Regular Premium" && document.form1.Mode.value=="Quarterly" && document.form1.IP.value!="")           
////        {
////            if(parseFloat(document.form1.IP.value)<3000)
////            {
////            alert("minimum Installment Premium for Quarterly is 3000.", "RELIANCE SUPER GOLDEN YEAR PLAN-PLUS ");
////            document.form1.IP.focus();
////            return false;
////            }
////        }
////        else if(document.form1.MODETYPE.value=="Regular Premium" && document.form1.Mode.value=="Monthly" && document.form1.IP.value!="")            
////        {
////            if(parseFloat(document.form1.IP.value)<1250)
////            {
////            alert("minimum Installment Premium for Monthly is 1250.", "RELIANCE SUPER GOLDEN YEAR PLAN-PLUS");
////            document.form1.IP.focus();
////            return false;
////            }
////        }


        if(document.form1.MODETYPE.value=="Select")
        {
            alert("Please Enter Premium Paying Type");
            document.form1.MODETYPE.focus();
            return false;
        }
        if(document.form1.MODETYPE.value=="Regular Premium" && document.form1.Mode.value=="Select")
        {
            alert("Please select Mode of Premium Payment");
            document.form1.Mode.focus();
            return false;
        }
        if(document.form1.MODETYPE.value=="Regular Premium" && (document.form1.IP.value=="" || document.form1.IP.value==null || document.form1.IP.value==0))
        {
            alert("Please Enter Installment Premium");
            document.form1.IP.focus();
            return false;
        }
        
        if(document.form1.MODETYPE.value=="Single Premium" && (document.form1.AP.value=="" || document.form1.AP.value==null || document.form1.AP.value==0))
        {
            alert("Please Enter Amount of Single Premium");
            document.form1.AP.focus();
            return false;
        }
        
////        if(document.form1.MODETYPE.value=="Single Premium" && document.form1.AP.value<30000)
////        {
////            alert("Minimum Amount of Single Premium should be 30000");
////            document.form1.AP.focus();
////            return false;
////        }
        if(document.form1.SA1.value=="" || document.form1.SA1.value==null || document.form1.SA1.value==0)
        {
            alert("Please enter basic Sum Assured.");
            document.form1.SA1.focus();
            return false;
        }         
        
        if(document.form1.ChkADTPD.checked==true)
        { 
            var age=parseFloat(document.form1.ADBRAge.value);
            var termr=parseFloat(document.form1.ADBRTerm.value);
            var baseval=parseFloat(document.form1.Term.value);
            var baseSA=parseFloat(document.form1.SA.value);
            var asa=parseFloat(document.form1.ADBRSA.value);
            if(age==0 || document.form1.ADBRAge.value=="" || document.form1.ADBRAge.value==null)
            {
                alert("Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Age.");
                document.form1.ADBRAge.focus();
                document.form1.ADBRAge.select();
                return false;
            }
//            if(age<18 || age>60)
//            {
//                alert("Invalid Rider Age. Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Age between 18 and 60.");
//                document.form1.ADBRAge.focus();
//                document.form1.ADBRAge.select();
//                return false;
//            } 
            
            //term nd sa
            if(termr==0 || document.form1.ADBRTerm.value=="" || document.form1.ADBRTerm.value==null)
            {
                alert("Please enter the term for Reliance Accidental Death and Total and Permanent Disablement Rider.");
                document.form1.ADBRTerm.focus();
                document.form1.ADBRTerm.select();
                return false;
            }
//            if(document.form1.MODETYPE.value=="Regular Premium")
//            {
//                if(termr<5 || termr>baseval)
//                {
//                    alert("Reliance Accidental Death and Total and Permanent Disablement Rider Term should be between 5 and "+ baseval);
//                    document.form1.ADBRTerm.focus();
//                    document.form1.ADBRTerm.select();
//                    return false;
//                }
//            }
            
            if(asa==0 || document.form1.ADBRSA.value=="" || document.form1.ADBRSA.value==null)
            {
                alert("Please enter sum assured for Reliance Accidental Death and Total and Permanent Disablement Rider.");
                document.form1.ADBRSA.focus();
                document.form1.ADBRSA.select();
                return false;
            }          
//            if(asa<25000)
//            {
//                alert("Minimum Sum Assured for Reliance Accidental Death and Total and Permanent Disablement Rider should be Rs.25000");
//                document.form1.ADBRSA.focus();
//                document.form1.ADBRSA.select();
//                return false;
//            }
//            if(asa<baseSA || asa>5000000)
//            {
//                alert("Reliance Accidental Death and Total and Permanent Disablement Rider Sum Assured should be between Rs."+baseSA+" and Rs.5000000");
//                document.form1.ADBRSA.focus();
//                document.form1.ADBRSA.select();
//                return false;
//            }

        }
        if(document.form1.chkTermliferider.checked==true)
        { 
            var age=parseFloat(document.form1.TLBRAge.value);
            var termr=parseFloat(document.form1.TLBRTerm.value);
            var baseSA=parseFloat(document.form1.SA.value);
            var asa=parseFloat(document.form1.TLBRSA.value);
            var baseterm=parseFloat(document.form1.Term.value);
            if(age==0 || document.form1.TLBRAge.value=="" || document.form1.TLBRAge.value==null)
            {
                alert("Please enter the age for Reliance Term Life Insurance Benefit Rider.");
                document.form1.TLBRAge.focus();
                document.form1.TLBRAge.select();
                return false;
            }
//            if(age<18 || age>59)
//            {
//                alert("Invalid Rider Age. Please enter Reliance Term Life Insurance Benefit Rider Age between 18 and 59.");
//                document.form1.TLBRAge.focus();
//                document.form1.TLBRAge.select();
//                return false;
//            } 
            
            //term and sa
            if(termr==0 || document.form1.TLBRTerm.value=="" || document.form1.TLBRTerm.value==null)
            {
                alert("Please enter the term for Reliance Term Life Insurance Benefit Rider.");
                document.form1.TLBRTerm.focus();
                document.form1.TLBRTerm.select();
                return false;
            }
//            if(document.form1.MODETYPE.value=="Regular Premium")
//            {
//                if(termr<5 || termr>10)
//                {
//                    alert("Reliance Term Life Insurance Benefit Rider should be between 5 and 10");
//                    document.form1.TLBRTerm.focus();
//                    document.form1.TLBRTerm.select();
//                    return false;
//                }
//            }    
            
            if(asa==0 || document.form1.TLBRSA.value=="" || document.form1.TLBRSA.value==null)
            {
                alert("Please enter sum assured for Reliance Term Life Insurance Benefit Rider.");
                document.form1.TLBRSA.focus();
                document.form1.TLBRSA.select();
                return false;
            }           
//            if(asa<25000 || asa>baseSA)
//            {
//                alert("Reliance Term Life Insurance Benefit Rider Sum Assured should be between 25000 and "+baseSA);
//                document.form1.TLBRSA.focus();
//                document.form1.TLBRSA.select();
//                return false;
//            }
        }
        if(document.form1.chkmajor.checked==true)
        { 
            var age=parseFloat(document.form1.MSBRAge.value);
            var termr=parseFloat(document.form1.MSBRTerm.value);
            var baseSA=parseFloat(document.form1.SA.value);
            var asa=parseFloat(document.form1.MSBRSA.value);
            if(age==0 || document.form1.MSBRAge.value=="" || document.form1.MSBRAge.value==null)
            {
                alert("Please enter the age for Reliance New Major Surgical Benefit Rider.");
                document.form1.MSBRAge.focus();
                document.form1.MSBRAge.select();
                return false;
            }
//            if(age<18 || age>55)
//            {
//                alert("Invalid Rider Age. Please enter Reliance New Major Surgical Benefit Rider Age between 18 and 55.");
//                document.form1.MSBRAge.focus();
//                document.form1.MSBRAge.select();
//                return false;
//            } 
            
            //term and sa
            if(termr==0 || document.form1.MSBRTerm.value=="" || document.form1.MSBRTerm.value==null)
            {
                alert("Please enter the term for Reliance New Major Surgical Benefit Rider.");
                document.form1.MSBRTerm.focus();
                document.form1.MSBRTerm.select();
                return false;
            }
//            if(document.form1.MODETYPE.value=="Regular Premium")
//            {
//                if(termr<5 || termr>10)
//                {
//                    alert("Term for Reliance New Major Surgical Benefit Rider should be between 5 and 10.");
//                    document.form1.MSBRTerm.focus();
//                    document.form1.MSBRTerm.select();
//                    return false;
//                } 
//            }            
            if(asa==0 || document.form1.MSBRSA.value=="" || document.form1.MSBRSA.value==null)
            {
                alert("Please enter sum assured for Reliance New Major Surgical Benefit Rider.");
                document.form1.MSBRSA.focus();
                document.form1.MSBRSA.select();
                return false;
            }
//            if(asa<10000 || asa>Math.min(baseSA,500000))
//            {
//                alert("Reliance New Major Surgical Benefit Rider Sum Assured should be between Rs.10000 and "+"Rs."+Math.min(baseSA,500000));
//                document.form1.MSBRSA.focus();
//                document.form1.MSBRSA.select();
//                return false;
//            }
        }
        if(document.form1.chkccrider.checked==true)
        { 
            var age=parseFloat(document.form1.CCRAge.value);
            var termr=parseFloat(document.form1.CCRTerm.value);
            var baseSA=parseFloat(document.form1.SA.value);
            var asa=parseFloat(document.form1.CCRSA.value);
            if(age==0 || document.form1.CCRAge.value=="" || document.form1.CCRAge.value==null)
            {
                alert("Please enter the age for Reliance New Critical Conditions (25) Rider.");
                document.form1.CCRAge.focus();
                document.form1.CCRAge.select();
                return false;
            }
//            if(age<18 || age>55)
//            {
//                alert("Invalid Rider Age. Please enter Reliance New Critical Conditions (25) Rider Age between 18 and 55.");
//                document.form1.CCRAge.focus();
//                document.form1.CCRAge.select();
//                return false;
//            } 

            //term and sa
            if(termr==0 || document.form1.CCRTerm.value=="" || document.form1.CCRTerm.value==null)
            {
                alert("Please enter the term for Reliance New Critical Conditions (25) Rider.");
                document.form1.CCRTerm.focus();
                document.form1.CCRTerm.select();
                return false;
            }
//            if(document.form1.MODETYPE.value=="Regular Premium")
//            {
//                if(termr<5 || termr>10)
//                {
//                    alert("Term for Reliance New Critical Conditions (25) Rider should be between 5 and 10.");
//                    document.form1.CCRTerm.focus();
//                    document.form1.CCRTerm.select();
//                    return false;
//                } 
//            }
            
            if(asa==0 || document.form1.CCRSA.value=="" || document.form1.CCRSA.value==null)
            {
                alert("Please enter sum assured for Reliance New Critical Conditions (25) Rider.");
                document.form1.CCRSA.focus();
                document.form1.CCRSA.select();
                return false;
            }
//            if(asa<10000 || asa>Math.min(baseSA,2000000))
//            {
//                alert("Reliance New Critical Conditions (25) Rider Sum Assured should be between Rs.10000 and Rs."+Math.min(baseSA,2000000));
//                document.form1.CCRSA.focus();
//                document.form1.CCRSA.select();
//                return false;
//            }
        }
        return true;
    }

//*****************************************************************************************************


//********************************** SUPER IMAAN INVESTMENT BASIC PLAN *********************************


function SuperImaanInvestmentPlan()
    {
        var mode = (document.form1.Mode.value);
        var ann_prm = parseInt(document.form1.A_Prem.value);
        var min_SA = (ann_prm * 5);
        var max_SA = (ann_prm * 50);

        if(document.form1.txtName.value=="" || document.form1.txtName.value==null)
        {
            alert("Please enter your/Customer's name.");
            document.form1.txtName.focus();
            return false;
        }
        if(document.form1.txtAdvisor.value=="" || document.form1.txtAdvisor.value==null)
        {
            alert("Please enter your/Advisor name");
            document.form1.txtAdvisor.focus();
            return false;
        }
        if(document.form1.Sex.value=="Select")
        {
            alert("Please select your Sex");
            document.form1.Sex.focus();
            return false;
        }
        if(document.form1.Age.value=="Select")
        {
            alert("Please select your Age");
            document.form1.Age.focus();
            return false;
        }  
        if(document.form1.Term.value=="Select")
        {
            alert("Please select Policy Term");
            document.form1.Term.focus();
            return false;
        } 
        if(document.form1.PType.value=="Select")
        {
            alert("Please select Type of Premium");
            document.form1.PType.focus();
            return false;
        }  
        
        if(document.form1.Mode.value=="Select")
        {
            alert("Please select Mode of Premium Payment");
            document.form1.Mode.focus();
            return false;
        }        
        if(document.form1.IP.value=="" || document.form1.IP.value==null || document.form1.IP.value==0)
        {
            alert("Please enter Installment Premium.");
            document.form1.IP.focus();
            return false;
        }     
        if(document.form1.PType.value=="Regular Premium" && document.form1.Mode.value=="Yearly" && document.form1.IP.value!="")
        {
            if(parseFloat(document.form1.IP.value)<20000)
            {
            alert("Minimum Installment Premium for Yearly is 20000.", "RELIANCE SUPER GOLDEN YEAR PLAN-PLUS ");
            document.form1.IP.focus();
            return false;
            }
        }
        else if(document.form1.PType.value=="Regular Premium" && document.form1.Mode.value=="Half Yearly" && document.form1.IP.value!="")
        {
            if(parseFloat(document.form1.IP.value)<10000)
            {
            alert("Minimum Installment Premium for Half Yearly is 10000.", "RELIANCE SUPER GOLDEN YEAR PLAN-PLUS ");
            document.form1.IP.focus();
            return false;
            }
        }
        else if(document.form1.PType.value=="Regular Premium" && document.form1.Mode.value=="Quarterly" && document.form1.IP.value!="")           
        {
            if(parseFloat(document.form1.IP.value)<5000)
            {
            alert("Minimum Installment Premium for Quarterly is 5000.", "RELIANCE SUPER GOLDEN YEAR PLAN-PLUS ");
            document.form1.IP.focus();
            return false;
            }
        }
        else if(document.form1.PType.value=="Regular Premium" && document.form1.Mode.value=="Monthly" && document.form1.IP.value!="")            
        {
            if(parseFloat(document.form1.IP.value)<2000)
            {
            alert("Minimum Installment Premium for Monthly is 2000.", "RELIANCE SUPER GOLDEN YEAR PLAN-PLUS");
            document.form1.IP.focus();
            return false;
            }
        }
        
        
        if(document.form1.PType.value=="Limited Premium" && document.form1.Mode.value=="Yearly" && document.form1.IP.value!="")
        {
            if(parseFloat(document.form1.IP.value)<25000)
            {
            alert("Minimum Installment Premium for Yearly is 25000.", "RELIANCE SUPER GOLDEN YEAR PLAN-PLUS ");
            document.form1.IP.focus();
            return false;
            }
        }
        else if(document.form1.PType.value=="Limited Premium" && document.form1.Mode.value=="Half Yearly" && document.form1.IP.value!="")
        {
            if(parseFloat(document.form1.IP.value)<12500)
            {
            alert("Minimum Installment Premium for Half Yearly is 12500.", "RELIANCE SUPER GOLDEN YEAR PLAN-PLUS ");
            document.form1.IP.focus();
            return false;
            }
        }
        else if(document.form1.PType.value=="Limited Premium" && document.form1.Mode.value=="Quarterly" && document.form1.IP.value!="")           
        {
            if(parseFloat(document.form1.IP.value)<6250)
            {
            alert("Minimum Installment Premium for Quarterly is 6250.", "RELIANCE SUPER GOLDEN YEAR PLAN-PLUS ");
            document.form1.IP.focus();
            return false;
            }
        }
        else if(document.form1.PType.value=="Limited Premium" && document.form1.Mode.value=="Monthly" && document.form1.IP.value!="")            
        {
            if(parseFloat(document.form1.IP.value)<2500)
            {
            alert("Minimum Installment Premium for Monthly is 2500.", "RELIANCE SUPER GOLDEN YEAR PLAN-PLUS");
            document.form1.IP.focus();
            return false;
            }
        }
        if(document.form1.SA1.value=="" || document.form1.SA1.value==null || document.form1.SA1.value==0)
        {
            alert("Please enter basic Sum Assured.");
            document.form1.SA1.focus();
            return false;
        }  
        if(document.form1.SA.value=="" || document.form1.SA.value==null || document.form1.SA.value==0)
        {
            alert("Please enter basic Sum Assured.");
            document.form1.SA.focus();
            return false;
        }          
    }        
    
    function GetPPT()
    {
        if(document.form1.PType.value=="Limited Premium" )
        {
            document.form1.PPT.value=document.form1.Term.value-5;
            //document.form1.TextBox1.value=document.form1.Term.value-5;
        }
        else if(document.form1.PType.value=="Regular Premium")
        {
            document.form1.PPT.value=document.form1.Term.value;
            // document.form1.TextBox1.value=document.form1.Term.value;
        }
        else if(document.form1.PType.value=="Single Premium")
        {
        document.form1.PPT.value="1";
        }
    }
    
    function blankFund()
    {
     if(document.form1.NMMF.value=="" || document.form1.NMMF.value==null)
        {
            document.form1.NMMF.value=0;
        } 
    }
    
    function AddRemoveItems()
    {
        if(document.form1.MODETYPE.value=="Single Premium")
        {    
            document.form1.Mode.remove(4);
            document.form1.Mode.remove(3);
            document.form1.Mode.remove(2);        
        }
        if(document.form1.MODETYPE.value=="Regular Premium" || document.form1.MODETYPE.value=="Limited Premium")
        {   
            document.form1.Mode.length = 0;
            
            var optn5 = document.createElement("OPTION");
            optn5.text = "Select";
            optn5.value = "Select";
            document.form1.Mode.options.add(optn5);
            
            var optn4 = document.createElement("OPTION");
            optn4.text = "Yearly";
            optn4.value = "Yearly";
            document.form1.Mode.options.add(optn4);
            
            var optn = document.createElement("OPTION");
            optn.text = "Half Yearly";
            optn.value = "Half Yearly";
            document.form1.Mode.options.add(optn);
            
            var optn1 = document.createElement("OPTION");            
            optn1.text = "Quarterly";
            optn1.value = "Quarterly";            
            document.form1.Mode.options.add(optn1);
            
            var optn2 = document.createElement("OPTION");    
            optn2.text = "Monthly";
            optn2.value = "Monthly";
            document.form1.Mode.options.add(optn2);
        }

    }
//*******************************************************************************************************































    function cal_prem()
    {
        var p=document.form1.PREMIUM.value;
        if(p=="")
        {
            document.form1.A_Prem.value=0;
        }
        var m=document.form1.Mode.value;
        if(m=="Quarterly")
        {
            if(p=="")
            {
                document.form1.A_Prem.value=0;
            }
            else
            {
                var md=4;
                document.form1.A_Prem.value=(md) * (p);
            }
        }
        if(m=="Monthly")
        {
            if(p=="")
            {
                document.form1.A_Prem.value=0;
            }
            else
            {
                var md=12;
                document.form1.A_Prem.value=(md) * (p);
            }
        }
        if(m=="Yearly")
        {
            if(p=="")
            {
                document.form1.A_Prem.value=0;
            }
            else
            {
                var md=1;
                document.form1.A_Prem.value=(md) * (p);
            }        
        }
        if(m=="Half Yearly")
        {
            if(p=="")
            {
                document.form1.A_Prem.value=0;
            }
            else
            {
                var md=2;
                document.form1.A_Prem.value=(md) * (p);
            }
        }
        document.form1.A_Prem1.value=document.form1.A_Prem.value;
    }

    function changeppt()
    {
		
		if(document.form1.PPTerm.value!=""|| document.form1.PPTerm.value==0)
		{
       	 document.form1.PPTerm.value=document.form1.Term.value;
		}
		
    }
//----- fUNDcHECKING fUNCTION
    function blankfund()
    {
        if(document.form1.PCSF.value=="" || document.form1.PCSF.value==null)
        {
            document.form1.PCSF.value=0;
        } 
        if(document.form1.PBF.value=="" || document.form1.PBF.value==null)
        {
            document.form1.PBF.value=0;
        } 
        if(document.form1.PGF.value=="" || document.form1.PGF.value==null)
        {
            document.form1.PGF.value=0;
        } 
        if(document.form1.PEF.value=="" || document.form1.PEF.value==null)
        {
            document.form1.PEF.value=0;
        } 
        if(document.form1.PPEF.value=="" || document.form1.PPEF.value==null)
        {
            document.form1.PPEF.value=0; 
        } 
        if(document.form1.PIF.value=="" || document.form1.PIF.value==null)
        {
            document.form1.PIF.value=0; 
        } 
        if(document.form1.PENF.value=="" || document.form1.PENF.value==null)
        {
            document.form1.PENF.value=0;
        } 
        if(document.form1.PMDF.value=="" || document.form1.PMDF.value==null)
        {
            document.form1.PMDF.value=0; 
        }
    }

    function checkFund()
    {
        var cap_sec_fund=parseInt(document.form1.PCSF.value);
        var bal_fund=parseInt(document.form1.PBF.value);
        var growth_fund=parseInt(document.form1.PGF.value);
        var equity_fund=parseInt(document.form1.PEF.value);
        var pure_fund = parseInt(document.form1.PPEF.value);
        var infra_fund = document.form1.PIF.value;
        var energy_fund = document.form1.PENF.value;
        var mid_fund = document.form1.PMDF.value;
        var txtname=document.form1.txtName.value;
        var prm=document.form1.PREMIUM.value;
        var trm=document.form1.Term.value;
        var sex1=document.form1.Sex.selectedIndex;
        var mode=document.form1.Mode.value;

        var totalfund=parseInt(cap_sec_fund)+parseInt(bal_fund)+parseInt(growth_fund)+parseInt(equity_fund)+ parseInt(pure_fund) + parseInt(infra_fund) + parseInt(energy_fund) + parseInt(mid_fund);
        if(txtname=="" || txtname==null)
        {
            alert("Please enter your/Customer's  name");
            document.form1.txtName.focus();
            return false;
        }
        if(document.form1.txtAdvisor.value=="" || document.form1.txtAdvisor.value==null)
        {
            alert("Please enter advisor name");
            document.form1.txtAdvisor.focus();
            return false;
        }
        if(document.form1.Sex.selectedIndex<1)
        {
            alert("Please select Your sex");
            document.form1.Sex.focus();
            return false;
        }
        if(document.form1.Age.selectedIndex<1)
        {
            alert("Please select Your Age");
            document.form1.Age.focus();
            return false;
        }
        if(document.form1.Term.value=="")
        {
            alert("Please Enter Term");
            document.form1.Term.focus();
            return false;
        }        
        if(document.form1.Mode.selectedIndex<1)
        {
            alert("Please Select Premium Payment Mode");
            document.form1.Mode.focus();
            return false;
        }
        if(document.form1.PREMIUM.value=="")
        {
            alert("Please enter Premium");
            document.form1.PREMIUM.focus();
            return false;
        }     
        return true;
    }



//function to check accidental rider value


    function chkAccidentalRider()
    {
        if(document.form1.ChkADTPD.checked==true)
        {
            var age=parseInt(document.form1.ADAge.value);
            if(age.value>0)
            {
                alert("Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Age");
                document.form1.ADAge.focus();
                document.form1.ADAge.select();
                return false;
            }
        }
    }

//function used for Age rider
    function chkAgeRider(ckkbox,age,term,sa) 
    {
        if(ckkbox.checked==true)
        {
            document.form1.ADBAGE.readOnly =false;
            document.form1.ADBRTERM.readOnly =false;
            document.form1.ADBRSA.readOnly =false;
        }
        else if(ckkbox.checked==false)
        {
            document.form1.ADBAGE.readOnly =true;
            document.form1.ADBRTERM.readOnly =true;
            document.form1.ADBRSA.readOnly =true; 
            document.form1.ADBAGE.value =0;
            document.form1.ADBRTERM.value =0;
            document.form1.ADBRSA.value =0;
        }
    }
    
    
    //Numeric Functiion chack Numeric Function
    function isNumberKey(evt)
    {
        var charCode = (evt.which) ? evt.which : event.keyCode
        if (charCode > 31 && (charCode < 48 || charCode > 57) )
        {         
            return false;
        }
        return true;
    }
        //End function
    function isalphabatickey(evt)
    {
        var charCode = (evt.which) ? evt.which : event.keyCode
        //if (charCode > 31 && (charCode < 48 || charCode > 57) )
        if ((charCode >= 33 && charCode <= 64) || (charCode >= 91 && charCode <= 96) || (charCode >= 123 && charCode <= 126))
        {
            // alert('Enter Number Only');
            return false;
        }
        return true;
    }
        
    
    
    
  //nOT EDITABLE TEXTBOX
  function iseditable(evt)
  {
 //var charCode = (evt.which) ? evt.which : event.keyCode
 //if (charCode > 31 && (charCode < 48 || charCode > 57) )
	//{
	// alert('Enter Number Only');
	  return false;
	//}
 // return true;
 }
  //  
	

//////////////money mareket gauranted??????????????????????????/
    function cal_summ_assured()
    {
        doCheck();
        var val;
        var amt_inst_pre = document.form1.IP.value;
        if ( document.form1.Mode.value == "Select" ){val = 0;};
        if ( document.form1.Mode.value == "Yearly" ){val = 1;};
        if ( document.form1.Mode.value == "Half Yearly" ){val = 2;};
        if ( document.form1.Mode.value == "Quarterly" ){val = 4;};
        if ( document.form1.Mode.value == "Monthly" ){val = 12;};

        if(val=="Select" || val=="" || amt_inst_pre=="")
        {
            document.form1.A_Prem.value="";
            document.form1.SA1.value="";
        }
        else
        {  
            var min_sum_ass1 = parseInt(Math.ceil((amt_inst_pre * val)*((document.form1.Term.value)/2)));  	   
            document.form1.SA1.value = min_sum_ass1;

            var min_sum_ass = parseInt(Math.ceil((amt_inst_pre * val)*((document.form1.Term.value)/2)));
            document.form1.SA.value = min_sum_ass;				
            document.form1.A_Prem.value = (amt_inst_pre) * (val);
        }
    }

    function checkFund_MMG()
    {  
        var growth_fund=parseInt(document.form1.PFD.value);
        var equity_fund=parseInt(document.form1.PFE.value);
        var pure_fund = parseInt(document.form1.PFF.value);

        var txtname=document.form1.txtName.value;
        var prm=document.form1.PREMIUM.value;
        var trm=document.form1.Term.value;
        var sex=document.form1.Sex.value;
        var mode=document.form1.Mode.value;
        var totalfund=parseInt(growth_fund)+parseInt(equity_fund)+ parseInt(pure_fund);
        if(txtname!="" && prm!="" && trm!="")
        {
            if(sex=="-Select-")
            {
                alert("Please select Your sex");
                document.form1.Sex.focus();
                return false;
            }
            if(mode=="Select")
            {
                alert("Please Select Premium Payment mode");
                document.form1.Mode.focus();
                return false;
            }  
        }
    }

function cal_ppt(evt)
{
document.form1.PPTerm.value=document.form1.Term.value;
document.form1.PPTerm.readOnly=true;
if(document.form1.Term.selectedIndex==0)
{
document.form1.PPTerm.value="";
}
} 
//manish bhai javascript tip
function checkFund_TIP1()
{
   var cap_sec_fund=parseInt(document.form1.PMMF.value);
   var bal_fund=parseInt(document.form1.PCBF.value);
   var growth_fund=parseInt(document.form1.PGF.value);
   
   var equity_fund=parseInt(document.form1.PEF.value);
   var pure_fund = parseInt(document.form1.PPEF.value);
   
   var infra_fund = document.form1.PIF.value;
   var energy_fund = document.form1.PENF.value;
   var mid_fund = document.form1.PMDF.value;
   
   var txtname=document.form1.txtName.value;
   var prm=document.form1.PREMIUM.value;
   var trm=document.form1.Term.value;
   var sex=document.form1.Sex.value;
   //var mode=document.form1.Mode.value;
  var totalfund=parseInt(cap_sec_fund)+parseInt(bal_fund)+parseInt(growth_fund)+parseInt(equity_fund)+ parseInt(pure_fund) + parseInt(infra_fund) + parseInt(energy_fund) + parseInt(mid_fund);
	 if(txtname!="" && prm!="" && trm!="")
	 {
	   if(sex=="-Select-")
		{
		 alert("Please select Your sex");
		 document.form1.Sex.focus();
		 return false;
		}
////////       if(cap_sec_fund > 40)
////////       {
////////         alert("Capital Secure Fund can not exceed 40%");
////////	     document.form1.PMMF.focus();
////////	    return false;
////////       }
////////       if(totalfund!=100)
////////       {
////////  	    alert("The sum of proportion of all funds should be equal to 100%");
////////  	    document.form1.PMMF.focus();
////////	    return false;
////////       }
	}
}
    



//function for policydate
//function used for Age rider
function chkAgeRider()
	{
	 if(document.form1.chkaccidentrider.checked==true)
	   {
	   document.form1.ADBRAGE.readOnly =false;
	   document.form1.ADBRTERM.readOnly =false;
	   document.form1.ADBRSA.readOnly =false;
	   document.form1.ADBRAGE.disabled =false;
	   document.form1.ADBRTERM.disabled =false;
	   document.form1.ADBRSA.disabled =false;	  
	   }
	   else if(document.form1.chkaccidentrider.checked==false)
	   {
	   document.form1.ADBRAGE.readOnly =true;
	   document.form1.ADBRTERM.readOnly =true;
	   document.form1.ADBRSA.readOnly =true; 
	   document.form1.ADBRAGE.disabled =true;
	   document.form1.ADBRTERM.disabled =true;
	   document.form1.ADBRSA.disabled =true;
	   document.form1.ADBRAGE.value =0;
	   document.form1.ADBRTERM.value =0;
	   document.form1.ADBRSA.value =0; 
	   }
	}
	
	
	function chkAgeRider111()
	{    
	 if(document.form1.chkaccidentrider.checked==true)
	   {
	   document.form1.ADBRAGE.readOnly =false;
	   document.form1.ADBRTERM.readOnly =false;
	   document.form1.ADBRSA.readOnly =false;
	   document.form1.ADBRAGE.disabled =false;
	   document.form1.ADBRTERM.disabled =false;
	   document.form1.ADBRSA.disabled =false;
	  
	   }
	   else if(document.form1.chkaccidentrider.checked==false)
	   {
	   document.form1.ADBRAGE.readOnly =true;
	   document.form1.ADBRTERM.readOnly =true;
	   document.form1.ADBRSA.readOnly =true; 
		document.form1.ADBRAGE.disabled =true;
	   document.form1.ADBRTERM.disabled =true;
	   document.form1.ADBRSA.disabled =true;
		document.form1.ADBRAGE.value =0;
	   document.form1.ADBRTERM.value =0;
	   document.form1.ADBRSA.value =0; 
	   }
	}
	//Term rider checked
	function chkTermRider()
	{
	 if(document.form1.chkTermliferider.checked==true)
	   {
	   document.form1.TLIBRAGE.readOnly =false;
	   document.form1.TLIBRTERM.readOnly =false;
	   document.form1.TLIBRSA.readOnly =false;
	   document.form1.TLIBRAGE.disabled =false;
	   document.form1.TLIBRTERM.disabled =false;
	   document.form1.TLIBRSA.disabled =false;
	
	  }
	   else if(document.form1.chkTermliferider.checked==false)
	   {
	   document.form1.TLIBRAGE.readOnly =true;
	   document.form1.TLIBRTERM.readOnly =true;
	   document.form1.TLIBRSA.readOnly =true; 
	   document.form1.TLIBRAGE.disabled =true;
	   document.form1.TLIBRTERM.disabled =true;
	   document.form1.TLIBRSA.disabled =true;
		document.form1.TLIBRAGE.value =0;
	   document.form1.TLIBRTERM.value =0;
	   document.form1.TLIBRSA.value =0; 
	   }
	}
	
	//fUNCTION FOR CHILD PLAN
	function chkAgeRiderChildPlan()
	{    
	 if(document.form1.chkaccidentrider.checked==true)
	   {
	   document.form1.ADBRAge.readOnly =false;
	   document.form1.ADBRTerm.readOnly =false;
	   document.form1.ADBRPTerm.readOnly =false;
	   document.form1.ADBRSA.readOnly =false;
	   document.form1.ADBRAge.disabled =false;
	   document.form1.ADBRTerm.disabled =false;
	   document.form1.ADBRSA.disabled =false;    
	   }
	   else if(document.form1.chkaccidentrider.checked==false)
	   {
	   document.form1.ADBRAge.readOnly =true;
	   document.form1.ADBRTerm.readOnly =true;
	    document.form1.ADBRPTerm.readOnly =true;
	   document.form1.ADBRSA.readOnly =true; 
	   document.form1.ADBRAge.disabled =true;
	   document.form1.ADBRTerm.disabled =true;
	    document.form1.ADBRPTerm.disabled =true;
	   document.form1.ADBRSA.disabled =true;
	   document.form1.ADBRAge.value =0;
	   document.form1.ADBRTerm.value =0;
	    document.form1.ADBRPTerm.value =0;
	   document.form1.ADBRSA.value =0; 
	   }
	}
	
	
	//Term rider checked
	function chkccRiderChildPlanMain()
	{    
	 if(document.form1.chkccrider.checked==true)
	   {
	   document.form1.CCRAge.readOnly =false;
	   document.form1.CCRTerm.readOnly =false;
	   document.form1.CCRPTerm.readOnly =true;
	   document.form1.CCRSA.readOnly =false;
	   document.form1.CCRAge.disabled =false;
	   document.form1.CCRTerm.disabled =false;
	   document.form1.CCRSA.disabled =false;          
	   }
	   else if(document.form1.chkccrider.checked==false)
	   {
	   document.form1.CCRAge.readOnly =true;
	   document.form1.CCRTerm.readOnly =true;
	   document.form1.CCRPTerm.readOnly =true;
	   document.form1.CCRSA.readOnly =true; 
	   document.form1.CCRAge.disabled =true;
	   document.form1.CCRTerm.disabled =true;
	    document.form1.CCRPTerm.disabled =true;
	   document.form1.CCRSA.disabled =true;
	   document.form1.CCRAge.value =0;
	   document.form1.CCRTerm.value =0;
	   document.form1.CCRPTerm.value =0;
	   document.form1.CCRSA.value =0; 
	   }
	}
	function chkccRiderSPcr()
	{
	 if(document.form1.chkccrider.checked==true)
	   {
	   document.form1.CCRAGE.readOnly =false;
	   document.form1.CCRTERM.readOnly =false;
	   document.form1.CCRSA.readOnly =false;
		document.form1.CCRAGE.disabled =false;
	   document.form1.CCRTERM.disabled =false;
	   document.form1.CCRSA.disabled =false;
   
	   }
	   else if(document.form1.chkccrider.checked==false)
	   {
	   document.form1.CCRAGE.readOnly =true;
	   document.form1.CCRTERM.readOnly =true;
	   document.form1.CCRSA.readOnly =true; 
	   document.form1.CCRAGE.disabled =true;
	   document.form1.CCRTERM.disabled =true;
	   document.form1.CCRSA.disabled =true;
		document.form1.CCRAGE.value =0;
	   document.form1.CCRTERM.value =0;
	   document.form1.CCRSA.value =0; 
	   }
	}
	//Special Term Plan checked
	//Term rider checked
	function chkccRiderSpecialTermPlan()
	{
	 if(document.form1.chkccrider.checked==true)
	   {
	   document.form1.CCRAGE.readOnly =false;
	   document.form1.CCRTERM.readOnly =false;
	   document.form1.CCRSA.readOnly =false;
	   document.form1.CCRAGE.disabled =false;
	   document.form1.CCRTERM.disabled =false;
	   document.form1.CCRSA.disabled =false;
 
	   }
	   else if(document.form1.chkccrider.checked==false)
	   {
	   document.form1.CCRAGE.readOnly =true;
	   document.form1.CCRTERM.readOnly =true;
	   document.form1.CCRSA.readOnly =true; 
		 document.form1.CCRAGE.disabled =true;
	   document.form1.CCRTERM.disabled =true;
	   document.form1.CCRSA.disabled =true;
		document.form1.CCRAGE.value =0;
	   document.form1.CCRTERM.value =0;
	   document.form1.CCRSA.value =0; 
	   }
	}
	
	//------------------------child plan
	function chkccRiderChildPlan()
	{
	 if(document.form1.chkccrider.checked==true)
	   {
	   document.form1.CCRAge.readOnly =false;
	   document.form1.CCRTerm.readOnly =false;
	   document.form1.CCRSA.readOnly =false;
	   
	   }
	   else if(document.form1.chkccrider.checked==false)
	   {
	   document.form1.CCRAge.readOnly =true;
	   document.form1.CCRTerm.readOnly =true;
	   document.form1.CCRSA.readOnly =true; 
		document.form1.CCRAge.value =0;
	   document.form1.CCRTerm.value =0;
	   document.form1.CCRSA.value =0; 
	   }
	}
	
	//*******************special cgp
	
	function chkccRiderScredtGardPlan()
	{
	 if(document.form1.chkccrider.checked==true)
	   {
	   document.form1.CCRAGE.readOnly =false;
	   document.form1.CCRTERM.readOnly =false;
	   document.form1.CCRSA.readOnly =false;
   
	   }
	   else if(document.form1.chkccrider.checked==false)
	   {
	   document.form1.CCRAGE.readOnly =true;
	   document.form1.CCRTERM.readOnly =true;
	   document.form1.CCRSA.readOnly =true; 
		document.form1.CCRAGE.value =0;
	   document.form1.CCRTERM.value =0;
	   document.form1.CCRSA.value =0; 
	   }
	}
	//******************88term plan*************
 function chkAgeRiderterm()
	{
	 if(document.form1.chkaccidentrider.checked==true)
	   {
	   document.form1.ADBRAge.readOnly =false;
	   document.form1.ADBRTerm.readOnly =false;
	   document.form1.ADBRSA.readOnly =false;
		document.form1.ADBRAge.disabled =false;
	   document.form1.ADBRTerm.disabled =false;
	   document.form1.ADBRSA.disabled =false;
  
	   }
	   else if(document.form1.chkaccidentrider.checked==false)
	   {
	   document.form1.ADBRAge.readOnly =true;
	   document.form1.ADBRTerm.readOnly =true;
	   document.form1.ADBRSA.readOnly =true; 
		document.form1.ADBRAge.disabled =true;
	   document.form1.ADBRTerm.disabled =true;
	   document.form1.ADBRSA.disabled =true;
		document.form1.ADBRAge.value =0;
	   document.form1.ADBRTerm.value =0;
	   document.form1.ADBRSA.value =0; 
	   }
	}
	
	//Term plan
	 function chkAgeRidertermPlan()
	{
	 if(document.form1.chkaccidentrider.checked==true)
	   {
	   //document.form1.ADBAge.readOnly =false;
	   //document.form1.ADBTerm.readOnly =false;
	   document.form1.ADBSA.readOnly =false;
	   }
	   else if(document.form1.chkaccidentrider.checked==false)
	   {
	   //document.form1.ADBAge.readOnly =true;
	  // document.form1.ADBTerm.readOnly =true;
	   document.form1.ADBSA.readOnly =true; 
	   // document.form1.ADBAge.value =0;
	   //document.form1.ADBTerm.value =0;
	   document.form1.ADBSA.value =0; 
	   }
	}
	//end
	
	function chkAgeRiderspage()
	{
	 if(document.form1.ChKADBR.checked==true)
	   {
	   document.form1.ADSA.readOnly =false;
	   }
	   else if(document.form1.ChKADBR.checked==false)
	   {
	   document.form1.ADSA.readOnly =true;
	   document.form1.ADSA.value =0;
	   }
	}
	
	 function chkAgeRidersptermcc()
	  {
	 if(document.form1.ChkCCR.checked==true)
	   {
	   document.form1.CCSA.readOnly =false;
	   }
	   else if(document.form1.ChkCCR.checked==false)
	   {
	   document.form1.CCSA.readOnly =true;
	   document.form1.CCSA.value =0;
	   }
	}
	
  //Function to check Null value for Rider in child plan By sachin Tyagi
	//********************8sachin T*******
	 function chkAgeRidernullvalue()
	 {
	   if(document.form1.chkaccidentrider.checked==true )
	   {
		 if(document.form1.ADBAge.value==0 )
			{
			 alert("Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Age.");
			 document.form1.ADBAge.focus();
			 document.form1.ADBAge.select();
			 return false;
			}
			else if(document.form1.ADBTerm.value==0)
			{
			   alert("Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Term.");
			   document.form1.ADBTerm.focus();
				document.form1.ADBTerm.select();
			   return false;
			}
			else if(document.form1.ADBSA.value==0)
			{
			   alert("Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Sum Assured.");
			   document.form1.ADBSA.focus();
			   document.form1.ADBSA.select();
			   return false;
			}
	   // return false;
		}
	   if(document.form1.chkccrider.checked==true )
	   {
		   if(document.form1.CCRAge.value==0 )
			 {
			  alert("Please enter Reliance Critical Condition Rider Age.");
			  document.form1.CCRAge.focus();
			  document.form1.CCRAge.select();
			  return false;
			 }
			else if(document.form1.CCRTerm.value==0)
			{
			  alert("Please enter Reliance Critical Condition Rider Term.");
			  document.form1.CCRTerm.focus();
			  document.form1.CCRTerm.select();
			  return false;
			}
			else if(document.form1.CCRSA.value==0)
			{
			  alert("Please enter Critical Conditions Sum Assured Rider.");
			  document.form1.CCRSA.focus();
			  document.form1.CCRSA.select();
			  return false;
		  
		  }
		   //return false; 
	   }
	   //
	 }
   function chkAgeRidernullwholelife()
	 {
	   if(document.form1.chkaccidentrider.checked==true )
	   {
	   if(document.form1.ADAGE.value==0 )
		{
		alert("Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Age.");
		document.form1.ADAGE.focus();
		document.form1.ADAGE.select();
		 return false;
		}
		else if(document.form1.ADBTerm.value==0)
		{
		alert("Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Term.");
		 document.form1.ADBTerm.focus();
		 document.form1.ADBTerm.select();
		  return false;
		}
		else if(document.form1.ADSA.value==0)
		{
		 alert("Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Sum Assured.");
		 document.form1.ADSA.focus();
		 document.form1.ADSA.select();
		  return false;
		}
	   //return true;
	  }
	   if(document.form1.chkccrider.checked==true )
	   {
	   if(document.form1.CCRAge.value==0 )
		{
		alert("Please enter Reliance Critical Condition Rider Age.");
		document.form1.CCRAge.focus();
		 document.form1.CCRAge.select();
		 return false;
		}
		else if(document.form1.CCRTerm.value==0)
		{
		alert("Please enter Reliance Critical Condition Rider Term.");
		 document.form1.CCRTerm.focus();
		 document.form1.CCRTerm.select();
		  return false;
		}
		else if(document.form1.CCRSA.value==0)
		{
		 alert("Please enter Critical Conditions Rider Sum Assured.");
		 document.form1.CCRSA.focus();
		 document.form1.CCRSA.select();
		  return false;
		}
		// return true;
	   }
	}
	
	//WHOLE LIFE CCR RIDER checked
	function chkccWHOLELIFECCRPlan()
	{   
	 if(document.form1.chkccrider.checked==true)
	   {
	   document.form1.CCRAge.readOnly =false;
	   document.form1.CCRTerm.readOnly =false;
	   document.form1.CCRPTerm.readOnly =true;
	   document.form1.CCRSA.readOnly =false;
		document.form1.CCRAge.disabled =false;
	   	document.form1.CCRTerm.disabled =false;
	    document.form1.CCRPTerm.disabled =false;
	   document.form1.CCRSA.disabled =false;    
	   }
	  
	   else if(document.form1.chkccrider.checked==false)
	   {
	   document.form1.CCRAge.readOnly =true;
	   document.form1.CCRTerm.readOnly =true;
	   document.form1.CCRSA.readOnly =true; 
		document.form1.CCRAge.disabled =true;
	   document.form1.CCRTerm.disabled =true;
	    document.form1.CCRPTerm.disabled =true;
	   document.form1.CCRSA.disabled =true;
		document.form1.CCRAge.value =0;
	   document.form1.CCRTerm.value =0;
	    document.form1.CCRPTerm.value =0;
	   document.form1.CCRSA.value =0; 
	   }
	}
	function chkAgeRiderwholelife()
	{
	 if(document.form1.chkaccidentrider.checked==true)
	   {
	   document.form1.ADBRAge.readOnly =false;
	   document.form1.ADBRTerm.readOnly =false;
	   document.form1.ADBRPTerm.readOnly =true;
	   document.form1.ADBRSA.readOnly =false;
	   document.form1.ADBRAge.disabled =false;
	   document.form1.ADBRTerm.disabled =false;
	    document.form1.ADBRPTerm.disabled =false;
	   document.form1.ADBRSA.disabled =false;
   
	   }
	   else if(document.form1.chkaccidentrider.checked==false)
	   {
	   document.form1.ADBRAge.readOnly =true;
	   document.form1.ADBRTerm.readOnly =true;
	   document.form1.ADBRSA.readOnly =true;
		document.form1.ADBRAge.disabled =true;
		document.form1.ADBRPTerm.disabled =true;
	   document.form1.ADBRTerm.disabled =true;
	   document.form1.ADBRSA.disabled =true; 
		document.form1.ADBRAge.value =0;
	   document.form1.ADBRTerm.value =0;
	    document.form1.ADBRPTerm.value =0;
	   document.form1.ADBRSA.value =0; 
	   }
	}
	
	  function chkAgeRiderSpCrGaurd()
	{
	 if(document.form1.chkaccidentrider.checked==true)
	   {
	   document.form1.ADBRAge.readOnly =false;
	   document.form1.ADBRTerm.readOnly =false;
	   document.form1.ADBRSA.readOnly =false;
		document.form1.ADBRAge.disabled =false;
	   document.form1.ADBRTerm.disabled =false;
	   document.form1.ADBRSA.disabled =false;
	 
	   }
	   else if(document.form1.chkaccidentrider.checked==false)
	   {
	   document.form1.ADBRAge.readOnly =true;
	   document.form1.ADBRTerm.readOnly =true;
	   document.form1.ADBRSA.readOnly =true;
		 document.form1.ADBRAge.disabled =true;
	   document.form1.ADBRTerm.disabled =true;
	   document.form1.ADBRSA.disabled =true; 
		document.form1.ADBRAge.value =0;
	   document.form1.ADBRTerm.value =0;
	   document.form1.ADBRSA.value =0; 
	   }
	}
	 
	function chkAgeRiderSpecialTerm()
	{
	 if(document.form1.chkaccidentrider.checked==true)
	   {
	   document.form1.ADBRAGE.readOnly =false;
	   document.form1.ADBRTERM.readOnly =false;
	   document.form1.ADBRSA.readOnly =false;
	   document.form1.ADBRAGE.disabled =false;
	   document.form1.ADBRTERM.disabled =false;
	   document.form1.ADBRSA.disabled =false;
	 
	   }
	   else if(document.form1.chkaccidentrider.checked==false)
	   {
	   document.form1.ADBRAGE.readOnly =true;
	   document.form1.ADBRTERM.readOnly =true;
	   document.form1.ADBRSA.readOnly =true; 
		document.form1.ADBRAGE.disabled =true;
	   document.form1.ADBRTERM.disabled =true;
	   document.form1.ADBRSA.disabled =true;
		document.form1.ADBRAGE.value =0;
	   document.form1.ADBRTERM.value =0;
	   document.form1.ADBRSA.value =0; 
	   }
	}
 
function chkAgeRiderSuperFivePlus()
	{
	 if(document.form1.chkaccidentrider.checked==true)
	   {
	   document.form1.ADBRAGE.readOnly =false;
	   document.form1.ADBRTERM.readOnly =false;
	    document.form1.ADBRPTERM.readOnly =true;
	   document.form1.ADBRSA.readOnly =false;
	   document.form1.ADBRAGE.disabled =false;
	   document.form1.ADBRTERM.disabled =false;
	    document.form1.ADBRPTERM.disabled =true;
	   document.form1.ADBRSA.disabled =false;
	 
	   }
	   else if(document.form1.chkaccidentrider.checked==false)
	   {
	   document.form1.ADBRAGE.readOnly =true;
	   document.form1.ADBRTERM.readOnly =true;
	    document.form1.ADBRPTERM.readOnly =true;
	   document.form1.ADBRSA.readOnly =true; 
		document.form1.ADBRAGE.disabled =true;
	   document.form1.ADBRTERM.disabled =true;
	   document.form1.ADBRSA.disabled =true;
	   document.form1.ADBRPTERM.disabled =true;
		document.form1.ADBRAGE.value =0;
	   document.form1.ADBRTERM.value =0;
	    document.form1.ADBRPTERM.value =0;
	   document.form1.ADBRSA.value =0; 
	   }
	}

//WholeLife Plan Developed by sachin
//Child Plan develod by sachin kumar javascript
 function ChangeDOBWholeLifePlan()
 {
  if(document.form1.txtName.value=="" || document.form1.txtName.value==null)
  {
  alert("Please enter your/Customer's  name");
  document.form1.txtName.focus();
  return false;
  }
  if(document.form1.txtAdvisor_code.value=="" || document.form1.txtAdvisor_code.value==null)
    {
        alert("Please enter Advisor/Employee Code");
        document.form1.txtAdvisor_code.focus();        
        return false;
    }
  if(document.form1.txtAdvisor.value=="" || document.form1.txtAdvisor.value==null)
  {
   alert("Please enter advisor's name");
   document.form1.txtAdvisor.focus();
   return false;
  }
  if(document.form1.DOBDD.selectedIndex==0 ) //|| document.form1.DOBMM.selectedIndex==0 || document.form1.DOBYYYY.selectedIndex==0)
  {
   alert("Please select your date of birth");
   document.form1.DOBDD.focus();
   return false;
  }
   if( document.form1.DOBMM.selectedIndex==0 )//|| document.form1.DOBYYYY.selectedIndex==0)
  {
   alert("Please select your date of birth");
   document.form1.DOBMM.focus();
   return false;
  }
   if(document.form1.DOBYYYY.selectedIndex==0)
  {
   alert("Please select your date of birth");
   document.form1.DOBYYYY.focus();
   return false;
  }
  if(document.form1.DOCDD.selectedIndex==0 ) //|| document.form1.DOCMM.selectedIndex==0 || document.form1.DOCYYYY.selectedIndex==0)
  {
   alert("Please select your policy Commencement date");
   document.form1.DOCDD.focus();
   return false;
  }
  if( document.form1.DOCMM.selectedIndex==0 )//|| document.form1.DOCYYYY.selectedIndex==0)
  {
   alert("Please select your policy Commencement date");
   document.form1.DOCMM.focus();
   return false;
  }
  if(document.form1.DOCYYYY.selectedIndex==0)
  {
   alert("Please select your policy Commencement date");
   document.form1.DOCYYYY.focus();
   return false;
  }
   if(document.form1.Sex.selectedIndex==0)
  {
  alert("Please select your sex");
  document.form1.Sex.focus();
  return false;
  }
if(document.form1.PPT.value=="Select" ||document.form1.PPT.value=="Select" ||document.form1.PPT.value=="Select")
   {
	 alert("Please enter your Premium Payment Term");
	 document.form1.PPT.focus();
	 return false;
   }
if(document.form1.Mode.selectedIndex==0)
   {
	 alert("Please select Premium Mode");
	 document.form1.Mode.focus();
	 return false;
   }
  var today=new Date();
  var pdate=new Date(document.form1.DOCYYYY.value,document.form1.DOCMM.selectedIndex-1,document.form1.DOCDD.selectedIndex);
  if(pdate>today)
   {
	alert("Policy Commencement date can not be greater than current date");
	return false;
   }
  if(document.form1.SA.value=="")
  {
  alert("Please enter your basic sum assured");
  document.form1.SA.focus();
  return false;
  }
  if(document.form1.PPT.value<5 ||document.form1.PPT.value>40)
   {
	 alert("Premium Payment Term should be 5 and 40");
	 document.form1.PPT.focus();
	 return false;
   }

  //Age Rider
	//Age calculation
	if (document.form1.DOBDD.selectedIndex!=0 && document.form1.DOBMM.selectedIndex!=0 && document.form1.DOBYYYY.selectedIndex!=0)
	  {
	  var dobyyyy = document.form1.DOBYYYY[document.form1.DOBYYYY.selectedIndex].value;
	   //alert(dobyyyy);
	 var dobmm = document.form1.DOBMM.selectedIndex;
	  //alert(dobmm);
	 var dobdd = document.form1.DOBDD[document.form1.DOBDD.selectedIndex].value;
	  //alert(dobdd);
	  var birthdate = new Date(dobyyyy, dobmm-1, dobdd) //Month is 0-11 in JavaScript
	   //alert(birthdate);
	 var curdate=new Date();
	  var one_day=1000*60*60*24;
	  var age = parseInt(Math.ceil((curdate.getTime()-birthdate.getTime())/(one_day))/365.25);
	  var te= 85-age;
	 
	  document.form1.Term.value =te;
	}
  //end calculation
  
  
  
  var poc=calage(document.form1.DOBYYYY.value,document.form1.DOBMM.selectedIndex,document.form1.DOBDD.value);
   //parseInt(document.form1.DOCYYYY.value)-parseInt(document.form1.DOBYYYY.value);
    if(poc<20 || poc>60)
    {
	    alert("Invalid Age.The minimum and maximum Age at entry under this plan is 20 years and 60 years respectively.");
	    document.form1.DOBYYYY.focus();
	    return false;
    }

  
  //end rider
  //dATE CHECK
	msg="";
	invalid="false";
	days = getDays((document.form1.DOBMM.selectedIndex-1),document.form1.DOBYYYY.value);
	if(document.form1.DOBDD.value > days)
	{
	  msg=msg+"The Birth Date is Invalid\n";
	  invalid="true";
	}
 
	days = getDays((document.form1.DOCMM.selectedIndex-1),document.form1.DOCYYYY.value)
	if(document.form1.DOCDD.value > days)
	{
	  msg=msg+"The Policy Commencement Date is Invalid\n";
	  invalid="true";
	}
	dt=date_diff();
 //alert(dt);
 if(dt >= 184)
 {
  msg=msg+"The policy commencement date cannot be back dated by more than 6 months\n";
   invalid="true";
  }
  if(invalid=="true")
  {
   alert(msg);
   return false;
  }
  
  if(document.form1.SA.value <25000)
  {
  alert("- minimum Sum Assured should be 25000");
  document.form1.SA.focus();
  return false;
  }
  
  if(document.form1.chkaccidentrider.checked==true)
   {
   
	 if(document.form1.ADBRAge.value==0||document.form1.ADBRAge.value=="" || document.form1.ADBRAge.value==null)
	  {
	  alert("Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Age");
	  document.form1.ADBRAge.focus();
	  document.form1.ADBRAge.select();
	  return false;
	  }
	  if(document.form1.ADBRTerm.value==0||document.form1.ADBRTerm.value=="" || document.form1.ADBRTerm.value==null)
	  {
	  alert("Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Term");
	  document.form1.ADBRTerm.focus();
		document.form1.ADBRTerm.select();
	  return false;
	  }
	  if(document.form1.ADBRSA.value==0||document.form1.ADBRSA.value=="" || document.form1.ADBRSA.value==null)
	  {
	  alert("Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Sum Assured");
	  document.form1.ADBRSA.focus();
	  document.form1.ADBRSA.select();
	  return false;
	  } 
//     if(termr==0)
//     {
//      alert("Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Term");
//      document.form1.ADTERM.focus();
//      return false;
//     }
	 var age=parseInt(document.form1.ADBRAge.value);
	 if(age==0)
	 {
	  alert("Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Age");
	  document.form1.ADBRAge.focus();
	   document.form1.ADBRAge.select();
	  return false;
	 }
	
	 if(age<20 || age>60)
	   {
		alert("Invalid age .Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Age between 20 and 60");
		document.form1.ADBRAge.focus();
		document.form1.ADBRAge.select();
		return false;
	   }
	  
	   //term nd sa
	 var termr=parseInt(document.form1.ADBRTerm.value);
	// var baseval=max_t;
	 var baseval=parseInt(document.form1.PPT.value);
	 var asa=parseFloat(document.form1.ADBRSA.value);
	 
	 if(termr<5)
	   {
		alert("Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Term between 5 and "+baseval);
		document.form1.ADBRTerm.focus();
		document.form1.ADBRTerm.select();
		return false;
	   }
		 if(termr>baseval)
	   {
		alert("Term For Reliance Accidental Death and Total and Permanent Disablement Rider Should be less Than or Equal to base Term.");
		document.form1.ADBRTerm.focus();
		document.form1.ADBRTerm.select();
		return false;
	   }
	   if(asa==0)
	 {
	  alert("Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Sum Assured");
	  document.form1.ADBRSA.focus();
	  document.form1.ADBRSA.select();
	  return false;
	 }
	 if(asa<25000 || asa>5000000)
	 {
	  alert("minimum Reliance Accidental Death and Total and Permanent Disablement Rider Sum Assured is Rs. 25,000 and maximum Sum Assured is 50,00,000");
	  document.form1.ADBRSA.focus();
	  document.form1.ADBRSA.select();
	  return false;
	 }
  }
  //end age rider
 //cc rider
  if(document.form1.chkccrider.checked==true)
   {
	  if(document.form1.CCRAge.value==0 ||document.form1.CCRAge.value=="" || document.form1.CCRAge.value==null)
	  {
	  alert("Please enter Reliance Critical Condition Rider Age.");
	  document.form1.CCRAge.focus();
	   document.form1.CCRAge.select();
	  return false;
	  }
	   if(document.form1.CCRTerm.value==0||document.form1.CCRTerm.value=="" || document.form1.CCRTerm.value==null)
	  {
	  alert("Please enter Reliance Critical Condition Rider Term.");
	  document.form1.CCRTerm.focus();
	   document.form1.CCRTerm.select();
	  return false;
	  }
	  if(document.form1.CCRSA.value==0||document.form1.CCRSA.value=="" || document.form1.CCRSA.value==null)
	  {
	  alert("Please enter Reliance Critical Condition Rider Sum Assured.");
	  document.form1.CCRSA.focus();
	  document.form1.CCRSA.select();
	  return false;
	  }
	var age=parseInt(document.form1.CCRAge.value);
	 if(age==0)
	 {
	  alert("Please enter Reliance Critical Condition Rider Age.");
	  document.form1.CCRAge.focus();
	  document.form1.CCRAge.select();
	  return false;
	 }
	 if(age<20 || age>55)
	   {
		alert("Invalid Age Please enter Reliance Critical Condition Rider Age between 20 and 55.");
		document.form1.CCRAge.focus();
		document.form1.CCRAge.select();
		return false;
	   } 
  }
  //end age rider
  //Term rider
  if(document.form1.chkccrider.checked==true)
   {
	 var termr=parseInt(document.form1.CCRTerm.value);
	 //var baseval=max_t;
	 var baseval=parseInt(document.form1.PPT.value);
	 var asa=parseFloat(document.form1.CCRSA.value);
	 
	 if(termr==0)
	 {
	  alert("Please enter Reliance Critical Condition Rider Term");
	  document.form1.CCRTerm.focus();
		  document.form1.CCRTerm.select();
	  return false;
	 }
	 if(termr<5 || termr>baseval)
	   {
		alert("Please enter Reliance Critical Condition Rider Term between 5 and "+baseval);
		document.form1.CCRTerm.focus();
		 document.form1.CCRTerm.select();
		return false;
	   } 
		if(document.form1.CCRSA.value=="" || document.form1.CCRSA.value==null)
	  {
	  alert("Please enter Reliance Critical Condition Rider Sum Assured.");
	  document.form1.CCRSA.focus();
	  document.form1.CCRSA.select();
	  return false;
	  }
	 if(asa==0)
	 {	
	  alert("Please enter Reliance Critical Condition Rider Sum Assured");
	  document.form1.CCRSA.focus();
	  document.form1.CCRSA.select();
	  return false;
	 }
	 if(asa<100000 || asa>1000000)
	 {
	
	  alert("Please enter Reliance Critical Condition Rider minimum basic sum assured between 1,00,000 and maximum 10,00,000");
	  document.form1.CCRSA.focus();
	  document.form1.CCRSA.select();
	  return false;
	 }
  }
   if(document.form1.chkFBIR.checked==true)
        { 
			//alert("hello");
            var age=parseInt(document.form1.FIBRAge.value);
           
           	var baseval=parseFloat(document.form1.Term.value);
            var baseSA=parseFloat(document.form1.SA.value);
            var baseAge=parseFloat(document.form1.Age.value);
            var asa=parseFloat(document.form1.FIBRSA.value);
			//alert(baseAge);
            if(age==0||document.form1.FIBRAge.value==""||document.form1.FIBRAge.value==null||document.form1.FIBRAge.value==0)
            {
                alert("Please enter Reliance Life Insurance Family Income benefit Rider Age.");
                document.form1.FIBRAge.focus();
                document.form1.FIBRAge.select();
                return false;
            }  
			 var termr=parseInt(document.form1.FIBRTerm.value);
           if(termr==0||document.form1.FIBRTerm.value==""||document.form1.FIBRTerm.value==null||document.form1.FIBRTerm.value==0)
            {
                alert("Please enter the term for Reliance Life Insurance Family Income benefit Rider.");
                document.form1.FIBRTerm.focus();
                document.form1.FIBRTerm.select();
                return false;
            }
         	
		if(document.form1.FIBRPTerm.value=="-Select-"||document.form1.FIBRPTerm.value==null||document.form1.FIBRPTerm.selectedIndex==0)
            {
                alert("Please select the Premium paying term for Reliance Life Insurance Family Income benefit Rider.");
                document.form1.FIBRPTerm.focus();
                //document.form1.FIBRPTerm.select();
                return false;
            }
            if(asa==0||document.form1.FIBRSA.value==""||document.form1.FIBRSA.value==null||document.form1.FIBRSA.value==0)
            {
                alert("Please enter sum assured for Reliance Life Insurance Family Income benefit Rider.");
                document.form1.FIBRSA.focus();
                document.form1.FIBRSA.select();
                return false;
            } 
			
			 if(age<18 || age>61)
	  		 {
			alert("Invalid Rider Age. Please enter Reliance Life Insurance Family Income Benefit Rider Age in between 18 and 60");
			document.form1.FIBRAge.focus();
		 	document.form1.FIBRAge.select();
			return false;
	  		 } 
	 	 if(termr<5 )
	   {
		alert("Reliance Life Insurance Family Income Benefit Rider Term Should be greater than or equal to 5.");
		 document.form1.FIBRTerm.focus();
          document.form1.FIBRTerm.select();
		return false;
	   } 
	   ////parseInt(document.form1.PPT.value); 
	   	var baseTerm=(85-age);
		
		if(Math.min(baseTerm,30)<termr)
		{
	alert("Reliance Life Insurance Family Income Benefit Rider Term Should be less than or equal to "+Math.min(baseTerm,30));
		 document.form1.FIBRTerm.focus();
          document.form1.FIBRTerm.select();
		  return false;
		}
			// var asa=parseFloat(document.form1.FIBRSA.value);
			//var baseSA=parseFloat(document.form1.SA.value);
			 if(baseSA<100000 )
                {
                    document.form1.chkFBIR.checked=false;
					alert("You are not eligible for Reliance Life Insurance Family Income Benefit Rider as Minimum Sum Assured should be 1,00,000.");
                                  
                   chkAgeRiderFBIR_BASIC();
				    return false;
                }
 		if(asa<100000 || asa>1000000)
            {
         alert("Reliance Life Insurance Family Income Benefit Rider sum assured should be Minimum 1,00,000 and Max 10,00,000. ");
                document.form1.FIBRSA.focus();
                document.form1.FIBRSA.select();
                return false;
            }
            if(asa>parseFloat(document.form1.SA.value))
            {
                 alert("Reliance Life Insurance Family Income Benefit Rider sum assured should be less than or equal to the base sum assured subject to Minimum 1,00,000 and Max 10,00,000. "); 
                document.form1.FIBRSA.focus();
                document.form1.FIBRSA.select();
                return false;
            }
			
			if(age<baseAge)
			{
				
				  alert("Reliance Life Insurance Family Income benefit Rider Age Should Be Greater Than Or Equal To Base Age.");
				  document.form1.FIBRAge.focus();
                document.form1.FIBRAge.select();
				return false;
			}
        }  
		
		
  return true;
  wholeLife_term();
}
 


//Cash Flow Plan Decveloped By sachin
function chkAgeRidertermCashFlow()
	{
	 if(document.form1.chkaccidentrider.checked==true)
	   {
	  
	   document.form1.ADBRAge.readOnly =false;
	   document.form1.ADBRTerm.readOnly =false;
	   document.form1.ADBRPTerm.readOnly =true;
	   document.form1.ADBRSA.readOnly =false;
		document.form1.ADBRAge.disabled =false;
	   document.form1.ADBRTerm.disabled =false;
	   document.form1.ADBRSA.disabled =false;
	   document.form1.ADBRPTerm.value = document.form1.ADBRTerm.value;
	   }
	   else if(document.form1.chkaccidentrider.checked==false)
	   {
	   document.form1.ADBRAge.readOnly =true;
	   document.form1.ADBRTerm.readOnly =true;
	    document.form1.ADBRPTerm.readOnly =true;
	   document.form1.ADBRSA.readOnly =true;
		document.form1.ADBRAge.disabled =true;
	   document.form1.ADBRTerm.disabled =true;
	    document.form1.ADBRPTerm.disabled =true;
	   document.form1.ADBRSA.disabled =true;
	   document.form1.ADBRAge.value =0;
	   document.form1.ADBRTerm.value =0;
	   document.form1.ADBRPTerm.value =0;
	   document.form1.ADBRSA.value =0;
	  
	   }
	   
	   if(document.form1.chkccrider.checked==true)
	   {
	   document.form1.CCRAge.readOnly =false;
	   document.form1.CCRTERM.readOnly =false;
	    document.form1.CCRPTERM.readOnly =true;
	   document.form1.CCRSA.readOnly =false;
	   document.form1.CCRAge.disabled =false;
	   document.form1.CCRTERM.disabled =false;
	   document.form1.CCRSA.disabled =false;     
	    document.form1.CCRPTERM.value= document.form1.CCRTERM.value;
	   }
	   else if(document.form1.chkccrider.checked==false)
	   {
	   document.form1.CCRAge.readOnly =true;
	   document.form1.CCRTERM.readOnly =true;
	   document.form1.CCRPTERM.readOnly =true;
	   document.form1.CCRSA.readOnly =true; 
	   document.form1.CCRAge.disabled =true;
	   document.form1.CCRTERM.disabled =true;
	   document.form1.CCRPTERM.disabled =true;
	   document.form1.CCRSA.disabled =true;
	   document.form1.CCRAge.value =0;
	   document.form1.CCRTERM.value =0;
	    document.form1.CCRPTERM.value =0;
	   document.form1.CCRSA.value =0; 
	   }
	}
	
	//------------------ChangeDOBcashflowPlan
	function ChangeDOBcashflowPlan()
	 {
	  //var dob=document.form1.txtId.value;
  if(document.form1.txtName.value=="" || document.form1.txtName.value==null)
  {
  alert("Please enter your/Customer's  name");
  document.form1.txtName.focus();
  return false;
  }
  if(document.form1.txtAdvisor_code.value=="" || document.form1.txtAdvisor_code.value==null)
    {
        alert("Please enter Advisor/Employee Code");
        document.form1.txtAdvisor_code.focus();        
        return false;
    }
  
  if(document.form1.txtAdvisor.value=="" || document.form1.txtAdvisor.value==null)
  {
   alert("Please enter advisor's name");
   document.form1.txtAdvisor.focus();
   return false;
  }
	  
   if(document.form1.SEX.selectedIndex==0)
  {
  alert("Please select Your sex");
  document.form1.SEX.focus();
  return false;
  } 
   if(document.form1.DOBDD.selectedIndex==0 ) //|| document.form1.DOBMM.selectedIndex==0 || document.form1.DOBYYYY.selectedIndex==0)
  {
   alert("Please select your date of birth");
   document.form1.DOBDD.focus();
   return false;
  }
   if( document.form1.DOBMM.selectedIndex==0 )//|| document.form1.DOBYYYY.selectedIndex==0)
  {
   alert("Please select your date of birth");
   document.form1.DOBMM.focus();
   return false;
  }
   if(document.form1.DOBYYYY.selectedIndex==0)
  {
   alert("Please select your date of birth");
   document.form1.DOBYYYY.focus();
   return false;
  }
  if(document.form1.DOCDD.selectedIndex==0 ) //|| document.form1.DOCMM.selectedIndex==0 || document.form1.DOCYYYY.selectedIndex==0)
  {
   alert("Please select your policy Commencement date");
   document.form1.DOCDD.focus();
   return false;
  }
  if( document.form1.DOCMM.selectedIndex==0 )//|| document.form1.DOCYYYY.selectedIndex==0)
  {
   alert("Please select your policy Commencement date");
   document.form1.DOCMM.focus();
   return false;
  }
  if(document.form1.DOCYYYY.selectedIndex==0)
  {
   alert("Please select your policy Commencement date");
   document.form1.DOCYYYY.focus();
   return false;
  }

 if(document.form1.TERM.selectedIndex==0)
   {
	 alert("Please select your Policy Term");
	 document.form1.TERM.focus();
	 return false;
   }
   
   if(document.form1.MODE.selectedIndex==0)
   {
	 alert("Please select your Premium Payment Mode");
	 document.form1.MODE.focus();
	 return false;
   }
   
	   if(document.form1.SA.value=="" || document.form1.SA.value==null|| document.form1.SA.value==0)
	  {
	   alert("Please enter your basic sum assured");
	   document.form1.SA.focus();
	   return false;
	  }
	  
	  
	  
	  
	   if(document.form1.chkaccidentrider.checked==true)
	   {
		var age=parseFloat(document.form1.ADBRAge.value);
		var termr=parseFloat(document.form1.ADBRTerm.value);
		var baseval=parseFloat(document.form1.TERM.value);
		var asa=parseFloat(document.form1.ADBRSA.value);
	   var sa1=parseFloat(document.form1.SA.value);
	   if(document.form1.ADBRAge.value=="" ||document.form1.ADBRAge.value==0 ||document.form1.ADBRAge.value==null)
	   {
		alert("Please enter Reliance Accidental Death  and Total & Permanent  Disablement Rider age.");
		document.form1.ADBRAge.focus();
		document.form1.ADBRAge.select();
		return false;
	   } 
	   if(document.form1.ADBRTerm.value==""||document.form1.ADBRTerm.value==0||document.form1.ADBRTerm.value==null)
	   {
		alert("Please enter Reliance Accidental Death  and Total & Permanent  Disablement Rider Term.");
		document.form1.ADBRTerm.focus();
		  document.form1.ADBRTerm.select();
		return false;
	   } 
	   if(document.form1.ADBRSA.value==""||document.form1.ADBRSA.value==0||document.form1.ADBRSA.value=="")
	   {
		alert("Please enter Reliance accidental Death and Total and Permanent disablement sum assured.");
		document.form1.ADBRSA.focus();
		 document.form1.ADBRSA.select();
		return false;
	   } 
  if(age==0)
		 {
		  alert("Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Age");
		  document.form1.ADBRAge.focus();
		   document.form1.ADBRAge.select();
		  return false;
		 }
		 if(age<18 || age>60)
		   {
			alert("Invalid rider Age. Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Age between 18 and 60");
			document.form1.ADBRAge.focus();
			 document.form1.ADBRAge.select();
			return false;
		   } 
		   //term nd sa
		  if(termr==0)
		   {
			alert("Please enter Reliance Accidental Death and Total and Permanent Disablement rider Term");
			document.form1.ADBRTerm.focus();
			 document.form1.ADBRTerm.select();
			return false;
			}
		 if(termr<5 || termr>baseval)
		   {
			alert("Rider Term Invalid. Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Term in between 5 and Base Policy Term");
			document.form1.ADBRTerm.focus();
			  document.form1.ADBRTerm.select();
			return false;
		   } 
			 if(asa==0)
		 {
		  alert("Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Sum Assured");
		  document.form1.ADBRSA.focus();
		   document.form1.ADBRSA.select();
		  return false;
		 }
		 if(asa<25000 || asa>5000000)
		 {
		  alert("minimum Reliance Accidental Death and Total and Permanent Disablement Rider Sum Assured is Rs. 25,000 and maximum Sum Assured is 50,00,000");
		  document.form1.ADBRSA.focus();
		   document.form1.ADBRSA.select();
		  return false;
		 }
		  if(asa>sa1)
		 {
		  alert("Reliance Accidental Death and Total and Permanent Disablement Rider sum assured should be less than or equal to basic sum assured.");
		  document.form1.ADBRSA.focus();
		   document.form1.ADBRSA.select();
		  return false;
		 }
	  }
	 //end age rider
	  //Critical rider
	  if(document.form1.chkccrider.checked==true)
		   {
	   var age=parseFloat(document.form1.CCRAge.value);
		var termr=parseFloat(document.form1.CCRTERM.value);
		var baseval=parseFloat(document.form1.TERM.value);
		var asa=parseFloat(document.form1.CCRSA.value);
	   var sa1=parseFloat(document.form1.SA.value);
	   if(document.form1.CCRAge.value==""||document.form1.CCRAge.value==0||document.form1.CCRAge.value==null)
	 {
	  alert("Please enter Reliance New Critical Conditions Rider Age.");
	  document.form1.CCRAge.focus();
	  document.form1.CCRAge.select();
	  return false;
	 }
   if(document.form1.CCRTERM.value==""||document.form1.CCRTERM.value==0||document.form1.CCRTERM.value==null)
	 {
	  alert("Please enter Reliance New Critical Conditions Rider Term.");
	  document.form1.CCRTERM.focus();
	   document.form1.CCRTERM.select();
	  return false;
	 }
	 if(document.form1.CCRSA.value==""||document.form1.CCRSA.value==0||document.form1.CCRSA.value==null)
	 {
	  alert("Please enter Reliance New Critical Conditions Rider Sum Assured");
	  document.form1.CCRSA.focus();
	  document.form1.CCRSA.select();
	  return false;
	 }
	 
   if(age==0)
		 {
		  alert("Please enter Reliance New Critical Conditions rider age");
		  document.form1.CCRAge.focus();
			document.form1.CCRAge.select();
		  return false;
		 }
		 if(age<18 || age>55)
		   {
			alert("Invalid Rider Age. Please enter Reliance New Critical Conditions Rider Age in between 18 and 55.");
			document.form1.CCRAge.focus();
			document.form1.CCRAge.select();
			return false;
		   } 
		   //term nd sa
		  if(termr==0)
		   {
			alert("Please enter Reliance New Critical Conditions rider Term");
			document.form1.CCRTERM.focus();
			document.form1.CCRTERM.select();
			return false;
			}
		 if(termr<5 || termr>baseval)
		   {
			alert("Rider Term Invalid. Please enter Reliance New Critical Conditions rider Term between 5 and Base Policy Term");
			document.form1.CCRTERM.focus();
			document.form1.CCRTERM.select();
			return false;
		   } 
		   if(asa==0)
		   {
		  alert("Please enter Reliance New Critical Conditions rider Sum assured");
		  document.form1.CCRSA.focus();
		  document.form1.CCRSA.select();
		  return false;
		   }
		  if(asa<100000 || asa>1000000)
		 {
	
	 		 alert("minimum Sum assured for Reliance New Critical Conditions Rider is 1,00,000 and maximum is 10,00,000");
		  document.form1.CCRSA.focus();
		  document.form1.CCRSA.select();
	 	 return false;
		 }
	   if(asa>sa1)
		 {
		  alert("Reliance New Critical Conditions Rider sum assured should be less than or equal to basic sum assured.");
		  document.form1.CCRSA.focus();
		   document.form1.CCRSA.select();
		  return false;
		 }
	  }
	  
	  
	  
	  if(document.form1.chkFBIR.checked==true)
        { 
			//alert("hello");
            var age=parseInt(document.form1.FIBRAge.value);
           
              var baseval=parseFloat(document.form1.TERM.value);
            var baseSA=parseFloat(document.form1.SA.value);
           
            var asa=parseFloat(document.form1.FIBRSA.value);
			//alert(baseAge);
            if(age==0||document.form1.FIBRAge.value==""||document.form1.FIBRAge.value==null||document.form1.FIBRAge.value==0)
            {
                alert("Please enter Reliance Life Insurance Family Income benefit Rider Age.");
                document.form1.FIBRAge.focus();
                document.form1.FIBRAge.select();
                return false;
            }  
		 var termr=parseInt(document.form1.FIBRTerm.value);
      	 if(termr==0||document.form1.FIBRTerm.value==""||document.form1.FIBRTerm.value==null||document.form1.FIBRTerm.value==0)
            {
                alert("Please enter the term for Reliance Life Insurance Family Income benefit Rider.");
                document.form1.FIBRTerm.focus();
                document.form1.FIBRTerm.select();
                return false;
            }
         	if(document.form1.FIBRPTerm.value=="-Select-"||document.form1.FIBRPTerm.value==null||document.form1.FIBRPTerm.selectedIndex==0)
            {
                alert("Please select the Premium paying term for Reliance Life Insurance Family Income benefit Rider.");
                document.form1.FIBRPTerm.focus();
                //document.form1.FIBRTerm.select();
                return false;
            }
            if(termr<5 || termr>baseval)
	    {
	    	alert("Rider Term Invalid. Please enter Reliance Life Insurance Family Income benefit Rider Term between 5 and Base Policy Term");
	    	 document.form1.FIBRTerm.focus();
	          document.form1.FIBRTerm.select();
	    	return false;
	     } 
	     if(termr>30 )
	      {
	    	alert(" Maximum Term For  Reliance Life Insurance Family Income benefit Rider Term should be 30.");
	    	 document.form1.FIBRTerm.focus();
	         document.form1.FIBRTerm.select();
	    	return false;
	      } 
            
            
            if(asa==0||document.form1.FIBRSA.value==""||document.form1.FIBRSA.value==null||document.form1.FIBRSA.value==0)
            {
                alert("Please enter sum assured for Reliance Life Insurance Family Income benefit Rider.");
                document.form1.FIBRSA.focus();
                document.form1.FIBRSA.select();
                return false;
            } 
		//var baseAge=parseFloat(document.form1.Age.value);
		 if(age<18 || age>61)
	  	 {
		alert("Invalid Rider Age. Please enter Reliance Life Insurance Family Income Benefit Rider Age in between 18 and 60");
		document.form1.FIBRAge.focus();
		document.form1.FIBRAge.select();
		return false;
	  	 } 
		 if(baseSA<100000)
                {
                    document.form1.chkFBIR.checked=false;
alert("You are not eligible for Reliance Life Insurance Family Income Benefit Rider as Minimum Sum Assured should be 1,00,000.");           
                   chkAgeRiderFBIR_BASIC();
				    return false;
                }
			 if(asa<100000 || asa>1000000)
            {
         alert("Reliance Life Insurance Family Income Benefit Rider sum assured should be Minimum 1,00,000 and Max 10,00,000. ");
                document.form1.FIBRSA.focus();
                document.form1.FIBRSA.select();
                return false;
            }
            if(asa>parseFloat(document.form1.SA.value))
            {
				alert("Reliance Life Insurance Family Income Benefit Rider sum assured should be less than or equal to the base sum assured subject to Minimum 1,00,000 and Max 10,00,000. ");  
                
                document.form1.FIBRSA.focus();
                document.form1.FIBRSA.select();
                return false;
            }
				
			if(age<baseAge)
			{
				
				  alert("Reliance Life Insurance Family Income benefit Rider Age Should Be Greater Than Or Equal To Base Age.");
				  document.form1.FIBRAge.focus();
                document.form1.FIBRAge.select();
				return false;
			}
			
		
		}
			
        
	  
	  
	  var today=new Date();
	  var pdate=new Date(document.form1.DOCYYYY.value,document.form1.DOCMM.selectedIndex-1,document.form1.DOCDD.selectedIndex);
	  if(pdate>today)
	   {
		alert("Policy Commencement date can not be more than current date");
		 document.form1.DOCYYYY.focus();
		return false;
	   }
////	   if(document.form1.SA.value <25000)
////	  {
////	   alert("minimum Sum Assured is 25,000");
////	   document.form1.SA.focus();
////	   return false;
////	  }
	   //calage();
   var poc=calage(document.form1.DOBYYYY.value,document.form1.DOBMM.selectedIndex,document.form1.DOBDD.value);
   //parseInt(document.form1.DOCYYYY.value)-parseInt(document.form1.DOBYYYY.value);
   if(poc<15 || poc>63)
   {
	alert("Invalid Age.The minimum and maximum Age at entry under this plan is 15 years and 63 years respectively.");
	 document.form1.DOBYYYY.focus();
	return false;
   }


	  //dATE CHECK
	msg="";
	invalid="false";
	days = getDays((document.form1.DOBMM.selectedIndex-1),document.form1.DOBYYYY.value);
	if(document.form1.DOBDD.value > days )
	{
	  msg=msg+"The Birth Date is Invalid\n";
	  invalid="true";
	}
 
	days = getDays((document.form1.DOCMM.selectedIndex-1),document.form1.DOCYYYY.value)
	if(document.form1.DOCDD.value > days)
	{
	  msg=msg+"The Policy Commencement Date is Invalid\n";
	  invalid="true";
	}
	dt=date_diff();
//  alert(dt);
  if(dt >= 184)
  {
   msg=msg+"The policy commencement date cannot be back dated by more than 6 months\n";
   document.form1.DOCYYYY.focus();
   invalid="true";
  }
  if(invalid=="true")
  {
   alert(msg);
   document.form1.DOCMM.focus();
   return false;
  }
	  if(document.form1.SA.value<25000)
	  {
	   alert("- minimum Sum Assured should be 25000.");
	   document.form1.SA.focus();
	   return false;
	  }
	 
  //Age Rider
	  
	  //Age Rider
		
		//var termr=parseInt(document.form1.ADBTERM.value);
	   // var baseval=parseInt(document.form1.TERM.value);
	   // var asa=parseInt(document.form1.ADBSA.value);
	 
 
  //END
	  //end
	  
	  GetBaseAgeValueTrad_Rider_withFBIR_WPR();
	  return true;
  }
  
  
  // Gyp Plan Value Developed by sachin
  function chkAgeRidertermValue()
	{
	 if(document.form1.ChkADTPD.checked==true)
	   {
	   document.form1.ADAge.readOnly =false;
	   document.form1.ADBTerm.readOnly =false;
	   document.form1.ADBSA.readOnly =false;
	 
	   }
	   else if(document.form1.ChkADTPD.checked==false)
	   {
	   document.form1.ADAge.readOnly =true;
	   document.form1.ADBTerm.readOnly =true;
	   document.form1.ADBSA.readOnly =true; 
		document.form1.ADAge.value =0;
	   document.form1.ADBTerm.value =0;
	   document.form1.ADBSA.value =0; 
	   }
	}
	
	function checkFundwithRider()
	{
	   var cap_sec_fund=parseInt(document.form1.PCSF.value);
	   var bal_fund=parseInt(document.form1.PBF.value);
	   var growth_fund=parseInt(document.form1.PGF.value);
	   var equity_fund=parseInt(document.form1.PEF.value);
	   var pure_fund = parseInt(document.form1.PPEF.value);
	   var infra_fund = parseInt(document.form1.PIF.value);
	   var energy_fund = parseInt(document.form1.PENF.value);
	   var mid_fund =parseInt(document.form1.PMDF.value);
	   var totalfund=parseInt(cap_sec_fund)+parseInt(bal_fund)+parseInt(growth_fund)+parseInt(equity_fund)+ parseInt(pure_fund) + parseInt(infra_fund) + parseInt(energy_fund) + parseInt(mid_fund);
	   if(document.form1.txtName.value=="" || document.form1.txtName.value==null)
	   {
		alert("Please enter your/Customer's  name value");
		document.form1.txtName.focus();
		return false;
	   }
	   if(document.form1.txtAdvisor.value=="" || document.form1.txtAdvisor.value==null)
	   {
		alert("Please enter your/Advisor name");
		document.form1.txtAdvisor.focus();
		return false;
	   }
	   if(document.form1.Sex.value=="Select")
	   {
		alert("Please select Your sex");
		document.form1.Sex.focus();
		return false;
	   }
		if(document.form1.Age.value=="-Select-")
	   {
		alert("Please select Your Age");
		document.form1.Age.focus();
		return false;
	   }
	   if(document.form1.Term.value=="" || document.form1.Term.value==null)
	   {
		alert("Please enter term value");
		document.form1.Term.focus();
		return false;
	   }
	   if(document.form1.Mode.value=="-Select-")
	   {
		alert("Please select your Premium Payment  Mode");
		document.form1.Mode.focus();
		return false;
	   }
	   if(document.form1.PREMIUM.value=="" || document.form1.PREMIUM.value==null || document.form1.PREMIUM.value==0)
	   {
		alert("Please enter Premium");
		document.form1.PREMIUM.focus();
		return false;
	   }
	   if(document.form1.SA.value=="" || document.form1.SA.value==null || document.form1.SA.value==0)
	   {
		alert("Please enter your basic sum assured");
		document.form1.SA.focus();
		return false;
	   }
	   if(document.form1.SA.value<25000)
	   {
		alert("Basic Plan Sum Assured should be greater then or equal to 25000");
		document.form1.SA.focus();
		return false;
	   }
	   
////////       if(totalfund!=100)
////////        {
////////          alert("The sum of proportion of all funds should be equal to 100%");
////////  	      document.form1.PCSF.focus();
////////	      return false;
////////        }
////////       if(cap_sec_fund>40)
////////        {
////////          alert("Capital Secure Fund can not exceed 40%");
////////	      document.form1.PCSF.focus();
////////	      return false;
////////        }
		if(document.form1.ChkADTPD.checked==true)
		 { 
		  var age=parseFloat(document.form1.ADAge.value);
		  var termr=parseFloat(document.form1.ADBTerm.value);
		  var baseval=parseFloat(document.form1.Term.value);
		  var asa=parseFloat(document.form1.ADBSA.value);
		  if(age==0)
		   {
			alert("Please enter the age for Reliance Accidental Death and Total and Permanent Disablement Rider");
			document.form1.ADAge.focus();
			document.form1.ADAge.select();
			return false;
		   }
		  if(age<18 || age>60)
		   {
			 alert("Invalid Rider Age. Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Age between 18 and 60");
			 document.form1.ADAge.focus();
			 document.form1.ADAge.select();
			 return false;
		   } 
		   //term nd sa
		  if(termr==0)
		   {
			 alert("Please enter the term for Reliance Accidental Death and Total and Permanent Disablement Rider.");
			 document.form1.ADBTerm.focus();
			 document.form1.ADBTerm.select();
			 return false;
			}
		  if(termr<5 || termr>baseval)
		   {
			alert("Term for Reliance Accidental Death and Total and Permanent Disablement Rider should not exceed base policy term");
			document.form1.ADBTerm.focus();
			document.form1.ADBTerm.select();
			return false;
		   } 
			if(asa==0)
		   {
			 alert("Please enter sum assured for Reliance Accidental Death and Total and Permanent Disablement Rider .");
			 document.form1.ADBSA.focus();
			 document.form1.ADBSA.select();
			 return false;
			}
		  if(asa<25000 || asa>5000000)
		  {
		   alert("Reliance Accidental Death and Total and Permanent Disablement Rider sum assured should be greater then equal to Rs. 25,000");
		   document.form1.ADBSA.focus();
		   document.form1.ADBSA.select();
		   return false;
		  }
	   }
   }
   
	
// Credit Gardian Plan
function CheckCreditGurdian()
{

 if(document.form1.txtName.value=="" || document.form1.txtName.value==null)
  {
   alert("Please enter your/Customer's  name");
   document.form1.txtName.focus();
   return false;
  }
  
  if(document.form1.txtAdvisor_code.value=="" || document.form1.txtAdvisor_code.value==null)
    {
        alert("Please enter Advisor/Employee Code");
        document.form1.txtAdvisor_code.focus();        
        return false;
    }
   if(document.form1.txtAdvisor.value=="" || document.form1.txtAdvisor.value==null)
  {
   alert("Please enter advisor name");
   document.form1.txtAdvisor.focus();
   return false;
  } 
  if(document.form1.SEX.selectedIndex==0)
  {
   alert("Please select Your sex");
   document.form1.SEX.focus();
   return false;
  }
  if(document.form1.IR.selectedIndex==0)
  {
   alert("Please select Interest rate");
   document.form1.IR.focus();
   return false;
  }
	if(document.form1.DOBDD.selectedIndex==0 ) //|| document.form1.DOBMM.selectedIndex==0 || document.form1.DOBYYYY.selectedIndex==0)
  {
   alert("Please select your date of birth");
   document.form1.DOBDD.focus();
   return false;
  }
   if( document.form1.DOBMM.selectedIndex==0 )//|| document.form1.DOBYYYY.selectedIndex==0)
  {
   alert("Please select your date of birth");
   document.form1.DOBMM.focus();
   return false;
  }
   if(document.form1.DOBYYYY.selectedIndex==0)
  {
   alert("Please select your date of birth");
   document.form1.DOBYYYY.focus();
   return false;
  }
  if(document.form1.DOCDD.selectedIndex==0 ) //|| document.form1.DOCMM.selectedIndex==0 || document.form1.DOCYYYY.selectedIndex==0)
  {
   alert("Please select your policy Commencement date");
   document.form1.DOCDD.focus();
   return false;
  }
  if( document.form1.DOCMM.selectedIndex==0 )//|| document.form1.DOCYYYY.selectedIndex==0)
  {
   alert("Please select your policy Commencement date");
   document.form1.DOCMM.focus();
   return false;
  }
  if(document.form1.DOCYYYY.selectedIndex==0)
  {
   alert("Please select your policy Commencement date");
   document.form1.DOCYYYY.focus();
   return false;
  }
  
  if(document.form1.MODETYPE.selectedIndex==0)
  {
	  alert("Please select your Premium Paying Type");
   	document.form1.MODETYPE.focus();
   	return false;
  }
   if(document.form1.MODETYPE.selectedIndex==2)
  {
 	 if(document.form1.MODE.selectedIndex==0)
 	 {
  		 alert("Please select your Premium Payment  Mode");
  		 document.form1.MODE.focus();
  		 return false;
 	 }
  }
  if(document.form1.TERM.selectedIndex==0)
  {
   alert("Please select Your Policy Term");
   document.form1.TERM.focus();
   return false;
  } 
 
  if(document.form1.SA.value=="" || document.form1.SA.value==null)
  {
   alert("Please enter your basic sum assured");
   document.form1.SA.focus();
   return false;
  }
  
  //dATE CHECK
   var poc=calage(document.form1.DOBYYYY.value,document.form1.DOBMM.selectedIndex,document.form1.DOBDD.value);
   //parseInt(document.form1.DOCYYYY.value)-parseInt(document.form1.DOBYYYY.value);
    if(poc<21 || poc>60)
    {
	    alert("Invalid Age.The minimum and maximum Age at entry under this plan is 21 years and 60 years respectively.");
	    document.form1.DOBYYYY.focus();
	    return false;
    }
  var term=parseFloat(document.form1.TERM.value);
  
  if((parseFloat(poc)+term)>65)
  {
	   alert("Maturity Age should be less than or equal to 64.");
	    document.form1.DOBYYYY.focus();
	    return false;
  }
  
   var today=new Date();
  var pdate=new Date(document.form1.DOCYYYY.value,document.form1.DOCMM.selectedIndex-1,document.form1.DOCDD.selectedIndex);
  if(pdate>today)
   {
	alert("Policy Commencement date can not be more than current date");
	return false;
   }
	msg="";
	invalid="false";
	days = getDays((document.form1.DOBMM.selectedIndex-1),document.form1.DOBYYYY.value);
	if(document.form1.DOBDD.value > days )
	{
	  msg=msg+"The Birth Date is Invalid\n";
	  invalid="true";
	}
 
	days = getDays((document.form1.DOCMM.selectedIndex-1),document.form1.DOCYYYY.value)
	if(document.form1.DOCDD.value > days)
	{
	  msg=msg+"The Policy Commencement Date is Invalid\n";
	  invalid="true";
	}
	dt=date_diff();
//  alert(dt);
  if(dt >= 184)
  {
   msg=msg+"The policy commencement date cannot be back dated by more than 6 months\n";
   invalid="true";
  }
  if(invalid=="true")
  {
   alert(msg);
   return false;
  }
  if(document.form1.MODETYPE.value=="Single Premium" ||document.form1.MODETYPE.selectedIndex==1)
  {
  if(document.form1.TERM.value<5 || document.form1.TERM.value>15)
  {
   alert("Term Invalid. Valid Term for Single Premium should be between 5 and 15");
   document.form1.TERM.focus();
   return false;
  }
  }
  else if(document.form1.MODETYPE.selectedIndex==2)
  {
  if(document.form1.TERM.value<10 || document.form1.TERM.value>30)
  {
   alert("Term Invalid. Valid Term for Regular Premium should be between 10 and 30");
   document.form1.TERM.focus();
   return false;
  }
  }
  if(document.form1.SA.value<250000)
  {
   alert("Sum assured should be greater than or equal to 2,50,000");
   document.form1.SA.focus();
   return false;
  }
  //END
}
// end

//Special Credit gardian 
function SpecialCreditGardian()
{
 if(document.form1.txtName.value=="" || document.form1.txtName.value==null)
  {
   alert("Please enter your/Customer's  name");
   document.form1.txtName.focus();
   return false;
  }
  if(document.form1.txtAdvisor_code.value=="" || document.form1.txtAdvisor_code.value==null)
    {
        alert("Please enter Advisor/Employee Code");
        document.form1.txtAdvisor_code.focus();        
        return false;
    }
   if(document.form1.txtAdvisor.value=="" || document.form1.txtAdvisor.value==null)
  {
   alert("Please enter advisor name");
   document.form1.txtAdvisor.focus();
   return false;
  }  
  if(document.form1.Sex.selectedIndex==0)
  {
   alert("Please select Your sex");
   document.form1.Sex.focus();
   return false;
  }
  if(document.form1.IR.selectedIndex==0)
  {
   alert("Please select Interest rate");
   document.form1.IR.focus();
   return false;
  }
 
//  if(document.form1.DOBDD.selectedIndex==0 || document.form1.DOBMM.selectedIndex==0 || document.form1.DOBYYYY.selectedIndex==0)
//  {
//   alert("Please select your date of birth");
//   return false;
//  }
//  if(document.form1.DOCDD.selectedIndex==0 || document.form1.DOCMM.selectedIndex==0 || document.form1.DOCYYYY.selectedIndex==0)
//  {
//   alert("Please select your policy Commencement date");
//   return false;
//  }

   if(document.form1.DOBDD.selectedIndex==0 ) //|| document.form1.DOBMM.selectedIndex==0 || document.form1.DOBYYYY.selectedIndex==0)
  {
   alert("Please select your date of birth");
   document.form1.DOBDD.focus();
   return false;
  }
   if( document.form1.DOBMM.selectedIndex==0 )//|| document.form1.DOBYYYY.selectedIndex==0)
  {
   alert("Please select your date of birth");
   document.form1.DOBMM.focus();
   return false;
  }
   if(document.form1.DOBYYYY.selectedIndex==0)
  {
   alert("Please select your date of birth");
   document.form1.DOBYYYY.focus();
   return false;
  }
  
  if(document.form1.DOCDD.selectedIndex==0 ) //|| document.form1.DOCMM.selectedIndex==0 || document.form1.DOCYYYY.selectedIndex==0)
  {
   alert("Please select your policy Commencement date");
   document.form1.DOCDD.focus();
   return false;
  }
  
  if( document.form1.DOCMM.selectedIndex==0 )//|| document.form1.DOCYYYY.selectedIndex==0)
  {
   alert("Please select your policy Commencement date");
   document.form1.DOCMM.focus();
   return false;
  }
  
  if(document.form1.DOCYYYY.selectedIndex==0)
  {
   alert("Please select your policy Commencement date");
   document.form1.DOCYYYY.focus();
   return false;
  }
  
 
  if(document.form1.MODETYPE.selectedIndex==0)
  {
   alert("Please select your Premium Payment Type.");
   document.form1.MODETYPE.focus();
   return false;
  }
   if(document.form1.MODETYPE.selectedIndex==2 && document.form1.MODE.selectedIndex==0)
  {
   alert("Please select your Mode");
   document.form1.MODE.focus();
   return false;
  }
  if(document.form1.TERM.selectedIndex==0)
  {
   alert("Please select your Policy Term");
   document.form1.TERM.focus();
   return false;
  }
  if(document.form1.SA.value=="" || document.form1.SA.value==null)
  {
   alert("Please enter your basic sum assured");
   document.form1.SA.focus();
   return false;
  }
  //trm check
  var tem=parseInt(document.form1.TERM.value);
  if (document.form1.MODETYPE.selectedIndex==1)
  {
	 if(tem>15)
	 {
	  alert("Policy Term should be 5 to 15");
	  document.form1.TERM.focus();
	  return false;
	 }
  }
 if(document.form1.MODETYPE.selectedIndex==2)
 {
   if(tem<10)
   {
	 alert("Policy Term should be 10 to 30");
	  document.form1.TERM.focus();
	  return false;
   }
  }
  
   if(document.form1.SA.value<250000)
  {
   alert("- minimum Sum Assured should be 250000.");
   document.form1.SA.focus();
   return false;
  }
   var poc=calage(document.form1.DOBYYYY.value,document.form1.DOBMM.selectedIndex,document.form1.DOBDD.value);
   //parseInt(document.form1.DOCYYYY.value)-parseInt(document.form1.DOBYYYY.value);
    if(poc<21 || poc>60)
    {
	    alert("Invalid Age.The minimum and maximum Age at entry under this plan is 21 years and 60 years respectively.");
	    document.form1.DOBYYYY.focus();
	    return false;
    }
  var term=parseFloat(document.form1.TERM.value);
  
  if((parseFloat(poc)+term)>66)
  {
	   alert("Maturity Age should be less than or equal to 65.");
	    document.form1.DOBYYYY.focus();
	    return false;
  }
  
  /*var poc=calage(document.form1.DOBYYYY.value,document.form1.DOBMM.selectedIndex,document.form1.DOBDD.value);
   //parseInt(document.form1.DOCYYYY.value)-parseInt(document.form1.DOBYYYY.value);
   alert (poc);
    if(poc<21 || poc>60)
    {
	    alert("Invalid Age.The minimum and maximum Age at entry under this plan is 21 years and 60 years respectively.");
	    document.form1.DOBYYYY.focus();
	    return false;
    }
	  */
	  
    var today=new Date();
    var pdate=new Date(document.form1.DOCYYYY.value,document.form1.DOCMM.selectedIndex-1,document.form1.DOCDD.selectedIndex);
    if(pdate>today)
    {
	alert("Policy Commencement date can not be more than current date");
	return false;
    }
	  //dATE CHECK
	msg="";
	invalid="false";
	days = getDays((document.form1.DOBMM.selectedIndex-1),document.form1.DOBYYYY.value);
	if(document.form1.DOBDD.value > days )
	{
	  msg=msg+"The Birth Date is Invalid\n";
	  invalid="true";
	}
 
	days = getDays((document.form1.DOCMM.selectedIndex-1),document.form1.DOCYYYY.value);
	if(document.form1.DOCDD.value > days)
	{
	  msg=msg+"The Policy Commencement Date is Invalid\n";
	  invalid="true";
	}
	dt=date_diff();
//  alert(dt);
  if(dt >= 184)
  {
   msg=msg+"The policy commencement date cannot be back dated by more than 6 months\n";
   invalid="true";
  }
  if(invalid=="true")
  {
   alert(msg);
   return false;
  }
 
  //nd
 if(document.form1.chkaccidentrider.checked==true)
	   {
		var age=parseFloat(document.form1.ADBRAge.value);
		var Termr=parseFloat(document.form1.ADBRTerm.value);
		var baseval=parseFloat(document.form1.TERM.value);
		var asa=parseFloat(document.form1.ADBRSA.value);
		if(document.form1.ADBRAge.value=="" || document.form1.ADBRAge.value==0)
		{
		   alert("Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Age.");
		  document.form1.ADBRAge.focus();
		   document.form1.ADBRAge.select();
		  return false;
		}
		 if(age==0)
		 {
		  alert("Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Age.");
		  document.form1.ADBRAge.focus();
		   document.form1.ADBRAge.select();
		  return false;
		 }
		 if(document.form1.ADBRTerm.value=="" || document.form1.ADBRTerm.value==0)
		 {
		   alert("Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Term");
			document.form1.ADBRTerm.focus();
			document.form1.ADBRTerm.select();
			return false;
		 }
		   //Term nd sa
		  if(Termr==0)
		   {
			alert("Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Term");
			document.form1.ADBRTerm.focus();
			document.form1.ADBRTerm.select();
			return false;
			}
			if(document.form1.ADBRSA.value=="" || document.form1.ADBRSA.value==0)
		   {
		   alert("Please enter Reliance Accidental Death and Total and Permanent Disablement Rider sum assured");
			document.form1.ADBRSA.focus();
			document.form1.ADBRSA.select();
			return false;
		   }
			  if(asa==0)
		   {
			alert("Please enter Reliance Accidental Death and Total and Permanent Disablement Rider sum assured");
			document.form1.ADBRSA.focus();
			document.form1.ADBRSA.select();
			return false;
			}
			 if(age<21 || age>60)
		   {
			alert(" Invalid rider Age. Please enter Reliance Accidental Death and Total and Permanent Disablement Rider age between 21 and 60");
			document.form1.ADBRAge.focus();
			document.form1.ADBRAge.select();
			return false;
		   }
			if(Termr<5 || Termr>baseval)
		   {
			alert(" Invalid rider Term .Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Term between 5 and "+baseval);
			document.form1.ADBRTerm.focus();
			document.form1.ADBRTerm.select();
			return false;
		   }
		   
		 if(asa<25000 || asa>5000000)
		 {
		  alert("Reliance Accidental Death and Total and Permanent Disablement Rider minimum sum assured  is Rs. 25,000 and maximum Sum Assured is 50,00,000");
		  document.form1.ADBRSA.focus();
		  document.form1.ADBRSA.select();
		  return false;
		 }
	  }
	  //end age rider
	  //Critical rider
	  if(document.form1.chkccrider.checked==true)
	   {
		var age=parseFloat(document.form1.CCRAGE.value);
		var Termr=parseFloat(document.form1.CCRTERM.value);
		var baseval=parseFloat(document.form1.TERM.value);
		var asa=parseFloat(document.form1.CCRSA.value);
		 if(document.form1.CCRAGE.value=="" || document.form1.CCRAGE.value==0)
		 {
		 alert("Please enter Reliance Critical condtion Rider Age");
		  document.form1.CCRAGE.focus();
		  document.form1.CCRAGE.select();
		  return false;
		 }
		 if(age==0)
		 {
		  alert("Please enter Reliance Critical condtion Rider Age");
		  document.form1.CCRAGE.focus();
		  document.form1.CCRAGE.select();
		  return false;
		 }
		  if(document.form1.CCRTERM.value=="" || document.form1.CCRTERM.value==0)
		   {
			alert("Please enter Reliance Critical condtion Rider Term");
			document.form1.CCRTERM.focus();
			document.form1.CCRTERM.select();
			return false;
		   }
		  if(Termr==0)
		   {
			alert("Please enter Reliance Critical condtion Rider Term");
			document.form1.CCRTERM.focus();
			document.form1.CCRTERM.select();
			return false;
			}
			  if(document.form1.CCRSA.value=="" || document.form1.CCRSA.value==0)
		   {
		   alert("Please enter Reliance Critical condtion Rider sum assured");
			document.form1.CCRSA.focus();
			document.form1.CCRSA.select();
			return false;
		   }
			if(asa==0)
		   {
			alert("Please enter Reliance Critical condtion Rider sum assured");
			document.form1.CCRSA.focus();
			document.form1.CCRSA.select();
			return false;
			}
		   
		  if(age<21 || age>55)
		   {
			alert("Invalid Rider Age. Please enter Reliance Critical condtion Rider Age between 21 and 55");
			document.form1.CCRAGE.focus();
			document.form1.CCRAGE.select();
			return false;
		   } 
		   //Term nd sa
		  
			if(Termr<5 || Termr>baseval)
		   {
			alert("Invalid Rider Term.  Please enter Reliance Critical condtion Rider Term between 5 and "+baseval);
			document.form1.CCRTERM.focus();
			document.form1.CCRTERM.select();
			return false;
		   }           
		 if(asa<100000 || asa>1000000)
		 {
		  alert("Reliance Critical Condition Rider minimum sum assured is 1,00,000 and maximum sum assured is 10,00,000");
		  document.form1.CCRSA.focus();
		  document.form1.CCRSA.select();
		  return false;
		 }
	  }
	  
	  
  //END
}
// end
//Function for validate date entery
function date_diff()
{
 //Today();
 
 
   var d, r, t1, t2, t3;
var minMilli = 1000 * 60
var HrMilli = minMilli * 60
var DyMilli = HrMilli * 24
t1 = new Date(parseFloat(document.form1.DOCYYYY.value),parseFloat(document.form1.DOCMM.selectedIndex)-1,parseFloat(document.form1.DOCDD.value));
t2 = new Date();
if (t2 >= t1)
t3 = t2 - t1;
else
t3 = t1 - t2;

r =Math.floor(t3 / DyMilli);

	return(r);
}
function getDays(month, year) {
// create array to hold number of days in each month
var ar = new Array(12)
ar[0] = 31 // January
ar[1] = (leapYear(year)) ? 29 : 28 // February
ar[2] = 31 // March
ar[3] = 30 // April
ar[4] = 31 // May
ar[5] = 30 // June
ar[6] = 31 // July
ar[7] = 31 // August
ar[8] = 30 // September
ar[9] = 31 // October
ar[10] = 30 // November
ar[11] = 31 // December
// return number of days in the specified month (parameter)
return ar[month]
}
function leapYear(year)
{
if (year % 4 == 0) // basic rule
return true // is leap year
/* else */ // else not needed when statement is "return"
return false // is not leap year
}
function Today()
{
  var today=new Date();
  if(parseInt(document.form1.DOCYYYY.value)>today.getYear() || parseInt(document.form1.DOCMM.value)>today.getMonth() || parseInt(document.form1.DOCDD.value)>today.getDay())
	{
	  alert("Policy commencement date forward not allowed");
	  return false;
	}
}

//-------------------------------------------------------Money Gurenty
//-------------------------------------------------------Money Gurenty
function blankfund_money()
{
if(document.form1.PFUNDD.value=="" || document.form1.PFUNDD.value==null)
		{
		document.form1.PFUNDD.value=0; 
		} 
		if(document.form1.PFUNDE.value=="" || document.form1.PFUNDE.value==null)
		{
		document.form1.PFUNDE.value=0; 
		} 
		 if(document.form1.PFUNDF.value=="" || document.form1.PFUNDF.value==null)
		{
		document.form1.PFUNDF.value=0; 
		   
		} 
}
function MoneyGurantee()
{
if(document.form1.txtName.value=="" || document.form1.txtName.value==null)
  {
   alert("Please enter your/Customer's Name");
   document.form1.txtName.focus();
   return false;
  }
   if(document.form1.txtAdvisor.value=="" || document.form1.txtAdvisor.value==null)
  {
   alert("Please enter Advisor's Name");
   document.form1.txtAdvisor.focus();
   return false;
  }
  if(document.form1.Sex.selectedIndex==0)
  {
   alert("Please select your Sex");
   document.form1.Sex.focus();
   return false;
  }
  if(document.form1.Age.selectedIndex==0)
  {
   alert("Please Select your Age");
   document.form1.Age.focus();
   return false;
  }
   if(document.form1.Term.value==0 || document.form1.Term.value=="" || document.form1.Term.value==null)
  {
   alert("Please enter Policy Term");
   document.form1.Term.focus();
   return false;
  }
  if(document.form1.Mode.selectedIndex==0)
  {
   alert("Please Select Mode of Premium Payment ");
   document.form1.Mode.focus();
   return false;
  }
  
  if(document.form1.PREMIUM.value=="" || document.form1.PREMIUM.value==0)
  {
   alert("Please Enter Installment Premium.");
   document.form1.PREMIUM.focus();
   return false;
  }
  var p=parseFloat(document.form1.PREMIUM.value);
  if(p==0)
  {
   alert("Please Enter Installment Premium.");
   document.form1.PREMIUM.focus();
   return false;
  }
//  var min_term = Math.max(10,(18-parseInt(Age)));
//	var max_term = Math.min(30,(80- parseInt(Age)));
//	var term_value = parseFloat("0" + document.form1.Term.value );
//	var max_maturity = parseFloat(document.form1.Term.value) + parseFloat(document.form1.Age.value);

//	if(parseInt(document.form1.Term.value)<min_term || parseInt(document.form1.Term.value) > max_term)
//	{
//		alert("Policy term should be between "+min_term+" and "+max_term+"");
//		document.form1.Term.focus();
//		return(false);
//	}
	
   if(document.form1.Term.value<10 || document.form1.Term.value>30 )
  {
   alert("Policy Term should be between 10 and 30.");
   document.form1.Term.focus();
   return false;
  }  

	var amt_inst =  document.form1.PREMIUM.value;   
	if (document.form1.Mode.value == "Yearly" && (amt_inst < 10000) || (amt_inst > 1000000000000000))
	{
		alert("If Mode of Premium Payment is yearly, then installment premium should be greater than or equal to 10000");
		document.form1.PREMIUM.focus();       
		return false;
	}       
	if (document.form1.Mode.value == "Half Yearly" && (amt_inst < 5000) || (amt_inst > 1000000000000000))
	{
		alert("If Mode of Premium Payment is Half yearly, then installment premium should be greater than or equal to 5000");
		document.form1.PREMIUM.focus();        
		return false;
	}   
	if (document.form1.Mode.value == "Quarterly" && (amt_inst < 2500) || (amt_inst > 1000000000000000))
	{
		alert("If Mode of Premium Payment is Quarterly, then installment premium should be greater than or equal to 2500");
		document.form1.PREMIUM.focus();
		return false;
	}    
	if (document.form1.Mode.value == "Monthly" && (amt_inst < 1000) || (amt_inst > 1000000000000000))
	{
		alert("If Mode of Premium Payment is Monthly,then installment premium should be greater than or equal to 1000");
		document.form1.PREMIUM.focus();        
		return false;
	}  
	
//	 if(document.form1.Term.value<10 )
//  {
//   alert("minimum Policy Term should be 10.");
//   document.form1.Term.focus();
//   return false;
//  }  
////    if (document.form1.Mode.value == "Yearly")
////    {
////        if ((amt_inst < 10000) || (amt_inst > 1000000000000000))
////        {
////            alert("If Mode of Premium Payment is yearly, then installment premium should be greater than or equal to 10000");
////            document.form1.PREMIUM.focus();
////            return false;
////        }
////    }
////    else if (document.form1.Mode.value == "Half Yearly")
////    {
////        if ((amt_inst < 5000) || (amt_inst > 1000000000000000))
////        {
////            alert("If Mode of Premium Payment is Half yearly, then installment premium should be greater than or equal to 5000");
////            document.form1.PREMIUM.focus();
////            return false;
////        }
////    }
////    else if (document.form1.Mode.value == "Quarterly")
////    {
////        if ((amt_inst < 2500) || (amt_inst > 1000000000000000))
////        {
////            alert("If Mode of Premium Payment is Quarterly, then installment premium should be greater than or equal to 2500");
////            document.form1.PREMIUM.focus();
////            return false;
////        }
////    }
////    else if (document.form1.Mode.value == "Monthly")
////    {
////        if ((amt_inst < 1000) || (amt_inst > 1000000000000000))
////        {
////            alert("If Mode of Premium Payment is Monthly,then installment premium should be greater than or equal to 1000");
////            document.form1.PREMIUM.focus();
////            return false;
////        }
////    }
  //PREMIUM
  
 var mon=parseInt(document.form1.PFUNDD.value);
 var mon1=parseInt(document.form1.PFUNDE.value);
 var mon2=parseInt(document.form1.PFUNDF.value);
 var tot=mon+mon1+mon2;
////// if(tot!=100)
////// {
//////  alert("The sum of proportion of all funds should be equal to 100%");
//////  document.form1.PFUNDD.focus();
//////   document.form1.PFUNDD.select();
//////  return false;
////// }
 if(document.form1.chkaccidentrider.checked==true)
	   {
	   
	   //---------------------------------------------
		if(document.form1.ADBRAGE.value==0||document.form1.ADBRAGE.value==""||document.form1.ADBRAGE.value==null)
		 {
		  alert("Please Enter the age for Reliance Accidental Death and Total and Permanent Disablement Rider");
		  document.form1.ADBRAGE.focus();
			document.form1.ADBRAGE.select();
		  return false;
		 }
	   if(document.form1.ADBRTERM.value==0||document.form1.ADBRTERM.value==""||document.form1.ADBRTERM.value==null)
		   {
			alert("Please Enter the term for Reliance Accidental Death and Total and Permanent Disablement Rider.");
			document.form1.ADBRTERM.focus();
			document.form1.ADBRTERM.select();
			return false;
			}
		 if(document.form1.ADBRSA.value==0||document.form1.ADBRSA.value==""||document.form1.ADBRSA.value==null)
		   {
			alert("Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Sum Assured Correctly.");
			document.form1.ADBRSA.focus();
			document.form1.ADBRSA.select();
			return false;
			} 
		 
		 //--------------------------------------------
		 
		 
		var age=parseFloat(document.form1.ADBRAGE.value);
		var termr=parseFloat(document.form1.ADBRTERM.value);
		var baseval=parseFloat(document.form1.Term.value);
		var asa=parseFloat(document.form1.ADBRSA.value);
		 if(age==0)
		 {
		  alert("Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Age");
		  document.form1.ADBRAGE.focus();
		  document.form1.ADBRAGE.select();
		  return false;
		 }
		 if(age<18 || age>60)
		   {
			alert("Invalid rider Age.Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Age between 18 and 60");
			document.form1.ADBRAGE.focus();
			document.form1.ADBRAGE.select();
			return false;
		   } 
		   //term nd sa
		  if(termr==0)
		   {
			alert("Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Term.");
			document.form1.ADBRTERM.focus();
			document.form1.ADBRTERM.select();
			return false;
			}
		 if(termr<5 || termr>baseval)
		   {
			alert(" Invalid rider Term.Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Term between 5 and "+baseval);
			document.form1.ADBRTERM.focus();
			document.form1.ADBRTERM.select();
			return false;
		   }
		   if(asa==0)
		   {
			alert("Please enter Reliance Accidental Death and Total and Permanent Disablement Rider sum assured.");
			document.form1.ADBRSA.focus();
			document.form1.ADBRSA.select();
			return false;
			} 
		 if(asa<25000 || asa>5000000)
		 {
		  alert("Please enter Reliance Accidental Death and Total and Permanent Disablement Rider minimum sum assured is Rs. 25,000 and maximum Sum Assured is 50,00,000");
		  document.form1.ADBRSA.focus();
		  document.form1.ADBRSA.select();
		  return false;
		 }
	  }
	  //end age rider
	  //Critical rider
	  if(document.form1.chkTermliferider.checked==true)
	   {
	   if(document.form1.TLIBRAGE.value==0||document.form1.TLIBRAGE.value==""||document.form1.TLIBRAGE.value==null)
		 {
		  alert("Please enter the age for Reliance Term Life Insurance Benefit Rider");
		  document.form1.TLIBRAGE.focus();
		  document.form1.TLIBRAGE.select();
		  return false;
		 }
		 if(document.form1.TLIBRTERM.value==0||document.form1.TLIBRTERM.value==""||document.form1.TLIBRTERM.value==null)
		   {
			alert("Please enter the Term for Reliance Term Life Insurance Benefit Rider");
			document.form1.TLIBRTERM.focus();
			document.form1.TLIBRTERM.select();
			return false;
			}
			 if(document.form1.TLIBRSA.value==0||document.form1.TLIBRSA.value==""||document.form1.TLIBRSA.value==null)
		   {
			alert("Please enter Reliance Term Life Insurance Benefit rider Sum Assured Correctly.");
			document.form1.TLIBRSA.focus();
			document.form1.TLIBRSA.select();
			return false;
			} 
	   
			var age=parseFloat(document.form1.TLIBRAGE.value);
			var termr=parseFloat(document.form1.TLIBRTERM.value);
			var baseval=parseFloat(document.form1.Term.value);
			var asa=parseFloat(document.form1.TLIBRSA.value);
			var sa=parseFloat(document.form1.SA1.value);
		 if(age==0)
		 {
		  alert("Please enter the age for Reliance Term Life Insurance Benefit Rider");
		  document.form1.TLIBRAGE.focus();
		  document.form1.TLIBRAGE.select();
		  return false;
		 }
		 if(age<18 || age>59)
		   {
			alert("Age for Reliance Term Life Insurance Benefit Rider should be between 18 to 59 years");
			document.form1.TLIBRAGE.focus();
			document.form1.TLIBRAGE.select();
			return false;
		   } 
		   //term nd sa
		  if(termr==0)
		   {
			alert("Please enter the  Term for Reliance Term Life Insurance Benefit Rider");
			document.form1.TLIBRTERM.focus();
			document.form1.TLIBRTERM.select();
			return false;
			}
		 if(termr<5 || termr>baseval)
		   {
			alert("minimum term for Reliance Term Life Insurance Benefit Rider is 5 and maximum is "+baseval);
			document.form1.TLIBRTERM.focus();
			document.form1.TLIBRTERM.select();
			return false;
		   } 
		 if(asa<25000 || asa>sa)
		 {
		  alert("Reliance Term Life Insurance Benefit Rider Sum Assured should be greater than or equal to 25000 and less than or equal to "+sa);
		  document.form1.TLIBRSA.focus();
		  document.form1.TLIBRSA.select();
		  return false;
		 }
	  }
}
//end



//------------------SPECIAL Term PLAN-------------------
function SpecialTermPlan()
{

  //var dob=document.form1.txtId.value;
  if(document.form1.txtName.value=="" || document.form1.txtName.value==null)
  {
  alert("Please enter your/Customer's  name");
  document.form1.txtName.focus();
  return false;
  }
  if(document.form1.txtAdvisor_code.value=="" || document.form1.txtAdvisor_code.value==null)
    {
        alert("Please enter Advisor/Employee Code");
        document.form1.txtAdvisor_code.focus();        
        return false;
    }
  if(document.form1.txtAdvisor.value=="" || document.form1.txtAdvisor.value==null)
  {
   alert("Please enter advisor's name");
   document.form1.txtAdvisor.focus();
   return false;
  }
  if(document.form1.DOBDD.selectedIndex==0 ) //|| document.form1.DOBMM.selectedIndex==0 || document.form1.DOBYYYY.selectedIndex==0)
  {
   alert("Please select your date of birth");
   document.form1.DOBDD.focus();
   return false;
  }
   if( document.form1.DOBMM.selectedIndex==0 )//|| document.form1.DOBYYYY.selectedIndex==0)
  {
   alert("Please select your date of birth");
   document.form1.DOBMM.focus();
   return false;
  }
   if(document.form1.DOBYYYY.selectedIndex==0)
  {
   alert("Please select your date of birth");
   document.form1.DOBYYYY.focus();
   return false;
  }
   if(document.form1.DOCDD.selectedIndex==0 ) //|| document.form1.DOCMM.selectedIndex==0 || document.form1.DOCYYYY.selectedIndex==0)
  {
   alert("Please select your policy Commencement date");
   document.form1.DOCDD.focus();
   return false;
  }
  if( document.form1.DOCMM.selectedIndex==0 )//|| document.form1.DOCYYYY.selectedIndex==0)
  {
   alert("Please select your policy Commencement date");
   document.form1.DOCMM.focus();
   return false;
  }
  if(document.form1.DOCYYYY.selectedIndex==0)
  {
   alert("Please select your policy Commencement date");
   document.form1.DOCYYYY.focus();
   return false;
  }
if(document.form1.SEX.selectedIndex==0)
  {
  alert("Please select Your Sex");
  document.form1.SEX.focus();
  return false;
  }
   if(document.form1.MODETYPE.selectedIndex==0)
     {
      alert("Please select your Premium Paying Type");
      document.form1.MODETYPE.focus();
      return false;
     }
  if(document.form1.MODETYPE.selectedIndex!=0)
  {
     if(document.form1.MODE.selectedIndex==0)
     {
      alert("Please select your Premium Payment Mode");
      document.form1.MODE.focus();
      return false;
     }
 }
 if(document.form1.TERM.selectedIndex==0)
 {
  alert("Please select your Policy Term");
  document.form1.TERM.focus();
  return false;
 }

  if(document.form1.SA.value==0 ||document.form1.SA.value=="" || document.form1.SA.value==null)
  {
   alert("Please enter your basic sum assured");
   document.form1.SA.focus();
   return false;
  }
  
  if(document.form1.chkaccidentrider.checked==true)
   {
   
   if(document.form1.ADBRAGE.value=="" ||parseInt(document.form1.ADBRAGE.value)==0||document.form1.ADBRAGE.value==null)
	   {
		alert("Please enter Reliance Accidental Death and Total and Permanent Disablement Rider age.");
		document.form1.ADBRAGE.focus();
		document.form1.ADBRAGE.select();
		return false;
	   } 
	   if(document.form1.ADBRTERM.value==""||parseInt(document.form1.ADBRTERM.value)==0||document.form1.ADBRTERM.value==null)
	   {
		alert("Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Term.");
		document.form1.ADBRTERM.focus();
		document.form1.ADBRTERM.select();
		return false;
	   } 
	   if(document.form1.ADBRSA.value==""||parseInt(document.form1.ADBRSA.value)==0||document.form1.ADBRSA.value=="")
	   {
		alert("Please enter Reliance Accidental Death and Total and Permanent disablement sum assured.");
		document.form1.ADBRSA.focus();
		document.form1.ADBRSA.select();
		return false;
	   } 
	 var age=parseInt(document.form1.ADBRAGE.value);
	 if(age==0)
	 {
	  alert("Please enter Reliance Accidental Death and Total and Permanent Disablement Rider age");
	  document.form1.ADBRAGE.focus();
	  document.form1.ADBRAGE.select();
	  return false;
	 }
	 if(age<21 || age>60)
	   {
		alert("Invalid Rider Age. Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Age between 21 and 60");
		document.form1.ADBRAGE.focus();
		return false;
	   } 
  }
  /*
  //end age rider
   //calage();
   var poc=calage(document.form1.DOBYYYY.value,document.form1.DOBMM.selectedIndex,document.form1.DOBDD.value);
   //parseInt(document.form1.DOCYYYY.value)-parseInt(document.form1.DOBYYYY.value);
   if(poc<21 || poc>60)
   {
	alert("Invalid Age.The minimum and maximum Age at entry under this plan Between 21 years and 60 years respectively.");
	document.form1.DOBYYYY.focus();
	return false;
   }
	 msg="";
	invalid="false";
	days = getDays((document.form1.DOBMM.selectedIndex-1),document.form1.DOBYYYY.value);
	if(document.form1.DOBDD.value > days )
	{
	  msg=msg+"The Birth Date is Invalid\n";
	  invalid="true";
	}
 
	days = getDays((document.form1.DOCMM.selectedIndex-1),document.form1.DOCYYYY.value)
	if(document.form1.DOCDD.value > days)
	{
	  msg=msg+"The Policy Commencement Date is Invalid\n";
	  invalid="true";
	}
	dt=date_diff();
//  alert(dt);
  if(dt >= 184)
  {
   msg=msg+"The policy commencement date cannot be back dated by more than 6 months\n";
   invalid="true";
  }
  if(invalid=="true")
  {
   alert(msg);
   document.form1.DOCMM.focus();
   return false;
  }
   if(document.form1.MODE.value=="Single Premium")
  {
  if(document.form1.TERM.value<5 || document.form1.TERM.value>15)
  {
   alert("Term Invalid. Valid Term for Single Premium should be between 5 and 15");
   document.form1.TERM.focus();
   return false;
  }
  }
  else
  {
  if(document.form1.TERM.value<5 || document.form1.TERM.value>30)
  {
   alert("Term Invalid. Valid Term for Regular Premium should be between 5 and 30");
   document.form1.TERM.focus();
   return false;
  }
  
  }
   //dATE CHECK
   var today=new Date();
  var pdate=new Date(document.form1.DOCYYYY.value,document.form1.DOCMM.selectedIndex-1,document.form1.DOCDD.selectedIndex);
  if(pdate>today)
   {
	alert("Policy Commencement date can not be more than current date");
	document.form1.DOCMM.focus();
	return false;
   }
   
  if(document.form1.SA.value<250000)
  {
   alert("- minimum Sum Assured should be 250000.");
   document.form1.SA.focus();
   return false;
  }   
  //Age Rider
  //Age Rider
 
 /* if(document.form1.chkaccidentrider.checked==true)
   {
   
   if(document.form1.ADBRAGE.value=="" ||parseInt(document.form1.ADBRAGE.value)==0||document.form1.ADBRAGE.value==null)
	   {
		alert("Please enter Reliance Accidental Death and Total and Permanent Disablement Rider age.");
		document.form1.ADBRAGE.focus();
		document.form1.ADBRAGE.select();
		return false;
	   } 
	   if(document.form1.ADBRTERM.value==""||parseInt(document.form1.ADBRTERM.value)==0||document.form1.ADBRTERM.value==null)
	   {
		alert("Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Term.");
		document.form1.ADBRTERM.focus();
		document.form1.ADBRTERM.select();
		return false;
	   } 
	   if(document.form1.ADBRSA.value==""||parseInt(document.form1.ADBRSA.value)==0||document.form1.ADBRSA.value=="")
	   {
		alert("Please enter Reliance Accidental Death and Total and Permanent disablement sum assured.");
		document.form1.ADBRSA.focus();
		document.form1.ADBRSA.select();
		return false;
	   } 
	 var age=parseInt(document.form1.ADBRAGE.value);
	 if(age==0)
	 {
	  alert("Please enter Reliance Accidental Death and Total and Permanent Disablement Rider age");
	  document.form1.ADBRAGE.focus();
	  document.form1.ADBRAGE.select();
	  return false;
	 }
	 if(age<21 || age>60)
	   {
		alert("Invalid Rider Age. Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Age between 21 and 60");
		document.form1.ADBRAGE.focus();
		return false;
	   } 
  }
  //end age rider*/
  //Term rider
  
  if(document.form1.chkaccidentrider.checked==true)
   {
	 var Termr=parseFloat(document.form1.ADBRTERM.value);
	 var baseval=parseFloat(document.form1.TERM.value);
	 var asa=parseFloat(document.form1.ADBRSA.value);
	 var sumassured=parseFloat(document.form1.SA.value);
	 if(Termr==0)
	 {
	  alert("Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Term");
	  document.form1.ADTERM.focus();
		document.form1.ADTERM.select();
	  return false;
	 }
	 if(Termr<5 || Termr>baseval)
	   {
		alert("Invalid Rider Term. Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Term between 5 and "+baseval);
		document.form1.ADBRTERM.focus();
		document.form1.ADBRTERM.select();
		return false;
	   } 
		if(asa==0)
	 {
	  alert("Please enter Reliance Accidental Death and Total and Permanent Disablement Rider sum assured");
	  document.form1.ADBRSA.focus();
	  document.form1.ADBRSA.select();
	  return false;
	 }
	 if(asa<25000 || asa>5000000)
	 {
	  alert("minimum Reliance Accidental Death and Total and Permanent Disablement Rider  Sum assured is Rs 25,000 and maximum Accidental Sum assured is 50,00,000");
	  document.form1.ADBRSA.focus();
	  document.form1.ADBRSA.select();
	  return false;
	 }
	 if(asa>sumassured)
	 {
	   alert("Reliance Accidental Death and Total and Permanent Disablement Rider Sum Assured should be less than or equal to basic Sum Assured ");
	  document.form1.ADBRSA.focus();
	  document.form1.ADBRSA.select();
	 return false;
	 }
  }
  //end rider
  //critical rider
   //Age Rider
  if(document.form1.chkccrider.checked==true)
   {
   
   if(document.form1.CCRAGE.value==""||document.form1.CCRAGE.value==0||document.form1.CCRAGE.value==null)
	 {
	  alert("Please enter Reliance New Critical Conditions Rider Age.");
	  document.form1.CCRAGE.focus();
	 document.form1.CCRAGE.select();
	  return false;
	 }
   if(document.form1.CCRTERM.value==""||document.form1.CCRTERM.value==0||document.form1.CCRTERM.value==null)
	 {
	  alert("Please enter Reliance New Critical Conditions Rider Term.");
	  document.form1.CCRTERM.focus();
	  document.form1.CCRTERM.select();
	  return false;
	 }
	 if(document.form1.CCRSA.value==""||document.form1.CCRSA.value==0||document.form1.CCRSA.value==null)
	 {
	  alert("Please enter Reliance New Critical Conditions Rider Sum Assured");
	  document.form1.CCRSA.focus();
	  document.form1.CCRSA.select();
	  return false;
	 }
	 var age=parseInt(document.form1.CCRAGE.value);
	 if(age==0)
	 {
	  alert("Please enter Reliance Critical Condtions Rider Age ");
	  document.form1.CCRAGE.focus();
	  document.form1.CCRAGE.select();
	  return false;
	 }
	 if(age<18 || age>55)
	   {
		alert("Invalid Rider Age.Please enter Reliance Critical Condtions Rider Age between 21 and 55");
		document.form1.CCRAGE.focus();
		document.form1.CCRAGE.select();
		return false;
	   } 
  }
  //end age rider
  //Term rider
  if(document.form1.chkccrider.checked==true)
   {
	 var Termr=parseFloat(document.form1.CCRTERM.value);
	 var baseval=parseFloat(document.form1.TERM.value);
	 var asa=parseFloat(document.form1.CCRSA.value);
	 var samax=parseFloat(document.form1.SA.value);
	 if(Termr<5 || Termr>baseval)
	   {
		alert("Invalid Rider Term.Please enter Reliance Critical Condtions Rider Term between 5 and "+baseval);
		document.form1.CCRTERM.focus();
		document.form1.CCRTERM.select();
		return false;
	   } 
	   if(asa==0)
	 {
	  alert("Please enter Reliance Critical Condtions Rider Sum assured");
	  document.form1.CCRSA.focus();
	  document.form1.CCRSA.select();
	  return false;
	 }
	  if(parseFloat(document.form1.CCRSA.value)<100000)
	  {
	  alert("Reliance Critical Condtions sum assured should be minimum 1,00,000");
	  document.form1.CCRSA.focus();
	  document.form1.CCRSA.select();
	  return false;
	  }
	  if(asa>100000)
	  {
		 if(asa>Math.min(samax,1000000))
		 {
		  alert("Reliance Critical Condtions sum assured should be maximum "+Math.min(samax,1000000));
		  document.form1.CCRSA.focus();
		  document.form1.CCRSA.select();
		  return false;
		 }
	 }
  }
  
  
   msg="";
	invalid="false";
	days = getDays((document.form1.DOBMM.selectedIndex-1),document.form1.DOBYYYY.value);
	if(document.form1.DOBDD.value > days )
	{
	  msg=msg+"The Birth Date is Invalid\n";
	  invalid="true";
	}
 
	days = getDays((document.form1.DOCMM.selectedIndex-1),document.form1.DOCYYYY.value)
	if(document.form1.DOCDD.value > days)
	{
	  msg=msg+"The Policy Commencement Date is Invalid\n";
	  invalid="true";
	}
	dt=date_diff();
//  alert(dt);
  if(dt >= 184)
  {
   msg=msg+"The policy commencement date cannot be back dated by more than 6 months\n";
   invalid="true";
  }
  if(invalid=="true")
  {
   alert(msg);
   document.form1.DOCMM.focus();
   return false;
  }
   if(document.form1.MODETYPE.selectedIndex==1)
  {
  if(document.form1.TERM.value<5 || document.form1.TERM.value>15)
  {
   alert("Term Invalid. Valid Term for Single Premium should be between 5 and 15");
   document.form1.TERM.focus();
   return false;
  }
  }
  else
  {
  if(document.form1.TERM.value<5 || document.form1.TERM.value>30)
  {
   alert("Term Invalid. Valid Term for Regular Premium should be between 5 and 30");
   document.form1.TERM.focus();
   return false;
  }
  
  }
   //dATE CHECK
   var today=new Date();
  var pdate=new Date(document.form1.DOCYYYY.value,document.form1.DOCMM.selectedIndex-1,document.form1.DOCDD.selectedIndex);
  if(pdate>today)
   {
	alert("Policy Commencement date can not be more than current date");
	document.form1.DOCMM.focus();
	return false;
   }
   
  if(document.form1.SA.value<250000)
  {
   alert("- minimum Sum Assured should be 250000.");
   document.form1.SA.focus();
   return false;
  }   
  
  //dATE CHECK
//////   if(parseFloat(document.form1.SA.value)<250000)
//////  {
//////  alert(" minimum Basic Sum Assured should be 2,50,000");
//////  document.form1.SA.focus();
//////  document.form1.SA.select();
//////  return false;
//////  }
  
  
  return true;
}
//------------------END---------------------------------

//-----------------Endownment Plan---------------------
function chkTermRiderendowment()
	{
	 if(document.form1.chkTermliferider.checked==true)
	   {
	   document.form1.TLBRAGE.readOnly =false;
	   document.form1.TLBRTERM.readOnly =false;
	   document.form1.TLBRPTERM.readOnly =true;
	   document.form1.TLBRSA.readOnly =false;
		document.form1.TLBRAGE.disabled =false;
	   document.form1.TLBRTERM.disabled =false;
	   document.form1.TLBRPTERM.disabled =false;
	   document.form1.TLBRSA.disabled =false;
	  
	   }
	   else if(document.form1.chkTermliferider.checked==false)
	   {
	   document.form1.TLBRAGE.readOnly =true;
	   document.form1.TLBRTERM.readOnly =true;
	   document.form1.TLBRPTERM.readOnly =true;
	   document.form1.TLBRSA.readOnly =true; 
		document.form1.TLBRAGE.disabled =true;
	   document.form1.TLBRTERM.disabled =true;
	    document.form1.TLBRPTERM.disabled =true;
	   document.form1.TLBRSA.disabled =true;
		document.form1.TLBRAGE.value =0;
	   document.form1.TLBRTERM.value =0;
	   document.form1.TLBRPTERM.value =0;
	   document.form1.TLBRSA.value =0; 
	   }
	}
	function ccriderendowment()
	{
	if(document.form1.chkccrider.checked==true)
	   {
	   document.form1.CCRAGE.readOnly =false;
	   document.form1.CCRTERM.readOnly =false;
	   document.form1.CCRPTERM.readOnly =true;
	   document.form1.CCRSA.readOnly =false;  
	   document.form1.CCRAGE.disabled =false;
	   document.form1.CCRTERM.disabled =false;
	   document.form1.CCRPTERM.disabled =false;
	   document.form1.CCRSA.disabled =false;     
	   }
	   else if(document.form1.chkccrider.checked==false)
	   {
	   document.form1.CCRAGE.readOnly =true;
	   document.form1.CCRTERM.readOnly =true;
	    document.form1.CCRPTERM.readOnly =true;
	   document.form1.CCRSA.readOnly =true; 
		document.form1.CCRAGE.disabled =true;
	   document.form1.CCRTERM.disabled =true;
	   document.form1.CCRPTERM.disabled =true;
	   document.form1.CCRSA.disabled =true; 
		document.form1.CCRAGE.value =0;
	   document.form1.CCRTERM.value =0;
	   document.form1.CCRSA.value =0; 
	   document.form1.CCRPTERM.value =0; 
	   }
	}
	//----------
 function CheckRidervalue()
{
 if(document.form1.txtName.value=="" || document.form1.txtName.value==null)
  {
  alert("Please enter your/Customer's Name");
  document.form1.txtName.focus();
  return false;
  }
  if(document.form1.txtAdvisor_code.value=="" || document.form1.txtAdvisor_code.value==null)
    {
        alert("Please enter Advisor/Employee Code");
        document.form1.txtAdvisor_code.focus();        
        return false;
    }
  
  if(document.form1.txtAdvisor.value=="" || document.form1.txtAdvisor.value==null)
  {
   alert("Please enter Advisor's Name");
   document.form1.txtAdvisor.focus();
   return false;
  }
 if(document.form1.Sex.selectedIndex==0)
 {
  alert("Please select your Sex");
  document.form1.Sex.focus();
  return false;
 }
  if(document.form1.DOBDD.selectedIndex==0 ) //|| document.form1.DOCMM.selectedIndex==0 || document.form1.DOCYYYY.selectedIndex==0)
  {
   alert("Please select your Date of Birth");
   document.form1.DOBDD.focus();
   return false;
  }
  if( document.form1.DOBMM.selectedIndex==0 )//|| document.form1.DOCYYYY.selectedIndex==0)
  {
   alert("Please select your Date of Birth");
   document.form1.DOBMM.focus();
   return false;
  }
  if(document.form1.DOBYYYY.selectedIndex==0)
  {
   alert("Please select your Date of Birth");
   document.form1.DOBYYYY.focus();
   return false;
  }
  //Age Calculation
   //Age Rider
	//Age calculation
	if (document.form1.DOBDD.selectedIndex!=0 && document.form1.DOBMM.selectedIndex!=0 && document.form1.DOBYYYY.selectedIndex!=0)
	  {
	  var dobyyyy = document.form1.DOBYYYY[document.form1.DOBYYYY.selectedIndex].value;
	   //alert(dobyyyy);
	 var dobmm = document.form1.DOBMM.selectedIndex;
	  //alert(dobmm);
	 var dobdd = document.form1.DOBDD[document.form1.DOBDD.selectedIndex].value;
	  //alert(dobdd);
	  var birthdate = new Date(dobyyyy, dobmm-1, dobdd) //Month is 0-11 in JavaScript
	   //alert(birthdate);
	 var curdate=new Date();
	  var one_day=1000*60*60*24;
	  var age = parseInt(Math.ceil((curdate.getTime()-birthdate.getTime())/(one_day))/365.25);   
	  //alert(age);  
	  document.form1.AGE.value =age;
	}
  //end calculation
  // end
  if(document.form1.DOCDD.selectedIndex==0 ) //|| document.form1.DOCMM.selectedIndex==0 || document.form1.DOCYYYY.selectedIndex==0)
  {
   alert("Please select your Policy Commencement Date");
   document.form1.DOCDD.focus();
   return false;
  }
  if( document.form1.DOCMM.selectedIndex==0 )//|| document.form1.DOCYYYY.selectedIndex==0)
  {
   alert("Please select your Policy Commencement Date");
   document.form1.DOCMM.focus();
   return false;
  }
  if(document.form1.DOCYYYY.selectedIndex==0)
  {
   alert("Please select your Policy Commencement Date");
   document.form1.DOCYYYY.focus();
   return false;
  }

 if(document.form1.TERM.selectedIndex==0)
 {
  alert("Please select your Policy Term");
  document.form1.TERM.focus();
  return false;
 }
 if(document.form1.MODE.selectedIndex==0)
 {
  alert("Please select your Premium Payment Mode");
  document.form1.MODE.focus();
  return false;
 }
 if(document.form1.SA.value=="" || document.form1.SA.value==null || document.form1.SA.value==0)
  {
  alert("Please enter your Basic Sum Assured");
  document.form1.SA.focus();
  document.form1.SA.select();
  return false;
  }
  if(document.form1.AGE.value <5 ||document.form1.AGE.value >65)
  {
  alert("Age must be in between 5 and 65.");
  document.form1.DOBYYYY.focus();
  return false;
  }  
 
 
if(parseFloat(document.form1.SA.value)<25000)
  {
  alert("- minimum Sum Assured should be 25000.");
  document.form1.SA.focus();
  document.form1.SA.select();
  return false;
  }
 if(document.form1.chkaccidentrider.checked==true)
 {
  //Age Rider
  
   if(document.form1.ADBRAge.value==""||document.form1.ADBRAge.value==null ||document.form1.ADBRAge.value==0)
	 {
	  alert("Please enter Reliance Accidental Death and Total and Permanent Disablement Rider age");
	  document.form1.ADBRAge.focus();
	  document.form1.ADBRAge.select();
	  return false;
	 }
	 
	 if(document.form1.ADBRTerm.value==""||document.form1.ADBRTerm.value==null||document.form1.ADBRTerm.value==0)
	 {
	  alert("Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Term.");
	  document.form1.ADBRTerm.focus();
	  document.form1.ADBRTerm.select();
	  return false;
	 }
	  if(document.form1.ADBRSA.value==""||document.form1.ADBRSA.value==null||document.form1.ADBRSA.value==0)
	 {
	  alert("Please enter Reliance Accidental Death and Total and Permanent Disablement Rider sum assured");
	  document.form1.ADBRSA.focus();
	  document.form1.ADBRSA.select();
	  return false;
	 }
	 
	 
	var age=parseInt(document.form1.ADBRAge.value);
	
	
	 if(age==0)
	 {
	  alert("Please enter Reliance Accidental Death and Total and Permanent Disablement Rider age");
	  document.form1.ADBRAge.focus();
	  document.form1.ADBRAge.select();
	  return false;
	 }
	 if(age<18 || age>60)
	   {
		alert("Invalid Rider Age. Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Age in between 18 and 60");
		document.form1.ADBRAge.focus();
		   document.form1.ADBRAge.select();
		return false;
	   } 
	//Term
	var termr=parseFloat(document.form1.ADBRTerm.value);
	 var baseval=parseFloat(document.form1.TERM.value);
	 var asa=parseFloat(document.form1.ADBRSA.value);
   
	if(termr<5 )
	   {
		alert("Invalid rider Term. minimum Reliance Accidental Death and Total and Permanent Disablement Rider Term is 5" );
		document.form1.ADBRTerm.focus();
		   document.form1.ADBRTerm.select();
		return false;
	   } 
	 if(termr<5 || termr>baseval)
	   {
		alert("Invalid rider Term. Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Term in between 5 and "+baseval);
		document.form1.ADBRTerm.focus();
		 document.form1.ADBRTerm.select();
		return false;
	   } 
		 if(asa==0)
	 {
	  alert("Please enter Reliance Accidental Death and Total and Permanent Disablement Rider sum assured");
	  document.form1.ADBRSA.focus();
	  document.form1.ADBRSA.select();
	  return false;
	 }
	 if(asa<25000 || asa>5000000)
	 {
	  alert("Reliance Accidental Death and Total and Permanent Disablement Rider sum assured should be between Rs. 25,000 and 5000000.");
	  document.form1.ADBRSA.focus();
	  document.form1.ADBRSA.select();
	  return false;
	 }
			
 }
 
 
 
 if(document.form1.chkccrider.checked==true)
 {
   //Age Rider
   
   
	if(document.form1.CCRAGE.value==""||document.form1.CCRAGE.value==null||document.form1.CCRAGE.value==0)
	 {
	  alert("Please Enter Reliance New Critical Conditions Rider Age.");
	  document.form1.CCRAGE.focus();
	  document.form1.CCRAGE.select();
	  return false;
	 }
	 
	  if(document.form1.CCRTERM.value==""||document.form1.CCRTERM.value==null||document.form1.CCRTERM.value==0)
	 {
	  alert("Please Enter Reliance New Critical Conditions Rider Term");
	  document.form1.CCRTERM.focus();
	  document.form1.CCRTERM.select();
	  return false;
	 }
	 
	   if(document.form1.CCRSA.value==""||document.form1.CCRSA.value==null||document.form1.CCRSA.value==0)
	 {
	  alert("Please Enter Reliance New Critical Conditions Rider Sum Assured");
	  document.form1.CCRSA.focus();
	  document.form1.CCRSA.select();
	  return false;
	 }
	var age=parseFloat(document.form1.CCRAGE.value);
	 if(age==0)
	 {
	  alert("Please enter Reliance New Critical Conditions Rider Age");
	  document.form1.CCRAGE.focus();
	  document.form1.CCRAGE.select();
	  return false;
	 }
	 if(age<18 || age>55)
	   {
		alert("Age for Reliance New Critical Conditions Rider should be between 18 and 55");
		document.form1.CCRAGE.focus();
		document.form1.CCRAGE.select();
		return false;
	   } 
	//Term
	var termr=parseFloat(document.form1.CCRTERM.value);
	 var baseval=parseFloat(document.form1.TERM.value);
	 var asa=parseFloat(document.form1.CCRSA.value);
	 if(termr==0)
	 {
	  alert("Please enter reliance Critical Conditions Rider Term");
	  document.form1.CCRTERM.focus();
	  document.form1.CCRTERM.select();
	  return false;
	 }
	 
	 if(termr<5)
	 {
	  alert("minimum Reliance New Critical Conditions Rider Term is 5.");
	  document.form1.CCRTERM.focus();
	  document.form1.CCRTERM.select();
	  return false;
	 }
	 if(termr<5 || termr>baseval)
	   {
		alert("Invalid Rider Term. Please enter Reliance New Critical Conditions Rider Term between 5 and "+baseval);
		document.form1.CCRTERM.focus();
		document.form1.CCRTERM.select();Conditions
		return false;
	   } 
	   if(asa==0)
	 {
	  alert("Please enter reliance Critical  Rider sum assured");
	  document.form1.CCRSA.focus();
	  document.form1.CCRSA.select();
	  return false;
	 }
	 if(asa<100000 || asa>1000000)
	 {
	  alert("Please enter Sum assured for Reliance New Critical Conditions rider in between 1,00,000 and 10,00,000 & it should not exceed initial sum assured");
	  document.form1.CCRSA.focus();
	  document.form1.CCRSA.select();
	  return false;
	 }
 }
 
 if(document.form1.chkTermliferider.checked==true)
 {
   //Age Rider
   
	
	if(document.form1.TLBRAGE.value==""||document.form1.TLBRAGE.value==null||document.form1.TLBRAGE.value==0)
	 {
	  alert("Please Enter Reliance Term Life Insurance Benefit Rider Age.");
	  document.form1.TLBRAGE.focus();
	   document.form1.TLBRAGE.select();
	  return false;
	 }
	 
	  if(document.form1.TLBRTERM.value==""||document.form1.TLBRTERM.value==null||document.form1.TLBRTERM.value==0)
	 {
	  alert("Please Enter Reliance Term Life Insurance Benefit Rider Term");
	  document.form1.TLBRTERM.focus();
	   document.form1.TLBRTERM.select();
	  return false;
	 }
	 
	   if(document.form1.TLBRSA.value==""||document.form1.TLBRSA.value==null||document.form1.TLBRSA.value==0)
	 {
	  alert("Please Enter Reliance Term Life Insurance Benefit Rider Sum Assured");
	  document.form1.TLBRSA.focus();
	   document.form1.TLBRSA.select();
	  return false;
	 }
	 
	  var age=parseFloat(document.form1.TLBRAGE.value);
	 if(age==0)
	 {
	  alert("Please enter Reliance Term Life Insurance Benefit Rider Age.");
	  document.form1.TLBRAGE.focus();
	  document.form1.TLBRAGE.select();
	  return false;
	 }
	 if(age<18 || age>59)
	   {
		alert("Invalid Rider Age. Please enter Reliance Term Life Insurance Benefit Rider Age in between 18 and 59");
		document.form1.TLBRAGE.focus();
		 document.form1.TLBRAGE.select();
		return false;
	   } 
	//Term
	var termr=parseFloat(document.form1.TLBRTERM.value);
	 var baseval=parseFloat(document.form1.TERM.value);
	 var asa=parseFloat(document.form1.TLBRSA.value);
	 if(termr==0)
	 {
	  alert("Please enter Reliance Term Life Insurance Benefit Rider Term");
	  document.form1.TLBRTERM.focus();
	  document.form1.TLBRTERM.select();
	  return false;
	 }
	  if(termr<5)
	 {
	  alert("minimum Reliance Term Life Insurance Benefit Rider Term is 5.");
	  document.form1.TLBRTERM.focus();
	  document.form1.TLBRTERM.select();
	  return false;
	 }
	 if(termr<5 || termr>baseval)
	   {
		alert("Invalid Rider Term.Please enter Reliance Term Life Insurance Benefit Rider Term in between 5 and "+baseval);
		document.form1.TLBRTERM.focus();
		document.form1.TLBRTERM.select();
		return false;
	   } 
		if(asa==0)
	 {
	  alert(" Reliance Term Life Insurance benefit minimum is 1,00,000 & should not exceed intial Sum Assured");
	  document.form1.TLBRSA.focus();
	  document.form1.TLBRSA.select();
	  return false;
	 }
	 if(asa<100000)
	 {
	  alert("minimum Sum Assured for Reliance Term life insurance benefit rider is 1,00,000 & should not exceed initial Sum Assured");
	  document.form1.TLBRSA.focus();
	  document.form1.TLBRSA.select();
	  return false;
	 }
 }
 
   if(document.form1.chkFBIR.checked==true)
        { 
		//alert("hello");
            var age=parseFloat(document.form1.FIBRAge.value);
            var termr=parseFloat(document.form1.FIBRTerm.value);
            var baseval=parseFloat(document.form1.TERM.value);
            var baseSA=parseFloat(document.form1.SA.value);
            var baseAge=parseFloat(document.form1.AGE.value);
            var asa=parseFloat(document.form1.FIBRSA.value);
			//alert("hi");
            if(age==0||document.form1.FIBRAge.value==""||document.form1.FIBRAge.value==null||document.form1.FIBRAge.value==0)
            {
                alert("Please enter Reliance Life Insurance Family Income benefit Rider Age.");
                document.form1.FIBRAge.focus();
                document.form1.FIBRAge.select();
                return false;
            }  

           if(termr==0||document.form1.FIBRTerm.value==""||document.form1.FIBRTerm.value==null||document.form1.FIBRTerm.value==0)
            {
                alert("Please enter the term for Reliance Life Insurance Family Income benefit Rider.");
                document.form1.FIBRTerm.focus();
                document.form1.FIBRTerm.select();
                return false;
            }
           if(document.form1.FIBRPTerm.value=="Select"||document.form1.FIBRPTerm.selectedIndex==0)
            {
                alert("Please select the Premium Paying term for Reliance Life Insurance Family Income benefit Rider.");
                document.form1.FIBRPTerm.focus();
                //document.form1.FIBRTerm.select();
                return false;
            }
            if(asa==0||document.form1.FIBRSA.value==""||document.form1.FIBRSA.value==null||document.form1.FIBRSA.value==0)
            {
                alert("Please enter sum assured for Reliance Life Insurance Family Income benefit Rider.");
                document.form1.FIBRSA.focus();
                document.form1.FIBRSA.select();
                return false;
            } 
			
			 if(age<18 || age>61)
	  		 {
			alert("Invalid Rider Age. Please enter Reliance Life Insurance Family Income Benefit Rider Age in between 18 and 60");
			document.form1.FIBRAge.focus();
		 	document.form1.FIBRAge.select();
			return false;
	  		 } 
			 
			  if(baseSA<100000)
                {
                    document.form1.chkFBIR.checked=false;
alert("You are not eligible for Reliance Life Insurance Family Income Benefit Rider as Minimum Sum Assured should be 1,00,000.");           
                   chkAgeRiderFBIR_BASIC();
				    return false;
                }
			 if(asa<100000 || asa>1000000)
            {
         alert("Reliance Life Insurance Family Income Benefit Rider sum assured should be Minimum 1,00,000 and Max 10,00,000. ");
                document.form1.FIBRSA.focus();
                document.form1.FIBRSA.select();
                return false;
            }
            if(asa>parseFloat(document.form1.SA.value))
            {
				alert("Reliance Life Insurance Family Income Benefit Rider sum assured should be less than or equal to the base sum assured subject to Minimum 1,00,000 and Max 10,00,000. ");  
                
                document.form1.FIBRSA.focus();
                document.form1.FIBRSA.select();
                return false;
            }
				
				if(age<baseAge)
			{
				
				  alert("Reliance Life Insurance Family Income benefit Rider Age Should Be Greater Than Or Equal To Base Age.");
				  document.form1.FIBRAge.focus();
                document.form1.FIBRAge.select();
				return false;
			}
			
        }
 
 
  var today=new Date();
  var pdate=new Date(document.form1.DOCYYYY.value,document.form1.DOCMM.selectedIndex-1,document.form1.DOCDD.selectedIndex);
  if(pdate>today)
   {
	alert("Policy Commencement date can not be greater than current date");
	 document.form1.DOCMM.focus();
	return false;
   }
   //dATE CHECK
   
	dt=date_diff();
//  alert(dt);
var msg="";
var invalid="false";
  if(dt >= 184)
  {
   msg=msg+"The policy commencement date cannot be back dated by more than 6 months\n";
	document.form1.DOCMM.focus();
   invalid="true";
  }
  if(invalid=="true")
  {
   alert(msg);
	 document.form1.DOCMM.focus();
   return false;
 }
 
}
//-----------------End---------------------------------


//---------------------Connect To Life----------------
function connectlifechek()
{
   var cap_sec_fund=parseInt(document.form1.PCSF.value);
   var bal_fund=parseInt(document.form1.PBF.value);
   var growth_fund=parseInt(document.form1.PBF.value);
   var equity_fund=parseInt(document.form1.PEF.value);
   var pure_fund = parseInt(document.form1.PPEF.value);
   var infra_fund = parseInt(document.form1.PIF.value);
   var energy_fund = parseInt(document.form1.PENF.value);
   var mid_fund = parseInt(document.form1.PMDF.value);
   var totalfund=parseInt(cap_sec_fund)+parseInt(bal_fund)+parseInt(growth_fund)+parseInt(equity_fund)+ parseInt(pure_fund) + parseInt(infra_fund) + parseInt(energy_fund) + parseInt(mid_fund);
   //Blank checks
   if(document.form1.txtName.value=="" || document.form1.txtName.value==null)
 {
  alert("Please enter your/Customer's  name");
  document.form1.txtName.focus();
  return false;
 }
 if(document.form1.txtAdvisor.value=="" || document.form1.txtAdvisor.value==null)
 {
  alert("Please enter advisor's name");
  document.form1.txtAdvisor.focus();
  return false;
 }
 if(document.form1.Sex.selectedIndex==0)
 {
  alert("Please select Your sex");
  document.form1.Sex.focus();
  return false;
 }
  if(document.form1.Age.selectedIndex==0)
 {
  alert("Please select Basic Age");
  document.form1.Age.focus();
  return false;
 }
 if(document.form1.MODE.selectedIndex==0 & document.form1.MODETYPE.selectedIndex==0)
 {
  alert("Please select your Premium Payment  Mode");
  document.form1.MODE.focus();
  return false;
 }
  if(document.form1.PREMIUM.value=="" || document.form1.PREMIUM.value==null || document.form1.PREMIUM.value===0)
 {
  alert("Please enter premium amount");
  document.form1.PREMIUM.focus();
  return false;
 }

   //end PREMIUM
////////   if(totalfund!=100)
////////   {
////////    alert("The sum of proportion of all funds should be equal to 100%");
////////    document.form1.PMMF.focus();
////////    return false;
////////   }
////////   if(cap_sec_fund>40)
////////   {
////////    alert("Money Market Fund can not exceed 40%");
////////    document.form1.PMMF.focus();
////////    return false;
////////   }
}

function AddOption()
{
	for(var ii=0; ii<document.form1.SAVAL.length; ii++)
	{
		document.form1.SAVAL.options[ii]=null;
	}
	document.form1.SAVAL.options[0] = new Option("--Select--","");
	////  document.form1.SAVAL.options[0] = new Option("--Select--");     
	if (document.form1.FPUR.value == "First Purchase" && document.form1.PTTFP.value == "Silver Plan")
	{
		document.form1.SAVAL.options[1] = new Option("100000");
	}
	else if (document.form1.FPUR.value == "First Purchase" && document.form1.PTTFP.value == "Gold Plan")
	{
		document.form1.SAVAL.options[1] = new Option("100000");
		document.form1.SAVAL.options[2] = new Option("200000");
	}
	if (document.form1.FPUR.value == "Second Purchase" && document.form1.PTTFP.value == "Silver Plan")
	{
		document.form1.SAVAL.options[1] = new Option("100000");
		document.form1.SAVAL.options[2] = new Option("200000");
	}
	else if (document.form1.FPUR.value == "Second Purchase" && document.form1.PTTFP.value == "Gold Plan")
	{
		document.form1.SAVAL.options[1] = new Option("100000");
		document.form1.SAVAL.options[2] = new Option("200000");
		document.form1.SAVAL.options[3] = new Option("300000");
	}        
	if (document.form1.FPUR.value == "Third Purchase" && document.form1.PTTFP.value == "Silver Plan")
	{
		document.form1.SAVAL.options[1] = new Option("100000");
		document.form1.SAVAL.options[2] = new Option("200000");
	}
	else if (document.form1.FPUR.value == "Third Purchase" && document.form1.PTTFP.value == "Gold Plan")
	{
		document.form1.SAVAL.options[1] = new Option("100000");
		document.form1.SAVAL.options[2] = new Option("200000");
		document.form1.SAVAL.options[3] = new Option("300000");
		document.form1.SAVAL.options[4] = new Option("400000");
		document.form1.SAVAL.options[5] = new Option("500000");
	}
}

function selectSAvalueOnSearch()
{ 
    document.form1.SAVAL.value=document.form1.SAVALNAME.value;
}
	
function selectSAvalue()
{
    var w = document.form1.SAVAL.selectedIndex;
    document.form1.SA.value=document.form1.SAVAL.options[w].text;
    document.form1.SAVALNAME.value=document.form1.SAVAL.options[w].text;
}




//----------------------------------TOTAL INVESTMENT PLAN-------------------------------------


function blanfund_tip1()
{
if(document.form1.PMMF.value=="" || document.form1.PMMF.value==null)
		{
		document.form1.PMMF.value=0; 
		   
		} 
		if(document.form1.PCBF.value=="" || document.form1.PCBF.value==null)
		{
		document.form1.PCBF.value=0; 
		  
		} 
		 if(document.form1.PGF.value=="" || document.form1.PGF.value==null)
		{
		document.form1.PGF.value=0; 
		   
		} 
		 if(document.form1.PEF.value=="" || document.form1.PEF.value==null)
		{
		document.form1.PEF.value=0; 
		   
		} 
		if(document.form1.PPEF.value=="" || document.form1.PPEF.value==null)
		{
		document.form1.PPEF.value=0; 
		   
		} 
		 if(document.form1.PIF.value=="" || document.form1.PIF.value==null)
		{
		document.form1.PIF.value=0; 
		
		} 
		 if(document.form1.PENF.value=="" || document.form1.PENF.value==null)
		{
		document.form1.PENF.value=0; 
		   
		} 
		if(document.form1.PMDF.value=="" || document.form1.PMDF.value==null)
		{
		document.form1.PMDF.value=0; 
		 } 
} 


function checkFund_TIP1()
{   
   var cap_sec_fund=parseInt(document.form1.PMMF.value);
   var bal_fund=parseInt(document.form1.PGF.value);
   var growth_fund=parseInt(document.form1.PCBF.value);
   var equity_fund=parseInt(document.form1.PEF.value);
   var pure_fund = parseInt(document.form1.PPEF.value);
   var infra_fund = parseInt(document.form1.PIF.value);
   var energy_fund = parseInt(document.form1.PENF.value);
   var mid_fund = parseInt(document.form1.PMDF.value);
   var totalfund=parseInt(cap_sec_fund)+parseInt(bal_fund)+parseInt(growth_fund)+parseInt(equity_fund)+ parseInt(pure_fund) + parseInt(infra_fund) + parseInt(energy_fund) + parseInt(mid_fund);
   //Blank checks
  if(document.form1.txtName.value=="" || document.form1.txtName.value==null)
	{
  alert("Please enter your/Customer's  name");
  document.form1.txtName.focus();
  return false;
	}
	if(document.form1.txtAdvisor_code.value=="" || document.form1.txtAdvisor_code.value==null)
    {
        alert("Please enter Advisor/Employee Code");
        document.form1.txtAdvisor_code.focus();        
        return false;
    }
 if(document.form1.txtAdvisor.value=="" || document.form1.txtAdvisor.value==null)
	{
  alert("Please enter advisor's name");
  document.form1.txtAdvisor.focus();
  return false;
	}
 if(document.form1.Sex.selectedIndex==0)
	{
  alert("Please select your sex");
  document.form1.Sex.focus();
  return false;
	}
	if(document.form1.Pre_Pol_Pur.selectedIndex==0)
	{
  alert("Please select your Previous Policy Purchase");
  document.form1.Pre_Pol_Pur.focus();
  return false;
	}
	
 if(document.form1.PolicyP.selectedIndex==0)
	{
  alert("Please select policy purchase option");
  document.form1.PolicyP.focus();
  return false;
	}
 if(document.form1.Age.selectedIndex==0)
	{
  alert("Please select your Age");
  document.form1.Age.focus();
  return false;
	}
  if(document.form1.PREMIUM.value=="" || document.form1.PREMIUM.value==null)
	{
  alert("Please enter premium amount");
  document.form1.PREMIUM.focus();
  return false;
	}
 
 
  if(document.form1.SA.value==0 ||document.form1.SA.value=="" || document.form1.SA.value==null)
	{
  alert("Please enter your basic sum assured amount");
  document.form1.SA.focus();
  return false;
	}
 
   //end PREMIUM
//   if(totalfund!=100)
//   {
//    alert("The sum of proportion of all funds should be equal to 100%");
//    document.form1.PMMF.focus();
//    document.form1.PMMF.Select();
//    return false;
//   }
//   if(cap_sec_fund>40)
//   {
//    alert("Money Market Fund can not exceed 40%");
//    document.form1.PMMF.focus();
//    return false;
//   }
   var age=parseInt(document.form1.Age.value);
   if(age<41)
   {
	  if(document.form1.PREMIUM.value<25000)
		{
		alert("minimum Premium for this plan is 25,000.");
		document.form1.PREMIUM.focus();
		document.form1.PREMIUM.select();
		return false;
		}
	}
 if(age>40)
   {
	  if(document.form1.PREMIUM.value<50000)
		{
		alert("minimum Single Premium is 50,000.");
		document.form1.PREMIUM.focus();
		document.form1.PREMIUM.select();
		return false;
		}
 }
}
//---------------------------------------END--------------------------------------------------

//--------------------------total investment plan 2(pension)--------
function blankcheckfund_tip()
{
	   if(document.form1.PMMF.value=="" || document.form1.PMMF.value==null)
		{
		document.form1.PMMF.value=0; 
		} 
		if(document.form1.PGF.value=="" || document.form1.PGF.value==null)
		{
		document.form1.PGF.value=0; 
		} 
		 if(document.form1.PCBF.value=="" || document.form1.PCBF.value==null)
		{
		document.form1.PCBF.value=0; 
		   
		} 
		 if(document.form1.PEF.value=="" || document.form1.PEF.value==null)
		{
		document.form1.PEF.value=0; 
		} 
		if(document.form1.PPEF.value=="" || document.form1.PPEF.value==null)
		{
		document.form1.PPEF.value=0; 
		   
		} 
		 if(document.form1.PIF.value=="" || document.form1.PIF.value==null)
		{
		document.form1.PIF.value=0; 
		
		} 
		 if(document.form1.PENF.value=="" || document.form1.PENF.value==null)
		{
		document.form1.PENF.value=0; 
		} 
		if(document.form1.PMDF.value=="" || document.form1.PMDF.value==null)
		{
		document.form1.PMDF.value=0; 
		 } 
   
}
function checkFund_TIP()
{
   var cap_sec_fund=parseInt(document.form1.PMMF.value);
   var bal_fund=parseInt(document.form1.PGF.value);
   var growth_fund=parseInt(document.form1.PCBF.value);
   var equity_fund=parseInt(document.form1.PEF.value);
   var pure_fund = parseInt(document.form1.PPEF.value);
   var infra_fund = parseInt(document.form1.PIF.value);
   var energy_fund = parseInt(document.form1.PENF.value);
   var mid_fund = parseInt(document.form1.PMDF.value);
   var totalfund=parseInt(cap_sec_fund)+parseInt(bal_fund)+parseInt(growth_fund)+parseInt(equity_fund)+ parseInt(pure_fund) + parseInt(infra_fund) + parseInt(energy_fund) + parseInt(mid_fund);
   //Blank checks
   if(document.form1.txtName.value=="" || document.form1.txtName.value==null)
 {
  alert("Please enter your/Customer's  name");
  document.form1.txtName.focus();
  return false;
 }
 if(document.form1.txtAdvisor_code.value=="" || document.form1.txtAdvisor_code.value==null)
    {
        alert("Please enter Advisor/Employee Code");
        document.form1.txtAdvisor_code.focus();        
        return false;
    }
 if(document.form1.txtAdvisor.value=="" || document.form1.txtAdvisor.value==null)
 {
  alert("Please enter advisor's name");
  document.form1.txtAdvisor.focus();
  return false;
 }
 if(document.form1.Sex.selectedIndex==0)
 {
  alert("Please select Your sex");
  document.form1.Sex.focus();
  return false;
 }
 if(document.form1.Pre_Pol_Pur.selectedIndex==0)
	{
  alert("Please select your Previous Policy Purchase");
  document.form1.Pre_Pol_Pur.focus();
  return false;
	}
 if(document.form1.PolicyP.selectedIndex==0)
 {
  alert("Please select policy purchase");
  document.form1.PolicyP.focus();
  return false;
 }
  if(document.form1.Age.selectedIndex==0)
 {
  alert("Please select Your Age");
  document.form1.Age.focus();
  return false;
 }
  if(document.form1.PREMIUM.value=="" || document.form1.PREMIUM.value==null)
 {
  alert("Please enter premium amount");
  document.form1.PREMIUM.focus();
  return false;
 }

   //end PREMIUM
//   if(totalfund!=100)
//   {
//    alert("The sum of proportion of all funds should be equal to 100%");
//    document.form1.PMMF.focus();
//     document.form1.PMMF.select();
//    return false;
//   }
//   if(cap_sec_fund>40)
//   {
//    alert("Money Market Fund can not exceed 40%");
//    document.form1.PMMF.focus();
//    document.form1.PMMF.select();
//    return false;
//   }
////////   if(document.form1.PREMIUM.value<25000)
//////// {
////////  alert("minimum Installment Premium should be 25000.");
////////  document.form1.PREMIUM.focus();
////////  return false;
//////// }
   
   
}
//------------------end--------------------------------------------


//---------------------------super investment plan---------------------

//---------------------------super investment plan---------------------
function cal_summ_assured1()
{
  var val;
	document.form1.A_Prem.readOnly = true;
	document.form1.PPTerm.readOnly = true;
//    document.form1.A_Prem.disabled = true;
//    document.form1.PPTerm.readOnly = true;
   var amt_inst_pre = document.form1.PREMIUM.value;
   if ( document.form1.Mode.value == "Select" ){val = 0;};
   if ( document.form1.Mode.value == "Yearly" ){val = 1;};
   if ( document.form1.Mode.value == "Half Yearly" ){val = 2;};
   if ( document.form1.Mode.value == "Quarterly" ){val = 4;};
   if ( document.form1.Mode.value == "Monthly" ){val = 12;};
   
   if(val=="" || amt_inst_pre=="" || val==0)
   {
		document.form1.A_Prem.value="";
   }
   else if (document.form1.Mode.value != "Select")
   {
	   document.form1.A_Prem.value = (amt_inst_pre) * (val);
	   if(document.form1.A_Prem.value < 10000  &&  (val== "1" || val == "2"))
	   {
		document.form1.SA.value = 5 * document.form1.A_Prem.value;
		document.form1.SA.readOnly = true;
		document.form1.A_Prem.readOnly = true;		
	   }
	   else
	   {
		document.form1.SA.readOnly = false;
	   }
 }
}

//////function cal_summ_assured1()
//////{
//////document.form1.A_Prem.readOnly = true;
//////document.form1.PPTerm.readOnly = true;
//////  var val;
//////   var amt_inst_pre = document.form1.PREMIUM.value;
//////   if ( document.form1.Mode.value == "Select" ){val = 0;};
//////   if ( document.form1.Mode.value == "Yearly" ){val = 1;};
//////   if ( document.form1.Mode.value == "Half Yearly" ){val = 2;};
//////   if ( document.form1.Mode.value == "Quarterly" ){val = 4;};
//////   if ( document.form1.Mode.value == "Monthly" ){val = 12;};
//////   
//////   if(val=="" || amt_inst_pre=="" || val==0)
//////   {
//////        document.form1.A_Prem.readOnly=true;
//////   		document.form1.A_Prem.value="";
//////   }
//////   else if(document.form1.Mode.value != "Select")
//////   {
//////   alert('select');
//////        document.form1.A_Prem.readOnly=true;
//////        document.form1.SA.readOnly = false;               
//////	    document.form1.A_Prem.value = parseInt(amt_inst_pre) * parseInt(val);
//////	   
//////	  
////////	    if(document.form1.A_Prem.value < 10000  &&  (val== "1" || val == "2"))
////////	   {
////////	   	document.form1.SA.value = 5 * document.form1.A_Prem.value;
////////		document.form1.SA.readOnly = true;
////////		document.form1.A_Prem.readOnly = true;
////////		
////////	   }
////////	   else
////////	   {
////////	   	document.form1.SA.readOnly = false;
////////	   }
////// }
//////}

function chktermRidersuperinv1()
	{   
	 if(document.form1.chkTermliferider.checked==true)
	   {      
	   document.form1.TLRAGE.readOnly =false;
	   document.form1.TLRTERM.readOnly =false;
	   document.form1.TLRSA.readOnly =false;
	   document.form1.TLRAGE.disabled =false;
	   document.form1.TLRTERM.disabled =false;
	   document.form1.TLRSA.disabled =false;
	   }
	   else if(document.form1.chkTermliferider.checked==false)
	   {
	   document.form1.TLRAGE.readOnly =true;
	   document.form1.TLRTERM.readOnly =true;
	   document.form1.TLRSA.readOnly =true;
	   document.form1.TLRAGE.disabled =true;
	   document.form1.TLRTERM.disabled =true;
	   document.form1.TLRSA.disabled =true; 
	   document.form1.TLRAGE.value =0;
	   document.form1.TLRTERM.value =0;
	   document.form1.TLRSA.value =0; 
	   }
	}
	function chktermRidermsbSpInvAss()
	{
	 if(document.form1.chkmajor.checked==true)
	   {
	   document.form1.MSBAGE.readOnly =false;
	   document.form1.MSBTERM.readOnly =false;
	   document.form1.MSBSA.readOnly =false;
		 document.form1.MSBAGE.disabled =false;
	   document.form1.MSBTERM.disabled =false;
	   document.form1.MSBSA.disabled =false;
	   }
	   else if(document.form1.chkmajor.checked==false)
	   {
	   document.form1.MSBAGE.readOnly =true;
	   document.form1.MSBTERM.readOnly =true;
	   document.form1.MSBSA.readOnly =true; 
	   document.form1.MSBAGE.disabled =true;
	   document.form1.MSBTERM.disabled =true;
	   document.form1.MSBSA.disabled =true; 
	   document.form1.MSBAGE.value =0;
	   document.form1.MSBTERM.value =0;
	   document.form1.MSBSA.value =0; 
	   }
	}
//------------------end--------------------------------------------

//----Clear all text box value---
function clear()
 {
  var forminput=document.form1.getElementsByTagName('input');
   for(var i=0;i<forminput.length;i++)
	{
	  var input=forminput[i];
	   if(input.type=='text') 
		 {
		  alert(input.value);
		 }
	}
 }
//-----------------end--------------
//-----------------Super Investment Plan


function chktermRidersuperinv()
	{
	 if(document.form1.chkTermliferider.checked==true)
	   {
	   document.form1.TLRAGE.readOnly =false;
	   document.form1.TLRTERM.readOnly =false;
	   document.form1.TLRSA.readOnly =false;
	   document.form1.TLRAGE.disabled =false;
	   document.form1.TLRTERM.disabled =false;
	   document.form1.TLRSA.disabled =false;
	   }
	   else if(document.form1.chkTermliferider.checked==false)
	   {
	   document.form1.TLRAGE.readOnly =true;
	   document.form1.TLRTERM.readOnly =true;
	   document.form1.TLRSA.readOnly =true; 
	   document.form1.TLRAGE.disabled =true;
	   document.form1.TLRTERM.disabled =true;
	   document.form1.TLRSA.disabled =true; 
		document.form1.TLRAGE.value =0;
	   document.form1.TLRTERM.value =0;
	   document.form1.TLRSA.value =0; 
	   }
	}
	function chktermRidermsb()
	{
	 if(document.form1.chkmajor.checked==true)
	   {
	   document.form1.MSBAGE.readOnly =false;
	   document.form1.MSBTERM.readOnly =false;
	   document.form1.MSBSA.readOnly =false;
	   document.form1.MSBAGE.disabled =false;
	   document.form1.MSBTERM.disabled =false;
	   document.form1.MSBSA.disabled =false;
		}
	   else if(document.form1.chkmajor.checked==false)
	   {
	   document.form1.MSBAGE.readOnly =true;
	   document.form1.MSBTERM.readOnly =true;
	   document.form1.MSBSA.readOnly =true; 
	   document.form1.MSBAGE.disabled =true;
	   document.form1.MSBTERM.disabled =true;
	   document.form1.MSBSA.disabled =true; 
		document.form1.MSBAGE.value =0;
	   document.form1.MSBTERM.value =0;
	   document.form1.MSBSA.value =0; 
	   }
	}
//------------------end--------------------------------------------
//----------------money return----------------------
function money_return()
{
   var cap_sec_fund=parseInt(document.form1.PCSF.value);
   var bal_fund=parseInt(document.form1.PBF.value);
   var growth_fund=parseInt(document.form1.PGF.value);
   var equity_fund=parseInt(document.form1.PEF.value);
   var pure_fund = parseInt(document.form1.PPEF.value);
   var infra_fund = parseInt(document.form1.PIF.value);
   var energy_fund = parseInt(document.form1.PENF.value);
   var mid_fund = parseInt(document.form1.PMDF.value);
   var totalfund=parseInt(cap_sec_fund)+parseInt(bal_fund)+parseInt(growth_fund)+parseInt(equity_fund)+ parseInt(pure_fund) + parseInt(infra_fund) + parseInt(energy_fund) + parseInt(mid_fund);
   //Blank checks
   if(document.form1.txtName.value=="" || document.form1.txtName.value==null)
 {
  alert("Please enter your/Customer's  name");
  document.form1.txtName.focus();
  return false;
 }
 if(document.form1.txtAdvisor.value=="" || document.form1.txtAdvisor.value==null)
 {
  alert("Please enter advisor's name");
  document.form1.txtAdvisor.focus();
  return false;
 }
 if(document.form1.Sex.selectedIndex==0)
 {
  alert("Please select Your sex");
  document.form1.Sex.focus();
  return false;
 }
  if(document.form1.Age.selectedIndex==0)
 {
  alert("Please select Basic Age");
  document.form1.Age.focus();
  return false;
 }
 if(document.form1.Mode.selectedIndex==0 & document.form1.MODETYPE.selectedIndex==0)
 {
  alert("Please select your Premium Payment  Mode");
  document.form1.Mode.focus();
  return false;
 }
  if(document.form1.PREMIUM.value=="" || document.form1.PREMIUM.value==null || document.form1.PREMIUM.value===0)
 {
  alert("Please enter premium amount");
  document.form1.PREMIUM.focus();
  return false;
 }
  if(document.form1.SA.value==0)
 {
  alert("Please select Basic Sum Assured");
  document.form1.SA.focus();
  return false;
 }

   //end PREMIUM
	 if(cap_sec_fund>40)
   {
	alert("Money Market Fund can not exceed 40%");
	document.form1.PCSF.focus();
	return false;
   }
//    if(totalfund!=100)
//   {
//    alert("The sum of proportion of all funds should be equal to 100%");
//    document.form1.PCSF.focus();
//    return false;
//   }
   
   if(document.form1.chkaccidentrider.checked==true)
	   {
		var age=parseFloat(document.form1.ADBRAGE.value);
		var termr=parseFloat(document.form1.ADBRTERM.value);
		var baseval=parseFloat(document.form1.Term.value);
		var asa=parseFloat(document.form1.ADBRSA.value);
		 if(age==0)
		 {
		  alert("Please enter Reliance Accidental Death  and Total & Permanent  Disablement Rider Age");
		  document.form1.ADBRAGE.focus();
		   document.form1.ADBRAGE.select();
		  return false;
		 }
		 if(age<18 || age>60)
		   {
			alert("Invalid Rider Age.Please enter Reliance Accidental Death  and Total & Permanent  Disablement Rider Age between 18 and 60");
			document.form1.ADBRAGE.focus();
			document.form1.ADBRAGE.select();
			return false;
		   } 
		   //term nd sa
		  if(termr==0)
		   {
			alert("Please enter Reliance Accidental Death  and Total & Permanent  Disablement Rider Term");
			document.form1.ADBRTERM.focus();
			document.form1.ADBRTERM.select();
			return false;
			}
			 if(asa==0)
		   {
			alert("Please enter Reliance Accidental Death  and Total & Permanent  Disablement Rider sum assured");
			document.form1.ADBRSA.focus();
			document.form1.ADBRSA.select();
			return false;
			}
		if(asa<25000 || asa>5000000)
		 {
		  alert("Please enter Reliance Accidental Death  and Total & Permanent  Disablement Rider minimum  Sum Assured is Rs. 25,000 and maximum  Sum Assured is 5,00,0000");
		  document.form1.ADBRSA.focus();
		  document.form1.ADBRSA.select();
		  return false;
		 }
	  }
}

//----------------------------single premium---------------------------
function checknull()
{
  if(document.form1.txtName.value=="" || document.form1.txtName.value==null)
	  {
	  alert("Please enter your/Customer's  name");
	  document.form1.txtName.focus();
	  return false;
	  }
	  if(document.form1.txtAdvisor.value=="" || document.form1.txtAdvisor.value==null)
	  {
	   alert("Please enter advisor's name");
	   document.form1.txtAdvisor.focus();
	   return false;
	  }
	  
	  if (document.form1.Age.selectedIndex==0)
		{
		  alert("Please select Your Age");
		  document.form1.Age.focus();
		  return false;
		}
	 
	  if(document.form1.Term.value=="" || document.form1.Term.value==null)
	  {
	   alert("Please enter Term");
	   document.form1.Term.focus();
	   return false;
	  }
	  if(document.form1.PREMIUM.value=="" || document.form1.PREMIUM.value==null)
	  {
	   alert("Please enter Premium");
	   document.form1.PREMIUM.focus();
	   return false;
	  }
	   if(document.form1.Term.value < 5 || document.form1.Term.value > 45)
	  {
	   alert("Please Enter Valid Term  Note: minimum :5 Years;Or upto age 45 year; If later:maximum:upto age 70 Years");
	   document.form1.Term.focus();
	   return false;
	  }
	   if(document.form1.PREMIUM.value <10000)
	  {
	   alert("Single Premium can not be less than 10000.");
	   document.form1.PREMIUM.focus();
	   return false;
	  }
}
//*********************************************************************************************8



function checkleapyear(datea)
{
///sanjeev new date
var startyear = "1950";
var endyear = "2010";
var dat = new Date();

var curday = dat.getDate();
var curmon = dat.getMonth()+1;
var curyear = dat.getFullYear();
if(datea.getYear()%4 == 0)
{
if(datea.getYear()% 10 != 0)
{
return true;
}
else
{
if(datea.getYear()% 400 == 0)
return true;
else
return false;
}
}
return false;
}
function DaysInMonth(Y, M) {
with (new Date(Y, M, 1, 12)) {
setDate(0);
return getDate();
}
}
function datediff(date1, date2) {
var y1 = date1.getFullYear(), m1 = date1.getMonth(), d1 = date1.getDate(),
y2 = date2.getFullYear(), m2 = date2.getMonth(), d2 = date2.getDate();

if (d1 < d2) {
m1--;
d1 += DaysInMonth(y2, m2);
}
if (m1 < m2) {
y1--;
m1 += 12;
}
return [y1 - y2, m1 - m2, d1 - d2];
}

function calage(YR,MN,DD)
{
	var dat = new Date();
var calday = DD;
var curmon = dat.getMonth()+1;
var curyear = dat.getFullYear();
var calmon = MN;
var calyear= YR;
var curday = dat.getDate();
//alert(DD+MN+YR);
if(curday == "" || curmon=="" || curyear=="" || calday=="" || calmon=="" || calyear=="")
{
}
else
{
var curd = new Date(curyear,curmon-1,curday);
var cald = new Date(calyear,calmon-1,calday);

var diff = Date.UTC(curyear,curmon,curday,0,0,0) - Date.UTC(calyear,calmon,calday,0,0,0);

var dife = datediff(curd,cald);
//alert(dife[0]);
return dife[0];
}
}

//**********************************************************************************************

//++++++++++++++++++++++++++++++++++++++++++AIP+++++++++++++++++++++++++++++++++++++++++
function checkFundAIP()
{
   var cap_sec_fund=parseInt(document.form1.PMMF.value);
   var bal_fund=parseInt(document.form1.PGF.value);
   var growth_fund=parseInt(document.form1.PCBF.value);
   var equity_fund=parseInt(document.form1.PEF.value);
   var pure_fund = parseInt(document.form1.PPEF.value);
   var infra_fund = document.form1.PIF.value;
   var energy_fund = document.form1.PENF.value;
   var mid_fund = document.form1.PMDF.value;
   var txtname=document.form1.txtName.value;
   var prm=document.form1.PREMIUM.value;
   var trm=document.form1.TERM.value;
   var sex1=document.form1.Sex.selectedIndex;
 //  var mode=document.form1.Mode.value;
	 
   var totalfund=parseInt(cap_sec_fund)+parseInt(bal_fund)+parseInt(growth_fund)+parseInt(equity_fund)+ parseInt(pure_fund) + parseInt(infra_fund) + parseInt(energy_fund) + parseInt(mid_fund);
	   if(txtname=="" || txtname==null)
		{
		 alert("Please enter your/Customer's  name");
		 document.form1.txtName.focus();
		 return false;
		}
		if(document.form1.txtAdvisor.value=="" || document.form1.txtAdvisor.value==null)
		{
		 alert("Please enter advisor's name");
		 document.form1.txtAdvisor.focus();
		 return false;
		}
		if(document.form1.Sex.selectedIndex<1)
		 {
		  alert("Please select sex");
		  document.form1.Sex.focus();
		  return false;
		 }
		 if(document.form1.AGE.selectedIndex<1)
		 {
		  alert("Please select Your Age");
		  document.form1.AGE.focus();
		  return false;
		 }
		  if(document.form1.TERM.value=="")
		{
		 alert("Please Enter Basic Term");
		 document.form1.TERM.focus();
		 return false;
		}
		 if(document.form1.PREMIUM.value=="" ||document.form1.PREMIUM.value==0)
		 {
		  alert("Please enter Premium");
		  document.form1.PREMIUM.focus();
		  return false;
		 }
		if(document.form1.SA.value=="" ||document.form1.SA.value==0)
		 {
		  alert("Please enter Basic sum assured");
		  document.form1.SA.focus();
		  return false;
		 } 
		  if(document.form1.FUNDNAME.selectedIndex<1)
		{
		 alert("Enter Fund Name");
		 document.form1.FUNDNAME.focus();
		 return false;
		} 
	   if(document.form1.TERM.value<10)
		{
		 alert("Premium Paying Term should be greater than or equal to 10");
		 document.form1.TERM.focus();
		 return false;
		}
		//  if(document.form1.SA.value<document.form1.PREMIUM.value)
	   // {
		// alert("Basic Plan Sum Assured should be greater than or equal to Premium");
		// document.form1.PREMIUM.focus();
		// return false;
	   // }
////////        if(document.form1.FUNDNAME.value=="Tailor Made")
////////        {
////////       if(cap_sec_fund > 40)
////////       {
////////         alert("maximum proption of Money market fund is 40%");
////////	     document.form1.PMMF.focus();
////////	    return false;
////////       }
////////       if(totalfund!=100)
////////       {
////////  	     alert("The sum of proportion of all funds should be equal to 100%");
////////  	    document.form1.PMMF.focus();
////////	    return false;
////////       }
////////     //  return true;
////////      }
	   
		if(document.form1.chkaccidentrid.checked==true)
	   {
		var age=parseFloat(document.form1.ADBAGE.value);
		var termr=parseFloat(document.form1.ADBTERM.value);
		var baseval=parseFloat(document.form1.TERM.value);
		var asa=parseFloat(document.form1.ADBSA.value);
	  
		 if(age==0)
		 {
		  alert("Please enter Reliance Accidental Death  and Total & Permanent  Disablement Rider Age");
		  document.form1.ADBAGE.focus();
		   document.form1.ADBAGE.select();
		  return false;
		 }
		 if(age<18 || age>60)
		   {
			alert("Invalid Rider Age.Please enter Reliance Accidental Death  and Total & Permanent  Disablement Rider Age between 18 and 60");
			document.form1.ADBAGE.focus();
			document.form1.ADBAGE.select();
			return false;
		   } 
		   //term nd sa
		  if(termr==0)
		   {
			alert("Please enter Reliance Accidental Death  and Total & Permanent  Disablement Rider Term");
			document.form1.ADBTERM.focus();
			document.form1.ADBTERM.select();
			return false;
			}
			 if(asa==0)
		   {
			alert("Please enter Reliance Accidental Death  and Total & Permanent  Disablement Rider sum assured");
			document.form1.ADBAGE.focus();
			document.form1.ADBSA.select();
			return false;
			}
		  if(document.form1.AGE.value >document.form1.ADBAGE.value)
		 {
		  alert("Age for Accidental Death and Accidental Total and Permanent Disability Rider should be greater than or equal to Base age.");
		  document.form1.ADBAGE.focus();
		  document.form1.ADBAGE.select();
		  return false;
		 }
		   if(age<18 || age>60)
		 {
		  alert("age for Accidental Death and Total and Permanent Disablement Rider should be between 18 and 60 years.");
		  document.form1.ADBAGE.focus();
		  document.form1.ADBAGE.select();
		  return false;
		 }  
		   if(termr=="" || termr==0)
		 {
		  alert("Please enter minimum term for  Accidental Death and Total and permanent disablement rider is 5 and maximum is 30");
		  document.form1.ADBTERM.focus();
		  document.form1.ADBTERM.select();
		  return false;
		 }  
		   if(document.form1.ADBTERM.value>document.form1.TERM.value )
		 {
		  alert("Term for Accidental Death and total and permanent Disablity rider  should not exceed base policy Term.");
		  document.form1.ADBTERM.focus();
		  document.form1.ADBTERM.select();
		  return false;
		 }  
		if(asa<25000 || asa>5000000)
		 {
		  alert("Please enter Reliance Accidental Death  and Total & Permanent  Disablement Rider minimum  Sum Assured is Rs. 25,000 and maximum  Sum Assured is 5,00,0000");
		  document.form1.ADBSA.focus();
		  document.form1.ADBSA.select();
		  return false;
		 }
		  if(document.form1.ADBSA.value > document.form1.SA.value )
		 {
		  alert("Sum assuerd for Accidental Death and Accidental Total and Permanent Disability Rider  should not be greater than Basic Plan Sum Assured.");
		  document.form1.ADBSA.focus();
		  document.form1.ADBSA.select();
		  return false;
		 }
	  }
	  
	  
	  if(document.form1.chkTermliferider.checked==true)
	   {
		var age=parseFloat(document.form1.TRAGE.value);
		var termr=parseFloat(document.form1.TRTERM.value);
		var baseval=parseFloat(document.form1.TERM.value);
		var asa=parseFloat(document.form1.TRSA.value);
		 if(age==0)
		 {
		  alert("Please enter the age for Reliance Term Life Insurance Benefit Rider");
		  document.form1.TRAGE.focus();
		  document.form1.TRAGE.select();
		  return false;
		 }
		  if(document.form1.TRAGE.value=="" ||document.form1.TRAGE.value==null )
		 {
		  alert("Please enter the age for Reliance Term Life Insurance Benefit Rider");
		  document.form1.TRAGE.focus();
		  document.form1.TRAGE.select();
		  return false;
		 }
		 if(age<18 || age>60)
		   {
			alert("Invalid Rider Age.Please enter Reliance Term Life Insurance Benefit Rider Age between 18 and 60");
			document.form1.TRAGE.focus();
			document.form1.TRAGE.select();
			return false;
		   } 
		   //term nd sa
		  if(termr==0)
		   {
			alert("Please enter Reliance Term Life Insurance Benefit Rider  Term");
			document.form1.TRTERM.focus();
			document.form1.TRTERM.select();
			return false;
			}
			 if(asa==0)
		   {
			alert("Please enter Reliance Term Life Insurance Benefit Rider sum assured");
			document.form1.TRSA.focus();
			document.form1.TRSA.select();
			return false;
			}
		  if(document.form1.AGE.value >document.form1.TRAGE.value)
		 {
		  alert("Age for Reliance Term Life Insurance Benefit Rider  should be greater than or equal to Base age.");
		  document.form1.TRAGE.focus();
		  document.form1.TRAGE.select();
		  return false;
		 }
		   if(termr<5 || termr>30)
		 {
		  alert("minimum term for Reliance Term Life Insurance Benefit Rider  is 5 and maximum is 30");
		  document.form1.TRTERM.focus();
		  document.form1.TRTERM.select();
		  return false;
		 }  
		   if(termr=="" || termr==0)
		 {
		  alert("Please enter minimum term for  Reliance Term Life Insurance Benefit Rider  is 5 and maximum is 30");
		  document.form1.TRTERM.focus();
		  document.form1.TRTERM.select();
		  return false;
		 }  
		   if(document.form1.TRTERM.value>document.form1.TERM.value )
		 {
		  alert("Term for  Reliance Term Life Insurance Benefit Rider should not exceed base policy Term.");
		  document.form1.TRTERM.focus();
		  document.form1.TRTERM.select();
		  return false;
		 }  
		if(asa<25000)
		 {
		  alert("Term life insurance benefit Rider Sum Assured should be greater than or equal to  25000");
		  document.form1.TRSA.focus();
		  document.form1.TRSA.select();
		  return false;
		 }
		  if(asa<25000)
		 {
		  alert("Term life insurance benefit Rider Sum Assured should be greater than or equal to  25000");
		  document.form1.TRSA.focus();
		  document.form1.TRSA.select();
		  return false;
		 }
		  if(document.form1.TRSA.value > document.form1.SA.value )
		 {
		  alert("Sum assuerd for Term Life  Inssurance  benifit Rider should not be greater than Basic Plan Sum Assured.");
		  document.form1.TRSA.focus();
		  document.form1.TRSA.select();
		  return false;
		 }
	  } 
}

function blankfundforAIP()
{
	   if(document.form1.PMMF.value=="" || document.form1.PMMF.value==null)
		{
		document.form1.PMMF.value=0; 
		   
		} 
		if(document.form1.PGF.value=="" || document.form1.PGF.value==null)
		{
		document.form1.PGF.value=0; 
		  
		} 
		 if(document.form1.PCBF.value=="" || document.form1.PCBF.value==null)
		{
		document.form1.PCBF.value=0; 
		   
		} 
		 if(document.form1.PEF.value=="" || document.form1.PEF.value==null)
		{
		document.form1.PEF.value=0; 
		   
		} 
		if(document.form1.PPEF.value=="" || document.form1.PPEF.value==null)
		{
		document.form1.PPEF.value=0; 
		   
		} 
		 if(document.form1.PIF.value=="" || document.form1.PIF.value==null)
		{
		document.form1.PIF.value=0; 
		
		} 
		 if(document.form1.PENF.value=="" || document.form1.PENF.value==null)
		{
		document.form1.PENF.value=0; 
		   
		} 
		if(document.form1.PMDF.value=="" || document.form1.PMDF.value==null)
		{
		document.form1.PMDF.value=0; 
		 } 
   
}

function cal_summ_assured11()
{
  var val;
   var amt_inst_pre = document.form1.PREMIUM.value;
   if ( document.form1.MODE.value == "" ){val = 0;};
   if ( document.form1.MODE.value == "Yearly" ){val = 1;};
   if ( document.form1.MODE.value == "Half Yearly" ){val = 2;};
   if ( document.form1.MODE.value == "Quarterly" ){val = 4;};
   if ( document.form1.MODE.value == "Monthly" ){val = 12;};
   
   if(val=="" || amt_inst_pre=="")
   {
		document.form1.A_Prem.value=0;
   }
   else
   {
  // alert(val);
	   document.form1.A_Prem.value = (amt_inst_pre) * (val);
		 // document.form1.A_Prem.disabled = true
   }

}
function selectchange()
{
    if (document.form1.FUNDNAME.value == "Ready Made")
    {
        document.getElementById("tblfund").style.visibility = "hidden"
        document.getElementById("tblrider").style.visibility = "visible" 
        document.getElementById("tblfund").style.display="none"
    }
    else if (document.form1.FUNDNAME.value == "Tailor Made")
    {
        document.getElementById("tblfund").style.visibility = "visible"
        document.getElementById("tblrider").style.visibility = "visible" 
        document.getElementById("tblfund").style.display="block"
    }
}
function selectchangeForSING()
{
 if (document.form1.PLANNAME.value == "Ready Made")
		{
		   document.getElementById("tblfund").style.visibility = "hidden"
		   document.getElementById("tblfund").style.display="none"
		}
		else if (document.form1.PLANNAME.value == "Tailor Made")
		{
			 document.getElementById("tblfund").style.visibility = "visible"
			 document.getElementById("tblfund").style.display="block"
		}
}



function cal_pptAIP(evt)
{
document.form1.PPTerm.value=document.form1.TERM.value;
} 
function chkAgeRidertermAIP()
	{
	 if(document.form1.chkaccidentrid.checked==true)
	   {
	   document.form1.ADBAGE.readOnly =false;
	   document.form1.ADBTERM.readOnly =false;
	   document.form1.ADBSA.readOnly =false;
	 
	   }
	   else if(document.form1.chkaccidentrid.checked==false)
	   {
	   document.form1.ADBAGE.readOnly =true;
	   document.form1.ADBTERM.readOnly =true;
	   document.form1.ADBSA.readOnly =true; 
		document.form1.ADBAGE.value =0;
	   document.form1.ADBTERM.value =0;
	   document.form1.ADBSA.value =0; 
	   }
	   if(document.form1.chkTermliferider.checked==true)
	   {
	   document.form1.TRAGE.readOnly =false;
	   document.form1.TRTERM.readOnly =false;
	   document.form1.TRSA.readOnly =false;
	
	   }
	   else if(document.form1.chkTermliferider.checked==false)
	   {
	   document.form1.TRAGE.readOnly =true;
	   document.form1.TRTERM.readOnly =true;
	   document.form1.TRSA.readOnly =true; 
		document.form1.TRAGE.value =0;
	   document.form1.TRTERM.value =0;
	   document.form1.TRSA.value =0; 
	   }
	}
	
  function checkFundAIPsingl()
{
   var cap_sec_fund=parseInt(document.form1.PMMF.value);
   var bal_fund=parseInt(document.form1.PGF.value);
   var growth_fund=parseInt(document.form1.PCBF.value);
   var equity_fund=parseInt(document.form1.PEF.value);
   var pure_fund = parseInt(document.form1.PPEF.value);
   var infra_fund = document.form1.PIF.value;
   var energy_fund = document.form1.PENF.value;
   var mid_fund = document.form1.PMDF.value;
   var txtname=document.form1.txtName.value;
   var prm=document.form1.PREMIUM.value;
   var trm=document.form1.TERM.value;
   var sex1=document.form1.Sex.selectedIndex;
 //  var mode=document.form1.Mode.value;
	 
   var totalfund=parseInt(cap_sec_fund)+parseInt(bal_fund)+parseInt(growth_fund)+parseInt(equity_fund)+ parseInt(pure_fund) + parseInt(infra_fund) + parseInt(energy_fund) + parseInt(mid_fund);
	   if(txtname=="" || txtname==null)
		{
		 alert("Please enter your/Customer's  name");
		 document.form1.txtName.focus();
		 return false;
		}
		if(document.form1.txtAdvisor.value=="" || document.form1.txtAdvisor.value==null)
		{
		 alert("Please enter advisor's name");
		 document.form1.txtAdvisor.focus();
		 return false;
		}
		if(document.form1.Sex.selectedIndex<1)
		 {
		  alert("Please select Your sex");
		  document.form1.Sex.focus();
		  return false;
		 }
		 if(document.form1.AGE.selectedIndex<1)
		 {
		  alert("Please select Your Age");
		  document.form1.Age.focus();
		  return false;
		 }
		  if(document.form1.TERM.value=="")
		{
		 alert("Please Enter Basic Term");
		 document.form1.TERM.focus();
		 return false;
		}
		 if(document.form1.PREMIUM.value=="" ||document.form1.PREMIUM.value==0)
		 {
		  alert("Please enter Amount of Single Premium");
		  document.form1.PREMIUM.focus();
		  return false;
		 }
		if(document.form1.SA.value=="" ||document.form1.SA.value==0)
		 {
		  alert("Please enter sum assured");
		  document.form1.SA.focus();
		  return false;
		 }  
	   if(document.form1.TERM.value<10)
		{
		 alert("Premium Paying Term should be greater than or equal to 10");
		 document.form1.TERM.focus();
		 return false;
		}
		if(document.form1.PREMIUM.value<10)
		{
		 alert("Amount Of single Premium should be greater then or equal to 25000");
		 document.form1.PREMIUM.focus();
		 return false;
		}
		  if(document.form1.SA.value<document.form1.PREMIUM.value)
		{
		 alert("Basic Plan Sum Assured should be greater than or equal to Premium");
		 document.form1.PREMIUM.focus();
		 return false;
		}
		  if(document.form1.PLANNAME.selectedIndex<0)
		{
		 alert("Enter Fund Name");
		 document.form1.PLANNAME.focus();
		 return false;
		}
////////        if(document.form1.PLANNAME.value=="Tailor Made")
////////        {
////////       if(cap_sec_fund > 40)
////////       {
////////         alert("Capital Secure Fund can not exceed 40%");
////////	     document.form1.PMMF.focus();
////////	    return false;
////////       }
////////       if(totalfund!=100)
////////       {
////////  	     alert("The sum of proportion of all funds should be equal to 100%");
////////  	    document.form1.PMMF.focus();
////////	    return false;
////////       }
////////       }
	   return true;
	  }
//++++++++++++++++++++++++++++++++++++++++++AIP ENd++++++++++++++++++++++++++++++++++++

//++++++++++++++++++++++++++++++++++++++++health wealth+++++++++++++++++++++++++++++++++++
function showhidefund()
{
 //document.form1.txtQuotationNo.disabled=true;
	   if (document.form1.FUNDNAME.value == "Tailor Made")
		{
		 document.getElementById("fund1").style.visibility = "visible"
		 document.getElementById("fund2").style.visibility = "visible"
		 document.getElementById("fund3").style.visibility = "visible"
		 document.getElementById("fund4").style.visibility = "visible"
		 document.getElementById("fund5").style.visibility = "visible"
		 document.getElementById("fund6").style.visibility = "visible"
		 document.getElementById("fund7").style.visibility = "visible"
		 document.getElementById("fund8").style.visibility = "visible"
		
		 document.getElementById("fund1").style.display="block"
		 document.getElementById("fund2").style.display="block"
		 document.getElementById("fund3").style.display="block"
		 document.getElementById("fund4").style.display="block"
		 document.getElementById("fund5").style.display="block"
		 document.getElementById("fund6").style.display="block"
		 document.getElementById("fund7").style.display="block"
		 document.getElementById("fund8").style.display="block"
		 
		  document.getElementById("PGF").value="0";
            document.getElementById("PMMF").value="0";
            document.getElementById("PCBF").value="0";
            document.getElementById("PEF").value="0";
            document.getElementById("PPEF").value="0";
            document.getElementById("PIF").value="0";
            document.getElementById("PENF").value="0";
            document.getElementById("PMDF").value="0"; 
		 
		}
		else
		{
		    document.getElementById("PGF").value="0";
            document.getElementById("PMMF").value="0";
            document.getElementById("PCBF").value="0";
            document.getElementById("PEF").value="0";
            document.getElementById("PPEF").value="0";
            document.getElementById("PIF").value="0";
            document.getElementById("PENF").value="0";
            document.getElementById("PMDF").value="0";  
            
		  document.getElementById("fund1").style.visibility = "hidden"
		  document.getElementById("fund2").style.visibility = "hidden"
		  document.getElementById("fund3").style.visibility = "hidden"
		  document.getElementById("fund4").style.visibility = "hidden"
		  document.getElementById("fund5").style.visibility = "hidden"
		  document.getElementById("fund6").style.visibility = "hidden"
		  document.getElementById("fund7").style.visibility = "hidden"
		  document.getElementById("fund8").style.visibility = "hidden"
		  
		  document.getElementById("fund1").style.display="none"
		   document.getElementById("fund2").style.display="none"
			document.getElementById("fund3").style.display="none"
			 document.getElementById("fund4").style.display="none"
			  document.getElementById("fund5").style.display="none"
			   document.getElementById("fund6").style.display="none"
			   document.getElementById("fund7").style.display="none"
			   document.getElementById("fund8").style.display="none"	   
			  
			   
		}
		//document.form1.txtQuotationDate.readOnly =true;
}

function showhidefundonLoad()
{
//document.form1.txtQuotationNo.disabled=true;
	   if (document.form1.FUNDNAME.value == "Tailor Made")
		{
		 document.getElementById("fund1").style.visibility = "visible"
		 document.getElementById("fund2").style.visibility = "visible"
		 document.getElementById("fund3").style.visibility = "visible"
		 document.getElementById("fund4").style.visibility = "visible"
		 document.getElementById("fund5").style.visibility = "visible"
		 document.getElementById("fund6").style.visibility = "visible"
		 document.getElementById("fund7").style.visibility = "visible"
		 document.getElementById("fund8").style.visibility = "visible"
		
		 document.getElementById("fund1").style.display="block"
		 document.getElementById("fund2").style.display="block"
		 document.getElementById("fund3").style.display="block"
		 document.getElementById("fund4").style.display="block"
		 document.getElementById("fund5").style.display="block"
		 document.getElementById("fund6").style.display="block"
		 document.getElementById("fund7").style.display="block"
		 document.getElementById("fund8").style.display="block"	 
		}
		else
		{           
		  document.getElementById("fund1").style.visibility = "hidden"
		  document.getElementById("fund2").style.visibility = "hidden"
		  document.getElementById("fund3").style.visibility = "hidden"
		  document.getElementById("fund4").style.visibility = "hidden"
		  document.getElementById("fund5").style.visibility = "hidden"
		  document.getElementById("fund6").style.visibility = "hidden"
		  document.getElementById("fund7").style.visibility = "hidden"
		  document.getElementById("fund8").style.visibility = "hidden"
		  
		  document.getElementById("fund1").style.display="none"
		   document.getElementById("fund2").style.display="none"
			document.getElementById("fund3").style.display="none"
			 document.getElementById("fund4").style.display="none"
			  document.getElementById("fund5").style.display="none"
			   document.getElementById("fund6").style.display="none"
			   document.getElementById("fund7").style.display="none"
			   document.getElementById("fund8").style.display="none"	   
			  
			   
		}
		//document.form1.txtQuotationDate.readOnly =true;
}
    function forNewHealthWealthInsured()
    {
        var rid;
        var termval,ageval;
        if(document.form1.TERM.value!="")
        {
            termval=parseInt(document.form1.TERM.value);
        }
        else
        {
            termval=0;
        }
        if(document.form1.AGEPI.value!="")
        {
            ageval=parseInt(document.form1.AGEPI.value);
        }
        else
        {
            ageval=0;
        }

        rid=ageval+termval;
        if(document.form1.cmbPISR1.value=="Reliance Term Life Insurance Benefit Rider")
        {
            if(rid<26)
            {
                alert("You are not eligible to opt for Reliance Term Life Insurance Benefit Rider");
                document.form1.cmbPISR1.selectedIndex=0;
                return false;
            }
        }
        if(document.form1.cmbPISR1.value == "Reliance New Term Life With Accident Benefit Rider")
        {
            if(rid<26)
            {
                alert("You are not eligible to opt for Reliance New Term Life with Accident Benefit Rider ");
                document.form1.cmbPISR1.selectedIndex=0;
                return false;
            }
        }
        if(document.form1.cmbCR1.value == "Yes")
        {
            if(rid<26)
            {
                alert("You are not eligible to opt for Reliance New Critical Conditions(25) Rider ");
                document.form1.cmbCR1.selectedIndex=0;
                return false;
            }
        }
    }
    
    function HWSpouserider()
    {
        var rid;
        var termval,ageval;
        if(document.form1.TERM.value!="")
        {
            termval=parseInt(document.form1.TERM.value);
        }
        else
        {
            termval=0;
        }
        if(document.form1.AGESP.value!="")
        {
            ageval=parseInt(document.form1.AGESP.value);
        }
        else
        {
            ageval=0;
        }
        var rid=ageval+termval;
        if(document.form1.cmbSPSR2.value=="Reliance Term Life Insurance Benefit Rider")
        {
            if(rid<26)
            {
                alert("You are not eligible to opt for Reliance Term Life Insurance Benefit Rider");
                document.form1.cmbSPSR2.selectedIndex=0;
                return false;
            }
        }
        if(document.form1.cmbSPSR2.value == "Reliance New Term Life With Accident Benefit Rider")
        {
            if(rid<26)
            {
                alert("You are not eligible to opt for Reliance New Term Life with Accident Benefit Rider ");
                document.form1.cmbSPSR2.selectedIndex=0;
                return false;
            }
        }
        if(document.form1.cmbCR2.value == "Yes")
        {
            if(rid<26)
            {
                alert("You are not eligible to opt for Reliance New Critical Conditions(25) Rider ");
                document.form1.cmbCR2.selectedIndex=0;
                return false;
            }
        }
    }

    
    function forcheckrider()
    {
        var rid;
        var termval,ageval;
        if(document.form1.TERM.value!="")
        {
            termval=parseInt(document.form1.TERM.value);
        }
        else
        {
            termval=0;
        }
        if(document.form1.AGEPI.value!="")
        {
            ageval=parseInt(document.form1.AGEPI.value);
        }
        else
        {
            ageval=0;
        }

        rid=ageval+termval;
        if(document.form1.cmbPISR1.value=="Reliance Term Life Insurance Benefit Rider")
        {
            if(rid<26)
            {
                alert("You are not eligible to opt for Term Life Insurance Benefit Rider");
                document.form1.cmbPISR1.selectedIndex=0;
                return false;
            }
        }
        if(document.form1.cmbPISR1.value == "Reliance New Term Life With Accident Benefit Rider")
        {
            if(rid<26)
            {
                alert("You are not eligible to opt for Term Life with Accident Benefit Rider ");
                document.form1.cmbPISR1.selectedIndex=0;
                return false;
            }
        }
        if(document.form1.cmbCR1.value == "Yes")
        {
            if(rid<26)
            {
                alert("You are not eligible to opt for Critical Conditions (25) Rider ");
                document.form1.cmbCR1.selectedIndex=0;
                return false;
            }
        }
    }

function forcheckSpouserider()
{
var rid;
var termval,ageval;
if(document.form1.TERM.value!="")
{
termval=parseInt(document.form1.TERM.value);
}
else
{
termval=0;
}
if(document.form1.AGESP.value!="")
{
ageval=parseInt(document.form1.AGESP.value);
}
else
{
ageval=0;
}
var rid=ageval+termval;
if(document.form1.cmbSPSR2.value=="Reliance Term Life Insurance Benefit Rider")
{
if(rid<26)
{
 alert("You are not eligible to opt for Term Life Insurance Benefit Rider");
 document.form1.cmbSPSR2.selectedIndex=0;
  return false;
}
}
if(document.form1.cmbSPSR2.value == "Reliance New Term Life With Accident Benefit Rider")
{
if(rid<26)
{
 alert("You are not eligible to opt for Term Life with Accident Benefit Rider ");
 document.form1.cmbSPSR2.selectedIndex=0;
 return false;
}
}
if(document.form1.cmbCR2.value == "Yes")
{
if(rid<26)
{
 alert("You are not eligible to opt for Critical Conditions (25) Rider ");
 document.form1.cmbCR2.selectedIndex=0;
   return false;
}
}
}


function checkNullValueHW()
{
 if(document.form1.PMMF.value=="" || document.form1.PMMF.value==null)
	  {
	  document.form1.PMMF.value=0;
	  }
	  if(document.form1.PGF.value=="" || document.form1.PGF.value==null)
	  {
	  document.form1.PGF.value=0;
	  }
	  if(document.form1.PCBF.value=="" || document.form1.PCBF.value==null)
	  {
	  document.form1.PCBF.value=0;
	  }
	  if(document.form1.PEF.value=="" || document.form1.PEF.value==null)
	  {
	  document.form1.PEF.value=0;
	  }
	  if(document.form1.PIF.value=="" || document.form1.PIF.value==null)
	  {
	  document.form1.PIF.value=0;
	  }
	  if(document.form1.PENF.value=="" || document.form1.PENF.value==null)
	  {
	  document.form1.PENF.value=0;
	  }
	  if(document.form1.PMDF.value=="" || document.form1.PMDF.value==null)
	  {
	  document.form1.PMDF.value=0;
	  }
	  if(document.form1.PPEF.value=="" || document.form1.PPEF.value==null)
	  {
	  document.form1.PPEF.value=0;
	  }
	  
	   var cap_sec_fund=parseInt(document.form1.PMMF.value);
	   var bal_fund=parseInt(document.form1.PGF.value);
	   var growth_fund=parseInt(document.form1.PCBF.value);
	   var equity_fund=parseInt(document.form1.PEF.value);
	   var pure_fund = parseInt(document.form1.PIF.value);
	   var infra_fund = parseInt(document.form1.PENF.value);
	   var energy_fund = parseInt(document.form1.PMDF.value);
	   var mid_fund =parseInt(document.form1.PPEF.value);
	   
	   var totalfund=parseInt(cap_sec_fund)+parseInt(bal_fund)+parseInt(growth_fund)+parseInt(equity_fund)+ parseInt(pure_fund) + parseInt(infra_fund) + parseInt(energy_fund) + parseInt(mid_fund);
	  
	  
	  
	  
if(document.form1.AGEPI.value=="" || document.form1.AGEPI.value==null)
 {
  alert("Please enter principal insured's age");
  document.form1.AGEPI.focus();
  return false;
 }
 if(document.form1.SEXPI.selectedIndex<1)
 {
  alert("Please select principal insured's Sex");
  document.form1.SEXPI.focus();
  return false;
 }
 if(document.form1.TERM.value=="" || document.form1.TERM.value==null)
 {
  alert("Please enter policy Term");
  document.form1.TERM.focus();
  return false;
 }
 if((parseInt(document.form1.TERM.value)<10) || (parseInt(document.form1.TERM.value)>25))
	 {
	  alert("Please enter policy term between 10 and 25");
	  document.form1.TERM.focus();
	   document.form1.TERM.select();
	  return false;
	 }
 if(document.form1.MODE.selectedIndex<1)
 {
  alert("Please select premium paying Mode");
  document.form1.MODE.focus();
  return false;
 }
 if(document.form1.PREMIUM.value=="" || document.form1.PREMIUM.value==null)
 {
  alert("Please enter Installment Premium");
  document.form1.PREMIUM.focus();
  document.form1.PREMIUM.select();
  return false;
 }
if(document.form1.FUNDNAME.selectedIndex<1)
 {
  alert("Please select Fund");
  document.form1.FUNDNAME.focus();
  document.form1.FUNDNAME.select();
  return false;
 }
 
 
 ////////////////////////////////////////
 
if (document.form1.PREMIUM.value == "")
{
alert("Please Enter Installment Premium");
document.form1.PREMIUM.focus();
document.form1.PREMIUM.select();
return false;
}
else
{
if (document.form1.PREMIUM.value != "")
{
	//if (Convert.ToInt32(t.Text)<10000 ) 
	if (parseInt(document.form1.AGEPI.value) <= 50)
	{
		if (document.form1.MODE.value == "Yearly")
		{
			if (document.form1.PREMIUM.value < 10000)
			{
				alert("For " + document.form1.MODE.value + " ,Installment Premium should be more than or equal to 10,000");
				document.form1.PREMIUM.focus();// 
				document.form1.PREMIUM.select();
				return false;
			}
		}
		else if (document.form1.MODE.value == "Half Yearly")
		{
			if (document.form1.PREMIUM.value < 5000)
			{
				alert("For " + document.form1.MODE.value + " ,Installment Premium should be more than or equal to 5000");
				document.form1.PREMIUM.focus();//
				document.form1.PREMIUM.select();
				return false;
			}
		}
		else if (document.form1.MODE.value == "Quarterly")
		{
			if (document.form1.PREMIUM.value < 2500)
			{
				alert("For " + document.form1.MODE.value + " ,Installment Premium should be more than or equal to 2500");
				document.form1.PREMIUM.focus();// 
				document.form1.PREMIUM.select();
				return false;
			}
		}

		else if (document.form1.MODE.value == "Monthly")
		{
			if (document.form1.PREMIUM.value < 1000)
			{
				alert("For " + document.form1.MODE.value + " ,Installment Premium should be more than or equal to 1000");
				document.form1.PREMIUM.focus();//
				document.form1.PREMIUM.select();
				return false;
			}
		}
	}
	else
	{
		if (document.form1.MODE.value == "Yearly")
		{

			if (document.form1.PREMIUM.value < 12000)
			{
				alert("For " + document.form1.MODE.value + " ,Installment Premium should be more than or equal to 12000");
				document.form1.PREMIUM.focus();//
				document.form1.PREMIUM.select(); 
				return false;
			}
		}
		else if (document.form1.MODE.value == "Half Yearly")
		{
			if (document.form1.PREMIUM.value < 6000)
			{
				alert("For " + document.form1.MODE.value + " ,Installment Premium should be more than or equal to 6000");
				document.form1.PREMIUM.focus();// 
				document.form1.PREMIUM.select();
				return false;
			}

		}
		else if (document.form1.MODE.value == "Quarterly")
		{
			if (document.form1.PREMIUM.value < 3000)
			{
				alert("For " + document.form1.MODE.value + " ,Installment Premium should be more than or equal to 3000");
				document.form1.PREMIUM.focus();//
				document.form1.PREMIUM.select(); 
				return false;
			}
		}

		else if (document.form1.MODE.value == "Monthly")
		{
			if (document.form1.PREMIUM.value < 1500)
			{
				alert("For " + document.form1.MODE.value + " ,Installment Premium should be more than or equal to 1500");
				document.form1.PREMIUM.focus();// 
				document.form1.PREMIUM.select();
				return false;
			}
		}
	}
	}
}
 //////////////////////////////////////
 if(document.form1.cmbPISR1.value=="Reliance Term Life Insurance Benefit Rider")
 {

 if(document.form1.PITRAGE.value=="" || document.form1.PITRAGE.value==0)
 {
  alert("Please enter Reliance Term Life Insurance Benefit Rider age for Principal Insured.");
  document.form1.PITRAGE.focus();
  document.form1.PITRAGE.select();
  return false;
 }
 if(document.form1.PITRTERM.value=="" || document.form1.PITRTERM.value==0)
 {
  alert("Please enter  Reliance Term Life Insurance Benefit Rider Term for Principal Insured.");
  document.form1.PITRTERM.focus();
   document.form1.PITRTERM.select();
  return false;
 }
 if(document.form1.PITRSA.value=="" || document.form1.PITRSA.value==0)
 {
  alert("Please enter  Reliance Term Life Insurance Benefit Rider Sum Assured for Principal Insured.");
  document.form1.PITRSA.focus();
  document.form1.PITRSA.select();
  return false;
 }
 if(document.form1.PITRAGE.value<18 || document.form1.PITRAGE.value>55)
 {
  alert("Reliance Term Life Insurance Benefit Rider age should be between 18 to 55");
  document.form1.PITRAGE.focus();
   document.form1.PITRAGE.select();
  return false;
 }
  if(parseFloat(document.form1.PITRAGE).value< parseFloat(document.form1.AGEPI.value))
 {
  alert("Age for  Reliance Term Life Insurance Benefit Rider for Principal Insured  can not be less than age at the entry.");
  document.form1.PITRAGE.focus();
   document.form1.PITRAGE.select();
  return false;
 }
 if(document.form1.PITRTERM.value<5 || document.form1.PITRTERM.value>25)
 {
  alert("Please enter Reliance Term Life Insurance Benefit Rider Term for Principal Insured between 5 to 25");
  document.form1.PITRTERM.focus();
  document.form1.PITRTERM.select();
  return false;
 }
  if(parseFloat(document.form1.PITRTERM.value)>parseFloat(document.form1.TERM.value))
 {
  alert("Term for  Reliance Term Life Insurance Benefit Rider should not exceed basic policy term.");
  document.form1.PITRTERM.focus();
  document.form1.PITRTERM.select();
  return false;
 }
  if(document.form1.PITRSA.value<25000)
 {
  alert("minimum Sum Assured  for Reliance term life insurance benifit rider is 25000");
  document.form1.PITRSA.focus();
  document.form1.PITRSA.select();
  return false;
 }

 }
 
 //////////////////////////
 if(document.form1.cmbPISR1.value=="Reliance New Term Life With Accident Benefit Rider")
 {
 if(document.form1.PITLBRAGE.value=="" || document.form1.PITLBRAGE.value==0)
 {
  alert("Please enter Reliance New Term Life With Accident Benefit Rider age for Principal Insured.");
  document.form1.PITLBRAGE.focus();
  document.form1.PITLBRAGE.select();
  return false;
 }
 if(document.form1.PITLBRTERM.value=="" || document.form1.PITLBRTERM.value==0)
 {
  alert("Please enter Term for Reliance New Term Life With Accident Benefit Rider for Principial Insured.");
  document.form1.PITLBRTERM.focus();
   document.form1.PITLBRTERM.select();
  return false;
 }
 if(document.form1.PITLBRSA.value=="" || document.form1.PITLBRSA.value==0)
 {
  alert("Please enter  Reliance New Term Life With Accident Benefit Rider Sum Assured  for Principal Insured.");
  document.form1.PITLBRSA.focus();
   document.form1.PITLBRSA.select();
  return false;
 }
  if(document.form1.PITLBRAGE.value<18 || document.form1.PITLBRAGE.value>55)
 {
  alert("Reliance New Term Life With Accident Benefit Rider age should be between 18 to 55");
  document.form1.PITLBRAGE.focus();
   document.form1.PITLBRAGE.select();
  return false;
 }
  if(parseFloat(document.form1.PITLBRAGE.value)<parseFloat(document.form1.AGEPI.value))
 {
  alert("Reliance New Term Life With Accident Benefit Rider age for Principal Insured  can not be less than age at the entry.");
  document.form1.PITLBRAGE.focus();
   document.form1.PITLBRAGE.select();
  return false;
 }
 if(document.form1.PITLBRTERM.value<5 || document.form1.PITLBRTERM.value>25)
 {
  alert("Please enter Reliance New Term Life With Accident Benefit Rider  term between 5 to 25");
  document.form1.PITLBRTERM.focus();
   document.form1.PITLBRTERM.select();
  return false;
 }
 if(parseFloat(document.form1.PITLBRTERM.value)>parseFloat(document.form1.TERM.value))
 {
  alert("Term for Reliance New Term Life With Accident Benefit Rider  should not exceed basic policy term.");
  document.form1.PITLBRTERM.focus();
   document.form1.PITLBRTERM.select();
  return false;
 }
  if(document.form1.PITLBRSA.value<25000)
 {
  alert("minimum Sum Assured  for Reliance New Term Life With Accident Benefit Rider is 25000");
  document.form1.PITLBRSA.focus();
  document.form1.PITLBRSA.select();
  return false;
 }
 
 }
 if(document.form1.cmbCR1.value=="Yes")
 {
 if(document.form1.PICCRAGE.value=="" || document.form1.PICCRAGE.value==0)
 {
  alert("Please enter Reliance Critical Condition(25) Rider age for Principal Insured. ");
  document.form1.PICCRAGE.focus();
   document.form1.PICCRAGE.select();
  return false;
 }
 if(document.form1.PICCRTREM.value=="" || document.form1.PICCRTREM.value==0)
 {
  alert("Please enter Term for Reliance New Critical Conditions(25) Rider");
  document.form1.PICCRTREM.focus();
   document.form1.PICCRTREM.select();
  return false;
 }
 if(document.form1.PICCRSA.value=="" || document.form1.PICCRSA.value==0)
 {
  alert("Please enter Reliance New Critical Conditions(25) rider sum assured:");
  document.form1.PICCRSA.focus();
  document.form1.PICCRSA.select();
  return false;
 }
 if(document.form1.PICCRAGE.value<18 || document.form1.PICCRAGE.value>55)
 {
  alert("Reliance Critical Condition(25) Rider age should be between 18 to 55");
  document.form1.PICCRAGE.focus();
  document.form1.PICCRAGE.select();
  return false;
 }
 if(parseFloat(document.form1.PICCRAGE.value)< parseFloat(document.form1.AGEPI.value))
 {
  alert("Age for Reliance Critical Condition(25) Rider can not be less than age at the entry.");
  document.form1.PICCRAGE.focus();
  document.form1.PICCRAGE.select();
  return false;
 }
 if(document.form1.PICCRTREM.value<5 || document.form1.PICCRTREM.value>25)
 {
  alert("Please enter Reliance Critical Condition(25) Rider term between 5 to 25");
  document.form1.PICCRTREM.focus();
  document.form1.PICCRTREM.select();
  return false;
 }
  if(parseFloat(document.form1.PICCRTREM.value)>parseFloat(document.form1.TERM.value))
 {
  alert(" Reliance Critical Condition(25) Rider term should not exceed basic policy term.");
  document.form1.PICCRTREM.focus();
  document.form1.PICCRTREM.select();
  return false;
 }
  if(document.form1.PICCRSA.value<10000)
 {
  alert("minimum Sum Assured for Reliance New Critical Conditions (25) Rider should be 10000");
  document.form1.PICCRSA.focus();
  document.form1.PICCRSA.select();
  return false;
 }
 }
 
 if(document.form1.cmbmsb1.value=="Yes")
 {
 if(document.form1.PIMSBRAGE.value=="" || document.form1.PIMSBRAGE.value==0)
 {
  alert("Please enter Reliance New Major Surgical Benefit Rider age for Principal Insured.");
  document.form1.PIMSBRAGE.focus();
   document.form1.PIMSBRAGE.select();
  return false;
 }
 if(document.form1.PIMSBRTERM.value=="" || document.form1.PIMSBRTERM.value==0)
 {
  alert("Please enter Reliance New Major Surgical Benefit Rider Term.");
  document.form1.PIMSBRTERM.focus();
  document.form1.PIMSBRTERM.select();
  return false;
 }
 if(document.form1.PIMSBRSA.value=="" || document.form1.PIMSBRSA.value==0)
 {
  alert("Please enter Reliance New Major Surgical Benefit Rider sum assured.");
  document.form1.PIMSBRSA.focus();
   document.form1.PIMSBRSA.select();
  return false;
 }
  if(document.form1.PIMSBRAGE.value<18 || document.form1.PIMSBRAGE.value>55)
 {
  alert("Reliance New Major Surgical Benefit Rider age should be between 18 to 55");
  document.form1.PIMSBRAGE.focus();
  document.form1.PIMSBRAGE.select();
  return false;
 }
 if(parseFloat(document.form1.PIMSBRAGE.value)<parseFloat(document.form1.AGEPI.value))
 {
  alert("Age for Reliance New Major Surgical Benefit Rider can not be less than age at the entry.");
  document.form1.PIMSBRAGE.focus();
  document.form1.PIMSBRAGE.select();
  return false;
 }
 if(document.form1.PIMSBRTERM.value<5 || document.form1.PIMSBRTERM.value>25)
 {
  alert("Please enter Reliance New Major Surgical Benefit Rider term between 5 to 25");
  document.form1.PIMSBRTERM.focus();
  document.form1.PIMSBRTERM.select();
  return false;
 }
  if(parseFloat(document.form1.PIMSBRTERM.value)> parseFloat(document.form1.TERM.value))
 {
  alert("Reliance New Major Surgical Benefit Rider term should not exceed basic policy term.");
  document.form1.PIMSBRTERM.focus();
  document.form1.PIMSBRTERM.select();
  return false;
 }
  if(document.form1.PIMSBRSA.value<10000)
 {
  alert("minimum Sum Assured for Reliance New Major Surgical Benefit Rider is 10000");
  document.form1.PIMSBRSA.focus();
  document.form1.PIMSBRSA.select();
  return false;
 }
 }
 
 
 
 //+++++++++++++++*for Spouse++============================================
 if(document.form1.cmbSpouse.value=="Yes")
 {
 if(document.form1.AGESP.value=="" || document.form1.AGESP.value==0)
 {
  alert("Please enter Spouse Age ");
  document.form1.AGESP.focus();
  return false;
 }
  if(document.form1.AGESP.value<18 || document.form1.AGESP.value>55)
 {
  alert("spouse age should be between 18 to 55");
  document.form1.AGESP.focus();
  return false;
 }
 if(document.form1.cmbSPSR2.value=="Reliance Term Life Insurance Benefit Rider")
 {

 if(document.form1.SPTRAGE.value=="" || document.form1.SPTRAGE.value==0)
 {
  alert("Please enter Reliance Term Life Insurance Benefit Rider age for Spouse.");
  document.form1.SPTRAGE.focus();
  document.form1.SPTRAGE.select();
  return false;
 }
 if(document.form1.SPTRTERM.value=="" || document.form1.SPTRTERM.value==0)
 {
  alert("Please enter Term for Reliance Term Life Insurance Benefit Rider for spouse");
  document.form1.SPTRTERM.focus();
   document.form1.SPTRTERM.select();
  return false;
 }

 if(document.form1.SPTRSA.value=="" || document.form1.SPTRSA.value==0)
 {
  alert("Please enter Reliance Term Life Insurance Benefit Rider sum assured for spouse:");
  document.form1.SPTRSA.focus();
  document.form1.SPTRSA.select();
  return false;
 }
 if(document.form1.SPTRAGE.value<18 || document.form1.SPTRAGE.value>55)
 {
  alert("Reliance Term Life Insurance Benefit Rider age should be between 18 to 55");
  document.form1.SPTRAGE.focus();
  document.form1.SPTRAGE.select();
  return false;
 }
 if(parseFloat(document.form1.SPTRAGE.value)<parseFloat(document.form1.SPTRAGE.value))
 {
  alert("Age for Reliance Term Life Insurance Benefit Rider can not be less than age at the entry.");
  document.form1.SPTRAGE.focus();
  document.form1.SPTRAGE.select();
  return false;
 }
  if(document.form1.SPTRTERM.value<5 || document.form1.SPTRTERM.value>25)
 {
  alert("Please enter term for Reliance Term Life Insurance Benefit Rider between 5 to 25");
  document.form1.SPTRTERM.focus();
   document.form1.SPTRTERM.select();
  return false;
 }
 if(parseFloat(document.form1.SPTRTERM.value)> parseFloat(document.form1.TERM.value))
 {
  alert("Term for  Reliance Term Life Insurance Benefit Rider should not exceed basic policy term.");
  document.form1.SPTRTERM.focus();
   document.form1.SPTRTERM.select();
  return false;
 }
 }
 if(document.form1.cmbSPSR2.value=="Reliance New Term Life With Accident Benefit Rider")
 {
 if(document.form1.SPTLBRAGE.value=="" || document.form1.SPTLBRAGE.value==0)
 {
  alert("Please enter Reliance New Term Life With Accident Benefit Rider age for Spouse.");
  document.form1.SPTLBRAGE.focus();
  document.form1.SPTLBRAGE.select();
  return false;
 }
 if(document.form1.SPTLBRTERM.value=="" || document.form1.SPTLBRTERM.value==0)
 {
  alert("Please enter Term for Reliance New Term Life With Accident Benefit Rider for Spouse.");
  document.form1.SPTLBRTERM.focus();
  document.form1.SPTLBRTERM.select();
  return false;
 }
 if(document.form1.SPTLBRSA.value=="" || document.form1.SPTLBRSA.value==0)
 {
  alert("Please enter  Reliance New Term Life With Accident Benefit Rider Sum Assured for Insured Spouse.");
  document.form1.SPTLBRSA.focus();
  document.form1.SPTLBRSA.select();
  return false;
 }
  if(document.form1.SPTLBRAGE.value<18 || document.form1.SPTLBRAGE.value>55)
 {
  alert("Reliance New Term Life With Accident Benefit Rider age should be between 18 to 55");
  document.form1.SPTLBRAGE.focus();
  document.form1.SPTLBRAGE.select();
  return false;
 }
 if(parseFloat(document.form1.SPTLBRAGE.value)<parseFloat(document.form1.SPTLBRAGE.value))
 {
  alert("Age for Reliance New Term Life With Accident Benefit Rider can not be less than age at the entry.");
  document.form1.SPTLBRAGE.focus();
  document.form1.SPTLBRAGE.select();
  return false;
 }
 if(document.form1.SPTLBRTERM.value<5 || document.form1.SPTLBRTERM.value>25)
 {
  alert("Please enter Reliance New Term Life With Accident Benefit Rider term between 5 to 25");
  document.form1.SPTLBRTERM.focus();
  document.form1.SPTLBRTERM.select();
  return false;
 }
 if(parseFloat(document.form1.SPTLBRTERM.value)>parseFloat(document.form1.SPTLBRTERM.value))
 {
  alert("Term for Reliance New Term Life With Accident Benefit Rider should not exceed basic policy term.");
  document.form1.SPTLBRTERM.focus();
  document.form1.SPTLBRTERM.select();
  return false;
 }
  if(document.form1.SPTLBRSA.value<25000)
 {
  alert("minimum Reliance New Term Life With Accident Benefit Rider sum assured for Spouse is 25000");
  document.form1.SPTLBRSA.focus();
  document.form1.SPTLBRSA.select();
  return false;
 }
 }
 if(document.form1.cmbCR2.value=="Yes")
 {
 if(document.form1.SPCCRAGE.value=="" || document.form1.SPCCRAGE.value==0)
 {
  alert("Please enter Reliance Critical Condition(25) Rider age for Spouse.");
  document.form1.SPCCRAGE.focus();
  document.form1.SPCCRAGE.select();
  return false;
 }
 if(document.form1.SPCCRTERM.value=="" || document.form1.SPCCRTERM.value==0)
 {
  alert("Please enter Reliance Critical Condition(25) Rider term value for Spouse.");
  document.form1.SPCCRTERM.focus();
  document.form1.SPCCRTERM.select();
  return false;
 }
 if(document.form1.SPCCRSA.value=="" || document.form1.SPCCRSA.value==0)
 {
  alert("Please enter Reliance Critical Condition(25) Rider sum assured. ");
  document.form1.SPCCRSA.focus();
  document.form1.SPCCRSA.select();
  return false;
 }
  if(document.form1.SPCCRAGE.value<18 || document.form1.SPCCRAGE.value>55)
 {
  alert("Reliance Critical Condition(25) Rider age should be between 18 to 55");
  document.form1.SPCCRAGE.focus();
  document.form1.SPCCRAGE.select();
  return false;
 }
 if(document.form1.SPCCRAGE.value<document.form1.AGESP.value)
 {
  alert("Age for Reliance Critical Condition(25) Rider can not be less than age at the entry.");
  document.form1.SPCCRAGE.focus();
  document.form1.SPCCRAGE.select();
  return false;
 }
  if(document.form1.SPCCRTERM.value<5 || document.form1.SPCCRTERM.value>25)
 {
  alert("Please enter Reliance Critical Condition(25) Rider term between 5 to 25");
  document.form1.SPCCRTERM.focus();
  document.form1.SPCCRTERM.select();
  return false;
 }
  if(parseInt(document.form1.SPCCRTERM.value) > parseInt(document.form1.TERM.value))
 {
  alert("Reliance Critical Condition(25) Rider term  should not exceed basic policy term.");
  document.form1.SPCCRTERM.focus();
  document.form1.SPCCRTERM.select();
  return false;
 }
 if(document.form1.SPCCRSA.value<10000)
 {
  alert("minimum Reliance Critical Condition(25) Rider sum assured is 10000. ");
  document.form1.SPCCRSA.focus();
  document.form1.SPCCRSA.select();
  return false;
 }
 }
 }
 if(document.form1.cmbmsb2.value=="Yes")
 {
 if(document.form1.SPMSBRAGE.value=="" || document.form1.SPMSBRAGE.value==0)
 {
  alert("Please enter Reliance New Major Surgical Benefit Rider age for Spouse.");
  document.form1.SPMSBRAGE.focus();
  document.form1.SPMSBRAGE.select();
  return false;
 }
 if(document.form1.SPMSBRTERM.value=="" || document.form1.SPMSBRTERM.value==0)
 {
  alert("Please enter term for Reliance New Major Surgical Benefit Rider.");
  document.form1.SPMSBRTERM.focus();
  document.form1.SPMSBRTERM.select();
  return false;
 }
 if(document.form1.SPMSBRSA.value=="" || document.form1.SPMSBRSA.value==0)
 {
  alert("Please enter Reliance Major surgical Benefit Rider Sum Assured for Insured Spouse.");
  document.form1.SPMSBRSA.focus();
  document.form1.SPMSBRSA.select();
  return false;
 }
 if(document.form1.SPMSBRAGE.value<18 || document.form1.SPMSBRAGE.value>55)
 {
  alert("Reliance New Major Surgical Benefit Rider age should be between 18 to 55");
  document.form1.SPMSBRAGE.focus();
  document.form1.SPMSBRAGE.select();
  return false;
 }
 if(parseFloat(document.form1.SPMSBRAGE.value)<parseFloat(document.form1.AGESP.value))
 {
  alert("Age for Reliance New Major Surgical Benefit Rider can not be less than age at the entry.");
  document.form1.SPMSBRAGE.focus();
  document.form1.SPMSBRAGE.select();
  return false;
 }
 if(document.form1.SPMSBRTERM.value<5 || document.form1.SPMSBRTERM.value>25)
 {
  alert("Please enter Reliance New Major Surgical Benefit Rider term between 5 to 25");
  document.form1.SPMSBRTERM.focus();
  document.form1.SPMSBRTERM.select();
  return false;
 }
 if(parseFloat(document.form1.SPMSBRTERM.value)>parseFloat(document.form1.TERM.value))
 {
  alert("Reliance New Major Surgical Benefit Rider term  should not exceed basic policy term.");
  document.form1.SPMSBRTERM.focus();
  document.form1.SPMSBRTERM.select();
  return false;
 }
 if(document.form1.SPMSBRSA.value<10000)
 {
  alert("minimum Reliance Major surgical Benefit Rider Sum Assured for Insured Spouse is 10000.");
  document.form1.SPMSBRSA.focus();
  document.form1.SPMSBRSA.select();
  return false;
 }
 }
 
 ///////////////////child1
 
 if(document.form1.cmbCh1.value=="Yes")
 {
 if(document.form1.AGECH1.value=="" || document.form1.AGECH1.value==0)
 {
  alert("Please enter Child1 Age");
  document.form1.AGECH1.focus();
	document.form1.AGECH1.select();
  return false;
 }
 if(document.form1.SEXCH1.selectedIndex<1)
 {
  alert("Please select Child1 Sex");
  document.form1.SEXCH1.focus();
  return false;
 }
  if(parseInt(document.form1.AGECH1.value)<0 || parseInt(document.form1.AGECH1.value)>19)
 {
  alert("The Entry age for  Insured  Child1 should be between 3 month & 19 yrs");
  document.form1.AGECH1.focus();
   document.form1.AGECH1.select();
  return false;
 }
 }
 if(document.form1.cmbCh2.value=="Yes")
 {
 if(document.form1.AGECH2.value=="" || document.form1.AGECH2.value==0)
 {
  alert("Please enter Child2 Age");
  document.form1.AGECH2.focus();
  return false;
 }
 if(document.form1.SEXCH2.selectedIndex<1)
 {
  alert("Please select Child2 Sex");
  document.form1.SEXCH2.focus();
  return false;
 }
  if(parseInt(document.form1.AGECH2.value)<0 || parseInt(document.form1.AGECH2.value)>19)
 {
  alert("The Entry age for  Insured Child2 should be between 3 month & 19 yrs");
  document.form1.AGECH2.focus();
   document.form1.AGECH2.select();
  return false;
 }
 }
 
 if(parseInt(document.form1.AGEPI.value)<18 ||parseInt(document.form1.AGEPI.value)>55)
 {
  alert("The Entry age for Principal Insured should be between 18 & 55 yrs");
		  document.form1.AGEPI.focus();
		  document.form1.AGEPI.select();
		  return false;
 }
 
 
	   if(document.form1.FUNDNAME.value=="Tailor Made")
	   {
////////        if(cap_sec_fund >40)
////////        {
////////          alert("Money Market Fund can not exceed 40%");
////////  	      document.form1.PMMF.focus();
////////  	      document.form1.PMMF.select();
////////	      return false;
////////        }
		if(totalfund!=100)
		{
		alert(totalfund);
		  alert("The sum of proportion of all funds should be equal to 100%");
		  document.form1.PMMF.focus();
		  document.form1.PMMF.select();
		  return false;
		}
	   }
	   //  document.form1.SEXSP.disabled=true;
	   
	   
//       var cap_sec_fund=parseInt(document.form1.PMMF.value);
//       var bal_fund=parseInt(document.form1.PGF.value);
//       var growth_fund=parseInt(document.form1.PCBF.value);
//       var equity_fund=parseInt(document.form1.PEF.value);
//       var pure_fund = parseInt(document.form1.PIF.value);
//       var infra_fund = parseInt(document.form1.PENF.value);
//       var energy_fund = parseInt(document.form1.PMDF.value);
//       var mid_fund =parseInt(document.form1.PPEF.value);
	   
	   if(document.form1.PMMF.value=="")
	   {
	   document.form1.PMMF.value=0;
	   }
	   if(document.form1.PGF.value=="")
	   {
	   document.form1.PGF.value=0;
	   }
	   if(document.form1.PCBF.value=="")
	   {
	  document.form1.PCBF.value=0;
	   }
	   if(document.form1.PEF.value=="")
	   {
	   document.form1.PEF.value=0;
	   }
	   if(document.form1.PGF.value=="")
	   {
	   document.form1.PGF.value=0;
	   }
	   if(document.form1.PIF.value=="")
	   {
	   document.form1.PIF.value=0;
	   }
	   if(document.form1.PENF.value=="")
	   {
	   document.form1.PENF.value=0;
	   }
	   if(document.form1.PMDF.value=="")
	   {
	   document.form1.PMDF.value=0;
	   }
	   if(document.form1.PPEF.value=="")
	   {
	   document.form1.PPEF.value=0;
	   }
}

//++++++++++++++++++++++++++++++++++++++++END Health Wealth+++++++++++++++++++++++++++++++++++
//+++++++++++++++++++++++++++++++++++++++=super investment +++++++++++++++++++++++++++++
 function checkvalueSIP()
	{	
	   var cap_sec_fund=parseInt(document.form1.PMMF.value);
	   var bal_fund=parseInt(document.form1.PGF.value);
	   var growth_fund=parseInt(document.form1.PCBF.value);
	   var equity_fund=parseInt(document.form1.PEF.value);
	   var pure_fund = parseInt(document.form1.PIF.value);
	   var infra_fund = parseInt(document.form1.PENF.value);
	   var energy_fund = parseInt(document.form1.PMDF.value);
	   var mid_fund =parseInt(document.form1.PPEF.value);
	   var totalfund=parseInt(cap_sec_fund)+parseInt(bal_fund)+parseInt(growth_fund)+parseInt(equity_fund)+ parseInt(pure_fund) + parseInt(infra_fund) + parseInt(energy_fund) + parseInt(mid_fund);
	   if(document.form1.PMMF.value=="" || document.form1.PMMF.value==null)
	   {
	   document.form1.PMMF.value=0;
	   }
	   if(document.form1.PGF.value=="" || document.form1.PGF.value==null)
	   {
	   document.form1.PGF.value=0;
	   }
	   if(document.form1.PCBF.value=="" || document.form1.PCBF.value==null)
	   {
	   document.form1.PCBF.value=0;
	   }
	   if(document.form1.PEF.value=="" || document.form1.PEF.value==null)
	   {
	   document.form1.PEF.value=0;
	   }
	   if(document.form1.PIF.value=="" || document.form1.PIF.value==null)
	   {
	   document.form1.PIF.value=0;
	   }
	   if(document.form1.PENF.value=="" || document.form1.PENF.value==null)
	   {
	   document.form1.PENF.value=0;
	   }
	   if(document.form1.PMDF.value=="" || document.form1.PMDF.value==null)
	   {
	   document.form1.PMDF.value=0;
	   }
	   if(document.form1.PPEF.value=="" || document.form1.PPEF.value==null)
	   {
	   document.form1.PPEF.value=0;
	   }
	   
	   
	   if(document.form1.txtName.value=="" || document.form1.txtName.value==null)
	   {
		alert("Please enter your/Customer's name");
		document.form1.txtName.focus();
		return false;
	   }
	   if(document.form1.txtAdvisor.value=="" || document.form1.txtAdvisor.value==null)
	   {
		alert("Please enter Advisor name");
		document.form1.txtAdvisor.focus();
		return false;
	   }
	   if(document.form1.Sex.value=="Select")
	   {
		alert("Please select your sex");
		document.form1.Sex.focus();
		return false;
	   }
		 if(document.form1.AGE.value=="Select")
	   {
		alert("Please select your Age");
		document.form1.AGE.focus();
		return false;
	   }
	   if(document.form1.Term.value=="" || document.form1.Term.value==0)
	   {
		alert("Please Enter Policy Term");
		document.form1.Term.focus();
		return false;
	   }
	   if(document.form1.Mode.value=="Select")
	   {
		alert("Please select your Premium Payment Mode");
		document.form1.Mode.focus();
		return false;
	   }
	   if(document.form1.PREMIUM.value=="" || document.form1.PREMIUM.value==0 || document.form1.PREMIUM.value==null)
	   {
		alert("Please enter Installment Premium");
		document.form1.PREMIUM.focus();
		return false;
	   }
	   if(document.form1.SA.value=="" || document.form1.SA.value==null || document.form1.SA.value==0)
	   {
		alert("Please enter your basic sum assured");
		document.form1.SA.focus();
		return false;
	   }
	 
	   
		if(document.form1.chkaccidentrider.checked==true)
		 { 
		  var age=parseFloat(document.form1.ADBRAGE.value);
		  var termr=parseFloat(document.form1.ADBRTERM.value);
		  var baseval=parseFloat(document.form1.Term.value);
		  var asa=parseFloat(document.form1.ADBRSA.value);
		  if(age==0 || document.form1.ADBRAGE.value=="")
		   {
			alert("Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Age");
			document.form1.ADBRAGE.focus();
			  document.form1.ADBRAGE.select();
			return false;
		   }
			if(termr==0 || document.form1.ADBRTERM.value=="")
		   {
			 alert("Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Term.");
			 document.form1.ADBRTERM.focus();
			 document.form1.ADBRTERM.select();
			 return false;
			}
			 if(asa==0 || document.form1.ADBRSA.value=="")
		   {
			 alert("Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Sum Assured.");
			 document.form1.ADBRSA.focus();
			 document.form1.ADBRSA.select();
			 return false;
			}
		  if(age<18 || age>60)
		   {
			 alert("Invalid Rider Age. Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Age between 18 and 60");
			 document.form1.ADBRAGE.focus();
			 document.form1.ADBRAGE.select();
			 return false;
		   } 
		   //term nd sa
		 
		  if(termr<5 || termr>30)
		   {
			alert("Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Term between 5 and 30");
			document.form1.ADBRTERM.focus();
			document.form1.ADBRTERM.select();
			return false;
		   } 
		   
		  if(asa<25000 )
		  {
		 alert("Reliance Accidental Death and Total and Permanent Disablement Rider minimum sum assured is Rs. 25,000 and maximum Sum Assured is 50,00,000");
		   document.form1.ADBRSA.focus();
		   document.form1.ADBRSA.select();
		   return false;
		  }
	   }
	   
		if(document.form1.chkTermliferider.checked==true)
		 { 
		  var age=parseFloat(document.form1.TLRAGE.value);
		  var termr=parseFloat(document.form1.TLRTERM.value);
		  var baseval=parseFloat(document.form1.Term.value);
		  var asa=parseFloat(document.form1.TLRSA.value);
		  if(age==0 || document.form1.TLRAGE.value=="")
		   {
			alert("Please enter Reliance Term Life Insurance Benefit Rider Age");
			document.form1.TLRAGE.focus();
			document.form1.TLRAGE.select();
			return false;
		   }
			if(termr==0 || document.form1.TLRTERM.value=="")
		   {
			 alert("Please enter Reliance Term Life Insurance Benefit Rider Term.");
			 document.form1.TLRTERM.focus();
			  document.form1.TLRTERM.select();
			 return false;
			}
			 if(asa==0 || document.form1.TLRSA.value=="")
		   {
			 alert("Please enter Reliance Term Life Insurance Benefit Rider Sum Assured.");
			 document.form1.TLRSA.focus();
			  document.form1.TLRSA.select();
			 return false;
			}
		  if(age<18 || age>59)
		   {
			 alert("Invalid Rider Age. Please enter Reliance Term Life Insurance Benefit Rider Age between 18 and 59");
			 document.form1.TLRAGE.focus();
			  document.form1.TLRAGE.select();
			 return false;
		   } 
		   //term nd sa
		 
		  if(termr<5 || termr>30)
		   {
			alert("Please enter Reliance Term Life Insurance Benefit Rider Term between 5 and 30");
			document.form1.TLRTERM.focus();
			 document.form1.TLRTERM.select();
			return false;
		   } 
		   
			 if(asa<25000 )
		  {
		 alert("minimum Reliance Term Life Insurance Benefit Rider Sum Assured is Rs. 25000");
		   document.form1.TLRSA.focus();
		   document.form1.TLRSA.select();
		   return false;
		  }
		}
		 if(document.form1.chkmajor.checked==true)
		 { 
		  var age=parseFloat(document.form1.MSBAGE.value);
		  var termr=parseFloat(document.form1.MSBTERM.value);
		  var baseval=parseFloat(document.form1.Term.value);
		  var asa=parseFloat(document.form1.MSBSA.value);
		  if(age==0 || document.form1.MSBAGE.value=="")
		   {
			alert("Please enter Age for Reliance New Major Surgical Benefit Rider");
			document.form1.MSBAGE.focus();
			 document.form1.MSBAGE.select();
			return false;
		   }
		   if(termr==0 || document.form1.MSBTERM.value=="")
		   {
			 alert("Please enter Term for Reliance New Major Surgical Benefit Rider.");
			 document.form1.MSBTERM.focus();
			  document.form1.MSBTERM.select();
			 return false;
			}
			if(asa==0 || document.form1.MSBSA.value=="")
		   {
			 alert("Please enter Reliance Major Surgical Benifit Rider Sum Assured.");
			 document.form1.MSBSA.focus();
			  document.form1.MSBSA.select();
			 return false;
			}
		  if(age<18 || age>55)
		   {
			 alert("Invalid Rider Age. Please enter Reliance Major Surgical Benifit Rider Age between 18 and 55");
			 document.form1.MSBAGE.focus();
			  document.form1.MSBAGE.select();
			 return false;
		   } 
		   //term nd sa
		  
		  if(termr<5 || termr>25)
		   {
			alert("Please enter Reliance Major Surgical Benifit Term between 5 and 25");
			document.form1.MSBTERM.focus();
			 document.form1.MSBTERM.select();
			return false;
		   } 
			
		 if(asa<10000 )
		  {
		 alert("minimum Major Surgical Benifit Rider Sum Assured is Rs. 10000");
		   document.form1.MSBSA.focus();
			 document.form1.MSBSA.select();
		   return false;
		  }
		}
		if(document.form1.chkccrider.checked==true)
		 { 
		  var age=parseFloat(document.form1.CCRAGE.value);
		  var termr=parseFloat(document.form1.CCRTERM.value);
		  var baseval=parseFloat(document.form1.Term.value);
		  var asa=parseFloat(document.form1.CCRSA.value);
		  if(age==0 || document.form1.CCRAGE.value=="")
		   {
			alert("Please enter Age for Reliance New Critical Conditions (25) Rider");
			document.form1.CCRAGE.focus();
			 document.form1.CCRAGE.select();
			return false;
		   }
			if(termr==0 || document.form1.CCRTERM.value=="")
		   {
			 alert("Please enter Term for Reliance New Critical Conditions(25) Rider.");
			 document.form1.CCRTERM.focus();
			  document.form1.CCRTERM.select();
			 return false;
			}
			 if(asa==0 || document.form1.CCRSA.value=="")
		   {
			 alert("Please enter Reliance New Critical Conditions(25) Rider Sum Assured.");
			 document.form1.CCRSA.focus();
			  document.form1.CCRSA.select();
			 return false;
			}
		  if(age<18 || age>55)
		   {
			 alert("Invalid Rider Age. Please enter Reliance New Critical Conditions(25) Rider Age between 18 and 55");
			 document.form1.CCRAGE.focus();
			  document.form1.CCRAGE.select();
			 return false;
		   } 
		   //term nd sa
		 
		  if(termr<5 || termr>25)
		   {
			alert("Please enter Reliance New Critical Conditions(25) Term between 5 and 25");
			document.form1.CCRTERM.focus();
			 document.form1.CCRTERM.select();
			return false;
		   } 
		   
		 if(asa<10000 )
		  {
		 alert("minimum Reliance New Critical Conditions(25) Rider Sum Assured is Rs. 10000");
		   document.form1.CCRSA.focus();
			document.form1.CCRSA.select();
		   return false;
		  }
		}
		
	  
//////  if(totalfund!=100)
//////        {
//////          alert("The sum of proportion of all funds should be equal to 100%");
//////  	      document.form1.PMMF.focus();
//////  	      document.form1.PMMF.select();
//////	      return false;
//////        }

   }
   

//++++++++++++++++++++++++++++++++++++++++++end supr investment
 function DisableEnterKey() 
{
		 if(event.keyCode == 13) 
		  {
		   return false; 
		  }
		 else
		   {
			return true; 
		   }
}

//+++++++++++++++++++++++++++++++++++++++++For secure child++++++++++++++++++++++++
function selectchangeforSCP()
{
//document.form1.A_Prem.disabled=true;
//document.form1.CSA.disabled=true;
 if (document.form1.MODETYPE.value == "Regular Premium")
		{        
		document.form1.AP.value=0;
//          document.form1.IP.value="";       
		  document.form1.A_Prem.value="";
		  document.getElementById("ridreg1").style.visibility = "visible" 
		  document.getElementById("ridreg2").style.visibility = "visible" 
		  document.getElementById("ridreg3").style.visibility = "visible" 
		  document.getElementById("ridreg4").style.visibility = "visible" 
		  document.getElementById("ridreg5").style.visibility = "visible" 
		  document.getElementById("rider1").style.visibility = "visible" 
		  document.getElementById("rider2").style.visibility = "visible" 
		  document.getElementById("rider3").style.visibility = "visible" 
		  document.getElementById("rider4").style.visibility = "visible" 
		  document.getElementById("rider1").style.display="block"
		  document.getElementById("rider2").style.display="block"
		  document.getElementById("rider3").style.display="block"
		  document.getElementById("rider4").style.display="block"
		  document.getElementById("ridreg1").style.display="block"
		  document.getElementById("ridreg2").style.display="block"
		  document.getElementById("ridreg3").style.display="block"
		  document.getElementById("ridreg4").style.display="block"
		  document.getElementById("ridreg5").style.display="block"
		  document.getElementById("singprem").style.visibility = "hidden" 
		  document.getElementById("singprem").style.display="none"
		  
		}
	   else if(document.form1.MODETYPE.value == "Limited Premium")
		{
		 document.form1.AP.value=0;
//         document.form1.IP.value="";
		document.form1.A_Prem.value="";
		  document.getElementById("ridreg1").style.visibility = "visible" 
		  document.getElementById("ridreg2").style.visibility = "visible" 
		  document.getElementById("ridreg3").style.visibility = "visible" 
		  document.getElementById("ridreg4").style.visibility = "visible" 
		  document.getElementById("ridreg5").style.visibility = "visible" 
		  document.getElementById("ridreg1").style.display="block"
		  document.getElementById("ridreg2").style.display="block"
		  document.getElementById("ridreg3").style.display="block"
		  document.getElementById("ridreg4").style.display="block"
		  document.getElementById("ridreg5").style.display="block"
		  document.getElementById("rider1").style.visibility = "hidden" 
		  document.getElementById("rider2").style.visibility = "hidden" 
		  document.getElementById("rider3").style.visibility = "hidden" 
		  document.getElementById("rider4").style.visibility = "hidden" 
		  document.getElementById("rider1").style.display="none"
		  document.getElementById("rider2").style.display="none"
		  document.getElementById("rider3").style.display="none"
		  document.getElementById("rider4").style.display="none"
		   document.getElementById("singprem").style.visibility = "hidden" 
		  document.getElementById("singprem").style.display="none"
		}
		else if(document.form1.MODETYPE.value == "Single Premium")
		{
		document.form1.IP.value=0;
		document.form1.A_Prem.value=0;
		  document.getElementById("singprem").style.visibility = "visible" 
		  document.getElementById("singprem").style.display="block"
		  document.getElementById("ridreg1").style.visibility = "hidden" 
		  document.getElementById("ridreg2").style.visibility = "hidden" 
		  document.getElementById("ridreg3").style.visibility = "hidden" 
		  document.getElementById("ridreg4").style.visibility = "hidden" 
		  document.getElementById("ridreg5").style.visibility = "visible" 
		  document.getElementById("ridreg1").style.display="none"
		  document.getElementById("ridreg2").style.display="none"
		  document.getElementById("ridreg3").style.display="none"
		  document.getElementById("ridreg4").style.display="none"
		  document.getElementById("ridreg5").style.display="block"
		  document.getElementById("rider1").style.visibility = "hidden" 
		  document.getElementById("rider2").style.visibility = "hidden" 
		  document.getElementById("rider3").style.visibility = "hidden" 
		  document.getElementById("rider4").style.visibility = "hidden" 
		  document.getElementById("rider1").style.display="none"
		  document.getElementById("rider2").style.display="none"
		  document.getElementById("rider3").style.display="none"
		  document.getElementById("rider4").style.display="none"
		  
		}
		else
		{
		  document.getElementById("ridreg1").style.visibility = "hidden" 
		  document.getElementById("ridreg2").style.visibility = "hidden" 
		  document.getElementById("ridreg3").style.visibility = "hidden" 
		  document.getElementById("ridreg4").style.visibility = "hidden" 
		  document.getElementById("ridreg5").style.visibility = "visible" 
		  document.getElementById("ridreg1").style.display="none"
		  document.getElementById("ridreg2").style.display="none"
		  document.getElementById("ridreg3").style.display="none"
		  document.getElementById("ridreg4").style.display="none"
		  document.getElementById("ridreg5").style.display="block"
		  document.getElementById("rider1").style.visibility = "hidden" 
		  document.getElementById("rider2").style.visibility = "hidden" 
		  document.getElementById("rider3").style.visibility = "hidden" 
		  document.getElementById("rider4").style.visibility = "hidden" 
		  document.getElementById("rider1").style.display="none"
		  document.getElementById("rider2").style.display="none"
		  document.getElementById("rider3").style.display="none"
		  document.getElementById("rider4").style.display="none"
		 
		}
}
//////////////////////Check Rider For Secure Child/////////////////////////
function ChkRiderOptSecureChild()
{
var intValAge,intValTerm;
if(document.form1.CAGE.value=="Select" || document.form1.CAGE.value==null)
{
intValAge=0;
}
else
{
intValAge=document.form1.CAGE.value;
}
if(document.form1.TERM.value=="" || document.form1.TERM.value==null)
{
intValTerm=0;
}
else
{
intValTerm=document.form1.TERM.value;
}
var opt= parseInt(intValAge)+parseInt(intValTerm);
if(document.form1.ChkADTPDR.checked==true)
{
if(opt<23)
{
  alert("You are not eligible to opt for Reliance Accidental Death and Total and Permanent Disablement Rider");
  document.form1.ChkADTPDR.checked=false;
  RiderNullSCP();
  return false;
}
}
if(document.form1.ChkCCR.checked==true)
{
if(opt<26)
{
  alert("You are not eligible to opt for Reliance New Critical Conditions Rider");
  document.form1.ChkCCR.checked=false;
  RiderNullSCP();
  return false;
}
}
if(document.form1.ChkTLIBR.checked==true)
{
if(opt<23)
{
  alert("You are not eligible to opt for Reliance Term Life Insurance Benefit Rider");
  document.form1.ChkTLIBR.checked=false;
  RiderNullSCP();
  return false;
}
}
}

///////////////////////////////////////////////////////////////////////////////
function RiderNullSCP()
{
 if(document.form1.ChkADTPDR.checked==true)
	   {
	   document.form1.ADBAGE.readOnly =false;
	   document.form1.ADBTERM.readOnly =false;
	   document.form1.ADBSA.readOnly =false;
		document.form1.ADBAGE.disabled =false;
	   document.form1.ADBTERM.disabled =false;
	   document.form1.ADBSA.disabled =false;
	 
	   }
	   else if(document.form1.ChkADTPDR.checked==false)
	   {
	   document.form1.ADBAGE.readOnly =true;
	   document.form1.ADBTERM.readOnly =true;
	   document.form1.ADBSA.readOnly =true; 
		document.form1.ADBAGE.disabled =true;
	   document.form1.ADBTERM.disabled =true;
	   document.form1.ADBSA.disabled =true; 
		document.form1.ADBAGE.value =0;
	   document.form1.ADBTERM.value =0;
	   document.form1.ADBSA.value =0; 
	   }
	   if(document.form1.ChkCCR.checked==true)
	   {
	   document.form1.CIAGE.readOnly =false;
	   document.form1.CITERM.readOnly =false;
	   document.form1.CISA.readOnly =false;
		document.form1.CIAGE.disabled =false;
	   document.form1.CITERM.disabled =false;
	   document.form1.CISA.disabled =false;
	
	   }
	   else if(document.form1.ChkCCR.checked==false)
	   {
	   document.form1.CIAGE.readOnly =true;
	   document.form1.CITERM.readOnly =true;
	   document.form1.CISA.readOnly =true; 
		document.form1.CIAGE.disabled =true;
	   document.form1.CITERM.disabled =true;
	   document.form1.CISA.disabled =true; 
		document.form1.CIAGE.value =0;
	   document.form1.CITERM.value =0;
	   document.form1.CISA.value =0; 
	   }
	   
	   if(document.form1.ChkTLIBR.checked==true)
	   {
	   document.form1.TRAGE.readOnly =false;
	   document.form1.TRTERM.readOnly =false;
	   document.form1.TRSA.readOnly =false;
	   document.form1.TRAGE.disabled =false;
	   document.form1.TRTERM.disabled =false;
	   document.form1.TRSA.disabled =false;
	
	   }
	   else if(document.form1.ChkTLIBR.checked==false)
	   {
	   document.form1.TRAGE.readOnly =true;
	   document.form1.TRTERM.readOnly =true;
	   document.form1.TRSA.readOnly =true; 
	   document.form1.TRAGE.disabled =true;
	   document.form1.TRTERM.disabled =true;
	   document.form1.TRSA.disabled =true; 
	   document.form1.TRAGE.value =0;
	   document.form1.TRTERM.value =0;
	   document.form1.TRSA.value =0; 
	   }
}

function CheckNullValue()
{
// var cap_sec_fund=parseInt(document.form1.FUNDG.value);
//       var bal_fund=parseInt(document.form1.FUNDH.value);
//       var growth_fund=parseInt(document.form1.PEQF.value);
//       var equity_fund=parseInt(document.form1.PPEF.value);
//       var pure_fund = parseInt(document.form1.PIF.value);
//       var infra_fund = parseInt(document.form1.PENF.value);
//       var energy_fund = parseInt(document.form1.PMF.value);
//       //var mid_fund =parseInt(document.form1.PMDF.value);
//       var totalfund=parseInt(cap_sec_fund)+parseInt(bal_fund)+parseInt(growth_fund)+parseInt(equity_fund)+ parseInt(pure_fund) + parseInt(infra_fund) + parseInt(energy_fund);
		if(document.form1.txtName.value=="" || document.form1.txtName.value==null)
		{
		alert("Please enter your/Customer's name");
		document.form1.txtName.focus();
		return false;
		}
		if(document.form1.txtAdvisor.value=="" || document.form1.txtAdvisor.value==null)
		{
		alert("Please enter Advisor name");
		document.form1.txtAdvisor.focus();
		return false;
		}
		if(document.form1.Sex.value=="Select")
		{
		alert("Please select your sex");
		document.form1.Sex.focus();
		return false;
		}
		if(document.form1.CAGE.value=="Select")
		{
		alert("Please select Child Age");
		document.form1.CAGE.focus();
		return false;
		}
		if(document.form1.AGE.value=="Select")
		{
		alert("Please select your Age");
		document.form1.AGE.focus();
		return false;
		}
		if(document.form1.TERM.value=="" || document.form1.TERM.value==null || document.form1.TERM.value==0)
		{
		alert("Please enter Policy Term");
		document.form1.TERM.focus();
		return false;
		}

		if(document.form1.MODETYPE.value=="Select")
		{
		alert("Please select Premium Paying Type");
		document.form1.MODETYPE.focus();
		return false;
		}
	   
		if(document.form1.MODETYPE.value=="Single Premium")
		{
		if(document.form1.AP.value=="" || document.form1.AP.value==null || parseInt(document.form1.AP.value)==0)
		{
		alert("Please enter your Amount of Single Premium");
		document.form1.AP.focus();
		document.form1.AP.select();
		return false;
		}
		if(document.form1.CSA.value=="" || document.form1.CSA.value==null || parseInt(document.form1.CSA.value)==0)
		{
		alert("Please enter your Basic Sum Assured");
		document.form1.CSA.focus();
		document.form1.CSA.select();
		return false;
		}
	   }
	   
	   if(document.form1.MODETYPE.value=="Regular Premium")
	   {    
	   if(document.form1.MODE.value=="Select")
	   {
		alert("Please select your Premium Payment Mode");
		document.form1.MODE.focus();
		return false;
	   }
	   if(document.form1.IP.value=="" || document.form1.IP.value==null || parseFloat(document.form1.IP.value)==0)
	   {
		alert("Please enter your Installment Premium");
		document.form1.IP.focus();
		 document.form1.IP.select();
		return false;
	   }
	   }
	   
	   if(document.form1.MODETYPE.value=="Limited Premium")
	   {
	
	   if(document.form1.PPT.value=="" || document.form1.PPT.value==null || document.form1.PPT.value==0)
	   {
		alert("Please enter Premium Paying Term");
		document.form1.PPT.focus();
		return false;
	   }
	   if(document.form1.MODE.value=="Select")
	   {
		alert("Please select your Premium Payment Mode");
		document.form1.MODE.focus();
		return false;
	   }
	   if(document.form1.IP.value=="" || document.form1.IP.value==null || parseFloat(document.form1.IP.value)==0)
	   {
		alert("Please enter your Installment Premium");
		document.form1.IP.focus();
		 document.form1.IP.selectselectchangeforSCP
		return false;
	   }    
	   }
	  
	   if(document.form1.TERM.value<10 || document.form1.TERM.value>25)
		{
		alert("- Policy Term should be between 10 and 25.");
		document.form1.TERM.focus();
		return false;
		}
	   
	   if (document.form1.MODETYPE.value == "Regular Premium")
			{
				if (document.form1.MODE.value == "Yearly" && document.form1.IP.value != "")
				{
					if (parseInt(document.form1.IP.value) < 10000)
					{
						alert("minimum Installment Pemium is 10000");
						document.form1.IP.focus();
						return false;
					}
				}
				else if (document.form1.MODE.value == "Half Yearly" && document.form1.IP.value != "")
				{
					if (parseInt(document.form1.IP.value) < 5000)
					{
						alert("minimum Installment Pemium is 5000");
						document.form1.IP.focus();
						return false;
					}
				}
				else if (document.form1.MODE.value == "Quarterly" && document.form1.IP.value != "")
				{
					if (parseInt(document.form1.IP.value) < 2500)
					{
						alert("minimum Installment Pemium is 2500");
						document.form1.IP.focus();
						return false;
					}
				}
				else if (document.form1.MODE.value == "Monthly" && document.form1.IP.value != "")
				{
					if (parseInt(document.form1.IP.value) < 1000)
					{
						alert("minimum Installment Pemium is 1000");
						document.form1.IP.focus();
						return false;
					}
				}
			}
			if (document.form1.MODETYPE.value == "Limited Premium")
			{
				if (document.form1.MODE.value == "Yearly" && document.form1.IP.value != "")
				{
					if (parseInt(document.form1.IP.value) < 20000)
					{
						alert("minimum Installment Pemium is 20000");
						document.form1.IP.focus();
						return false;
					}
				}
				else if (document.form1.MODE.value == "Half Yearly" && document.form1.IP.value != "")
				{
					if (parseInt(document.form1.IP.value) < 10000)
					{
						alert("minimum Installment Pemium is 10000");
						document.form1.IP.focus();
						return false;
					}
				}
				else if (document.form1.MODE.value == "Quarterly" && document.form1.IP.value != "")
				{
					if (parseInt(document.form1.IP.value) < 5000)
					{
						alert("minimum Installment Pemium is 5000");
						document.form1.IP.focus();
						return false;
					}
				}
				else if (document.form1.MODE.value == "Monthly" && document.form1.IP.value != "")
				{
					if (parseInt(document.form1.IP.value) < 2000)
					{
						alert("minimum Installment Pemium is 2000");
						document.form1.IP.focus();
						return false;
					}
				}
			}
	   
	   
	   
		if(document.form1.ChkADTPDR.checked==true)
		 { 
		  var age=parseInt(document.form1.ADBAGE.value);
		  var termr=parseInt(document.form1.ADBTERM.value);
		  var baseval=parseInt(document.form1.TERM.value);
		  var asa=parseInt(document.form1.ADBSA.value);
		  if(age==0)
		   {
			alert("Please Enter Age for Accidental Death and Total and Permanent Disablement Rider");
			document.form1.ADBAGE.focus();
			document.form1.ADBAGE.select();
			return false;
		   }
		  
		   //term nd sa
		  if(termr==0)
		   {
			 alert("Please Enter Term for Accidental Death and Total and Permanent Disablement Rider.");
			 document.form1.ADBTERM.focus();
			 document.form1.ADBTERM.select();
			 return false;
			}
		
			if(asa==0)
		   {
			 alert("Please enter Sum Assured for Accidental Death and Total and Permanent Disablement Rider.");
			 document.form1.ADBSA.focus();
			 document.form1.ADBSA.select();
			 return false;
			}
		  if(age<18 || age>35)
		   {
			 alert("Age for Accidental Death and Total and Permanent Disablement Rider should be between 18 and 35 years");
			 document.form1.ADBAGE.focus();
			 document.form1.ADBAGE.select();
			 return false;
		   } 
		  if(termr<5 || termr>baseval)
		   {
			alert("Please enter Term for Accidental Death and Total and Permanent Disablement rider between 5 to"+baseval);
			document.form1.ADBTERM.focus();
			document.form1.ADBTERM.select();
			return false;
		   } 
			 if(asa<25000)
		   {
			 alert("minimum Sum Assured for Accidental Death and Total and Permanent Disablement Rider is 25000.");
			 document.form1.ADBSA.focus();
			 document.form1.ADBSA.select();
			 return false;
			}
		
	   }
	   if(document.form1.ChkCCR.checked==true)
		 { 
		  var age=parseInt(document.form1.CIAGE.value);
		  var termr=parseInt(document.form1.CITERM.value);
		  var baseval=parseInt(document.form1.TERM.value);
		  var asa=parseInt(document.form1.CISA.value);
		  var bsa=parseInt(document.form1.CSA.value);
		  if(age==0)
		   {
			alert("Please Enter Age for Critical Conditions Rider");
			document.form1.CIAGE.focus();
			document.form1.CIAGE.select();
			return false;
		   }
		  
		   //term nd sa
		  if(termr==0)
		   {
			 alert("Please enter Term for Critical Conditions Rider");
			 document.form1.CITERM.focus();
			 document.form1.CITERM.select();
			 return false;
			}
			if(asa==0)
		   {
			 alert("Please enter Sum Assured for Critical Conditions Rider.");
			 document.form1.CISA.focus();
			 document.form1.CISA.select();
			 return false;
			}
			if(age<18 || age>35)
		   {
			 alert("Age for Critical Conditions Rider should be between 18 and 35 years");
			 document.form1.CIAGE.focus();
			 document.form1.CIAGE.select();
			 return false;
		   } 
			 if(termr<5 || termr>baseval)
		   {
			alert("Please enter Term for Critical Conditions rider between 5 to "+baseval);
			document.form1.CITERM.focus();
			document.form1.CITERM.select();
			return false;
		   } 
		   
			if (asa < 25000 || asa > Math.min(bsa, 1000000))
				{
					alert("Reliance New Critical Conditions Rider Sum Assured should be between 25000 and " + Math.min(bsa, 1000000));
					document.form1.CISA.focus();
					return false;
				} 
//           if(asa<25000)
//           {
//             alert("minimum Sum Assured for Critical Conditions Rider is 25000.");
//             document.form1.CISA.focus();
//             document.form1.CISA.select();
//             return false;
//            }
		 }
		if(document.form1.ChkTLIBR.checked==true)
		 { 
		  var age=parseInt(document.form1.TRAGE.value);
		  var termr=parseInt(document.form1.TRTERM.value);
		  var baseval=parseInt(document.form1.TERM.value);
		  var asa=parseInt(document.form1.TRSA.value);
		  if(age==0)
		   {
			alert("Please enter Age for Term Life Insurance benefit rider");
			document.form1.TRAGE.focus();
			document.form1.TRAGE.select();
			return false;
		   }
		  
		   //term nd sa
		  if(termr==0)
		   {
			 alert("Please enter Term for Term Life Insurance benefit rider.");
			 document.form1.TRTERM.focus();
			 document.form1.TRTERM.select();
			 return false;
			}
		 
			if(asa==0)
		   {
			 alert("Please enter Sum Assured for Term Life Insurance benefit rider.");
			 document.form1.TRSA.focus();
			 document.form1.TRSA.select();
			 return false;
			}
			if(age<18 || age>35)
		   {
			 alert("Age for Term Life Insurance benefit Rider should be between 18 and 35 years");
			 document.form1.TRAGE.focus();
			 document.form1.TRAGE.select();
			 return false;
		   } 
			if(termr<5 || termr>baseval)
		   {
			alert("Please enter Term for Term Life Insurance Benefit rider between 5 to "+baseval);
			document.form1.TRTERM.focus();
			document.form1.TRTERM.select();
			return false;
		   } 
			if(asa<25000)
		   {
			 alert("minimum Sum Assured for Term Life Insurance benefit rider is 25000.");
			 document.form1.TRSA.focus();
			 document.form1.TRSA.select();
			 return false;
			}
		 }
	   
////////        if(totalfund!=100)
////////        {
////////          alert("The sum of proportion of all funds should be equal to 100%");
////////  	      document.form1.FUNDG.focus();
////////  	      document.form1.FUNDG.select();
////////	      return false;
////////        }
	  
}

function prem_calSCP()
{
var frequency;
	if ( document.form1.MODE.value == "Select" ){frequency = 0;};
   if ( document.form1.MODE.value == "Yearly" ){frequency = 1;};
   if ( document.form1.MODE.value == "Half Yearly" ){frequency = 2;};
   if ( document.form1.MODE.value == "Quarterly" ){frequency = 4;};
   if ( document.form1.MODE.value == "Monthly" ){frequency = 12;};
if(document.form1.MODETYPE.value == "Regular Premium" || document.form1.MODETYPE.value == "Limited Premium")
{
	var prem=document.form1.IP.value;
	//var frequency=document.form1.MODE.value;
	var max_sa;
	if(prem=="" || frequency=="")
		document.form1.A_Prem.value=0;
	else
		document.form1.A_Prem.value=(prem) * (frequency);

	var ann_ppm_val=document.form1.A_Prem.value;

	if ( document.form1.TERM.value/2 > 5 )
		max_sa = document.form1.TERM.value/2;
	else
		max_sa = 5;

	document.form1.CSA.value = max_sa * parseInt(ann_ppm_val);
	document.form1.CSA.readOnly =true;
   if(frequency==0)
   {
   document.form1.A_Prem.value="";
   document.form1.CSA.value="";
   }
}
else
{
document.form1.CSA.readOnly =false;

}
}

function CheckNullValue_sin()
{
 var cap_sec_fund=parseInt(document.form1.FUNDG.value);
	   var bal_fund=parseInt(document.form1.FUNDH.value);
	   var growth_fund=parseInt(document.form1.PEQF.value);
	   var equity_fund=parseInt(document.form1.PPEF.value);
	   var pure_fund = parseInt(document.form1.PIF.value);
	   var infra_fund = parseInt(document.form1.PENF.value);
	   var energy_fund = parseInt(document.form1.PMF.value);
	   //var mid_fund =parseInt(document.form1.PMDF.value);
	   var totalfund=parseInt(cap_sec_fund)+parseInt(bal_fund)+parseInt(growth_fund)+parseInt(equity_fund)+ parseInt(pure_fund) + parseInt(infra_fund) + parseInt(energy_fund);
	   if(document.form1.txtName.value=="" || document.form1.txtName.value==null)
	   {
		alert("Please enter your/Customer's  name value");
		document.form1.txtName.focus();
		return false;
	   }
	   if(document.form1.txtAdvisor.value=="" || document.form1.txtAdvisor.value==null)
	   {
		alert("Please enter your/Advisor name");
		document.form1.txtAdvisor.focus();
		return false;
	   }
	   if(document.form1.Sex.value=="Select")
	   {
		alert("Please select Your sex");
		document.form1.Sex.focus();
		return false;
	   }
		 if(document.form1.CAGE.value=="Select")
	   {
		alert("Please select Child Age");
		document.form1.CAGE.focus();
		return false;
	   }
		if(document.form1.AGE.value=="Select")
	   {
		alert("Please select Parent Age");
		document.form1.AGE.focus();
		return false;
	   }
	   if(document.form1.TERM.value=="" || document.form1.TERM.value==null)
	   {
		alert("Please enter term value");
		document.form1.TERM.focus();
		return false;
	   }
		if(document.form1.MODETYPE.value=="Select")
	   {
		alert("Please select Premium Paying Type");
		document.form1.MODETYPE.focus();
		return false;
	   }
	  if(document.form1.AP.value=="" || document.form1.AP.value==null || document.form1.AP.value==0)
	   {
		alert("Please enter Premium");
		document.form1.AP.focus();
		return false;
	   }
	   if(document.form1.CSA.value=="" || document.form1.CSA.value==null || document.form1.CSA.value==0)
	   {
		alert("Please enter your basic sum assured");
		document.form1.CSA.focus();
		return false;
	   }
////////        if(totalfund!=100)
////////        {
////////          alert("The sum of proportion of all funds should be equal to 100%");
////////  	      document.form1.FUNDG.focus();
////////  	      document.form1.FUNDG.select();
////////	      return false;
////////        }
	   if(document.form1.CSA.value<25000)
	   {
		alert("Basic Plan Sum Assured should be greater then or equal to 25000");
		document.form1.CSA.focus();
		document.form1.CSA.select();
		return false;
	   }
 }
 
 
 
 
 
 function selectchangeSplCrGaur()
 {
	if (document.form1.MODE.value == "Single Premium")
	{
	document.getElementById("rider1").style.visibility = "hidden"
	document.getElementById("rider2").style.visibility = "hidden"
	document.getElementById("rider3").style.visibility = "hidden"
	
	document.getElementById("rider1").style.display="none"
	document.getElementById("rider2").style.display="none"
	document.getElementById("rider3").style.display="none"
	document.form1.chkaccidentrider.checked=false;
	document.form1.chkccrider.checked=false;
	chkccRiderSPcr();
	chkAgeRiderSpCrGaurd();
	 /*  document.form1.ADAGE.readOnly =true;
	   document.form1.ADTERM.readOnly =true;
	   document.form1.ADSA.readOnly =true; 
		document.form1.ADAGE.value =0;
	   document.form1.ADTERM.value =0;
	   document.form1.ADSA.value =0; 
	   
	   document.form1.CCRAGE.readOnly =true;
	   document.form1.CCRTERM.readOnly =true;
	   document.form1.CCRSA.readOnly =true; 
		document.form1.CCRAGE.value =0;
	   document.form1.CCRTERM.value =0;
	   document.form1.CCRSA.value =0; */
	}
	else
	{
	document.getElementById("rider1").style.visibility = "visible"
	document.getElementById("rider2").style.visibility = "visible"
	document.getElementById("rider3").style.visibility = "visible"
	document.getElementById("rider1").style.display="block"
	document.getElementById("rider2").style.display="block"
	document.getElementById("rider3").style.display="block"
	}
}
function checkMF()
{
if(document.form1.SEXPI.selectedIndex==1)
{
document.form1.SEXSP.selectedIndex=2;
}
if(document.form1.SEXPI.selectedIndex==2)
{
document.form1.SEXSP.selectedIndex=1;
}
if(document.form1.SEXPI.selectedIndex==0)
{
document.form1.SEXSP.selectedIndex=0;
}
//document.form1.SEXSP.disabled=true;
}






function ChkRiderOptSIP1()
{
var intValAge,intValTerm;
if(document.form1.AGE.value=="Select" || document.form1.AGE.value==null)
{
intValAge=0;
}
else
{
intValAge=document.form1.AGE.value;
}
if(document.form1.Term.value=="" || document.form1.Term.value==null)
{
intValTerm=0;
}
else
{
intValTerm=document.form1.Term.value;
}
var opt= parseInt(intValAge)+parseInt(intValTerm);
if(opt<23)
{
  alert("You are not eligible to opt for Rider");
  document.form1.chkaccidentrider.checked=false;
  chkAgeRider111();
  return false;
}
}

function ChkRiderOptSIP2()
{
var intValAge,intValTerm;
if(document.form1.AGE.value=="Select" || document.form1.AGE.value==null)
{
intValAge=0;
}
else
{
intValAge=document.form1.AGE.value;
}
if(document.form1.Term.value=="" || document.form1.Term.value==null)
{
intValTerm=0;
}
else
{
intValTerm=document.form1.Term.value;
}
var opt= parseInt(intValAge)+parseInt(intValTerm);
if(opt<23)
{
  alert("You are not eligible to opt for Rider");
  document.form1.chkTermliferider.checked=false;
  return false;
}
if(parseInt(document.form1.AGE.value)>59)
{
alert("You are not eligible to opt for Term life insurance benefit Rider. Since maximum entry age allowed is 59");
document.form1.chkTermliferider.checked=false;
chktermRidersuperinv1();
  return false;
}
}
function ChkRiderOptSIP3()
{
var intValAge,intValTerm;
if(document.form1.AGE.value=="Select" || document.form1.AGE.value==null)
{
intValAge=0;
}
else
{
intValAge=document.form1.AGE.value;
}
if(document.form1.Term.value=="" || document.form1.Term.value==null)
{
intValTerm=0;
}
else
{
intValTerm=document.form1.Term.value;
}
var opt= parseInt(intValAge)+parseInt(intValTerm);
if(opt<23)
{
  alert("You are not eligible to opt for Rider");
  document.form1.chkmajor.checked=false;
  return false;
}
if(parseInt(document.form1.AGE.value)>55)
{
alert("You are not eligible to opt for Major Surgical Benefit Rider. Since maximum entry age allowed is 55");
 document.form1.chkmajor.checked=false;
  return false;
}
}
function ChkRiderOptSIP4()
{
var intValAge,intValTerm;
if(document.form1.AGE.value=="Select" || document.form1.AGE.value==null)
{
intValAge=0;
}
else
{
intValAge=document.form1.AGE.value;
}
if(document.form1.Term.value=="" || document.form1.Term.value==null)
{
intValTerm=0;
}
else
{
intValTerm=document.form1.Term.value;
}
var opt= parseInt(intValAge)+parseInt(intValTerm);
if(opt<23)
{
  alert("You are not eligible to opt for Rider");
   document.form1.chkccrider.checked=false;
  return false;
}
if(parseInt(document.form1.AGE.value)>55)
{
alert("You are not eligible to opt for Critical Conditions (25) Rider. Since maximum entry age allowed is 55");
 document.form1.chkccrider.checked=false;
  return false;
}
}
function changePptSCP()
{
	   if(document.form1.MODETYPE.value=="Single Premium")
	   {
	   document.form1.PPT.value=1;
	   }
	   else if(document.form1.MODETYPE.value=="Regular Premium")
	   {
	   document.form1.PPT.value=document.form1.TERM.value;
		document.form1.PPT.readOnly=true;
	   }
	   else
	   {
	   // document.form1.PPT.value=document.form1.TERM.value;
		document.form1.PPT.readOnly=false;
	   }
}
function iseditable1(evt)
  {
 var charCode = (evt.which) ? evt.which : event.keyCode
 if (charCode > 31 && (charCode < 48 || charCode > 57) )
	//{
	// alert('Enter Number Only');
	  return false;
	//}
 // return true;
 }
 
 function blankfundSCP()
{
	   if(document.form1.FUNDG.value=="" || document.form1.FUNDG.value==null)
		{
		document.form1.FUNDG.value=0; 
		   
		} 
		if(document.form1.FUNDH.value=="" || document.form1.FUNDH.value==null)
		{
		document.form1.FUNDH.value=0; 
		  
		} 
		 if(document.form1.PEQF.value=="" || document.form1.PEQF.value==null)
		{
		document.form1.PEQF.value=0; 
		   
		} 
		 if(document.form1.PPEF.value=="" || document.form1.PPEF.value==null)
		{
		document.form1.PPEF.value=0; 
		   
		} 
		if(document.form1.PIF.value=="" || document.form1.PIF.value==null)
		{
		document.form1.PIF.value=0; 
		   
		} 
		 if(document.form1.PENF.value=="" || document.form1.PENF.value==null)
		{
		document.form1.PENF.value=0; 
		
		} 
		 if(document.form1.PMF.value=="" || document.form1.PMF.value==null)
		{
		document.form1.PMF.value=0; 
		   
		} 
		if(document.form1.ADBAGE.value=="" || document.form1.ADBAGE.value==null)
		{
		document.form1.ADBAGE.value=0; 
		 } 
		   if(document.form1.ADBTERM.value=="" || document.form1.ADBTERM.value==null)
		{
		document.form1.ADBTERM.value=0; 
		 } 
		   if(document.form1.ADBSA.value=="" || document.form1.ADBSA.value==null)
		{
		document.form1.ADBSA.value=0; 
		 } 
		 
		  if(document.form1.CIAGE.value=="" || document.form1.CIAGE.value==null)
		{
		document.form1.CIAGE.value=0; 
		 } 
		  if(document.form1.CITERM.value=="" || document.form1.CITERM.value==null)
		{
		document.form1.CITERM.value=0; 
		 } 
		  if(document.form1.CISA.value=="" || document.form1.CISA.value==null)
		{
		document.form1.CISA.value=0; 
		 } 
		 
		   if(document.form1.TRAGE.value=="" || document.form1.TRAGE.value==null)
		{
		document.form1.TRAGE.value=0; 
		 } 
		  if(document.form1.TRTERM.value=="" || document.form1.TRTERM.value==null)
		{
		document.form1.TRTERM.value=0; 
		 } 
		  if(document.form1.TRSA.value=="" || document.form1.TRSA.value==null)
		{
		document.form1.TRSA.value=0; 
		 } 
   
}

//+++++++++++++++++++++++Imaan Plan++++++++++++++++++++++++++++++++++++++
function ChangeDOBimaan()
{
  if(document.form1.txtName.value=="" || document.form1.txtName.value==null)
	   {
		alert("Please enter your/Customer's  name");
		document.form1.txtName.focus();
		return false;
	   }
	   if(document.form1.txtAdvisor.value=="" || document.form1.txtAdvisor.value==null)
	   {
		alert("Please enter your/Advisor name");
		document.form1.txtAdvisor.focus();
		return false;
	   }
	   if(document.form1.Sex.value=="Select")
	   {
		alert("Please select Your sex");
		document.form1.Sex.focus();
		return false;
	   }
	   if(document.form1.AGE.value=="Select")
	   {
		alert("Please select Age");
		document.form1.AGE.focus();
		return false;
	   }
	   if(document.form1.TERM.value=="" || document.form1.TERM.value==null)
	   {
		alert("Please enter Policy Term");
		document.form1.TERM.focus();
		return false;
	   }
		if(document.form1.MODETYPE.value=="Select" )
	   {
		alert("Please select Premium Paying Type");
		document.form1.MODETYPE.focus();
		return false;
	   }
		 if(document.form1.MODETYPE.value=="Limited Premium" )
	   {
	   if(document.form1.PPT.value=="" || document.form1.PPT.value==0 || document.form1.PPT.value==null)
	   {
		alert("Please select Premium Paying Term");
		document.form1.PPT.focus();
		return false;
	   }
	   }
		if(document.form1.MODE.value=="Select")
	   {
		alert("Please select Mode of Premium Payment");
		document.form1.MODE.focus();
		return false;
	   }
	  if(document.form1.PREMIUM.value=="" || document.form1.PREMIUM.value==null || document.form1.PREMIUM.value==0)
	   {
		alert("Please enter Installment Premium");
		document.form1.PREMIUM.focus();
		return false;
	   }
	   if(document.form1.SA.value=="" || document.form1.SA.value==null || document.form1.SA.value==0)
	   {
		alert("Please enter your basic sum assured");
		document.form1.SA.focus();
		return false;
	   }
		if(document.form1.MODETYPE.value=="Regular Premium")
	   {
		//alert(document.form1.AGE.value);
		if(document.form1.AGE.value<=49)
		   {
			if(document.form1.TERM.value<6 || document.form1.TERM.value>30)
			{
			alert("Policy term should be between 6 to 30");
			document.form1.TERM.focus();
			return false;
			}
		  }
		else if(document.form1.AGE.value>49 && document.form1.AGE.value<=55)
		  {
		   //alert(document.form1.AGE.value);
			  if(document.form1.TERM.value<7 || document.form1.TERM.value>30)
			  {
			   alert("Policy term should be between 7 to 30");
			   document.form1.TERM.focus();
				return false;
			  }
		  }
		  else if(document.form1.AGE.value>55 && document.form1.AGE.value<=65)
		  {
			   if(document.form1.TERM.value<10 || document.form1.TERM.value>30)
				{
				alert("Policy term should be between 10 to 30");
				document.form1.TERM.focus();
				return false;
				}
		  }
	   }
	  
		if(document.form1.MODETYPE.value=="Limited Premium")
	   {
	   if(parseInt(document.form1.TERM.value) <=10 )
			{
			alert("For Limited Premium type, Policy Term should be greater than 10 years");
			document.form1.TERM.focus();
					return false;
			}
	   if(parseInt(document.form1.PPT.value) <10 )
			{
			alert("For Limited Premium type, Premium Paying Term should be greater than or equal to 10");
			document.form1.PPT.focus();
					return false;
			}
	   if(parseInt(document.form1.PPT.value) >= parseInt(document.form1.TERM.value))
	   {
		alert("For Limited Premium type, Premium Paying Term should not be greater than or equal to Policy Term");
		document.form1.PPT.focus();
		return false;
		}
	   }
	   //return true;
}

function calc_sa()
{
var val;
   //var amt_inst_pre = document.form1.PREMIUM.value;
   if ( document.form1.MODE.value == "Select" ){val = 0;};
   if ( document.form1.MODE.value == "Yearly" ){val = 1;};
   if ( document.form1.MODE.value == "Half Yearly" ){val = 2;};
   if ( document.form1.MODE.value == "Quarterly" ){val = 4;};
   if ( document.form1.MODE.value == "Monthly" ){val = 12;};

	 if(document.form1.TERM.value!="")
	 {
		term= document.form1.TERM.value;
	 }
	 else
	 {
		term="";
	 }
	 if(document.form1.PREMIUM.value!="" && val!=0)
	{
		installment_Premium= document.form1.PREMIUM.value;    	
		document.form1.A_Prem.value = installment_Premium * val;
	}
	else
	{
		document.form1.A_Prem.value ="";
	}
	document.form1.A_Prem.readOnly = true;
}

function change_pptImaan()
{

	if(document.form1.MODETYPE.value == "Regular Premium")
		{
			if(document.form1.TERM.value!="")
			{
				document.form1.PPT.value = document.form1.TERM.value;
			}
////		    else 
////		    {
////		        document.form1.PPT.value ="";
////		    }
			document.form1.PPT.readOnly = true;
		}
		else if(document.form1.MODETYPE.value == "Select")
		{
		  document.form1.PPT.readOnly = true;
		}
	else 
		{
			if(parseInt(document.form1.TERM.value) <10 )
			{
				alert("For Limited Premium type, Policy Term should be greater than 10 years");
				document.form1.TERM.focus();
				document.form1.PPT.value = 0;
				document.form1.PPT.readOnly = true;
			}
			else
			{
//			    document.form1.PPT.value = 0;
				document.form1.PPT.readOnly = false;
			}
		}
		
}
function change_SAImaan()
{
var val;
   //var amt_inst_pre = document.form1.PREMIUM.value;
   if ( document.form1.MODE.value == "Select" ){val = 0;};
   if ( document.form1.MODE.value == "Yearly" ){val = 1;};
   if ( document.form1.MODE.value == "Half Yearly" ){val = 2;};
   if ( document.form1.MODE.value == "Quarterly" ){val = 4;};
   if ( document.form1.MODE.value == "Monthly" ){val = 12;};

	if(document.form1.PREMIUM.value!="" && document.form1.TERM.value!="")
	{
	  var sum_ass = parseFloat(document.form1.PREMIUM.value * val)*(parseFloat(document.form1.TERM.value)/2);
	   document.form1.SA.value=Math.ceil(sum_ass);
	}
	else
	{
		document.form1.SA.value ="";
	}
	document.form1.SA.readOnly=true;
}
//+++++++++++++++++++++End Imaan Plan+++++++++++++++++++++++++++++++++++



//______________________super golden year plan value_________________________
  function checkFundwithRSGYP()
	{
	   var mode = (document.form1.Mode.value);
	   var ann_prm = parseInt(document.form1.A_Prem.value);
	   var cap_sec_fund=parseInt(document.form1.PCSF.value);
	   var bal_fund=parseInt(document.form1.PBF.value);
	   var growth_fund=parseInt(document.form1.PGF.value);
	   var equity_fund=parseInt(document.form1.PEF.value);
	   var pure_fund = parseInt(document.form1.PPEF.value);
	   var infra_fund = parseInt(document.form1.PIF.value);
	   var energy_fund = parseInt(document.form1.PENF.value);
	   var mid_fund =parseInt(document.form1.PMDF.value);
	   var totalfund=parseInt(cap_sec_fund)+parseInt(bal_fund)+parseInt(growth_fund)+parseInt(equity_fund)+ parseInt(pure_fund) + parseInt(infra_fund) + parseInt(energy_fund) + parseInt(mid_fund);
	   var min_SA = (ann_prm * 5);
	   var max_SA = (ann_prm * 50);

	   if(document.form1.txtName.value=="" || document.form1.txtName.value==null)
	   {
		alert("Please enter your/Customer's name.");
		document.form1.txtName.focus();
		return false;
	   }
	   if(document.form1.txtAdvisor.value=="" || document.form1.txtAdvisor.value==null)
	   {
		alert("Please enter your/Advisor name");
		document.form1.txtAdvisor.focus();
		return false;
	   }
	   if(document.form1.Sex.value=="Select")
	   {
		alert("Please select your Sex");
		document.form1.Sex.focus();
		return false;
	   }
		if(document.form1.Age.value=="Select")
	   {
		alert("Please select your Age");
		document.form1.Age.focus();
		return false;
	   }
	   if(document.form1.Term.value=="" || document.form1.Term.value==null)
	   {
		alert("Please enter Policy Term");
		document.form1.Term.focus();
		return false;
	   }
	   if(document.form1.Mode.value=="Select")
	   {
		alert("Please select Mode of Premium Payment");
		document.form1.Mode.focus();
		return false;
	   }
	   if(document.form1.PREMIUM.value=="" || document.form1.PREMIUM.value==null || document.form1.PREMIUM.value==0)
	   {
		alert("Please enter Premium");
		document.form1.PREMIUM.focus();
		return false;
	   }
	   if(document.form1.SA1.value=="" || document.form1.SA1.value==null || document.form1.SA1.value==0)
	   {
		alert("Please enter basic Sum Assured.");
		document.form1.SA1.focus();
		return false;
	   }        
	   
		if(document.form1.Term.value<5)
	   {
		alert("minimum Policy Term should be 5");
		document.form1.Term.focus();
		return false;
	   }
	   if(document.form1.Mode.value=="Yearly" && document.form1.PREMIUM.value!="")
			{
				if(parseInt(document.form1.PREMIUM.value)<10000)
				{
				alert("minimum Installment Premium for Yearly is 10000.", "RELIANCE SUPER GOLDEN YEAR PLAN-PLUS ");
				document.form1.PREMIUM.focus();
				return false;
				}
			}
			else if(document.form1.Mode.value=="Half Yearly" && document.form1.PREMIUM.value!="")
			{
				if(parseInt(document.form1.PREMIUM.value)<5000)
				{
				alert("minimum Installment Premium for Half Yearly is 5000.", "RELIANCE SUPER GOLDEN YEAR PLAN-PLUS ");
				document.form1.PREMIUM.focus();
				return false;
				}
			}
			 else if(document.form1.Mode.value=="Quarterly" && document.form1.PREMIUM.value!="")           
			{
				if(parseInt(document.form1.PREMIUM.value)<2500)
				{
			   alert("minimum Installment Premium for Quarterly is 2500.", "RELIANCE SUPER GOLDEN YEAR PLAN-PLUS ");
				document.form1.PREMIUM.focus();
				return false;
				}
			}
			else if(document.form1.Mode.value=="Monthly" && document.form1.PREMIUM.value!="")            
			{
				if(parseInt(document.form1.PREMIUM.value)<1000)
				{
				alert("minimum Installment Premium for Monthly is 1000.", "RELIANCE SUPER GOLDEN YEAR PLAN-PLUS");
				document.form1.PREMIUM.focus();
				return false;
				}
			}
////////       if(totalfund!=100)
////////        {
////////          alert("The sum of proportion of all funds should be equal to 100%");
////////  	      document.form1.PCSF.focus();
////////  	       document.form1.PCSF.select();
////////	      return false;
////////        }
////////       if(cap_sec_fund>40)
////////        {
////////          alert("Money Market Fund can not exceed 40%");
////////	      document.form1.PCSF.focus();
////////	      return false;
////////        }
		if(document.form1.ChkADTPD.checked==true)
		 { 
		  var age=parseInt(document.form1.ADAge.value);
		  var termr=parseInt(document.form1.ADTerm.value);
		  var baseval=parseInt(document.form1.Term.value);
		  var baseSA=parseInt(document.form1.SA.value);
		  var asa=parseInt(document.form1.ADSA.value);
		  if(age==0)
		   {
			alert("Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Age.");
			document.form1.ADAge.focus();
			document.form1.ADAge.select();
			return false;
		   }
		  
		   //term nd sa
		  if(termr==0)
		   {
			 alert("Please enter the term for Reliance Accidental Death and Total and Permanent Disablement Rider.");
			 document.form1.ADTerm.focus();
			 document.form1.ADTerm.select();
			 return false;
			}
		 
			if(asa==0)
		   {
			 alert("Please enter sum assured for Reliance Accidental Death and Total and Permanent Disablement Rider.");
			 document.form1.ADSA.focus();
			 document.form1.ADSA.select();
			 return false;
			}
			if(age<18 || age>60)
		   {
			 alert("Invalid Rider Age. Please enter Reliance Accidental Death and Total and Permanent Disablement Rider Age between 18 and 60.");
			 document.form1.ADAge.focus();
			 document.form1.ADAge.select();
			 return false;
		   } 
		  if(termr<5 )
		   {
			alert("minimum Term for Reliance Accidental Death and Total and Permanent Disablement Rider should be 5");
			document.form1.ADTerm.focus();
			document.form1.ADTerm.select();
			return false;
		   } 
		  
			if(asa<25000 || asa>5000000)
			  {
			   alert("Reliance Accidental Death and Total and Permanent Disablement Rider Sum Assured should be greater than or equal to Rs. 25,000 and should not exceed Rs. 50,00,000.");
			   document.form1.ADSA.focus();
			   document.form1.ADSA.select();
			   return false;
			  }
		 
	   }
	   if(document.form1.chkTermliferider.checked==true)
		 { 
		  var age=parseInt(document.form1.TLBRAGE.value);
		  var termr=parseInt(document.form1.TLBRTERM.value);
		  var baseSA=parseInt(document.form1.SA.value);
		  var asa=parseInt(document.form1.TLBRSA.value);
		  var baseterm=parseInt(document.form1.Term.value);
		  if(age==0)
		   {
			alert("Please enter the age for Reliance Term Life Insurance Benefit Rider.");
			document.form1.TLBRAGE.focus();
			document.form1.TLBRAGE.select();
			return false;
		   }
		  
		   //term and sa
		  if(termr==0)
		   {
			 alert("Please enter the term for Reliance Term Life Insurance Benefit Rider.");
			 document.form1.TLBRTERM.focus();
			 document.form1.TLBRTERM.select();
			 return false;
			}
		  
			if(asa==0)
		   {
			 alert("Please enter sum assured for Reliance Term Life Insurance Benefit Rider.");
			 document.form1.TLBRSA.focus();
			 document.form1.TLBRSA.select();
			 return false;
			}
			if(age<18 || age>59)
		   {
			 alert("Invalid Rider Age. Please enter Reliance Term Life Insurance Benefit Rider Age between 18 and 59.");
			 document.form1.TLBRAGE.focus();
			 document.form1.TLBRAGE.select();
			 return false;
		   } 
		   if(termr<5 || termr>30)
		   {
			alert("Term for Reliance Term Life Insurance Benefit Rider should be between 5 and 30");
			document.form1.TLBRTERM.focus();
			document.form1.TLBRTERM.select();
			return false;
		   } 
		  if(asa<25000 || asa>baseSA)
		  {
		   alert("Reliance Term Life Insurance Benefit Rider Sum Assured should be greater than or equal to Rs. 25,000 and should not exceed Basic Sum Assured.");
		   document.form1.TLBRSA.focus();
		   document.form1.TLBRSA.select();
		   return false;
		  }
	   }
	   if(document.form1.chkmajor.checked==true)
		 { 
		  var age=parseInt(document.form1.MSBRAGE.value);
		  var termr=parseInt(document.form1.MSBRTERM.value);
		  var baseSA=parseInt(document.form1.SA.value);
		  var asa=parseInt(document.form1.MSBRSA.value);
		  
		  if(age==0)
		   {
			alert("Please enter the age for Reliance New Major Surgical Benefit Rider.");
			document.form1.MSBRAGE.focus();
			document.form1.MSBRAGE.select();
			return false;
		   }
		  
		   //term and sa
		  if(termr==0
