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

function popUp(w) 
{
	var popID 		= w;
	var popWidth 	= 640;

	$('#' + popID).fadeIn().css({ 'width': Number( popWidth ) }).prepend('<a href="#" class="close"><img src="http://www.av-solutions.nl/images/close_pop.png" class="btn_close" title="Close Window" alt="Close" /></a>');

	var popMargTop = ($('#' + popID).height() + 80) / 2;
	var popMargLeft = ($('#' + popID).width() + 80) / 2;

	$('#' + popID).css({ 
		'margin-top' : -popMargTop,
		'margin-left' : -popMargLeft
	});

	$('body').append('<div id="fade"></div>'); //Add the fade layer to bottom of the body tag.
	$('#fade').css({'filter' : 'alpha(opacity=80)'}).fadeIn(); //Fade in the fade layer 

	//return false;
}


$('a.close, #fade').live('click', function() { //When clicking on the close or fade layer...
	$('.close').remove();
  	$('#fade , .bb-pan').fadeOut(); //fade them both out
	$('#fade').remove();
	//return false;
});
