function sortlist(listID)
{
    var isNumeric=false;
    var selectBox = document.getElementById(listID);	
    var selectArray = new Array();    
    try
    {
        for (i = 0; i < selectBox.length; i++)
        {
            selectArray[i] = new Array();
            selectArray[i][0] = selectBox.options[i].text;
            selectArray[i][1] = selectBox.options[i].value;
            isNumeric=(!isNumeric?!isNaN((selectBox.options[i].text*1)):isNumeric)
        }
        if (isNumeric)
        {
            for (i = 0; i < selectBox.length-1; i++)
            {
                for (j=i; j < selectBox.length; j++)
                {
                    if( (selectBox.options[i].text*1)>(selectBox.options[j].text*1))
                    {
                        tNum=selectBox.options[i].text;
                        tVal=selectBox.options[i].Value;
                        selectBox.options[i].text=selectBox.options[j].text
                        selectBox.options[i].Value=selectBox.options[j].value
                        selectBox.options[j].text=tNum;
                        selectBox.options[j].value=tVal;
                    }
                }
            }
        }
        else
        {
            selectArray.sort();
            for (j = 0; j < selectBox.length; j++)
            {
                selectBox.options[j].text = selectArray[j][0];
                selectBox.options[j].value = selectArray[j][1];
            }
        }
    }
    catch(e)
    {
        //In case of any error, dont do anything.
        //alert('The following error occurred: ' + e.name + ' - ' + e.message);
    }
}

