

    window.onload = function() {
	setAllDivWidth('photoBox');
    }

    function setAllDivWidth(cName) {
	cArr = getElementsByClass ('DL', 'DIV', cName);
	for (i = 0; i<cArr.length; i++) {
	    setDivWidth(cArr[i]);
	}
    }

    // pass a HTMLDivElement object to this
    function setDivWidth(d) {
      firstImgWidth = d.getElementsByTagName('img')[0].width;
      d.style.width = firstImgWidth + 'px';
    }

    function getElementsByClass (tName, cName, windowRef) {

      if (!windowRef)
	windowRef = window;

      var i;
      var elmlist = new Array();
      var all;

      if (windowRef.document.getElementsByTagName) {
	all = windowRef.document.getElementsByTagName(tName);
      } else if (windowRef.document.all) {
	all = windowRef.document.all;
      } else {
	all = new Array();
      }

      for (i = 0; i < all.length; i++) {
	if ( (all[i].className.search(cName) > -1) && all[i].tagName == tName) {
	  elmlist[elmlist.length] = all[i];
	}
      }

      return elmlist;
    }

