// Author: Chris Calon (koeus.com)
// About: Using jQuery to run all JS Functionality.
// No JS?: Backup measures have been taken into account
/*--------------------------------------------------------------------------------------------------*/
//Did you Know? ticket thing
var newsitems;
var curritem=0;
var iPause=0;
$(document).ready(function() {
// Row color alternator
// About: Zebra stripping for weather tables.
// No JS?: Not a big deal, data still there, just no alternating row colors
/*--------------------------------------------------------------------------------------------------*/
$('table.weather tbody tr:odd').addClass('odd');
$('table.weather tbody tr:even').addClass('even');
// Trip Dates Collapser
// About:
// No JS?:
/*--------------------------------------------------------------------------------------------------*/
var collapse = $('.tripdatescollapse ul li').size();
$('.tripdatescollapse ul li:gt(1)').hide();
$('.itinerary a').click(function() {
$('.seeall-wrapper').hide();
$('.tripdatescollapse ul li').show();
});
$('p.jsrequired').remove();
// Adventure Tags
// About: Adds comma to the end of every tags
// No JS?: no commans
/*--------------------------------------------------------------------------------------------------*/
$('a.tag:not(:last)').after(",");
// Form Input
// About: Styles Form Inputs
// No JS?:
/*--------------------------------------------------------------------------------------------------*/
$('input:text').addClass('form-input');
// PNG fix
// About:
// No JS?: Images will look funny
/*-------------------------------------------------------------------------------------------------*/
var ie6 = $.browser.msie && typeof XMLHttpRequest == 'function';
if (ie6) {
$(document).pngFix();
}
// Image Lightboxes
// About: If images exist inside content-details area, wrap lightbox around them.
// No JS?:
/*--------------------------------------------------------------------------------------------------*/
$('#content-details img, img.fancybox').each(function() {
var title = $(this).attr("alt");
var href = $(this).attr("src").replace("thumbs", "images");
$(this).wrap('');
});
// Fancy Boxes
// About: Fancy Boxes
// No JS?: Images show, but no click.
/*--------------------------------------------------------------------------------------------------*/
$('.fancybox').fancybox({
'overlayShow': true
});
// Slideshows
// About: If slideshow exists, run the cycle
// No JS?:
/*--------------------------------------------------------------------------------------------------*/
$('#slideshow').html('


');
$('#slideshow-home').html('






');
$('#slideshow-home').cycle({
fx: 'fade',
speed: 1000,
timeout: 3000
});
$('#slideshow').cycle({
fx: 'fade',
speed: 4000,
timeout: 3000,
random: 1
});
// Validate Form
// About: Validate the Inquiry form to make sure email address is complete,and phone numbe entered
// No JS?: Will not break, and people will be able to circumvent form.
/*--------------------------------------------------------------------------------------------------*/
if ($('#inquire').size() > 0) {
$("#inquire").validate({
rules: {
Realname: "required",
Email: "required",
Phone: "required",
Name: {
required: true,
minlength: 2
},
Email: {
required: true,
email: true
},
Phone: {
required: true,
minlength: 10
}
},
messages: {
Realname: "Please enter your name",
Email: "Please enter a valid email address",
Phone: "Please enter a valid 10 digit phone number"
}
});
}
// Booking Validate Form
// About: Validate the Booking form to make sure email address is complete,and phone numbe entered
// No JS?: Will not break, and people will be able to circumvent form.
/*--------------------------------------------------------------------------------------------------*/
if ($('#booking').size() > 0) {
$("#booking").validate({
rules: {
name_title: "required",
name_first: "required",
name_last: "required",
gender: "required",
email: "required",
phone: "required",
phone_work: "required",
phone_mobile: "required",
address: "required",
city: "required",
state: "required",
country: "required",
postcode: "required",
passport_no: "required",
passport_country: "required",
dateofbirth: "required",
passport_date_issue: "required",
passport_date_expirey: "required",
flights_arrival_date: "required",
flights_arrival_time: "required",
flights_arrival_flight_number: "required",
flights_departure_date: "required",
flights_departure_time: "required",
flights_departure_flight_number: "required",
medical_major_illness: "required",
medical_allergies: "required",
other_conditions_medication: "required",
kin_name: "required",
kin_relationship: "required",
kin_phone: "required",
insurance_company: "required",
insurance_policy_number: "required",
insurance_contact: "required",
special_travlling_together: "required",
special_room_type_single_double_twin: "required",
special_requested_shirt_size: "required",
special_requested_bike_size: "required",
special_diet: "required",
special_additional_questions: "required",
terms: "required"
}
});
}
// Round all corners
// About:
// No JS?:
/*--------------------------------------------------------------------------------------------------*/
$('#content').corner({
tl: { radius: 6 },
tr: { radius: 6 },
bl: false,
br: false,
antiAlias: true,
autoPad: true,
validTags: ["div"] });
$('#updated').corner({
tl: { radius: 8 },
tr: { radius: 8 },
bl: { radius: 8 },
br: { radius: 8 },
antiAlias: true,
autoPad: true,
validTags: ["div"]
});
// News Ticker on Left
// About:
// No JS?:
/*--------------------------------------------------------------------------------------------------*/
$('#dyk-ticker').cycle({
fx: 'fade',
speed: 1000,
timeout: 4000,
random: 1
});
// Submenu
// About:
// No JS?:
/*--------------------------------------------------------------------------------------------------*/
if ($('ul.submenu').size() > 0) {
var tabContainers = $('#container > div');
$('ul.submenu').tabs({ fxSlide: true, fxFade: true, fxSpeed: 'slow' });
$('ul.submenu a:first').addClass('active');
$('ul.submenu a').click(function() {
if ($(this).attr('className') != "active") {
$('ul.submenu a').removeClass('active');
$(this).addClass('active');
return false;
}
});
}
// Dates
// About:
// No JS?:
/*--------------------------------------------------------------------------------------------------*/
if ($('#panel').size() > 0) {
if ($('.on-demand').size() > 0) {
var onDemandLink = $('.bookthistrip a').attr("href");
$('.on-demand').attr({'href':onDemandLink});
} else {
var tripTitle = $('div.upcomingdates').attr('title');
$('div.upcomingdates').prepend('
| Expect moderate walking and/or light cycling | |
| Expect three to five hours of moderate daily activity. Some experience with the trip focused activity would be beneficial. | |
| An effort level of three indicates 3 to 7 hours per day of exercise. It is expected that participants have significant recent experience with the primary trip activities. | |
| At this level participants will challenged by up to 8 hours per day of strenuous hiking or cycling. Participants should be very physically fit and fully competent in the trip activities. | |
| Level five is like level four but with more days of excitement. |