<!--
function popImage(url,windowTitle,windowName,closeOnClick,width,height,t){
	closeOnClick=true;
	if(!url)return
	function readSize(){if(t.complete)showPopup(t.width,t.height);else setTimeout(readSize,1e2)}
	function showPopup(w,h){with(window.open('',windowName||'','width='+(width||w)+',height='+(height||h)).document){open();write('<html><head><title>'+(windowTitle||'')+'</title></head><body onBlur="self.close()" style="margin:0;padding:0"><img src="'+url+'" style="display:block'+(closeOnClick?';cursor: pointer" onclick="self.close()" title="Zamknij okno"':'"')+'></body></html>');close()}}
	if(!width||!height)t=new Image(),t.src=url,readSize()
	else showPopup(width,height)
}

function popup(mylink) 
{
	if (!window.focus)return true;
	var href;
	if (typeof(mylink) == 'string')
	   href=mylink;
	else
	   href=mylink.href;
	window.open(href, 'Popup', 'width=636,height=400,scrollbars=yes');
	return false;
}

//Otwórz okno z dokumentem (określ rozmiary)
function okno(URL,szer,wys) {
	nowe_okno=window.open(URL,"_blank","toolbar=no,status=no,menus=no,scrollbars,location=no,resizable,width="+szer+",height="+wys+",top=30,left=30");
	return;
}


/*
Form2Pop Script- By Peter Bailey (http://www.peterbailey.net)
Featured on JavaScriptKit.com
Visit http://www.javascriptkit.com for this script and more
*/

function createTarget(sTarget,sWhat,sOptions){
	window.open(sWhat, sTarget, sOptions);
	return false;
}


function submitForm(sFormName, bDontHideButton){
//	showHideFixedPreloader();
	if (bDontHideButton == undefined) {
		bDontHideButton = false;
	}
	if (!bDontHideButton) {
		jQuery('#' + sFormName + 'Submit').hide();
	}		
	jQuery('#' + sFormName).submit();
}

function initializeFancyBoxImages()
{
	jQuery("a.fancyBoxImage").fancybox({
		'zoomSpeedIn':	500,
		'zoomSpeedOut':	300,
		'overlayShow':	true,
		'hideOnContentClick': true
	});
}

var iMonthNumber = 0;

function v()
{
	void(null);
}

/*** JQUERY ***/
jQuery.noConflict();
jQuery(document).ready(function() {
	externalLinks();
	/*** FANCY BOX ***/
	initializeFancyBoxImages();
	changeFontSize();
	handleAdsButtons();
	loadAdsBox();
	pollVote();
	showCalendarMonth();
});

function initializeInputFocusEffect(sInputName, sText)
{
	if (!jQuery("input[name='" + sInputName + "']").attr('value')) {
		jQuery("input[name='" + sInputName + "']").attr('value', sText);
	}
	jQuery("input[name='"+sInputName+"']").focus(function()
		{
			if (jQuery("input[name='" + sInputName + "']").attr('value') == sText) {
				jQuery("input[name='" + sInputName + "']").attr('value', '');
			}
		}
	)
	jQuery("input[name='"+sInputName+"']").blur(function()
		{
			if (!jQuery("input[name='"+sInputName+"']").attr('value')) {
				jQuery("input[name='"+sInputName+"']").attr('value', sText);
			}
		}
	)
}

function changeBGPIC(sDiv, iPX)
{
	jQuery(sDiv).css('background-position', '0px ' + iPX + 'px');
}

function initializeTextareaFocusEffect(sTextareaName, sText)
{
/*
	if (jQuery("textarea[@name="+hTextareaName+"]").val() == 'Wypełnij pole!'){
		$("textarea[@name="+hTextareaName+"]").val('');
		$("textarea[@name="+hTextareaName+"]").css("color","#A8A8A8");
	}
*/
	var hTextarea = jQuery("textarea[@name="+sTextareaName+"]");
	
	if (hTextarea.val() == '') {
		hTextarea.val(sText);
	}
	jQuery(hTextarea).focus(function()
		{
			if (hTextarea.val() == sText) {
				hTextarea.val('');
			}
		}
	)
	jQuery(hTextarea).blur(function()
		{
			if (hTextarea.val() == '') {
				hTextarea.val(sText);
			}
		}
	)
}

function showHidePreloader(sTargetDiv, bHide)
{
	if (bHide == 'undefined') {
		bHide = false;
	}
	var iDivContentHeight = jQuery('.' + sTargetDiv).height();
	var divPreloader = jQuery('div.preloaderApla_' + sTargetDiv);
	iDivContentHeight = (iDivContentHeight > 59) ? iDivContentHeight : 60;
	jQuery(divPreloader).height(iDivContentHeight);
	if (!bHide) {
		jQuery(divPreloader).show();
	} else {
		jQuery(divPreloader).hide();
	}
}

