;(function($){var m=$.scrollTo=function(b,h,f){$(window).scrollTo(b,h,f)};m.defaults={axis:'xy',duration:parseFloat($.fn.jquery)>=1.3?0:1};m.window=function(b){return $(window).scrollable()};$.fn.scrollable=function(){return this.map(function(){var b=this,h=!b.nodeName||$.inArray(b.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!h)return b;var f=(b.contentWindow||b).document||b.ownerDocument||b;return $.browser.safari||f.compatMode=='BackCompat'?f.body:f.documentElement})};$.fn.scrollTo=function(l,j,a){if(typeof j=='object'){a=j;j=0}if(typeof a=='function')a={onAfter:a};if(l=='max')l=9e9;a=$.extend({},m.defaults,a);j=j||a.speed||a.duration;a.queue=a.queue&&a.axis.length>1;if(a.queue)j/=2;a.offset=n(a.offset);a.over=n(a.over);return this.scrollable().each(function(){var k=this,o=$(k),d=l,p,g={},q=o.is('html,body');switch(typeof d){case'number':case'string':if(/^([+-]=)?\d+(\.\d+)?(px)?$/.test(d)){d=n(d);break}d=$(d,this);case'object':if(d.is||d.style)p=(d=$(d)).offset()}$.each(a.axis.split(''),function(b,h){var f=h=='x'?'Left':'Top',i=f.toLowerCase(),c='scroll'+f,r=k[c],s=h=='x'?'Width':'Height';if(p){g[c]=p[i]+(q?0:r-o.offset()[i]);if(a.margin){g[c]-=parseInt(d.css('margin'+f))||0;g[c]-=parseInt(d.css('border'+f+'Width'))||0}g[c]+=a.offset[i]||0;if(a.over[i])g[c]+=d[s.toLowerCase()]()*a.over[i]}else g[c]=d[i];if(/^\d+$/.test(g[c]))g[c]=g[c]<=0?0:Math.min(g[c],u(s));if(!b&&a.queue){if(r!=g[c])t(a.onAfterFirst);delete g[c]}});t(a.onAfter);function t(b){o.animate(g,j,a.easing,b&&function(){b.call(this,l,a)})};function u(b){var h='scroll'+b;if(!q)return k[h];var f='client'+b,i=k.ownerDocument.documentElement,c=k.ownerDocument.body;return Math.max(i[h],c[h])-Math.min(i[f],c[f])}}).end()};function n(b){return typeof b=='object'?b:{top:b,left:b}}})(jQuery);;(function($){var l=location.href.replace(/#.*/,'');var g=$.localScroll=function(a){$('body').localScroll(a)};g.defaults={duration:1e3,axis:'y',event:'click',stop:true,target:window,reset:true};g.hash=function(a){if(location.hash){a=$.extend({},g.defaults,a);a.hash=false;if(a.reset){var e=a.duration;delete a.duration;$(a.target).scrollTo(0,a);a.duration=e}i(0,location,a)}};$.fn.localScroll=function(b){b=$.extend({},g.defaults,b);return b.lazy?this.bind(b.event,function(a){var e=$([a.target,a.target.parentNode]).filter(d)[0];if(e)i(a,e,b)}):this.find('a,area').filter(d).bind(b.event,function(a){i(a,this,b)}).end().end();function d(){return!!this.href&&!!this.hash&&this.href.replace(this.hash,'')==l&&(!b.filter||$(this).is(b.filter))}};function i(a,e,b){var d=e.hash.slice(1),f=document.getElementById(d)||document.getElementsByName(d)[0];if(!f)return;if(a)a.preventDefault();var h=$(b.target);if(b.lock&&h.is(':animated')||b.onBefore&&b.onBefore.call(b,a,f,h)===false)return;if(b.stop)h.stop(true);if(b.hash){var j=f.id==d?'id':'name',k=$('<a> </a>').attr(j,d).css({position:'absolute',top:$(window).scrollTop(),left:$(window).scrollLeft()});f[j]='';$('body').prepend(k);location=e.hash;k.remove();f[j]=d}h.scrollTo(f,b).trigger('notify.serialScroll',[f])}})(jQuery);if(pageTracker==undefined){var pageTracker='';}
jQuery.fn.clearonfocus=function(){jQuery(this)
.bind('focus',function(){if(!this.defaultValue)this.defaultValue=this.value;if(this.defaultValue&&this.defaultValue!=this.value)return;this.value='';})
.bind('blur',function(){if(this.value.match(/^\s*$/))
this.value=this.defaultValue;});};$(function(){$("#super-search").submit(function(){if($("#ss_keywords").val().match(/Enter Keyword/i)){$("#ss_keywords").val('');}
if($('#ss_keywords').val()!=''&&!($("#ss_keywords").val().match(/Enter Keyword/i))){var currentVal=$("#ss_keywords").val();if(!(currentVal.match(/['|"]/))&&(currentVal.match(/.\b./))){$("#ss_keywords").val('"'+currentVal+'"');}}});$("#basic-search").submit(function(){if($("query").val()=='Search the site...')$("query").val('');return true;});if($('h2.expander').length){$('h2.expander').toggle(function(){$(this).next().slideDown('fast');$(this).find('span').text('-');},function(){$(this).next().slideUp('fast');$(this).find('span').text('+');});}
if($('.currency-switcher a').length)$('.currency-switcher a').currencySwitcher();if($('dl.currency-switcher').length){$('dl.currency-switcher').accordion({header:"dt",alwaysOpen:false,active:false,selectedClass:'active'});}
$('#supplementary-nav dd a').removeClass('fallback').append('<span class="hover"></span>').each(function(){var $span=$('> span.hover',this).css({'opacity':0});$(this).hover(function(){$span.stop().fadeTo(300,1);},function(){$span.stop().fadeTo(300,0);});});$('div.price-hidden').each(function(){$(this).wrapInner('<div class="fancy_wrap"></div>');$(this).hide();});$('a.fancybox-price').each(function(){var targetEl=$(this).attr('href');var targetHeight=(($(targetEl).height())/2)+100;$(this).fancybox({padding:0,hideOnContentClick:false,frameWidth:720,frameHeight:targetHeight});});$('a.fancycart').each(function(){$(this).fancybox({padding:0,hideOnContentClick:false,frameWidth:760});});if($('#tour #map').attr('id')=="map"){map=load();}
$('body.map div.primary #map,#tour div.secondary #map').wrap('<div id="map_wrap"></div>');$('#map_wrap').after('<a href="#map_wrap" class="fancymap">View the map full screen (without Street View)</a>');$('body.map #page div.primary p.instructions:not(body.map #page div.primary form p.instructions)').append('&nbsp;Want a bigger map? <a href="#map_wrap" class="fancymap">View the map full screen</a>');$('a.fancymap').fancybox({frameWidth:$(window).width()-100,frameHeight:$(window).height()-100,hideOnContentClick:false,overlayOpacity:.9,callbackOnStart:function(){$('#map_wrap #map').empty();if(pageTracker!=''){pageTracker._trackEvent('Google Map','Launch','Full Screen Map Launch');};},callbackOnShow:function(){$('#map_wrap #map').remove();var geoSearch=$('#geo-search').clone();load(map.getCenter(),map.getZoom(),map.getCurrentMapType());if(geoSearch.html()!=''){geoSearch.appendTo($('#fancy_div #map')).css({'position':'relative','zIndex':'9999'}).attr('id','geo-search2').css({'position':'absolute','top':'0','left':'75px'});$('#geo-search2 input[type=text]').removeAttr('value').attr('value','Search towns, suburbs and street names').val('Search towns, suburbs and street names').clearonfocus();}},callbackOnClose:function(){$('#map_wrap').append('<div id="map"></div>');load(map.getCenter(),map.getZoom(),map.getCurrentMapType());$('#fancy_div #map').remove();}});$('a.print-button').click(function(){window.print();return false;});$("hr").wrap("<div class='hr'></div>").hide();$("input[type=text]").addClass('text');$('#query').val("Search the site...").clearonfocus();$('#geo-search input[type=text]').val("Search towns, suburbs and major street names within South Africa and Africa").clearonfocus();$('#dir-search #fromAddress').val("Johannesburg").clearonfocus();$('#dir-search #toAddress').val("Cape Town").clearonfocus();$('dl.filter dd').hide();$('dl.filter dt').click(function(){$('dl.filter dd').toggle("fast");});if($('#tour').length){var tourTypeDescription='<dt id="tour-type_accordion" class="clearfix"><a href="#"><span>+</span>What type of tour is this?</a></dt><dd><dl><dd id="tour-type-description"></dd></dl></dd>';$('div.secondary dl.meta-menu').prepend(tourTypeDescription);$("#tour-type-description").load("/tour-type-descriptions/"+tourTypeUrl+"/",function(){$(this).append('<ul><li><a href="/'+tourTypeUrl+'/" title="View all of this tour type">View all '+tourType+'</a></li><li><a href="#tour-nav" title="All tour types">View all tour types</a></li></ul>');});$(window).load(function(){$('#tour-type-description a[href=#tour-nav]').fancybox({padding:0,hideOnContentClick:false,frameWidth:900,frameHeight:440});});$('dl.meta-menu').accordion({header:"dt.clearfix",alwaysOpen:false,active:false,selectedClass:'active',autoheight:false});$('dl.meta-menu dt.clearfix').click(function(){if($(this).find('a span').text()=='+'){$(this).find('a span').text('-')}else{$(this).find('a span').text('+')}});}
$('#tour-nav').attr({id:'tour-nav_inner'}).wrap('<div id="tour-nav"></div>');$('#tour-nav').hide();$('a[href=#tour-nav]').fancybox({padding:0,hideOnContentClick:false,frameWidth:900,frameHeight:440});$('a.fancycart').fancybox({padding:0,hideOnContentClick:false,frameWidth:780,frameHeight:400});jQuery('dl.hooks').accordion({header:"dt.send-to-friend",alwaysOpen:false,active:false,selectedClass:'active',autoheight:false});$('a.fancybox-carhire').fancybox({padding:20,hideOnContentClick:false,frameWidth:760,callbackOnShow:function(){$('#fancy_ajax').addClass('carhire');}});$("#form-enquire-now").validate({rules:{first_name:"required",email:"required",confirm_email:"required",first_name:{required:true,minlength:2},email:{email:true,required:true,minlength:5},alt_email:{email:true}},messages:{first_name:{required:"Please tell us your name",minlength:"Your name must be longer than that"},email:{required:"Please tell us your email address",minlength:"Whoops, that is not a valid email address"},confirm_email:{required:"Please confirm your email address",equalTo:"Please enter the same email address"},email:"Whoops, that is not a valid email address"}});$("#form-send-to-friend_1").validate({rules:{first_name:{required:true,minlength:2},sender_email:{email:true,required:true,minlength:5},email:{email:true,required:true,minlength:5}},messages:{first_name:{required:"Please tell us your name",minlength:"Your name must be longer than that"},sender_email:{required:"Please tell us your email address",minlength:"Whoops, that is not a valid email address"},email:{required:"Please tell us your friend's email address",minlength:"Whoops, that is not a valid email address"}}});$("#form-send-to-friend_2").validate({rules:{first_name:{required:true,minlength:2},sender_email:{email:true,required:true,minlength:5},email:{email:true,required:true,minlength:5}},messages:{first_name:{required:"Please tell us your name",minlength:"Your name must be longer than that"},sender_email:{required:"Please tell us your email address",minlength:"Whoops, that is not a valid email address"},email:{required:"Please tell us your friend's email address",minlength:"Whoops, that is not a valid email address"}}});$('.social-media a:not(class=^fancy)').filter(function(){var theHref=this;if(theHref.hostname&&theHref.hostname!==location.hostname){$(theHref).addClass("external");$(theHref).bind('click keypress',function(event){var code=event.charCode||event.keyCode;if(!code||(code&&code==13)){if(pageTracker!=''){var fixedLink=this.href;fixedLink=fixedLink.replace(/https?:\/\/(.*)/,"$1");fixedLink='/social-media/'+fixedLink;pageTracker._trackPageview(fixedLink);pageTracker._trackEvent('Social Media','Submit','All Social Media Links');};};});};});$('#tour div.secondary dl.meta-menu a').filter(function(){var theHref=this;$(theHref).bind('click keypress',function(event){var code=event.charCode||event.keyCode;if(!code||(code&&code==13)){if(pageTracker!=''){pageTracker._trackEvent('Accordion','Activate','Meta Menu');};};});});$('#tour div.secondary dl.meta-menu #tour-type_accordion a').bind('click keypress',function(event){if(pageTracker!=''){pageTracker._trackEvent('Accordion','Activate','Meta Menu - Tour Type');};});$('div.primary #map').bind('click',function(event){if(pageTracker!=''){pageTracker._trackEvent('Google Map','Click','Large Map');};});$('div.secondary #map:not(.route-map)').bind('click',function(event){if(pageTracker!=''){pageTracker._trackEvent('Google Map','Click','Large Map');};});$('div.secondary #map.route-map').bind('click',function(event){if(pageTracker!=''){pageTracker._trackEvent('Google Map','Click','Small Map');};});$('#fancy_div #map').bind('click',function(event){if(pageTracker!=''){pageTracker._trackEvent('Google Map','Click','Full Screen Map');};});$('#find-your-tour a').bind('click',function(event){if(pageTracker!=''){pageTracker._trackEvent('Tour Nav','Launch','Primary Navigation');};});$('#supplementary-nav a').bind('click',function(event){if(pageTracker!=''){pageTracker._trackEvent('Tour Nav','Follow Link','Supplementary Tour Navigation');};});$('#breadcrumb dl:not(#supplementary-nav) a').bind('click',function(event){if(pageTracker!=''){pageTracker._trackEvent('Breadcrumb Nav','Follow Link','Breadcrumb');};});$('#contact-us-link a').bind('click',function(event){if(pageTracker!=''){pageTracker._trackEvent('Enquire Now','Follow Link','Primary Navigation');};});$('#enquire-now #page div.primary p a').bind('click',function(event){if(pageTracker!=''){pageTracker._trackEvent('Abandon Enquiry Form','Follow Link','Back to tour of interest');};});$('a.fancybox-price').bind('click',function(event){if(pageTracker!=''){pageTracker._trackEvent('Price Info','Launch','All Price Info Clicks');};});$('a[href=^mailto:info]').bind('click',function(event){if(pageTracker!=''){pageTracker._trackEvent('General Enquiry','Click Mail Link','info@');};});$('a[href=^mailto:specials]').bind('click',function(event){if(pageTracker!=''){pageTracker._trackEvent('Specials Enquiry','Click Mail Link','specials@');};});$('a[href=^mailto:cars]').bind('click',function(event){if(pageTracker!=''){pageTracker._trackEvent('Car Hire Enquiry','Click Mail Link','cars@');};});$('a[rel*=gallery]').fancybox({padding:0}).bind('click',function(event){if(pageTracker!=''){pageTracker._trackEvent('Gallery','Launch','All Gallery Views');};});$('a.localscroll').wrap('<span class="localscroll"></span>');$('span.localscroll').localScroll({onAfter:function(){if($("dd.departures-accordion_content").css('display')=='none'){$('#accordion.meta-menu').accordion('activate','dt.departures-accordion_head');}}});});$(window).load(function(){$('a[href=#tour-nav]').fancybox({padding:0,hideOnContentClick:false,frameWidth:900,frameHeight:440});});function setDirections(fromAddress,toAddress,locale){$("#directions").parent().find('>h3').text('Your directions from '+fromAddress+' to '+toAddress);$("#directions-wrapper").show();gdir.load("from: "+fromAddress+", Africa"+" to: "+toAddress+", Africa",{"locale":locale});}
function onGDirectionsLoad(){}
function handleErrors(){if(gdir.getStatus().code==G_GEO_UNKNOWN_ADDRESS)
alert("No location could be found for one of the specified addresses. This may be because the address is relatively new, or it may be incorrect.\nError code: "+gdir.getStatus().code);else if(gdir.getStatus().code==G_GEO_SERVER_ERROR)
alert("Sorry, we can't find directions for one or more of those addresses.\n Error code: "+gdir.getStatus().code);else if(gdir.getStatus().code==G_GEO_MISSING_QUERY)
alert("Sorry, we can't find directions for one or more of those addresses.\n Error code: "+gdir.getStatus().code);else if(gdir.getStatus().code==G_GEO_BAD_KEY)
alert("Sorry, we can't find directions for one or more of those addresses. \n Error code: "+gdir.getStatus().code);else if(gdir.getStatus().code==G_GEO_BAD_REQUEST)
alert("Sorry, we can't find directions for one or more of those addresses.\n Error code: "+gdir.getStatus().code);else alert("Sorry, we can't find directions for one or more of those addresses.");$("#directions-wrapper").fadeOut();}