|
var hiddenText = document.querySelector("#tfa_218"); |
|
var submitButton = document.querySelector("input[value='Submit']"); |
|
var nextPageButton = document.querySelector("input[value='Next Page']"); |
|
var previousPageButton = document.querySelector("input[value='Previous Page']"); |
|
|
|
var disableButtons = function () { |
|
if (submitButton) { |
|
submitButton.style.display = 'none'; |
|
} |
|
|
|
if (nextPageButton) { |
|
nextPageButton.style.display = 'none'; |
|
} |
|
|
|
if (previousPageButton) { |
|
previousPageButton.style.display = 'none'; |
|
} |
|
|
|
hiddenText.style.display = 'block'; |
|
}; |
|
|
|
var enableButtons = function () { |
|
if (submitButton) { |
|
submitButton.style.display = 'block'; |
|
} |
|
|
|
if (nextPageButton) { |
|
nextPageButton.style.display = 'block'; |
|
} |
|
|
|
if (previousPageButton) { |
|
previousPageButton.style.display = 'block'; |
|
} |
|
|
|
hiddenText.style.display = 'none'; |
|
}; |
|
|
|
var doLoad = function () { |
|
var nyc = moment.tz(new Date(), "America/New_York"); |
|
|
|
if (nyc.date() === 28 && nyc.minutes() >= 31) { |
|
return enableButtons(); |
|
} |
|
|
|
disableButtons(); |
|
|
|
if (nyc.date() === 28 && nyc.minutes() < 31) { |
|
var shouldEnableButtons = function () { |
|
return (moment.tz(new Date(), "America/New_York").minutes() >= 31); |
|
}; |
|
|
|
var shouldEnableButtonsInterval = setInterval(function () { |
|
if (shouldEnableButtons()) { |
|
enableButtons(); |
|
|
|
clearInterval(shouldEnableButtonsInterval); |
|
} |
|
}, 5000); |
|
} |
|
} |
|
|
|
if (window.addEventListener) { |
|
window.addEventListener("load", doLoad, false); |
|
} else if (window.attachEvent) { |
|
window.attachEvent("onload", doLoad); |
|
} else { |
|
window.onload = doLoad; |
|
} |