<!--
//-->var pending_selection="";
//-->var medical_selection="";
var plan_selection="";
var acc=0
var show_time=false;
var timerID=null;
var blank=":"
var inforequired="";
var smokes ="";
var years = 0;

function FrontPage_Form1_Validator(request)
{
  if (request.Advisor.value == "")
     {
      alert("Please enter Advisor");
      request.Advisor.focus();
      return (false);
      }

  if (request.Client.value =="")
     {  
      alert("Please enter Client name");
      request.Client.focus();
      return (false);
      }
      
   if (request.Day1.value ==" ")
      {
       alert("Please enter Date of Birth");
        request.Day1.focus();
         return(false);
      }  
   if (request.Month1.value ==" ")
      {
       alert("Please enter Date of Birth");
        request.Month1.focus();
         return(false);
      } 
   if (request.Year1.value ==" ")
      {
       alert("Please enter Date of Birth");
        request.Year1.focus();
         return(false);
      } 
 startit()

     if (document.request.yrs.value < 18) 
      {
       alert("Sorry the Age is below the minimum of 18");
       request.Year1.focus();   
       return(false);
      }     
     
   if (request.Currency.value ==" ")
      {
       alert("Please enter a Currency");
        request.Currency.focus();
         return(false);
      }  
    
    if (request.Value.value =="")
      {
       alert("Please enter a Premium amount");
        request.Value.focus();
         return(false);
      } 
      
 if (request.Value.value < 25000)
      {
       alert("Premium amount below minimum value of 25,000");
        request.Value.focus();
         return(false);
      }   

 
  
  if (request.InvTotal.value != 100)
       {
        alert("Investment Percentage must total 100. Please check Inputs.")
         request.Inv1.focus();
          return(false);
       } 

<!-- Maturity age // -->

     
   
   return(true);     
     
       
<!-- Additional validation goes below here //-->     
}
<!-- Sum the Year totals //-->

function summate() {
        	var tot=0
	// Investment 1
        	checkyear = parseInt(request.Inv1.value);    
                    if (isNaN(checkyear))                
                      {
                       alert("Please enter a valid Number");
                       request.Inv1.focus();
                       return(false);
                      }
                 tot = tot + request.Inv1.value*1;
	
	// Investment 2	
		
        	 checkyear = parseInt(request.Inv2.value);    
                    if (isNaN(checkyear))                
                      {
                       alert("Please enter a valid Number");
                       request.Inv2.focus();
                       return(false);
                      }
                 tot = tot + request.Inv2.value*1; 

	// Investment 3

		checkyear = parseInt(request.Inv3.value);    
                    if (isNaN(checkyear))                
                      {
                       alert("Please enter a valid Number");
                       request.Inv3.focus();
                       return(false);
                      }
                 tot = tot + request.Inv3.value*1;

	// Investment 4
                  
		checkyear = parseInt(request.Inv4.value);    
                    if (isNaN(checkyear))                
                      {
                       alert("Please enter a valid Number");
                       request.Inv4.focus();
                       return(false);
                      }
                 tot = tot + request.Inv4.value*1;        

	// Investment 5

		checkyear = parseInt(request.Inv5.value);    
                    if (isNaN(checkyear))                
                      {
                       alert("Please enter a valid Number");
                       request.Inv5.focus();
                       return(false);
                      }
                 tot = tot + request.Inv5.value*1;
	
	// Investment 6

		checkyear = parseInt(request.Inv6.value);    
                    if (isNaN(checkyear))                
                      {
                       alert("Please enter a valid Number");
                       request.Inv6.focus();
                       return(false);
                      }
                 tot = tot + request.Inv6.value*1;
	// Total All                                      
        	request.InvTotal.value = tot;
        }

