<!-- //

function BullStatistic()
{
	var colorDepth = window.screen.colorDepth;
	var res = window.screen.width + "," + window.screen.height;
	var referer = escape(document.referrer);
	document.write('<img src="/stats/zlicz.php?colors=' + colorDepth + '&resolution=' + res + '&referer=' + referer + '" style="width:0;height:0;" />');
}

function SendForm()
{
	jQuery("#send").val("109357339");
	jQuery("#formular").submit();
}

function ShowTab(id,lang)
{
	for(var i = 1; i < 4; i++)
	{
		if(id == i)
		{
			jQuery('#tab'+i).css('display','block');
			jQuery('#tab'+i+'b').attr('src','/img/'+lang+'/tabs/'+i+'on.gif');
			//jQuery('#tab'+i+'b').src = '/img/tabs/'+lang+'/'+i+'on.gif';
		}
		else
		{
			jQuery('#tab'+i).css('display','none');
			//jQuery('#tab'+i+'b').src = '/img/tabs/'+lang+'/'+i+'off.gif';
			jQuery('#tab'+i+'b').attr('src','/img/'+lang+'/tabs/'+i+'off.gif');
		}
	}
}

function Print(content,lang)
{
	var okno = null;
	ScrWidth = 640;
	 width = 700;
	ScrHeight = 480;
	height = 480;
	if(window.screen)
	{
		ScrWidth = window.screen.width;
		ScrHeight = window.screen.height;
	}
	if(okno != null && !document.layers)
	{
		okno.close();
	}
	PosX = Math.round((ScrWidth - width) / 2);
	PosY = Math.round((ScrHeight - height) / 2);
	okno = window.open("/print.php?content="+content+"&lang="+lang, "aktualnosci", "menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=no,copyhistory=no,width=" + width + ",height=" + height + ",left=" + PosX + ",top=" + PosY);
	okno.focus();
}		

function PowiekszZdjecie(url, width, height, info, tytul)
{
	var okno = null;
	if(okno) okno.close();
	ScrWidth = 640;
	ScrHeight = 480;
	if(window.screen)
  	{
   	ScrWidth = window.screen.width;
		ScrHeight = window.screen.height;
  	}
  	PosX = Math.round((ScrWidth - width) / 2);
  	PosY = Math.round((ScrHeight - height) / 2);
  	width = width;
  	height = height;
  	okno = window.open("", "zdjecie", "menubar=no,toolbar=no,location=no,directories=no,status=yes,scrollbars=no,resizable=no,copyhistory=no,width=" + width + ",height=" + height + ",left=" + PosX + ",top=" + PosY);
  	okno.document.clear();
	okno.document.write("<html><head><title>" + tytul + "</title><meta http-equiv='content-type' content='text/html; charset=ISO-8859-2'></head><style type=\"text/css\">body { margin:0; padding:0; }</style><body><div align=\"center\"><img src=\""+ url +"\" alt=\"" + info + "\" title=\"" + info + "\" border=\"0\" onclick=\"window.close();\" /></div></body></html>");
	okno.document.close();
  	okno.focus();
}

function ShowPictures(typ,id,zdjecie)
{
	var okno = null;
	if(okno) okno.close();
	var ScrWidth = 640;
	var ScrHeight = 480;
	var width = 720;
	var height = 600;
	if(window.screen)
  	{
   	ScrWidth = window.screen.width; 
		ScrHeight = window.screen.height;
  	}
  	PosX = Math.round((ScrWidth - width) / 2);
  	PosY = Math.round((ScrHeight - height) / 2);
  	width = width;
  	height = height;
  	okno = window.open("/show_pictures.php?typ="+typ+"&id="+id+"&zdjecie="+zdjecie, "zdjecie", "menubar=no,toolbar=no,location=no,directories=no,status=yes,scrollbars=no,resizable=no,copyhistory=no,width=" + width + ",height=" + height + ",left=" + PosX + ",top=" + PosY);
  	okno.focus();	
}

function ShowGalleries(galeria_id,zdjecie_id,lang)
{
	var okno = null;
	if(okno) okno.close();
	var ScrWidth = 640;
	var ScrHeight = 480;
	var width = 840;
	var height = 660;
	if(window.screen)
  	{
   	ScrWidth = window.screen.width; 
		ScrHeight = window.screen.height;
  	}
  	PosX = Math.round((ScrWidth - width) / 2);
  	PosY = Math.round((ScrHeight - height) / 2);
  	width = width;
  	height = height;
  	okno = window.open("/show_galleries.php?galeria_id="+galeria_id+"&zdjecie_id="+zdjecie_id+"&lang="+lang, "zdjecie", "menubar=no,toolbar=no,location=no,directories=no,status=yes,scrollbars=no,resizable=no,copyhistory=no,width=" + width + ",height=" + height + ",left=" + PosX + ",top=" + PosY);
  	okno.focus();	
}

