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 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"){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 F=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(F)){alert(F+" 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(S,b){var Y=new Array("1111111111","2222222222","3333333333","4444444444","5555555555","6666666666","7777777777","8888888888","9999999999","0000000000","0123456789","9876543210");var Q=new Array("1111111","2222222","3333333","4444444","5555555","6666666","7777777","8888888","9999999","0000000");var T=new Array("800","900","888","866","877");if(isSubmitted==0){for(var R=0;R<S.length;R++){if(S.elements[R].name=="f_tampa_reference_no"){S.f_tampa_reference_no.value=S.f_tampa_reference_no.value.toUpperCase();var O=S.f_tampa_reference_no.value;if((O.length!=10)||(!isNaN(O.charAt(0)))||(O.charAt(0)=="M")||(isNaN(O.substring(1,O.length)))){switch(b){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}S.f_tampa_reference_no.select();S.f_tampa_reference_no.focus();return false}break}}var F=TrimString(S.f_first_name.value);if((F=="")||isAscii(F)==false){switch(b){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}S.f_first_name.select();S.f_first_name.focus();return false}var H=TrimString(S.f_last_name.value);if((H=="")||isAscii(H)==false){switch(b){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}S.f_last_name.select();S.f_last_name.focus();return false}var V=TrimString(S.f_addr_line_1.value);if((V=="")||isAscii(V)==false){switch(b){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}S.f_addr_line_1.select();S.f_addr_line_1.focus();return false}var N=TrimString(S.f_city_line.value);if((N=="")||isAscii(N)==false){switch(b){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}S.f_city_line.select();S.f_city_line.focus();return false}if(S.f_state_code.selectedIndex==0){switch(b){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}S.f_state_code.focus();return false}var A=S.f_zip_code5.value;if((A=="")||(!numericPattern.test(A))||(A.length!=5)){switch(b){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}S.f_zip_code5.select();S.f_zip_code5.focus();return false}var Z=S.f_phone_number1.value;var B=S.f_phone_number2.value;var C=S.f_phone_number3.value;var X=Z+B+C;var K=B+C;if((Z=="")||(!numericPattern.test(Z))||(Z.length!=3)){phoneMsg(b);S.f_phone_number1.select();S.f_phone_number1.focus();return false}if((B=="")||(!numericPattern.test(B))||(B.length!=3)){phoneMsg(b);S.f_phone_number2.select();S.f_phone_number2.focus();return false}if((C=="")||(!numericPattern.test(C))||(C.length!=4)){phoneMsg(b);S.f_phone_number3.select();S.f_phone_number3.focus();return false}if((checkIllegalPhone(Z,T)==false)||(checkIllegalPhone(K,Q)==false)||(checkIllegalPhone(X,Y)==false)){phoneMsg(b);S.f_phone_number1.select();S.f_phone_number1.focus();return false}if(S.f_best_day_to_call.selectedIndex==0){switch(b){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}S.f_best_day_to_call.focus();return false}if(S.f_best_time_to_call.selectedIndex==0){switch(b){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}S.f_best_time_to_call.focus();return false}for(var R=0;R<S.length;R++){if((S.elements[R].name=="f_birthdate_month")||(S.elements[R].name=="f_birthdate_day")||(S.elements[R].name=="f_birthdate_year")){if((S.f_birthdate_month.value!="")||(S.f_birthdate_day.value!="")||(S.f_birthdate_year.value!="")){var E=new Date(S.f_birthdate_year.value,S.f_birthdate_month.value-1,S.f_birthdate_day.value);var D=E.getFullYear();var G=E.getMonth()+1;var P=E.getDate();var a=new Date(1901,0,1);var U=new Date();var I=U.getFullYear();var W=U.getMonth();var M=W+1;var J=U.getDate();var L=new Date(I,W,J);if((E<a)||(E>L)||(S.f_birthdate_month.value.length!=2)||(S.f_birthdate_day.value.length!=2)||(S.f_birthdate_year.value.length!=4)||(D!=S.f_birthdate_year.value)||(G!=S.f_birthdate_month.value)||(P!=S.f_birthdate_day.value)){switch(b){case"en":alert("You must enter a valid Date of Birth in the format 'mm-dd-yyyy' between '01-01-1901' and '"+M+"-"+J+"-"+I+"'.");break;case"es":alert("Tiene que escribir su fecha de nacimiento en este formato 'mm-dd-yyyy' entre '01-01-1901' y '"+M+"-"+J+"-"+I+"'.");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à '"+M+"-"+J+"-"+I+"'.");break;case"zh":alert("您必須根據 'mm-dd-yyyy' 的格式填入正確的出生日期﹐ 該日期必須在 '01-01-1901' 和 '"+M+"-"+J+"-"+I+"' 之間.");break}S.f_birthdate_month.select();S.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};