/**
 * @author Wout Kramer - wout@28-6design.nl - www.28-6design.nl
 */
$(function(){$.pir.options.php="/pir.php";$("h2").pir({font:"ZEROHOUR.ttf"})});jQuery.fn.topLink=function(a){a=jQuery.extend({min:1,fadeSpeed:200},a);return this.each(function(){var b=$(this);b.hide();$(window).scroll(function(){$(window).scrollTop()>=a.min?b.fadeIn(a.fadeSpeed):b.fadeOut(a.fadeSpeed)})})};$(document).ready(function(){$("#top-link").topLink({min:400,fadeSpeed:500});$("#top-link").click(function(a){a.preventDefault();$.scrollTo(0,300)})}); $(function(){$(".more_updates").live("click",function(){var a=$(this).attr("id");if(a=parseInt(this.id.replace("nr",""))){$("#more"+a).html('<img src="img/laden.gif" height="10px" width="50px" alt="Even geduld.." />');$.ajax({type:"POST",url:"news-laden.php",data:"lastupd="+a,cache:false,success:function(b){$("ol#nieuwsarchief").append(b);$("#more"+a).remove();$("li.einde").delay(1E3).slideUp("slow")}})}else{$(".morebox").html("Alle nieuwsberichten zijn geladen.");$("li.last").delay(1E3).slideUp("slow")}return false})}); $(function(){$(".meer_fotos").live("click",function(){var a=$(this).attr("id");if(a=parseInt(this.id.replace("nr",""))){$("#more"+a).html('<img src="img/laden.gif" height="10px" width="50px" alt="Even geduld.." />');$.ajax({type:"POST",url:"albums-laden.php",data:"lastupd="+a,cache:false,success:function(b){$("ul#photos").append(b);$("#more"+a).delay(1E3).slideUp("slow",function(){$(this).remove()})}})}return false})});$(document).ready(function(){$("a.externe-link").attr("target","_blank")});$(document).ready(function(){$("a[rel=nofollow]").attr("target","_blank")});

function formatTitle(title, currentArray, currentIndex, currentOpts) {
    return '<div id="tip7-title"><span><a class="sluit-btn" href="javascript:;" onclick="$.fancybox.close();">Sluiten</a></span>' + (title && title.length ? '<b>' + title + '</b>' : '' ) + 'Afbeelding ' + (currentIndex + 1) + ' van ' + currentArray.length + '</div>';
}

$("#album #photos a").fancybox({
	'showCloseButton'	: false,
	'titlePosition' 	: 'inside',
	'titleFormat'		: formatTitle
});

$(document).ready(function() {
	$(".ytlink").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;
	});
});
