/*lava menu*/
$(function() { $("#menu").lavaLamp({ fx: "backout", speed: 700 })});


/*image hover swap*/

$(function() {
$("img.hoverswap")
.mouseover(function () {
$(this).attr("src", $(this).attr("src").replace(".jpg", "_over.jpg"));
})

.mouseout(function() {
$(this).attr("src", $(this).attr("src").replace("_over.jpg", ".jpg"));
});

});

/* protect */

$(document).ready(function(){
		$('a.protect').each(function(){
			e = this.rel.replace('/','@');
			this.href = 'mailto:' + e;
			$(this).text(e);
		});
	});
	
	
/*vertical menu*/

$(document).ready(function () {

		//Set the height of the block
		$('#menu2 .block').height($('#menu2 li').height());

		//go to the default selected item
		topval = $('#menu2 .selected').position()['top'];
		$('#menu2 .block').stop().animate({top: topval}, {easing: '', duration:400});

		$('#menu2 li').hover(
			
			function() {
				
				//get the top position
				topval = $(this).position()['top'];
				
				//animate the block
				//you can add easing to it
				$('#menu2 .block').stop().animate({top: topval}, {easing: '', duration:400});
				
				//add the hover effect to menu item
				$(this).addClass('hover');	
			},
			
			function() {		
				//remove the hover effect
				$(this).removeClass('hover');
        topval = $('#menu2 .selected').position()['top'];	
				$('#menu2 .block').stop().animate({top: topval}, {easing: '', duration:300});
			}
		);
	
	});
	
	
	/* Mouse zoom*/
 $(document).ready(function () {
 $('img.thumb').mouseover(function(){
		
		$('body').prepend('<img src="http://heviz.farkasnet.hu/images/zoom.png" width="31" height="31" style="position: absolute; z-index:1;" id="magnify" />');
	
		var p = $(this);
	
		var position = p.position();
		var imgheight = p.height();
		var imgwidth = p.width();
		
		$('#magnify').css({'top' : position.top-15+imgheight/2, 'left' : position.left-15+imgwidth/2});
		

		$('#magnify').hide();
		$('#magnify').fadeIn();
	});
		
	$('img.thumb').mouseout(function(){
	
		$('#magnify').fadeOut();
	
	});
 	});


