// show the popup window
function showPopupWindow( fn_before, fn_after, evt ) {
	if ( fn_before && fn_before.constructor == Function )
		fn_before();
	
	$(".popup-window .tl").width( $(".popup-window").width() + "px" ) /* IE7 fix */
	$(".popup-window .bl").width( $(".popup-window").width() + "px" ) /* IE7 fix */
	if ( evt ) {
		$('.popup-window')
			.css("top", (evt.pageY - 50) + "px" )
			.css("left", (evt.pageX - 50) + "px" );
	}
	$('.popup-window').removeClass('hidden');
	$('.popup-window').draggable({handle: 'div.pw_header'});
	
	if ( fn_after && fn_after.constructor == Function )
		fn_after();
}

// hide the popup window
function hidePopupWindow() {
	$('.popup-window').addClass('hidden');
}

$(document).ready( function() {	
	// implement the action for the close button
	//$(".popup-window .pw_header .close-btn")
	$(".close-btn")
		.live( "click", function() {
			hidePopupWindow()
		})
	
})
