// JavaScript Document

function initMenu() {
    $('#accordion .scroller').hide();
    $('#accordion a').click(
                function() {
                    var checkElement = $(this).next();
                    if ((checkElement.is('.scroller')) && (checkElement.is(':visible'))) {
                        return false;
                    }
                    if ((checkElement.is('.scroller')) && (!checkElement.is(':visible'))) {
                        $('.scroller:visible').slideUp('normal');
                        checkElement.slideDown('normal');
                        return false;
                    }
                }
            );
};

function initTableMenu() {
    $('.accordionTable:not(.accordionTable.activated)').next().hide();
    $('.accordionTable').click(
                function() {
                    var checkElement = $(this).next();
                    if ((checkElement.is('.scroller')) && (checkElement.is(':visible'))) {
                        return false;
                    }
                    if ((checkElement.is('.scroller')) && (!checkElement.is(':visible'))) {
                        $('.scroller:visible').slideUp('normal');
                        checkElement.slideDown('normal');
                        return false;
                    }	
                }
            ).css({"cursor":"pointer"});
};

$(document).ready(function() { initMenu(); initTableMenu();});

function trackConv() { 
        var google_conversion_id  = 1022340300; 
        var google_conversion_label  = "weJzCIa-uAIQzNm-5wM"; 
        image = new Image(1,1); 
        image.src = "http://www.googleadservices.com/pagead/conversion/"+google_conversion_id+"/?label="+google_conversion_label+"&script=0"; 
} 

$(document).ready(function() {
	$(".contentthumbs a").fancybox({
		'zoomSpeedIn':	300, 
		'zoomSpeedOut':	300, 
		'overlayShow':	true,
		'overlayColor': '#000000',
		'overlayOpacity': 0.8,
		'padding': 2
	});

	$(".fancybox").fancybox({
	    'zoomSpeedIn': 300,
	    'zoomSpeedOut': 300,
	    'overlayShow': true,
	    'overlayColor': '#000000',
	    'overlayOpacity': 0.8
	});
	
	$("a#headerReserveerBtn, a.packages").click(function(){
		trackConv();
		
		$.fancybox({
			'type' : 'iframe',
			'href' : $(this).attr('href'),
			'zoomSpeedIn':	300, 
			'zoomSpeedOut':	300, 
			'overlayShow':	true,
			'overlayColor': '#000000',
			'overlayOpacity': 0.8,
			'padding': 2,
			'width': 520,
			'height': 520,
		});		
		
		return false;
    });   

    $(".contentborderthumbs a.active").children('.thumbBorderMask').attr({ 'src': 'images/contentimgbordermask_groen.png' });
    	
	$(".contentborderthumbs a").hover(function(){
		$(this).children('.thumbBorderMask').attr({'src':'images/contentimgbordermask_groen.png'});
		
		if($(this).attr('class') != "thumbBorderLink active"){
			$('.contentborderthumbs a.active').children('.thumbBorderMask').attr({'src':'images/contentimgbordermask.png'});
		}		
	}, function(){
		$(this).children('.thumbBorderMask').attr({'src':'images/contentimgbordermask.png'});
		$('.contentborderthumbs a.active').children('.thumbBorderMask').attr({'src':'images/contentimgbordermask_groen.png'});
	});
	
	$(".gallerythumbs a").click(function(){											 
		var replaceTarget = $('#contentGalleryImageLarge img:not(.contentGalleryImageLargeMask)');
		$(replaceTarget).css({'display' : 'none'});
		
		$(replaceTarget).load(function () {
			$(replaceTarget).fadeIn();
		}).attr('src', $(this).attr('href'));
		
		return false;
	});
});
