home *** CD-ROM | disk | FTP | other *** search
/ PC User 2003 September / Australian PC User - September 2003 (CD1).iso / magstuff / web / files / dwmx61.exe / Disk1 / data1.cab / Configuration_En / Commands / ServerObject-MenuProps.js < prev    next >
Encoding:
JavaScript  |  2002-11-25  |  18.5 KB  |  717 lines

  1.  
  2. // Copyright 2001-2002 Macromedia, Inc. All rights reserved. 
  3.  
  4.  
  5. //************************GLOBALS**************************
  6.  
  7. var helpDoc = MM.HELP_soFormFieldProps;
  8.  
  9. var _MenuGrid;
  10. var _ManualLayer;
  11. var _DatabaseLayer;
  12. var _ColumnText;
  13. var _ColumnValue;
  14. var _DefaultManual;
  15. var _DefaultDatabase;
  16. var _PopulateRadio;
  17. var _ElemUp, _ElemDown, _ElemAdd, _ElemDel;
  18. var _RecordsetName = new RecordsetMenu("InsertRecord.htm","RecordsetName");
  19. var _MenuLabels = new RecordsetFieldMenu("InsertRecord.htm", "MenuLabels", "", "_RecordsetName");
  20. var _MenuValues = new RecordsetFieldMenu("InsertRecord.htm", "MenuValues", "", "_RecordsetName");
  21.  
  22. // The following variable is need by the UI.  Setting here,
  23. //  rather than changing the UI file.
  24. var TF_DEFAULT_DATABASE = "";
  25.  
  26. //********************API FUNCTIONS**************************
  27. //--------------------------------------------------------------------
  28. // FUNCTION:
  29. //   commandButtons
  30. //
  31. // DESCRIPTION:
  32. //   Returns the list of buttons which should appear on the right hand
  33. //   side of the dialog
  34. //
  35. // ARGUMENTS:
  36. //   none
  37. //
  38. // RETURNS:
  39. //   Array - pairs of button name and function call
  40. //--------------------------------------------------------------------
  41. function commandButtons()
  42. {
  43.  
  44.   return new Array(MM.BTN_OK,    "clickedOK()",
  45.                    MM.BTN_Cancel,"clickedCancel()",
  46.                    MM.BTN_Help, "displayHelp()"); 
  47. }
  48.  
  49.  
  50. //--------------------------------------------------------------------
  51. // FUNCTION:
  52. //   displayHelp
  53. //
  54. // DESCRIPTION:
  55. //   This function is called when the user clicks the HELP button
  56. //
  57. // ARGUMENTS:
  58. //   none
  59. //
  60. // RETURNS:
  61. //   nothing
  62. //--------------------------------------------------------------------
  63.  
  64. function displayHelp()
  65. {
  66.   dwscripts.displayDWHelp(helpDoc);
  67. }
  68.  
  69.  
  70. //******************LOCAL FUNCTIONS**************************
  71.  
  72. //--------------------------------------------------------------------
  73. // FUNCTION:
  74. //   clickedOK
  75. //
  76. // DESCRIPTION:
  77. //   This function is called when the user clicks OK
  78. //
  79. // ARGUMENTS:
  80. //   none
  81. //
  82. // RETURNS:
  83. //   nothing
  84. //--------------------------------------------------------------------
  85. function clickedOK()
  86. {
  87.   if (_ManualLayer.visibility == "visible")
  88.   { 
  89.     // static menu object created
  90.     var allRows = _MenuGrid.list, nRows = allRows.length, currRowText, dividerInd;
  91.     var textArr = new Array(),valArr = new Array();
  92.  
  93.     for (i=0;i<nRows;i++)
  94.     {
  95.       currRowText = allRows[i];
  96.       dividerInd = currRowText.indexOf("|");
  97.       textArr.push(currRowText.substring(0,dividerInd));
  98.       valArr.push(currRowText.substring(dividerInd +1));
  99.     }
  100.  
  101.     MM.commandReturnValue = new eoMenu(textArr,valArr,_DefaultManual.value);
  102.   }
  103.   else
  104.   { 
  105.     // dynamic menu object created
  106.     dynMenuObj = new eoDynamicMenu();
  107.     dynMenuObj.recordset = _RecordsetName.getValue();
  108.     dynMenuObj.textCol = _MenuLabels.getValue();
  109.     dynMenuObj.valCol = _MenuValues.getValue();
  110.     dynMenuObj.defaultSelected = _DefaultDatabase.value;
  111.  
  112.     MM.commandReturnValue = dynMenuObj;
  113.   }
  114.  
  115.   clearUI();
  116.   window.close();
  117. }
  118.  
  119.  
  120. function clearUI()
  121. {
  122.   _MenuGrid.setAllRows(new Array(),new Array());
  123.   _ColumnText.value = "";
  124.   _ColumnValue.value = "";
  125.   _DefaultManual.value = ""; 
  126.   _DefaultDatabase.value = "";
  127.  
  128.   _ManualLayer.visibility="hidden";
  129.   _DatabaseLayer.visibility="hidden";
  130. }
  131.  
  132. //--------------------------------------------------------------------
  133. // FUNCTION:
  134. //   clickedCancel
  135. //
  136. // DESCRIPTION:
  137. //   This function is called when CANCEL is clicked
  138. //
  139. // ARGUMENTS:
  140. //   none
  141. //
  142. // RETURNS:
  143. //   nothing
  144. //--------------------------------------------------------------------
  145. function clickedCancel()
  146. {
  147.   MM.commandReturnValue = "";
  148. //  dwscripts.findDOMObject("RecordsetName").selectedIndex = _RecordsetName.listControl.getIndex();
  149. //  dwscripts.findDOMObject("MenuLabels").selectedIndex = _MenuLabels.listControl.getIndex();
  150. //  dwscripts.findDOMObject("MenuValues").selectedIndex = _MenuValues.listControl.getIndex();    
  151.   clearUI();
  152.   window.close();
  153. }
  154.  
  155. //--------------------------------------------------------------------
  156. // FUNCTION:
  157. //   initializeUI
  158. //
  159. // DESCRIPTION:
  160. //   This function is called in the onLoad event.  It is responsible
  161. //   for initializing the UI.
  162. //
  163. // ARGUMENTS:
  164. //   none
  165. //
  166. // RETURNS:
  167. //   nothing
  168. //--------------------------------------------------------------------
  169. function initializeUI()
  170. {
  171.   // Some callers pass just the type, some pass an array w/ type and display name
  172.   var menuInfoObj = MM.commandArgument;
  173.   var serverModel = dw.getDocumentDOM().serverModel.getServerName();
  174.  
  175.   _ManualLayer   = document.layers["manualLayer"];
  176.   _DatabaseLayer = document.layers["databaseLayer"];
  177.  
  178.   _PopulateRadio = new RadioGroup("ServerObject-MenuProps", "Populate", "");
  179.   _PopulateRadio.initializeUI();
  180.   _MenuGrid = new TreeControlWithNavControls("MenuGrid",_ManualLayer,true);
  181.   _MenuGrid.setColumnNames(MM.LABEL_MenuGrid);
  182.  
  183.   _ColumnText = dwscripts.findDOMObject("MenuText",_ManualLayer);
  184.   _ColumnValue = dwscripts.findDOMObject("MenuValue",_ManualLayer);
  185.   _DefaultManual = dwscripts.findDOMObject("DefaultValueManual", _ManualLayer);
  186.  
  187.   var displayNameSpan = dwscripts.findDOMObject("RecordsetDisplayName", _DatabaseLayer);
  188.   displayNameSpan.innerHTML = dwscripts.getRecordsetDisplayName();
  189.  
  190.   _RecordsetName.initializeUI();
  191.   _MenuLabels.initializeUI();
  192.   _MenuValues.initializeUI();
  193.  
  194.   _DefaultDatabase = dwscripts.findDOMObject("DefaultValueDatabase",_DatabaseLayer);
  195.   TF_DEFAULT_DATABASE = _DefaultDatabase;
  196.  
  197.   _ElemUp = dwscripts.findDOMObject("elemUp");
  198.   _ElemDown = dwscripts.findDOMObject("elemDown");
  199.   _ElemAdd = dwscripts.findDOMObject("elemAdd");
  200.   _ElemDel = dwscripts.findDOMObject("elemDel");
  201.  
  202.   if (menuInfoObj.type == "menu" )
  203.   { 
  204.     // if a static menu
  205.     initManualLayer();
  206.     showDifferentLayer("manual");
  207.     _PopulateRadio.setIndex(0);
  208.     if (menuInfoObj.textArr != "" || menuInfoObj.defaultSelected != "")
  209.     { 
  210.       if (serverModel == "Cold Fusion")
  211.       {
  212.         menuInfoObj.defaultSelected = dwscripts.stripCFOutputTags(menuInfoObj.defaultSelected);          
  213.       } 
  214.       else if (serverModel == "PHP") 
  215.       {
  216.         menuInfoObj.defaultSelected = dwscripts.stripScriptDelimiters(menuInfoObj.defaultSelected);       
  217.       }
  218.       else 
  219.       {
  220.         // other server models go here  
  221.       }
  222.  
  223.  
  224.       // if there are prior values
  225.       var nOptions = menuInfoObj.textArr.length,i;
  226.       var gridDisplayArr = new Array();
  227.       var textArr = menuInfoObj.textArr;
  228.       var valArr  = menuInfoObj.valArr;
  229.       for (i=0;i<nOptions;i++)
  230.       {
  231.         gridDisplayArr[i] = textArr[i] + "|";
  232.         if (valArr[i])
  233.           gridDisplayArr[i] += valArr[i];
  234.       }
  235.  
  236.       if (gridDisplayArr.length && gridDisplayArr.length > 0)
  237.       {
  238.         _MenuGrid.setAllRows(gridDisplayArr);
  239.         _MenuGrid.setRowIndex(0);
  240.         displayGridValues();
  241.       }
  242.  
  243.       _ColumnText.focus();
  244.       if (_ColumnText.value != "")
  245.         _ColumnText.select();
  246.       _DefaultManual.value = menuInfoObj.defaultSelected;
  247.     }
  248. //    EnableDisableUpDownBtns();
  249. //    EnableDisableAddDelBtns();      
  250.   }
  251.   else
  252.   { 
  253.     // if a dynamic menu
  254.     _PopulateRadio.setIndex(1);
  255.     initDatabaseLayer();
  256.     showDifferentLayer('database');
  257.     if (menuInfoObj.recordset)
  258.     { 
  259.       updateColumns();
  260.       _DefaultDatabase.value = menuInfoObj.defaultSelected;
  261.     }
  262.   }
  263. }
  264.  
  265.  
  266. //--------------------------------------------------------------------
  267. // FUNCTION:
  268. //   initDatabaseLayer
  269. //
  270. // DESCRIPTION:
  271. //   This function is called in the onLoad event.  It is responsible
  272. //   for initializing the UI.
  273. //
  274. // ARGUMENTS:
  275. //   none
  276. //
  277. // RETURNS:
  278. //   nothing
  279. //--------------------------------------------------------------------
  280. function initDatabaseLayer()
  281. {
  282.   updateColumns();
  283.   _DefaultDatabase.value = "";
  284.   if (_DefaultManual.value != "")
  285.   {
  286.     _DefaultDatabase.value = _DefaultManual.value;
  287.   }
  288. }
  289.  
  290.  
  291. //--------------------------------------------------------------------
  292. // FUNCTION:
  293. //   addNewRow
  294. //
  295. // DESCRIPTION:
  296. //   This function is called in the onLoad event.  It is responsible
  297. //   for initializing the UI.
  298. //
  299. // ARGUMENTS:
  300. //   none
  301. //
  302. // RETURNS:
  303. //   nothing
  304. //--------------------------------------------------------------------
  305. function addNewRow()
  306. {
  307.   _MenuGrid.addRow(MM.LABEL_menuPropLabelPrefix + "|");
  308.   displayGridValues();
  309.   var newLabel = getUniqueLabel(MM.LABEL_menuPropLabelPrefix);
  310.   _ColumnText.value = newLabel;
  311.   updateGridRow();
  312.   _ColumnText.focus();
  313.   _ColumnText.select();
  314. //  EnableDisableUpDownBtns();
  315. //  EnableDisableAddDelBtns();   
  316. }
  317.  
  318. //--------------------------------------------------------------------
  319. // FUNCTION:
  320. //   delRow
  321. //
  322. // DESCRIPTION:
  323. //  This function deletes a row in the grid control.
  324. //
  325. // ARGUMENTS:
  326. //   none
  327. //
  328. // RETURNS:
  329. //   nothing
  330. //--------------------------------------------------------------------
  331. function delRow()
  332. {
  333.   _MenuGrid.delRow();
  334.   displayGridValues();
  335.   updateGridRow();  
  336. //  EnableDisableUpDownBtns();
  337. //  EnableDisableAddDelBtns();     
  338. }
  339.  
  340. //--------------------------------------------------------------------
  341. // FUNCTION:
  342. //   moveRowUp
  343. //
  344. // DESCRIPTION:
  345. //  This function moves the selected row up in the grid control.
  346. //
  347. // ARGUMENTS:
  348. //   none
  349. //
  350. // RETURNS:
  351. //   nothing
  352. //--------------------------------------------------------------------
  353. function moveRowUp()
  354. {
  355.   _MenuGrid.moveRowUp();
  356. //  EnableDisableUpDownBtns();
  357. //  EnableDisableAddDelBtns();       
  358. }
  359.  
  360. //--------------------------------------------------------------------
  361. // FUNCTION:
  362. //   moveRowDown
  363. //
  364. // DESCRIPTION:
  365. //  This function moves the selected row down in the grid control.
  366. //
  367. // ARGUMENTS:
  368. //   none
  369. //
  370. // RETURNS:
  371. //   nothing
  372. //--------------------------------------------------------------------
  373. function moveRowDown()
  374. {
  375.   _MenuGrid.moveRowDown();
  376. //  EnableDisableUpDownBtns();
  377. //  EnableDisableAddDelBtns();       
  378. }
  379.  
  380.  
  381. //--------------------------------------------------------------------
  382. // FUNCTION:
  383. //   initManualLayer
  384. //
  385. // DESCRIPTION:
  386. //   This function is called in the onLoad event.  It is responsible
  387. //   for initializing the UI.
  388. //
  389. // ARGUMENTS:
  390. //   none
  391. //
  392. // RETURNS:
  393. //   nothing
  394. //--------------------------------------------------------------------
  395. function initManualLayer()
  396. {
  397.   if (_MenuGrid.list.length == 0)
  398.   {
  399.     _DefaultManual.value = "";
  400.     addNewRow();
  401.     _MenuGrid.setRowIndex(0);
  402. //    EnableDisableUpDownBtns();
  403. //    EnableDisableAddDelBtns();    
  404.   }
  405.   else
  406.   {
  407.     if (_MenuGrid.list.length == 1 && _MenuGrid.getRow() == "|")
  408.     {
  409.       _MenuGrid.setRow(" |");
  410.       _MenuGrid.setRowIndex(0);
  411.     }
  412.     _ColumnText.focus();
  413.     _ColumnText.select();
  414.   }
  415.  
  416.   if (_DefaultDatabase.value !="")
  417.   {
  418.     _DefaultManual.value = _DefaultDatabase.value;
  419.   }
  420. }
  421.  
  422. //--------------------------------------------------------------------
  423. // FUNCTION:
  424. //   showDifferentLayer
  425. //
  426. // DESCRIPTION:
  427. //   This function is called in the onLoad event.  It is responsible
  428. //   for initializing the UI.
  429. //
  430. // ARGUMENTS:
  431. //   none
  432. //
  433. // RETURNS:
  434. //   nothing
  435. //--------------------------------------------------------------------
  436. function showDifferentLayer(whichOne)
  437. {
  438.   if (whichOne == 'database')
  439.   {
  440.     if (dwscripts.getRecordsetNames().length == 0)
  441.     {
  442.       alert (dwscripts.sprintf(MM.MSG_NeedRecordsetForOption, dwscripts.getRecordsetDisplayName()));
  443.       _PopulateRadio.setIndex(0);
  444.       return;
  445.     }
  446.     _ManualLayer.visibility   = "hidden";
  447.     _DatabaseLayer.visibility = "visible";
  448.     initDatabaseLayer();
  449.   }
  450.   else
  451.   {
  452.     _DatabaseLayer.visibility = "hidden";
  453.     _ManualLayer.visibility   = "visible";
  454.     initManualLayer();
  455.   }
  456.  
  457. }
  458.  
  459.  
  460. //--------------------------------------------------------------------
  461. // FUNCTION:
  462. //   updateGridRow
  463. //
  464. // DESCRIPTION:
  465. //   This function is called in the onLoad event.  It is responsible
  466. //   for initializing the UI.
  467. //
  468. // ARGUMENTS:
  469. //   none
  470. //
  471. // RETURNS:
  472. //   nothing
  473. //--------------------------------------------------------------------
  474. function updateGridRow()
  475. {
  476.   _MenuGrid.setRow(_ColumnText.value + "|" + _ColumnValue.value);
  477. }
  478.  
  479.  
  480. //--------------------------------------------------------------------
  481. // FUNCTION:
  482. //   displayGridValues
  483. //
  484. // DESCRIPTION:
  485. //   This function is called in the onLoad event.  It is responsible
  486. //   for initializing the UI.
  487. //
  488. // ARGUMENTS:
  489. //   none
  490. //
  491. // RETURNS:
  492. //   nothing
  493. //--------------------------------------------------------------------
  494. function displayGridValues()
  495. {
  496.   var currRow = _MenuGrid.getRow();
  497.   var dividerIndex = currRow.indexOf("|");
  498.   _ColumnText.value = currRow.substring( 0,dividerIndex);
  499.   _ColumnValue.value = currRow.substring(dividerIndex+1);
  500. //  EnableDisableUpDownBtns();
  501. //  EnableDisableAddDelBtns();   
  502. }
  503.  
  504.  
  505. //--------------------------------------------------------------------
  506. // FUNCTION:
  507. //   displayDynamicDataDialog
  508. //
  509. // DESCRIPTION:
  510. //   This function pops up the dialog allowing the user to choose 
  511. //   dynamic data
  512. //
  513. // ARGUMENTS:
  514. //   none
  515. //
  516. // RETURNS:
  517. //   nothing
  518. //--------------------------------------------------------------------
  519. function displayDynamicDataDialog(textFieldObj)
  520. {
  521.   var serverModel = dw.getDocumentDOM().serverModel.getServerName();
  522.   var expression = dw.showDynamicDataDialog(textFieldObj.value);
  523.  
  524.   if (expression)
  525.   {
  526.     if (serverModel == "Cold Fusion")
  527.     {
  528.       expression = dwscripts.stripCFOutputTags(expression);
  529.     }
  530.     textFieldObj.value = expression;
  531.   }
  532. }
  533.  
  534.  
  535. //--------------------------------------------------------------------
  536. // FUNCTION:
  537. //   updateColumns
  538. //
  539. // DESCRIPTION:
  540. //   This function pops up the dialog allowing the user to choose 
  541. //   dynamic data
  542. //
  543. // ARGUMENTS:
  544. //   none
  545. //
  546. // RETURNS:
  547. //   nothing
  548. //--------------------------------------------------------------------
  549. function updateColumns()
  550. {
  551.   _MenuLabels.updateUI();
  552.   _MenuValues.updateUI();   
  553. }
  554.  
  555.  
  556. //--------------------------------------------------------------------
  557. // FUNCTION:
  558. //   getUniqueLabel
  559. //
  560. // DESCRIPTION:
  561. //   This function pops up the dialog allowing the user to choose 
  562. //   dynamic data
  563. //
  564. // ARGUMENTS:
  565. //   none
  566. //
  567. // RETURNS:
  568. //   nothing
  569. //--------------------------------------------------------------------
  570. function getUniqueLabel()
  571. {
  572.   var label, i, num=1, isUnique;
  573.  
  574.   for (isUnique=false; !isUnique; num++)
  575.   {
  576.     label = TEXT_defaultItemText + num;
  577.     isUnique = true;
  578.     for (i=0; i<GarrMenuOptions.length && isUnique; i++)
  579.       if (GarrMenuOptions[i][0] == label) isUnique=false;
  580.   }
  581.   return label;
  582. }
  583.  
  584.  
  585. //--------------------------------------------------------------------
  586. // FUNCTION:
  587. //   getUniqueLabel
  588. //
  589. // DESCRIPTION:
  590. //   This function pops up the dialog allowing the user to choose 
  591. //   dynamic data
  592. //
  593. // ARGUMENTS:
  594. //   none
  595. //
  596. // RETURNS:
  597. //   nothing
  598. //--------------------------------------------------------------------
  599. function getUniqueLabel(baseName)
  600. {
  601.   var label, i, num=1, isUnique,rowText,menuLabel;
  602.  
  603.   for (isUnique=false; !isUnique; num++)
  604.   {
  605.     label = baseName + num; 
  606.     isUnique = true;
  607.     for (i=0; i<_MenuGrid.list.length && isUnique; i++)
  608.     {
  609.       rowText = _MenuGrid.list[i]; 
  610.       menuLabel = rowText.substring(0,rowText.indexOf("|"));
  611.       if (menuLabel == label) isUnique=false;
  612.     }
  613.   }
  614.   return label;
  615. }
  616.  
  617. //--------------------------------------------------------------------
  618. // FUNCTION:
  619. //   EnableDisableUpDownBtns
  620. //
  621. // DESCRIPTION:
  622. //   Enable/disables the elemUp and elemDown buttons
  623. //
  624. // ARGUMENTS:
  625. //   None
  626. //
  627. // RETURNS:
  628. //   Nothing
  629. //--------------------------------------------------------------------
  630. function EnableDisableUpDownBtns()
  631. {
  632.   // Check if there are any columns
  633.   if (_MenuGrid.list.length == 0 || _MenuGrid.getRowIndex() == -1)
  634.   {
  635.     _ElemUp.setAttribute("disabled", true);
  636.     _ElemUp.src = "../Shared/MM/Images/btnUp_dis.gif";   
  637.  
  638.     _ElemDown.setAttribute("disabled", true);
  639.     _ElemDown.src = "../Shared/MM/Images/btnDown_dis.gif";        
  640.   }
  641.   else
  642.   {
  643.     if(_MenuGrid.list.length == 1)
  644.       {
  645.       // first row, so disable the up and down buttons
  646.       _ElemDown.setAttribute("disabled", true);
  647.       _ElemDown.src = "../Shared/MM/Images/btnDown_dis.gif";
  648.  
  649.       _ElemUp.setAttribute("disabled", true);
  650.       _ElemUp.src = "../Shared/MM/Images/btnUp_dis.gif";
  651.     }
  652.     else if(_MenuGrid.list.length-1 == _MenuGrid.getRowIndex())
  653.     {
  654.       // last row, so disable the down button and enable the up button
  655.       _ElemDown.setAttribute("disabled", true);
  656.       _ElemDown.src = "../Shared/MM/Images/btnDown_dis.gif";
  657.  
  658.       _ElemUp.setAttribute("disabled", false);
  659.       _ElemUp.src = "../Shared/MM/Images/btnUp.gif";
  660.     }    
  661.     // first row, if it is disable up button and enable the down button
  662.     else if (_MenuGrid.getRowIndex() == 0)
  663.     {
  664.       _ElemUp.setAttribute("disabled", true);
  665.       _ElemUp.src = "../Shared/MM/Images/btnUp_dis.gif";
  666.  
  667.       _ElemDown.setAttribute("disabled", false);
  668.       _ElemDown.src = "../Shared/MM/Images/btnDown.gif";      
  669.     }
  670.     else
  671.     {
  672.       //enable both up and down buttons
  673.       _ElemDown.setAttribute("disabled", false);
  674.       _ElemDown.src = "../Shared/MM/Images/btnDown.gif";
  675.  
  676.       _ElemUp.setAttribute("disabled", false);
  677.       _ElemUp.src = "../Shared/MM/Images/btnUp.gif";      
  678.     }
  679.   }
  680. }
  681.  
  682.  
  683. //--------------------------------------------------------------------
  684. // FUNCTION:
  685. //   EnableDisableAddDelBtns
  686. //
  687. // DESCRIPTION:
  688. //   Enable/disables the elemAdd and elemDel buttons
  689. //
  690. // ARGUMENTS:
  691. //   None
  692. //
  693. // RETURNS:
  694. //   Nothing
  695. //--------------------------------------------------------------------
  696. function EnableDisableAddDelBtns()
  697. {
  698.   // if there is no selection, disable the del button and make sure you 
  699.   // enable the add button...
  700.   if (_MenuGrid.getRowIndex() == -1)
  701.   {
  702.     _ElemAdd.setAttribute("disabled", false);
  703.     _ElemAdd.src = "../Shared/MM/Images/btnAdd.gif";   
  704.  
  705.     _ElemDel.setAttribute("disabled", true);
  706.     _ElemDel.src = "../Shared/MM/Images/btnDel_dis.gif";        
  707.   }
  708.   else
  709.   {
  710.     _ElemAdd.setAttribute("disabled", false);
  711.     _ElemAdd.src = "../Shared/MM/Images/btnAdd.gif";   
  712.  
  713.     _ElemDel.setAttribute("disabled", false);
  714.     _ElemDel.src = "../Shared/MM/Images/btnDel.gif";          
  715.   }
  716. }
  717.