var isSubmitted=0;var pfWin="";function gotoCalc(a){win=window.open(a,"Calculator","toolbar=no,location=no,scrollbars=yes,resizable=no,width=480,height=510,top="+((screen.availHeight-510)/2)+",left="+((screen.availWidth-480)/2))}function gotoLocator(a){win=window.open(a,"Logo","toolbar=no,location=no,scrollbars=yes,resizable=no,width=640,height=450,top="+((screen.availHeight-450)/2)+",left="+((screen.availWidth-640)/2))}function openPFfullWindow(c,b){var e="scrollbars=yes,toolbar=no,resizable=yes,menubar=no,location=no,status=yes,left=0,screenX=0,top=0,screenY=0,resizable";if(window.screen){var a=screen.availHeight-100;var d=screen.availWidth-10;e+=",height="+a;e+=",innerHeight="+a;e+=",width="+d;e+=",innerWidth="+d}pfWin=window.open(c,b,e);pfWin.focus()}function hasNumber(a){return/\d/.test(a)}function validateWhatsNewForm(e){var d=TrimString(e.email.value);var c=TrimString(e.name.value);c=c.toLowerCase();var b=/^\w+.*@(\w|-)+(\.\w+)+$/;var a=/@www./i;if(c==""||c=="name"||hasNumber(c)){alert("You must enter your Name in the Name field.");e.name.focus();e.name.select();return false}if(d==""){alert("Please enter your email address.");e.email.focus();return false}if(b.test(d)){if(a.test(d)){alert(""+d+" is an invalid email address!");e.email.select();e.email.focus();return false}else{return true}}else{alert(""+d+" is an invalid email address!");e.email.select();e.email.focus();return false}}function submitForm(e){if(isSubmitted==0){for(var b=0;b<e.length;b++){if(e.elements[b].name=="firstname"){if(e.firstname.value==""){alert("You must enter your first name in the First Name field");e.firstname.select();e.firstname.focus();return false}}if(e.elements[b].name=="lastname"){if(e.lastname.value==""){alert("You must enter your last name in the Last Name field");e.lastname.select();e.lastname.focus();return false}}if(e.elements[b].name=="email"){var g=e.email.value;var d=/^\w+.*@(\w|-)+(\.\w+)+$/;if(e.email.value==""){alert("You must enter your email address in the E-mail field.");e.email.select();e.email.focus();return false}if(!d.test(g)){alert(g+" is an invalid email address!");e.email.select();e.email.focus();return false}}if(e.elements[b].name=="address1"){if(e.address1.value==""){alert("You must enter your address in the Address1 field");e.address1.select();e.address1.focus();return false}}if(e.elements[b].name=="city"){if(e.city.value==""){alert("You must enter your city in the City field");e.city.select();e.city.focus();return false}}if(e.elements[b].name=="state"){if(e.state.selectedIndex==0){alert("You must enter your state");return false}}if(e.elements[b].name=="zip"){if(e.zip.value==""){alert("You must enter your zip in the Zip field");e.zip.select();e.zip.focus();return false}}if(e.elements[b].name=="phone"){if(e.phone.value==""){alert("You must enter your phone number in the Phone field");e.phone.select();e.phone.focus();return false}}if(e.elements[b].name=="requ_info"){var c=0;for(var a=0;a<e.requ_info.length;a++){if(e.requ_info[a].checked){c=1}}if(!c){alert("Please check off at least one product you are interested in.");return false}}if(e.elements[b].name=="subject"){if(e.subject.value==""){alert("You must enter your subject in the Subject field.");return false}}if(e.elements[b].name=="additionaltext"){if(e.additionaltext.value==""){alert("You must enter your feedback in the Feedback field.");e.additionaltext.select();e.additionaltext.focus();return false}}}e.formattedmessage.value=format_email(e);isSubmitted=1;return true}else{return false}}function getCookie(c){var d=c+"=";var b="";var e=0;var a=0;if(document.cookie.length>0){e=document.cookie.indexOf(d);if(e!=-1){e+=d.length;a=document.cookie.indexOf(";",e);if(a==-1){a=document.cookie.length}b=unescape(document.cookie.substring(e,a))}}return(b)}function getABSplitRandomWeight(ids,weights){var totalweight=eval(weights.join("+"));var weightedidlist=new Array();var currentid=0;while(currentid<ids.length){for(i=0;i<weights[currentid];i++){weightedidlist[weightedidlist.length]=ids[currentid]}currentid++}var randomnumber=Math.floor(Math.random()*totalweight);return weightedidlist[randomnumber]}function displayHide(c){var a=document.getElementById(c);var b=a.parentElement?a.parentElement:a.parentNode;if(a.style.display=="block"){a.style.display="none"}else{a.style.display="block"}}function TrimString(a){lTrimStr=a.replace(/^\s+/g,"");rTrimStr=lTrimStr.replace(/\s+$/g,"");return rTrimStr}function submitCommentsForm(f){var specialCharRE=/(&#60;|&#62;|&#91;|&#93;|&#123;|&#125;)/;var emailRE=/^\s*[0-9a-zA-Z]+([-_\.][0-9a-zA-Z]+)*@[0-9a-zA-Z]+([-_\.][0-9za-zA-Z]+)*\.[0-9a-zA-Z]{2,}\s*$/;var strName=TrimString(f.f_name.value);var strEmail=TrimString(f.f_email.value);var strComment=TrimString(f.f_comment.value);if(specialCharRE.test(strName)){alert("These Special Characters Are Not Permitted: < > { } [ ] in the Name field.");f.f_name.select();f.f_name.focus();return false}if(strName=="Enter Your Name"||strName==""){alert("You Must Enter Your Name");f.f_name.select();f.f_name.focus();return false}if(strEmail=="Enter Your Email"||strEmail==""){alert("You Must Enter Your Email Address");f.f_email.select();f.f_email.focus();return false}if(emailRE.test(strEmail)){}else{alert("Not a valid email address");f.f_email.select();f.f_email.focus();return false}if(strComment==""){alert("You Must Enter A Comment");f.f_comment.select();f.f_comment.focus();return false}if(strComment.length>500){alert("Comments have to be less than 500 characters, your current comment length is: "+f.f_comment.value.length);return false}if(specialCharRE.test(strComment)){alert("These Special Characters Are Not Permitted: < > { } [ ] in the comment field.");f.f_comment.select();f.f_comment.focus();return false}for(i=0;i<f.length;i++){var frmElement=f.elements[i];var tselect="f."+frmElement.name+".select();";var tfocus="f."+frmElement.name+".focus();";var tFrmElementValue=frmElement.value;for(var x=0;x<frmElement.value.length;x++){var tDecVal=frmElement.value.charCodeAt(x);if(tDecVal==60||tDecVal==62||tDecVal==91||tDecVal==93||tDecVal==123||tDecVal==125){if(frmElement.name=="f_name"){alert("These Special Characters Are Not Permitted: < > { } [ ] in the Name field.");eval(tselect);eval(tfocus);return false}if(frmElement.name=="f_comment"){alert("These Special Characters Are Not Permitted: < > { } [ ] in the Comment field");eval(tselect);eval(tfocus);return false}}}}return true}function clearText(a){if(a.defaultValue==a.value){a.value=""}}function onOptionChange(a){splitStr=a.options[a.selectedIndex].value.split("|");targetURL=splitStr[0];targetWindow=splitStr[1];if(targetWindow!=""&&targetWindow!=undefined){window.open(targetURL,targetWindow);a.selectedIndex=0}else{window.open(targetURL,"_top")}}function showQuiz(quizQuestions,quizAnswer){quizWindow=window.open("/script/blank.html","Quiz","toolbar=no,location=no,scrollbars=yes,resizable=no,width=551,height=550,top="+((screen.availHeight-510)/2)+",left="+((screen.availWidth-480)/2));quizWindow.focus();with(quizWindow.document){open();write('<html><head><title>New York Life-Quiz</title><script language="JavaScript">function disableRadioGroup (radioGroup, id) { if (!radioGroup.disabled) {  radioGroup.disabled = true;  if (document.all || document.getElementById) {    if (!radioGroup.length) { radioGroup.disabled = true;  } else { for (var b = 0; b < radioGroup.length; b++)  radioGroup[b].disabled = true; }  }  } else {  if (!radioGroup.length) { radioGroup.storedChecked = radioGroup.checked; radioGroup.oldOnClick = radioGroup.onclick;  radioGroup.onclick = preserveRadioGroup; } else {  for (var b = 0; b < radioGroup.length; b++) { radioGroup[b].storedChecked = radioGroup[b].checked;   radioGroup[b].oldOnClick = radioGroup[b].onclick; radioGroup[b].onclick = preserveRadioGroup; }  }  }   var isNS4 = (document.layers); var isIE4 =(document.all);  if (isNS4) { document.layers[id].visibility = "show"; } else if (isIE4) { document.all(id).style.display = "block"; } else { elm = document.getElementById(id); elm.style.display= "block"; } return; }<\/script></head>');write('<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" bgcolor="#ffffff">');write('<img src="/newyorklife.com/General/FileLink/Static%20Files/NYL2/images/banner_print.jpg" width=535 height=70><br>');write('<table border="0" cellspacing="0" cellpadding="0" width="100%">');write('<tr><td valign="top"><img src="/newyorklife.com/General/FileLink/Static%20Files/NYL2/images/banner_print_left.gif" width=85 height=410></td>');write('<td align="left" valign="top">');write('<table border="0" cellspacing="0" cellpadding="5" width="100%">');write('<tr><td colspan="2">&nbsp;</td></tr>');var lentest=quizQuestions.length-1;for(var q=1;q<=lentest;q++){write('<form name="form');write(q);write('">');write('<tr><td colspan="2"><font face="verdana" size="2">'+quizQuestions[q][0]+"<br></font></td></tr>");var len=quizQuestions[q].length-1;for(var i=1;i<=len;i++){var choiseValue=quizQuestions[q][i][0];write('<tr><td valign="top" width="5%"><font face="verdana" size="2">');write('<input name="rad');write(q);write('" type="radio" onClick="disableRadioGroup(rad');write(q);if(choiseValue.substr(0,1)=="T"){write(",'testDivTrue")}else{if(choiseValue.substr(0,1)=="F"){write(",'testDivFalse")}}write(q+"'");write(');return true;"></font></td>');write('<td valign="top"><font face="verdana" size="2">'+choiseValue.substr(2));write("</font></td></tr>")}var anslen=quizAnswer[q].length-1;for(var a=0;a<=anslen;a++){write('<tr><td colspan="2"><font face="verdana" size="2">');if(a==0){write('<div id="testDivTrue')}else{write('<div id="testDivFalse')}write(q);var isNS4=(document.layers);if(isNS4){write('" style="position: relative; overflow:none; visibility: hide;">')}else{write('" style="position: relative; overflow:none; display: none;">')}write("<b>"+quizAnswer[q][a]+"</b></div></font></td></tr>")}write("</form>")}write('<tr><td align="center" colspan="2" valign="top"><a href="javascript: self.close()"><img src="/newyorklife.com/General/FileLink/Static%20Files/NYL2/images/close.gif" border=0 width=106 height=24></a></td></tr>');write("</table></td></tr></table></body></html>");close()}}function showToolTip(b,d){var c=document.all;var e=document.getElementById&&!document.all;if(c){hoverarea.innerHTML=d;hoverarea.style.visibility="visible";hoverarea.style.position="absolute";hoverarea.style.left=getLeftPosition(b)-120;hoverarea.style.top=getTopPosition(b)+30}else{var a=document.getElementById("hoverarea");a.innerHTML=d;a.style.visibility="visible";a.style.position="absolute";a.style.left=getLeftPosition(b)-120;a.style.top=getTopPosition(b)+30}}function hideToolTip(){var b=document.all;var c=document.getElementById&&!document.all;if(b){hoverarea.style.visibility="hidden"}else{var a=document.getElementById("hoverarea");a.style.visibility="hidden"}}function showToolTipMMS(b,d){var c=document.all;var e=document.getElementById&&!document.all;if(c){hoverareamms.innerHTML=d;hoverareamms.style.visibility="visible";hoverareamms.style.position="absolute"}else{var a=document.getElementById("hoverareamms");a.innerHTML=d;a.style.visibility="visible";a.style.position="absolute"}}function hideToolTipMMS(){var b=document.all;var c=document.getElementById&&!document.all;if(b){hoverareamms.style.visibility="hidden"}else{var a=document.getElementById("hoverareamms");a.style.visibility="hidden"}}function getLeftPosition(b){var a=b.offsetLeft;var c=b.offsetParent;while(c!=null){a+=c.offsetLeft;c=c.offsetParent}return a}function getTopPosition(b){var a=b.offsetTop;var c=b.offsetParent;while(c!=null){a+=c.offsetTop;c=c.offsetParent}return a}var numericPattern=/^\d+$/;var dateNumericPattern=/^\d*$/;function phoneMsg(a){switch(a){case"en":alert("You must enter a valid Phone Number in the Phone field.");break;case"es":alert("Tiene que escribir un numero valido de telefono en el espacio indicado.");break;case"vi":alert("Xin quý vị điền số điện thoại vào ô Số Ðiện Thoại.");break;case"zh":alert("您必須在電話號碼一欄填入正確的電話號碼.");break}return}function checkIllegalPhone(b,a){for(var c=0;c<a.length;c++){if((b.match(a[c])!=null)){return false}}}function isAscii(b){for(var a=0;a<b.length;a++){if((b.charCodeAt(a)>=48&&b.charCodeAt(a)<=57)||(b.charCodeAt(a)>=65&&b.charCodeAt(a)<=90)||(b.charCodeAt(a)>=97&&b.charCodeAt(a)<=122)||b.charCodeAt(a)==32||b.charCodeAt(a)==35||b.charCodeAt(a)==39||b.charCodeAt(a)==45||b.charCodeAt(a)==46||b.charCodeAt(a)==47){}else{return false}}return true}function submitMMSForm(u,D){var A=new Array("1111111111","2222222222","3333333333","4444444444","5555555555","6666666666","7777777777","8888888888","9999999999","0000000000","0123456789","9876543210");var s=new Array("1111111","2222222","3333333","4444444","5555555","6666666","7777777","8888888","9999999","0000000");var v=new Array("800","900","888","866","877");if(isSubmitted==0){for(var t=0;t<u.length;t++){if(u.elements[t].name=="f_tampa_reference_no"){u.f_tampa_reference_no.value=u.f_tampa_reference_no.value.toUpperCase();var q=u.f_tampa_reference_no.value;if((q.length!=10)||(!isNaN(q.charAt(0)))||(q.charAt(0)=="M")||(isNaN(q.substring(1,q.length)))){switch(D){case"en":alert("You must enter a valid reference number in the Reference Number field.");break;case"es":alert("Tiene que escribir su numero de cliente en el espacio llamado numero de referencia.");break;case"vi":alert("Xin quý vị điền một số đối chiếu còn có hiệu lực vào ô Số Ðối Chiếu.");break;case"zh":alert("您必須在參考號碼一欄填入您的參考號碼.");break}u.f_tampa_reference_no.select();u.f_tampa_reference_no.focus();return false}break}}var g=TrimString(u.f_first_name.value);if((g=="")||isAscii(g)==false){switch(D){case"en":alert("You must enter your First Name in the First Name field.");break;case"es":alert("Tiene que escribir su nombre en el primer espacio como esta indicado.");break;case"vi":alert("Xin quý vị điền Tên vào ô Tên/ Quí Danh.");break;case"zh":alert("您必須在您的名字一欄填入您的名字.");break}u.f_first_name.select();u.f_first_name.focus();return false}var j=TrimString(u.f_last_name.value);if((j=="")||isAscii(j)==false){switch(D){case"en":alert("You must enter your Last Name in the Last Name field.");break;case"es":alert("Tiene que escribir su apellido en el ultimo espacio como esta indicado.");break;case"vi":alert("Xin quý vị điền Họ vào ô Họ.");break;case"zh":alert("您必須在您的姓氏一欄填入您的姓氏.");break}u.f_last_name.select();u.f_last_name.focus();return false}var x=TrimString(u.f_addr_line_1.value);if((x=="")||isAscii(x)==false){switch(D){case"en":alert("You must enter your address in the Address field.");break;case"es":alert("Tiene que escribir su dirección en el espacio indicado.");break;case"vi":alert("Xin quý vị điền địa chỉ vào ô Ðịa Chỉ.");break;case"zh":alert("您必須在您的住址一欄填入您的住址.");break}u.f_addr_line_1.select();u.f_addr_line_1.focus();return false}var p=TrimString(u.f_city_line.value);if((p=="")||isAscii(p)==false){switch(D){case"en":alert("You must enter your city in the City field.");break;case"es":alert("Tiene que escribir la ciudad donde reside en el espacio indicado.");break;case"vi":alert("Xin quý vị điền thành phố của mình vào ô Thành Phố/ Thị Trấn.");break;case"zh":alert("您必須在您所在的城市一欄填入您的城市.");break}u.f_city_line.select();u.f_city_line.focus();return false}if(u.f_state_code.selectedIndex==0){switch(D){case"en":alert("You must select your state from the State dropdown menu.");break;case"es":alert("Tiene que escribir el estado donde reside seleccionando del menu.");break;case"vi":alert("Xin quý vị chọn tiểu bang của mình từ bảng liệt kê.");break;case"zh":alert("您必須在您所在的州一欄選出您所在的州.");break}u.f_state_code.focus();return false}var a=u.f_zip_code5.value;if((a=="")||(!numericPattern.test(a))||(a.length!=5)){switch(D){case"en":alert("You must enter a valid Zip Code in the Zip field.");break;case"es":alert("Tiene que escribir su codigo postal valido.");break;case"vi":alert("Xin quý vị điền zip code vào ô Zip.");break;case"zh":alert("您必須在郵政編碼欄填入正確的郵政編碼.");break}u.f_zip_code5.select();u.f_zip_code5.focus();return false}var B=u.f_phone_number1.value;var b=u.f_phone_number2.value;var c=u.f_phone_number3.value;var z=B+b+c;var m=b+c;if((B=="")||(!numericPattern.test(B))||(B.length!=3)){phoneMsg(D);u.f_phone_number1.select();u.f_phone_number1.focus();return false}if((b=="")||(!numericPattern.test(b))||(b.length!=3)){phoneMsg(D);u.f_phone_number2.select();u.f_phone_number2.focus();return false}if((c=="")||(!numericPattern.test(c))||(c.length!=4)){phoneMsg(D);u.f_phone_number3.select();u.f_phone_number3.focus();return false}if((checkIllegalPhone(B,v)==false)||(checkIllegalPhone(m,s)==false)||(checkIllegalPhone(z,A)==false)){phoneMsg(D);u.f_phone_number1.select();u.f_phone_number1.focus();return false}if(u.f_phone_number_location[0].checked==false&&u.f_phone_number_location[1].checked==false){switch(D){case"en":alert("Please select the location of your phone number.");break;case"es":alert("Por favor, seleccione la ubicación de su número telefónico.");break;case"vi":alert("Vui lòng phân loại số điện thoại của bạn.");break;case"zh":alert("請告知電話號碼所在的地點。");break}return false}if(u.f_best_day_to_call.selectedIndex==0){switch(D){case"en":alert("Please select the best day to call.");break;case"es":alert("Por favor seleccione el mejor día para llamarle.");break;case"vi":alert("Xin chọn ngày tiện nhất để gọi.");break;case"zh":alert("請選擇與您聯絡的最好日期.");break}u.f_best_day_to_call.focus();return false}if(u.f_best_time_to_call.selectedIndex==0){switch(D){case"en":alert("Please select the best time to call.");break;case"es":alert("Por favor seleccione la mejor hora para llamarle.");break;case"vi":alert("Xin chọn giờ tiện nhất để gọi.");break;case"zh":alert("請選擇與您聯絡的最好時間.");break}u.f_best_time_to_call.focus();return false}for(var t=0;t<u.length;t++){if((u.elements[t].name=="f_birthdate_month")||(u.elements[t].name=="f_birthdate_day")||(u.elements[t].name=="f_birthdate_year")){if((u.f_birthdate_month.value!="")||(u.f_birthdate_day.value!="")||(u.f_birthdate_year.value!="")){var e=new Date(u.f_birthdate_year.value,u.f_birthdate_month.value-1,u.f_birthdate_day.value);var d=e.getFullYear();var h=e.getMonth()+1;var r=e.getDate();var C=new Date(1901,0,1);var w=new Date();var k=w.getFullYear();var y=w.getMonth();var o=y+1;var l=w.getDate();var n=new Date(k,y,l);if((e<C)||(e>n)||(u.f_birthdate_month.value.length!=2)||(u.f_birthdate_day.value.length!=2)||(u.f_birthdate_year.value.length!=4)||(d!=u.f_birthdate_year.value)||(h!=u.f_birthdate_month.value)||(r!=u.f_birthdate_day.value)){switch(D){case"en":alert("You must enter a valid Date of Birth in the format 'mm-dd-yyyy' between '01-01-1901' and '"+o+"-"+l+"-"+k+"'.");break;case"es":alert("Tiene que escribir su fecha de nacimiento en este formato 'mm-dd-yyyy' entre '01-01-1901' y '"+o+"-"+l+"-"+k+"'.");break;case"vi":alert("Xin điền ngày tháng năm sinh theo mẫu 'mm-dd-yyyy' trong khoảng '01-01-1901' và '"+o+"-"+l+"-"+k+"'.");break;case"zh":alert("您必須根據 'mm-dd-yyyy' 的格式填入正確的出生日期﹐ 該日期必須在 '01-01-1901' 和 '"+o+"-"+l+"-"+k+"' 之間.");break}u.f_birthdate_month.select();u.f_birthdate_month.focus();return false}}}}isSubmitted=1;return true}else{return false}}function DoExitSurvey(){if(isSubmitted==0){window.open("/nyl/jsp/others/exit_survey.jsp","ExitSurvey","scrollbars,width=416,height=375,top=100,left=100")}}function format_email(d){var c="";for(var b=0;b<d.length;b++){if(d.elements[b].checked){c+="<begin>"+d.elements[b].name+"="+d.elements[b].value+"<end>\n"}if((d.elements[b].type=="text"&&d.elements[b].value!="")||(d.elements[b].type=="textarea"&&d.elements[b].value!="")){c+="<begin>"+d.elements[b].name+"="+d.elements[b].value+"<end>\n"}if(d.elements[b].type=="hidden"){if(d.elements[b].name=="formattedmessage"||d.elements[b].name=="confirm"||d.elements[b].name=="hitbox_pn"||d.elements[b].name=="hitbox_ct"){}else{c+="<begin>"+d.elements[b].name+"="+d.elements[b].value+"<end>\n"}}if(d.elements[b].type=="select-one"||d.elements[b].type=="select-multiple"){for(var a=0;a<d.elements[b].options.length;a++){if(d.elements[b].options[a].selected==true){c+="<begin>"+d.elements[b].name+"="+d.elements[b].options[a].value+"<end>\n"}}}}return c}(function(a){a(function(){if(a(".acc_nav").length){a(".acc_nav li[id$=consult], .acc_nav li[id$=read], .acc_nav li[id$=share]").click(function(c){c.preventDefault();var b=a(this).attr("id").substring(0,3);var d=a(this).attr("id").substring(7);a("#"+b+"_acc_nav_hidden > div").each(function(){if(a(this).attr("id")!=undefined){if(a(this).attr("id").indexOf(d)==-1){a(this).hide(300)}else{a(this).slideToggle(300)}}});if(d=="share"){a("#facebook_"+b).attr("src",a("#facebook_"+b).attr("src"))}return false})}})})(jQuery);
