/**
* hoverIntent r5 // 2007.03.27 // jQuery 1.1.2+
* <http://cherne.net/brian/resources/jquery.hoverIntent.html>
* 
* @param  f  onMouseOver function || An object with configuration options
* @param  g  onMouseOut function  || Nothing (use configuration options object)
* @author    Brian Cherne <brian@cherne.net>
*/
(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY;};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev]);}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev]);};var handleHover=function(e){var p=(e.type=="mouseover"?e.fromElement:e.toElement)||e.relatedTarget;while(p&&p!=this){try{p=p.parentNode;}catch(e){p=this;}}if(p==this){return false;}var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);}if(e.type=="mouseover"){pX=ev.pageX;pY=ev.pageY;$(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}}else{$(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob);},cfg.timeout);}}};return this.mouseover(handleHover).mouseout(handleHover);};})(jQuery);
;(function($){$.fn.flickrGallery=function(options){var defaults={galleryHeight:'auto',userFlickr:'false',useFlickrLargeSize:'false',flickrAPIKey:'',photosetID:'',per_page:30,useHoverIntent:'false',useLightBox:'false',defaultImageIndex:1};var options=$.extend(defaults,options);return this.each(function(){var obj=$(this);function makeGallery(){var flickrLargeImg;var theCaption;var container;var stepCount;var count=1;var totalImageCount=0;var currentImageCount=options.defaultImageIndex;var thumbs=obj.find('ul');thumbs.addClass('galleryUL');if(options.useFlickr=='true'){obj.prepend('<div class="largeImageWrap"><div class="largeImage_nextPage"></div><div class="largeImage_prevPage"></div><a href="" class="largeImage_flickrLink" target="_blank"><span>Flickr</span></a><div class="largeImage_prev"><span>Prev</span></div><div class="largeImage_next"><span>Next</span></div><div class="largeImage"></div><div class="caption"></div></div>');}else{obj.prepend('<div class="largeImageWrap"><div class="largeImage_prev"><span>Prev</span></div><div class="largeImage_next"><span>Next</span></div><div class="largeImage"></div><div class="caption"></div></div>');};var largeImageWrap=obj.find('.largeImageWrap');var nextPage=obj.find('.largeImage_nextPage');var prevPage=obj.find('.largeImage_prevPage');var nextImg=obj.find('.largeImage_next');var prevImg=obj.find('.largeImage_prev');var largeImageFlickrLink=obj.find('.largeImage_flickrLink');var largeImage=obj.find('.largeImage');var imgCaption=obj.find('.caption');if(options.galleryHeight!='auto'){var theHeight=parseFloat(options.galleryHeight);largeImageWrap.animate({height:theHeight+'px'},600);}
if(options.useFlickr=='true'){thumbs.children().bind('click',function(){return false;});};thumbs.wrap('<div class="sliderGallery"></div>');var sliderGallery=obj.find('.sliderGallery');sliderGallery.wrap('<div class="sliderGallery_Wrap"></div>');var sliderGalleryWrap=obj.find('.sliderGallery_Wrap');sliderGallery.append('<div class="slider"></div>');var theSlider=obj.find('.slider');count=1;totalImageCount=0;currentImageCount=options.defaultImageIndex;obj.find('.galleryUL img').each(function(){var IESRC=$(this).attr('src');$(this).attr('src',IESRC);$(this).data('uniqueId',count);$(this).addClass('galleryThumb_'+count);count++;totalImageCount++;});nextPage.bind('click',function(){var currentPage=parseFloat($(obj).find('input:eq(0)').val());var totalPages=parseFloat($(obj).find('input:eq(1)').val());nextPage=currentPage+1;if(nextPage>totalPages){nextPage=1;};theSlider.slider("destroy");sliderGalleryWrap.hide();$(obj).children().slideUp();obj.slideUp('slow',function(){obj.empty();obj.flickr({api_key:options.flickrAPIKey,type:'photoset',photoset_id:options.photosetID,thumb_size:'m',per_page:options.per_page,page:nextPage,callback:function(){makeGallery();}});obj.slideDown();});});prevPage.bind('click',function(){var currentPage=parseFloat($(obj).find('input:eq(0)').val());var totalPages=parseFloat($(obj).find('input:eq(1)').val());prevPage=currentPage-1;if(prevPage==0){prevPage=totalPages;};theSlider.slider("destroy");sliderGalleryWrap.hide();$(obj).children().slideUp();obj.slideUp('slow',function(){obj.empty();obj.flickr({api_key:options.flickrAPIKey,type:'photoset',photoset_id:options.photosetID,thumb_size:'m',per_page:options.per_page,page:prevPage,callback:function(){makeGallery();}});obj.slideDown();});});function calcHeight(){largeImage.fadeOut(function(){function doHeight(){largeImage.fadeIn(function(){var imgHeight=largeImage.find('img').height();var captionHeight=imgCaption.height();largeImage.find('img').css({position:'',visibility:'visible',display:'none'});if(options.galleryHeight=='auto'){largeImageWrap.animate({height:imgHeight+captionHeight+'px'},function(){largeImage.find('img').fadeIn();imgCaption.fadeIn();});}else{largeImage.find('img').fadeIn();imgCaption.fadeIn();};});var slideValue=currentImageCount-1;slideValue=slideValue*stepCount;theSlider.slider("value",slideValue);};$(this).find('img').remove();imgCaption.empty();var i=new Image();var flickrLink;if(options.useFlickr=='true'){if(options.useFlickrLargeSize=='true'){flickrLargeImg=thumbs.find('.galleryThumb_'+currentImageCount).parent().attr('href');flickrLink=thumbs.find('.galleryThumb_'+currentImageCount).parent().attr('title')
theCaption=thumbs.find('.galleryThumb_'+currentImageCount).attr('alt');i.onload=doHeight;i.src=flickrLargeImg;largeImage.append(i);}else{flickrLink=thumbs.find('.galleryThumb_'+currentImageCount).parent().attr('title');theCaption=thumbs.find('.galleryThumb_'+currentImageCount).attr('alt');i.onload=doHeight;i.src=thumbs.find('.galleryThumb_'+currentImageCount).attr('src');largeImage.append(i);flickrLargeImg=thumbs.find('.galleryThumb_'+currentImageCount).parent().attr('href');if(options.useLightBox=='true'){largeImage.find('img').wrap('<a href="'+flickrLargeImg+'" title="'+theCaption+'"></a>');largeImage.find('a').lightBox();};}
largeImageFlickrLink.attr('href',flickrLink);largeImage.find('img').data('uniqueId',currentImageCount);}else{var currentThumb=thumbs.find('.galleryThumb_'+currentImageCount);currentThumb.clone().css('opacity',1).appendTo(largeImage);theCaption=currentThumb.attr('title');doHeight();};imgCaption.append(theCaption).hide();largeImage.find('img').css({position:'absolute',visibility:'hidden',display:'block'}).data('uniqueId',currentImageCount).attr('title',theCaption);});};obj.find('div.sliderGallery').each(function(){container=$(this);var ul=thumbs;var itemsWidth=ul.innerWidth()-container.outerWidth();var totalCount=totalImageCount;totalCount=parseFloat(totalCount-1);stepCount=itemsWidth/totalCount;var division=itemsWidth/totalCount;var theValue=0;theSlider.slider({min:0,max:itemsWidth,step:itemsWidth/totalCount,value:stepCount*(options.defaultImageIndex-1),change:function(event,ui){ul.animate({'left':ui.value*-1},500);theValue=ui.value;},stop:function(event,ui){ul.css('left',ui.value*-1);}});ul.css('left',stepCount*(options.defaultImageIndex-1)*-1);obj.find('.galleryUL img').bind('click',function(){var clickThumb=$(this);var startCount=0;var theCaption=$(this).attr('title');currentImageCount=$(this).data('uniqueId');calcHeight();});});function startHeight(){imgCaption.append(theCaption).hide();largeImage.find('img').css({position:'',visibility:'visible',display:'none'});largeImage.find('img').data('uniqueId',currentImageCount).attr('title',theCaption);largeImage.show(function(){var imgHeight=largeImage.find('img').height();var captionHeight=imgCaption.height();if(options.galleryHeight=='auto'){largeImageWrap.animate({height:imgHeight+captionHeight+'px'},'slow','swing',function(){largeImage.css({visibility:'visible'});imgCaption.fadeIn();largeImage.find('img').fadeIn(300,function(){sliderGallery.hide().wrapInner('<div class="sliderGalleryInnerWrap"></div>');var sliderGalleryInnerWrap=obj.find('.sliderGalleryInnerWrap');sliderGalleryInnerWrap.hide();sliderGalleryWrap.show();sliderGallery.slideDown('slow',function(){sliderGalleryInnerWrap.fadeIn();});});});}else{largeImage.css({visibility:'visible'});largeImage.find('img').fadeIn('slow',function(){sliderGallery.hide().wrapInner('<div class="sliderGalleryInnerWrap"></div>');var sliderGalleryInnerWrap=obj.find('.sliderGalleryInnerWrap');sliderGalleryInnerWrap.hide();sliderGalleryWrap.show();sliderGallery.slideDown('slow',function(){sliderGalleryInnerWrap.fadeIn('slow');});});imgCaption.fadeIn('slow');};});};sliderGalleryWrap.hide();largeImage.hide().css({visibility:'hidden'});var i=new Image();if(options.useFlickr=='true'){if(options.useFlickrLargeSize=='true'){flickrLargeImg=thumbs.find('.galleryThumb_'+currentImageCount).parent().attr('href');flickrLink=thumbs.find('.galleryThumb_'+currentImageCount).parent().attr('title')
theCaption=thumbs.find('.galleryThumb_'+currentImageCount).attr('alt');i.onload=startHeight;i.src=flickrLargeImg;largeImage.append(i);}else{flickrLargeImg=thumbs.find('.galleryThumb_'+currentImageCount).parent().attr('href');flickrLink=thumbs.find('.galleryThumb_'+currentImageCount).parent().attr('title')
thumbs.find('.galleryThumb_'+currentImageCount).clone().appendTo(largeImage);theCaption=thumbs.find('.galleryThumb_'+currentImageCount).attr('alt');if(options.useLightBox=='true'){largeImage.find('img').wrap('<a href="'+flickrLargeImg+'" title="'+theCaption+'"></a>');largeImage.find('a').lightBox();}
startHeight();}
largeImageFlickrLink.attr('href',flickrLink);largeImage.find('img').data('uniqueId',currentImageCount);}else{thumbs.find('.galleryThumb_'+currentImageCount).clone().appendTo(largeImage);theCaption=thumbs.find('.galleryThumb_'+currentImageCount).attr('title');startHeight();};if(options.useHoverIntent=='false'){largeImageWrap.hover(function(){prevImg.fadeIn();nextImg.fadeIn();largeImageFlickrLink.fadeIn();nextPage.fadeIn();prevPage.fadeIn();},function(){obj.find('.largeImage_prev').fadeOut();obj.find('.largeImage_next').fadeOut();obj.find('.largeImage_flickrLink').fadeOut();obj.find('.largeImage_prevPage').fadeOut();obj.find('.largeImage_nextPage').fadeOut();});$(thumbs).children().find('img').hover(function(){$(this).animate({opacity:1},300);},function(){$(this).animate({opacity:.7},300);});}else{function hoverOn(){prevImg.fadeIn();nextImg.fadeIn();largeImageFlickrLink.fadeIn();nextPage.fadeIn();prevPage.fadeIn();};function hoverOff(){obj.find('.largeImage_prev').fadeOut();obj.find('.largeImage_next').fadeOut();obj.find('.largeImage_flickrLink').fadeOut();obj.find('.largeImage_prevPage').fadeOut();obj.find('.largeImage_nextPage').fadeOut();};var config={sensitivity:3,interval:50,over:hoverOn,timeout:200,out:hoverOff};largeImageWrap.hoverIntent(config);function thumbHoverOn(){$(this).animate({opacity:1},300);};function thumbHoverOff(){$(this).animate({opacity:.7},300);};var config2={sensitivity:1,interval:25,over:thumbHoverOn,timeout:50,out:thumbHoverOff};$(thumbs).children().find('img').hoverIntent(config2);};prevImg.bind('click',function(){var theSRC=largeImage.find('img').attr('src');currentImageCount=largeImage.find('img').data('uniqueId');var newSRC="";var newImage="";var fixIE="";var prevImageCount=currentImageCount-1;if(prevImageCount<1){currentImageCount=totalImageCount;}else{currentImageCount=prevImageCount;};newSRC=thumbs.find('.galleryThumb_'+currentImageCount).attr('src');newImage=thumbs.find('.galleryThumb_'+currentImageCount).clone().css('opacity',1).data('uniqueId',currentImageCount);calcHeight();});nextImg.bind('click',function(){var theSRC=largeImage.find('img').attr('src');currentImageCount=largeImage.find('img').data('uniqueId');var newSRC="";var theCaption="";var newImage="";var nextImageCount=currentImageCount+1;if(nextImageCount>totalImageCount){currentImageCount=1;}else{currentImageCount=nextImageCount;};newSRC=thumbs.find('.galleryThumb_'+currentImageCount).attr('src');newImage=thumbs.find('.galleryThumb_'+currentImageCount).clone().css('opacity',1).data('uniqueId',currentImageCount);calcHeight();});};if(options.useFlickr=='true'){obj.flickr({api_key:options.flickrAPIKey,type:'photoset',photoset_id:options.photosetID,thumb_size:'m',per_page:options.per_page,page:1,callback:function(){makeGallery();}});}else{makeGallery();};});};})(jQuery);
;/**
 * jQuery.ScrollTo - Easy element scrolling using jQuery.
 * Copyright (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
 * Dual licensed under MIT and GPL.
 * Date: 5/25/2009
 * @author Ariel Flesler
 * @version 1.4.2
 *
 * http://flesler.blogspot.com/2007/10/jqueryscrollto.html
 */
