Hi there,
here is some code I just wrote:
// event of button onmouseout
function normalstate(){
change.style.backgroundColor= 'deepskyblue';
}
//event of button onclick
function doit(this){
alert(this.id);
}
var buttonframe = document.createElement('div');//creating a dividerelement
buttonframe.setAttribute('id', 'dummy');//with the id of the elementgroup
buttonframe.setAttribute('className', 'buttonframe');//setting its class to buttonframe in the .CSS
document.childNodes[1].childNodes[1].appendChild(buttonframe);//find the body node of the document and append the frame
var frame = document.getElementById('dummy');//referring to the element by its new id
frame.style.top = fromtop;//setting th position offset from top
frame.style.left = fromleft;//setting th position offset from left
var button = document.createElement('div');//creating the divider button element
button.setAttribute('id', '
test');//setting its id
button.setAttribute('className', 'button');//setting the class name from the .CSS style sheet
document.getElementById('dummy').appendChild(button);//refer to the frame element by its id and append the button
var change = document.getElementById('test');//get the button element by its id and position it
change.style.top = "0"
document.getElementById("test").attachEvent("onmouseover",highlite);//give it an event onmouseover
document.getElementById("test").attachEvent("onmouseout",normalstate);//give it an event onmouseout
document.getElementById("test").attachEvent("onclick",doit);//give it an event onmouseout
Hope this will help you
bigdog
jstacher@econophone.ch