You just need to use 'this' which is the element that the onclick event occurred as in changeImage(this, 'bannerImage_left');
then within function function changeImage(elem, bannerId)
get the src: from 1st parameter elem
elem.src and remove '_thumb' with elem.src.replace('_thumb','');
then add converted src to 2nd parameter bannerid ref src using document.getElementById(bannerId).src