$(document).ready(function () {
    function a(a, b) {
        var c = a > 2 ? ' style="display:none"' : "";
        return '<a href="#?page" title="1"' + c + ' class="" rel="buttonsat" id="buttactive"></a>'
    }
    $("#topnav ul li a").hover(function () {
        $(this).parent().find("ul.subtop").slideDown("fast").show();
        $("#topnav ul li ul").hover(function () {
            $(this).parent().children(":first").addClass("active")
        }, function () {
            $(this).parent().children(":first").removeClass("active")
        });
        $(this).parent().hover(function () {}, function () {
            $(this).parent().find("ul.subtop").slideUp("fast")
        })
    });
    if ($.browser.msie) {
        $("#topnav ul li ul").each(function (a) {
            $(this).css("margin-left", -$(this).parent().width()+2)
        })
    }

    $("a[rel=img_group]").fancybox({
        transitionIn: "fade",
        transitionOut: "fade",
        titlePosition: "over",
        titleFormat: function (a, b, c, d) {
            return '<span id="fancybox-title-over" style="color: #ffffff;">' + a + "</span>"
        }
    });

    $('#foto_rot').cycle({
	    context: false,
	    tabs: false,
	    timeout: 5000,      // time before next slide appears (in ms)
	    slideSpeed: 4000,   // time it takes to slide in each slide (in ms)
	    tabSpeed: 300,      // time it takes to slide in each slide (in ms) when clicking through tabs
	    cleartypeNoBg: true,
			fx: 'fade' // choose your transition type, ex: fade, scrollUp, shuffle, etc...
		});
    $('#banner').cycle({
	    context: false,
	    tabs: false,
	    timeout: 7000,      // time before next slide appears (in ms)
	    slideSpeed: 4000,   // time it takes to slide in each slide (in ms)
	    tabSpeed: 300,      // time it takes to slide in each slide (in ms) when clicking through tabs
	    cleartypeNoBg: true,
			fx: 'fade' // choose your transition type, ex: fade, scrollUp, shuffle, etc...
		});

    $("#cal_prev").click(function () {
        $.ajax({
            url: "fw/ajax/calendar_m.php",
            data: "typi=1",
            success: function (a) {
                $("#monthsat").html(a);
                $.ajax({
                    url: "fw/ajax/calendar.php",
                    data: "typi=1",
                    success: function (a) {
                        $(".month_days").html(a)
                    }
                })
            }
        })
    });
    $("#cal_next").click(function () {
        $.ajax({
            url: "fw/ajax/calendar_m.php",
            data: "typi=2",
            success: function (a) {
                $("#monthsat").html(a);
                $.ajax({
                    url: "fw/ajax/calendar.php",
                    data: "typi=2",
                    success: function (a) {
                        $(".month_days").html(a)
                    }
                })
            }
        })
    });
 
});
