$().ready(function() {
        $( "#accordion" ).accordion({
		autoHeight: true,
		fillSpace: true
	});

        $('.accordion .head').click(function() {
                $(this).next().toggle('slow');
                return false;
        }).next().hide();
        
	//$('a.lightbox').lightBox();
        $('a.lightbox').fancybox({
                'autoScale'     : false,
                'titleShow'             : true,
                'titlePosition'                 : 'outside',
                'transitionIn'  : 'elastic',
                'transitionOut' : 'elastic',
                'overlayOpacity': '0.5'
        });
        $("input#search").labelify({ text: "label" });
        $('a.admin_part').click(function () {
                $('div#banner').slideToggle("slow");
                return false;
        });
		
		// custom easing called "custom"
$.easing.custom = function (x, t, b, c, d) {
	var s = 2.70158; 
	if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
	return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
}
        // initialize scrollable
        var root = $(".scrollable").
                scrollable({circular: true, speed: 1700, easing: "custom"}).
                navigator({indexed:true}).
                autoscroll({ autoplay: true, interval: 5000  });

        // provide scrollable API for the action buttons
        var api = root.data("scrollable");
                
        $("div#play a").click(function() {
            $(this).parent().toggle();
            $("div#pause").toggle();
            api.play();
            return false;
        });
        $("div#pause a").click(function() {
            $(this).parent().toggle();
            $("div#play").toggle();
            api.pause();
            return false;
        });

        $("a.catalog_view_item_name").click(function(){
            var id = $(this).attr("rel");
            $("div#catalog_item"+id).toggle();
            return false;
        })
		
		$("#sub-header").corner("7px");
		$("h2.menu_name").corner("7px");
		$("ul#menu_list li").corner("7px");
		$("#map_canvas").corner("7px");
		$("#map_item").corner("7px");
		$("#content").corner("7px");
});
