function init_catalog_hover(){ if(!$('glass-description')){ return; } var items = $C('description-item', $('glass-description')); items.each( function(item){ if(!$C('text', item)){ throw $continue; } item.dropdown = $C('text', item)[0]; item.onmouseover = function(){ this.dropdown.style.display = "block"; } item.onmouseout = function(){ this.dropdown.style.display = "none"; } } ); } function init_collection(){ var root = $('collection'); if(!root){ return false; } var items = $C('item', root, 'DIV'); items.each(function(item){ item.img_div = $C('img', item, 'DIV', 1); item.img = $T('IMG', item.img_div, 1); item.hover = $C('hover', item, 'DIV', 1); item.img.onmouseover = function(e){ this.hover.show(1); }.bind(item); item.img.onmouseout = item.hover.onmouseout = function(e){ var ev = window.event || e; var relTarget = ev.relatedTarget || ev.toElement; if(relTarget == this.hover || relTarget == this.img || _isChild(relTarget, this.hover)){ return true; } this.hover.hide(1); }.bind(item); }); } window.onload = function(){ init_catalog_hover(); init_collection(); }