The better way to match image src attribute is :
function changeImage() {
var image = document.getElementById('myImage');
if (image.getAttribute('src')=="pic_bulbon.gif") {
image.src = "pic_bulboff.gif";
} else {
image.src = "pic_bulbon.gif";
}
}
This works.