function addoption(selectid, txt, val, selected)
{

    // write your own safari browser detection

    if((agt.indexOf('safari')!=-1)&&(agt.indexOf('mac')!=-1)) {

        var element = document.getElementById(selectid);
        var newone = new option(txt,val,selected);
        element.add(newone,element.options[element.options.length]);

    } else {

        var objoption = new option(txt, val, selected);
        document.getElementById(selectid).options.add(objoption);

    }

}

function clearoptionlist(selectid) 
{

    document.getElementById(selectid).options.length = 0;

}
