$(document).ready(function() {
    $("#gallery-gigya-code").val($('#gigya-embed-code').html());
    var pconf={
      useFacebookMystuff: 'false', 
      contentIsLayout: 'false', 
      defaultContent: 'gallery-gigya-code',
      widgetTitle: gigyaPconfWidgetTitle,
      UIConfig: '<config baseTheme="v2"><display showDesktop="false" showEmail="true" showBookmark="true" networksToHide="" networksToShow="facebook, twitter, myspace, digg, igoogle, bebo, friendster, hi5, orkut, delicious, *"></display></config>'
    };
    Wildfire.LinkedLoading=false;
    Wildfire.initPost('814082', 'gallery-gigya-post', 300, 165, pconf);
    

    $(".gigya .button").click( function() {
          if ($("#wildfire-post-wrapper").hasClass("visible")) {
            $("#wildfire-post-wrapper").hide();
            $("#wildfire-post-wrapper").removeClass("visible");
            if ($.support.style === false) {
                // IE 6/7
                $('.most-popular-content').css('margin-top', '0');
            }
          } else {
            $("#wildfire-post-wrapper").show();
            $("#wildfire-post-wrapper").addClass("visible");
            if ($.support.style === false) {
                // IE 6/7
                $('.most-popular-content').css('margin-top', '70px');
            }
          }
        });

        $(".gigya .close-button").click( function() {
          $("#wildfire-post-wrapper").hide();
          $("#wildfire-post-wrapper").removeClass("visible");
          if ($.support.style === false) {
              // IE 6/7
              $('.most-popular-content').css('margin-top', '0');
          }
        });
});
