
/* ==============  HOMEPAGE UI  ======================= */

$(function() {


	$('#mast_banner_cycle').cycle({
	    fx:    'fade',
	    timeout:       7000, 
	    speed:         750,   
	    next:          '#mast_banner_next',  
	    prev:          '#mast_banner_prev',  
	    pause:         1,
	    pauseOnPagerHover: 1,
	    pager:         '#mast_banner_pager',
	    
		fastOnEvent:   0,
	    manualTrump:   true,
	    cleartype:  1 // enable cleartype corrections
	    
	});
	
	$('#collections_slides').cycle({
	    fx:    		'fade',
	    timeout:       10000,
	    speed:         500,  
	    next:          '#collections_next',  
	    prev:          '#collections_prev',  
	    pause:         1,    
		fastOnEvent:   0,
	    manualTrump:   true,
	    cleartype:  1, 
	    
	    pager:  '#collections_slidenav', 
	    pauseOnPagerHover: 1
	    
	});
	
		
	$('#about_us_slides').cycle({
	    fx:    		'fade',
	    timeout:       15000,
	    speed:         500,  
	    next:          '#about_us_next',  
	    prev:          '#about_us_prev',  
	    pause:         1,    
		fastOnEvent:   0,
	    manualTrump:   true,
	    cleartype:  1, 
	    
	    pager:  '#about_us_slidenav', 
	    pauseOnPagerHover: 1, 
	    
	    before: onBefore
	    
	});
	
	$('#about_us_pg1').click(function() { 
	        $('#about_us_slidenav a:eq(0)').trigger('click'); 
	        return false; 
	});
	$('#about_us_pg2').click(function() { 
	        $('#about_us_slidenav a:eq(1)').trigger('click'); 
	        return false; 
	});
	$('#about_us_pg3').click(function() { 
	        $('#about_us_slidenav a:eq(2)').trigger('click'); 
	        return false; 
	});
	$('#about_us_pg4').click(function() { 
	        $('#about_us_slidenav a:eq(3)').trigger('click'); 
	        return false; 
	});


});

function onBefore() {
	
	var page_num = $(this).parent().children().index(this) + 1; 
			
	$('.about_us_pg_link').css("background","transparent");
	$('.about_us_pg_link').css("color","#3A4F71");
	$('.about_us_pg_link').css("cursor","pointer");	

	$('#about_us_pg' + page_num).css("background","#3A4F71 url(http://www.myescapades.com/images/site_elements/tabs_bar_grad_blue.png) repeat-x");
	$('#about_us_pg' + page_num).css("color","#fff");


}


function mycarousel_initCallback(carousel)
{
    // Disable autoscrolling if the user clicks the prev or next button.
    carousel.buttonNext.bind('click', function() {
        carousel.startAuto(0);
    });

    carousel.buttonPrev.bind('click', function() {
        carousel.startAuto(0);
    });

    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });
};


jQuery(document).ready(function() {
    jQuery('#featured_tours').jcarousel({
        // Configuration goes here
        
        wrap: 'last',
        scroll: 1,
        auto: 8, 
        animation: 500,
        initCallback: mycarousel_initCallback
        
    });
});

jQuery(document).ready(function() {
    jQuery('#about_us_jcarousel').jcarousel({
        // Configuration goes here
        
        vertical: true,
        animation: 'slow'
        
    });
});


/* ==============  GLOBAL UI  ======================= */

