Cufon.replace('h1')('h2');

$(function(){

    $('.trlink').click(function(){
        window.location = $(this).find('a').attr('href');
    });

    //Border laatste li verwijderen
    $("#MenuBar1 li:last").css('border','0');

    $("#MenuBar1 li ul").hide();
    $("#MenuBar1 li:has(a.active)").each(function(){
        $(this).children().show();
    });

    $("a.single_image, a img.fancybox, a.fancybox").fancybox({
        'titleShow'     : false
    });

    // ----- CYCLE -----
    $(".cycle").cycle({fx: 'fade'});

    $('#searchResult').cycle({
        fx: "scrollVert",
        timeout: 0,
        startingSlide:   0,
        pager:  '.pager',
        pagerAnchorBuilder: function(idx, slide) {
            return '<a href="#"> &bull; </a>';
        },
        after: function(slide,next){
            $("#searchResult").animate({
                height: $(next).height() + 25
            }, 1000);
        }
    }, 500);

    $(".floorplanner").fancybox({
        'width' : '90%',
        'height' : '90%',
        'autoScale' : false,
        'transitionIn' : 'none',
        'transitionOut' : 'none',
        'type' : 'iframe'
    });
	$("#koopwoningen").fancybox({
        'width' : 800,
        'height' : 400,
        'type' : 'swf'
    });

    $('#huurwoningen').hover(function(){
        $('#situatie_0').attr('src', 'uploadfiles/image/situatie_1.jpg');
    }, function(){
        $('#situatie_0').attr('src', 'uploadfiles/image/situatie_0.jpg');
    });

    $('#koopwoningen').hover(function(){
        $('#situatie_0').attr('src', 'uploadfiles/image/situatie_2.jpg');
    }, function(){
        $('#situatie_0').attr('src', 'uploadfiles/image/situatie_0.jpg');
    });
	
	//SWAP DIV
	if ($("#kenmerkenB").html()) {
		var A = $("#kenmerkenA").html();
		var B = $("#kenmerkenB").html();
		
		$("#kenmerkenB").html(A);
		$("#kenmerkenA").html(B);
	}
})

