﻿function swapImages(img, fileSm, fileLg, widthSm, widthLg) {
  if (img.src.indexOf('/standard/') > 0) {
    var IbDiv = document.getElementById("ImageBreak");
    var EnlDiv = document.getElementById("enlarge");
    if (IbDiv) {
      if (getWindowWidth() < 986) { 
        IbDiv.style.display = 'inline';
      } else {
        IbDiv.style.display = 'none';
      };          
    };
    if (EnlDiv) EnlDiv.style.visibility = 'hidden';
    img.src = fileLg;
    img.width = widthLg;
  } else {
    var IbDiv = document.getElementById("ImageBreak");
    var EnlDiv = document.getElementById("enlarge");
    if (IbDiv) IbDiv.style.display = 'none';
    if (EnlDiv) EnlDiv.style.visibility = 'visible';
    img.src = fileSm;
    img.width = widthSm;
  };
  return false;
};
function getWindowWidth() {
  return (window.innerWidth)?window.innerWidth:((document.all)?document.body.clientWidth:986);
};