function screenSize() {
var w, h;
w = (window.innerWidth ? window.innerWidth : (document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.offsetWidth));
h = (window.innerHeight ? window.innerHeight : (document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.offsetHeight));
return {w:w, h:h};
}
function ChHgh() {
var content_width = screenSize().w;
document.getElementById('block1').style.width = content_width + 'px';
}
вот так вышло