<!-- Age Calculation //-->
function stopit() {
if (show_time)
clearTimeout(timerID);
show_time=false;
}
function startit(form) {
var today=new Date();
var curyear=today.getYear()
if (curyear < 1000)
curyear+=1900
var acc1=acc;
var display_value =" Time:  " + curyear
if (today.getMinutes() < 10) {
display_value+=":0" + today.getMinutes();
}
else {
display_value+=":" + today.getMinutes();
}
if (today.getSeconds() < 10){
display_value+=":0" + today.getSeconds();
}
else {
display_value+=":" + today.getSeconds();
}
if
(today.getHours()>=12) {
display_value+=" P.M.  "
}
else {
display_value+=" A.M.  "
}
display_value += " Date:  " + (today.getMonth()+1) + "/" + today.getDate() + "/" + curyear; 
window.status=display_value; 
writeyourAge(acc1) 
timerID=setTimeout("startit()",100); 
show_time=true;
}
function writeyourAge(onval) {
if (onval == 0) {
normal()
} else {
accurate()
   }
}
function normal() {                             
TheDate = new Date();                     
Month = TheDate.getMonth();              
Day = TheDate.getDate();                 
Year = TheDate.getYear();
if (Year< 1000)
Year+=1900
Hour = TheDate.getHours();
Minute = TheDate.getMinutes();
Second = TheDate.getSeconds();   
by = (document.request.Year1.value);
bm = (document.request.Month1.value);
bd = (document.request.Day1.value);
BDate = Date.UTC(by,bm,bd);
if (Year<2000) {              
CDate = Date.UTC(Year,Month,Day,Hour,Minute,Second);
} else {
CDate = Date.UTC(Year,Month,Day,Hour,Minute,Second);
}
Age = CDate-BDate + (1000*60*60*24*30);  document.request.yrs.value = parseInt(((((Age/1000)/60)/60)/24)/365.25,10); 
}
function accurate() {
TheDate = new Date();                     
Month = TheDate.getMonth();                
Day = TheDate.getDate();                  
Year = TheDate.getYear();
if (Year< 1000)
Year+=1900
Hour = TheDate.getHours();
Minute = TheDate.getMinutes();
Second = TheDate.getSeconds();           
by = (document.request.year.value);
bm = (document.request.month.value);
bd = (document.request.date.value);
BDate = Date.UTC(by,bm,bd);
if (Year<2000) {              
CDate = Date.UTC(Year,Month,Day,Hour,Minute,Second);
} else {
CDate = Date.UTC(Year,Month,Day,Hour,Minute,Second);
}
Age = CDate-BDate + (1000*60*60*24*30); document.request.yrs.value = ((((Age/1000)/60)/60)/24)/365.25; 

}

<!--
// **BEGIN GENERIC VALIDATION FUNCTIONS**
// JavaScript sees numbers with leading zeros as octal values, so strip zeros
function stripZeros(inputStr) {
var result = inputStr
while (result.substring(0,1) == "0") {
result = result.substring(1,result.length)
}
return result
}

// general purpose function to see if an input value has been entered at all
function isEmpty(inputStr) {
if (inputStr == "" || inputStr == null) {
return true
}
return false
}

// general purpose function to see if a suspected numeric input 
// is a positive integer
function isNumber(inputStr) {
for (var i = 0; i < inputStr.length; i++) {
var oneChar = inputStr.substring(i, i + 1)
if (oneChar < "0" || oneChar > "9") {
return false
}
}
return true
}

// function to determine if value is in acceptable range for this application
function inRange(inputStr, lo, hi) {
var num = parseInt(inputStr)
if (num < lo || num > hi) {
return false
}
return true
}
// **END GENERIC VALIDATION FUNCTIONS**

function validateMonth(field) {
var input = stripZeros(field.value)
if (isEmpty(input)) {
alert("Be sure to enter a month value.")
select(field)
return false
} else {
if (!isNumber(input)) {
alert("Month Entries must be numbers only.")
select(field)
return false
} else {
if (!inRange(input,1,12)) {
alert("For Month Enter a number between 1 (January) and 12 (December).")
select(field)
return false
}
}
}
calcDate()
return true
}

function validateDate(field) {
var input = stripZeros(field.value)
if (isEmpty(input)) {
alert("Be sure to enter a date value.")
select(field)
return false
} else {
if (!isNumber(input)) {
alert("Day Entries must be numbers only.")
select(field)
return false
} else {
var monthField = document.request.month
if (!validateMonth(monthField)) return false
var monthVal = parseInt(monthField.value)
var monthMax = new Array(31,31,29,31,30,31,30,31,31,30,31,30,31)
var top = monthMax[monthVal]
if (!inRange(input,1,top)) {
alert("Enter a number between 1 and " + top + ".")
select(field)
return false
}
}
}
calcDate()
return true
}

function validateYear(field) {
var input = stripZeros(field.value)
if (isEmpty(input)) {
alert("Be sure to enter a month value.")
select(field)
return false
} else {
if (!isNumber(input)) {
alert("Entries must be numbers only.")
select(field)
return false
} else {
if (!inRange(input,1900,2005)) {
alert("Enter a number between 1900 and 2005.")
select(field)
return false
}
}
}
calcDate()
return true
}

function select(field) {
field.focus()
field.select()
}

function calcDate() {
var mm = parseInt(document.request.month.value) - 1
var dd = parseInt(document.request.date.value)
var yy = parseInt(document.request.year.value)
<!-- document.request.result.value = (new Date(yy,mm,dd)).toString() //-->
}


