/* jquery.tools 1.1.1 - The missing UI library for the Web
 * [tools.tabs-1.0.3, tools.tooltip-1.1.1, tools.scrollable-1.1.1, tools.overlay-1.1.1, tools.expose-1.0.5]
 * Copyright (c) 2009 Tero Piirainen
 * http://flowplayer.org/tools/
 * Dual licensed under MIT and GPL 2+ licenses
 * http://www.opensource.org/licenses
 * File generated: Fri Sep 18 05:04:58 EDT 2009
 */
(function(c){c.tools=c.tools||{};c.tools.tooltip={version:"1.1.1",conf:{effect:"toggle",fadeOutSpeed:"fast",tip:null,predelay:0,delay:30,opacity:1,lazy:undefined,position:["top","center"],offset:[0,0],cancelDefault:true,relative:undefined,events:{def:"mouseover,mouseout",input:"focus,blur",widget:"focus mouseover,blur mouseout"},api:false},addEffect:function(d,f,e){b[d]=[f,e]}};var b={toggle:[function(d){var e=this.getConf();this.getTip().css({opacity:e.opacity}).show();d.call()},function(d){this.getTip().hide();d.call()}],fade:[function(d){this.getTip().fadeIn(this.getConf().fadeInSpeed,d)},function(d){this.getTip().fadeOut(this.getConf().fadeOutSpeed,d)}]};function a(e,f){var o=this,j=c(this);e.data("tooltip",o);var k=e.next();if(k.length&&f.relative===undefined){f.relative=true}if(f.tip){k=c(f.tip);if(k.length>1){k=e.nextAll(f.tip).eq(0);if(!k.length){k=e.parent().nextAll(f.tip).eq(0)}}}function n(t){var s=f.relative?e.position().top:e.offset().top,r=f.relative?e.position().left:e.offset().left,u=f.position[0];s-=k.outerHeight()-f.offset[0];r+=e.outerWidth()+f.offset[1];var p=k.outerHeight()+e.outerHeight();if(u=="center"){s+=p/2}if(u=="bottom"){s+=p}u=f.position[1];var q=k.outerWidth()+e.outerWidth();if(u=="center"){r-=q/2}if(u=="left"){r-=q}return{top:s,left:r}}var h=e.is(":input"),d=h&&e.is(":checkbox, :radio, select, :button"),g=e.attr("type"),m=f.events[g]||f.events[h?(d?"widget":"input"):"def"];m=m.split(/,\s*/);e.bind(m[0],function(q){var p=k.data("trigger");if(p&&p[0]!=this){k.hide()}q.target=this;o.show(q);k.hover(o.show,function(){o.hide(q)})});e.bind(m[1],function(p){o.hide(p)});if(!c.browser.msie&&!h){e.mousemove(function(){if(!o.isShown()){e.triggerHandler("mouseover")}})}if(f.opacity<1){k.css("opacity",f.opacity)}var l=0,i=e.attr("title");if(i&&f.cancelDefault){e.removeAttr("title");e.data("title",i)}c.extend(o,{show:function(q){if(q){e=c(q.target)}clearTimeout(k.data("timer"));if(k.is(":animated")||k.is(":visible")){return o}function p(){k.data("trigger",e);var s=n(q);if(f.tip&&i){k.html(e.data("title"))}var r=c.Event("onBeforeShow");j.trigger(r,[s]);if(r.isDefaultPrevented()){return o}s=n(q);k.css({position:"absolute",top:s.top,left:s.left});b[f.effect][0].call(o,function(){j.trigger("onShow")})}if(f.predelay){clearTimeout(l);l=setTimeout(p,f.predelay)}else{p()}return o},hide:function(q){clearTimeout(k.data("timer"));clearTimeout(l);if(!k.is(":visible")){return}function p(){var r=c.Event("onBeforeHide");j.trigger(r);if(r.isDefaultPrevented()){return}b[f.effect][1].call(o,function(){j.trigger("onHide")})}if(f.delay&&q){k.data("timer",setTimeout(p,f.delay))}else{p()}return o},isShown:function(){return k.is(":visible, :animated")},getConf:function(){return f},getTip:function(){return k},getTrigger:function(){return e},bind:function(p,q){j.bind(p,q);return o},onHide:function(p){return this.bind("onHide",p)},onBeforeShow:function(p){return this.bind("onBeforeShow",p)},onShow:function(p){return this.bind("onShow",p)},onBeforeHide:function(p){return this.bind("onBeforeHide",p)},unbind:function(p){j.unbind(p);return o}});c.each(f,function(p,q){if(c.isFunction(q)){o.bind(p,q)}})}c.prototype.tooltip=function(d){var e=this.eq(typeof d=="number"?d:0).data("tooltip");if(e){return e}var f=c.extend(true,{},c.tools.tooltip.conf);if(c.isFunction(d)){d={onBeforeShow:d}}else{if(typeof d=="string"){d={tip:d}}}d=c.extend(true,f,d);if(typeof d.position=="string"){d.position=d.position.split(/,?\s/)}if(d.lazy!==false&&(d.lazy===true||this.length>20)){this.one("mouseover",function(g){e=new a(c(this),d);e.show(g)})}else{this.each(function(){e=new a(c(this),d)})}return d.api?e:this}})(jQuery);
/* ----------- SLIDE ---------------- */
(function($) {
	$.fn.slidee = function(options){
		var defaults = {
			prevId: 		'prevBtn',
			prevText: 		'<img src=\"img/left.png\" alt=\"Poprzednia realizacja\">',
			nextId: 		'nextBtn',
			nextText: 		'<img src=\"img/right.png\" alt=\"Nastêpna realizacja\">',
			controlsShow:	true,
			controlsBefore:	'',
			controlsAfter:	''
		};
		var options = $.extend(defaults, options);
		this.each(function() {
			var obj = $(this);
			var s = $("li", obj).length;
			var w = $("li", obj).width();
			var h = $("li", obj).height();
			obj.css("overflow","hidden");
			var ts = s-1;
			var t = 0;
			$("li", obj).css('float','left');

			if(options.controlsShow){
				var html = ' <span id="'+ options.prevId +'"><a href=\"javascript:void(0);\">'+ options.prevText +'</a></span>';
				html += ' <span id="'+ options.nextId +'"><a href=\"javascript:void(0);\">'+ options.nextText +'</a></span>';
				$(obj).after(html);
			};

			$("a","#"+options.nextId).click(function(){
				animate("next",true,"");
			});
			$("a","#"+options.prevId).click(function(){
				animate("prev",true,"");
			});

			$(".top a").click(function(){
			  var other_id;
				other_id=$(this).attr("name");
				animate("other",true,other_id);
				return false;
			});

			function animate(dir,clicked,other_id){
				var ot = t; // t - actually visible element
				switch(dir){
					case "next": t = (ot>=ts) ? (options.continuous ? 0 : ts) : parseInt(t)+1; break;
					case "prev":	 t = (t<=0) ? (options.continuous ? ts : 0) : parseInt(t)-1; break;
					case "other":	 t = other_id; break;
					default:			 break;
				};
					//alert(t);
					$("#slider li:visible").fadeOut("1000", function() {$("#s"+t).parent("li").fadeIn("1000")});
					if(t==ts){
						$("a","#"+options.nextId).hide();
					} else {
						$("a","#"+options.nextId).show();
					};
					if(t==0){
						$("a","#"+options.prevId).hide();
					} else {
						$("a","#"+options.prevId).show();
					};
			};
				$("a","#"+options.prevId).hide();
		});
	};
})(jQuery);

