/*
 dyn.js
 for dyanimally setting text within an html document.

 Here is some text:
 <div id="sometext">blah blah</div>

 to change text to "hey", call this javascript:
 setTextById("sometext", "hey"); 

 NOTE:  I believe for the old netscape, you need to specify the following
     (this will make it a "layer")
     --  not needed for the other methods, which work in IE, Opera and Mozilla
 <STYLE>
 #sometext { position: absolute; }
 </STYLE>
*/

function setTextById(id, newtext) {
    //alert("setTextById");
    if (document.all) {
        //alert('got all');
        //document.all['heythere'].innerText = "now";
        var elem = document.all[id];
        elem.innerHTML = newtext;
    }
    else if (document.getElementById) {
        //alert('got getElementById: ' + id);
        var elem = document.getElementById(id);
        elem.innerHTML = newtext;
    }
    else if (document.layers) {
        //alert('got layers');
        // for older netscape
        //var layer = document[id];
        var layer = document.layers[id];
        //alert("layer: " + layer);
        layer.document.open();
        layer.document.writeln(newtext);
        layer.document.close();
    }
    else {
        alert("script could not set the text");
    }
}