function EnlargePic(url,width,height)
{
	var okno = null;
	if(okno) okno.close();
	width = width + 50;
	height = height + 50;
	if(window.screen)
  	{
   	ScrWidth = window.screen.width;
		ScrHeight = window.screen.height;
  	}
	var PosX = Math.round((ScrWidth - width) / 2);
  	var PosY = Math.round((ScrHeight - height) / 2);
	
	okno = window.open("", "", "menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no,width=" + width + ",height=" + height + ",left=" + PosX + ",top=" + PosY);
  	okno.document.open();
  	okno.document.clear();
  	okno.document.write("<HTML><head><meta http-equiv=\"Content-type\" content=\"text/html; charset=iso-8859-2\"><title>HENKIS</title></HEAD><body leftmargin=0 topmargin=0 rightmargin=0 bottommargin=0 marginwidth=0 marginheight=0><a href='javascript:window.close()'><img src="+url+" alt='Click to close the window' border='0'></a></BODY></HTML>");
  	okno.document.close();
  	okno.focus();
}

function WyslijEmail(uzytkownik, domena, temat)
{
	var OtworzProgramPocztowy = "mailto:" + uzytkownik + "@" + domena + "?Subject=" + temat;
	window.location = OtworzProgramPocztowy;
}

function SendAplication(email,temat)
{
	var OtworzProgramPocztowy = "mailto:"+email+"?Subject=" + temat;
	window.location = OtworzProgramPocztowy;
}

function $(id)
{
	return document.getElementById(id);
}

function CheckValidEmail(adres)
{
   a = adres.search(/@/i);
   a1 = adres.substring(0,a);
   a2 = a1.length;
   a = a + 1;
   b = adres.indexOf(".");
   b1 = adres.substring(a,b);
   b2 = b1.length;
   b = b + 1;
   c = adres.length;
   c1 = adres.substring(b,c);
   c2 = c1.length;
   if(adres.indexOf("@") != "-1" && adres.indexOf(".") != "-1" && a2 >= 1 && b2 >= 1 && c2 >= 1)
   {
   	return true;
   }
   else
   {
   	return false;
   }
}

function ShowTip(id,todo,lang)
{
	jQuery.get("/ajax/ajax_showtip.php?lang="+lang, { id: id, a: todo },

		function(data)
		{
			jQuery('#ciekawostka').html(data);
  		}

	);
}

function pokazOdzial(id)
{
	for(var i = 1; i < 4; i++)
	{
		if(i == id)
			jQuery('#oddzial'+i).attr('style','display:block');
		else
			jQuery('#oddzial'+i).attr('style','display:none');
	}
}

function Newsletter(newsletter_action,msg1,msg2,msg3,msg4,msg5)
{
	if(!CheckValidEmail(jQuery('#newsletter_email').val()))
	{
		jQuery('#newsletter_info').html(msg1);
		jQuery('#newsletter_email').focus();
	}
	else
	{
		jQuery('#newsletter_info').html(msg2);
		jQuery.get("/ajax/ajax_newsletter.php", { e: jQuery('#newsletter_email').val(), a: newsletter_action },

		function(data)
		{
			if(data == "true") jQuery('#newsletter_info').html(msg3);
			else if(data == "exists" || data == "notexists") jQuery('#newsletter_info').html(msg5);
			else jQuery('#newsletter_info').html(msg4);
  		}

		);
	}
}

function RaportyBiezace(msg)
{
	jQuery('#raporty_biezace').html("<div style=\"padding:30px;text-align:center;font-weight:bold;\">"+msg+"</div>");
	jQuery.get("/ajax/ajax_raporty_biezace.php?lang="+jQuery('#rb_l').val(), { y: jQuery('#year').val(), m: jQuery('#month').val(), l: jQuery('#rb_l').val() },
		function(data)
		{
			jQuery('#raporty_biezace').html(data);
		}
	);
}

function Publikacje(msg)
{
	jQuery('#raporty_biezace').html("<div style=\"padding:30px;text-align:center;font-weight:bold;\">"+msg+"</div>");
	jQuery.get("/ajax/ajax_publikacje.php", { y: jQuery('#year').val(), m: jQuery('#month').val(), l: jQuery('#rb_l').val() },
		function(data)
		{
			jQuery('#raporty_biezace').html(data);
		}
	);
}

sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

// -->