$(document).ready(function(){
//BEGIN


//menu
$("div.menu_item").hover(function() {
	$(this).css("backgroundColor", "#f4f1e9")
	       .css("color", "#b75012")
		   .prev("div.menu_tick").html("<img src=\"images/tick_active.png\" width=\"12\" height=\"12\" />");
},function() {
	$(this).css("backgroundColor", "transparent")
	       .css("color", "#3A3A3A")
		   .prev("div.menu_tick").html("<img src=\"images/tick_passive.png\" width=\"12\" height=\"12\" />");
});

$("div.menu_item").click(function() {
	var goto = $(this).attr("goto");
	if(goto != "NaN") {
		document.location.href = "?go=" + goto;
	}
});


//bigimg slideshow
$("div.slideshow").cycle({
	timeout:   8000,
	speed:     300,
	pause:     1,
	next:      "div.slideshow",
	after:     function() {
	var opis = $(this).attr("opis");
	$("div.BIcaption_title").html(this.alt);
	$("div.BIcaption_txt").html(opis);
    }
});


//carousel
$("#mycarousel").jcarousel({
	wrap: "circular",
	animation: "slow",
	scroll: 2
	// This tells jCarousel NOT to autobuild prev/next buttons
	//buttonNextHTML: null,
	//buttonPrevHTML: null
});
$("#mycarousel a.loadup").click(function() {
	var a = $(this).attr("count");
	a = a * 1; //string nie dziala
    $("div.slideshow").cycle(a); 
    return false; 
});


//galeria
$("a.gal_a").simpletooltip();
$("a.gal_a").click(function() {
    var cat_name = $(this).attr("dir_name");
	var name = $(this).attr("tit");
	var desc = $(this).attr("desc"); 
    var formData = "load=" + cat_name;
    $.ajax({
      type: "POST",
	  url: "really_simple_templates/gal_b_ajax.php",
	  data: formData,
	  success: function(html) {
        $("div.gal_b").html(html);
	  }
	  
	});
	$("div.small_txt").html("<b>" + name + "</b><br /><br />" + desc);
});







	//END
});
