
/*
if (document.getElementById || document.all) { // minimum dhtml support required
   window.onload = winOnLoad;
}

function winOnLoad()
{
  var ele = xGetElementById('AreaLeft');
  if (ele && xDef(ele.style, ele.offsetHeight)) { // another compatibility check
    adjustLayout();
    xAddEventListener(window, 'resize', winOnResize, true);
  }
}
function winOnResize()
{
  adjustLayout();
}
function adjustLayout()
{
  // Get content heights
  var cHeight = xHeight('centerColumnContent');
  var lHeight = xHeight('leftColumnContent');
  var rHeight = xHeight('rightColumnContent');

  // Find the maximum height
  var maxHeight = Math.max(cHeight, Math.max(lHeight, rHeight));

  // Assign maximum height to all columns
  xHeight('AreaLeft', maxHeight);
  xHeight('AreaContent', maxHeight);
  xHeight('AreaRight', maxHeight);

}
*/

function getElementsByClass(searchClass,node,tag) {
            var classElements = new Array();
            if ( node == null )
                        node = document;
            if ( tag == null )
                        tag = '*';
            var els = node.getElementsByTagName(tag);
            var elsLen = els.length;
            var pattern = new RegExp("(^|\\s)"+searchClass+"(\\s|$)");
            for (i = 0, j = 0; i < elsLen; i++) {
                        if ( pattern.test(els[i].className) ) {
                                    classElements[j] = els[i];
                                    j++;
                        }
            }
            return classElements;
}

function setNormal(searchClass,node,tag) {
           
            if (document.getElementById) {
                        // the divs array contains references to each column's div element.  
                        // Replace 'center' 'right' and 'left' with your own.  
                        // Or remove the last one entirely if you've got 2 columns.  Or add another if you've got 4!
                        var divs = new getElementsByClass(searchClass,node,tag);
                        
                        // Let's resetset all columns height
                        for (var i = 0; i < divs.length; i++) {
                           divs[i].style.height = '';                                   
                           divs[i].style.minHeight = '';                                   
                        }
            }
}



