
<!--

function redirectFromASP(sAction, sSection, sP1, sP2, sP3, sP4, sP5, sP6, sP7, sP8, sP9, sP10) {
	var BCOrequest = "";
	BCOrequest += "../bco.pl/post?";
        BCOrequest += "default_action=" + sAction + "&";
        BCOrequest += "Section=" + sSection;
	if (sP1 !== undefined && sP1 !== "") {BCOrequest += "&Parm1=" + sP1;}
        if (sP2 !== undefined && sP2 !== "") {BCOrequest += "&Parm2=" + sP2;}
        if (sP3 !== undefined && sP3 !== "") {BCOrequest += "&Parm3=" + sP3;}
        if (sP4 !== undefined && sP4 !== "") {BCOrequest += "&Parm4=" + sP4;}
        if (sP5 !== undefined && sP5 !== "") {BCOrequest += "&Parm5=" + sP5;}
        if (sP6 !== undefined && sP6 !== "") {BCOrequest += "&Parm6=" + sP6;}
        if (sP7 !== undefined && sP7 !== "") {BCOrequest += "&Parm7=" + sP7;}
        if (sP8 !== undefined && sP8 !== "") {BCOrequest += "&Parm8=" + sP8;}
        if (sP9 !== undefined && sP9 !== "") {BCOrequest += "&Parm9=" + sP9;}
        if (sP10 != undefined && sP10 !== "") {BCOrequest += "&Parm10=" + sP10; }
	
	window.top.location.href = BCOrequest ;
	return true;
}

var timerID = null;
function setAutoLogout() {
	var nMins = 0;
	switch(getCookie('SYSNAME')) 
	{
		case 'CA' :
			nMins = 120;
			break;
		case 'CC' :
			nMins = 999;
			break;	
		default :
			nMins = 20; //PA
			break;
	}

	if (location.host.indexOf("wdeviis") >= 0 ) { 
		nMins = 99; 
	}	
	var cMins = ''+nMins+'';
	timerID = setInterval('startLogout('+cMins+')', (nMins*60000));
	return true;
}
function clearAutoLogout() {
	clearInterval(timerID);
	return true;
}
function reStartTimer() {
	clearInterval(timerID);
	setAutoLogout();
	return true;
}

function startLogout(cMins) {
	clearAutoLogout();
	if (typeof(document.menuform)=='undefined') {
		reStartTimer();
		return false;
	}
    var l1 = 'Your session has been inactive for '+cMins+' minutes and has expired.\r\n\r\nPlease do not use the \'Back\' button.\r\n';
	alert(l1);
	document.menuform.DEFAULT_ACTION.value='LOGOUT'
	document.menuform.submit();
	return true;
}

    var gbDebug = false;
    var browser_name = navigator.appName;
    var browser_version = navigator.appVersion;
    var browser_handle = "";
    if (browser_name == "Microsoft Internet Explorer") {
        if (browser_version.substring("compatible")) {
            var browser_version_number = 
                parseFloat(browser_version.substring(browser_version.indexOf("MSIE")+5));
            if (browser_version_number < 4) {
                browser_handle = "IE3";
            }
            else {
                browser_handle = "IE4++";
            }
        }
        else {
            browser_version_number = parseFloat(browser_version);
            browser_handle = "IE" + browser_version_number;
        }
    }
    if (browser_name == "Netscape") {
        browser_version_number = parseFloat(browser_version);
        if (browser_version_number < 3) {
            browser_handle = "Nav2";
        }
        else if (browser_version_number < 4) {
            browser_handle = "Nav3";
        }
        else {
            browser_handle = "Nav4++";
        }
    }
	if (browser_name == "Opera") {
        browser_version_number = parseFloat(browser_version);
        if (browser_version_number < 4) {
            browser_handle = "Opera3";
        }
        else if (browser_version_number < 5) {
            browser_handle = "Opera4";
        }
        else {
            browser_handle = "Opera5++";
        }
    }
    if (browser_handle == "") {
        browser_handle = "IE3";
    }
