$(document).ready(function() {

	zoomImg();
	screenshotPreview();
	
	$('.wijnbrief_img').click(function(){
		location.href = bhref+'wijnbrief/pagina'+nxt+'.html';		
	});
});

function zoomImg(){
	$('#cat_holder .jqzoom').jqzoom({showPreload:false,title:false});
}

function screenshotPreview (){	
	/* CONFIG */
	
	
		xOffset = 10;
		yOffset = 230;
		
		// these 2 variable determine popup's distance from the cursor
		// you might want to adjust to get the right result
		
	/* END CONFIG */

	$("a.preview").hover(function(e){ 
		var par =  $(this).parent().attr('id');
		var pos = $(this).position();
		if (par=='rcol') {
			xOffset = -290;
			yOffset = 230;
		}
		this.t = this.title;
		this.title = "";	
		var c = (this.t != "") ? "<br/>" + this.t : "";
		if (this.t=='undefined') { this.t = ""; }
		$("body").append("<p id='screenshot'><img src='"+ this.rel +"' alt='image preview' title='"+ this.t +"' /><br />"+ this.t +"</p>");								 

			$("#screenshot")
			.css("top",(e.pageY - yOffset) + "px")
			.css("left",(e.pageX + xOffset) + "px")
			.slideDown();						  
    },
	function(){
		
		this.title = this.t;	
		$("#screenshot").slideUp().remove();
    });	
	$("a.preview").mousemove(function(e){ 
		var par =  $(this).parent().attr('id');
		var pos = $(this).position();
		//alert(pos.left);

		if (par=='rcol') { 
			xOffset = -200;
			yOffset = 270;
			$("#screenshot")
			.css("top",(e.pageY - yOffset) + "px")				
		  } else {
		$("#screenshot")
			.css("top",(e.pageY - yOffset) + "px")
			.css("left",(e.pageX + xOffset) + "px");
		  }
	});		
		
};