window.addEvent("domready",function(){
	$$('img.vesselThumb').each(function(item,index){
		var width = $(item).getSize().x;
		var height = $(item).getSize().y;
		var bheight = height -6;
		var bwidth = width -6;
		var oheight = height +6;
		var owidth = width +6;


		if (height){
			var href = $(item).getParent("a").href;
			var wrapper = new Element('div').wraps($(item)).addClass('ImageDiv').setStyles({width:owidth+'px',height:oheight+'px',position:'relative',top:'0',display:'block'});

			wrapper.addEvent('click', function(event){
				window.location = href;
			});
			var bevel = new Element('div').inject($(item), 'after').addClass('opBorder').setStyles({'width':bwidth+'px','height':bheight+'px',position:'absolute',top:'0',left:'0',borderLeft:'3px #fff solid',borderTop:'3px #ccc solid',borderRight:'3px #000 solid', borderBottom:'5px #333 solid'});
			bevel.addEvent('mouseover', function(event){
				this.setStyles({borderLeft:'3px #333 solid',borderTop:'3px #000 solid',borderRight:'3px #ccc solid', borderBottom:'5px #fff solid'});

			});
			bevel.addEvent('mouseout', function(event){
				this.setStyles({borderLeft:'3px #fff solid',borderTop:'3px #ccc solid',borderRight:'3px #000 solid', borderBottom:'5px #333 solid'});

			});
			var shadow = new Element('div').inject($(item), 'after').addClass('Shadow').setStyles({'width':width+'px','height':height+'px',position:'absolute',top:'6px',left:'1px'});
			$(item).setStyles({'z-index':'500'});
		}

	});	


  var links = $('SideMenu').getElements('a img');


	links.each(function(img,index){
		var src = img.getProperty('src');
		var extension = src.substring(src.lastIndexOf('.'),src.length)
		img.addEvent('mouseenter', function() { img.setProperty('src',src.replace(extension,'_mo' + extension)); });
		img.addEvent('mouseleave', function() { img.setProperty('src',src); });
	});	
});

