That means that
var imgobj = eval('document.' + coll + 'image' + num + styleObj)
is returning null. You'll need to figure out why that is. My understanding is eval is evil so I would suggest changing to using jQuery $("#fieldName") or document.getElementById("id"); instead of using eval.