﻿Cufon.replace('#newsCTA h2,#specialsCTA h2, #content h1 div, #content h2, #ibeSlogan, #textWidget-1 h1, #side .widgetCTA .widgetCTAHeaders, #side .widgetCTA span, #constantContact h1', { hover: true, fontFamily: 'Goudy Old Style' });
//Cufon.replace('#bookARoom', { hover: true, fontFamily: 'Goudy Old Style'});

$(document).ready(function(){
     var findSubNavLI = $("#subNav ul  > li ");
     if (findSubNavLI.length<1) {$("#subNav").css({'display' : 'none'}) };
     
     $('#pageid1813 .widgetCTA, #pageid4814 .widgetCTA, #pageid4815 .widgetCTA, #pageid4816 .widgetCTA, #pageid4817 .widgetCTA, #pageid4818 .widgetCTA, #pageid5493 .widgetCTA, #pageid8073 .widgetCTA').addClass('propCTA');
     //jQuery Photo Gallery Magic!
     //Photo gallery widget conversion to shadowbox
     var galID = 0;
     
     //add ul to each photogallery
     $(".widgetPhotoGallery").each(function(){      
          
     $(this).append("<ul style='padding: 0;'></ul>").addClass("shadowBoxGallery").attr({ id: "gallery" + galID});

     $(this).find(".galleryImgThumb").each(function(){
     
          //the background image of the thumbnail's "A" tag, contains the actual thumbnail image.
          //let's steal that source
          var thumbnailSrc = $(this).css('backgroundImage');
          var thumbnailSrc = thumbnailSrc.replace('url(', '').replace(')', '');
          
          //the href of the thumbnail's "A" tag contains the link to the larger image.
          var largeImg = $(this).attr("href");
          
          //oh, and grab some title stuff
          var imgDesc = $(this).attr("title")
          
          //append <li>'s to the shadowbox container
          //the li includes the thumbnail, and a link to the larger image
          $("#gallery" + galID + " ul").append("<li class='shadowBoxThumbs'><a title='" + imgDesc + "' href=" + largeImg + " rel='shadowbox[gallery" + galID + "]'><img src=" + thumbnailSrc + " /></a></li>");
          
     });

galID += 1;

});

$(".shadowBoxThumbs").css({"list-style-type" : "none", "display" : "inline"});

//ditch the old photogallery
$(".galleryImgFullShell, .imgDescriptionShell, .imgPreviousNextShell, .imgThumbnailsOuterShell").remove();

//reinitialize shadowbox
//Shadowbox.setup();




//Add body class for current section
if ( $('#nav li.current').length != 0 ) {
     var currentParent = $("#footerNavLinks>li.current>a").html().replace(/ /g,'');
     currentParent = currentParent.replace('&amp;', '');
     $("body").addClass(currentParent);
     //alert('the body class is:' + currentParent);
}

Shadowbox.init({
     continuous: true
});


});
