var cb = document.forms[0].$$SelectDoc;
// find the first checked document . . .
var selectcount = 0;
var docUNID = new Array();
for(i = 0; i < cb.length; i ++){
if (cb[i].checked){
docUNID[selectcount] = cb[i].value;
selectcount++;
}
}
if (docUNID[0] == null ){
alert('You did not select any documents, please correct and try again.');
} else {
if (docUNID != null ){
result=window.confirm('Publishing will send an email for each selected document, click OK if you wish to proceed.');
if (result==true) {
var lastunid = ''
for(j = 0; j < docUNID.length; j++){
if ( docUNID[j] == lastunid) {
//do nothing, the current doc has already been processed during this cycle
}
else {
lastunid = docUNID[j]
parent.AFrame.location.href = document.forms[0].dbURL.value + "/Publish?OpenAgent&docunid=" + docUNID[j]
for (d=0;d<20000;d++) ; // do nothing but eat CPU
}
}
lastunid = ''
parent.AFrame.location.href = document.forms[0].dbURL.value + "/Blank?OpenPage"
self.location.href = document.forms[0].dbURL.value + "/PPEdit?OpenForm"
}
}
}