//$(document).ready($(function() {
//    var zoomFunc = function(dimension) {
//        return dimension * 1.5;
//    }
//    var shrinkFunc = function(dimension) {
//        return dimension * 0.5;
//    }
//    $('div.gallery img').slidingGallery({
//        'slideSpeed':'slow',
////        'Lzoom':zoomFunc, 
////        'Pzoom':zoomFunc,
////        'Lshrink':shrinkFunc,
////        'Pshrink':shrinkFunc,
//        'container': $('div.gallery')
//    });
//}));

//api_gallery=['images/fullscreen/1.JPG','images/fullscreen/2.jpg','images/fullscreen/3.JPG'];
//api_titles=['API Call Image 1','API Call Image 2','API Call Image 3'];
//api_descriptions=['Description 1','Description 2','Description 3'];

$(document).ready(function(){
    
    $("a[rel^='prettyPhoto']").mouseover(
        function pulsate() {
            $(".gallery-caption").animate({
                opacity: 0.25
            }, 400).animate({
                opacity: 0.75
            }, 400, 'swing', pulsate);
        }
    );
    $("a[rel^='prettyPhoto']").mouseout(function() {
        //console.log('mouseout');
        $(".gallery-caption").stop(true, false);
        $(".gallery-caption").css('opacity', 0.75);
    });
    
    var pulsate = function ( ) {
        $("#download-ad").animate({
            opacity: 0.25
        }, 400).animate({
            opacity: 0.75
        }, 400, 'swing', pulsate);
    }
    
    pulsate();
    
    $("#download-ad").mouseout(pulsate);
    
    $("#download-ad").mouseover(function() {
        //console.log('mouseout');
        $("#download-ad").stop(true, false);
        $("#download-ad").css('opacity', 0.75);
    }); 
    
    //pulsate(); 
    $("a[rel^='prettyPhoto']").prettyPhoto({
        autoplay: false,
        autoplay_slideshow: false,
        theme: 'pp_default',
        social_tools: '<div class="pp_social"><div class="facebook"><iframe id="face" name="face" src="http://www.facebook.com/plugins/like.php?locale=uk_UA&href='+location.href+'&amp;layout=button_count&amp;show_faces=false&amp;width=500&amp;action=like&amp;font&amp;colorscheme=light&amp;height=23" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:500px; height:23px;" allowTransparency="true"></iframe></div></div>',
        changepicturecallback: function() {
            // update FB url in order to match currently selected picture
            url = "http://www.facebook.com/plugins/like.php?locale=uk_UA&href=" + location.origin + '/' + $('#fullResImage').attr('src') + "&amp;layout=button_count&amp;show_faces=false&amp;width=500&amp;action=like&amp;font&amp;colorscheme=light&amp;height=23";
            document.getElementById('face').setAttribute('src', url);
        }
    });

        //$(".gallery:first a[rel^='prettyPhoto']").prettyPhoto({animation_speed:'normal',theme:'facebook',slideshow:3000, autoplay_slideshow: true});
        //$(".gallery:gt(0) a[rel^='prettyPhoto']").prettyPhoto({animation_speed:'fast',slideshow:10000, hideflash: true});

//        $("#custom_content a[rel^='prettyPhoto']:first").prettyPhoto({
//                custom_markup: '<div id="map_canvas" style="width:260px; height:265px"></div>',
//                changepicturecallback: function(){ initialize(); }
//        });
//
//        $("#custom_content a[rel^='prettyPhoto']:last").prettyPhoto({
//                custom_markup: '<div id="bsap_1259344" class="bsarocks bsap_d49a0984d0f377271ccbf01a33f2b6d6"></div><div id="bsap_1237859" class="bsarocks bsap_d49a0984d0f377271ccbf01a33f2b6d6" style="height:260px"></div><div id="bsap_1251710" class="bsarocks bsap_d49a0984d0f377271ccbf01a33f2b6d6"></div>',
//                changepicturecallback: function(){ _bsap.exec(); }
//        });
});

