
function popup(clientName, pHeight) {
	$('#popup-info').children('div').css('display','none');
	if (!pHeight) pHeight = 306;
	$('#popup-info').css('height',pHeight).center();
	$('#popup-'+clientName).css('display','block');
	$('#blanket').fadeIn(300);
	$('#popup-info').fadeIn(300);
}

function closeWindow() {
	$('#blanket').fadeOut(300);
	$('#popup-info').fadeOut(300);
}

$(window).keyup(function(e){
	if (e.keyCode == 27) {
		closeWindow();
	}
});

jQuery.fn.center = function () {
	this.css('position', 'fixed').css('top', '50%').css('left', '50%').css('margin-top', this.height()/-2).css('margin-left', this.width()/-2);
	return this;
}
