function preloadImages() 
{
	jQuery("<img>").attr("src", "./img/menu/menu_background1.png");
	jQuery("<img>").attr("src", "./img/menu/menu_background2.png");
	jQuery("<img>").attr("src", "./img/red_transparent.png");
	jQuery("<img>").attr("src", "./img/arrow_hover.png");
	jQuery("<img>").attr("src", "./img/arrow_hover_down.png");	
	jQuery("<img>").attr("src", "./img/ico/zmprzyst.png");
	jQuery("<img>").attr("src", "./img/ico/przesprzyst.png");
	jQuery("<img>").attr("src", "./img/ico/likwprzyst.png");
	jQuery("<img>").attr("src", "./img/ico/zmsta.png");
	jQuery("<img>").attr("src", "./img/ico/zmczas.png");
}

function resize() 
{
	var menuh = jQuery("#Menu").height();
	
	if (jQuery("#MainContent").length > 0)
	{
		var mainh = jQuery("#MainContent").height();
		var righth = jQuery("#RightBanners").height();
		maxh = Math.max(menuh, mainh, righth);
//		jQuery("#MainContent").height(maxh);
		if(righth > mainh || menuh > mainh)
			jQuery("#MainContent").height(maxh);
		
	}
	else if(jQuery("#TwoColContent").length > 0)
	{
		jQuery("#TwoColContent").css("height", "auto");
		var twoh = jQuery("#TwoColContent").height();
		maxh = Math.max(menuh, twoh);
		if(menuh > twoh)
			jQuery("#TwoColContent").height(maxh);
	}
	
	if (jQuery("#AktualnosciKomunikatyContent").length > 0)
	{
		if (jQuery("#MainNews").length > 0)
		{
			var imgh = jQuery("#MainNews img").height();
			var ah = jQuery("#MainNews a.opis").height();
			jQuery("#MainNews a.opis").css("top", imgh - ah  - 28);
		}

		var komh = jQuery("#KomunikatyPrasowe").height();
		var akth = jQuery("#Aktualnosci").height();

		if(komh > akth)
			jQuery("#Aktualnosci").height(maxh - jQuery("#OstatnieZmiany").outerHeight(true) - 6);
	}
}

function zegar()
{

	var curDate = new Date();
	var nowHour = curDate.getHours();
	var nowMinutes = curDate.getMinutes();
	
	var gpos = "0px -" + parseInt(nowHour) * 53 + "px";
	var mpos = "0px -" + parseInt(nowMinutes) * 53 + "px";
	
	jQuery("#ZegarGodzina").css("backgroundPosition", gpos);
	jQuery("#ZegarMinuta").css("backgroundPosition", mpos);

	setTimeout("zegar()", 1000);
}

function printWebPart(tagid)
{
    if (tagid) 
	{
        var html = "<html>\n<head>\n"+
            jQuery("head").html()+
            "\n</head>\n<body style=\"text-align: left\">\n"+
            jQuery("#"+tagid).html()+
            "\n</body>\n</HTML>";

        var printWP = window.open("","printWebPart");
        printWP.document.open();

        printWP.document.write(html);
        printWP.document.close();

        printWP.print();
    }
}