//$(document).ready(function() {
$(window).load(function() {
   if ($("#combined #container").length > 0) {
       //$("#combined").addClass("jquery_scrollable_enabled");
      var do_scroll = ($.browser.msie && jQuery.browser.version.substr(0,1)=="6") ? false : true;
      if (do_scroll) {
         //init jquery tools scroller
         $("#container").scrollable({
            // vertical:true,
            size:1,
            hoverClass: 'hover'
         }).circular().navigator().mousewheel().autoscroll({
            steps: 1,
            interval: 7000,
            autopause: true,
            autoplay: true,
            api: true
         });
      }
   }
});
//do the following on dom ready
$(document).ready(function() {
   if ($("#thumbnails #album").length > 0) {
      var album_id = $("#thumbnails #album").attr("class").match(/\d/g).join("");
      $("#thumbnails").attr("style","text-align: center; min-height: 428px;");

      var flashvarobj = {};
         flashvarobj.preloader = {color: "0x4F121A", alpha: 0.5, height: 2};
         flashvarobj.options = {forceXScale: true, allowYCenter: false, display:{type: "cmsPgHeaders"},query:"?ALBUMID="+album_id+"&SORTBY=name"};
         flashvarobj.masking = {enabled: false};//,width,height
         flashvarobj.transition = {type: "crossfade", delay: 4500, duration:1.5};
         flashvarobj.navigation = {type: "None", position:{loc: "BM", xpad: 0, ypad: 0}};

      var params = {};
         params.quality = "high";
         params.wmode = "transparent";
         params.allowFullScreen = "false";
         params.allowScriptAccess = "sameDomain";
         params.menu = "false";
         params.scale = "false";
         params.bgcolor = "#1B2121";
         params.flashvars = "JSON="+escape($.toJSON(flashvarobj))+"&debug=false";

      var attributes = {};
         attributes.id = "flashSlideshow";
         attributes.name = "flashSlideshow";

      if (swfobject.hasFlashPlayerVersion("9.0.0")) {
         //only show flash if they have the correct player?
         swfobject.embedSWF("/flashplayer/php_slideshow_ui.swf", "album", 570, 428, "9.0.0","/flashplayer/expressInstall.swf", flashvarobj, params, attributes);
      }
   }
});
//--------------------------------------------
function _debug ($string) {
   try {
      console.log($string);
   } catch (err) {}
}