//** Dynamic Drive Equal Columns Height script v1.01 (Nov 2nd, 06)
//** http://www.dynamicdrive.com/style/blog/entry/css-equal-columns-height-script/

var ddequalcolumns=new Object()
//Input IDs (id attr) of columns to equalize. Script will check if each corresponding column actually exists:
ddequalcolumns.columnswatch=["right-user1", "right-user2"]

ddequalcolumns.setHeights=function(reset){
    
    if (document.documentElement.clientWidth > 1024 && navigator.appVersion.indexOf("MSIE 6.") == -1) {
        document.getElementById('wrapper').style.width="1022px"
        document.getElementById('wrapper_r').style.width="1022px"
    }
    else
    {
        document.getElementById('wrapper').style.width="1000px"
        document.getElementById('wrapper_r').style.width="1000px"
    }
    
    
    var tallest=0
    var resetit=(typeof reset=="string")? true : false
    for (var i=0; i<this.columnswatch.length; i++){
        if (document.getElementById(this.columnswatch[i])!=null){
            if (resetit == false)
                if (document.getElementById(this.columnswatch[i]).offsetHeight>tallest){
                    tallest=document.getElementById(this.columnswatch[i]).offsetHeight
                }
        }
    }
    if (tallest>0){
        for (var i=0; i<this.columnswatch.length-1; i++){
            if (document.getElementById(this.columnswatch[i])!=null)
                document.getElementById(this.columnswatch[i]).style.height=(tallest-1)+"px"
        }
    }
}

ddequalcolumns.resetHeights=function(){
    this.setHeights("reset")
}

ddequalcolumns.dotask=function(target, functionref, tasktype){ //assign a function to execute to an event handler (ie: onunload)
    var tasktype=(window.addEventListener)? tasktype : "on"+tasktype
    if (target.addEventListener)
        target.addEventListener(tasktype, functionref, false)
    else if (target.attachEvent)
        target.attachEvent(tasktype, functionref)
}

ddequalcolumns.dotask(window, function(){ddequalcolumns.setHeights()}, "load")
ddequalcolumns.dotask(window, function(){if (typeof ddequalcolumns.timer!="undefined") clearTimeout(ddequalcolumns.timer); ddequalcolumns.timer=setTimeout("ddequalcolumns.resetHeights()", 200)}, "resize")
