// JavaScript Document


function ajaxHeight() {

    var o_ajax_wrapper = document.getElementById("ajaxWrapper");
    var o_left = document.getElementById("left");
    var o_right = document.getElementById("right");
    var o_right_wrapper = document.getElementById("leftWrapper");
    
    if ( o_right.clientHeight > o_right_wrapper.clientHeight ) {
        o_right.style.height = o_right_wrapper.clientHeight + "px";
    }
    
    if ( o_ajax_wrapper != null ) {
        // alert( o_ajax_wrapper.clientHeight );
        // alert( o_ajax_wrapper.innerHeight );
        // alert( o_ajax_wrapper.offsetHeight );
        // we are using the offset height instead of the client height because the
        o_left.style.height = ( o_ajax_wrapper.offsetHeight + 40 ) + "px";
    }
    
    setheight();

}

function setheight() {
    	
    
         
    var windowHeight = getWindowHeight() - 450;
    var centerRightHeight = document.getElementById('right').clientHeight;
    var centerLeftHeight =  document.getElementById('left').clientHeight;

    if ( centerRightHeight > centerLeftHeight ) {
        document.getElementById('left').style.height = ( centerRightHeight - 20 ) + "px";
    } else if ( centerLeftHeight > centerRightHeight ) {
        document.getElementById('right').style.height = ( centerLeftHeight - 20 ) + "px";
    }
    
    var centerRightHeight = document.getElementById('right').clientHeight;
    var centerLeftHeight =  document.getElementById('left').clientHeight;
    
    if ( windowHeight > centerRightHeight ) {
        document.getElementById('left').style.height = windowHeight + "px";
        document.getElementById('right').style.height = ( windowHeight ) + "px";
    }
    

	

}

window.onload = function() {
	setheight();
}
window.onresize = function() {
//	setheight();
}