// DOM Tools.
// 
// Created: 10.10.2008
// 
// (c) 2008 ServiceHome
// 
// Web : http://www.servicehome.net
// Mail: info@servicehome.net
// 
// based on: 
//  - Prototype 1.6.0.2 (http://www.prototypejs.org/)
////////////////////////////////////////////////////////////////////////////////

var SH_DOMTOOLS = Class.create({
    initialize: function () {
        // NOTHING
    },
    
    createSelect: function (name, id) {
        var select = document.createElement("select");
        select.setAttribute("name", name);
        select.setAttribute("id", id);

        return(select);
    },
    
    createOption: function (value, label) {
        var option = document.createElement("option");
        option.setAttribute("value", value);
        option.appendChild(document.createTextNode(label));
        
        return(option);
    },
    
    addOption: function (select_ref, value, label) {
        select_ref.appendChild(this.createOption(value, label));
    },
    
    removeOptionByIndex: function (select_ref, index) {
        var option = select_ref.childNodes[index];
        select_ref.removeChild(option);
    }
});
