var isNS4 = false;
var isIE4 = false;
var isW3C = false;
var displayNav = "";
var toggle = false;
var docObj;
	
if (document.layers) {   
	isNS4 = true;
	docObj = "document.";
	styleObj = "";
	}
else if (document.all && !document.getElementById) {  
	isIE4 = true;
	docObj = "document.all.";
	styleObj = ".style";
	}
else if (document.getElementById && document.all) {  
	isW3C = true;
	docObj = "document.getElementById('";
	styleObj = "').style";
	}
else if (document.getElementById) { 
	isW3C = true;
	docObj = "document.getElementById('";
	styleObj = "').style";
	}
	
var gDate;
var gYear;

function setdate() {
  gDate= new Date();
  gYear= gDate.getYear();
  if (gYear< 1000)
     gYear+= 1900;
}
function putDate(doc) {
  monthNames = new Array("January","February","March","April","May", 
    "June","July","August","September", "October", "November", "December");
  dayNames = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
  setdate();
  doc.write(dayNames[gDate.getDay()] + ", " +  monthNames[gDate.getMonth()] +
    "  " + gDate.getDate() + ", " + gYear);
}
function putDateTime(doc) {
  var s = getClockTime();
  monthNames = new Array("January","February","March","April","May", 
    "June","July","August","September", "October", "November", "December");
  dayNames = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
  setdate();
  doc.write(dayNames[gDate.getDay()] + ", " +  monthNames[gDate.getMonth()] +
    "  " + gDate.getDate() + ", " + gYear + "&nbsp;-&nbsp;" + s);
}
function putTime(doc) {
  var s = getClockTime();
  doc.write(s);
}
function getClockTime()
{
   var now    = new Date();
   var hour   = now.getHours();
   var minute = now.getMinutes();
   var second = now.getSeconds();
   var ap = "AM";
   if (hour   > 11) { ap = "PM";             }
   if (hour   > 12) { hour = hour - 12;      }
   if (hour   == 0) { hour = 12;             }
   if (hour   < 10) { hour   = "0" + hour;   }
   if (minute < 10) { minute = "0" + minute; }
   if (second < 10) { second = "0" + second; }
   var timeString = hour +
                    ':' +
                    minute +
                    ':' +
                    second +
                    " " +
                    ap;
   return timeString;
} 
function putcopyright(doc) {
  setdate();
  doc.write("&copy; " + gYear + "  Legal and General America");
} 
function put17copyright(doc) {
  setdate();
  //doc.write("&copy; " + gYear + " Banner Life Insurance Company, Urbana MD 21704 All Rights Reserved.  Banner Life Insurance Company is a Legal & General America Company, a subsidiary of Legal & General Group Plc. Banner Life Insurance Company is domiciled in Maryland and is licensed to do business in 49 states and the District of Columbia.");
  doc.write("&copy; " + gYear + " Legal & General America.  All Rights Reserved. Our life insurance products are underwritten and issued by Banner Life Insurance Company, Urbana, MD and William Penn Life Insurance Company of New York, Garden City, NY.  Banner is licensed to do business in 49 states and the District of Columbia.  William Penn does business exclusively in New York; Banner does not solicit business there.");
}
function putcopyrightdefault(doc) {
  setdate();
  doc.write("&copy; " + gYear + " Banner Life Insurance Company (Urbana, MD) and William Penn Life Insurance Company of New York (Garden City, NY) are Legal & General America companies.  Banner's life insurance products are sold through independent life brokerage agencies in 49 states and the District of Columbia. Banner is not licensed to do business in New York and does not solicit business there. William Penn's products are sold exclusively in New York.");
}
function putWPcopyright(doc) {
  setdate();
  //doc.write("&copy; " + gYear + " William Penn Life Insurance Company of New York, Garden City, NY 11530. All Rights Reserved.  William Penn Life Insurance Company of New York is a Legal & General America Company, a subsidiary of Legal & General Group Plc and is domiciled and licensed to only conduct business in New York.");
  doc.write("&copy; " + gYear + " Legal & General America.  All Rights Reserved. Our life insurance products are underwritten and issued by Banner Life Insurance Company, Urbana, MD and William Penn Life Insurance Company of New York, Garden City, NY.  Banner is licensed to do business in 49 states and the District of Columbia.  William Penn does business exclusively in New York; Banner does not solicit business there.");
}
function putb2bcopyright(doc) {
  setdate();
  doc.write("&copy; " + gYear + " Legal & General America.  All Rights Reserved. Our life insurance products are underwritten and issued by Banner Life Insurance Company, Urbana, MD and William Penn Life Insurance Company of New York, Garden City, NY.  Banner is licensed to do business in 49 states and the District of Columbia.  William Penn does business exclusively in New York; Banner does not solicit business there.");
}
function put17foot(doc) {
  doc.write("<p class=\"style3\"><a href=\"/newcscontact.htm\">Contact Us</a> | <a href=\"/newpriv.htm\">Privacy Policy</a> | <a href=\"/newsec.htm\">Security</a> | <a href=\"/newwhyban.htm\">Careers</a> | <a href=\"/newnews.htm\">News</a> | <a href=/wpmainsave.htm>William Penn</a> | <a href=\"/newsite.htm\">Site Map</a></p>");
}
function putWPfoot(doc) {
  doc.write("<p class=\"style3\"><a href=\"/wpcscontact.htm\">Contact Us</a> | <a href=\"/wppriv.htm\">Privacy Policy</a> | <a href=\"/wpsecurity.htm\">Security</a> | <a href=\"/wpwhywp.htm\">Careers</a> | <a href=\"/wpnews.htm\">News</a> | <a href=/newbannermainsave.htm>Banner</a> | <a href=\"/wpsite.htm\">Site Map</a></p>");
}
function put17footbus(doc) {
  doc.write("<p class=\"style3\"><a href=\"/announce/privacypolicy.pdf\" target=_blank>Privacy Policy</a> | <a href=\"/announce/security.pdf\" target=_blank>Security</a></p>");
}
function putWPfootbus(doc) {
  doc.write("<p class=\"style3\"><a href=\"/announce/privacypolicy.pdf\" target=_blank>Privacy Policy</a> | <a href=\"/announce/security.pdf\" target=_blank>Security</a></p>");
}
function addOption(selectbox, text,value) {
var optn = document.createElement("OPTION");
  optn.text = text;
  optn.value = value;
  selectbox.options.add(optn);
}
function puthdrag(doc) {
  //doc.write("<div style=\"float: right; height: 25px; width: 960px;\">" +
  //  "<a target=\"_self\" href=\"/newagloginban.htm\">" +
 //   "<img style=\"float: right; margin-right: 40px; margin-top: 10px;\" name=\"aglog\" alt=\"\" src=\"images/aglogin100wt1.png\" width=\"100\"  height=\"25\"></a></div>");
  //puttxtsz(doc);
  doc.write("<div style=\"float: right; height: 25px; width: 960px;\">" +
    "<a target=\"_self\" href=\"/cgi-bin/recentnewsd.exe?curco=17\">" +
    "<img style=\"float: right; margin-right: 40px; margin-top: 10px;\" name=\"aglog\" alt=\"\" src=\"images/aglogin100wt1.png\" width=\"100\"  height=\"25\"></a></div>");
  //puttxtsz(doc);
}
function puthdragwp(doc) {
 // doc.write("<div style=\"float: right; height: 25px; width: 960px;\">" +
 //   "<a target=\"_self\" href=\"/wpaglogin.htm\">" +
 //   "<img style=\"float: right; margin-right: 40px; margin-top: 10px;\" name=\"aglog\" alt=\"\" src=\"images/aglogin100wt1.png\" width=\"100\"  height=\"25\"></a></div>");
   doc.write("<div style=\"float: right; height: 25px; width: 960px;\">" +
    "<a target=\"_self\" href=\"/cgi-bin/recentnewsd.exe?curco=WP\">" +
    "<img style=\"float: right; margin-right: 40px; margin-top: 10px;\" name=\"aglog\" alt=\"\" src=\"images/aglogin100wt1.png\" width=\"100\"  height=\"25\"></a></div>");

  //puttxtsz(doc);
}
function puthdr(doc) {
  doc.write("<div style=\"float: right; height: 25px; width: 960px;\"></div>");
  //puttxtsz(doc);
}
function puttxtsz(doc) {
   doc.write("<div style=\"float: right; height: 18px; width: 960px; margin-top: 20px; margin-right: 10px\">" +
  "<img class=\"flsz22\" name=\"txt_lrg\" id=\"txt_lrg\" onclick=\"setActiveStyleSheet('Large Text');return false;\" src=\"examp1_images/text_size_lrg_off.gif\" alt=\"\">" +
   "<img class=\"flsz22\" name=\"txt_med\" id=\"txt_med\" onclick=\"setActiveStyleSheet('Medium Text');return false;\" src=\"examp1_images/text_size_med_off.gif\" alt=\"\">" +
   "<img class=\"flsz22\" name=\"txt_sm\" id=\"txt_sm\" onclick=\"setActiveStyleSheet('Small Text');return false;\" src=\"examp1_images/text_size_sml_off.gif\" alt=\"\">" +
   "<div><span class=\"changetextsz\">Change Text Size</span></div>" +
   "</div>)");
}
function getpolicy() {
  var defpolicy = '';
  var apolicy = '';
  if (typeof document.webdirector.rpolicy != "undefined")
    defpolicy = document.webdirector.rpolicy.value;
  apolicy = prompt('Enter the policy number you would like reissued.', defpolicy);
  if ((apolicy == '') || (apolicy == null))  
    return;
  if ((apolicy.length > 10) || (apolicy.length  < 9))
  { 
    window.alert('The policy number was invalid.  Please try again.');
    return; 
  }
  else
  { 
    document.webdirector.policy.value = apolicy;
    submitnew('penddispd.exe','20','99999999','next');
  }
}
function Trim(TRIM_VALUE){
 if(TRIM_VALUE.length < 1)
 {
  return"";
 }
 TRIM_VALUE = RTrim(TRIM_VALUE);
 TRIM_VALUE = LTrim(TRIM_VALUE);
 if(TRIM_VALUE==""){
  return "";
 }
 else{
 return TRIM_VALUE;
 }
}
 
