function init_links(){ var items = $C('news-item', $('news-block')); if(!items) return; items.each( function(item){ //item.style.border = "solid 1px red"; var links = $T('A', item); var trigger, reciever; links.each( function(link){ if(link.className.indexOf('blue') != -1){ trigger = link; }else{ reciever = link; } } );// reciever.onmouseover = function(){ this.style.textDecoration = "underline"; } reciever.onmouseout = function(){ this.style.textDecoration = "none"; } trigger.onmouseover = reciever.onmouseover.bind(reciever); trigger.onmouseout = reciever.onmouseout.bind(reciever); } ); } var listItems; var menuRoot; function init_sec_menu(){ var menuRoot = $('secondary-menu'); if(!menuRoot) return; var height = setSecMenuHeight(menuRoot); menuRoot.style.height = height + "px"; listItems = $T('LI', menuRoot); listItems.each( function(listItem){ if($C('treeblock', listItem, 'div')){ listItem.dropdown = $C('treeblock', listItem, 'div')[0]; listItem.dropdown.style.height = height + "px"; listItem.onmouseover = function(){ if(this.className.indexOf('here') != -1) return; this.dropdown.style.visibility = "visible"; this.dropdown.style.zIndex = "2"; } listItem.onmouseout = function(){ if(this.className.indexOf('here') != -1) return; this.dropdown.style.visibility = "hidden"; this.dropdown.style.zIndex = "0"; } } } ); } function setSecMenuHeight(elem){ var blocks = $C('treeblock', elem, 'div'); var height = 0; blocks.each( function(block){ if(block.offsetHeight > height){ height = block.offsetHeight; } } ); return height; } function fix_tbl(classN){ var tables = $T('table'); tables.each(function(tbl){ if(tbl.className.indexOf(classN) != -1){ var trs = $T('TR', tbl); trs.each(function(tr){ var tds = $T('TD', tr); tds[tds.length - 1].style.borderRight = "none"; }); } }) } function init(){ //init_links(); init_sec_menu(); fix_tbl('tbl'); } window.onload = init;