$(function(){   

    $("a[rel^='lightbox']").prettyPhoto({
			animationSpeed: 'slow',
			padding: 40,
			opacity: 0.85,
			showTitle: false,
			allowresize: true,
			counter_separator_label: '/',
			theme: 'light_rounded'
    });
    
    if ($.fn.mbBookShowcase) {
        $("#tray-wrapper").mbBookShowcase({
            targetTray: 'showcaseTrays', //div id of tray in your php fetch file trays.php
            detailsImg: 'book-img',
            itemClass: 'book',
            imgClass: 'bookImg',
            mOvrClass: 'book-ovr',
            selClass: 'book-sel',
            phpFetchFile: 'showcaseBooks.php',
            klass: 'mbBookShowcase',
            bookId: g_showcaseRecord,
            followLink: false,
            loadTrayFromExternalFile: false
        }, function() {
            var str = this.clickid;
            str = str.substring(1);
            $("#showcaseHiddenRecord").val(str);
            if (this.event == "click") {
                $.ajax({
                    url: "/showcaseSaveItem.php?record=" + str
                });
            }
        });

        $("#book-img").live('click', function () {
            document.showcaseForm.submit();
        });
        
        $("#showcase-left a, #showcase-right a").hover(function(){
        	$(this).toggleClass("showcase-arrow-over");	
        });
    }
     
});
