$(document).ready(function() {
  $('.slideshow').cycle({
    fx: 'fade', // choose your transition type, ex: fade, scrollUp, shuffle, etc...
    timeout: 8000, 
    speed: 3000, 
    pause: 1, 
    pager:  '#slideshow-nav',
    pagerAnchorBuilder: function(idx, slide) {
      // return CSS selector string for existing anchor
      return '#slideshow-nav li:eq(' + (idx) + ') a';
    }
  });

  $('.vt-slideshow').cycle({
    fx: 'fade', // choose your transition type, ex: fade, scrollUp, shuffle, etc...
    timeout: 20000, 
    speed: 500, 
    pause: 1, 
    pager:  '#vt-nav',
    pagerAnchorBuilder: function(idx, slide) {
      // return CSS selector string for existing anchor
      return '#vt-nav li:eq(' + (idx) + ') a';
    }
  });

  function isANumber(text) {
    return text.match(/[0-9]+/);
  }

  $('.beds').each(function(index){
    var text = $(this).text();
    if (isANumber(text)) {
      var numberOfBeds = parseInt(text);
      if (numberOfBeds > 11) {
        $(this).addClass("available");
      } else if (numberOfBeds < 12) {
        $(this).addClass("part-available");
      }
    } else {
      $(this).addClass("full");
    }
  });
});

