$(document).ready(function(){	
	$("#bandContainer").easySlider({
		auto		: true,
		continuous	: true,
		playpause	: true,
		controlShow	: false,
		speed		: 2500,
		pause		: 8000
	});
	$(".colorbox").each(function(){
		var Width			= 800;
		var Height			= 500;
		var contactWidth	= 500;
		var contactHeight	= 600;
		
		if($(this).hasClass("contact")){
			Width	= ContactWidth;
			height	= contactHeight;
		}
		if($(this).attr("Width")){
			Width = $(this).attr("Width");
		}
		if($(this).attr("Height")){
			Height = $(this).attr("Height");
		}
		
		var overlayClose= true;
		if($(this).attr("overlayClose")){
			overlayClose = false;
		}
		var href= $(this).attr("href");
		var sep = "&";
		if(href.indexOf("?") == -1){
			sep = "?";
		}

		if($(this).hasClass("ajax")){
			href = href + sep + "ajax";
			$(this).attr("href",href);
			$(this).colorbox({close:'Sluiten', width:Width,height:Height,overlayClose: overlayClose});
		}else if($(this).hasClass("iframe")){
			href = href + sep + "ajax";
			$(this).attr("href",href);
			$(this).colorbox({close:'Sluiten',iframe: true, width:Width,height:Height, overlayClose: overlayClose});
		}else{
			$(this).colorbox({close:'Sluiten'});
		}
	});
	
	$("form.ajax").livequery(bindForm);
	$("#portfolio_images").livequery(function(){
		setTimeout(portfolioSlider, 1000)
		});;
	$("ul.contactgegevens li:last").livequery(function(){
		$(this).css("backgroundImage","none");
	});
});

var bindForm = function(){
	$(this).ajaxForm({target: '#cboxLoadedContent'});
}

var portfolioSlider = function(){
	$("#portfolio_images").easySlider({
		auto: false,
		numeric: true
	});
}
