function $(id){return document.getElementById(id);}
var min_w = 1004;
var now_w = document.body.clientWidth;
if(now_w >min_w){ document.write("<style>#top,#foot{ width:100%;}</style>");}

function change_div(num){
	$("top").style.width = num;
	$("foot").style.width = num;
}
window.onresize = function (){
	now_w = document.body.clientWidth;	
	if(now_w>min_w) change_div("100%");
	else change_div(min_w+"px");
}