$(function() {
    $activeclasscolor = $("#menu a.active").attr('class').substring(7);
    $("#menuborder").addClass($activeclasscolor);
    $("#wrapper").addClass('wrapper-'+$activeclasscolor);
    $("#logo").addClass($activeclasscolor+'2');

    $(".userMenu input").first().remove();
    $(".loginform a,.loginform h1,.userMenu label").remove();
    
    $gbooklink = $(".submen li a[title='Gastenboek']");
    $gbooklink.attr('href','guestbook.html');
    
    var cnt = 0;
    $(".photobook-pages li a img").each(function(){
        $(".photobook-pages li").addClass($activeclasscolor);
        cnt++;
        $img = $(this);
        $src = $img.attr("src");
        if(cnt === 5){
            $img.replaceWith('<span class="pics last" style="background:url(\''+$src+'\') center no-repeat">&nbsp;</span>');
            cnt = 0;
            
        }else{
            $img.replaceWith('<span class="pics" style="background:url(\''+$src+'\') center no-repeat">&nbsp;</span>');
        }
        //$(".photobook-images li a").attr('rel','prettyPhoto[gallery]');
    });
    
    var cnt2 = 0;
    $("#photobook-details li a img").each(function(){
        $("#photobook-details li").addClass($activeclasscolor);
        cnt2++;
        $img = $(this);
        $src = $img.attr("src");
        if(cnt === 5){
            $img.replaceWith('<span class="pics last" style="background:url(\''+$src+'\') center no-repeat">&nbsp;</span>');
            cnt2 = 0;
            
        }else{
            $img.replaceWith('<span class="pics" style="background:url(\''+$src+'\') center no-repeat">&nbsp;</span>');
        }
       // $(".photobook-images li a").attr('rel','prettyPhoto[gallery]');
    });
    
    $(".photobook-pages li a .title,#photobook-details li a .title, #video-list .title").remove();
    $(".photobook-images a").attr(
        "rel","pic"
    );
        
    $(".photobook-images a img").attr(
        "rel","pic"
    );
        
    $(".photobook-images a").fancybox(); 

    $("#book-controls a").attr('href','foto-en-video.html');
    $(".login #video-list div a").attr('href','foto-en-video.html');
    
    $(".youtubeok #video-list a").addClass('youtube');
    
    $(".youtube").click(function() {

		$.fancybox({
				'padding'		: 	0,
				'autoScale'		:	false,
				'transitionIn'	: 	'none',
				'transitionOut'	: 	'none',
				'title'			:	this.title,
				'width'			: 	680,
				'height'		: 	495,
				'href'			: 	this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
				'type'			: 	'swf',
				'swf'			: 	{
						'wmode'			: 	'transparent',
						'allowfullscreen'	: 'true'					
				}
			});

		return false;
	});
}); 


