$(document).ready(function(){
					   
	$('.follow-twitter').css('cursor', 'pointer')
    .click(function() {
        window.location = $('a', this).attr('href');
    });
	
	$('.twitter .close').click(function() {
		$('.twitter').slideUp('slow', function() {
			$(this).remove();
		});
	});
	
	// Center tekst
	$("#footer-twitter p, .twitter li").center({
		horizontal: false // only vertical
	});
	
	// Hover effekt i sidebar
	$("#sidebar li").hover(function(){
		$(this).stop().animate({
			paddingLeft: "10px"
		}, 400);
	}, function() {
		$(this).stop().animate({
			paddingLeft: "0"
		}, 400);
	});
	
	/* CSS */
	
	$('.wp125 img:odd').css('margin-right', '0'); 	// Fjern margin-right på hver anden reklame
	$('#section .post:last, #sidebar .widget:last').css('border-bottom', 'none');
	$('div.single, div.portfolio-single').css('border-bottom', '1px dotted #c2c2c2');
	$('ul#menu li:nth-child(6)').css('background', 'none'); // Fjerner baggrunden på det 6. menu punkt
	$('.post a:has(img)').addClass('img'); // Fjerner border på link med et billede
	$('.guestbook li:odd, .download-item:odd').addClass('odd');
	
	
	// jCarousel
	jQuery('#mycarousel').jcarousel({
		wrap: 'last',
		animation: 'slow'
    });
	
	jQuery('#single-carousel').jcarousel({
		buttonNextHTML: null,
		buttonPrevHTML: null
    });
	
	// Fancybox 
	
	$("a.portfolio-img").fancybox({
		'imageScale':		false,
		'centerOnScroll': 	false
	});
	$("a.portfolio-img-small").fancybox();
	
	// Code box 
	
	$("pre").wrapInner("<code>");
	
	$("pre").hover(function() {
	var codeInnerWidth = $("code", this).width() + 10;
    if (codeInnerWidth > 580) {
		$(this)
			.stop(true, false)
			.css({
					zIndex: "5",
					position: "relative"
			})
			.animate({
				width: codeInnerWidth + "px"
			});
		}
	}, function() {
			$(this).stop(true, false).animate({
				width: 580
		});
	});
	
});