// JavaScript Document
$(function() {
    $('img.image1').data('ad-desc', 'Whoa! This description is set through elm.data("ad-desc") instead of using the longdesc attribute.<br>And it contains <strong>H</strong>ow <strong>T</strong>o <strong>M</strong>eet <strong>L</strong>adies... <em>What?</em> That aint what HTML stands for? Man...');
    $('img.image1').data('ad-title', 'Title through $.data');
    $('img.image4').data('ad-desc', 'This image is wider than the wrapper, so it has been scaled down');
    $('img.image5').data('ad-desc', 'This image is higher than the wrapper, so it has been scaled down');
    var conf = { cycle: false, display_next_and_prev: true, callbacks: {

      afterImageVisible: function(){
        $('.ad-image-wrapper').prepend('<div class="ad-image-container" style="width:278px;height:278px;display:block;"></div>');
        $('.ad-image-container').prepend($('.ad-image').html());
        $('.ad-image').remove();
        $('.ad-image-container img').imgCenter();
      }
    }};
//    var galleries = $('.ad-gallery').adGallery(conf);
    $('#switch-effect').change(
      function() {
        galleries[0].settings.effect = $(this).val();
        return false;
      }
    );
    $('#toggle-slideshow').click(
      function() {
        galleries[0].slideshow.toggle();
        return false;
      }
    );
  });