function showHideFixedPreloader(bHide)
{
	if (bHide == undefined) {
		bHide = false;
	}
	var divFixedPreloader = jQuery('div#ajaxLoading');
	if (!bHide) {
		jQuery(divFixedPreloader).show();
	} else {
		jQuery(divFixedPreloader).hide();
	}
}

function setPrintHTML(sHTML)
{
	var sName = 'toPrint';
	
	jQuery.post("ajax/jQuerySession.php", {set: '1', name: sName, value: sHTML}, function(data)
	{
		if(data == "ok") {
			//jQuery("#container").html("<b>SESSION Setup Successfully!</b>");
			return createTarget('print','toPrint', 'width=700,height=600,resizable=no,scrollbars=yes');
			alert
		} else {
	//		jQuery("#container").html("<b>Something Broke! HELP!</b>");
		}
	});
	
//	alert(sHTML);
//	return false;
}

var adsPage = 1;

function loadAdsBox()
{
	var divContent = jQuery(".boxAnnon .contenter");
	jQuery.ajax({  
		method: "post",
		global: false,
		url: "ajax/getAdsBox.php",data: "&page=" + adsPage,  
		beforeSend: function(){
			jQuery(divContent).html('<p class="ajaxLoading">Ładowanie...</p>'); //show loading just when link is clicked  
		}, 
		success: function(html){ //so, if data is retrieved, store it in html  
			jQuery(divContent).html(html); //show the html inside .content div  
		}  
	}); //close jQuery.ajax(  
}



function handleAdsButtons()
{
	jQuery("#adsButtonLeft").click(
		function()
		{
			if (adsPage == 1) {
				adsPage = iAdsPages;
			} else {
				adsPage--;
			}
			loadAdsBox();
			return false;
		}
	);
	
	jQuery("#adsButtonRight").click(
		function()
		{
			if (adsPage == iAdsPages) {
				adsPage = 1;
			} else {
				adsPage++;
			}
			loadAdsBox();
			return false;
		}
	);
}

function pollVote()
{
	jQuery("input[name=pollOption]").change(
		function()
		{
			jQuery("#pollForm").submit();
		}
	);
}

var iCurrentYoutubeList = 0;
function changeRelatedYoutubeList(bPrev)
{
	var iNewList = 0;
	if (bPrev) {
		iNewList = ((iCurrentYoutubeList - 1) == -1) ? 0 : iCurrentYoutubeList - 1;
	} else {
		iNewList = ((iCurrentYoutubeList + 1) >= iMaxYoutubeList - 1) ? iMaxYoutubeList - 1 : iCurrentYoutubeList + 1;
	}

	var divLastList = jQuery("#youtubeList_" + iCurrentYoutubeList);
	jQuery(divLastList).hide();

	var divList = jQuery("#youtubeList_" + iNewList);
	jQuery(divList).show();

	iCurrentYoutubeList = iNewList;
	
	return false;
}



var iCurrentNewestYoutubeList = 0;
function changeNewestYoutubeList(bPrev)
{
	var iNewList = 0;
	if (bPrev) {
		iNewList = ((iCurrentNewestYoutubeList - 1) == -1) ? 0 : iCurrentNewestYoutubeList - 1;
	} else {
		iNewList = ((iCurrentNewestYoutubeList + 1) >= iMaxNewestYoutubeList - 1) ? iMaxNewestYoutubeList - 1 : iCurrentNewestYoutubeList + 1;
	}

	var divLastList = jQuery("#newestYoutube_" + iCurrentNewestYoutubeList);
	jQuery(divLastList).hide();

	var divList = jQuery("#newestYoutube_" + iNewList);
	jQuery(divList).show();

	iCurrentNewestYoutubeList = iNewList;
	
	return false;
}

function showCalendarMonth(iMonth)
{
	jQuery(".loader").show();
	jQuery.get("ajax/getCalendarMonth.php", {monthNumber: iMonth, year: iYear}, function(sHTML)
	{
		if(sHTML) {
			jQuery(".boxCalendar").html(sHTML);
			JT_init();
			changeCalendarMonth();
			jQuery(".loader").hide();
		}
	});
}

function changeCalendarMonth()
{
	jQuery(".changeCalendarMonth").click(
		function()
		{
			var iMonth = jQuery(this).attr("rel");
			if (iMonth > 12) {
				iMonth = 1;
				iYear++;
			}
			if (iMonth < 1) {
				iMonth = 12;
				iYear--;
			}
			showCalendarMonth(iMonth);
			return false;
		}
	);
}

-->

