// Event Listener // by Scott Andrew - http://scottandrew.com/ function addEvent(obj, evType, fn) { if (obj.addEventListener) { obj.addEventListener(evType, fn, false); return true; } else if (obj.attachEvent) { var r = obj.attachEvent('on'+evType, fn); return r; } else { return false; } } // from your man at http://www.kryogenix.org/ addEvent(window, "load", resizeBooks); addEvent(window, "resize", resizeBooks); function resizeBooks(e) { // check this browser can cope with what we want to do if (!document.getElementById) return; var bd = document.getElementById('rec-books-lists'); if (!bd) return; var ad = document.getElementById('rec-authors-lists'); if (!ad) return; var lf = document.getElementById('left'); if (!lf) return; if (!lf.offsetWidth) return; cnbd = bd.childNodes; cnad = ad.childNodes; // if div#left is wide enough to accept two or more floated
s if (lf.offsetWidth >= 621) { // loop through all the dls in div#rec-books-lists and resize them to 150px for (var i=0;is else { // loop through all the dls in div#rec-books-lists and resize them to the-width-of-div#left-minus-150px for (var i=0;i