function openPrint(site) {
	openWindow (site+'?print=true','print','width=650, height=500, scrollbars=yes',true);
}

function polecStrone(site) 
{
	var test = document.getElementById('recommend');
	if (test)
	{
		return;
	}
    var recommend = document.createElement('div');
    recommend.id = "recommend";
    recommend.className = "recommendWindow";
    
    var recommendContent = document.createElement('div');
    recommendContent.id = "recommendContent";
    recommend.appendChild(recommendContent);
    document.body.appendChild(recommend);
    if ($("#recommend")) {
    $("#recommend").hide();    
    $("#recommendContent").load('/polec.php?site='+site, {}, function () {$("#recommend").fadeIn("slow");});
    }
}

function submitRecommend()
{
	$("#recommend").fadeOut("slow", function () {
	$.post("/polec.php", {site: $('form #site').attr('value'), 
	                      send: 1,
	                      email_to: $('form #email_to').attr('value'),
	                      name: $('form #name').attr('value'),
	                      email_from: $('form #email_from').attr('value'),
	                      comment: $('form #comment').attr('value')
	                     }, function (data) {
		$("#recommendContent").html(data);
		$("#recommend").fadeIn("slow");
	});
  	//	$("#recommend").fadeOut("slow");
});
}

function polecStroneHide()
{	
	$("#recommend").fadeOut("slow");
	window.setTimeout("polecStroneHideCore()", 1000);
}

function polecStroneHideCore()
{
	var recommend = document.getElementById('recommend');
	document.body.removeChild(recommend);
}


function biuletyn() {
	openWindow ('/subscribe.php','biuletyn','width=530, height=320, scrollbars=no',true);
}

function newsletter() {
     noweOkno = window.open('http://www.pbkm.pl/newsletter/nletter.php','Newsletter',
'menubar=no, toolbar=no, location=no, scrollbars=no, resizable=no, status=no, width=300, height=300')
}

function openWindow(address,identifier,attributes,focusing)
{
	win=window.open(address,identifier,attributes);
	if (focusing) win.focus();
}

