var objmain = document.getElementById("main");
function updatesize()
{
var bodyw = window.document.body.offsetWidth;
if(bodyw <= 790)
  objmain.style.width="770px";
else if(bodyw >= 1016)
  objmain.style.width="990px";
else
  objmain.style.width="100%";
}
updatesize(); 
window.onresize = updatesize;
