function CreateFormElements()
{
    if (document.getElementById && document.createElement) 
    { 
        var el;

        el = document.createElement('input');
        el.setAttribute('name','text1');
        if (el.getAttribute('name') != 'text1')
        { 
            el = document.createElement('<input name="text1">'); 
        } 
        el.setAttribute('type','text'); 
        el.setAttribute('size','20'); 
        el.setAttribute('value','text here'); 
        document.getElementById('text1').appendChild(el);

        el = document.createElement('input'); 
        el.name = 'text2'; 
        if (el.name != 'text2')
        { 
            el = document.createElement('<input name="text2">'); 
        } 
        el.type = 'text'; 
        el.size = '20'; 
        el.value = 'text here'; 
        document.getElementById('text2').appendChild(el);
        
        el = document.createElement('input'); 
        el.setAttribute('name','radio'); 
        if (el.getAttribute('name') != 'radio')
        { 
            el = document.createElement('<input name="radio">'); 
        } 
        el.setAttribute('type','radio'); 
        document.getElementById('radio1').appendChild(el);
        
        el = document.createElement('input'); 
        el.name = 'radio'; 
        if (el.name != 'radio')
        { 
            el = document.createElement('<input name="radio">'); 
        } 
        el.type = 'radio'; 
        document.getElementById('radio2').appendChild(el);
        
        el = document.createElement('input'); 
        el.setAttribute('name','checkbox1'); 
        if (el.getAttribute('name') != 'checkbox1')
        { 
            el = document.createElement('<input name="checkbox1">'); 
        } 
        el.setAttribute('type','checkbox'); 
        document.getElementById('checkbox1').appendChild(el);
        
        el = document.createElement('input'); 
        el.name = 'checkbox2'; 
        if (el.name != 'checkbox2')
        { 
        el = document.createElement('<input name="checkbox2">'); 
        } 
        el.type = 'checkbox'; 
        document.getElementById('checkbox2').appendChild(el);
        
        el = document.createElement('input'); 
        el.setAttribute('name','password1'); 
        if (el.getAttribute('name') != 'password1')
        { 
            el = document.createElement('<input name="password1">'); 
        } 
        el.setAttribute('type','password'); 
        el.setAttribute('size','20'); 
        el.setAttribute('value','password'); 
        document.getElementById('password1').appendChild(el);
        
        el = document.createElement('input'); 
        el.name = 'password2'; 
        if (el.name != 'password2')
        { 
            el = document.createElement('<input name="password2">'); 
        } 
        el.type = 'password'; 
        el.size = '20'; 
        el.value = 'password'; 
        document.getElementById('password2').appendChild(el);
        
        el = document.createElement('input'); 
        el.setAttribute('name','submit1'); 
        if (el.getAttribute('name') != 'submit1')
        { 
            el = document.createElement('<input name="submit1">'); 
        } 
        el.setAttribute('type','submit'); 
        el.setAttribute('value','submit form'); 
        document.getElementById('submit1').appendChild(el);
        
        el = document.createElement('input'); 
        el.name = 'submit2'; 
        if (el.name != 'submit2')
        { 
            el = document.createElement('<input name="submit2">'); 
        } 
        el.type = 'submit'; 
        el.value = 'submit form'; 
        document.getElementById('submit2').appendChild(el);
        
        el = document.createElement('input'); 
        el.setAttribute('name','reset1'); 
        if (el.getAttribute('name') != 'reset1')
        { 
            el = document.createElement('<input name="reset1">'); 
        } 
        el.setAttribute('type','reset'); 
        el.setAttribute('value','clear form'); 
        document.getElementById('reset1').appendChild(el);
        
        el = document.createElement('input'); 
        el.name = 'reset2'; 
        if (el.name != 'reset2')
        { 
            el = document.createElement('<input name="reset2">'); 
        } 
        el.type = 'reset'; 
        el.value = 'clear form'; 
        document.getElementById('reset2').appendChild(el);
        
        el = document.createElement('input'); 
        el.setAttribute('name','file1'); 
        if (el.getAttribute('name') != 'file1')
        { 
            el = document.createElement('<input name="file1">'); 
        } 
        el.setAttribute('type','file'); 
        document.getElementById('file1').appendChild(el);
        
        el = document.createElement('input'); 
        el.name = 'file2'; 
        if (el.name != 'file2')
        { 
            el = document.createElement('<input name="file2">'); 
        } 
        el.type = 'file'; 
        document.getElementById('file2').appendChild(el);
        
        el = document.createElement('input'); 
        el.setAttribute('name','image1'); 
        if (el.getAttribute('name') != 'image1')
        { 
            el = document.createElement('<input name="image1">'); 
        } 
        el.setAttribute('type','image'); 
        el.setAttribute('src','../shared/pencil.jpg'); 
        el.setAttribute('alt','button image');
        el.setAttribute('width','80');
        el.setAttribute('height','80');
        document.getElementById('image1').appendChild(el);
        
        el = document.createElement('input'); 
        el.name = 'image2'; 
        if (el.name != 'image2')
        { 
            el = document.createElement('<input name="image2">'); 
        } 
        el.type = 'image'; 
        el.src = '../shared/pencil.jpg'; 
        el.alt = 'button image';
        el.width = '80';
        el.height = '80';
        document.getElementById('image2').appendChild(el);
        
        el = document.createElement('input'); 
        el.setAttribute('name','button1'); 
        if (el.getAttribute('name') != 'button1')
        { 
            el = document.createElement('<input name="button1">'); 
        } 
        el.setAttribute('type','button'); 
        el.setAttribute('value','a button'); 
        document.getElementById('button1').appendChild(el);
        
        el = document.createElement('input'); 
        el.name = 'button2'; 
        if (el.name != 'button2')
        { 
            el = document.createElement('<input name="button2">'); 
        } 
        el.type = 'button'; 
        el.value = 'a button'; 
        document.getElementById('button2').appendChild(el); 
    }
}

function ReportElementAttributes()
{
    var inputs = document.getElementsByTagName('INPUT');
    for (var i = 0; i < inputs.length; i++)
    {
        if (inputs[i].parentNode.tagName == 'DD') inputs[i].onclick = function()
        {
            var str = "attributes: ";
            for (var a = 0; a < this.attributes.length; a++)
            {
                if (this.attributes[a].nodeValue != '' && this.attributes[a].nodeValue != null)
                {
                    str += this.attributes[a].nodeName + "='" + this.attributes[a].nodeValue + "'";
                    if (a < this.attributes.length - 1) str += "; ";
                }
            }
            alert(str);
        }
    }
}