function clean_number(s)
{
    var pos;
    if (s.length == 0) { return "0"; }
    while ((pos = s.indexOf(",")) != -1) {
        s = s.substring(0, pos) + s.substring(pos+1, s.length);
    }
    return s;
}
function count_decimals(s)
{
    var pos;
    if (s.length == 0) { return "0"; }
    if ((pos = s.lastIndexOf(".")) != -1) {
        s =  s.substring(pos+1, s.length);
	return s.length;
    }
    return 0;
}
function is_integer(s, name, alert_p)
{
    s = clean_number(s);
    var i = parseInt(s, 10); 
    if ((browser_handle == "Nav2") || (browser_handle == "IE3")) {
        if (i == 0) {
            if ((s.length == 0) || (s.substring(0,1) != "0")) {
                i = null;
            }
        }
    }
    else if (isNaN(i)) {
        i = null;
    }
    var istring = "" + i;
    if (istring != s) { i = null; }
    if ((i == null) && alert_p) {
        alert("Couldn't interpret '" + s + "' as " + name + ".\n" +
              "Expected a whole number.");
    }
    return i;
}
function is_integer_in_range(s, name, alert_p, min, max, factor)
{
    var i = is_integer(s, name, true);
    if (i == null) { return i; }
    if (i < min) {
        if (alert_p) {
            alert(name + " must be greater than or equal to " + min + ".\n" +
                  "Received " + i);
        }
        return null;
    }
    if ((max != null) && (i > max)) {
        if (alert_p) {
            alert(name + " must be less than or equal to " + max + ".\n" +
                  "Received " + i);
        }
        return null;
    }
    if (factor != null) {
        return is_integer_multiple(s, name, alert_p, factor);
    }
    return i;
}
function is_integer_multiple(s, name, alert_p, factor)
{
    var i = is_integer(s, name, true);
    if (i == null) { return i; }
    if ((i % factor) != 0) {
        if (alert_p) {
            alert(name + " must be a multiple of  " + factor + ".\n" +
                  "Received " + i);
        }
        return null;
    }
    return i;
}
function is_float(s, name, alert_p)
{
    s = clean_number(s);
    var i = parseFloat(s);
    if ((browser_handle == "Nav2") || (browser_handle == "IE3")) {
        if (i == 0) {
            if ((s.length == 0) || (s.substring(0,1) != "0")) {
                i = null;
            }
        }
    }
    else if (isNaN(i)) {
        i = null;
    }
    if ((i == null) && alert_p) {
        alert("Couldn't interpret '" + s + "' as " + name + ".\n" +
              "Expected a real number.");
    }
    return i;
}
function is_float_in_range(s, name, alert_p, min, max)
{
    var i = is_float(s, name, true);
    if (i == null) { return i; }
    if (i < min) {
        if (alert_p) {
            alert(name + " must be greater than or equal to " + min + ".\n" +
                  "Received " + i);
        }
        return null;
    }
    if ((max != null) && (i > max)) {
        if (alert_p) {
            alert(name + " must be less than or equal to " + max + ".\n" +
                  "Received " + i);
        }
        return null;
    }
    return i;
}
function is_money(s, name, alert_p)
{
    s = clean_number(s);
    var i = parseFloat(s);
    var decplace=count_decimals(s);
    if ((browser_handle == "Nav2") || (browser_handle == "IE3")) {
        if (i == 0) {
            if ((s.length == 0) || (s.substring(0,1) != "0")) {
                i = null;
            }
        }
    }
    else if (isNaN(i)) {
        i = null;
    }
    if ((i == null || decplace > 2 ) && alert_p) {
        alert("Couldn't interpret '" + s + "' as " + name + ".\n" +
              "Expected dollars and cents.");
    }
    return i;
}
function is_money_in_range(s, name, alert_p, min, max)
{
    var i = is_money(s, name, true);
    if (i == null) { return i; }
    if (i < min) {
        if (alert_p) {
            alert(name + " must be greater than or equal to " + min + ".\n" +
                  "Received " + i);
        }
        return null;
    }
    if ((max != null) && (i > max)) {
        if (alert_p) {
            alert(name + " must be less than or equal to " + max + ".\n" +
                  "Received " + i);
        }
        return null;
    }
    return i;
}
function is_date(s, name, alert_p)
{
    var d = make_simpleDate(s);
    if (d.errmsg != null) {
        if (alert_p) {
            alert("Couldn't interpret '" + s + "' as " + name + ".\n" +
                  "Error reading date:\n" + d.errmsg);
        }
        return null; 
    }
    else {
        return s;
    }
}
function is_date_in_range(s, name, alert_p, a, b)
{
    if (is_date(s, name, true) == null) { return null; }
    var d = make_simpleDate(s);
     if (a != " ") {
     	if (date_compare(a, d) < 0) {
        	if (alert_p) {
            	alert(name + " must be on or after " + format_date(a) + ".\n" +
                	  "Received " + format_date(d));
        	}
        	return null;
  	  }
    }
      if (b != " ") {
    	if (date_compare(d, b) < 0) {
        	if (alert_p) {
           	 alert(name + " must be on or before " + format_date(b) + ".\n" +
            	      "Received " + format_date(d));
       		 }
       		 return null;
   	 }
      }
    return s;
}
function check_field(e, name, type, min, max, factor)
{
    var val = e.value;
    var check;
    if ((type == 'd') || (type == 'date')) {
        if (min != null) {
            check = is_date_in_range(val, name, true, min, max);
        }
        else {
            check = is_date(val, name, true);
        }
    }
    else if ((type == 'f') || (type == 'float')) {
        if (min != null) {
            check = is_float_in_range(val, name, true, min, max);
        }
        else {
            check = is_float(val, name, true);
        }
        if (check != null) {
            e.value = clean_number(val);
        }
    }
    else if ((type == 'i') || (type == 'int') || (type == 'integer')) {
        if (min != null) {
            check = is_integer_in_range(val, name, true, min, max, factor);
        }
        else {
            check = is_integer(val, name, true);
        }
        if (check != null) {
            e.value = clean_number(val);
        }
    }
    else if ((type == 'm') || (type == 'mon') || (type == 'money')) {
        if (min != null) {
            check = is_money_in_range(val, name, true, min, max, factor);
        }
        else {
            check = is_money(val, name, true);
        }
        if (check != null) {
            e.value = clean_number(val);
        }
    }
    if (check == null) {
	e.value = '';
        e.focus();
        return false;
    }
    else {
        return true;
    }
}
function make_simpleDate(s)
{
    var i; 
    var j; 
    var simpleDate = new Object(); 
    simpleDate.errmsg = null; 
    var possible_separators = new Object();
    possible_separators[0] = "/";
    possible_separators[1] = "-";
    possible_separators[2] = ".";
    possible_separators[3] = " ";
    var possible_separators_max = 3;
    var sep;
    i = -1;
    j = -1;
    while ((i < 0) && (j++ < possible_separators_max)) {
        i = s.indexOf(possible_separators[j]);
    }
    if (i < 0) {
        simpleDate.errmsg = "unknown date format, couldn't determine separator";
        return simpleDate;
    }
    sep = possible_separators[j];
    j = s.indexOf(sep, i+1);
    if (j < 0) {
        simpleDate.errmsg = "couldn't find more than one separator [" + sep + "]";
        return simpleDate;
    }
    var sMonth;
    var sDate;
    var sYear;
    if (sep == " ") {
        sDate = s.substring(0, i);
        sMonth = s.substring(i+1, j);
        sYear = s.substring(j+1);
    }
    else {
        sMonth = s.substring(0, i);
        sDate = s.substring(i+1, j);
        sYear = s.substring(j+1);
    }
    var month;
    if (sep == " ") {
        var month_names = new Object();
        month_names["jan"] = 1;
        month_names["feb"] = 2;
        month_names["mar"] = 3;
        month_names["apr"] = 4;
        month_names["may"] = 5;
        month_names["jun"] = 6;
        month_names["jul"] = 7;
        month_names["aug"] = 8;
        month_names["sep"] = 9;
        month_names["oct"] = 10;
        month_names["nov"] = 11;
        month_names["dec"] = 12;
        var mname = sMonth.substring(0, 3).toLowerCase();
        month = month_names[mname];
        if (month == null) {
            simpleDate.errmsg = "couldn't figure out month from '" + mname + "'";
            return simpleDate;
        }
    }
    else {
        month = parseInt(sMonth, 10);
        if (((browser_handle == "IE3") && (month == 0)) || isNaN(month)) {
            simpleDate.errmsg = "couldn't figure out month number from '" + sMonth + "'";
            return simpleDate;
        }
    }
    var date = parseInt(sDate, 10);
    if (((browser_handle == "IE3") && (date == 0)) || isNaN(date)) {
        simpleDate.errmsg = "couldn't figure out day of the month from '" + sDate + "'";
        return simpleDate;
    }
    var year = parseInt(sYear, 10);
    if (((browser_handle == "IE3") && (year == 0)) || isNaN(year)) {
        simpleDate.errmsg = "couldn't figure out year from '" + sYear + "'";
        return simpleDate;
    }
    if (year < 0) { 
        simpleDate.errmsg = "year can't be negative: " + year;
        return simpleDate;
    }
    if (year < 1000) { 
        simpleDate.errmsg = "year must be four digits " + year;
        return simpleDate;
    }
    if ((month < 1) || (month > 12)) {
        simpleDate.errmsg = "month number must be between 1 and 12: " + month;
        return simpleDate;
    }
    var days_per_month = new Object();
    days_per_month[1] = 31;
    addfactor = 0;
    if ((year%4 == 0  && year%100 !=0) || (year%100 == 0 && year%400 == 0))
	{
	addfactor = 1; 
	}
    days_per_month[2] = 28 + addfactor;
    days_per_month[3] = 31;
    days_per_month[4] = 30;
    days_per_month[5] = 31;
    days_per_month[6] = 30;
    days_per_month[7] = 31;
    days_per_month[8] = 31;
    days_per_month[9] = 30;
    days_per_month[10] = 31;
    days_per_month[11] = 30;
    days_per_month[12] = 31;
    if ((date < 1) || (date > days_per_month[month])) {
        simpleDate.errmsg = "day of the month must be between 1 and " + days_per_month[month] + ": " + date;
        return simpleDate;
    }
    simpleDate.year = year;
    simpleDate.month = month;
    simpleDate.date = date;
    return simpleDate;
}
function now_simpleDate()
{
    var now = new Date();
    var simpleDate = new Object();
    if (browser_handle == "Nav3") {
        var year = now.getYear();
        if (year < 2000) {
            year = year + 1900;
        }
        simpleDate.year = year;
    }
    else {
        simpleDate.year = now.getFullYear();
    }
    simpleDate.month = now.getMonth() + 1;
    simpleDate.date = now.getDate();
    return simpleDate;
}
function months_until_date(datestring)
{
    var then = make_simpleDate(datestring);
    if (then.errmsg != null) {
        return null;
    }    
    var now = now_simpleDate();
    var mdiff = then.month - now.month;
    if (mdiff < 0) { mdiff = 12 + mdiff; }
    return mdiff;
}
function date_compare(sd1, sd2)
{
    sdd = date_diff(sd1, sd2);
    if (sdd.year > 0) {
        return -1;
    }
    else if (sdd.year == 0) {
        if (sdd.month > 0) {
            return -1;
        }
        else if (sdd.month == 0) {
            if (sdd.date > 0) {
                return -1;
            }
            else if (sdd.date == 0) {
                return 0;
            }
            else {
                return 1;
            }
        }
        else {
            return 1;
        }
    }
    else {
        return 1;
    }
}
function date_diff(sd1, sd2)
{
    sdd = new Object();
    sdd.year = sd1.year - sd2.year;
    sdd.month = sd1.month - sd2.month;
    sdd.date = sd1.date - sd2.date;
    return sdd;
}
function month_diff(sd1, sd2)
{
    var ydiff = year_diff(sd1, sd2);
    var mdiff = sd1.month - sd2.month;
    return ydiff * 12 + mdiff;
}
function year_diff(sd1, sd2)
{
    return sd1.year - sd2.year;
}
function age_in_years(datestring)
{
    var then = make_simpleDate(datestring);
    if (then.errmsg != null) {
        return null;
    }    
    var now = now_simpleDate();
    var ydiff = now.year - then.year;
    if (now.month > then.month) {
        return ydiff;
    }
    else if (now.month < then.month) {
        return ydiff - 1;
    }
    else if (now.date >= then.date) {
        return ydiff;
    }
    else {
        return ydiff - 1;
    }
}
function decode_date(s)
{
    var d = make_simpleDate(s);
    if (d.errmsg != null) {
        Alert("Error creating simpleDate object: " + d.errmsg);
        return null;
    }
    else {
        return format_date(d);
    }
}
function format_date(sd)
{
    return sd.month + "/" + sd.date + "/" + sd.year;
}
function fmtFix(sNum, fixpoint)
{
    var ptPos = sNum.indexOf(".");
    var ptFix; 
    if (0 < ptPos) { 
        if (fixpoint == 0) {
            ptFix = ptPos;
        }
        else {
            ptFix = ptPos + 1 + fixpoint;
        }
        if (ptFix < sNum.length) { 
            sNum = sNum.substring(0, ptFix);
        }
    }
	return sNum;
}
function getCookie(theCookie) {
  var wLength = theCookie.length;        
  var cLength = document.cookie.length;  
  var i = 0;                             
  var cEnd = 1;                          
  while ((i < cLength) && (cEnd > 0)) {  
    var j = i + wLength;                 
    cEnd = document.cookie.indexOf(";",i); 
    if (document.cookie.substring(i,j) == theCookie) { 
      if (cEnd == -1) {                  
        cEnd = cLength;                  
      }
      return unescape(document.cookie.substring(j+1,cEnd));
    }
    i = cEnd + 2;  
  }
  return " ";
}
function original_getCookie(theCookie) {
  var wLength = theCookie.length
  var cLength = document.cookie.length
  var i = 0
  while (i < cLength) {
    var j = i + wLength
    if (document.cookie.substring(i,j) == theCookie) {
      var cEnd = document.cookie.indexOf(";",j)
      if (cEnd == -1) {
        cEnd = document.cookie.length
      }
    return unescape(document.cookie.substring(j+1,cEnd))
    }
    i++
  }
  return " "
}
function SetCookie (name, value) {
        var argv = SetCookie.arguments;
        var argc = SetCookie.arguments.length;
        var expires = (argc > 2) ? argv[2] : null;
        var path = (argc > 3) ? argv[3] : null;
        var domain = (argc > 4) ? argv[4] : null;
        var secure = (argc > 5) ? argv[5] : false;
        document.cookie = name + "=" + escape (value) +
                ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
                ((path == null) ? "" : ("; path=" + path)) +
                ((domain == null) ? "" : ("; domain=" + domain)) +
                ((secure == true) ? "; secure" : "");
}
function socValid(theobj) {
	var soc = theobj.value
	if (soc.length < 9) {
  		alert("Please enter a valid social security number before making a selection.");
		return false;
	}
  else {
		return true;
	}
}
var isNN = (navigator.appName.indexOf("Netscape")!=-1);
function autoTab(input,len, e) {
	var keyCode = (isNN) ? e.which : e.keyCode; 
	var filter = (isNN) ? [0,8,9] : [0,8,9,16,17,18,37,38,39,40,46];
		if(input.value.length >= len && !containsElement(filter,keyCode)) {
	   		input.value = input.value.slice(0, len);
	   		input.form[(getIndex(input)+1) % input.form.length].focus();
}
function containsElement(arr, ele) {
	var found = false, index = 0;
	while(!found && index < arr.length)
		if(arr[index] == ele)
	   		found = true;
		else
	   		index++;
	return found;
}
function getIndex(input) {
	var index = -1, i = 0, found = false;
	while (i < input.form.length && index == -1)
		if (input.form[i] == input)index = i;
		else i++;
return index;
}
return true;
}
function GetJSValue(selfcall) {
 if (selfcall == null) {
  setTimeout("GetJSValue(1)", 300);
 } else {
  if (navigator.appName.indexOf("Microsoft") != -1) {
   movieID = myMovie;
  } else {
   movieID = document.myMovie;
  }
  movieID.EvalScript("#incoming, " + document.forms[0].theField.value);
 }
}
var shortName = "NYLIM"
var longName = "New York Life Investment Management LLC"
var secName = "NYLIFE Distributors, Inc."
var secAddress = "169 Lackawanna Ave.  Parsippany, NJ 07054"
var webmasterEmail = "<A href='mailto:webmaster@nylim.com'>webmaster@nylim.com</A>"
function ValidEmail(email_str){
   var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/ ;
   var bres = true;
   if (re.test(email_str) == false){
      bres = false;
   }
   return bres;
}
function swapImages(toTheRadio)	{
	if (toTheRadio.value == 1)	{
			document.images[0].src = "/bco/pa/graphics/MSInfo_Chart1.gif" ;
			return true;
	}
	if (toTheRadio.value == 2)	{
			document.images[0].src = "/bco/pa/graphics/MSInfo_Chart2.gif" ;
			return true;
	}
	if (toTheRadio.value == 3)	{
			document.images[0].src = "/bco/pa/graphics/MSInfo_Chart3.gif" ;
			return true;
	}
}
function trim(s) { 
 return s.replace(/^\s+/, "").replace(/\s+$/, ""); 
} 
// -->


