var browser = new Object();
  browser.isMicrosoft = false;
  browser.isNetscape = false;
  if (navigator.appName.indexOf("Netscape") != -1) {
    browser.isNetscape = true;
  }
  if (navigator.appName.indexOf("Microsoft") != -1) {
    browser.isMicrosoft = true;
  }
  
function imagescroller (thumbimage, fullimage, n, division, width) {
  var a = new Array();
  var img = new Array();
  var fullimg = new Array();
  var thumbimg = new Array();
  var nbsp = new Array();
  var div = document.createElement("div");
  div.setAttribute("id", division);
  if (browser.isMicrosoft) {
    div.style.width = width + "px";
  }
  if (browser.isNetscape) {
    div.setAttribute("style", "width:"+ width + "px;");
  }
  document.body.appendChild(div);
  
  for (var i=0; i<2; i++) {
    //Create &nbsp character using String.fromCharCode method that converts a unicode character to a string
    nbsp[i] = document.createTextNode(String.fromCharCode(160));
    div.appendChild(nbsp[i]);
  } 
  for (var j=0; j<n; j++) {
 
    fullimg[j] = fullimage[j];
    thumbimg[j] = thumbimage[j];
    a[j] = document.createElement("a");
    var hrefstr = "javascript:window.open(\'" + fullimg[j].src + "\', \'object\',  \'scrollbars=no, width=425, height=425, resizable=no\');void 0;";
    a[j].setAttribute("href", hrefstr);
    img[j] = document.createElement("img");
    img[j].setAttribute("class", "horizontal");
    img[j].setAttribute("src", thumbimg[j].src);
    img[j].setAttribute("border", "0");
    a[j].appendChild(img[j]);
    div.appendChild(a[j]);
    
 
    if ((j+1) == n) break;
    for (var k=0; k<6; k++) {
     nbsp[k] = document.createTextNode(String.fromCharCode(160));
     div.appendChild(nbsp[k]);
    }
  }
}


