// jQuery Cursor Message Plugin
//
// Version 0.1
//
// Tim de Koning
// Kingsquare Information Services (http://www.kingsquare.nl/)
//
// Visit http://www.kingsquare.nl/cursorMessage for usage and more information
//
// Terms of Use
//
// This file is released under the GPL, any version you like
//

 jQuery.noConflict();

 jQuery(document).ready(function(){
jQuery(".news-latest-item:even").css("clear", "both");
jQuery("a[title = 'Szukaj']").css({"display":"none"});
jQuery("a[title = 'Search']").css({"display":"none"});
});

function showCursorMessage(nazwa) {
	jQuery.cursorMessage(nazwa);
}


var mapkaArray = new Array();
mapkaArray[0] = '';
mapkaArray[1] = 'zachodniopomorskie';
mapkaArray[2] = 'pomorskie';
mapkaArray[3] = 'warmińsko-mazurskie';
mapkaArray[4] = 'podlaskie';
mapkaArray[5] = 'lubuskie';
mapkaArray[6] = 'wielkopolskie';
mapkaArray[7] = 'kujawsko-pomorskie';
mapkaArray[8] = 'łódzkie';
mapkaArray[9] = 'mazowieckie';
mapkaArray[10] = 'lubelskie';
mapkaArray[11] = 'dolnośląskie';
mapkaArray[12] = 'opolskie';
mapkaArray[13] = 'śląskie';
mapkaArray[14] = 'świętokrzyskie';
mapkaArray[15] = 'małopolskie';
mapkaArray[16] = 'podkarpackie';


function mapkaPokaz(id){
	showCursorMessage('&nbsp;&nbsp;'+mapkaArray[id])
	document.getElementById('mapkaGif').src = "/fileadmin/static/graf/mapka"+id+".gif";
}
function mapkaUkryj(){
	showCursorMessage('')
	document.getElementById('mapkaGif').src = "/fileadmin/static/graf/mapka"+adresPodstawowyMapki+".gif";
}



if(jQuery) {
	( function($) {
	$.cursorMessageData = {}; // needed for e.g. timeoutId
	//start registring mouse coöridnates from the start!

	$(window).ready(function(e) {
		if ($('#cursorMessageDiv').length==0) {
			  $('body').append('<div id="cursorMessageDiv">&nbsp;</div>');	
			  $('#cursorMessageDiv').hide();
		}

		$('body').mousemove(function(e) {
			$.cursorMessageData.mouseX = e.pageX;
			$.cursorMessageData.mouseY = e.pageY;
			if ($.cursorMessageData.options != undefined) $._showCursorMessage();
		});
	});	
	$.extend({
		cursorMessage: function(message, options) {
			if( options == undefined ) options = {};
			if( options.offsetX == undefined ) options.offsetX = 3;
			if( options.offsetY == undefined ) options.offsetY = 5;
			if( options.hideTimeout == undefined ) options.hideTimeout = 2000;
			
			var hideCursorMessage = function() {
				$('#cursorMessageDiv').html(message).fadeOut('slow');
			};
			
			$('#cursorMessageDiv').html(message).fadeIn('slow');
			if (jQuery.cursorMessageData.hideTimoutId != undefined)  clearTimeout(jQuery.cursorMessageData.hideTimoutId);
			jQuery.cursorMessageData.hideTimoutId = setTimeout(hideCursorMessage,options.hideTimeout);
			jQuery.cursorMessageData.options = options;
			$._showCursorMessage();
		},
		
		_showCursorMessage: function() {
			$('#cursorMessageDiv').css({ top: ($.cursorMessageData.mouseY + $.cursorMessageData.options.offsetY)+'px', left: ($.cursorMessageData.mouseX + $.cursorMessageData.options.offsetX) })
		}
	});
})(jQuery);
}

/*
 * Pozostale funkcje
 */
function getDzialanie(id)
{
	//alert(jQuery('#kolumna2')+' - '+id+' - aaaa');
//alert(id);
	jQuery.ajax({
		   type: "POST",
                   url: "loadDzialania.php",
//		   url: js_url+"ajax-box/set-acl-strona/",
                   //url: 'http://pomorskie.ksow.pl/baza-dobrych-praktyk2/',
		   data: "post_ajax=1&elId="+id,
		   success: function(msg){
				//alert(jQuery('#dzial_skrot'));
//				document.getElementById('dzial_skrot').innerHTML = msg;
 jQuery("#dzial_skrot").html(msg);
                                
                             
		   }
 	 });
}

function _resizeFont(name, s)
{
   var k2 = jQuery(name);
   fs = parseInt(k2.css("font-size"));
   
   if(s == 0)
   {
   	fs =12;
   }
   else if(s == -1 && (fs-2) >= 8)
   {
   	fs = fs - 2;
   }
   else if(s == 1 && (fs+2) <= 20)
   {
   	fs = fs + 2;
   }
   
   k2.css('font-size',fs);

   //alert(k2.css("font-size")+' - '+name);
}

function resizeFont(s)
{
  _resizeFont('#kolumna2',s);
  _resizeFont('#kolumna2 p.bodytext',s);
  _resizeFont('#kolumna2 .news-latest-item h3');
  _resizeFont('#kolumna2 .news-latest-item h3 a');
}