// Include this at the bottom of the Page.  Call canSubmit from the form's onSubmit.
// Each page must implement a function validate.
function canSubmit(hideTableIds, hideIFrameIds, showTableId, showIFrameIds){
var i = m_iSubmitCount++;
if (i == 0){
if (noSubmit() && checkValidate()){
if(hideTableIds != null && showTableId != null)
switchFormDisplay(hideTableIds, hideIFrameIds, showTableId, showIFrameIds);
return true;
}else{
m_iSubmitCount = 0;
}
}else{
alert('Submit is in progress, please wait.');
}
return false;
}
function noSubmit(){
var sub = document.getElementById('submitReason').value;
if (sub != null){
if (sub == 'noSubmit')
return false;
}
return true;
}
function checkValidate(){
if (self.validate) {
return validate();
}
return true;
}
var m_iSubmitCount = 0;
