﻿function unsetFieldValue(field, ifVal) {
  field = $(field);
  var str = field.val();
  if (str == ifVal) {
    field.val('');
  }
}

function setFieldValue(field, ifVal) {
  field = $(field);
  var str = field.val();
  if (trim(str) == '') {
    field.val(ifVal);
  }
}

function trim(str) {
  return str.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
}

$(document).ready(function(){
    // Tour Slide Down Menu
    $("#tourMenu").hide();
    
    $("#priNav ul li.cat a").toggle(function(){
	    $(this).addClass("active"); 
	    }, function () {
	    $(this).removeClass("active");
    });
    
    $("#priNav ul li.cat a").click(function(){
	    $("#tourMenu").slideToggle("slow,");
    });
    
    // Isle promo title hover
    var Duration = 150;
    $('.internalPromo h2 a').hover(function() {
    $(this).animate({ paddingTop: '10px' }, Duration);
    }, function() {
    $(this).animate({ paddingTop: '0px' }, Duration);
    });
    
    if ($('.mainImg').size() > 0) {
      $('.mainImg').cycle('fade');
    }
});



// Activites scroller
jQuery(document).ready(function () {
    // Show the destination list as hidden by default in css, hide the loader
    $("#activityDestinations ul").show();
    $(".activityDestinationsLoader").hide();
    // Initialise the first and second carousel by class selector.
    // Note that they use both the same configuration options (none in this case).
    jQuery('.first-and-second-carousel').jcarousel(
);
            jQuery('.carousel-scroll4').jcarousel(
            { scroll: 5, buttonNextEvent: "click", buttonPrevEvent: "click" }
);
            jQuery('.carousel-scroll8').jcarousel(
            { scroll: 7 }
);

    // If you want to use a caoursel with different configuration options,
    // you have to initialise it seperately.
    // We do it by an id selector here.
    jQuery('#third-carousel').jcarousel({
        vertical: true
    });
});

$(document).ready(function() { $('#features').jshowoff(); });
