var wait = secs * 1000; function initWaiting() { if( document.getElementById("SurveyOverSubmit") != null ) { document.getElementById("SurveyOverSubmit").disabled = true; document.getElementById("SurveyOverSubmit").value = " 提交(" + secs + ") "; } if( document.getElementById("SurveyNextSubmit") != null ) { document.getElementById("SurveyNextSubmit").disabled = true; document.getElementById("SurveyNextSubmit").value = " 下一页(" + secs + ") "; } for( tmp = 1; tmp <= secs; tmp++) { window.setTimeout("Update(" + tmp + ")", tmp * 1000); } window.setTimeout("Timer()", wait); } function Update(num, value) { if( document.getElementById("SurveyOverSubmit") != null ) { if(num == (wait/1000)) { document.getElementById("SurveyOverSubmit").value = " 提交问卷 "; } else { printnr = (wait / 1000) - num; document.getElementById("SurveyOverSubmit").value = " 提交(" + printnr + ") "; } } if( document.getElementById("SurveyNextSubmit") != null ) { if(num == (wait/1000)) { document.getElementById("SurveyNextSubmit").value = " 下一页 "; } else { printnr = (wait / 1000) - num; document.getElementById("SurveyNextSubmit").value = " 下一页(" + printnr + ") "; } } } function Timer() { if( document.getElementById("SurveyOverSubmit") != null ) { document.getElementById("SurveyOverSubmit").disabled = false; } if( document.getElementById("SurveyNextSubmit") != null ) { document.getElementById("SurveyNextSubmit").disabled = false; } } var limitedTime = limitedSecs * 1000; function initLimitedTime() { for( tmp = limitedSecs; tmp >=0 ; tmp--) { window.setTimeout("limitedUpdate(" + tmp + ")", tmp * 1000); } window.setTimeout("limitedTimer()", limitedTime); } function limitedUpdate(num, value) { var lprintnr = (limitedTime / 1000) - num; document.getElementById("limitedBar").innerHTML = " 问卷回复剩余时间:" + lprintnr + "秒"; } function limitedTimer(){ document.getElementById("limitedBar").innerHTML = " 问卷回复剩余时间:0秒"; if( document.getElementById("SurveyOverSubmit") != null ) { document.getElementById("SurveyOverSubmit").disabled = true; } if( document.getElementById("SurveyNextSubmit") != null ) { document.getElementById("SurveyNextSubmit").disabled = true; } }