$(document).ready(function(){
  $("#slider").slideDown(2400).slidee();
	$("#prevBtn,#nextBtn").show(1900);
  $("#s1").css("background","url('img/pf01.jpg')");	$("#s2").css("background","url('img/pf02.jpg')");	$("#s3").css("background","url('img/pf03.jpg')");	$("#s4").css("background","url('img/pf04.jpg')");	$("#s5").css("background","url('img/pf05.jpg')");	$("#s6").css("background","url('img/pf06.jpg')");	$("#s7").css("background","url('img/pf07.jpg')");	$("#s8").css("background","url('img/pf08.jpg')");	$("#s9").css("background","url('img/pf09.jpg')");	$("#s10").css("background","url('img/pf10.jpg')"); $("#s11").css("background","url('img/pf11.jpg')");	$("#s12").css("background","url('img/pf12.jpg')"); $("#s13").css("background","url('img/pf13.jpg')");
  $("#style_switch").show();
	$("#style_switch a").click(function() {
   if($(this).attr('rel')=='style/style.css') {$("link:eq(1)").remove(); $(this).css("display","none"); $(this).next("a").css("display","inline");}
   else {$("link:eq(0)").after('<link rel=\"stylesheet\" type=\"text/css\" href=\"style/style2.css\" media=\"screen\">'); $(this).css("display","none"); $(this).prev("a").css("display","inline");}
   return false;
   });
  $("#slider a").attr("target","_blank");
  $("#head_web").tooltip({tip: '#tooltip1',position: 'bottom center',lazy: true,delay: 1});
  $("#head_other").tooltip({tip: '#tooltip2',position: 'bottom center',lazy: true,delay: 1});
  $("#head_id").tooltip({tip: '#tooltip3',position: 'bottom center',lazy: true,delay: 1});

	$("#enlarge").show();
	$("#toogle_menu").click(function(){
					if ($(".hidden").css("display")=="none")
					  {
						  $(".hidden").slideDown(500);
							$("#toogle_menu").attr("src","img/arrow_up.gif");
						}
					else
					  {
							 $("#toogle_menu").attr("src","img/arrow_down.gif");
							 $(".hidden").slideUp(500);
						}
					});
});

