No results found.
').appendTo(outer); outer.appendTo(lwr); } else { for (var idx = 0; idx < sData.length; idx++) { var sObj = sData[idx]; var item = $('No results found.
').appendTo(outer); outer.appendTo(lwr); } oText._searchXhr = null; if (oText._searchQueued == true) { oText._searchQueued = false; local.pagePickerSearch(oText); } }); } }, 300); }; /* WebFilter 0x1010006400000004 */ local.fileLinkPickerSearch = function(oText,iFolder) { if (oText._searchTimeout) { clearTimeout(oText._searchTimeout); } oText._searchTimeout = setTimeout(function() { oText._searchTimeout = null; var ot = $(oText); if (oText._lower == null) oText._lower = ot.closest('.cms-page-search').find('.cms-page-search-lower'); var lwr = oText._lower; if (lwr._oldHtml == null) { lwr._oldHtml = $(lwr).html(); } if (oText._searchXhr != null) { // Request already in progress oText._searchQueued = true; } else if (oText.value == '' && lwr._oldHtml != null) { lwr.html(lwr._oldHtml); } else if (oText._lastSearch != oText.value) { // Nothing queued oText._searchQueued = false; ot.closest('div').addClass('active'); oText._lastSearch = oText.value; oText._searchXhr = $.getJSON(cms.RootPath + '/wf.ashx?f=search.json&t=268566529&q=' + encodeURIComponent(oText.value) + '&file.folder=' + parseInt(iFolder,10), function(sData) { $(lwr).empty(); var h = $(lwr).closest('.ui-dialog-content').height(); ot.closest('div').removeClass('active'); ot.closest('.cms-page-search').find('.cms-page-search-lower').scrollTop(0); var result = false; if (sData.length > 0) { for (var idx = 0; idx < sData.length; idx++) { var sObj = sData[idx]; var size = parseInt(sObj['size'],10); if (size > 0) { var item = $('No results found.
').appendTo(outer); outer.appendTo(lwr); } oText._searchXhr = null; if (oText._searchQueued == true) { oText._searchQueued = false; local.pagePickerSearch(oText); } }); } }, 300); }; /* WebFilter 0x1010006400000016 */ local.google = {}; local.google.maps = {}; local.google.maps.loadMap = function(selector,itemType,itemTag,bCentreLoc){ //Lookup any new addresses local.google.maps.codeAddress(); //Create Map local.google.maps.itemType = itemType; local.google.maps.itemTag = itemTag; local.google.maps.googlePendingInterval = setInterval(function() { if (local.google.maps.googlePendingCount <= 0) { clearInterval(local.google.maps.googlePendingInterval); local.google.maps.InitializeMap(selector); if (bCentreLoc === true) { if (navigator && navigator.geolocation) { navigator.geolocation.getCurrentPosition(function (position) { initialLocation = new google.maps.LatLng(position.coords.latitude, position.coords.longitude); local.google.maps.map.setCenter(initialLocation); }); } } } },100); }; local.google.maps.googlePendingInterval = null; local.google.maps.zoomDelayInterval = null; local.google.maps.googlePendingCount = 0; local.google.maps.map = null; local.google.maps.addressArray = []; local.google.maps.encodedAddrArray = []; local.google.maps.overQueryLimit = false; local.google.maps.InitializeMap = function(selector) { mapType = google.maps.MapTypeId.ROADMAP; switch(local.google.maps.mapType) { case 'k': mapType = google.maps.MapTypeId.SATELLITE; break; case 'h': mapType = google.maps.MapTypeId.HYBRID; break; case 'p': mapType = google.maps.MapTypeId.TERRAIN; break; } google.maps.MapTypeId.ROADMAP; var myOptions = { mapTypeId: mapType, zoom: local.google.maps.zoomLevel }; local.google.maps.map = new google.maps.Map(document.getElementById(selector), myOptions); local.google.maps.addMarkers(); local.google.maps.addOverlays(); local.google.maps.zoomDelayInterval = setInterval(function() { clearInterval(local.google.maps.zoomDelayInterval); local.google.maps.map.setZoom(local.google.maps.zoomLevel); },500); }; local.google.maps.codeAddress = function() { $.each( local.google.maps.addressArray, function( intIndex, objValue ){ if(local.google.maps.overQueryLimit != true){ local.google.maps.googlePendingCount++; var geocoder = new google.maps.Geocoder(); geocoder.geocode( { 'address': objValue.address}, function(results, status) { local.google.maps.googlePendingCount--; if (status == google.maps.GeocoderStatus.OK) { local.google.maps.encodedAddrArray.push({'position' : results[0].geometry.location, 'title' : objValue.title, 'content': objValue.content}); var pos = {'lat':results[0].geometry.location.lat(), 'long':results[0].geometry.location.lng()}; local.google.maps.saveLocationData(objValue.marker_id, pos); } else { console.log("Geocode was not successful for the following reason: " + status); if(status == 'OVER_QUERY_LIMIT'){ local.google.maps.overQueryLimit = true; } } }); } } ); }; local.google.maps.addOverlays = function(){ google.maps.event.addListener(local.google.maps.map, "rightclick", function(e) { var lat = e.latLng.lat(); var lng = e.latLng.lng(); // populate yor box/field with lat, lng //alert("Lat=" + lat + "; Lng=" + lng); }); }; local.google.maps.addMarkers = function(){ var infowindow; $.each( local.google.maps.encodedAddrArray, function(intIndex, objValue){ var marker = new google.maps.Marker({ map: local.google.maps.map, position: objValue.position, title: objValue.title }); if (objValue.content) { var iw = new google.maps.InfoWindow({content:objValue.content}); google.maps.event.addListener(marker,'click',function(){ iw.open(local.google.maps.map,marker); }); } /* google.maps.event.addListener(marker, 'click', function() { if (infowindow) infowindow.close(); infowindow = new google.maps.InfoWindow({ content: objValue.content }); infowindow.open(local.google.maps.map, marker); }); */ if (intIndex == local.google.maps.encodedAddrArray.length - 1 && local.google.maps.centerTimeout == null) { local.google.maps.centerTimeout = setTimeout(local.google.maps.centerMap,500); } } ); }; local.google.maps.centerTimeout = null; local.google.maps.centerMap = function(){ local.google.maps.centerTimeout = null; // Create a new viewpoint bound var bounds = new google.maps.LatLngBounds (); // Go through each... for (var i = 0, LtLgLen = local.google.maps.encodedAddrArray.length; i < LtLgLen; i++) { // And increase the bounds to take this point bounds.extend (local.google.maps.encodedAddrArray[i].position); } // Fit these bounds to the map google.maps.event.addListener(local.google.maps.map, 'zoom_changed', function() { zoomChangeBoundsListener = google.maps.event.addListener(local.google.maps.map, 'bounds_changed', function(event) { if (this.getZoom() > 24 && this.initialZoom == true) { // Change max/min zoom here this.setZoom(24); this.f = false; } google.maps.event.removeListener(zoomChangeBoundsListener); }); }); local.google.maps.map.initialZoom = true; local.google.maps.map.fitBounds (bounds); } local.google.maps.addAddress = function(id, address, title, content) { local.google.maps.addressArray.push({'address' : address, 'marker_id' : id, 'title' : title, 'content' : content}); }; local.google.maps.saveLocationData = function(object, data) { var objData = data; var obj = object; //console.log(objData); $.getJSON(cms.RootPath + '/wf.ashx/access.json/getkey/'+local.google.maps.itemTag+'/-1?u=' + Math.random(), function (data) { var ah = data['a.h']; var as = data['a.s']; var at = data['a.t']; if (ah == null || as == null || at == null) { //alert('Failed to authorise.'); } else { var jsonData = []; var thisData = {}; thisData.d = obj; thisData.t = local.google.maps.itemType; thisData.f = {}; thisData.f['latitude'] = objData.lat; thisData.f['longitude'] = objData.long; jsonData.push(thisData); var postData = JSON.stringify(jsonData); var url = cms.RootPath + '/wf.ashx/access.json/put/'+local.google.maps.itemTag+'/-1?a.h=' + encodeURIComponent(ah) + '&a.s=' + encodeURIComponent(as) + '&a.t=' + encodeURIComponent(at) + '&u=' + Math.random(); $.post(url, postData, function (data, textStatus, jqXhr) { }); } }); }; /* TemplateFilter 0x10C80FA000000007 */ local.StartSlideshow = function(g,data,startId,settings) { var s = new slideShow(); s.g = g; g.addClass('i001-gallery-slideshow-parent'); s.ID = Math.floor(Math.random() * 100000); local.slideShowTable[s.ID] = s; s.SlideshowData = data; if (settings) { for (var x in settings) { s.SlideshowSettings[x] = settings[x]; } } // Width fix var tWrap = g.find('.i001-gallery-thumbs'); var tRow = tWrap.find('.i001-gallery-thumb_row'); tRow.width(tWrap.width() - (2 * parseInt(s.SlideshowSettings.navPadding,10))); s.SlideshowStartId = startId; g.data('g',s); s.SlideshowPrepareThumbnails(); s.UnpauseSlideshow(); s.SlideshowTimeout = setTimeout("local.slideShowTable['" + s.ID + "'].SlideshowExecute()",s.SlideshowSettings.interval); } local.slideShowTable = { }; function slideShow() { } slideShow.prototype.ID = 0; slideShow.prototype.g = null; slideShow.prototype.SlideshowIndex = -1; slideShow.prototype.SlideshowCurrent = null; slideShow.prototype.SlideshowData = null; slideShow.prototype.SlideshowTimeout = -1; slideShow.prototype.SlideshowPaused = false; slideShow.prototype.SlideshowSettings = { interval: 5000, transitionInterval: 500, thumbSpacing: 120, navPadding: 66 }; local.PauseSlideshow = function(oLink) { return $(oLink).closest('.i001-gallery-slideshow-parent').data('g').PauseSlideshow(); } slideShow.prototype.PauseSlideshow = function() { var g; if (this.SlideshowData) { g = this; } else if (g == null) { g = $(this).closest('.i001-gallery-slideshow-parent').data('g'); } g.SlideshowPaused = true; g.g.find('.i001-gallery-slideshow-state .play').removeClass('active'); g.g.find('.i001-gallery-slideshow-state .pause').addClass('active'); return false; }; local.UnpauseSlideshow = function(oLink) { return $(oLink).closest('.i001-gallery-slideshow-parent').data('g').UnpauseSlideshow(); } slideShow.prototype.UnpauseSlideshow = function() { var g; if (this.SlideshowData) { g = this; } else if (g == null) { g = $(this).closest('.i001-gallery-slideshow-parent').data('g'); } g.SlideshowPaused = false; g.g.find('.i001-gallery-slideshow-state .pause').removeClass('active'); g.g.find('.i001-gallery-slideshow-state .play').addClass('active'); return false; }; slideShow.prototype.SlideshowExecute = function() { if (this.SlideshowPaused == true) { clearTimeout(this.SlideshowTimeout); this.SetTimeout(2); } else { this.UnpauseSlideshow(); if (this.SlideshowIndex == -1) this.SlideshowPrepare(this.SlideshowData); this.SlideshowChangeTo(this.SlideshowIndex + 1,this.SlideshowData); } }; slideShow.prototype.SlideshowPrepare = function(data) { this.SlideshowData = data; this.g.find('.i001-gallery-slideshow-img-standby').data('g',this).load(this.SlideshowStandbyLoad).parent().css('z-index',90); this.g.find('.i001-gallery-slideshow-img-main').data('g',this).load(this.SlideshowStandbyReset).parent().css('z-index',89); for(var i=0; i < data.length; i++) { if (parseInt(data[i].ss_id) == this.SlideshowStartId) { this.SlideshowIndex = i; } if (data[i].ss_id > 0) { data[i].cacheImg = new Image(); data[i].cacheImg.src = '/f.ashx?v=' + parseInt(data[i].img_tgt,10); } } }; slideShow.prototype.SlideshowChangeTo = function(newIdx,data) { if (this.SlideshowIndex == -1) this.SlideshowPrepare(data); clearTimeout(this.SlideshowTimeout); var oldIdx = this.SlideshowIndex; this.SlideshowIndex = newIdx; if (this.SlideshowIndex >= data.length - 1) this.SlideshowIndex = 0; if (this.SlideshowIndex < 0) this.SlideshowIndex = data.length - 2; var t = data[this.SlideshowIndex]; this.SlideshowCurrent = t; this.g.find('.i001-gallery-slideshow-img-standby').attr('src',t.cacheImg.src); }; slideShow.prototype.SlideshowStandbyReset = function() { $(this).css('opacity',1); $(this).closest('.i001-gallery-slideshow-parent').find('.i001-gallery-slideshow-img-standby').parent().css('top','-20000px'); }; slideShow.prototype.SlideshowStandbyLoad = function() { var g = $(this).data('g'); if (g == null) return; var t = g.SlideshowCurrent; if (t == null) return; var wrap = g.g.find('.i001-gallery-slideshow-wrap'); var standby = g.g.find('.i001-gallery-slideshow-img-standby'); var main = g.g.find('.i001-gallery-slideshow-img-main'); standby.css('opacity',0).parent().css('top','0'); main.stop(true).css('opacity',1); var trans = g.SlideshowSettings.transitionInterval; main.stop(true).animate({opacity:0},trans); standby.stop(true).animate({opacity: 1},trans,function() { main.attr('src',standby.attr('src')); }); wrap.stop(true).animate({height: standby.height()}, trans); g.g.find('.i001-gallery-slideshow-title').text(cms.UnescapeHtml(t.title)); var cap = g.g.find('.i001-gallery-slideshow-caption'); var sbCap = g.g.find('.i001-gallery-slideshow-caption-standby'); sbCap.text(cms.UnescapeHtml(t.caption)); if (t.caption == '' || t.caption == null) { cap.parent().stop(true).animate({height: 0},trans,function() { cap.text(''); cap.parent().css('display','none'); }); } else { cap.parent().css('display','block').stop(true).animate({height: sbCap.parent().height()},trans,function() { cap.text(cms.UnescapeHtml(t.caption)); }); } g.SlideshowActivateThumbnail(g,t.ss_id); g.SetTimeout(); }; slideShow.prototype.SetTimeout = function(divisor) { if (divisor > 1) { } else { divisor = 1; } this.SlideshowTimeout = setTimeout("local.slideShowTable['" + this.ID + "'].SlideshowExecute()", this.SlideshowSettings.interval / divisor); } slideShow.prototype.ThumbOffset = -1; slideShow.prototype.ThumbListWidth = -1; slideShow.prototype.ThumbBoxWidth = -1; slideShow.prototype.ThumbMinPos = 0; slideShow.prototype.SlideshowPrepareThumbnails = function() { var row = this.g.find('.i001-gallery-slideshow-thumbs').data('g',this); var inner = row.find('.i001-gallery-thumb_row_inner'); row.css('overflow','hidden'); this.ThumbBoxWidth = row.width(); inner.css('position','absolute').css('left','0'); var curPos = 0; var curIdx = 0; var parent = this; inner.find('div div').each(function() { var t = $(this); t.css('position','absolute').css('left',curPos).css('float','none'); this._position = curPos; this._idx = curIdx++; curPos += parent.SlideshowSettings.thumbSpacing; }); inner.find('a').click(function() { var parent = $(this).closest('.i001-gallery-slideshow-parent').data('g'); parent.SlideshowChangeTo(parseInt($(this).closest('div')[0]._idx),parent.SlideshowData); return false; }); this.ThumbListWidth = curPos; this.ThumbMinPos = this.ThumbBoxWidth - this.ThumbListWidth; this.g.find('.i001-gallery-nav.i001-gallery-back a').click(function(){ var parent = $(this).closest('.i001-gallery-slideshow-parent').data('g'); parent.SlideshowChangeTo(parent.SlideshowIndex - 1,parent.SlideshowData); return false; }); this.g.find('.i001-gallery-nav.i001-gallery-next a').click(function(){ var parent = $(this).closest('.i001-gallery-slideshow-parent').data('g'); parent.SlideshowChangeTo(parent.SlideshowIndex + 1,parent.SlideshowData); return false; }); }; slideShow.prototype.SlideshowActivateThumbnail = function(g,thmId) { g.g.find('.i001-gallery-slideshow-nav-parent').find('.i001-gallery-slideshow-item-active').removeClass('i001-gallery-slideshow-item-active'); var thm = g.g.find('.i001-gallery-slideshow-item-' + parseInt(thmId)); thm.addClass('i001-gallery-slideshow-item-active'); var ntPos = (g.ThumbBoxWidth / 2) - (thm[0]._position + (thm.width() / 2)); if (ntPos < g.ThumbMinPos) ntPos = g.ThumbMinPos; if (ntPos > 0) ntPos = 0; g.g.find('.i001-gallery-slideshow-thumbs div.i001-gallery-thumb_row_inner').stop(true).animate({left: ntPos},g.SlideshowSettings.transitionInterval); }; /* TemplateFilter 0x10C80FA000000019 */ local.cartRedir_productLinksActive = false; local.cartRedir_activateProductLinks = function() { if (local.cartRedir_productLinksActive == false) { local.cartRedir_productLinksActive = true; if (local.ActivePage) { $('a.i001-prod-tgt-link').click(function(e) { var scrollTop = $(document).scrollTop(); if (isNaN(scrollTop)) { scrollTop = 0; } var pageId = local.ActivePage; var t = $(this); var curTarget = t.attr('originalTarget'); if (curTarget == null) { curTarget = t.attr('href'); t.data('originalTarget',curTarget); } t.attr('href',curTarget + '&lv.nextpage=' + parseInt(pageId,10) + '&lv.nextpagehash=ST' + parseInt(scrollTop,10)); }); $('form').each(function(){ var t = $(this); if (t.find('.i001-detail-info input').length > 0) { t.submit(local.cartRedir_productSubmitForm); } }); } if (window.location.hash) { if (window.location.hash.substring(0,3) == '#ST') { var scrollTop = parseInt(window.location.hash.substring(3),10); if (scrollTop > 0) { $(window).scrollTop(scrollTop); cms.DisplayMessage('Items added to cart successfully.',2000); } } } } }; local.cartRedir_productSubmitForm = function() { if (local.ActivePage) { var scrollTop = $(document).scrollTop(); if (isNaN(scrollTop)) { scrollTop = 0; } var pageId = local.ActivePage; var t = $(this); var curTarget = t.data('originalTarget'); if (curTarget == null) { curTarget = t.attr('action'); t.data('originalTarget',curTarget); } t.attr('action',curTarget + '&lv.nextpage=' + parseInt(pageId,10) + '&lv.nextpagehash=ST' + parseInt(scrollTop,10)); } }; /* TemplateFilter 0x10C80FA00000001A */ local.changeTargetImage = function(smallVerId,largeVerId) { cms.Popup.ImgChangeDynamic('#target_img',smallVerId,largeVerId); return false; }; /* TemplateFilter 0x10C80FA0000000E5 */ cms.InitializeDropdown = function(direction,multi){ if(cms._initializedComplete == true){return}; if(direction == 'vertical'){ var width = $('.w123-std-menu').width(); var shrinkSize = width - (0.3 * width); $('.w123-std-menu li').children('.w123-std-dropdown').css({left: shrinkSize}); cms.VertStdDropdown(); } else if(direction == 'horizontal'){ var height = $('.w123-std-menu').height(); if (height == 0) { height = $('.w123-std-menu li').height(); } var shrinkSize = height - (0.3 * height); $('.w123-std-menu li').children('.w123-std-dropdown').css({top: shrinkSize}); cms.HoriStdDropdown(); } if(multi == true){ $('.w123-std-dropdown').each(function(){ var pWidth = $(this).outerWidth(); var shrinkSize = pWidth - (0.1 * pWidth); if(shrinkSize > 0){ $(this).find('.w123-std-dropdown-inner-child').css({left: shrinkSize}); } }); cms.deepStdDropdown(direction); } cms._initializedComplete = true; }; cms.VertStdDropdown = function(){ if (cms.StdDropdownActive == true) { return; } cms.StdDropdownActive = true; var width = $('.w123-std-menu').width(); var shrinkSize = width - (0.3 * width); $('.w123-std-menu li').mouseover(function(){ $(this).children('.w123-std-dropdown').stop().dequeue().animate({ left: width, opacity: 1},100); $(this).closest('li').addClass('open'); }).mouseleave(function(){ $(this).children('.w123-std-dropdown').animate({ left: shrinkSize, opacity: 0 },200); $('.w123-std-menu li').closest('li').removeClass('open'); }); cms.StdDropdownActive = false; }; cms.HoriStdDropdown = function(){ if (cms.StdDropdownActive == true) { return; } cms.StdDropdownActive = true; var height = $('.w123-std-menu').height(); if (height == 0) { height = $('.w123-std-menu li').height(); } height = height * 0.9; var shrinkSize = height * 0.5; $('.w123-std-menu li').mouseover(function(){ $(this).children('.w123-std-dropdown').stop().dequeue().animate({ top: height, opacity: 1},100); $(this).closest('li').addClass('open'); }).mouseleave(function(){ $(this).children('.w123-std-dropdown').animate({ top: shrinkSize, opacity: 0 },200); $('.w123-std-menu li').closest('li').removeClass('open'); }); cms.StdDropdownActive = false; }; cms.StdDropdown = function(){ if (cms.StdDropdownActive == true) { return; } $('.w123-std-menu li').hover( function() { $(this).closest('li').addClass('open'); }, function() { $(this).closest('li').removeClass('open'); } ); cms.StdDropdownActive = false; }; cms.deepStdDropdown = function(direction){ if (cms.StdDropdownActive == true) { return; } cms.StdDropdownActive = true; if(direction == 'horizontal'){ $('.w123-std-dropdown li').mouseover(function(){ var target = $(this).closest('ul'); cms.getWidth(target); $(this).children('.w123-std-dropdown-inner-child').stop().dequeue().width(cms._targetWidth).animate({ left: cms._targetWidth, opacity: 1},100); $(this).closest('li').addClass('open'); }).mouseleave(function(){ $(this).children('.w123-std-dropdown-inner-child').animate({ left: cms._shrinkSize, opacity: 0 },200); $('.w123-std-menu li').closest('li').removeClass('open'); }); } else if(direction == 'vertical'){ $('.w123-std-dropdown li').mouseover(function(){ var target = $(this).closest('ul'); cms.getWidth(target); $(this).children('.w123-std-dropdown-inner-child').stop().dequeue().animate({ left: cms._targetWidth, opacity: 1},100); $(this).closest('li').addClass('open'); }).mouseleave(function(){ $(this).children('.w123-std-dropdown-inner-child').animate({ left: cms._shrinkSize, opacity: 0 },200); $('.w123-std-menu li').closest('li').removeClass('open'); }); } cms.StdDropdownActive = false; }; cms.StdDropdownActive = false; cms._targetWidth = 0; cms._shrinkSize = 0; cms._initializedComplete = false; cms.getWidth = function(target){ cms._targetWidth = $(target).width(); cms._shrinkSize = cms._targetWidth - (0.1 * cms._targetWidth); }; /* TemplateFilter 0x10C80FA00000042F */ local.toggleFaq = function(obj) { var tgt = $(obj); var parent = tgt.closest('.i001-faq-item0'); var inner = parent.find('.faq-content'); if (parent.hasClass('open')) { inner.hide('fast'); parent.removeClass('open'); } else { inner.show('fast'); parent.addClass('open'); } return false; }; /* TemplateFilter 0x10C80FA00000043E */ local.changeTargetImage = function(selector, smallVerId,largeVerId) { cms.Popup.ImgChangeDynamic(selector, smallVerId,largeVerId); return false; }; local.enableImageZoom = function(selector) { var tgt = $(selector); var zoomData = tgt.data('imgZoom'); if (zoomData == null) { zoomData = { }; tgt.data('imgZoom',zoomData); tgt.addClass('cms-img-zoom'); var nh = tgt.height(); var nw = tgt.width(); var ar = nh / nw; tgt.mouseover(local.imgZoomMouseOver); tgt.mousemove(local.imgZoomMouseMove); //Set event handler as 'mouseleave' if original image is less than 450px high if(ar < 0.4){ tgt.mouseleave(local.imgZoomMouseOut); } else { tgt.mouseout(local.imgZoomMouseOut); } tgt.find('img').load(local.imgZoomLoadImg); local.imgZoomSetSizes(tgt); } }; local.imgZoomSetSizes = function(tgt) { var zoomData = tgt.data('imgZoom'); var lge = tgt.find('.cms-img-zoom-large'); var w = tgt.width(); var h = tgt.height(); var bw = lge.width(); var bh = lge.height(); var xMax = (bw - w); var yMax = (bh - h); zoomData.pad = 20; zoomData.w = w; zoomData.h = h; zoomData.ar = h / w; zoomData.bw = bw; zoomData.bh = bh; zoomData.xMax = xMax; // Set the height of the element to be equal to the height of the large image if less than 450px // so that the mouse move pad is correctly setup for the new, larger height. if(zoomData.ar < 0.4){ zoomData.o = h; h = bh; zoomData.h = bh; zoomData.yMax = bh; } else { zoomData.yMax = yMax; } zoomData.pos = tgt.offset(); zoomData.xt = bw - w; zoomData.yt = bh - h; zoomData.xRatio = (w - zoomData.pad * 2) / zoomData.xt; zoomData.yRatio = (h - zoomData.pad * 2) / zoomData.yt; }; local.imgZoomLoadImg = function(e) { var tgt = $(this).closest('.cms-img-zoom'); if (tgt.length > 0) { local.imgZoomSetSizes(tgt); } }; local.imgZoomMouseOver = function(e) { if($(e.relatedTarget).is('img') == false) { var tgt = $(this); var lge = tgt.find('.cms-img-zoom-large'); var bh = lge.height(); var zoomData = tgt.data('imgZoom'); // Make the image box the size of the large image if less than 450px. if(zoomData.ar < 0.4){ $(this,'#target_img').animate({ height: bh }); } $(this).find('.cms-img-zoom-large').fadeIn(); } }; local.imgZoomMouseMove = function(e) { var tgt = $(this); var lge = tgt.find('.cms-img-zoom-large'); var zoomData = tgt.data('imgZoom'); zoomData.pos = tgt.offset(); var x = e.pageX - zoomData.pos.left; var y = e.pageY - zoomData.pos.top; if (x > zoomData.w - zoomData.pad) { x = zoomData.w - zoomData.pad; } x = Math.max(0,(x - zoomData.pad)); if (y > zoomData.h - zoomData.pad) { y = zoomData.h - zoomData.pad; } y = Math.max(0,(y - zoomData.pad)); x = -(x / zoomData.xRatio); y = -(y / zoomData.yRatio); if (x > 0) { x = 0; } if (y > 0) { y = 0; } if (x < -zoomData.xMax) { x = -zoomData.xMax; } if (y < -zoomData.yMax) { y = -zoomData.yMax; } lge.css('top',y + 'px'); lge.css('left',x + 'px'); }; local.imgZoomMouseOut = function(e) { if($(e.relatedTarget).is('img') == false) { $(this).find('.cms-img-zoom-large').fadeOut(); var tgt = $(this); // Put image box back to original size and remove height styling. var zoomData = tgt.data('imgZoom'); if(zoomData.ar < 0.4){ $(this,'#target_img').css('height', ''); } } }; local.changeTargetZoomImage = function(selector,smallVerId,largeVerId) { var tgt = $(selector); tgt.find('.cms-img-zoom-default img').attr('src','/f.ashx?v=' + smallVerId); tgt.find('.cms-img-zoom-large img').attr('src','/f.ashx?v=' + largeVerId); return false; }; /* TemplateFilter 0x10C80FA000000476 */ local.initBookingForm = function(){ if(local.bookingFormIsInit == false){ $('.i001-booking-date a').click(function(){ local.changeDate($(this)); }); if (window.location.hash) { if (window.location.hash.substring(0,3) == '#ST') { var scrollTop = parseInt(window.location.hash.substring(3),10); if (scrollTop > 0) { $(window).scrollTop(scrollTop); } } } local.bookingFormPostLoad(); cms.Dynamic.CompleteCallback = local.bookingFormPostLoad; local.bookingFormIsInit = true; } }; local.bookingFormIsInit = false; local.bookingFormPostLoad = function() { $('.daywrapper').hover(function(){ var tgt = $(this); tgt.addClass('active'); },function(){ var tgt = $(this); tgt.removeClass('active'); }); $('.i001-booking-main td.day, .i001-booking-extra-sel').not('.sold').click(function(e){ var tgt = $(e.target); if (tgt.is('td') == false) { tgt = tgt.closest('td'); } var chk = tgt.find('input.cms-checkbox'); if (chk.length > 0) { chk.click(); } }); }; local.bookUpdatePicker = function(sDate,inst){ if (sDate != '') { var td = new Date(sDate); if (td.getFullYear() > 1900) { var m = td.getMonth() + 1; var d = td.getDate(); var s = td.getFullYear() + '-' + (m < 10 ? '0' : '') + m + '-' + (d < 10 ? '0' : '') + d; // Get State Dump jsDump = 'ST' + $(window).scrollTop(); document.location.href = local._baseBookUrl.replace('_val_',s) + '#' + jsDump; } } } local.changeDate = function(tgt){ var tgt = tgt; var d = tgt.closest('.i001-booking-date').attr('data-date'); var d = $.datepicker.parseDate('dd-mm-yy',d); console.log(d); }; /* TemplateFilter 0x10C80FA000000489 */ local.gallery = {}; local.gallery.initPopup = function(gId,imgArray){ }; local.gallery.openPopup = function(gId,idx,tgt){ var gallery = $(gId); var imgSrc = tgt.attr('href'); local.gallery.createAndLoad(gallery,idx,imgSrc); return false; }; local.gallery.fixResize = function(){ var p = $('.db-dialog-wrap'); var tgt = $('.db-dialog-backing'); if (tgt.length != 0) { tgt.css({width:local.screenWidth,height:local.screenHeight}); var img = p.find('.slideshow-img'); local.gallery.fitToWindow(img,'.db-dialog-image-wrap',img.width(),img.height()); } }; local.gallery.fitToWindow = function(img,parentSelector,w,h){ var p = $(parentSelector); var ar = w/h; var maxH = local.screenHeight * 0.8; var maxW = local.screenWidth * 0.8; var sAr = maxW/maxH; var finalW; var finalH; if(h > maxH || w > maxW){ if(sAr > ar){ finalW = w * maxH / h; finalH = maxH; } else { finalW = maxW; finalH = h * maxW / w; } } else { finalH = h; finalW = w; } img.css('width',finalW); img.css('height', finalH); $('.db-dialog-caption').css({width:finalW}); p.animate({ width: finalW }, 300).animate({ height: finalH }, 300); }; local.gallery.nav = function(gId,direction,tgt){ var gallery = $(gId); var v = tgt.attr('href'); var newsrc = '/f.ashx?v='+v; var img = $('').appendTo(newContainer)); }); newContainer.insertBefore(parentUl); parentUl.remove(); proceed = false; } else if (parentOl.length > 0) { // Move list var newList = $('
').appendTo(newContainer)); }); newContainer.insertBefore(parentOl); parentOl.remove(); proceed = false; } else if (parentUl.length > 0) { // Move list var newList = $('