$(document).ready(function() {
	$.fn.fadeLi = function(time, type) {
		$(this).animate({opacity: 'toggle'}, "slow");
	}
	$("address").prepend('<div id="wallis"><img src="http://www.kiitos.nl/gfx/wallis_cross.gif" alt="drag me"></div>');
	$('#about').draggable({axis: 'x', handle: '#wallis', containment: "parent", scroll: false});
	$("#portfolio li h3 a").click(function() {
		if ($(this).hasClass('active')) {
			var port = $(this).parent().parent().children(".portfolio");
			$(this).parent().parent().find("ul.photos").animate({marginLeft: 56, width: 0}, "fast", function() {
				port.slideUp("fast");
			});
		} else {
			$(this).parent().parent().children(".portfolio").slideDown(800, function() {
				$(this).find("ul.photos").animate({marginLeft: 0, width: 53}, "slow");
			});
			$.scrollTo($(this), 800, {offset:-50});
		}
		$(this).toggleClass("active");
		return false;
	});
	$('a[rel=lightbox]').click(function () {
		$('ul.photos li a').removeClass('active');
		$(this).addClass('active');
		$(this).parent().parent().parent().children('.portfolio_container').attr('src',$(this).attr('href'));
		// $('h3.photo_title').html($(this).attr('title'));
		return false;
	});
	// $("ul#nieuws li:gt(0)").hide();
	$("#nieuws").easySlider({
			auto: true,
			continuous: true,
			controlsShow: false,
			pause: 4000
		});
	$("#wallis").delay(2000).animate({marginRight: 0, width: 52});
});