/*jslint bitwise: true, browser: true, eqeqeq: true, immed: true, newcap: true, nomen: true, onevar: true, plusplus: true, regexp: false, undef: true *//*global Animate, lightbox, slideshow*/var browser = (function (window) {var isKhtml = document.childNodes && !document.all && !navigator.taintEnabled;return {gecko: !isKhtml && navigator.product === 'Gecko',khtml: isKhtml && navigator.vendor === 'KDE',presto: typeof window.opera === 'object',trident: /*@cc_on!@*/false,webkit: isKhtml && navigator.vendor !== 'KDE'};}(this));document.addEvent('ready', function () {var i, link, links = document.links;for (i = 0; (link = links[i]); i += 1) {if (!(/mailto:/).test(link.href) && link.hostname.search(location.hostname) === -1 && (/http(s)?:/).test(link.href)) {link.target = '_blank';link.title = 'Link opens in new window';}}});document.addEvent('ready', function () {if (document.getElementById('slideshow')) {slideshow('slideshow', 3000);}});document.addEvent('ready', function () {var i, input, inputs = document.get('#login input'), blur = function () {if (this.getProperty('value') === '') {this.setProperty('value', this.getProperty('title').toLowerCase());}}, focus = function () {if (this.getProperty('value') === this.getProperty('title').toLowerCase()) {this.setProperty('value', '');}};document.get('#login a')[0].addEvent('click', function (event) {var animate, login = document.get('login'), toggle = this;if (login.offsetLeft > 400) {animate = new Animate(login.style, 'right', Animate.snapOut, -444, 9, 1.2, 'px');animate.start();toggle.addClass('active');animate.onfinish = function () {inputs[0].focus();};} else {animate = new Animate(login.style, 'right', Animate.snapIn, 9, -444, 0.6, 'px');animate.start();animate.onfinish = function () {toggle.removeClass('active');};}event.preventDefault();});if (browser.gecko) {document.get('#login a')[0].style.top = '-4px';}for (i = 0; (input = inputs[i]); i += 1) {input.addEvent('blur', blur).addEvent('focus', focus);}});document.addEvent('ready', function () {if (document.get('.scroller')) {var cancel = function (event) {event.preventDefault();}, galleries = document.get('.storeSlides'), gallery, i, image, images, j, left = function (event) {var animate, callback = arguments.callee, scroller = this.parentNode.getElementsBySelector('.scroller')[0], target = this;if (scroller.offsetLeft >= 0) {return event.preventDefault();}this.removeEvent('click', callback);animate = new Animate(scroller.style, 'left', Animate.easeOut, scroller.offsetLeft, (scroller.offsetLeft + 336), 1.2, 'px');animate.start();animate.onfinish = function () {target.addEvent('click', callback);};}, mouseover = function (event) {this.storeImage.setProperty('src', this.getProperty('src').replace('tn/', ''));this.storeImageTitle.setProperty('html', '<strong>Tour the Market</strong> ' + this.getProperty('alt'));}, right = function (event) {var animate, callback = arguments.callee, scroller = this.parentNode.getElementsBySelector('.scroller')[0], target = this, totalWidth = (this.parentNode.getElementsBySelector('.scroller img') || []).length * 83;if (((scroller.offsetLeft * -1) + 335) > totalWidth) {return event.preventDefault();}this.removeEvent('click', callback);animate = new Animate(scroller.style, 'left', Animate.easeOut, scroller.offsetLeft, scroller.offsetLeft - 336, 1.2, 'px');animate.start();animate.onfinish = function () {target.addEvent('click', callback);};};for (i = 0; (gallery = galleries[i]); i += 1) {images = gallery.getElementsBySelector('.scroller img') || [];gallery.insertBefore(document.set('a', {'class': 'scrollLeft', href: '#', title: 'Scroll Left…'}).addEvent('click', left).addEvent('click', cancel), gallery.firstChild);gallery.appendChild(document.set('a', {'class': 'scrollRight', href: '#', title: 'Scroll Right…'}).addEvent('click', right).addEvent('click', cancel));for (j = 0; (image = images[j]); j += 1) {image.storeImage = gallery.parentNode.getElementsBySelector('.storeImage')[0];image.storeImageTitle = gallery.parentNode.getElementsBySelector('.storeImageTitle')[0];image.addEvent('mouseover', mouseover);}}lightbox.initialize(1, 85, 8, true, 5000);}});document.ready();(function () {var ga = document.createElement('script');ga.async = true;ga.src = ('https:' === document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';ga.type = 'text/javascript';(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(ga);}());