// startup function called by the prefs architecture. function Startup() { DoEnabling(); } function DoEnabling() { var increments = document.getElementById("offlineNewsDownloadIncrements"); var textfield = document.getElementById("offlineNewsDownloadDays"); var radio0 = document.getElementById("offlineNewsDownloadUseDays0"); var radio1 = document.getElementById("offlineNewsDownloadUseDays1"); var downloadByDate = document.getElementById("offlineNewsDownloadByDate"); if( !downloadByDate.checked ) { increments.setAttribute( "disabled", "true" ); textfield.setAttribute( "disabled", "true" ); radio0.setAttribute( "disabled", "true" ); radio1.setAttribute( "disabled", "true" ); } else { radio0.removeAttribute("disabled"); radio1.removeAttribute("disabled"); if( radio0.checked ) { increments.removeAttribute( "disabled" ); textfield.setAttribute( "disabled", "true" ); } else if( radio1.checked ) { textfield.removeAttribute( "disabled" ); increments.setAttribute( "disabled", "true" ); } } } &newmes; &downOnlyCheck; &downDateCheck; &fromRadio.label; &yesterday.select; &oneW.select; &twoW.select; &oneM.select; &sixM.select; &oneY.select; &sinceRadio.label; &daysAgo; &Allmsg; &offlineMsgs;