I will try to help. If you like javascript librarys like jQuery. This would be a solution. I have tested it in IE and firefox.
I dont know how it performs in other browsers.
If you don't want to work with librarys because they take up space. Just let me or us know.
I hope this is a solution.
function screenWidth(){
var height=0;
var width=0;
if (self.screen) { // for NN4 and IE4
width = screen.width;
height = screen.height
}
if(width < 801 && width > 783){ // I took the scrollbar in consideration
$('#main_div').css("width", "798px"); // If you have a scrollbar on the right. You have to adjust the main_div width
}
if(width > 1024){
$('#main_div').css("width", "100%");
}
}
$(window).load(function(){
screenWidth();
});
You can keep adding screen resolutions in the code.