$(function() {
	$("a#inline").fancybox(
			{ 'hideOnContentClick': false, 'frameWidth': 500,  'frameHeight': 300 }
	);
	
	// Slideshow in header
	$('#slideshow').cycle({ 
        fx:      'fade', 
        speed:    2000, 
        timeout:  5000,
        pause: true     
    });
	
	// Te koop overview: fade in and out on hover
	$('table.tekoop .item').fadeTo(50, 0.7, function(){});
	$('table.tekoop .item').hover(
			function(){$(this).fadeTo(200, 1.0, function(){})}, 
			function(){$(this).fadeTo(50, 0.7, function(){})}
	);
	
	// Te koop detail: cycle through images for a detail page of an item
	$('.images').cycle({ 
        fx:      'fade',
        fit:      0,
        containerResize: 0,
        height:   510,
        speed:    1000, 
        timeout:  0,
        pager:    '#thumbs_pager ul',         
        pagerAnchorBuilder: function(idx, slide) {
			return '<li class="thumb"><a><img src="' + slide.alt + '" width="100px" height="70px"/></a></li>';
        }    
    });
	
	// Te koop detail: thumbnail carrousel
	$("#thumbs_pager").jCarouselLite({
        btnNext: ".next",
        btnPrev: ".prev",
        vertical: true,
        circular: false,
        speed: 500,
        afterEnd: function(a) {
			$('#thumb_pager ul').css('margin-top: -5px');
    	}

    });
});
 
function link(url) {
	window.location = url;
}
