var popupRestartAfterClose = false;

function closePopup(){
	$('#hideshow').fadeOut('fast', function(){
		if(popupRestartAfterClose)
			window.location.reload();
	});
	/*
	$.fancybox.close();
	*/
	return false;
}

function showPopup(content, title, reload){
	/*
	popupRestartAfterClose = reload;
	var ct = '<div class="popup_block" id="popup_block">'+
			'<div class="popup">';
			
	if(title)
		ct += '<div id="popupTitle"><h3>'+title+'</h3></div>';
	 
	ct += '	<div id="popupContent">'+content+' <br clear="all"<br clear="all"/></div></div></div>';
	
	$.fancybox({
		content : ct,
		autoScale : false,
		width : 920,
		height : 600,
		autoDimensions : false,
		onClosed : function(){
			if(popupRestartAfterClose)
				window.location.reload();
		},
		onComplete : function(){
			
			$('.buttons').button();
			$('.icons').button();
		}
	});
*/

	popupRestartAfterClose = reload;
	if(title != ''){
		$('#popupTitle').html("<h3>"+title+"</h3>");
		$('#popupTitle').show();
	}
	else
		$('#popupTitle').hide();
	$('#popupContent').html(content);
	$('#hideshow').fadeIn('fast');
	var windowWidth = $(window).width();
	var popupBlockWidth = $('#popup_block').width();
	var leftValue = (windowWidth - popupBlockWidth) / 2;
	leftValue += 252;
	//alert(popupBlockWidth);
    $("#popup_block").css('left', leftValue+'px');
    $('.buttons').button();
			$('.icons').button();
    
}
