var cal=null;function initPage(){cal=new CalendarPopup("testdiv1");cal.setReturnFunction("cal_clicked");cal.showCalendar()}function cal_clicked(H,C,E){var G=new Date();var F=new Date();C=parseInt(C)-1;E=parseInt(E);H=parseInt(H);F.setMonth(C);F.setDate(E);F.setFullYear(H);var L=new Date();L.setMonth(10);L.setDate(23);L.setFullYear(2008);var A=dateToString(F);var B="";var I='<div class="maildate">Your mail date is '+A+"</div>";if(F<L){setInfo(I+"The USPS Move Update requirement for standard mail does not take effect until November 23, 2008.");return }var K=F.getTime()-G.getTime();var M=round(msToDays(K),0);if(M<=95){setInfo(I+"You are within 95 days of your mail date. You should contact Data Management to have your list processed through NCOA<sup>Link</sup>.")}else{var D=F.getTime()-daysToMs(95);var J=new Date();J.setTime(D);B=dateToString(J);setInfo(I+"Your mail drop date is "+M+" days away. The USPS requires that you perform a valid Move Update service, such as NCOA<sup>Link</sup> within 95 days of your mail date. Therefore you should wait until "+B+" to process NCOA<sup>Link</sup> for your mailing.")}}function msToDays(A){var B=A/1000;var C=B/86400;return C}function daysToMs(C){var B=C*86400;var A=B*1000;return A}function dateToString(E){var B=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var D=["January","February","March","April","May","June","July","August","September","October","November","December"];var A=E.getMonth();var F=E.getDate();var G=E.getFullYear();var C=E.getDay();return B[C]+", "+D[A]+" "+F+", "+G}function round(B,D){var C=""+Math.round(B*Math.pow(10,D));while(C.length<=D){C="0"+C}var A=C.length-D;if(D>0){return C.substring(0,A)+"."+C.substring(A,C.length)}else{return C.substring(0,A)}}function setInfo(A){var B=document.getElementById("divInfo");B.innerHTML=A}window.onload=initPage