﻿// JScript File

function dkconfig_checkListBoxKeyUp(oListBox, oSubmit, oEvent)
{

  if(oEvent != null)
  {
    var iKeyCode = -1;
    
    iKeyCode = oEvent.which != null ? oEvent.which : (oEvent.keyCode != null ? oEvent.keyCode : -1);       

    dkconfig_listBoxDoKeyPress(oListBox, oSubmit, iKeyCode);
  }
}

function dkconfig_listBoxDoKeyPress(oListBox, oSubmit, iKeyCode)
{
  if(oSubmit != null)
  {
    if(iKeyCode == 13)
    {
      oSubmit.click();
    }
  }
}

function dkconfig_listBoxChange(oListBox, oHidden)
{
  if(oListBox != null && oHidden != null)
  {
    var i = 0;
    var sDummy = "";
    
    for(i=0; i<oListBox.length; i++)
    {
      if(oListBox.options[i].selected == true)
      {
        if(sDummy.length > 0)
        {
          sDummy = sDummy + "@@" + oListBox.options[i].value;
        }
        else
        {
          sDummy = oListBox.options[i].value;
        }
      }
    }   
    
    oHidden.value = sDummy;
  }
}
