Through the efforts of the participants of the site, I understood a little where to dig in the editing of the code. In general rewrote under jQuery. But the code does not work ... What did I do wrong? Tell me.
Problem solved in a completely different way. Thanks to all.
function hide_div() { //var rnd_200 = Math.round(Math.random()*4) + 7; swap_img('loader_' + rnd_200); clearTimeout(show_delay); show_delay = null; if (!obj_float_div) return; obj_float_div.style.visibility = 'hidden'; obj_float_div.style.left = "-3000px"; obj_float_div = false; } var IE = (document.all); var NC = (document.layers); var Opera = (document.getElementById); function getWidth() { if (IE) return document.body.clientWidth; if (NC) return window.innerWidth; if (Opera) return document.body.offsetWidth; return 1024; } var cmw; var hfw; var ww; function recount() { var ttt; if (window.getSize().x >= 1690) { ttt = 8; } else if (window.getSize().x >= 1260) { ttt = 6; } else { ttt = 4; } cmw = ttt * 205; hfw = cmw - 5; ww = hfw + 30; } window.onload = resizecontent; window.onresize = resizecontent; function resizecontent() { recount(); $('#header').css({ 'width': hfw + 'px' }); $('#footer').css({ 'width': hfw + 'px' }); if ($('#contentmain').length > 0) { $('#contentmain').css({ 'width': cmv + 'px' }); } else { $('#wrapper').css({ 'width': ww }); } if ($('#imagezoom_overlay').length > 0) { $('#imagezoom_overlay').width(document.body.clientWidth); $('#imagezoom_overlay').height(window.innerHeight().y); } } text in italics