/**
 *
 * LynxRail
 * skrypty ogólne
 * 
 * @lastmodified 2011-05
 * @requires jQuery 1.5.2
 *
 */
 
 
/**
 * in-field label
 *
 * @revision 2
 * @author Mateusz Janik
 */
(function($){
	$.fn.inFieldLabel = function() {
		this.each(function() {
			var $this = $(this);
			if($this.val() === '') {
				$this.val($this.attr('title'));
			}
			$this.focus(function() {
				$this.removeClass('default');
				if($this.val() === $this.attr('title')) {
					$this.val('');
				}
			});
			$this.blur(function() {
				if($this.val() === '') {
					$this.val($this.attr('title')).addClass('default');
				}
			});
		});
		return $(this);
	}
})(jQuery);	  
 

/* ************************************************

   Document ready 

*/
$(function(){
 
 
	/**
	 * Input w polu wyszukiwania
	 */
	$('#header form :text').inFieldLabel();
	
	
	/**
	 * Zakładki na stronie głównej
	 * @requires jquery.tools.min.js [tabs]
	 */
	$("#teaser > ul").tabs("#teaser .panes > div", { 
		rotate: true,
		tabs: 'li'
	}).find('a').bind('mouseover', function () {
		$(this).click();
	});
/* 	.slideshow({
		autoplay: true,
		interval: 4000,
		clickable: false
	}); */


	/**
	 * Newsy na stronie głónej
	 * @requires jquery.tools.min.js [tabs]
	 */
	$('.newsline').each(function () {
		var 
			$root = $(this)
			$panes = $root.find('ul > li')
		;
		
		var h = '<p class="jump">';
		$panes.each(function () {
			h += '<a href="#"></a>';
		});
		h += '</p>';
		
		var $tabs = $(h).appendTo($root);
		
		$tabs.tabs($panes, {
			effect: 'fade', 
			rotate: true
		}).slideshow({
			autoplay: true,
			interval: 6000,
			clickable: false
		});
		
		var tabs = $tabs.data('tabs');
		
		$root.find('.prev').click(function () {
			tabs.prev();
			return false
		});
		$root.find('.next').click(function () {
			tabs.next();
			return false
		});
				
	});
	
	
}) // Document ready
/* ************************************************ */

var config = config || {};

config.colorbox = {
	opacity: .8,
	transition: 'none',
	maxWidth: '90%',
	maxHeight: '90%'
}

$(function() {
   $('a[href^="[MAIL]"]').each(function() {
      var $email = $(this);
      $email.attr('href', $email.attr('href')
         .replace(/\s*\[ANTI-SPAM\]\s*/, '@').replace(/\s*\[MAIL\]\s*/, 'mailto:'));
   });
});
/**
 *
 * LynxRail
 * skrypty ogólne
 * 
 * @lastmodified 2011-05
 * @requires jQuery 1.5.2
 *
 */
 
 
/**
 * in-field label
 *
 * @revision 2
 * @author Mateusz Janik
 */
(function($){
	$.fn.inFieldLabel = function() {
		this.each(function() {
			var $this = $(this);
			if($this.val() === '') {
				$this.val($this.attr('title'));
			}
			$this.focus(function() {
				$this.removeClass('default');
				if($this.val() === $this.attr('title')) {
					$this.val('');
				}
			});
			$this.blur(function() {
				if($this.val() === '') {
					$this.val($this.attr('title')).addClass('default');
				}
			});
		});
		return $(this);
	}
})(jQuery);	  
 

/* ************************************************

   Document ready 

*/
$(function(){
 
 
	/**
	 * Input w polu wyszukiwania
	 */
	$('#header form :text').inFieldLabel();
	
	
	/**
	 * Zakładki na stronie głównej
	 * @requires jquery.tools.min.js [tabs]
	 */
	$("#teaser > ul").tabs("#teaser .panes > div", { 
		rotate: true,
		tabs: 'li'
	}).find('a').bind('mouseover', function () {
		$(this).click();
	});
/* 	.slideshow({
		autoplay: true,
		interval: 4000,
		clickable: false
	}); */


	/**
	 * Newsy na stronie głónej
	 * @requires jquery.tools.min.js [tabs]
	 */
	$('.newsline').each(function () {
		var 
			$root = $(this)
			$panes = $root.find('ul > li')
		;
		
		var h = '<p class="jump">';
		$panes.each(function () {
			h += '<a href="#"></a>';
		});
		h += '</p>';
		
		var $tabs = $(h).appendTo($root);
		
		$tabs.tabs($panes, {
			effect: 'fade', 
			rotate: true
		}).slideshow({
			autoplay: true,
			interval: 6000,
			clickable: false
		});
		
		var tabs = $tabs.data('tabs');
		
		$root.find('.prev').click(function () {
			tabs.prev();
			return false
		});
		$root.find('.next').click(function () {
			tabs.next();
			return false
		});
				
	});
	
	/**
	 * Detekcja Safari coby przez CSS zlikwidować buga ze znikającą strzałką w <select>'ach
	 */
	if ($.browser.safari) {
		$('html').addClass('safari');
	}
	
	
}) // Document ready
/* ************************************************ */

var config = config || {};

config.colorbox = {
	opacity: .8,
	transition: 'none',
	maxWidth: '90%',
	maxHeight: '90%'
}

$(function() {
   $('a[href^="[MAIL]"]').each(function() {
      var $email = $(this);
      $email.attr('href', $email.attr('href')
         .replace(/\s*\[ANTI-SPAM\]\s*/, '@').replace(/\s*\[MAIL\]\s*/, 'mailto:'));
   });
});

