

function onLoadComplete()
{
   var argumentArray = dialogArguments;
   
   document.getElementById('msgCell').innerHTML  = dialogArguments[0];
   
   var targetCell = document.getElementById('btnRow');
   var tmpCell;
   var tmpBtn;
   
   for(i=0; i< dialogArguments[1]; i++)
   {
      tmpCell = document.createElement("td");
	  tmpBtn = document.createElement("button");
	  tmpBtn.value = dialogArguments[(i*2)+2];
	  tmpBtn.setAttribute("className","dlgbtn");
	  tmpBtn.setAttribute("retval", dialogArguments[(i*2)+3]);
	  tmpBtn.attachEvent("onclick", ReturnValue);
	  tmpCell.appendChild(tmpBtn);
      targetCell.appendChild(tmpCell) ;
   }
  
}

function ReturnValue(e)
{ 
    var srcElement=(window.event)? window.event.srcElement:e.target;
   
    window.returnValue = srcElement.getAttribute("retval"); 
    window.close(); 
}

function CustomConfirmation(argArray)
{
	var strFeatures = "dialogWidth:450px;dialogHeight:125px;help:no;maximize:no;minimize:no;scrollbars:no;status:no";
	var objAnswer = window.showModalDialog('../includes/Dialog.html', argArray, strFeatures);
		   
	return  objAnswer;
}

