function openImage(id, name) {
  var img = document.getElementById(id);
  var fakeImg = document.createElement('img');
  fakeImg.src = img.src;
  var width = fakeImg.width + 45;
  var height = fakeImg.height + 75;
  var wleft = Math.round((screen.width - width) / 2);
  var wtop = Math.round((screen.height - height) / 2);

  var win = window.open('', '', 'width=' + width + ', height=' + height + ', ' +
'left=' + wleft + ', top=' + wtop + ', ' +
'location=no, menubar=no, ' +
'status=no, toolbar=no, scrollbars=no, resizable=no');

  win.document.write('<html><head><title>3rd and Wall - '+name+'</title></head><body><center><img src=\"'
    +fakeImg.src+'\" alt=\"'+name+'\"/></center></body></html>');
  win.document.close();

  win.resizeTo(width, height);
  win.moveTo(wleft, wtop);
  win.focus();
}

function insertScript(id, imgName) {
  var ta = document.getElementById(id);
  if (q__isExplorer()){
    alert("innerText: " + ta.innerText);
    ta.innerText = ta.innerText + "<img src=\"" + imgName + "\"/>";
    alert("innerText: " + ta.innerText);
  } else if (q__isMozilla()) {
    alert("innerHTML: " + ta.innerHTML);
    ta.innerHTML = ta.innerHTML + "<img src=\"" + imgName + "\"/>";
    alert("innerHTML: " + ta.innerHTML);
  }
}