function RTrim(VALUE){
 var w_space = String.fromCharCode(32);
 var v_length = VALUE.length;
 var strTemp = "";
 if(v_length < 0){
   return"";
}
 var iTemp = v_length -1;
 
 while(iTemp > -1){
 if(VALUE.charAt(iTemp) == w_space){ 
 }
 else{
 strTemp = VALUE.substring(0,iTemp +1);
 break;
 }
 iTemp = iTemp-1;
 
 } //End While
 return strTemp;
 
} //End Function
 
function LTrim(VALUE){
 var w_space = String.fromCharCode(32);
 if(v_length < 1)
 {
  return"";
 }
 var v_length = VALUE.length;
 var strTemp = "";
 
 var iTemp = 0;
 
 while(iTemp < v_length)
 {
  if(VALUE.charAt(iTemp) == w_space)
  {
  }
  else
  {
    strTemp = VALUE.substring(iTemp,v_length);
    break;
   }
 iTemp = iTemp + 1;
 } //End While
return strTemp;
} //End Function
function docombine(afunc) {
  var haschecked = false;
  for (i=3; i < document.main_form.elements.length ; i++) 
    if (document.main_form.elements[i].checked) {
     haschecked = true;
     break;
  }     
  if (haschecked) {
    document.main_form.elements.func.value = afunc;
    document.main_form.submit();
    return; 
  } else
    window.alert('Nothing selected for combine');
} 
