$(function() {
	$('#demo a').popUp({width:1000,height:610})
	.click(function() {
		$('#content').html("<h2>Bedankt</h2>\n\n<p>Bedankt voor je belangstelling voor Mijn Route.nu</p>\n\n<p>Wil je reageren op deze website? Neem contact met ons op of stuur een e-mail naar <a href=\"mailto:maaike@argumentenfabriek.nl\">maaike@argumentenfabriek.nl</a>.</p>\n");
		$('#menu').removeClass();
	});
});

jQuery.fn.popUp = function(settings) {
	return this.each(function() {
		$(this).click(function() {
    		settings = jQuery.extend({
				name: 'popup',
				width: 600,
				height: 400,
				scrollbars: 0,
				resizable: 0,
				toolbar: 0,
				location: 0,
				statusbar: 0,
				menubar: 0	
			}, settings);

			var url = this.href;
			var left = (screen.availWidth - settings.width)/2;
			var top = (screen.availHeight - settings.height)/2;

			var props = 'width='+settings.width+',height='+settings.height+',left='+left+',top='+top+'toolbar='+settings.toolbar+',scrollbars='+settings.scrollbars+',location='+settings.location+',statusbar='+settings.statusbar+',menubar='+settings.menubar+',resizable='+settings.resizable+',directories=0';


			if (url) {
				window.open(url, settings.name, props).focus();
			} else {
				alert(url);
			}

			return false;
		});
	});
};