Shadowbox.init({
	players:["img","html","iframe"],
	skipSetup: true
});

$(document).ready(function() 
{
	init();
	cmsFunctions();
});

function createEmailBySplit(splitString)
{
	var eParts 		= base64_decode(splitString).split('|');
	return eParts[0] + '@' + eParts[1] + '.' + eParts[2];
}

function cmsFunctions()
{		
	/* emailadressen beschermen */
	$('#footer li:first').addClass('first');
	$('span.eprotecttext').each( function(i)
	{
		$(this).text( createEmailBySplit( $(this).attr('alt') ) );
		$(this).attr('alt', '');
	});	
	
	$('#navigation > li').hover( function () {
		$(this).addClass('hover');
	}, function () {
		$(this).removeClass('hover');
	} );
	
	$('span.eprotectlink').each( function(i)
	{
		var mailtoLink	= '<a href="mailto:' + createEmailBySplit( $(this).attr('alt') ) + '">' + $(this).text() + '</a>';
		$(this).html(mailtoLink);
		$(this).attr('alt', '');
		$(this).attr('title', '');
	});	
	
	/* links en buttons */
	$('input[type=submit]').addClass('button');	
	$('a[rel~="external"]').each (function(i)
	{
		$(this).attr('target', '_blank');
		$(this).addClass('external');
	});
}

function init()
{	
	Shadowbox.setup("a[rel*='shadowbox']", {
		language: 'nl',
		enableKeys: false,
		players:  ['img', 'html', 'iframe', 'swf', 'flv'],
		autoplayMovies: false,
		continuous: true,
		counterLimit: 0,
		counterType: 'skip',
		handleOversize: 'drag'
	});
    Shadowbox.setup("a[rel*='shadowboxgal']", {
        gallery: 'gallery',
		counterLimit: 0,
		counterType: 'default',
		handleOversize: 'resize',
		continuous: true
    });
};
