//<![CDATA[ 

  var aContainerIds = new Array('nav-browse', 'images', 'text', 'photo', 'nav-image', 'nav-photo', 'slideshow');
  
  function Point(nX, nY) {
    this.nX = nX;
    this.nY = nY;
  }
  
  function Box(nTop, nRight, nBottom, nLeft) {
    this.nTop    = nTop;
    this.nRight  = nRight;
    this.nBottom = nBottom;
    this.nLeft   = nLeft;
  }
  
  function Border(bTop, bRight, bBottom, bLeft) {
    this.bTop    = bTop;
    this.bRight  = bRight;
    this.bBottom = bBottom;
    this.bLeft   = bLeft;
  }
    
  function addCorners() {
    var nCornerSize         = 6;
    var sBorderStyle        = '1px solid #fff';
    var aCorners            = new Array;
    var aPositions          = new Array;
    var aBorders            = new Array;
    var nNumberOfContainers = aContainerIds.length;
    var nContainerWidth, nContainerHeight;
    var oBox;
    var j, i;
    for(i=0; i<nNumberOfContainers; i++) {
      oContainer = document.getElementById(aContainerIds[i]);
      if(oContainer) {
        nContainerWidth  = oContainer.offsetWidth;
        nContainerHeight = oContainer.offsetHeight;
        if(aContainerIds[i]=='images') {
          nContainerHeight = nContainerHeight -25;
        }
        oContainer.style.position = 'relative';
        oBox = new Box(-nCornerSize, nContainerWidth, nContainerHeight, -nCornerSize);
        aPositions[0] = new Point(oBox.nLeft,  oBox.nTop);
        aPositions[1] = new Point(oBox.nRight, oBox.nTop);
        aPositions[2] = new Point(oBox.nRight, oBox.nBottom);
        aPositions[3] = new Point(oBox.nLeft,  oBox.nBottom);
        aBorders[0]   = new Border(true,  false, false, true);
        aBorders[1]   = new Border(true,  true,  false, false);
        aBorders[2]   = new Border(false, true,  true,  false);
        aBorders[3]   = new Border(false, false, true,  true);
        aCorners[i] = new Array();
        for(j=0; j<4; j++) {
          aCorners[i][j] = document.createElement('div');
          aCorners[i][j].setAttribute('id','corner'+i+'-'+j);
          aCorners[i][j].style.position = 'absolute';
          aCorners[i][j].style.width  = nCornerSize+'px';
          aCorners[i][j].style.height = nCornerSize+'px';
          aCorners[i][j].style.lineHeight = '0';
          aCorners[i][j].style.fontSize = '0';
          oContainer.appendChild(aCorners[i][j]);
          aCorners[i][j].style.left = aPositions[j].nX + 'px';
          aCorners[i][j].style.top  = aPositions[j].nY + 'px';
          aCorners[i][j].style.borderTop     = aBorders[j].bTop    ? sBorderStyle : '0';
          aCorners[i][j].style.borderRight   = aBorders[j].bRight  ? sBorderStyle : '0';
          aCorners[i][j].style.borderBottom  = aBorders[j].bBottom ? sBorderStyle : '0';
          aCorners[i][j].style.borderLeft    = aBorders[j].bLeft   ? sBorderStyle : '0';
        }
	    }
    }
  }
  
  if(typeof Array.prototype.push != "function"){
      Array.prototype.push = ArrayPush;
      function ArrayPush(value){
          this[this.length] = value;
      }
  }

  /*
      Written by Jonathan Snook, http://www.snook.ca/jonathan
      Add-ons by Robert Nyman, http://www.robertnyman.com
  */
  function getElementsByClassName(oElm, strTagName, strClassName){
      var arrElements = (strTagName == "*" && oElm.all)? oElm.all : oElm.getElementsByTagName(strTagName);
      var arrReturnElements = new Array();
      strClassName = strClassName.replace(/\-/g, "\\-");
      var oRegExp = new RegExp("(^|\\s)" + strClassName + "(\\s|$)");
      var oElement;
      for(var i=0; i<arrElements.length; i++){
          oElement = arrElements[i];      
          if(oRegExp.test(oElement.className)){
              arrReturnElements.push(oElement);
          }   
      }
      return (arrReturnElements)
  }

  function stretchColumns() {
	  var aDivs = document.getElementsByTagName('div');
	  var nDivsLength = aDivs.length;
	  var oLeft, oRight;
	  var nOffsetHeightMax;
	  var aLefts, aRights;
	  for(var i=0; i<nDivsLength; i++) {
	    nOffsetHeightMax = 0;
	    if(aDivs[i].id.substring(0,4) == 'row-') {
	      aLefts  = getElementsByClassName(aDivs[i], "div", "left");
	      aRights = getElementsByClassName(aDivs[i], "div", "right");
	      if(aLefts[0].offsetHeight > aRights[0].offsetHeight) {
	        aRights[0].style.height = aLefts[0].offsetHeight + 'px';
	      } else if(aRights[0].offsetHeight > aLefts[0].offsetHeight) {
	        aLefts[0].style.height = aRights[0].offsetHeight + 'px';
	      }
	    }
	  }    
  }
  
  function doCornerStuff() {
    stretchColumns();
    addCorners();
  }
  
//]]> 