/**
 *    prepare the dialog for Importing of reminders 
 *    used with File and Attachment D&D to the statusbar icon)
 */
function rmFx_reminderImportwCategory() {
	
   //  ar results = { mode: 'CANCEL', categories: categoryItem, 
   //    numEvents:numEvents, numTodos: numTodos };
 
   document.getElementById("noEvents").setAttribute("value", window.arguments[0].numEvents 
      + " " + reminderFox_getBundle().getString("rf.html.heading.reminders"));
   document.getElementById("noTodos").setAttribute("value", window.arguments[0].numTodos 
      + " " + reminderFox_getBundle().getString("rf.html.heading.todos")); 

   // get cat default 
   var importCat = window.arguments[0].categories;  
   document.getElementById("inputRmCategories").setAttribute("value", importCat);
   
   document.getElementById("inputRmCategories").setAttribute("disabled", "true");
   document.getElementById("catChange").setAttribute("disabled", "true");
   document.getElementById('catLabel').value = "";
}

/**
 *   called to pass/save selection
 */
function rmFx_ReminderImportwCategoryClose (mode) {
 
   window.arguments[0].mode = mode;
   if (mode == 'CANCEL') {
      return;
   }
   // read and pass selected textbox entry
   var catId = document.getElementById("catGroup").selectedItem.value;  
   var catDef = document.getElementById('inputRmCategories').value;

   if (catId == 'catHbox') {
      window.arguments[0].categories = catDef;
   } else {
   	window.arguments[0].categories = "";
   }
}

/**
 *   called with radio group selection change
 */
function catMode() {
   var catId = document.getElementById("catGroup").selectedItem.value;
	
   document.getElementById("inputRmCategories").setAttribute("disabled", "true");
   document.getElementById("catChange").setAttribute("disabled", "true");
	   
   if (catId == "catHbox") {
      document.getElementById("inputRmCategories").removeAttribute("disabled");
      document.getElementById("catChange").removeAttribute("disabled");
   }
}