function printPage (elementId)
{
    if (document.getElementById('contentBody')) 
    {
    	var contentBody = document.getElementById('contentBody').innerHTML;	
    }
    if (document.getElementById('contentHeader')) {
    	var contentHeader = document.getElementById('contentHeader').innerHTML;	
    }
    if (document.getElementById('contentTitle') ) {
    	var contentTitle = document.getElementById('contentTitle').innerHTML;	
    }
    if (document.getElementById('contentAuthor') ) {
    	var contentAuthor = document.getElementById('contentAuthor').innerHTML;	
    }
    if (document.getElementById('comments') ) {
    	var comments = document.getElementById('comments').innerHTML;	
    }
    var myWindow = window.open('','','width=500,height=600,scrollbars=1');
	myWindow.print();
	myWindow.document.write("<html>")
	myWindow.document.write("<head>")
	myWindow.document.write("<title>"+location.host+"</title>");
	myWindow.document.write("<link rel=\"stylesheet\" type=\"text/css\" href=\"var/css/style_print.css\">");
	myWindow.document.write("</head>")
	myWindow.document.write("<body>")
	myWindow.document.write("<div style=\"font-size: 11px; font-family: tahoma;\">");
	myWindow.document.write("Strona z serwisu " + location.host);
	myWindow.document.write("<hr style=\"height: 1px; color: silver;\">");
	myWindow.document.write("<br>");
	myWindow.document.write("<br>");
	if (contentTitle) {
	   myWindow.document.write("<h4>"+contentTitle+"</h4>");
	}
	if (contentBody) {
	   myWindow.document.write(contentBody);
	}
	if (contentAuthor) {
	   myWindow.document.write("<br><br><div align=\"right\">"+contentAuthor+"</div>");	    
	}
	myWindow.document.write("</div>")
	myWindow.document.write("</body>")
	myWindow.document.write("</html>")
}
function sendPage (elementId) {
    var myWindow = window.open('inc/popup.recommend.php?pId='+elementId,'','width=410,height=300,top=100,left=100,scrollbars=1');
}
function DisplayWindow(url, nazwa) 
{
	var Win = window.open('inc/'+url, nazwa, 'menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,fullscreen=no,channelmode=no,width=500,height=565');
	Win.focus();
}
function zoom(pId) {
    DisplayWindow('zoom.php?pId='+pId,'Zoom');
}
function closeAlert()
{
   var alertWindow = document.getElementById('alertWindow');
   alertWindow.style.display='none';
}
function setCentered(element,width)
{
    if (width=='')
    {
        width = 0;
    }
    if (parseInt(navigator.appVersion)>3) 
    {
       if (navigator.appName=="Netscape") 
       {
           winW = window.innerWidth;
    	   winH = window.innerHeight;
       }
       if (navigator.appName.indexOf("Microsoft")!=-1) 
       {
           winW = document.body.offsetWidth;
           winH = document.body.offsetHeight;
       }
    }
    positionLeft = (winW-width)/2;
    document.getElementById(element).style.left=positionLeft;
}
function confirmAccountDelete()
{
    if(confirm('Czy napewno usu±æ Twoje konto?'))
    {
        document.location='customer.php?action=deleteAccountConfirmed';
        return false;
    }
    else
    {
        document.location='customer.php';
        return true;
    }
}