$(function() {

	
	$(".checkbox_category_filter").click(function(){	
		var category_id = $(this).attr("value");		
		$('#list_category_' + category_id).toggle();
		
	});

	
	$("#search_masthead_keyword").Watermark("Search...");
	$("#search_keyword_banner").Watermark("What do you want to experience?","#bbb");
	$("#mailing_list_email").Watermark("Enter your email address","#bbb");
	
	$("#reservations_name").Watermark("Enter your name","#bbb");
	$("#reservations_email").Watermark("Enter your email address","#bbb");
	$("#reservations_phone").Watermark("Enter your phone number","#bbb");

	$("#name").Watermark("Enter your name","#bbb");
	$("#email").Watermark("Enter your email address","#bbb");
	$("#phone").Watermark("Enter your phone number","#bbb");
	$("#tour_departure_date").Watermark("Enter your preferred departure date","#bbb");


	// ASK-A-QUESTION FORM 


		
	// prepare Options Object 
		var ajaxform_options = {  
		    
		    beforeSubmit: validate_it
		    
		}; 
			 
		// pass options to ajaxForm 
		$("#enquiry").ajaxForm(ajaxform_options);
	
	
		var ajaxsubmit_options = {  
		    
		    success:    function() { 
		        
		        
				$('#enquiry').css('display', 'none');
				$('#contact_intro').css('display', 'none');
				$('#form_success').css('display', 'block');
				$('#form_success').html('<h1>Thank you.</h1><p>Your message has been sent. </p><p>One of our agents will contact you in the shortest possible time. It is indeed our pleasure to serve you.</p>');
				
		    }
		    
		}; 
					

	$("#enquiry").validate({
			   submitHandler: function(form) {
			  
		
			   var strClean = $("#message").val().replace(/\n/g, "<br>");
				$("#message").attr("value", strClean);
						
							   	
				$('.contact_form input[type=submit]').attr('value', 'Sending...');
				$('.contact_form input[type=submit]').css('background', 'none');
				$('.contact_form input[type=submit]').css('background-color', '#bbbbbb');
				$('.contact_form select').attr('disabled', 'disabled');
				$('.contact_form input[type=text]').attr('readonly', 'readonly');
				$('.contact_form input[type=text]').css('color', '#bbbbbb');
				$('.contact_form textarea').css('color', '#bbbbbb');
				$('.contact_form input[type=checkbox]').attr('disabled', 'disabled');
				$('.contact_form textarea').attr('readonly', 'readonly');

				$("#enquiry").ajaxSubmit(ajaxsubmit_options);
				
			   	scrollTo('contact_form');
			   	
				return false; 
		   		}
		});
		
		
	function validate_it(formData, jqForm, options) {

		
		if ($('#name').val() == "Enter your name") {
			$('#name').attr('value','')
		}
	
		var newsletter_check = $('#newsletter_check').attr('checked');
		var special_offers_check = $('#special_offers_check').attr('checked');
		
		if (newsletter_check) {	
			$('#newsletter_signup').attr('value','newsletter');
		}
		
		if (special_offers_check) {	
			$('#special_offers_signup').attr('value','special_offers'); 				
		}
				
		$("#enquiry").validate().form();
		
		return false; 

	};	
	

	// RESERVATION FORM 

		
	// prepare Options Object 
		var ajaxform_options_reservation = {  
		    
		    beforeSubmit: validate_it_reservation
		    
		}; 
			 
		// pass options to ajaxForm 
		$("#reservation").ajaxForm(ajaxform_options_reservation);
	
	
		var ajaxsubmit_options_reservation = {  
		    
		    
		    success:    function() { 
		        
				$('#reservation').css('display', 'none');
				$('#reservation_form_success').css('display', 'block');
				$('#reservation_form_success').html('<h1>Thank you.</h1><p>Your request has been sent. </p><p>We will check availability for the tour dates requested and contact you in the shortest possible time. It is indeed our pleasure to serve you. </p>');
				
		    }
		    
		}; 


	$("#reservation").validate({
			   submitHandler: function(form) {
			   
			   var strClean = $("#reservations_message").val().replace(/\n/g, "<br>");
				$('.reservations_form textarea').attr("value", strClean);
				
				$('.reservations_form input[type=submit]').attr('value', 'Sending...');
				$('.reservations_form input[type=submit]').css('background', 'none');
				$('.reservations_form input[type=submit]').css('background-color', '#bbbbbb');
				$('.reservations_form input[type=text]').attr('readonly', 'readonly');
				$('.reservations_form input[type=text]').css('color', '#bbbbbb');
				$('.reservations_form textarea').css('color', '#bbbbbb');
				$('.reservations_form textarea').attr('readonly', 'readonly');
				
				$("#reservation").ajaxSubmit(ajaxsubmit_options_reservation);
				
			   	scrollTo('reservations_form');
			   				   
				return false; 
		   		}
		});
		
	function validate_it_reservation(formData, jqForm, options) {

		if ($('#reservations_name').val() == "Enter your name") {
			$('#reservations_name').attr('value','');
		}
		
		if ($('#reservations_phone').val() == "Enter your phone number") {
			$('#reservations_phone').attr('value','');
		}
	
		var newsletter_check = $('#newsletter_check').attr('checked');
		var special_offers_check = $('#special_offers_check').attr('checked');
		
		if (newsletter_check) {	
			$('#newsletter_signup').attr('value','newsletter');
		}
		
		if (special_offers_check) {	
			$('#special_offers_signup').attr('value','special_offers'); 				
		}
				
		$("#reservation").validate().form();
		
		return false; 

	};	
	


	




	// MAILING LIST JOIN FORM 
		
	// prepare Options Object 
		var ajax_options_mailinglist = {  
		    
		    beforeSubmit: validate_it_mailinglist,
		    
		    success:    function() { 
		     
				$('#mailing_list_form').css('display', 'none');
				$('#mailing_list_form_success').css('display', 'block');
				$('#mailing_list_form_success').html('<h5>Thanks for joining.</h5><p>Check your email to confirm your subscription.</p>');
				
				return false;
		    }
		    
		}; 
		
		var ajaxsubmit_options_mailinglist = {  
		    
		    success:    function() { 
		     
				$('#mailing_list_form').css('display', 'none');
				$('#mailing_list_form_success').css('display', 'block');
				$('#mailing_list_form_success').html('<h5>Thanks for joining.</h5><p>Check your email to confirm your subscription.</p>');
				
				return false;
		    }
		    
		}; 
		
				 
		// pass options to ajaxForm 
		$("#nav_mailinglist").ajaxForm(ajax_options_mailinglist);
	
	
	$("#nav_mailinglist").validate({
			   submitHandler: function(form) {
			   
			
			   	
				$('#nav_mailinglist input[type=submit]').attr('value', 'Sending...');
				$('#nav_mailinglist input[type=submit]').attr('disabled', 'disabled');
				$('#nav_mailinglist input[type=submit]').css('background', 'none');
				$('#nav_mailinglist input[type=submit]').css('background-color', '#bbbbbb');
				$('#nav_mailinglist input[type=text]').attr('readonly', 'readonly');
				$('#nav_mailinglist input[type=text]').css('color', '#bbbbbb');
				
			   	$(form).ajaxSubmit(ajaxsubmit_options_mailinglist);
			
				return false;
				
		   		}, 
		   		
		   		invalidHandler: function(form, validator) {
		   		
		   		return false; 
		   		
		   		}
		});
		
	function validate_it_mailinglist(formData, jqForm, options) {
						   
		return false; 
		
	};



	// BANNER SEARCH FORM 
		
	$("#search_form_banner").validate({
			   submitHandler: function(form) {
			   
			   if ($('#search_keyword_banner').val() == "What do you want to experience?" || $('#search_keyword_banner').val() == "") {
					
					$("#search_submit_banner").css('display','none');
					$("#search_submit_banner_loading").css('display','inline');
					
					location.href="http://www.myescapades.com/travel";
					

				} else {
					
					$("#search_submit_banner").css('display','none');
					$("#search_submit_banner_loading").css('display','inline');
		
					form.submit();
					
				}
		
				
		   		}
		});



		
	$("#date_departure").datepicker({ 
	
	dateFormat: 'DD, MM d, yy',
	altFormat: 'yy-mm-dd',
	defaultDate: +30,
	numberOfMonths: [1, 3],
	hideIfNoPrevNext: true,
	maxDate: '+1y 6m',
	minDate: '7d',
	changeMonth: true, 
	changeYear: false, 
	onSelect: function(dateText, inst) { 
   		
   		$('#date_selected').html(dateText);
   		$('#tour_departure_date').attr('value',dateText);
   		$('#tour_departure_date').css('color','#932626');
   		$('#date_departure').hide();
   		$('#date_select_departure').show();
   		
   		 }
	});
	


		
		
			
	var search_keywords = [ {text:'Short Stays', url:'http://www.myescapades.com/travel/collections/short_stays'}, {text:'Classics', url:'http://www.myescapades.com/travel/collections/classics'}, {text:'Journeys', url:'http://www.myescapades.com/travel/collections/journeys'}, {text:'Air & Land Inclusive', url:'http://www.myescapades.com/travel/collections/air_land_inclusive'}, {text:'Small Groups', url:'http://www.myescapades.com/travel/collections/small_groups'}, {text:'Adventures', url:'http://www.myescapades.com/travel/collections/adventures'}, {text:'Beach Holidays', url:'http://www.myescapades.com/travel/collections/beach_holidays'}, {text:'City Getaways', url:'http://www.myescapades.com/travel/collections/city_getaways'}, {text:'Cruises', url:'http://www.myescapades.com/travel/collections/cruises'}, {text:'Game Lodges', url:'http://www.myescapades.com/travel/collections/game_lodges'}, {text:'History & Culture', url:'http://www.myescapades.com/travel/collections/history_and_culture'}, {text:'Romantic Getaways', url:'http://www.myescapades.com/travel/collections/romantic_getaways'}, {text:'Safaris', url:'http://www.myescapades.com/travel/collections/safaris'}, {text:'Sand Dunes', url:'http://www.myescapades.com/travel/collections/sand_dunes'}, {text:'Train Journeys', url:'http://www.myescapades.com/travel/collections/train_journeys'}, {text:'Luxury Accommodations', url:'http://www.myescapades.com/travel/collections/luxury_accommodations'}, {text:'Luxury Safaris', url:'http://www.myescapades.com/travel/collections/luxury_safaris'}, {text:'Luxury Train Journeys', url:'http://www.myescapades.com/travel/collections/luxury_train_journeys'}, {text:'Private Game Lodges', url:'http://www.myescapades.com/travel/collections/private_game_lodges'}, {text:'Gorilla Trekking', url:'http://www.myescapades.com/travel/collections/gorilla_trekking'}, {text:'Kilimanjaro Climbs', url:'http://www.myescapades.com/travel/collections/kilimanjaro_climbs'}, {text:'Nile Cruise', url:'http://www.myescapades.com/travel/collections/nile_cruise'}, {text:'Rovos Rail', url:'http://www.myescapades.com/travel/collections/rovos_rail'}, {text:'Shongololo Express', url:'http://www.myescapades.com/travel/collections/shongololo_express'}, {text:'The Blue Train', url:'http://www.myescapades.com/travel/collections/the_blue_train'}, {text:'Russia & Ukraine', url:'http://www.myescapades.com/travel/destinations/russia_and_ukraine'}, {text:'The Middle East', url:'http://www.myescapades.com/travel/destinations/the_middle_east'}, {text:'Asia', url:'http://www.myescapades.com/travel/destinations/asia'}, {text:'Africa', url:'http://www.myescapades.com/travel/destinations/africa'}, {text:'Thailand', url:'http://www.myescapades.com/travel/destinations/asia/thailand'}, {text:'Jordan', url:'http://www.myescapades.com/travel/destinations/the_middle_east/jordan'}, {text:'Russia', url:'http://www.myescapades.com/travel/destinations//russia'}, {text:'Oman', url:'http://www.myescapades.com/travel/destinations/the_middle_east/oman'}, {text:'Israel', url:'http://www.myescapades.com/travel/destinations/the_middle_east/israel'}, {text:'United Arab Emirates', url:'http://www.myescapades.com/travel/destinations/the_middle_east/united_arab_emirates'}, {text:'Nepal', url:'http://www.myescapades.com/travel/destinations/asia/nepal'}, {text:'Rwanda', url:'http://www.myescapades.com/travel/destinations/africa/rwanda'}, {text:'Mauritius', url:'http://www.myescapades.com/travel/destinations/africa/mauritius'}, {text:'Zimbabwe', url:'http://www.myescapades.com/travel/destinations/africa/zimbabwe'}, {text:'Malawi', url:'http://www.myescapades.com/travel/destinations/africa/malawi'}, {text:'Kenya', url:'http://www.myescapades.com/travel/destinations/africa/kenya'}, {text:'Tanzania', url:'http://www.myescapades.com/travel/destinations/africa/tanzania'}, {text:'Mozambique', url:'http://www.myescapades.com/travel/destinations/africa/mozambique'}, {text:'Morocco', url:'http://www.myescapades.com/travel/destinations/africa/morocco'}, {text:'Egypt', url:'http://www.myescapades.com/travel/destinations/africa/egypt'}, {text:'South Africa', url:'http://www.myescapades.com/travel/destinations/africa/south_africa'}, {text:'Botswana', url:'http://www.myescapades.com/travel/destinations/africa/botswana'}, {text:'Seychelles', url:'http://www.myescapades.com/travel/destinations/africa/seychelles'}, {text:'Zambia', url:'http://www.myescapades.com/travel/destinations/africa/zambia'}, {text:'Namibia', url:'http://www.myescapades.com/travel/destinations/africa/namibia'}, {text:'Tunisia', url:'http://www.myescapades.com/travel/destinations/africa/tunisia'}, {text:'India', url:'http://www.myescapades.com/travel/destinations/asia/india'}, {text:'Bhutan', url:'http://www.myescapades.com/travel/destinations/asia/bhutan'}, {text:'Sun City', url:'http://www.myescapades.com/travel/destinations/africa/south_africa/sun_city4'}, {text:'Shongololo &ndash; The Dune Express', url:'http://www.myescapades.com/travel/destinations/africa/south_africa/shongololo_the_dune_express'}, {text:'Exclusive Encounters', url:'http://www.myescapades.com/travel/destinations/africa/south_africa/exclusive_encounters'}, {text:'Wildlife Discovery', url:'http://www.myescapades.com/travel/destinations/africa/south_africa/wildlife_discovery'}, {text:'Israel  Kaleidoscope', url:'http://www.myescapades.com/travel/destinations/the_middle_east/israel/israel_kaleidoscope'}, {text:'Classic Israel  ', url:'http://www.myescapades.com/travel/destinations/the_middle_east/israel/classic_israel'}, {text:'Egyptian Panorama', url:'http://www.myescapades.com/travel/destinations/africa/egypt/egyptian_panorama'}, {text:'Past & Present', url:'http://www.myescapades.com/travel/destinations/africa/egypt/past_present'}, {text:'A Private Experience', url:'http://www.myescapades.com/travel/destinations/africa/kenya/a_private_experience'}, {text:'Diverse Kenya', url:'http://www.myescapades.com/travel/destinations/africa/kenya/diverse_kenya'}, {text:'Cairo Getaway', url:'http://www.myescapades.com/travel/destinations/africa/egypt/cairo_getaway'}, {text:'Kalahari Epic', url:'http://www.myescapades.com/travel/destinations/africa/botswana/kalahari_epic'}, {text:'Egyptian Riches ', url:'http://www.myescapades.com/travel/destinations/africa/egypt/egyptian_riches'}, {text:'Kenya Wildlife Trails', url:'http://www.myescapades.com/travel/destinations/africa/kenya/kenya_wildlife_trails'}, {text:'Holyland Tour', url:'http://www.myescapades.com/travel/destinations/the_middle_east/israel/holyland_tour'}, {text:'The Best Of Israel Plus Petra', url:'http://www.myescapades.com/travel/destinations/the_middle_east/israel/the_best_of_israel_plus_petra'}, {text:'Biblical Journey', url:'http://www.myescapades.com/travel/destinations/the_middle_east/israel/biblical_journey'}, {text:'Jewels of the  Emirates', url:'http://www.myescapades.com/travel/destinations/the_middle_east/united_arab_emirates/jewels_of_the_emirates'}, {text:'Exploring The Emirates', url:'http://www.myescapades.com/travel/destinations/the_middle_east/united_arab_emirates/exploring_the_emirates'}, {text:'East Africa Migration Safari', url:'http://www.myescapades.com/travel/destinations/africa/kenya/east_africa_migration_safari'}, {text:'Nabatean Wonder', url:'http://www.myescapades.com/travel/destinations/the_middle_east/jordan/nabatean_wonder'}, {text:'Classic Jordan', url:'http://www.myescapades.com/travel/destinations/the_middle_east/jordan/classic_jordan'}, {text:'Jordan Explorer', url:'http://www.myescapades.com/travel/destinations/the_middle_east/jordan/jordan_explorer'}, {text:'Jordan Overview', url:'http://www.myescapades.com/travel/destinations/the_middle_east/jordan/jordan_overview'}, {text:'Thailand Treasures', url:'http://www.myescapades.com/travel/destinations/asia/thailand/thailand_treasures'}, {text:'Thai Silks', url:'http://www.myescapades.com/travel/destinations/asia/thailand/thai_silks'}, {text:'Northern Vistas ', url:'http://www.myescapades.com/travel/destinations/asia/thailand/northern_vistas'}, {text:'Goa Getaway', url:'http://www.myescapades.com/travel/destinations/asia/india/goa_getaway'}, {text:'Dubai Getaway ', url:'http://www.myescapades.com/travel/destinations/the_middle_east/united_arab_emirates/dubai_getaway'}, {text:'Abu Dhabi Getaway', url:'http://www.myescapades.com/travel/destinations/the_middle_east/united_arab_emirates/abu_dhabi_getaway'}, {text:'Oman From North To South', url:'http://www.myescapades.com/travel/destinations/the_middle_east/oman/oman_from_north_to_south'}, {text:'Cultural Oman', url:'http://www.myescapades.com/travel/destinations/the_middle_east/oman/cultural_oman'}, {text:'Classic Tour of Oman', url:'http://www.myescapades.com/travel/destinations/the_middle_east/oman/classic_tour_of_oman'}, {text:'Discovering Oman', url:'http://www.myescapades.com/travel/destinations/the_middle_east/oman/discovering_oman'}, {text:'Fujairah Getaway', url:'http://www.myescapades.com/travel/destinations/the_middle_east/united_arab_emirates/fujairah_getaway'}, {text:'Kolkata Getaway', url:'http://www.myescapades.com/travel/destinations/asia/india/kolkata_getaway'}, {text:'Cochin Getaway', url:'http://www.myescapades.com/travel/destinations/asia/india/cochin_getaway'}, {text:'Hyderabad Getaway', url:'http://www.myescapades.com/travel/destinations/asia/india/hyderabad_getaway'}, {text:'Chennai Getaway', url:'http://www.myescapades.com/travel/destinations/asia/india/chennai_getaway'}, {text:'Mumbai Getaway', url:'http://www.myescapades.com/travel/destinations/asia/india/mumbai_getaway'}, {text:'Delhi Getaway', url:'http://www.myescapades.com/travel/destinations/asia/india/delhi_getaway'}, {text:'Bangalore Getaway', url:'http://www.myescapades.com/travel/destinations/asia/india/bangalore_getaway'}, {text:'Splendours of South India', url:'http://www.myescapades.com/travel/destinations/asia/india/splendours_of_south_india'}, {text:'Indian Kaleidoscope', url:'http://www.myescapades.com/travel/destinations/asia/india/indian_kaleidoscope'}, {text:'Temples & Tigers', url:'http://www.myescapades.com/travel/destinations/asia/india/temples_and_tigers'}, {text:'Rajasthan Heritage', url:'http://www.myescapades.com/travel/destinations/asia/india/rajasthan_heritage'}, {text:'Golden Triangle', url:'http://www.myescapades.com/travel/destinations/asia/india/golden_triangle'}, {text:'Desert Safari Experience', url:'http://www.myescapades.com/travel/destinations/africa/tunisia/desert_safari_experience'}, {text:'Port El Kantaoui Beach Holiday', url:'http://www.myescapades.com/travel/destinations/africa/tunisia/port_el_kantaoui_beach_holiday15'}, {text:'Private Game Lodges by Road ', url:'http://www.myescapades.com/travel/destinations/africa/south_africa/private_game_lodges_by_road'}, {text:'Migration Routes', url:'http://www.myescapades.com/travel/destinations/africa/botswana/migration_routes'}, {text:'From The Falls To The Delta', url:'http://www.myescapades.com/travel/destinations/africa/botswana/from_the_falls_to_the_delta'}, {text:'Great Trek Adventure', url:'http://www.myescapades.com/travel/destinations/africa/botswana/great_trek_adventure'}, {text:'Port El Kantaoui Beach Holiday', url:'http://www.myescapades.com/travel/destinations/africa/tunisia/port_el_kantaoui_beach_holiday8'}, {text:'Rivers of Zambia', url:'http://www.myescapades.com/travel/destinations/africa/zambia/rivers_of_zambia'}, {text:'Kalahari Sands', url:'http://www.myescapades.com/travel/destinations/africa/botswana/kalahari_sands'}, {text:'Hammamet Beach Holiday', url:'http://www.myescapades.com/travel/destinations/africa/tunisia/hammamet_beach_holiday15'}, {text:'Hammamet Beach Holiday', url:'http://www.myescapades.com/travel/destinations/africa/tunisia/hammamet_beach_holiday8'}, {text:'Dian Fosseys Gorilla', url:'http://www.myescapades.com/travel/destinations/africa/rwanda/dian_fosseys_gorilla'}, {text:'Gorillas Plus Primates', url:'http://www.myescapades.com/travel/destinations/africa/rwanda/gorillas_plus_primates'}, {text:'Gorillas at their Best ', url:'http://www.myescapades.com/travel/destinations/africa/rwanda/gorillas_at_their_best'}, {text:'Meeting Mountain Gorillas', url:'http://www.myescapades.com/travel/destinations/africa/rwanda/meeing_mountain_gorillas'}, {text:'South African Essentials', url:'http://www.myescapades.com/travel/destinations/africa/south_africa/south_african_essentials'}, {text:'Botswana Magic', url:'http://www.myescapades.com/travel/destinations/africa/botswana/botswana_magic'}, {text:'East Africa Explorer', url:'http://www.myescapades.com/travel/destinations/africa/kenya/east_africa_explorer'}, {text:'Magic of Morocco', url:'http://www.myescapades.com/travel/destinations/africa/morocco/magic_of_morocco'}, {text:'Tunisia Explorer', url:'http://www.myescapades.com/travel/destinations/africa/tunisia/tunisia_explorer'}, {text:'Tunisia Wonders', url:'http://www.myescapades.com/travel/destinations/africa/tunisia/tunisia_wonders'}, {text:'Kenya At Its Best', url:'http://www.myescapades.com/travel/destinations/africa/kenya/kenya_at_its_best'}, {text:'South Africa Discovery', url:'http://www.myescapades.com/travel/destinations/africa/south_africa/south_africa_discovery'}, {text:'Magnificent Garden Route', url:'http://www.myescapades.com/travel/destinations/africa/south_africa/magnificent_garden_route'}, {text:'Kruger Park Breakaway', url:'http://www.myescapades.com/travel/destinations/africa/south_africa/kruger_park_breakaway'}, {text:'Sossusvlei Adventure', url:'http://www.myescapades.com/travel/destinations/africa/namibia/sossusvlei_adventure'}, {text:'Etosha National Park', url:'http://www.myescapades.com/travel/destinations/africa/namibia/etosha_national_park'}, {text:'Wildlife Extravaganza', url:'http://www.myescapades.com/travel/destinations/africa/kenya/wildlife_extravaganza'}, {text:'Rovos Rail &ndash; Pride of Africa Namibia', url:'http://www.myescapades.com/travel/destinations/africa/namibia/rovos_rail_pride_of_africa_namibia'}, {text:'Rovos Rail &ndash; African Collage', url:'http://www.myescapades.com/travel/destinations/africa/south_africa/rovos_rail_african_collage'}, {text:'Rovos Rail &ndash; Cape Town to Pretoria', url:'http://www.myescapades.com/travel/destinations/africa/south_africa/rovos_rail_cape_town_pretoria'}, {text:'Kenyan Kaleidoscope', url:'http://www.myescapades.com/travel/destinations/africa/kenya/kenyan_kaleidoscope'}, {text:'Big Five Safari', url:'http://www.myescapades.com/travel/destinations/africa/kenya/big_five_safari'}, {text:'Rovos Rail &ndash; Pretoria to Victoria Falls', url:'http://www.myescapades.com/travel/destinations/africa/south_africa/rovos_rail_pretoria_victoria_falls'}, {text:'Rovos Rail &ndash; Pretoria to Durban', url:'http://www.myescapades.com/travel/destinations/africa/south_africa/rovos_rail_pretoria_durban'}, {text:'Rovos Rail &ndash; Cape Town to Dar Es Salaam', url:'http://www.myescapades.com/travel/destinations/africa/botswana/rovos_rail_cape_town_to_dar_es_salaam'}, {text:'The Cape, Winelands & Wildlife', url:'http://www.myescapades.com/travel/destinations/africa/south_africa/the_cape_winelands_wildlife'}, {text:'Zanzibar Island Stay', url:'http://www.myescapades.com/travel/destinations/africa/tanzania/zanzibar_island_stay'}, {text:'Shongololo &ndash; The Good Hope ', url:'http://www.myescapades.com/travel/destinations/africa/south_africa/shongololo_the_good_hope'}, {text:'Shongololo &ndash; The Southern Cross', url:'http://www.myescapades.com/travel/destinations/africa/south_africa/shongololo_the_southern_cross'}, {text:'A Taste of the Cape', url:'http://www.myescapades.com/travel/destinations/africa/south_africa/a_taste_of_the_cape'}, {text:'Classic Tanzania', url:'http://www.myescapades.com/travel/destinations/africa/tanzania/classic_tanzania'}, {text:'Private Game Lodges by Air to Hoedspruit', url:'http://www.myescapades.com/travel/destinations/africa/south_africa/private_game_lodges_by_air_to_hoedspruit'}, {text:'Private Game Lodges by Air to Mpumalanga ', url:'http://www.myescapades.com/travel/destinations/africa/south_africa/private_game_lodges_by_air_to_mpumalanga'}, {text:'Marangu Route Kilimanjaro Climb  ', url:'http://www.myescapades.com/travel/destinations/africa/tanzania/marangu_route_kilimanjaro_climb'}, {text:'Machame Route Kilimanjaro Climb  ', url:'http://www.myescapades.com/travel/destinations/africa/tanzania/machame_route_kilimanjaro_climb'}, {text:'Mauritius West, East & South West Island Stay', url:'http://www.myescapades.com/travel/destinations/africa/mauritius/mauritius_west_east_south_west_island_stay'}, {text:'Sun City', url:'http://www.myescapades.com/travel/destinations/africa/south_africa/sun_city'}, {text:'Mauritius North West Island Stay', url:'http://www.myescapades.com/travel/destinations/africa/mauritius/mauritius_north_west_island_stay'}, {text:'Flying Namibia', url:'http://www.myescapades.com/travel/destinations/africa/namibia/flying_namibia'}, {text:'Nile Antiquities', url:'http://www.myescapades.com/travel/destinations/africa/egypt/nile_antiquities'}, {text:'Egyptian Jewels ', url:'http://www.myescapades.com/travel/destinations/africa/egypt/egyptian_jewels'}, {text:'Pharaohs Phollies', url:'http://www.myescapades.com/travel/destinations/africa/egypt/pharaohs_phollies'}, {text:'Imperial Cities', url:'http://www.myescapades.com/travel/destinations/africa/morocco/imperial_cities'}, {text:'Johannesburg', url:'http://www.myescapades.com/travel/destinations/africa/south_africa/johannesburg'}, {text:'Cape Town', url:'http://www.myescapades.com/travel/destinations/africa/south_africa/cape_town_2'}, {text:'Blue Train &ndash; Pretoria to Cape Town ', url:'http://www.myescapades.com/travel/destinations/africa/south_africa/blue_train_pretoria_to_cape_town'}, {text:'Blue Train &ndash; Cape Town to Pretoria', url:'http://www.myescapades.com/travel/destinations/africa/south_africa/blue_train_cape_town_to_pretoria'}, {text:'Arts & Culture Experience', url:'http://www.myescapades.com/travel/destinations/africa/south_africa/arts_and_culture_experience'}, {text:'Royally South Africa', url:'http://www.myescapades.com/travel/destinations/africa/south_africa/royally_south_africa'}, {text:'Exploring South Africa', url:'http://www.myescapades.com/travel/destinations/africa/south_africa/exploring_south_africa'}, {text:'The Deep South ', url:'http://www.myescapades.com/travel/destinations/africa/morocco/the_deep_south'}, {text:'Casablanca Getaway', url:'http://www.myescapades.com/travel/destinations/africa/morocco/casablanca_getaway'}, {text:'Marrakech Getaway', url:'http://www.myescapades.com/travel/destinations/africa/morocco/marrakech_getaway'}, {text:'Cape to Kruger', url:'http://www.myescapades.com/travel/destinations/africa/south_africa/cape_to_kruger'}, {text:'Agadir Getaway', url:'http://www.myescapades.com/travel/destinations/africa/morocco/agadir_getaway'}, {text:'Romance the Isles', url:'http://www.myescapades.com/travel/destinations/africa/seychelles/romance_the_isles'}, {text:'La Digue Island stay', url:'http://www.myescapades.com/travel/destinations/africa/seychelles/la_digue_island_stay'}, {text:'Praslin Island stay', url:'http://www.myescapades.com/travel/destinations/africa/seychelles/praslin_island_stay'}, {text:'Mahe Island stay', url:'http://www.myescapades.com/travel/destinations/africa/seychelles/mahe_island_stay'}, {text:'Five Nations', url:'http://www.myescapades.com/travel/destinations/africa/botswana/five_nations'}, {text:'Southern Africa Jewels', url:'http://www.myescapades.com/travel/destinations/africa/namibia/southern_africa_jewels'}, {text:'Botswana Adventure Safari', url:'http://www.myescapades.com/travel/destinations/africa/botswana/botswana_adventure_safari'}, {text:'Victoria Falls & Chobe', url:'http://www.myescapades.com/travel/destinations/africa/botswana/victoria_falls_chobe'}, {text:'Victoria Falls', url:'http://www.myescapades.com/travel/destinations/africa/zimbabwe/victoria_falls'}, {text:'Livingstone, Chobe & Okavango', url:'http://www.myescapades.com/travel/destinations/africa/botswana/livingstone_chobe_okavango'}, {text:'Livingstone & Chobe', url:'http://www.myescapades.com/travel/destinations/africa/botswana/livingstone_chobe'}, {text:'Livingstone', url:'http://www.myescapades.com/travel/destinations/africa/zambia/livingstone'}, {text:'Dunes & Deserts', url:'http://www.myescapades.com/travel/destinations/africa/namibia/dunes_and_deserts'}, {text:'Classic Safari', url:'http://www.myescapades.com/travel/destinations/africa/kenya/classic_safari'}, {text:'', url:''} ];
	
	$("#search_keyword_banner").autocomplete(search_keywords, {
	  	width: 455,
		autoFill:false,
		matchContains: true,
		cacheLength: 400,
		delay:  0, 
		mustMatch: false,
		scrollHeight: 210,
		selectFirst: false,
	  formatItem: function(item) {
	    return item.text;
	  }
	}).result(function(event, item) {
	
		$("#search_submit_banner").css('display','none');
		$("#search_submit_banner_loading").css('display','inline');
		
	  location.href = item.url;
	});
	
	$("#search_keyword").autocomplete(search_keywords, {
		width: 242,
		scrollHeight: 500,
		autoFill:false,
		matchContains: true,
		cacheLength: 400,
		delay:  10, 
		mustMatch: false, 
		selectFirst: false, 
		formatItem: function(item) {
   			return item.text;
 		}
	}).result(function(event, item) {

		$("#search_submit").css('display','none');
		$("#search_submit_loading").css('display','inline');
		
  		location.href = item.url;
	});	
	
		
/* ==============  ACCORDIONS  ======================= */

	/* __________  accordion-nav_tree_destinations ___ */ 
	
	/*
	
	$("#accordion-nav_tree_destinations").accordion({ header: "h3", 			
		event: 'click',
		autoHeight: false, 
    	active: false,
    	collapsible: true  
	 });
	
	*/ 
	
	/* __________  accordion-nav_tree_collections ___ */ 
	
	/*
	
	$("#accordion-nav_tree_collections").accordion({ header: "h3", 			
		event: 'click',
		autoHeight: false, 
		active: false, 
    	collapsible: true  
	 });
	 	 
	*/ 
	
	/* __________  accordion-tour_budget_01 ___ */ 
	$("#accordion-tour_budget_01").accordion({ header: "h3", 			
		event: 'click',
 		autoHeight: false, 
 		collapsible: false
	 });

	/* __________  accordion-tour_budget_02 ___ */ 
	$("#accordion-tour_budget_02").accordion({ header: "h3", 			
		event: 'click',
		autoHeight: false, 
		collapsible: false
	 });	 

	/* __________  accordion-tour_budget_03 ___ */ 
	$("#accordion-tour_budget_03").accordion({ header: "h3", 			
		event: 'click',
		autoHeight: false, 
		collapsible: false
	 });	
	 
	 /* __________  accordion-tour_budget_04 ___ */ 
	$("#accordion-tour_budget_04").accordion({ header: "h3", 			
		event: 'click',
		autoHeight: false, 
		collapsible: false
	 });		 

	 /* __________  accordion-tour_budget_04 ___ */ 
	$("#accordion-tour_budget_05").accordion({ header: "h3", 			
		event: 'click',
		autoHeight: false, 
		collapsible: false
	 });		 
	

/* ==============  TABS (General)  ================== */

	/* __________  Tab Sections  ____________________ */ 
	$('#tabsSectionsx').tabs({
		event: 'click',
		cache: true, 
		cookie: { expires: 7 }
			
	});
	
	
	/* __________  tabsTourFilter  __________________ */ 
	$('#tabsTourFilter').tabs({
		event: 'click',
		cache: true, 
		cookie: { expires: 7 } 	
	});

	/* __________  tabsTourItineraryBudget  _________ */ 
	$('#tabsTourItineraryBudget').tabs({
		event: 'click',
		cache: true, 
		cookie: { expires: 7 } 	
	});

	/* __________  tabsTourInclusionsOptions  _________ */ 
	$('#tabsTourInclusionsOptions').tabs({
		event: 'click',
		cache: true, 
		cookie: { expires: 7 } 	
	});
	

	/* __________  tabsTourBookingBudget  _________ */ 
	$('#tabsTourBookingBudget').tabs({
		event: 'click',
		cache: true, 
		cookie: { expires: 7 } 	
	});
	
		
	
	/* __________  tabsTourAccommBudget  _________ */ 
	$('#tabsTourAccommBudget').tabs({
		event: 'click',
		cache: true, 
		cookie: { expires: 7 } 	
	});


	

	
});
