
/////////////////////EXTY////////////////////////////////////////
//opoznienie
$.fn.wait = function(time, type) {
    time = time || 1000;
    type = type || "fx";
    return this.queue(type, function() {
        var self = this;
        setTimeout(function() {
            $(self).dequeue();
        }, time);
    });
};

var kotniz = {
	
	//
	// Inicjuje wszystkie funkcje strony.
	//
	init: function() {
		kotniz.initEvent();
		kotniz.initElse();
	},

	//
	// a takie tam rozne.
	//
	initEvent: function() {
		$(".openclose").click(function (e) { 
			  e.preventDefault();
			  //$(this).fadeOut("slow");
		      $("+ div", this).fadeIn("slow"); 
		    });	
		//istne glupoty z menu
    	$("#menu a").hover(function (e) { 
			  e.preventDefault();
			  var t = $(this).attr("rel");
			  var tt = 0 - (t * 70);
			  $("#menu").css("background-position","0px " + tt +"px");
		    },
		    function () {
		    	$("#menu").css("background-position","0px 0px");
		      }
    	);
	},

	initElse: function() {

		$("img").fullsize();  
		//gradient

		
		//zaokraglenie rogow
		$(".round").cornerz({
			radius: 30,
			background: "white"
		}); 
        
        
        
        
        
        // obsluga menu 
    	//slideshow w obrazkach
		 $('.slideshow').cycle({
				fx: 'fade',
				next:   '#next2', 
				prev:   '#prev2'
			});
		 
		 

	},
	
	//
	// Osadza flasha na stronie.
	//
	embedFlash: function(banner, id, width, height) {
		$('#' + id).replaceWith('<!--[if !IE]>--><object type="application/x-shockwave-flash" data="' + banner + '" width="' + width + '" height="' + height + '"><!--<![endif]--><!--[if IE]><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="' + width + '" height="' + height + '"><param name="movie" value="' + banner + '" /><!--><!--dgx--><param name="loop" value="true" /><param name="menu" value="false" /><param name="wmode" value="transparent" /></object><!-- <![endif]-->');
	}
};

$(document).ready(function() {
	kotniz.init();
});

