var img = document.createElement('img');
img.setAttribute('src', 'http://clients.realestatechannel.ca/js/view.php?pid=' + pid);