function eventFire(el, etype){
if (el.fireEvent) {
el.fireEvent('on' + etype);
} else {
var evObj = document.createEvent('Events');
evObj.initEvent(etype, true, false);
el.dispatchEvent(evObj);
}
}
var parent = document.getElementById("elements");
var childs = parent.getElementsByTagName('div');
for (var i = 0; i < childs.length; i++) {
if (i = 1) {
eventFire(childs[i], 'click');
break;
}
}