$(document).ready(function(){
	$("a[@href$=pdf]").addClass("pdf").attr({ target: "_blank" });

	$("a[@href$=zip]").addClass("zip").attr({ target: "_blank" });

	$("a[@href$=psd]").addClass("psd").attr({ target: "_blank" });
	
	$("a[@href^='http']").attr('target','_blank')
		.addClass("external")
		.attr({ target: "_blank" });
	
	if ($("#extra_1").is(":checked")){
        $('.aflever').removeClass("hidden");
    }
			
	$('#extra_1').click(function(){
        if ($("#extra_1").is(":checked")){
            $('.aflever').slideDown("slow").removeClass("hidden");
        } else {
            $('.aflever').slideUp("slow").addClass("hidden");
        }
	});
	
	$("input[@name='zoekterm']").focus(function(){
	    $(this).val('');
	});
	
	$("#mailing input[@name='name']").focus(function(){
	    $(this).val('');
	});
	
	$("#mailing input[@name='email']").focus(function(){
	    $(this).val('');
	});
		
	$('#betaalmethode li').click(function(event){
        event.preventDefault();
        var payment = $(this).children(':eq(2)').attr("href");
        
        $.post("/bestellen/betaal/", { payment: payment },
          function(data){
            top.location.href=data;
          });
         
	});
	
	$("#usp li").wrapInner("<div></div>");
	$("#overzicht img").wrap("<div></div>");


$('a.collapse').click(function() {
    $('#collapse').slideToggle(400);
	$(this).toggleClass("min");
    return false;
});


			$("#overzicht li:eq(3)").addClass("last");
			$("#overzicht li:eq(7)").addClass("last");
			$("#overzicht li:eq(11)").addClass("last");
			$("#overzicht li:eq(15)").addClass("last");
			$("a[rel^='prettyPhoto']").prettyPhoto(
			{
				animationSpeed: 'slow', /* fast/slow/normal */
				padding: 50, /* padding for each side of the picture */
				opacity: 0.35, /* Value betwee 0 and 1 */
				showTitle: false, /* true/false */
				allowresize: false, /* true/false */
				counter_separator_label: 'of', /* The separator for the gallery counter 1 "of" 2 */
				theme: 'light_square', /* light_rounded / dark_rounded / light_square / dark_square */
				callback: function(){}
			}
			);
			$("li:last-child, fieldset:last-child, fieldset div:last-child").addClass("last");
			$("li:first-child").addClass("first");

	$("#overzicht li").click(function(){
	  window.location=$(this).find("a").attr("href"); return false;
	});


});
