	function resizeBloki(){
		var h=200;
		if (ie4){
			h=window.frames["bloki"].document.body.scrollHeight;
			document.all['bloki'].height = h+15;
			//alert(window.frames["bloki"].document.body.scrollWidth);
			//document.all['bloki'].style.scrolling=true;
		}
		else if (ie6nn6){
			//h=document.getElementById('bloki').document.body.scrollHeight;
			h=document.getElementById('bloki').scrollHeight;
			document.getElementById('bloki').height=h+15;
		}
	}

	function insideLoad(plik, stan, opis)
	{
		var x = (screen.width-800)/2;
		var y = (screen.height-480)/2;
		var okno = window.open("","","left="+x+", top="+y+", width=800, height=480, scrollbars=no, toolbar=no,resizable=yes, status=no,directories=no,menubar=no,fullscreen=no,channelmode=no,location=no");
		var tresc= "<html><body style='padding:0px;margin:0px;overflow:hidden;'><iframe id='popIF' frameborder='0'  width='100%' height='100%' style='width:100%;height:100%;border:0px;' src='"+plik+"'></iframe></body></html>";
		//var tresc= "<HTML><BODY style='padding:0px;margin:0px;overflow:hidden;'><iframe id='popIF' frameborder='0'  width='100%' height='100%' style='width:100%;height:100%;border:0px;' src='about:blank'></iframe></BODY></HTML>";
		okno.document.write(tresc);
		//okno.document.getElementById("popIF").contentWindow.location.href=plik;
		return false;	
	}
	function insideLoad2(plik, stan, opis){
		var scrollX=0;
		var scrollY=0;
		

		if (stan>0){
			document.getElementById("bloki").contentWindow.location.href=plik;

			if (opis)
				document.getElementById("tdEdycjaBlokiHeader").innerHTML=opis;
			document.getElementById("tdEdycjaTresci").style.display="none";
			document.getElementById("tdEdycjaBloki").style.display="block";
			document.getElementById("tdEdycjaBloki").style.visibility="visible";

			if (window.scrollX)
				scrollX=window.scrollX;//FF
			else
				scrollX=document.body.scrollLeft;//IE, Opera
		
			if (window.scrollY)
				scrollY=window.scrollY;
			else
				scrollY=parseInt(document.body.scrollTop);

			//Odleg�o?� od lewej kraw�dzi
			document.getElementById("divFilter").style.left=(scrollX+((document.body.clientWidth)/2)-(640/2)-5)+"px";
			//Odleg�o?� od g�ry
			document.getElementById("divFilter").style.top=(scrollY+((document.body.clientHeight)/2)-(480/2)-15)+"px";

			document.getElementById("iframeFilter").style.width=document.body.clientWidth+"px";
			document.getElementById("iframeFilter").style.height=document.body.scrollHeight+"px";
			document.getElementById("iframeFilter").style.background="#FFFFFF";

			if (ie6nn6 && !ie4)//Tylko FF
				document.getElementById("bloki").style.height=480;
		}
		else{
			document.getElementById("tdEdycjaBloki").style.visibility="hidden";
			//document.getElementById("tdEdycjaBloki").style.display="none";
			document.getElementById("tdEdycjaBlokiHeader").innerHTML="&nbsp;";
			document.getElementById("tdEdycjaTresci").style.display="block";
			document.getElementById("bloki").contentWindow.location.href="about:blank";
		}
	}

	function goToPage(pageID, submitForm){
		pageID = parseInt(pageID);
		currentID = parseInt(document.getElementById("ak_z_m").elements["strNavi"].value);
		if (!pageID){
			//pageID=currentID;
		}
		if (!pageID || document.getElementById("ak_z_m").elements["data_od"].value.length>0 || document.getElementById("ak_z_m").elements["data_do"].value.length>0){
			document.getElementById("ak_z_m").elements["strona"].value=currentID+pageID-1;
			//alert(document.getElementById("ak_z_m").elements["strona"].value);
			if (submitForm==1)
				document.getElementById("ak_z_m").submit();
			/*
			ak_z_m.strona.value=currentID+pageID-1;
			if (submitForm==1)
				ak_z_m.submit();
			*/
			return false;
		}
		else
			return true;
	}

	function correctPNGbackground()
	{
		var arVersion = navigator.appVersion.split("MSIE")
		var version = parseFloat(arVersion[1])
		
		if ((version >= 5.5) && (document.body.filters)) 
		{
		   for(var i=0; i<document.images.length; i++)
		   {
		      var img = document.images[i]
		      var imgName = img.src.toUpperCase()
		      if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
		      {
		         var imgID = (img.id) ? "id='" + img.id + "' " : ""
		         var imgClass = (img.className) ? "class='" + img.className + "' " : ""
		         var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
		         var imgStyle = "display:inline-block;" + img.style.cssText 
		         if (img.align == "left") imgStyle = "float:left;" + imgStyle
		         if (img.align == "right") imgStyle = "float:right;" + imgStyle
		         if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
		         var strNewHTML = "<span " + imgID + imgClass + imgTitle
		         + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
		         + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
		         + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
		         img.outerHTML = strNewHTML
		         i = i-1
		      }
		   }
		}
	}
	function slideIn() {
		jQuery("#menu_slide").animate({ right: (document.body.clientWidth/2)-340, opacity: 'show'}, "slow", function(){});
	}
	
	function slideOut() { 
		jQuery("#menu_slide").animate({ right: 0, opacity: 'hide'}, "slow", function(){});
	}
	
	jQuery(document).ready(function() {
		correctPNGbackground();
		jQuery("#menu_pokaz").toggle(
			function(){
				slideIn();
			},
			function(){
				slideOut();
			}
		);
				
	});	

