function imageScaler(parameters){this.windowSize;this.canvasWidth=parameters.canvasWidth;this.canvasCentre=Math.floor(this.canvasWidth/2);this.headerHeight=parameters.headerHeight;this.footerHeight=parameters.footerHeight;this.isIE7=parameters.isIE7;this.image=parameters.image;this.isSubViewport;this.viewport;this.newSize;}
imageScaler.prototype.template=function(parameters){return true;};imageScaler.prototype.installScaler=installScaler;imageScaler.prototype.setViewPort=setViewPort;imageScaler.prototype.scaleImage=scaleImage;imageScaler.prototype.updateCSS=updateCSS;imageScaler.prototype.getViewPortSize=getViewPortSize;imageScaler.prototype.getNewImageSize=getNewImageSize;imageScaler.prototype.getCanvasWidth=getCanvasWidth;function installScaler(){this.setViewPort();this.scaleImage();this.updateCSS();var _self=this;jQuery(window).resize(function(){_self.setViewPort();_self.scaleImage();_self.updateCSS();});};function setViewPort(){this.windowSize={'w':parseInt(jQuery(window).width(),10),'h':parseInt(jQuery(window).height(),10)};this.isSubViewport=(this.windowSize.w<this.canvasWidth)?true:false;if(this.isSubViewport){this.windowSize.w=(this.windowSize.w<800)?800:this.windowSize.w;jQuery('body,').addClass('sub996');jQuery('body, .header,.footer').css({'width':this.windowSize.w+'px'});}else{jQuery('body').removeClass('sub996');jQuery('body').css({'width':'100%'});jQuery('.header,.footer').css({'width':'996px'});}
if(this.windowSize.h<700){this.windowSize.h=700;}
this.windowSize.aspectRatio=this.windowSize.w/this.windowSize.h;this.viewport={'w':this.windowSize.w,'h':this.windowSize.h-(this.headerHeight+this.footerHeight)};this.viewport.aspectRatio=this.viewport.w/this.viewport.h;var vw=(this.isSubViewport)?this.windowSize.w:this.canvasWidth;this.viewport.offset=(!this.isIE7)?-Math.floor((this.windowSize.w-vw)/2):0;}
function scaleImage(){if(this.viewport.aspectRatio>this.image.aspectRatio){this.scale=this.viewport.w/this.image.w;}else{this.scale=this.viewport.h/this.image.h;}
xOffset=-((this.image.w*this.scale)-this.viewport.w)/2;this.newSize={'width':Math.floor(this.image.w*this.scale),'height':Math.floor(this.image.h*this.scale),'left':Math.floor(xOffset),'scale':this.scale};jQuery('DIV.panel').eq(0).find('IMG.fabric').css({'width':this.newSize.width+'px','height':this.newSize.height+'px','left':this.newSize.left+'px'});var logoImage=jQuery('.panel .logo');var logoImageWidth=parseInt(logoImage.width(),10);var logoImageHeight=parseInt(logoImage.height(),10);this.logoImg={'width':logoImageWidth,'height':logoImageHeight,'left':parseInt(((this.viewport.w-logoImageWidth)/2),10),'top':parseInt(((this.viewport.h-logoImageHeight)/2),10)-40};logoImage.css({'left':this.logoImg.left+'px','top':this.logoImg.top+'px'});}
function updateCSS(){if(this.isSubViewport){jQuery('.sub996 .page').css({'width':this.windowSize.w+'px'});}else{jQuery('.page').css({'width':'996px'});}
jQuery('DIV.imageScaler').css({'width':this.viewport.w+'px','height':this.viewport.h+'px','left':this.viewport.offset+'px'});jQuery('DIV.imageWrapper,DIV.flashWrapper').css({'width':this.viewport.w+'px','height':this.viewport.h+'px','left':'0px'});jQuery('BODY.homePage DIV.footerSpan').css({'top':(this.windowSize.h-this.footerHeight)+'px'});}
function getNewImageSize(){return this.newSize;}
function getViewPortSize(){return this.viewport;}
function getCanvasWidth(){return this.canvasWidth;}
function timestamp(){this.year;this.month;this.day;this.date;this.hours;this.minutes;this.seconds;this.time;this.timezone;this.now();}
timestamp.prototype.template=function(){};timestamp.prototype.now=function(){var today=new Date();this.year=today.getFullYear();this.month=today.getMonth()+1;this.date=today.getDate();this.day=today.getDay();this.hours=today.getHours();this.minutes=today.getMinutes();this.seconds=today.getSeconds();};timestamp.prototype.setDate=function(dateObject){this.year=dateObject.year;this.month=dateObject.month;this.date=dateObject.date;};timestamp.prototype.setTime=function(timeObject){this.hours=timeObject.hours;this.minutes=timeObject.minutes;this.seconds=timeObject.seconds;};timestamp.prototype.zeroPad=function(number){return(number<=9)?'0'+number:number;};timestamp.prototype.returnTimestamp=function(){return''+this.year+this.zeroPad(this.month)+this.zeroPad(this.date)+this.zeroPad(this.hours)+this.zeroPad(this.minutes)+this.zeroPad(this.seconds)};function timerObject(parameters){this.timer;this.delay;if(typeof parameters!='undefined'){if(typeof parameters.delay!='undefined'){this.setDelay(parameters.delay);}
if(typeof parameters.process!='undefined'){this.setProcess(parameters.process);}}}
timerObject.prototype.template=function(parameters){return;};timerObject.prototype.startTimer=function(){this.timer=window.setInterval(this.process,this.delay);};timerObject.prototype.killTimer=function(){clearInterval(this.timer);};timerObject.prototype.setDelay=function(delay){this.delay=delay;}
timerObject.prototype.setProcess=function(process){this.process=process;};function largeCarousel(parameters){this.itemTemplate=parameters.productListLargeItemTemplate;this.largeList=jQuery('DIV.products-list-large-wrapper UL.products-list');this.items=jQuery('DIV.products-list-large-wrapper UL.products-list LI');this.itemCount=this.items.length;this.lastIndex=this.itemCount-1;this.markers=jQuery('DIV.products-list-sub-wrapper DIV.marker');this.slideDuration=parameters.slideDuration;this.fadeInDuration=parameters.fadeInDuration;this.baseOffset=parameters.baseOffset;this.largeWidth=parameters.largeWidth;this.isIE=parameters.isIE;this.isInfoPanelPage=parameters.isInfoPanelPage;this.offset=0;this.offsets=[];}
largeCarousel.prototype.positionItems=function(){this.generateOffsets();this.largeList.css({'left':this.offsets[0]+'px'});}
largeCarousel.prototype.generateOffsets=function(){for(n=0;n<this.itemCount;n++){this.offsets[n]=this.baseOffset-((this.itemTemplate.width+1)*(n-1))-1;}}
largeCarousel.prototype.IndexLoop=function(index){var newIndex=index;if(index<0)
newIndex=this.itemCount+index;if(index>(this.itemCount-1))
newIndex=index-this.itemCount;return newIndex;}
largeCarousel.prototype.transitionStart=function(oldIndex,newIndex){this.markers.eq(oldIndex).animate({'opacity':0},this.fadeInDuration,function(){jQuery(this).css({'display':'none'});});if(this.isIE&&this.isInfoPanelPage){jQuery('DIV.products-list-large-wrapper UL.products-list LI.item-'+oldIndex).find('DIV.product-shop').css({'display':'none'});}else{jQuery('DIV.products-list-large-wrapper UL.products-list LI.item-'+oldIndex).find('DIV.product-shop').animate({'opacity':0},this.slideDuration,function(){jQuery(this).css({'display':'none'})});}}
largeCarousel.prototype.transitionEnd=function(oldIndex,newIndex){this.markers.eq(newIndex).css({'display':'block'}).animate({'opacity':1},this.fadeInDuration,function(){});if(this.isIE&&this.isInfoPanelPage){jQuery('DIV.products-list-large-wrapper UL.products-list LI.item-'+newIndex).find('DIV.product-shop').css({'display':'block'});}else{jQuery('DIV.products-list-large-wrapper UL.products-list LI.item-'+newIndex).find('DIV.product-shop').css({'display':'block'}).animate({'opacity':1},this.fadeInDuration,function(){});}}
largeCarousel.prototype.jumpTo=function(oldIndex,newIndex,direction){var _self=this;this.transitionStart(oldIndex,newIndex);var newLeft=this.offsets[newIndex];this.largeList.animate({'left':newLeft+'px'},this.slideDuration,function(){slideRunning=false;_self.transitionEnd(oldIndex,newIndex);});}
function miniOverlay(parameters){this.parameters=parameters;this.shroud=jQuery('DIV#'+parameters.shroud);this.overlay=jQuery('DIV#'+parameters.overlay);this.opener=jQuery(parameters.opener);this.hideSelect=false;this.windowSize;this.ImageSize;this.scrollerPosition=0;this.wheelScale=16;this.minScale;this.isOpen=false;this.overlayLoaded=false;this.imageIsReady=false;this.isZoomable=true;this.pH;}
miniOverlay.prototype.template=function(){};miniOverlay.prototype.getWindowSize=function(){this.windowSize={'w':parseInt(jQuery(window).width(),10),'h':parseInt(jQuery(window).height(),10)};this.windowSize.aspectRatio=this.windowSize.w/this.windowSize.h;};miniOverlay.prototype.installOverlay=function(){var _self=this;this.imagePreloadBox=[];this.ovBody=this.overlay.find('DIV.ovBody');this.ovBodyTarget=this.ovBody.find('DIV.ovBodyInner');this.ovControl=this.ovBodyTarget.find('DIV.control');this.ovControl.mousemove(function(e){if(_self.imageIsReady){var ey=parseInt(e.pageY,10);var ex=parseInt(e.pageX,10);var y=(ey-_self.topOffset);var yp=y/_self.viewportHeight;_self.selectedImage.yp=yp;if(jQuery.browser.msie&&jQuery.browser.version==9){var imageHeightZoomded=_self.zoomImage.attr('height');}
else{var imageHeightZoomded=_self.zoomImage.height();}
_self.oy=-(imageHeightZoomded-_self.viewportHeight)*yp;var x=(ex-_self.leftOffset);var xp=x/900;_self.selectedImage.xp=xp;_self.ox=0;if(_self.selectedImage.zoomed){_self.ox=-(_self.zoomImage.width()-900)*xp;_self.zoomImage.css({'left':_self.ox+'px'});}
_self.zoomImage.css({'top':_self.oy+'px'});_self.selectedImage.ox=_self.ox;_self.selectedImage.oy=_self.oy;}}).mousewheel(function(e,delta){if(_self.imageIsReady&&_self.isZoomable){var scaleRange=1-_self.selectedImage.minScale;var wd=delta*_self.wheelScale;_self.sc+=wd;if(_self.sc<0)
_self.sc=0;if(_self.sc>100)
_self.sc=100;var ts=(_self.sc*(scaleRange/100))+_self.selectedImage.minScale;if(_self.sc==0){_self.selectedImage.zoomed=false;jQuery('DIV#'+_self.parameters.overlay+' DIV.more-views DIV.zoomLevel A.zPlus').show();jQuery('DIV#'+_self.parameters.overlay+' DIV.more-views DIV.zoomLevel A.zMinus').hide();}else{_self.selectedImage.zoomed=true;jQuery('DIV#'+_self.parameters.overlay+' DIV.more-views DIV.zoomLevel A.zPlus').hide();jQuery('DIV#'+_self.parameters.overlay+' DIV.more-views DIV.zoomLevel A.zMinus').show();}
_self.selectedImage.sw=_self.selectedImage.w*ts;_self.selectedImage.sh=_self.selectedImage.h*ts;_self.ox=-(_self.selectedImage.sw-900)*_self.selectedImage.xp;_self.oy=-(_self.selectedImage.sh-_self.viewportHeight)*_self.selectedImage.yp;_self.zoomImage.css({'width':_self.selectedImage.sw+'px','height':_self.selectedImage.sh+'px','left':_self.ox+'px','top':_self.oy+'px'});e.preventDefault();}});this.getWindowSize();this.leftOffset=Math.floor((this.windowSize.w-900)/2);jQuery(window).resize(function(){_self.getWindowSize();_self.leftOffset=Math.floor((_self.windowSize.w-900)/2);});this.opener.click(function(e){if(!_self.isOpen){_self.getWindowSize();if(typeof document.body.style.maxHeight==="undefined"){jQuery("body","html").css({height:"100%",width:"100%"});jQuery("html").css("overflow","hidden");if(document.getElementById("TB_HideSelect")===null){_self.hideSelect=true;jQuery("body").append("<iframe id='TB_HideSelect'></iframe>");}}
_self.pH=_self.windowSize.h;_self.viewportHeight=_self.pH-48;_self.overlay.css({'marginLeft':'-474px','marginTop':0+'px','width':'948px','height':_self.pH+'px'});_self.ovBody.css({'height':(_self.pH-70)+'px'});_self.ovBodyTarget.css({'height':_self.viewportHeight+'px'});_self.ovControl.css({'height':_self.viewportHeight+'px'});_self.openAll();if(!_self.overlayLoaded){var contentURL=_self.opener.attr('href');pagetTimestamp.now();jQuery.ajax({type:"POST",url:contentURL+'?time='+pagetTimestamp.returnTimestamp(),data:"",dataType:"html",success:function(html){var tContent=jQuery(html).find('DIV.main-image');_self.ovBodyTarget.append(tContent.find('DIV.more-views'));jQuery('DIV#ovPreloadBox').empty();_self.imageIsReady=false;_self.imageCount=jQuery('DIV#pvOverlay DIV.more-views UL LI').length;var counter=_self.imageCount;if(jQuery('DIV#ovPreloadBox IMG').length==0){jQuery('DIV#pvOverlay DIV.more-views UL LI').each(function(i){var thisImage=jQuery(this).find('A').attr('href');var newImage=jQuery('<img src="'+thisImage+'" />').load(function(){var xImage={'url':thisImage,'w':newImage.width(),'h':newImage.height()};if(jQuery.browser.msie&&jQuery.browser.version==9){xImage.w=newImage.attr('width');xImage.h=newImage.attr('height');}
scale=900/xImage.w;minScale=scale;newImageSize={'w':xImage.w*scale,'h':xImage.h*scale};newImage.attr({'width':newImageSize.w,'height':newImageSize.h});newImage.css({'width':newImageSize.w+'px','height':newImageSize.h+'px','opacity':'1'});xImage.nw=newImageSize.w;xImage.nh=newImageSize.h;xImage.scale=scale;if(isIE){xImage.xp=0.5;xImage.yp=0.5;}
xImage.minScale=minScale;xImage.isZoomable=(minScale<1);xImage.zoomed=false;_self.imagePreloadBox[i]=xImage;counter--;if(counter==0){_self.overlayLoaded=true;_self.afterPreload();}});jQuery('DIV#ovPreloadBox').append(newImage);});}},complete:function(html){}});}else{_self.afterPreload();}}
e.preventDefault();});};miniOverlay.prototype.afterPreload=function(){var _self=this;this.viewportPosition=jQuery('DIV#'+this.parameters.overlay).position();this.topOffset=24;_self.clickIndex=pvClickIndex;_self.ovBodyTarget.find('IMG.zoomImage').remove();_self.zoomImage=jQuery('DIV#ovPreloadBox IMG').eq(_self.clickIndex).clone().addClass('zoomImage');_self.selectedImage=_self.imagePreloadBox[_self.clickIndex];_self.tfh=_self.selectedImage.nh;if(_self.tfh<(_self.windowSize.h-48)){_self.pH=_self.tfh+48;}else{_self.pH=_self.windowSize.h;}
_self.viewportHeight=_self.pH-48;_self.overlay.css({'marginLeft':'-474px','marginTop':0+'px','width':'948px','height':_self.pH+'px'});_self.ovBody.css({'height':(_self.pH-70)+'px'});_self.ovBodyTarget.css({'height':_self.viewportHeight+'px'});_self.ovControl.css({'height':_self.viewportHeight+'px'});_self.xTarget=_self.ovBodyTarget.find('DIV.more-views');_self.xWindow=_self.ovBodyTarget.find('DIV.xWindow');_self.xList=_self.ovBodyTarget.find('UL.xList');_self.xUpArrow=_self.ovBodyTarget.find('.xUp');_self.xDownArrow=_self.ovBodyTarget.find('.xDown');_self.xListHeight=parseInt(_self.xList.height(),10);_self.xList.css({'top':'0px'});if((_self.xListHeight+90)>_self.viewportHeight){_self.xTarget.addClass('xScroll');_self.xWindowHeight=(_self.viewportHeight-90);_self.xWindowDelta=_self.xWindowHeight-_self.xListHeight;_self.xWindow.css({'height':(_self.viewportHeight-90)+'px'});_self.xUpArrow.addClass('xDisabled');_self.xDownArrow.removeClass('xDisabled');}else{_self.xTarget.removeClass('xScroll');_self.xWindow.css({'height':_self.xListHeight+'px'});}
_self.selectedImage.tempScale=_self.selectedImage.scale;_self.ovControl.css({'height':_self.tfh+'px'});_self.zoomImage.css({'width':'900px','height':_self.tfh+'px'})
_self.ovBodyTarget.append(_self.zoomImage);_self.isZoomable=_self.selectedImage.isZoomable;if(_self.isZoomable){jQuery('.zoomLevel').show();_self.minZoom();}else{jQuery('.zoomLevel').hide();}
_self.imageIsReady=true;jQuery('DIV#'+_self.parameters.overlay+' DIV.more-views UL LI A').click(function(e){_self.imageIsReady=false;jQuery('DIV#'+_self.parameters.overlay+' DIV.more-views UL LI').removeClass('current');jQuery(this).parent('LI').addClass('current');_self.clickIndex=jQuery('DIV#'+_self.parameters.overlay+' DIV.more-views UL LI').index(jQuery(this).parent('LI'));_self.thisImage=_self.imagePreloadBox[_self.clickIndex];_self.ovBodyTarget.find('IMG.zoomImage').remove();_self.zoomImage=jQuery('DIV#ovPreloadBox IMG').eq(_self.clickIndex).clone().addClass('zoomImage');_self.selectedImage=_self.imagePreloadBox[_self.clickIndex];_self.tfh=_self.selectedImage.nh;if(_self.tfh<(_self.windowSize.h-48)){_self.pH=_self.tfh+48;}else{_self.pH=_self.windowSize.h;}
_self.viewportHeight=_self.pH-48;_self.overlay.css({'marginLeft':'-474px','marginTop':0+'px','width':'948px','height':_self.pH+'px'});_self.ovBody.css({'height':(_self.pH-70)+'px'});_self.ovBodyTarget.css({'height':_self.viewportHeight+'px'});_self.ovControl.css({'height':_self.viewportHeight+'px'});_self.selectedImage.tempScale=_self.selectedImage.scale;_self.ovControl.css({'height':_self.tfh+'px'});_self.zoomImage.css({'width':'900px','height':_self.tfh+'px'})
_self.ovBodyTarget.append(_self.zoomImage);_self.isZoomable=_self.selectedImage.isZoomable;if(_self.isZoomable){jQuery('.zoomLevel').show();_self.minZoom();}else{jQuery('.zoomLevel').hide();}
_self.imageIsReady=true;e.preventDefault();});jQuery('.xControl').click(function(e){e.preventDefault();if(!jQuery(this).hasClass('xDisabled')){var arrowClass=jQuery(this).attr('class');var senseRegEx=new RegExp('x(Up|Down)');var results=senseRegEx.exec(arrowClass);if(results){category=results[1];}
switch(category){case'Up':{_self.xUpArrow.addClass('xDisabled');_self.xDownArrow.removeClass('xDisabled');_self.xListTop=0;}break;case'Down':{_self.xUpArrow.removeClass('xDisabled');_self.xDownArrow.addClass('xDisabled');_self.xListTop=_self.xWindowDelta;}break;}
_self.xList.animate({'top':_self.xListTop+'px'},500,function(){});}});jQuery('DIV#'+_self.parameters.overlay+' DIV.more-views DIV.zoomLevel A.zPlus').click(function(e){_self.maxZoom();e.preventDefault();});jQuery('DIV#'+_self.parameters.overlay+' DIV.more-views DIV.zoomLevel A.zMinus').click(function(e){_self.minZoom();e.preventDefault();});this.shroud.click(function(e){_self.closeAll();e.preventDefault();});this.overlay.find('A.closer').click(function(e){_self.closeAll();e.preventDefault();});jQuery(document).keyup(function(e){if(e.keyCode==27){_self.closeAll();}});}
miniOverlay.prototype.closeAll=function(){if(this.isOpen){this.closeOverlay();if(this.hideSelect)
jQuery('#TB_HideSelect').hide();}};miniOverlay.prototype.openAll=function(){this.openOverlay();}
miniOverlay.prototype.openOverlay=function(){var _self=this;_self.shroud.css({'display':'block'});_self.overlay.css({'display':'block'});_self.isOpen=true;}
miniOverlay.prototype.closeOverlay=function(){var _self=this;_self.overlay.css({'display':'none'});_self.shroud.css({'display':'none'});_self.isOpen=false;}
miniOverlay.prototype.maxZoom=function(){jQuery('DIV#'+this.parameters.overlay+' DIV.more-views DIV.zoomLevel A.zPlus').hide();jQuery('DIV#'+this.parameters.overlay+' DIV.more-views DIV.zoomLevel A.zMinus').show();this.selectedImage.zoomed=true;this.sc=100;this.setZoom(1);}
miniOverlay.prototype.minZoom=function(){jQuery('DIV#'+this.parameters.overlay+' DIV.more-views DIV.zoomLevel A.zPlus').show();jQuery('DIV#'+this.parameters.overlay+' DIV.more-views DIV.zoomLevel A.zMinus').hide();this.selectedImage.zoomed=false;this.sc=0;this.setZoom(this.selectedImage.minScale);}
miniOverlay.prototype.setZoom=function(ts){this.zoomImage=jQuery('DIV#'+this.parameters.overlay+' IMG.zoomImage');this.selectedImage.sw=this.selectedImage.w*ts;this.selectedImage.sh=this.selectedImage.h*ts;this.ox=-(this.selectedImage.sw-900)*this.selectedImage.xp;this.oy=-(this.selectedImage.sh-this.viewportHeight)*this.selectedImage.yp;this.zoomImage.css({'width':this.selectedImage.sw+'px','height':this.selectedImage.sh+'px','left':this.ox+'px','top':this.oy+'px'});}
miniOverlay.prototype.debugMessage=function(message){var linkDisplay=jQuery('<p></p>').addClass('test').html(message);jQuery('DIV#testPanel').empty().append(linkDisplay);}
function rfOverlay(parameters){this.parameters=parameters;this.shroud=jQuery('DIV#'+parameters.shroud);this.overlay=jQuery('DIV#'+parameters.overlay);this.opener=jQuery(parameters.opener);this.hideSelect=false;this.overlayWidth=parameters.width;this.overlayHeight=parameters.height;this.leftOffset=-(this.overlayWidth/2);this.topOffset=-(this.overlayHeight/2);this.type=parameters.type;this.googleMapWidth=580;this.googleMapHeight=580;}
rfOverlay.prototype.template=function(){};rfOverlay.prototype.installOverlay=function(){var _self=this;this.ovBody=this.overlay.find('DIV.ovBody');this.ovBodyTarget=this.ovBody.find('DIV.ovBodyInner');this.opener.click(function(e){_self.jsOpen(jQuery(this));e.preventDefault();});this.shroud.click(function(e){_self.closeAll();e.preventDefault();});this.overlay.find('A.closer').click(function(e){_self.closeAll();e.preventDefault();});jQuery(document).keyup(function(e){if(e.keyCode==27){_self.closeAll();}});};rfOverlay.prototype.jsOpen=function(opener){var _self=this;if(!_self.isOpen){if(typeof document.body.style.maxHeight==="undefined"){jQuery("body","html").css({height:"100%",width:"100%"});if(document.getElementById("gnr_HideSelect")===null){_self.hideSelect=true;jQuery("body").append("<iframe id='gnr_HideSelect'></iframe>");}}
_self.leftOffset=-(_self.overlayWidth/2);_self.topOffset=-(_self.overlayHeight/2);switch(_self.type){case'scroller':{}break;case'html':{}break;case'iframe':{_self.topOffset=_self.topOffset-80;jQuery('#rfTarget').attr('src',opener.attr('href'));}break;case'googlemap':{var thisStore=opener.parents('.store');var location={'title':thisStore.find('H4').html(),'address':thisStore.find('P').html(),'postcode':thisStore.find('INPUT[name=city]').val(),'city':thisStore.find('INPUT[name=postcode]').val(),'longitude':thisStore.find('INPUT[name=long]').val(),'latitude':thisStore.find('INPUT[name=lat]').val()};var map=new GMap2(document.getElementById("mapTarget"),{size:new GSize(_self.googleMapWidth,_self.googleMapHeight)});map.setUIToDefault();map.setCenter(new GLatLng(location.longitude,location.latitude),15);var myHtml='<h4>'+location.title+'</h4><p>'+location.address+'</p><br/>';map.openInfoWindowHtml(map.getCenter(),myHtml);}break;}
_self.overlay.css({'marginLeft':_self.leftOffset+'px','marginTop':_self.topOffset+'px'});_self.openAll();if(_self.type=='scroller'){_self.parameters.callback.update();}}};rfOverlay.prototype.closeAll=function(){if(this.isOpen){this.closeOverlay();if(this.hideSelect)
jQuery('#gnr_HideSelect').hide();}};rfOverlay.prototype.openAll=function(){this.openOverlay();}
rfOverlay.prototype.openOverlay=function(){var _self=this;_self.shroud.css({'display':'block'});_self.overlay.css({'display':'block'});_self.isOpen=true;}
rfOverlay.prototype.closeOverlay=function(){var _self=this;_self.overlay.css({'display':'none'});_self.shroud.css({'display':'none'});_self.isOpen=false;}
function voucherTotalizer(){this.fields=jQuery('UL.grouped-items INPUT.qty');this.submitForm=jQuery('FORM#product_addtocart_form');this.fieldWrappers=jQuery('DIV.itemQuantity');this.voucherValues=[];this.totalText=jQuery('SPAN#voucherTotal');this.fieldCount=this.fields.length;this.total=0;this.bindToFields();}
voucherTotalizer.prototype.template=function(){};voucherTotalizer.prototype.test=function(){alert('voucherTotalizer');};voucherTotalizer.prototype.bindToFields=function(){for(n=0;n<this.fieldCount;n++){this.voucherValues.push(parseInt(this.fields.eq(n).parent().parent().find('INPUT.voucherValue').val(),10));}
var _self=this;this.fields.change(function(){_self.updateTotal(this);}).keyup(function(){_self.updateTotal(this);}).blur(function(){_self.updateTotal(this);});};voucherTotalizer.prototype.updateTotal=function(field){this.total=0;var quantityRegEx=/^[\d]+$/;for(n=0;n<this.fieldCount;n++){var thisField=this.fields.eq(n);var thisFieldString=thisField.val();var results=quantityRegEx.test(thisFieldString);var thisItemQuantity=(results)?parseInt(thisFieldString,10):0;thisField.val(thisItemQuantity);this.total+=(thisItemQuantity*this.voucherValues[n]);}
this.totalText.text(this.total);this.setValidationMarkers(this.isNotZeroQuantity());};voucherTotalizer.prototype.isNotZeroQuantity=function(){return(this.total!=0);}
voucherTotalizer.prototype.setValidationMarkers=function(isValid){switch(isValid){case true:{this.fieldWrappers.addClass('valid').removeClass('invalid');}break;case false:{this.fieldWrappers.addClass('invalid').removeClass('valid');}break;}}
voucherTotalizer.prototype.doValidation=function(){this.setValidationMarkers(this.isNotZeroQuantity());return this.isNotZeroQuantity();}
function mainNavigation(parameters){this.menuOpenDelay=parameters.openDelay;this.menuCloseDelay=parameters.closeDelay;this.menuItems=parameters.menuItems;this.menuLinks=parameters.menuLinks;this.isIE7=parameters.isIE7;this.isHomePage=parameters.isHomePage;this.offsets=parameters.offsets;this.isDropdownOpen=false;this.dropdown;this.openTimer;this.closeTimer;this.openIndex=-1;this.newOffsets=[];this.install();}
mainNavigation.prototype.template=function(){};mainNavigation.prototype.install=function(){var _self=this;this.menuItems.hover(function(){var thisNode=jQuery(this);var thisIndex=_self.menuItems.index(thisNode);if(_self.isDropdownOpen&&(thisIndex!=_self.openIndex)){_self.closeMenuItem(_self.parent);}
_self.openIndex=thisIndex;_self.parent=thisNode;clearTimeout(_self.closeTimer);_self.openTimer=window.setTimeout(function(){_self.openMenuItem(_self.parent);},_self.menuOpenDelay);},function(){clearTimeout(_self.openTimer);_self.closeTimer=window.setTimeout(function(){_self.closeMenuItem(_self.parent);},_self.menuCloseDelay);});};mainNavigation.prototype.fixForIE7=function(node){var windowWidth=parseInt(jQuery(window).width(),10);var pageOffset;if(windowWidth>=996){pageOffset=Math.floor((windowWidth-996)/2);}else{pageOffset=0;}
for(n=0;n<this.menuItems.length;n++){var thisOffset=this.offsets[n]+pageOffset;this.newOffsets[n]=thisOffset;this.menuItems.eq(n).find('.wrapper').eq(0).css({'left':this.newOffsets[n]+'px'});}}
mainNavigation.prototype.openMenuItem=function(node){this.doMenuItem('show',node);};mainNavigation.prototype.closeMenuItem=function(node){this.doMenuItem('hide',node);};mainNavigation.prototype.doMenuItem=function(state,node){this.dropdown=node.find('.wrapper').eq(0);var display=(state=='show')?'block':'none';this.isDropdownOpen=(state=='show');this.dropdown.css({'display':display});};mainNavigation.prototype.hideAll=function(){jQuery('.nav-container .menuAddon').remove();jQuery('.nav-container #nav li .wrapper').css({'display':'none'});this.isDropdownOpen=false;}
function lifestyleOverlay(parameters){this.parameters=parameters;this.shroud=jQuery('DIV#'+parameters.shroud);this.overlay=jQuery('DIV#'+parameters.overlay);this.opener=jQuery(parameters.opener);this.flashConfig=parameters.flashConfig;this.swf=parameters.swf;this.swfID=parameters.swfID;this.hideSelect=false;this.windowSize;this.isOpen=false;this.overlayLoaded=false;this.pH;}
lifestyleOverlay.prototype.template=function(){};lifestyleOverlay.prototype.getWindowSize=function(){this.windowSize={'w':parseInt(jQuery(window).width(),10),'h':parseInt(jQuery(window).height(),10)};this.windowSize.aspectRatio=this.windowSize.w/this.windowSize.h;};lifestyleOverlay.prototype.installOverlay=function(){var _self=this;this.ovBody=this.overlay.find('DIV.ovBody');this.ovBodyTarget=this.ovBody.find('DIV.ovBodyInner');this.getWindowSize();this.leftOffset=Math.floor((this.windowSize.w-900)/2);jQuery(window).resize(function(){_self.getWindowSize();_self.leftOffset=Math.floor((_self.windowSize.w-900)/2);});this.opener.click(function(e){e.preventDefault();if(!_self.isOpen){_self.getWindowSize();if(typeof document.body.style.maxHeight==="undefined"){jQuery("body","html").css({height:"100%",width:"100%"});jQuery("html").css("overflow","hidden");if(document.getElementById("TB_HideSelect")===null){_self.hideSelect=true;jQuery("body").append("<iframe id='TB_HideSelect'></iframe>");}}
_self.pH=_self.windowSize.h;_self.viewportHeight=_self.pH-48;_self.overlay.css({'marginLeft':'-474px','marginTop':0+'px','width':'948px','height':_self.pH+'px'});_self.ovBody.css({'height':(_self.pH-70)+'px'});_self.ovBodyTarget.css({'height':_self.viewportHeight+'px'});_self.openAll();_self.afterPreload();pagetTimestamp.now();var variables={"configLocation":_self.flashConfig+"?time="+pagetTimestamp.returnTimestamp()};var parameters={"allowFullScreen":"true","allowscriptaccess":"always","wmode":"opaque",'swliveconnect':'true',"scale":"noscale","salign":"t"};var attributes={};swfobject.embedSWF(_self.swf,_self.swfID,'900',_self.viewportHeight,'9.0.28',false,variables,parameters,attributes,function(){});}});};lifestyleOverlay.prototype.afterPreload=function(){var _self=this;this.shroud.click(function(e){_self.closeAll();e.preventDefault();});this.overlay.find('A.closer').click(function(e){_self.closeAll();e.preventDefault();});jQuery(document).keyup(function(e){if(e.keyCode==27){_self.closeAll();}});}
lifestyleOverlay.prototype.closeAll=function(){if(this.isOpen){this.closeOverlay();if(this.hideSelect)
jQuery('#TB_HideSelect').hide();}};lifestyleOverlay.prototype.openAll=function(){this.openOverlay();}
lifestyleOverlay.prototype.openOverlay=function(){var _self=this;_self.shroud.css({'display':'block'});_self.overlay.css({'display':'block'});_self.isOpen=true;}
lifestyleOverlay.prototype.closeOverlay=function(){var _self=this;_self.overlay.css({'display':'none'});_self.shroud.css({'display':'none'});_self.isOpen=false;}
function submitNotification()
{var size=jQuery('.super-attribute-select option[value='+jQuery('.super-attribute-select').val()+']').html();var productSku=jQuery('#productSku').val();var productName=jQuery('#productName').val();var customerEmail=jQuery('#customerEmail').val();jQuery('.notificationLoader').css('display','block');jQuery.ajax({type:"POST",url:'/contacts/index/postNotification/',data:{size:size,productName:productName,productSku:productSku,customerEmail:customerEmail},success:function(data){if(data=='error'){jQuery('.notificationLoader').css('display','none');alert('Please check your email.');}else{jQuery('.notificationForm').html('<span class="notificationMessage">Your notification was submited.</span>');jQuery('.notificationLoader').css('display','none');}}});return false;}
function siteMapPanel(){this.siteMapHeight=430;this.siteMapSpeed=500;this.opener=jQuery('A.sitemapOpener');this.closer=jQuery('DIV.block-sitemap A.closer');this.panel=jQuery('DIV.footer DIV.block-sitemap');this.isOpen=false;this.install();}
siteMapPanel.prototype.template=function(){};siteMapPanel.prototype.install=function(){var _self=this;this.seoHeight=parseInt(this.panel.find('ul.mainNav').height(),10)+160;this.opener.addClass('closed');this.opener.click(function(e){_self.toggle();e.preventDefault();});this.closer.click(function(e){_self.toggle();e.preventDefault();});};siteMapPanel.prototype.toggle=function(){var _self=this;if(this.opener.hasClass('closed')){this.opener.addClass('open').removeClass('closed');this.panel.animate({'height':this.seoHeight+'px'},this.siteMapSpeed,function(){_self.isOpen=true;});}else{this.opener.addClass('closed').removeClass('open');this.panel.animate({'height':'0px'},this.siteMapSpeed,function(){_self.isOpen=false;});}};function plainScroller(parameters){this.slider=parameters.slider;this.overlay=parameters.overlay;this.panelHeight=505;this.contentHeight=0;this.sliderEnabled=true;this.scrollerPosition=0;this.wheelScale=5;this.install();};plainScroller.prototype.template=function(){};plainScroller.prototype.install=function(){var self=this;if(this.sliderEnabled){if(this.slider.length!=0){this.slider.slider({orientation:"vertical",value:100,min:0,max:100,slide:function(event,ui){var thisMarker=100-ui.value;self.scrollerPosition=thisMarker;var offset=Math.floor(-(thisMarker/100)*(self.contentHeight-self.panelHeight));jQuery('DIV.contentContainer').css({top:offset+'px'});}});}
jQuery('DIV.contentScroller').mousewheel(function(e,delta){if(self.sliderEnabled){self.scrollerPosition=self.scrollerPosition-(delta*self.wheelScale)
if(self.scrollerPosition<0)self.scrollerPosition=0;if(self.scrollerPosition>100)self.scrollerPosition=100;self.setScroll(100-self.scrollerPosition);e.preventDefault();}});}
this.update();};plainScroller.prototype.update=function(){height=this.overlay.find('.contentContainer').height();this.height=(typeof height=='number')?height:0;if(this.height>this.panelHeight){this.showSlider();this.contentHeight=this.height;this.slider.slider('value',100);jQuery('DIV.contentContainer').css({top:'0px'});}else{this.hideSlider();}};plainScroller.prototype.showSlider=function(){this.sliderEnabled=true;jQuery('DIV.contentScroller DIV.controlPanel').css({display:'inline'});};plainScroller.prototype.hideSlider=function(){this.sliderEnabled=false;jQuery('DIV.contentScroller DIV.controlPanel').css({display:'none'});};plainScroller.prototype.setScroll=function(position){this.slider.slider('value',position);var offset=Math.floor(-((100-position)/100)*(this.contentHeight-this.panelHeight));jQuery('DIV.contentContainer').css({top:offset+'px'});};function timeline(parameters){this.parameters=parameters;this.panelWidth=parameters.panelWidth;this.scrollSpeed=parameters.scrollSpeed;this.autoDelay=parameters.autoDelay;this.panel=parameters.panel;this.ticks=parameters.ticks;this.timeline=this.ticks.parent().parent();this.marker=parameters.marker;this.arrows=parameters.arrows;this.leftArrow=parameters.leftArrow;this.rightArrow=parameters.rightArrow;this.play=parameters.play;this.stop=parameters.stop;this.reset=parameters.reset;this.tickOffset=parameters.tickOffset;this.tickPadding=parameters.tickPadding;this.tickIndex=0;this.tickCount;this.isAutoRun=true;this.autoTimer;this.tlMarkerOffsets=[];this.install();};timeline.prototype.template=function(){};timeline.prototype.install=function(){var _self=this;var windowHREF=window.location.href;var anchorRegEx=/tick=([\d]+|Timeless)/;var results=anchorRegEx.exec(windowHREF);this.startID=(results)?results[1]:false;this.ticks.each(function(i){var thisTick=jQuery(this);var thisWidth=thisTick.width()+_self.tickPadding;var thisPosition=thisTick.position();_self.tlMarkerOffsets.push({'left':thisPosition.left,'width':thisWidth});});this.tickCount=this.tlMarkerOffsets.length;this.play.hide();this.ticks.click(function(e){if(_self.isAutoRun){_self.stopAuto();}
_self.tickIndex=_self.ticks.index(jQuery(this));_self.update();e.preventDefault();});this.arrows.click(function(e){if(_self.isAutoRun){_self.stopAuto();}
_self.arrowClick(jQuery(this));e.preventDefault();});this.play.click(function(e){_self.playAuto();e.preventDefault();});this.stop.click(function(e){_self.stopAuto();e.preventDefault();});this.reset.click(function(e){_self.goToFirst();e.preventDefault();});if(this.startID){this.tickIndex=this.ticks.index(this.timeline.find('a[href=#tlp'+this.startID+']'));if(this.tickIndex!=-1){this.snapto();}}
this.displayArrows();this.playAuto();}
timeline.prototype.update=function(){var _self=this;this.displayArrows();this.ticks.removeClass('current');var newOffset=-this.panelWidth*this.tickIndex;var thisMarker=this.tlMarkerOffsets[this.tickIndex];this.marker.stop().animate({'left':(thisMarker.left+this.tickOffset)+'px','width':thisMarker.width+'px'},this.scrollSpeed,function(){_self.ticks.eq(_self.tickIndex).addClass('current');});this.panel.stop().animate({'left':newOffset+'px'},this.scrollSpeed,function(){});}
timeline.prototype.snapto=function(){this.displayArrows();this.ticks.removeClass('current');var newOffset=-this.panelWidth*this.tickIndex;var thisMarker=this.tlMarkerOffsets[this.tickIndex];this.marker.css({'left':(thisMarker.left+this.tickOffset)+'px','width':thisMarker.width+'px'});this.panel.css({'left':newOffset+'px'});this.ticks.eq(this.tickIndex).addClass('current');}
timeline.prototype.auto=function(){var _self=this;this.tickIndex++;if(this.tickIndex==this.tickCount)
this.tickIndex=0;this.update();this.autoTimer=window.setTimeout(function(){_self.auto();},this.autoDelay);}
timeline.prototype.doLeft=function(){this.tickIndex--;if(this.tickIndex==-1)
this.tickIndex=0;}
timeline.prototype.doRight=function(){this.tickIndex++;if(this.tickIndex==this.tickCount)
this.tickIndex=(this.tickCount-1);}
timeline.prototype.arrowClick=function(target){var arrowClass=target.attr('class');var senseRegEx=new RegExp('(left|right)Arrow');var results=senseRegEx.exec(arrowClass);if(results){category=results[1];}
switch(category){case'left':{this.doLeft();this.update();}break;case'right':{this.doRight();this.update();}break;}}
timeline.prototype.displayArrows=function(){if(this.tickIndex==0){this.leftArrow.hide();}else{this.leftArrow.show();}
if(this.tickIndex==(this.tickCount-1)){this.rightArrow.hide();}else{this.rightArrow.show();}}
timeline.prototype.goToFirst=function(){this.tickIndex=0;this.update();}
timeline.prototype.playAuto=function(){var _self=this;this.isAutoRun=true;this.play.hide();this.stop.show();this.autoTimer=window.setTimeout(function(){_self.auto();},this.autoDelay);}
timeline.prototype.stopAuto=function(){this.isAutoRun=false;this.play.show();this.stop.hide();clearTimeout(this.autoTimer);}
function footerControl(parameters){alert('footerControl');}
