function popupRedraw(){
	var wH = jQuery(window).height();
	var wW = jQuery(window).width();
	if( wW < 1000 ) wW = 1000;
	var scrollTop = jQuery(window).scrollTop();
	var bl = jQuery('.b-pp');
	var h = bl.height();
	var w = bl.width();
	var l = ( wW - w ) / 2;
	height_new = jQuery('.b-pp-round-top').height() + jQuery('.b-pp-round-bot').height() + 100;
	if( height_new >= jQuery(window).height() ){
		t = 0;
		//jQuery('.jScrollPaneContainer').css('height', jQuery(window).height() - 150)
		jQuery('.scroll-pane').css('height', jQuery(window).height() - jQuery('.b-pp-round-bot').height() - 100);
	} else {
		t = ( wH - height_new ) / 2;
		//jQuery('.jScrollPaneContainer').css('height', jQuery('.b-pp-round-top').height())
		jQuery('.scroll-pane').css('height', 'auto');
	}
	if( jQuery.browser.msie && jQuery.browser.version == '6.0'){
		t = t + scrollTop;
	}
	bl.css('top', t);
	bl.css('left', l);
	bl.addClass('b-pp-act');
}

jQuery(window).resize(function(){
	popupRedraw();
});
jQuery(window).scroll(function(){
	popupRedraw();
});

jQuery(function(){
	//jQuery('.scroll-pane').jScrollPane({scrollbarWidth:18, dragMaxHeight: 50})
	popupRedraw();
	jQuery('.b-pp .close').click(function(){
		jQuery(this).parents('.b-pp').add('.b-overlay').fadeOut();
		window.setTimeout(function(){
			document.location.href = '/';
		}, 500);
	});
});
