function topmenu2(theid, theli){
	var topmenu2 = $(theid);
	var topmenu2_style = topmenu2.style.display;
	if(topmenu2_style == 'none'){
		lastli(theid);
		var offset = theli.offsetTop;
		topmenu2.style.cssText = 'display: block; '+'top:'+(22 + offset)+'px;';
		theli.style.cssText = 'background:url(images/topmenu_hover.gif) repeat-x top left;';
			var thediv = $(theid).childElements()[0];
			var theinnerdiv = thediv.clientWidth;
			//var leftoffset = theli.offsetLeft;
			var newoff = theli.offsetLeft-19;
			//alert(newoff);
			if (theinnerdiv < (678 - newoff)){
				thediv.style.cssText = 'padding: 0px 0px 0px ' + (newoff) + 'px;';
			}
	} else if(topmenu2_style == 'block') {
		topmenu2.style.cssText = 'display: none;';
		theli.style.cssText = 'background:none';
	}
}

function lastli(whereid){
	var string = '#'+whereid+' li';
	var last = $$(string).last();
	last.setStyle({
		background: 'none'
	});
}



Event.observe(window, 'load', function(){
									   
	$$('#list_table tr').each(function(elm){
		elm.observe('mouseover', function(){
			if ((this.readAttribute('class') != 'nohand')&& (this.readAttribute('class'))) {
				$('lastOpened').getAttribute('class')
				if($('lastOpened').readAttribute('class')){
					$$('#list_img .'+$('lastOpened').readAttribute('class'))[0].setStyle({'display':'none'});
				}			
				$$('#list_img .'+elm.readAttribute('class'))[0].setStyle({'display':'block'});
				$('lastOpened').writeAttribute('class',this.readAttribute('class'));
			}
			if (this.readAttribute('class') != 'nohand') {
				this.setStyle({
					'color': '#5a5758',
					fontWeight:'bold',
					'cursor': 'pointer'
				});
			}
		})
		elm.observe('mouseout', function(){
			if (this.readAttribute('class') != 'nohand') {
				this.setStyle({
					'color': '#828283',
					fontWeight:'normal',
					'cursor': 'pointer'
				});
			}
		})
	})

})

