$(function() {
	/*
	uncomment for simple alert boxes
	$('a').each(function() {
		var h = $(this).attr('href');
		if (h.match(/\/documenten\/membersonly\/(.*)/i)) {
			$(this).click(function() {
				if (user_logged_in) {
					return true;
				}
				alert('Please log in to view this document');
				return false;
			});
		}
	});*/
	
	var urlParams = {};
	(function () {
		var e,
			a = /\+/g,  // Regex for replacing addition symbol with a space
			r = /([^&=]+)=?([^&]*)/g,
			d = function (s) { return decodeURIComponent(s.replace(a, " ")); },
			q = window.location.search.substring(1);

		while (e = r.exec(q))
		   urlParams[d(e[1])] = d(e[2]);
	})();
	if ("notauthorized" in urlParams) {
		var settings = {
			social_tools: '',
			theme: 'light_rounded',
			default_height: 200
		};
		$.prettyPhoto.open('#inlineNotAuthorized', '', '', settings);
	}
});
