Layout fixed, sidebar adjust according with the main content

hack
he = $('#mainContainer').height();
tamano = he-550+"px";
$('#sidebar').css({'height': tamano});