
function delWarn(numKids,edit)   {
   var confString = "Are you sure you want to delete?\nThis action cannot be undone.";
   
   var count = 0;
   
   if(!edit && document.childListForm.lid && typeof document.childListForm.lid=='object')   {
      for(i=0; i<document.childListForm.lid.length;i++)   {
         if (document.childListForm.lid[i].checked == true) {
            count++;
         }
      }
   }
   
   
   if(numKids>1 && count==0)
      confString+= "\n\n There are " + numKids + " children under this entry.";
   else if(numKids==1 && count==0)
      confString+= "\n\n There is " + numKids + " child under this entry.";
   else if(count>1)
      confString+= "\n\n You have selected " + count + " children to delete.";
   else if(count==1)
      confString+= "\n\n You have selected 1 child to delete.";
   
   var conf = confirm(confString); 
   if(conf)   {
      document.childListForm.updateAction.value='delete';
      document.childListForm.submit();
   }
   else if(conf)
      return true;
      
   return false;
}

function reposition(moveEls,posID)   {
   
   document.childListForm.process.value='ass';
   
   if(moveEls==2)
      window.open("../include/popYesNo.jsp?id=" + posID,"","width=300,height=100,toolbar=no,menubar=no");
   else if(moveEls=='-1')
      return false;
   else   {
      document.childListForm.action='../page2/assign.jsp';
      document.childListForm.actionableID.value=posID;
      document.childListForm.mvEls.value=moveEls;
      document.childListForm.submit();
   }
   return false;
}

function duplicate(set)   {
   
   var conf =true;
   if(set=='dup')
      conf = confirm("Confirm duplication");
   
   if(conf)   {
      document.childListForm.process.value=set;
      document.childListForm.action='../page2/entryDup.jsp';
      document.childListForm.submit();
   }
   return false;
}


function repositionSet()   {
   
   document.childListForm.process.value='reas';
   document.childListForm.action='../page2/assign.jsp'; 
   document.childListForm.submit();
   
   return false;
}

function sendMail()   {
   
   document.childListForm.process.value='addContact';
   document.childListForm.action='../page2/emailControl.jsp'; 
   document.childListForm.submit();
   
   return false;
}

function replaceTxt(ref)   {
   
   //document.childListForm.process.value='rep';
   document.childListForm.action='../page2/replaceTxt.jsp'; 
   document.childListForm.submit();
   
   return false;
}

function launchWindow( initURL, width, height ) {
    var top=((screen.height - height - 30) / 2),left=((screen.width - width - 10) / 2);
    //alert(screen.height + "x" + screen.width + "; " + height + "x" + width + "; " + top + "," + left);
    window.open(initURL,'_blank','width=' + width + ',height=' + height + ',resizable=yes,scrollbars=yes,toolbar=no,directories=no,menubar=no,status=yes,top=' +  top + ',left=' + left + '');
}


