function make_popup(url, width, height, overflow){
	  if (width > 1024) { width = 1024; }
	  if (height > 768) { height = 768; }
	
	  if (overflow == '' || !/^(scroll|resize|both)$/.test(overflow))
	  {
		overflow = 'both';
	  }
	
	  var links = (screen.width - width)/2;
	  var boven = (screen.height - height)/2;
	
	  var win = window.open(url, '',
		  'width=' + width + ',height=' + height + ', left=' + links + ', top=' + boven
		  + ',scrollbars=' + (/^(scroll|both)$/.test(overflow) ? 'yes' : 'no')
		  + ',resizable=' + (/^(resize|both)$/.test(overflow) ? 'yes' : 'no')
		  + ',status=yes,toolbar=no,menubar=no,location=no'
	  );
	
	  return win;
}

window.addEvent('domready', function(){
	if($chk($('intro_overlay'))){ 
		$('intro_overlay').setStyle('visibility', 'visible');
		resize_overlay();
		position_container();
		window.addEvent('resize', function(){resize_overlay(); position_container();});
	
		$('intro_top').getElement('a[class=close]').addEvent('click', function(){$('intro_overlay').fade('out')});	
	}		
});

function resize_overlay(){
	var scrollSize = $(window).getScrollSize().y;
	var scrollTop = $(window).getScroll().y;
	$('intro_overlay').setStyles({ 'height':scrollSize+scrollTop,'top':-scrollTop });
}

function position_container(){
	var top = $(window).getSize().y/2;
	$('intro_container').setStyles({'top':top});
}
	