;(function(d){var k=d.scrollTo=function(a,i,e){d(window).scrollTo(a,i,e)};k.defaults={axis:'xy',duration:parseFloat(d.fn.jquery)>=1.3?0:1};k.window=function(a){return d(window)._scrollable()};d.fn._scrollable=function(){return this.map(function(){var a=this,i=!a.nodeName||d.inArray(a.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!i)return a;var e=(a.contentWindow||a).document||a.ownerDocument||a;return d.browser.safari||e.compatMode=='BackCompat'?e.body:e.documentElement})};d.fn.scrollTo=function(n,j,b){if(typeof j=='object'){b=j;j=0}if(typeof b=='function')b={onAfter:b};if(n=='max')n=9e9;b=d.extend({},k.defaults,b);j=j||b.speed||b.duration;b.queue=b.queue&&b.axis.length>1;if(b.queue)j/=2;b.offset=p(b.offset);b.over=p(b.over);return this._scrollable().each(function(){var q=this,r=d(q),f=n,s,g={},u=r.is('html,body');switch(typeof f){case'number':case'string':if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(f)){f=p(f);break}f=d(f,this);case'object':if(f.is||f.style)s=(f=d(f)).offset()}d.each(b.axis.split(''),function(a,i){var e=i=='x'?'Left':'Top',h=e.toLowerCase(),c='scroll'+e,l=q[c],m=k.max(q,i);if(s){g[c]=s[h]+(u?0:l-r.offset()[h]);if(b.margin){g[c]-=parseInt(f.css('margin'+e))||0;g[c]-=parseInt(f.css('border'+e+'Width'))||0}g[c]+=b.offset[h]||0;if(b.over[h])g[c]+=f[i=='x'?'width':'height']()*b.over[h]}else{var o=f[h];g[c]=o.slice&&o.slice(-1)=='%'?parseFloat(o)/100*m:o}if(/^\d+$/.test(g[c]))g[c]=g[c]<=0?0:Math.min(g[c],m);if(!a&&b.queue){if(l!=g[c])t(b.onAfterFirst);delete g[c]}});t(b.onAfter);function t(a){r.animate(g,j,b.easing,a&&function(){a.call(this,n,b)})}}).end()};k.max=function(a,i){var e=i=='x'?'Width':'Height',h='scroll'+e;if(!d(a).is('html,body'))return a[h]-d(a)[e.toLowerCase()]();var c='client'+e,l=a.ownerDocument.documentElement,m=a.ownerDocument.body;return Math.max(l[h],m[h])-Math.min(l[c],m[c])};function p(a){return typeof a=='object'?a:{top:a,left:a}}})(jQuery);
;function packageChooser(containerSelector,titleContainerSelector){this.onChange=function(){}
this.selectDefault=function(){this.select(container.find('a:first'),true);}
this.select=function(jqA,initializing){var title=jqA.attr('title');var link=jqA.attr('href');if(typeof(selectedLink)=='string'){$(selectedLink).hide();}
if(typeof(link)=='string'){this.quoteRef=jqA.attr('data');titleContainer.trigger('click');if(typeof(selectedLink)=='string'){$(link).show("slide",{},600);}else{$(link).show();}}
selectedLink=link;this.onChange(initializing);}
function unSelectAll(){container.find('li').removeClass('ui-tabs-selected');container.find('a').each(function(i,item){$($(item).attr('href')).hide();});}
var callback=this;var selectedLink;var container=$(containerSelector);var titleContainer=$(titleContainerSelector);container.find('a').bind('click',function(e){container.find('li').removeClass('ui-tabs-selected');$(this).parent().addClass('ui-tabs-selected');callback.select($(this));return false;});container.find('tr').hover(function(){$(this).addClass('highlight');},function(){$(this).removeClass('highlight');}).bind('click',function(){$(this).find('a:first').trigger('click');});unSelectAll();container.find('li:first').addClass('ui-tabs-selected');}
;function overlayEnquiryForm(){this.enabled=true;this.setQuoteRef=function(value){if(typeof(value)!='string')return false;this.container.find('.quote-ref').text(value);this.container.find('input[name=ref]').val(value);}
this.setTravelType=function(value){if(typeof(value)!='string')return false;this.container.find('input[name="travel_type"]').val(value);}
this.open=function(){this.container.dialog('open');}
this.close=function(){this.reset();this.containerForm.find('input.date-picker').datepicker('hide');}
this.disable=function(){var callback=this;if(!this.enabled){window.setTimeout('$("'+this.containerSelector+'").trigger("callbackDisable");',1000);return false;}
this.container.dialog('disable');this.container.find('.ajax-busy').fadeIn('fast',function(){callback.enabled=false;});}
this.enable=function(){var callback=this;if(this.enabled){window.setTimeout('$("'+this.containerSelector+'").trigger("callbackEnable");',1000);return false;}
this.container.find('.ajax-busy').fadeOut('fast',function(){callback.container.dialog('enable');callback.enabled=true;});}
this.reset=function(){this.validator.resetForm();this.containerForm.find('input[type=text],select,textarea').val('');this.containerForm.find('textarea[name="children_ages"]').attr('disabled','disabled');this.containerForm.find('textarea[name="children_ages"]').parent('div').parent('div.field').hide();this.container.find('.ajax-busy').hide();}
this.showSuccess=function(){var title='Thank you for your enquiry';if(typeof(this.successTitle)=='string'){title=this.successTitle;}
this.container.dialog('close');$(this.containerDoneSelector).dialog("option","title",title).dialog("open");window.setTimeout("$('"+this.containerDoneSelector+"').dialog('close');",10000);}
this.error=function(message,title){if(typeof(title)!='string')title='Form Submission Error';if(typeof(message)!='object')message=$('<p>Sorry, there was an unknown problem processing your data</p>');$(this.containerErrorSelector).find('div.intro:first').empty().append(message);$(this.containerErrorSelector).dialog("option","title",title);$(this.containerErrorSelector).dialog("open");}
this.showFaultList=function(faults){var formFaults={};var formFaultCount=0;var faultCount=0;this.containerForm.find('input,textarea,select').each(function(){var name=$(this).attr('name');if(typeof(faults[name])!='undefined'){formFaults[name]=faults[name];formFaultCount++;delete faults[name];}});if(formFaultCount)this.validator.showErrors(formFaults);var message=$('<ul class="error"></ul>');message.append('<p class="error">The following errors occurred while processing your submission:</p>');if(typeof(faults)=='object'&&faults){for(var i in faults){faultCount++;if(typeof(faults[i])=='string')message.append('<li>'+faults[i]+'</li>');else if(typeof(faults[i])=='object'){for(var j=0;j<faults[i].length;j++){if(typeof(faults[i][j])=='string')message.append('<li>'+faults[i][j]+'</li>');}}else{message.append('<li>undefined error</li>');}}
this.error(message);}
if(!faultCount){this.error();}}
this.submit=function(){this.disable();var callback=this;$.get('/_ajax/overlay-enquiry-form.json.php',{formType:this.formType,type:'submit',data:$.toJSON(this.getValues())},function(data){var objData;try{objData=$.secureEvalJSON(data);}catch(err){callback.error($('<pre>'+data+'</pre>'));callback.enable();return;}
callback.submitResult(objData);});}
this.submitResult=function(data){if(typeof(data)!='object')data={success:0};if(data.success>0){this.showSuccess();}else{if(typeof(data.faults)=='object'){this.showFaultList(data.faults);}else{this.error();}}
this.enable();}
this.getValues=function(){var data={};this.containerForm.find('input[type=text],input[type=hidden],input[type=radio]:checked,input[type=checkbox]:checked,select,textarea').each(function(i,j){j=$(j);var name=j.attr('name');var value=j.val();if(typeof(name)!='undefined')data[name]=value;});this.containerForm.find('input.date-picker').each(function(i,j){j=$(j);var name=j.attr('name');var value=$.datepicker.formatDate('yy-mm-dd',$.datepicker.parseDate('dd/mm/yy',j.val()));if(typeof(name)!='undefined')data[name+'_mysql']=value;});return data;}
this.init=function(dialogTitle){var callback=this;this.container.dialog({autoOpen:false,draggable:false,modal:true,resizable:false,width:630,buttons:{"Send Enquiry >>":function(){if(!callback.enabled)return false;callback.container.find('form:first').trigger('submit');},"Cancel":function(){if(!callback.enabled)return false;callback.container.dialog('close');}},title:this.dialogTitle,close:function(event,ui){callback.close();}});this.container.bind('callbackDisable',function(){callback.disable();}).bind('callbackEnable',function(){callback.enable();});this.containerForm.find('input.date-picker').datepicker({showOn:'button',buttonImage:'/images/calendar.gif',buttonImageOnly:true,dateFormat:'dd/mm/yy',minDate:'+0d',maxDate:'+1y',closeText:'X',closeAtTop:true});this.containerForm.find('input.min-date-for').bind('change',function(){var minDateFor=$(this).attr('mindatefor');var value=$.datepicker.parseDate('dd/mm/yy',$(this).val());value=new Date(value.getFullYear(),value.getMonth(),value.getDate()+1);if(typeof(minDateFor)!='string')return;callback.container.find('input[name="'+minDateFor+'"]').datepicker('disable').val('').datepicker('hide').datepicker('change',{minDate:value}).datepicker('enable').trigger('change');});this.containerForm.find('select[name="num_children"]').bind('change',function(){if($(this).val()>0){callback.containerForm.find('textarea[name="children_ages"]').attr('disabled','');callback.containerForm.find('textarea[name="children_ages"]').parent('div').parent('div.field').show();}else{callback.containerForm.find('textarea[name="children_ages"]').attr('disabled','disabled');callback.containerForm.find('textarea[name="children_ages"]').parent('div').parent('div.field').hide();}}).trigger('change');$(this.containerErrorSelector).dialog({autoOpen:false,draggable:false,modal:true,resizable:false,width:500,buttons:{'OK':function(){$(this).dialog("close");}},title:'No Title'});$(this.containerDoneSelector).dialog({autoOpen:false,draggable:false,modal:true,resizable:false,width:600,buttons:{'OK':function(){$(this).dialog("close");}},title:'No Title'});}
this.formType='overlay';}
function breakEnquiryForm(containerSelector,containerDoneSelector,containerErrorSelector){var callback=this;this.container=$(containerSelector);this.containerSelector=containerSelector;this.containerDoneSelector=containerDoneSelector;this.containerErrorSelector=containerErrorSelector;this.containerForm=this.container.find('form:first');this.formType='break';this.successTitle='City Break Enquiry';this.dialogTitle='City Break Enquiry Form';this.init();this.validator=this.containerForm.validate({submitHandler:function(form){callback.submit();},errorPlacement:function(error,element){if(element.attr('errorboxid')){error.appendTo('#'+element.attr('errorboxid'));}else{error.insertAfter(element);}},rules:{title:{required:true},forename:{required:true},surname:{required:true},landline:{required:function(element){return(callback.containerForm.find('input[name="mobile"]').val()=='');}},home_country:{required:true},email:{email:true,required:true},o_station:{required:true},o_date:{required:true},r_date:{required:true},num_adults:{required:true},children_ages:{required:true}},messages:{email:{required:'Please enter your email address.',email:'Please enter a valid email address.'},forename:'Please enter your first name.',surname:'Please enter your family name.',title:'Please select your title.',landline:'Please enter your phone number.',home_country:'Please select the country you live in.',o_station:'Please enter your departure point.',o_date:{required:'Please select your date of travel.'},r_date:{required:'Please select your date of travel.'},num_adults:'Please select number of people travelling.',children_ages:'Please enter the ages of the children travelling.'},onfocusout:false,onkeyup:false,errorClass:"form-error"});}
breakEnquiryForm.prototype=new overlayEnquiryForm();function holidayEnquiryForm(containerSelector,containerDoneSelector,containerErrorSelector){var callback=this;this.formType='holiday';this.successTitle='Holiday Enquiry';this.container=$(containerSelector);this.containerSelector=containerSelector;this.containerDoneSelector=containerDoneSelector;this.containerErrorSelector=containerErrorSelector;this.containerForm=this.container.find('form:first');this.dialogTitle='Holiday Enquiry Form';this.init();this.validator=this.containerForm.validate({submitHandler:function(form){callback.submit();},errorPlacement:function(error,element){if(element.attr('errorboxid')){error.appendTo('#'+element.attr('errorboxid'));}else{error.insertAfter(element);}},rules:{title:{required:true},forename:{required:true},surname:{required:true},landline:{required:function(element){return(callback.containerForm.find('input[name="mobile"]').val()=='');}},home_country:{required:true},email:{email:true,required:true},o_station:{required:true},o_date:{required:true},r_station:{required:true},r_date:{required:true},num_adults:{required:true}},messages:{email:{required:'Please enter your email address.',email:'Please enter a valid email address.'},forename:'Please enter your first name.',surname:'Please enter your family name.',title:'Please select your title.',landline:'Please enter your phone number.',home_country:'Please select the country you live in.',o_city:'*',o_date:{required:'Please select your date of travel.'},r_city:'*',r_date:{required:'*'},num_adults:'*'},onfocusout:false,onkeyup:false,errorClass:"form-error"});}
holidayEnquiryForm.prototype=new overlayEnquiryForm();
;var flickrGalleryObject;$(document).ready(function(){$('#tabset').tabs().tabClean().bind('tabsshow',function(event,ui){var link=$(ui.tab).attr('href');if(link=='#tab-images'){if(typeof(flickrGalleryObject)!='object'){$('#hotelGallery > ul').css('visibility','hidden');flickrGalleryObject=$('#hotelGallery').flickrGallery({useHoverIntent:'true'});}
$('#hotelGallery ul').css('visibility','visible');}}).bind('tabsselect',function(event,ui){$('#hotelGallery > ul').css('visibility','hidden');});var packageChooserHandle=new packageChooser('#packageListing','#package-title');var breakEnquiryFormHandle=new breakEnquiryForm('#break-enquiry-form','#break-enquiry-done','#break-enquiry-error');packageChooserHandle.onChange=function(initializing){breakEnquiryFormHandle.setQuoteRef(this.quoteRef);$('.how-to-book .quote-ref').text(this.quoteRef);if(!initializing)niceScroll('#details');}
packageChooserHandle.selectDefault();$('a.break-enquiry-form').bind('click',function(){breakEnquiryFormHandle.open();return false;});});