function setAreaHeights() {
            if (document.getElementById) {
            
                // Get the element objects
                var elALeft = document.getElementById('AreaLeft');
                var elAContent = document.getElementById('AreaContent');
                var elARight = document.getElementById('AreaRight');
                var elAContentandRight = document.getElementById('AreaContentAndRight');
                var elAreaFull = document.getElementById('AreaFull');
                
                var elAreaFulloffsetTop = ((navigator.appName == "Microsoft Internet Explorer") ? 0 : elAreaFull.offsetTop);
                var maxy = elAreaFull.offsetHeight + elAreaFulloffsetTop;
                               
                var FACTOR = 1;
                var UNIT = 'px';
                
                //if(elALeft) elALeft.style.height = (maxy - elALeft.offsetTop) * FACTOR + UNIT;
                //if(elAContent) elAContent.style.height = (maxy - elAContent.offsetTop) * FACTOR + UNIT;
                //if(elARight) elARight.style.height = (maxy - elARight.offsetTop) * FACTOR + UNIT;
                //if(elAContentandRight) elAContentandRight.style.height = (maxy - elAContentandRight.offsetTop) * FACTOR + UNIT;

                if (navigator.userAgent.indexOf('MSIE 6.0') != -1) 
                {
                    if(elALeft) elALeft.style.height = (maxy - elALeft.offsetTop) * FACTOR + UNIT;
                    if(elAContent) elAContent.style.height = (maxy - elAContent.offsetTop) * FACTOR + UNIT;
                    if(elARight) elARight.style.height = (maxy - elARight.offsetTop) * FACTOR + UNIT;
                    if(elAContentandRight) elAContentandRight.style.height = (maxy - elAContentandRight.offsetTop) * FACTOR + UNIT;              
                    
                } else {
                    if(elALeft) elALeft.style.minHeight = (maxy - elALeft.offsetTop) * FACTOR + UNIT;
                    if(elAContent) elAContent.style.minHeight = (maxy - elAContent.offsetTop) * FACTOR + UNIT;
                    if(elARight) elARight.style.minHeight = (maxy - elARight.offsetTop) * FACTOR + UNIT;
                    if(elAContentandRight) elAContentandRight.style.minHeight = (maxy - elAContentandRight.offsetTop) * FACTOR + UNIT;
                }
                
 

                return;
                
                /*
            
                var elSearch = document.getElementById('searchHolder');
            
            
                var hLeft = 0;
                var hContent = 0;
                var hRight = 0;
                var hSearch = 0;
                var hCntRight = 0;
                var hContentRight = 0;
                
                
                
                // Find the heights of the divs
                if (elSearch)   hSearch = elSearch.offsetHeight;
                if (elALeft)    hLeft = elALeft.offsetHeight;
                if (elAContent) hContent = elAContent.offsetHeight;
                if (elARight)   hRight = elARight.offsetHeight;
                if (elAContentandRight) hContentRight = elAContentandRight.offsetHeight;
                
                
                
                
                //Adjust hieght according to highest div and search area
                hCntRight = hContent;
                if (hRight > hCntRight) hCntRight = hRight;
                if (hContentRight - hSearch > hCntRight) hCntRight = hContentRight;
                if (hSearch + hCntRight > hLeft) hLeft = hSearch + hCntRight;
                else hCntRight = hLeft - hSearch;
                
                
                
                // Set the calculated heights, and if neccesary offset for padding in IE5.5 etc.
                if (elALeft) {
                    elALeft.style.height = hLeft + 'px';
                    if (elALeft.offsetHeight > hLeft) elALeft.style.height = (hLeft -(elALeft.offsetHeight - hLeft)) + 'px';
                }
                if (elARight) {
                    elARight.style.height = hCntRight + 'px';
                    if (elARight.offsetHeight > hCntRight) elARight.style.height = (hCntRight -(elARight.offsetHeight - hCntRight)) + 'px';
                }
                if (elAContent) {
                    elAContent.style.height = hCntRight + 'px';
                    if (elAContent.offsetHeight > hCntRight) elAContent.style.height = (hCntRight -(elAContent.offsetHeight - hCntRight)) + 'px';
                }
                if (elAContentandRight) {
                    elAContentandRight.style.height = hCntRight + 'px';
                    if (elAContentandRight.offsetHeight > hCntRight) elAContentandRight.style.height = (hCntRight -(elAContentandRight.offsetHeight - hCntRight)) + 'px';
                }
                */
            }
}


function setTall(searchClass,node,tag) {
           
            if (document.getElementById) {
                        // the divs array contains references to each column's div element.  
                        // Replace 'center' 'right' and 'left' with your own.  
                        // Or remove the last one entirely if you've got 2 columns.  Or add another if you've got 4!
                        var divs = new getElementsByClass(searchClass,node,tag);
                        
                        // Let's determine the maximum height out of all columns specified
                        var maxHeight = 0;
                        for (var i = 0; i < divs.length; i++) {
                          if (divs[i].offsetHeight > maxHeight) maxHeight = divs[i].offsetHeight;
                        }
                       // Let's set all columns to that maximum height
                        for (var i = 0; i < divs.length; i++) {
                           divs[i].style.height = maxHeight + 'px';
                                   // Now, if the browser's in standards-compliant mode, the height property
                                   // sets the height excluding padding, so we figure the padding out by subtracting the
                                   // old maxHeight from the new offsetHeight, and compensate!  So it works in Safari AND in IE 5.x
                                    if (divs[i].offsetHeight > maxHeight) {
                                          divs[i].style.height = (maxHeight - (divs[i].offsetHeight - maxHeight)) + 'px';
                                    }
                        }
            }
}

/*
window.onload = function() {
    setAreaHeights();
 //  setTall('equalheight', document, '*');

}

window.onresize = function() {
    alert(1);
    setAreaHeights();
//    setTall('equalheight', document, '*');

}
*/


