/*jslint bitwise: true, browser: true, newcap: true, nomen: false, onevar: true, plusplus: true, regexp: false, undef: true *//*Analogue 1.11.01, Copyright (c) 2011 Analogue Web Design LLC, all rights reserved.*/var analogue = (function (window, root) {"use strict";var build = new Date(1295971797285), detect = (function () {var a, div = document.createElement('div');root.className = 'hasJs';div.innerHTML = '<form><a href="/a" style="color:red;float:left;opacity:.5">a</a><input /></form>';div.getElementsByTagName('input')[0].setAttribute('name', 'nameAttribute');a = div.getElementsByTagName('a')[0];if (!window.HTMLElement) {if (window.Element && window.Element.prototype) {window.HTMLElement = window.Element;} else {if (window['[[DOMElement.prototype]]']) {window.HTMLElement = function () {};window.HTMLElement.prototype = window['[[DOMElement.prototype]]'];}}}return {cssFloat: !!a.style.cssFloat ? 'cssFloat' : 'styleFloat',encType: !!div.getElementsByTagName('form')[0].encoding ? 'encoding' : 'enctype',getElementById: (function () {var div = document.createElement('div'), id = 'id' + new Date().getTime(), value = true;div.innerHTML = '<a name="' + id + '"></a>';root.insertBefore(div, root.firstChild);value = !div.ownerDocument.getElementById(id);root.removeChild(div);return value;}()),href: a.getAttribute('href') === '/a',isIe: /*@cc_on!@*/false,style: (/red/).test(a.getAttribute('style')),setAttribute: (/nameAttribute/).test(div.innerHTML),arraySlice: (function () {try {return !!Array.prototype.slice.call(root.childNodes)[0];} catch (e) {return false;}}()),opacity: a.style.opacity === '0.5',textContent: a.textContent === 'a' ? 'textContent' : 'innerText'};}()), events = (function () {var cancelBubble, fixEvent = function (element, event) {event.metaKey = event.ctrlKey;event.pageX = event.clientX + Math.max(root.scrollLeft, document.body.scrollLeft) - (root.clientLeft || 0);event.pageY = event.clientY + Math.max(root.scrollTop, document.body.scrollTop) - (root.clientTop || 0);event.preventDefault = function () {this.returnValue = false;};event.relatedTarget = event.type === 'mouseover' ? event.fromElement : event.type === 'mouseout' ? event.toElement : undefined;event.stopPropagation = function () {this.cancelBubble = true;};event.target = event.srcElement || element;event.timeStamp = new Date().getTime();event.which = event.charCode = event.keyCode;if (!event.which && event.button) {event.which = (event.button === 1 ? 1 : (event.button === 4 ? 2 : (event.button === 2 ? 3 : 0)));}return event;}, guid = 0, meta = null, returnValue, handleEvent = function (event) {event = event || fixEvent(this, window.event);var i, listeners = this.events[event.type];for (i in listeners) {if (listeners.hasOwnProperty(i)) {meta.pseudoEvent = {'listener': listeners[i], 'target': this, 'event': event};if (returnValue === false) {event.preventDefault();}if (cancelBubble === true) {event.stopPropagation();}}}};if (root.attachEvent) {meta = document.createElement('meta');meta.pseudoEvent = null;meta.attachEvent('onpropertychange', function (event) {if (event.propertyName === 'pseudoEvent') {meta.pseudoEvent.listener.call(meta.pseudoEvent.target, meta.pseudoEvent.event);returnValue = meta.pseudoEvent.event.returnValue;cancelBubble = meta.pseudoEvent.event.cancelBubble;}});document.getElementsByTagName('head')[0].appendChild(meta);}return {addEvent: root.addEventListener ? function (type, listener) {this.addEventListener(type, listener, false);return this;} : function (type, listener) {if (!listener.guid) {listener.guid = (guid += 1);}this.events = this.events || {};if (!this.events[type]) {this.events[type] = {};if (this['on' + type]) {this.events[type][0] = this['on' + type];}this['on' + type] = handleEvent;}this.events[type][listener.guid] = listener;return this;},removeEvent: root.removeEventListener ? function (type, listener) {this.removeEventListener(type, listener, false);return this;} : function (type, listener) {if (this.events && this.events[type] && listener.guid) {delete this.events[type][listener.guid];}return this;},triggerEvent: root.dispatchEvent ? function (type, which) {var charCode = 0, event = null, keyCode = 0;if (/mouse|click/.test(type)) {event = document.createEvent('MouseEvents');if (event.initMouseEvent) {event.initMouseEvent(type, true, true, window, 0, 0, 0, 0, 0, false, false, false, false, which || 0, null);} else {event = document.createEvent('UIEvents');event.initEvent(type, true, true);event.button = which || 0;}} else if (/key(down|press|up)/.test(type)) {if (which) {which = typeof which === 'number' ? which : which.charCodeAt(0);if (type === 'keypress') {if ((which > 64 && which < 91) || (which > 96 && which < 123)) {charCode = which;} else {keyCode = which;}} else {keyCode = which;}}try {event = document.createEvent('KeyEvents');event.initKeyEvent(type, true, true, window, false, false, false, false, keyCode, charCode);} catch (e) {try {event = document.createEvent('Events');} catch (er) {event = document.createEvent('UIEvents');} finally {event.initEvent(type, true, true);event.keyCode = keyCode;event.charCode = charCode;event.which = which || 0;}}} else {event = document.createEvent('HTMLEvents');event.initEvent(type, true, true);}return this.dispatchEvent(event);} : function (type, which) {var event = document.createEventObject();if (/mouse|click/.test(type)) {event.button = (which === 0 ? 1 : (which === 1 ? 4 : (which === 2 ? 2 : 0)));} else if (/key(down|press|up)/.test(type)) {event.keyCode = which ? (typeof which === 'number' ? which : which.charCodeAt(0)) : 0;}event.type = type;return this.fireEvent('on' + type, fixEvent(this, event));}};}()), extend = function (object, source) {var i;if (!source) {source = object;object = this;}for (i in source) {if (source.hasOwnProperty(i) && !object[i]) {object[i] = source[i];}}return object;}, methods = (function () {var booleans = {'checked': 'checked','disabled': 'disabled','multiple': 'multiple','readonly': 'readOnly','selected': 'selected'}, getOpacity = function (element) {if (detect.opacity) {return window.getComputedStyle(element, null).opacity || 1;}try {return element.filters.item('DXImageTransform.Microsoft.Alpha').opacity / 100;} catch (e) {try {return element.filters.alpha.opacity / 100;} catch (er) {}}return 1;}, i, properties = {'accesskey': 'accessKey','class': 'className','enctype': detect.encType,'float': detect.cssFloat,'for': 'htmlFor','html': 'innerHTML','maxlength': 'maxLength','tabindex': 'tabIndex','text': detect.textContent,'value': 'value'};for (i in booleans) {if (booleans.hasOwnProperty(i)) {properties[i] = booleans[i];}}return {addClass: function (value) {var classes = this.className.split(' ');if (!this.hasClass(value)) {classes.push(value);this.className = classes.join(' ');}return this;},getProperty: function (attribute) {if (attribute === 'style' && !detect.style) {return this.style.cssText.toLowerCase();}if (attribute === 'opacity') {return getOpacity(this);}if ((/^(href|src|type|value)$/i).test(attribute) && !detect.href) {return this.getAttribute(attribute, 2);}if (booleans[attribute]) {return !!this[properties[attribute]];}return properties[attribute] ? this[properties[attribute]] : this.getAttribute(attribute);},hasClass: function (value) {return this.className && new RegExp('(^|\\s)' + value + '($|\\s)').test(this.className);},removeClass: function (value) {var classes = this.className.split(' '), i, ii;for (i = 0, ii = classes.length; i < ii; i += 1) {if (classes[i] === value) {classes.splice(i, 1);}}this.className = classes.join(' ');return this;},setProperty: function (attribute, value) {if (attribute === 'style' && !detect.style) {this.style.cssText = value;} else if (attribute === 'opacity') {if (detect.opacity) {this.style.opacity = value;} else if (this.style.filter !== undefined) {this.style.filter = 'alpha(opacity=' + value * 100 + ')';}} else if (attribute.match(/^on(\w+)$/i) && typeof value === 'function') {this.addEvent(RegExp.$1, value);} else if (properties[attribute]) {if (booleans[attribute] && typeof value !== 'boolean') {value = (typeof value !== 'undefined') ? true : false;}this[properties[attribute]] = value;} else {this.setAttribute(attribute, value);}return this;},toggleClass: function (value) {if (this.hasClass(value)) {this.removeClass(value);} else {this.addClass(value);}return this;}};}()), path = (function (src) {return src.replace('?' + location.search, '').replace(/((\/)*[\w\.]+)$/, '/').replace(new RegExp('^' + location.protocol + '//' + location.host), '');}(document.getElementsByTagName('script')[0].src)), selectors = (function () {var clean = function (string) {return string.replace(/^\s+|\s+$/g, '');}, getElementById = detect.getElementById ? function (id) {return document.getElementById(id);} : function (id) {var element = document.getElementById(id), elements, i, ii;if (element) {if (element.id === id) {return element;} else {elements = document.all[id];for (i = 1, ii = elements.length; i < ii; i += 1) {if (elements[i].id === id) {return element;}}}}return null;}, getElements = function (context, tag, combinator) {tag = (tag ? tag : '*').toLowerCase();var child, children, collection = [], element, elements, i, ii, j, jj;for (i = 0, ii = context.length; i < ii; i += 1) {switch (combinator) {case '>':children = context[i].childNodes;for (j = 0, jj = children.length; j < jj; j += 1) {child = children[j];if (child.nodeType === 1 && child.nodeName !== '!') {if (tag === '*' || child.nodeName.toLowerCase() === tag) {collection.push(child);}}}break;case '+':element = context[i].nextSibling;while (element) {if (element.nodeType === 1 && element.nodeName !== '!') {if (tag !== '*' && element.nodeName.toLowerCase() !== tag) {break;}collection.push(element);break;} else {element = element.nextSibling;}}break;default:elements = context[i].getElementsByTagName(tag);for (j = 0, jj = elements.length; j < jj; j += 1) {collection.push(elements[j]);}}}return collection;}, getPrevious = function (element) {while (element && element.nodeType !== 1) {element = element.previousSibling;}return element;}, parse = function (context, selector) {context = [context];selector = clean(selector.replace(/\s*(>|\+)\s*/g, ' $1'));var combinator, element, elements, i, ii, j, jj, k, kk, match, name, operator, parts, property, token, tokens = selector.split(' '), value;for (i = 0, ii = tokens.length; i < ii; i += 1) {token = clean(tokens[i]);if ((/^(>|\+)/i).test(token)) {combinator = RegExp.$1;token = token.replace(combinator, '');}if (token.indexOf('#') > -1) {parts = token.split('#');element = getElementById(parts[1]);if (!element || (parts[0] && element.nodeName.toLowerCase() !== parts[0])) {return [];}context = [element];} else if (token.indexOf('.') > -1) {parts = token.split('.');elements = getElements(context, parts[0], combinator);context = [];for (j = 0, jj = elements.length; j < jj; j += 1) {element = elements[j];match = true;for (k = 1, kk = parts.length; k < kk; k += 1) {if (!element.className || !new RegExp('(^|\\s)' + parts[k] + '(\\s|$)').test(element.className)) {match = false;break;}}if (match) {context.push(element);}}} else if ((/^(\w*):first\-child$/i).test(token)) {elements = getElements(context, RegExp.$1, combinator);context = [];for (j = 0, jj = elements.length; j < jj; j += 1) {element = elements[j];if (!getPrevious(element.previousSibling)) {context.push(element);}}} else if ((/^(\w*)\[(\w+)([=~\|\^\$\*]?)=?"?([\w]*)"?\]$/i).test(token)) {elements = getElements(context, RegExp.$1, combinator);context = [];name = RegExp.$2;operator = RegExp.$3;value = RegExp.$4;for (j = 0, jj = elements.length; j < jj; j += 1) {element = elements[j];property = element.getProperty(name);if (property) {if (!operator) {context.push(element);} else if (operator === '=' && property === value) {context.push(element);} else if (operator === '~' && new RegExp('(^|\\s)' + value + '(\\s|$)').test(property)) {context.push(element);} else if (operator === '^' && property.indexOf(value) === 0) {context.push(element);} else if (operator === '$' && property.lastIndexOf(value) === (property.length - value.length)) {context.push(element);} else if (operator === '*' && (property.indexOf(value) + 1)) {context.push(element);} else if (operator === '|' && new RegExp('^' + value + '-').test(property)) {context.push(element);}}}} else {context = getElements(context, token, combinator);}}return context;}, unique = function (collection) {var element, filtered = [], i, ii;for (i = 0, ii = collection.length; i < ii; i += 1) {element = collection[i];if (!element.included && element.nodeName !== '!') {element.included = true;filtered.push(element);}}for (i = 0, ii = filtered.length; i < ii; i += 1) {filtered[i].included = null;}return filtered;};return {match: document.querySelectorAll ? function (context, selector) {var collection = [], elements = context.querySelectorAll(selector), i = 0;if (detect.arraySlice) {return Array.prototype.slice.call(elements);}while (elements[i]) {collection.push(elements[i]);i += 1;}return collection;} : function (context, selector) {var collection = [], i, ii, groups = selector.split(',');for (i = 0, ii = groups.length; i < ii; i += 1) {collection = collection.concat(parse(context, groups[i]));}return unique(collection);}};}()), versioning = [1, String(build.getFullYear()).slice(2), String((build.getMonth() + 1) / 100).slice(2)];extend(methods, extend(events, {getElementsByAttribute: function (name, value, tag) {return selectors.match(this, (tag ? tag : '') + '[' + name + (value ? '~="' + value + '"' : '') + ']');},getElementsByClassName: function (value) {return selectors.match(this, '.' + value.replace(' ', '.'));},getElementsBySelector: function (selector) {return selectors.match(this, selector);}}));extend(Function.prototype, {bind: function (object) {var method = this;return function () {return method.apply(object, arguments);};},extend: extend,inherit: function (object) {this.prototype = object;return this;}});extend(window, {addEvent: function () {return events.addEvent.apply(window, arguments);},removeEvent: function () {return events.removeEvent.apply(window, arguments);},triggerEvent: function () {return events.triggerEvent.apply(window, arguments);}});extend(document, {addEvent: function (type, listener) {if ((/^(dom|ready)+(contentloaded)*$/i).test(type)) {if (!this.ready.fired) {events.addEvent.call(this, 'dataavailable', listener);} else {listener.apply(this, arguments);}return this;} else {return events.addEvent.call(this, type, listener);}},get: function (query) {var attempt = 'getElementById,getElementsByTagName,getElementsByClassName,getElementsBySelector'.split(','), i, ii, result;for (i = 0, ii = attempt.length; i < ii; i += 1) {try {result = this[attempt[i]](query);if (result !== null && (result.length === undefined || result.length !== 0)) {return result;}} catch (e) {}}return null;},head: document.getElementsByTagName('head')[0],loadScript: function (source) {var script = this.createElement('script');script.setAttribute('type', 'text/javascript');script.setAttribute('src', source);this.head.appendChild(script);return this;},loadStyleSheet: function (source, media) {var sheet = this.createElement('link');sheet.setAttribute('href', source);sheet.setAttribute('media', media || 'screen');sheet.setAttribute('rel', 'stylesheet');sheet.setAttribute('type', 'text/css');this.head.appendChild(sheet);return this;},ready: function () {if (!document.ready.fired) {document.ready.fired = true;document.ready.fire();if (document.removeEventListener) {document.removeEventListener('DOMContentLoaded', document.ready, false);}window.removeEvent('load', document.ready);}}.extend({fire: root.dispatchEvent ? function () {var event = document.createEvent('HTMLEvents');event.initEvent('dataavailable', true, true);document.dispatchEvent(event);} : function () {var event = document.createEventObject();event.type = 'dataavailable';document.fireEvent('on' + event.type, event);},fired: false}),set: function (tag, attributes, content) {var element, i, ii;if (attributes && !detect.setAttribute) {for (i in attributes) {if (i.match(/^(checked|multiple|name|readonly|type)$/i)) {tag += ' ' + i + '="' + attributes[i] + '"';delete attributes[i];}}tag = '<' + tag + '>';}element = document.createElement(tag);if (attributes) {for (i in attributes) {if (attributes.hasOwnProperty(i)) {element.setProperty(i, attributes[i]);}}}if (content) {if (typeof content === 'string') {element.appendChild(document.createTextNode(content));} else {for (i = 0, ii = content.length; i < ii; i += 1) {if (typeof content[i] === 'string') {content[i] = document.createTextNode(content[i]);}element.appendChild(content[i]);}}}return element;}});extend(document, events);if (window.HTMLElement) {extend(window.HTMLElement.prototype, methods);} else {document.create = document.createElement;document.createElement = function (tag) {return extend(document.create(tag), methods);};document.addEvent('ready', function () {var elements = document.getElementsByTagName('*'), i, ii;for (i = 0, ii = elements.length; i < ii; i += 1) {extend(elements[i], methods);}});}if (document.addEventListener) {document.addEventListener('DOMContentLoaded', document.ready, false);} else if (detect.isIe) {document.loadScript(path + 'Analogue.MSIE').write(decodeURI('%3Cscript defer src="//:" onreadystatechange="if(this.readyState===\'complete\'){document.ready();}"%3E%3C/script%3E'));}window.addEvent('load', document.ready);return {path: path,version: versioning.join('.') + ' (' + parseInt(build.valueOf() / 1000, 10) + ')'};}(this, document.documentElement));/*Analogue.Forms 1.11.01, Copyright (c) 2011 Analogue Web Design LLC, all rights reserved.*/analogue.forms = (function (window) {"use strict";var build = new Date(1295224896735), check = {alpha: function (value) {return !(/[^a-zA-Z]/g).test(value);},alphaNumeric: function (value) {return !(/[^a-zA-Z\d]/g).test(value);},creditCard: (function () {var cards = [{length: '15', name: 'American Express', prefix: /^3[4|7]{1}/},{length: '16', name: 'Discover', prefix: /^(6011|622|(64[4-9]{1})|65)/},{length: '16', name: 'MasterCard', prefix: /^5[1-5]{1}/},{length: '13,16', name: 'Visa', prefix: /^4/}];return {length: function (element) {var i, ii, lengths = cards[element.cardType].length.split(','), value = element.value;for (i = 0, ii = lengths.length; i < ii; i += 1) {if (value.length === parseInt(lengths[i], 10)) {return true;}}return false;},luhn: function (value) {var calc, checksum = 0, i, j = 1;for (i = value.length - 1; i >= 0; i -= 1) {calc = Number(value.charAt(i)) * j;if (calc > 9) {checksum = checksum + 1;calc = calc - 10;}checksum = checksum + calc;j = j === 1 ? 2 : 1;}return (checksum % 10 === 0);},prefix: function (element) {var i, ii, value = element.value;element.cardName = element.cardType = null;if (value.length > 1) {for (i = 0, ii = cards.length; i < ii; i += 1) {if (cards[i].prefix.test(value)) {element.cardType = i;element.cardName = cards[i].name;return true;}}}return false;}};}()),date: function (value) {var day, days, month, year;if (!(/^(\d{1,2})[\s\.\/\-](\d{1,2})[\s\.\/\-](\d{4})$/).test(value)) {return false;}month = parseInt(RegExp.$1, 10);day = parseInt(RegExp.$2, 10);year = parseInt(RegExp.$3, 10);if (month < 1 || month > 12 || year < 1900 || year > 2100) {return false;}switch (month) {case 2:days = ((year % 4) === 0) ? 29 : 28;break;case 4:case 6:case 9:case 11:days = 30;break;default:days = 31;}return (day >= 1 && day <= days);},email: function (value) {if ((/^([\w\-]+(?:\.[\w\-]+)*)@((?:[\w\-]+\.)*\w[\w\-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/).test(value)) {var path = analogue.path + 'mx/', request = new XMLHttpRequest();if (!request) {return true;} else {request.open('GET', path + value.split('@')[1], false);request.send(null);if (request.status === 200) {if (request.responseText.indexOf('ERROR')) {return true;}return false;}return true;}}return false;},empty: function (value) {return !(value === null || value.length === 0 || (/^\s+$/).test(value));},group: function (node) {var count = 0, i, ii, valid = null;if (node.nodeType !== 1) {return 0;}if (node.nodeName.toLowerCase() === 'input') {switch (node.type.toLowerCase()) {case 'checkbox':case 'radio':valid = node.checked;break;default:valid = node.value;}} else {valid = node.value;}if (valid && this.empty(valid)) {count += 1;}for (i = 0, ii = node.childNodes.length; i < ii; i += 1) {count += this.group(node.childNodes[i]);}return count;},match: function (element) {var verify = document.getElementById(element.id.split('-')[1]);if (verify && element.value !== verify.value) {return false;}return true;},numeric: function (value) {return !(/[^\d\.\-]/g).test(value);},phone: function (value) {return (/^([1]?[\s\.\-]?\(?[2-9]\d{2}\)?)?[\s\.\-]?(\d{3}[\s\.\-]?\d{4})$/).test(value);},url: function (value) {return (/^(http|ftp|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?\^=%&amp;:\/~\+#]*[\w\-\@?\^=%&amp;\/~\+#])?/).test(value);}}, getLabel = function (element, form) {if (element.parentNode.nodeName.toLowerCase() === 'label') {return element.parentNode;}var i, ii, label, labels = form.getElementsByTagName('label');for (i = 0, ii = labels.length; i < ii; i += 1) {label = labels[i];if (label.htmlFor && label.htmlFor === element.id) {return label;}}return false;}, validate = function (event) {var count, element, elements = this.getElementsByClassName('isRequired'), error, errors = [], i, ii, j, jj, match, message, span, tag, title, valid, value;for (i = 0, ii = elements.length; i < ii; i += 1) {element = elements[i];element.removeClass('isInvalid');if (element.label) {element.label.removeClass('isInvalid');}if (element.nextSibling && element.nextSibling.nodeName.toLowerCase() === 'span') {element.parentNode.removeChild(element.nextSibling);} else if (element.lastChild && element.lastChild.nodeName.toLowerCase() === 'span') {element.removeChild(element.lastChild);}tag = element.nodeName.toLowerCase();title = element.title;valid = true;value = element.value;switch (tag) {case 'div':case 'fieldset':if ((/atLeast-(\d+)/).test(element.className)) {if (!(valid = (count = parseInt(RegExp.$1, 10)) <= check.group(element))) {errors.push('Please select at least ' + count + ' options in the ' + title + ' group.');}} else if (!(valid = check.group(element))) {errors.push('Please select an option in the ' + title + ' group.');}if (valid && (/atMost-(\d+)/).test(element.className)) {if (!(valid = (count = parseInt(RegExp.$1, 10)) >= check.group(element))) {errors.push('Please select no more than ' + count + ' options in the ' + title + ' group.');}}break;case 'input':switch (element.type.toLowerCase()) {case 'checkbox':case 'radio':if (!(valid = element.checked)) {errors.push('You must ' + title + '.');}break;default:if (!(valid = check.empty(value))) {errors.push('The ' + title + ' field is required.');} else if (element.hasClass('checkPlaceholder') && (!(valid = value !== title))) {errors.push('The ' + title + ' field is required.');} else if (element.hasClass('checkAlpha') && (!(valid = check.alpha(value)))) {errors.push('The ' + title + ' field may contain letters only, no numbers or other characters.');} else if (element.hasClass('checkAlphaNumeric') && (!(valid = check.alphaNumeric(value)))) {errors.push('The ' + title + ' field may contain letters and numbers only.');} else if (element.hasClass('checkCreditCard')) {value = element.value = element.value.replace(/\W/gi, '');if ((!(valid = check.numeric(value)))) {errors.push('The Credit Card number may contain numbers only, no letters or other characters.');} else if (!(valid = check.creditCard.prefix(element))) {errors.push('The Credit Card number you entered is an unknown or unsupported card type.');} else if (!(valid = check.creditCard.length(element))) {errors.push('Your ' + element.cardName + ' card number has too many or too few digits.');} else if (!(valid = check.creditCard.luhn(value))) {errors.push('Your ' + element.cardName + ' card number is invalid.');}} else if (element.hasClass('checkDate') && (!(valid = check.date(value)))) {errors.push(value + ' does not appear to be a valid date.');} else if (element.hasClass('checkEmail') && (!(valid = check.email(value.toLowerCase())))) {errors.push(value + ' does not appear to be a valid e-mail address.');} else if (element.hasClass('checkMatch') && (!(valid = check.match(element)))) {match = document.getElementById(element.id.split('-')[1]);errors.push('The ' + title + ' field does not match the ' + match.title + ' field.');} else if (element.hasClass('checkNumeric') && (!(valid = check.numeric(value)))) {errors.push('The ' + title + ' field may contain numbers only, no letters or other characters.');} else if (element.hasClass('checkPhone') && (!(valid = check.phone(value)))) {errors.push(value + ' does not appear to be a valid phone number.');} else if (element.hasClass('checkUrl') && (!(valid = check.url(value)))) {errors.push(value + ' does not appear to be a valid URL.');}}break;case 'select':if (element.hasClass('checkIndex')) {valid = element.selectedIndex !== 0;} else {valid = check.empty(element.options[element.selectedIndex].value);}if (!valid) {errors.push('Please select an option from the ' + title + ' list.');}break;case 'textarea':if (!(valid = check.empty(value))) {errors.push('The ' + title + ' field is required.');} else if (element.hasClass('checkPlaceholder') && (!(valid = value !== title))) {errors.push('The ' + title + ' field is required.');}break;}if (!valid) {element.addClass('isInvalid');if (element.label) {element.label.addClass('isInvalid');}if (!this.hasClass('useConfirm') && !this.hasClass('useAlert')) {span = document.set('span', { 'class': 'errorDetail' },  [errors[0], document.set('span')]);if (tag === 'fieldset' || tag === 'div') {element.appendChild(span);} else {element.parentNode.insertBefore(span, element.nextSibling);}if (element.focus) {element.focus();}event.preventDefault();return false;}if (errors.length === 1) {error = element;}}}if (errors.length === 0) {if (this.hasClass('disableSubmit')) {this.getElementsBySelector('[type="submit"]')[0].disabled = true;}return true;}message = 'The following form ' + (errors.length > 1 ? 'fields were' : 'field is') + ' incomplete or incorrect:\n\n';for (j = 0, jj = errors.length; j < jj; j += 1) {message += (j + 1) + '. ' + errors[j] + '\n';}if (this.hasClass('useConfirm') && window.confirm(message + '\nYour form has not been submitted.\nClick \"OK\" to continue submitting the form; or\nClick \"Cancel\" to check the information that you provided and try again.')) {return true;} else if (this.hasClass('useAlert')) {window.alert(message + '\nYour form has not been submitted.\nPlease check the information that you provided and submit the form again.');}if (error.focus) {error.focus();}event.preventDefault();return false;}, versioning = [1, String(build.getFullYear()).slice(2), String((build.getMonth() + 1) / 100).slice(2)];document.addEvent('ready', function () {var element, elements, form, forms = document.getElementsByTagName('form'), i, ii, j, jj, setFocus = false;for (i = 0, ii = forms.length; i < ii; i += 1) {form = forms[i];if (!setFocus && form.hasClass('setFocus')) {setFocus = form;}elements = form.getElementsByClassName('isRequired');if (elements.length > 0) {form.addEvent('submit', validate);for (j = 0, jj = elements.length; j < jj; j += 1) {element = elements[j];element.label = getLabel(element, form);}}}if (setFocus) {window.addEvent('load', function () {var element, elements = this.elements, i, ii;for (i = 0, ii = elements.length; i < ii; i += 1) {element = elements[i];if (element.nodeName.toLowerCase() !== 'fieldset' && element.type.toLowerCase() !== 'hidden' && !element.disabled) {element.focus();break;}}}.bind(setFocus));}});document.addEvent('ready', function () {var blur = function () {if (this.value === '') {this.value = this.getProperty('title');}}, focus = function () {if (this.value === this.getProperty('title')) {this.value = '';}}, i, ii, fields = document.get('.checkPlaceholder') || [];for (i = 0, ii = fields.length; i < ii; i += 1) {fields[i].addEvent('blur', blur).addEvent('focus', focus);}});return {validate: function (method, parameters) {return check[method](parameters);},version: versioning.join('.') + ' (' + parseInt(build.valueOf() / 1000, 10) + ')'};}(this));/*Animate 2.11.01, Copyright (c) 2011 Analogue Web Design LLC, all rights reserved.*/var animate = function (object, property, transition, begin, finish, duration, suffix) {"use strict";var instance = {addEvent: function (listener) {this.removeEvent(listener);return this.listeners.push(listener);},callEvent: function () {var i, ii, listener, listeners = this.listeners, properties = [];for (i = 0, ii = arguments.length; i < ii; i += 1) {properties.push(arguments[i]);}listener = properties.shift();for (i = 0, ii = listeners.length; i < ii; i += 1) {if (listeners[i][listener]) {listeners[i][listener].apply(listeners[i], properties);}}},change: 0,continueTo: function (finish, duration) {this.begin = this.position;this.setFinish(finish);if (this.duration !== undefined) {this.setDuration(duration);}this.start();},delegate: function (object, method) {var array = [], i, ii;for (i = 2, ii = arguments.length; i < ii; i += 1) {array[i - 2] = arguments[i];}return function () {method.apply(object, [].concat(arguments, array));};},fforward: function () {this.time = this.duration;this.fixTime();this.update();},fixTime: function () {this.startTime = this.getTimer() - this.time * 1000;},getPosition: function (time) {if (time === undefined) {time = this.time;}return this.transition(time, this.begin, this.change, this.duration);},getTimer: function () {return new Date().getTime() - this.time;},initialize: function () {this.listeners = [];this.addEvent(this);this.object = object;this.property = property;if (transition !== null && transition !== '') {this.transition = transition;}if (property === 'opacity') {if (begin < 0) {begin = 0;}if (finish > 100) {finish = 100;}}this.begin = begin;this.position = begin;this.setFinish(finish);this.setDuration(duration);this.suffix = suffix || '';return this;},listeners: [],looping: false,nextFrame: function () {this.setTime((this.getTimer() - this.startTime) / 1000);},onEnterFrame: function () {if (this.isPlaying) {this.nextFrame();setTimeout(this.delegate(this, this.onEnterFrame), 0);}},position: 0,prevPosition: 0,prevTime: 0,removeEvent: function (listener) {var i, ii, listeners = this.listeners;for (i = 0, ii = listeners.length; i < ii; i += 1) {if (listeners[i] === listener) {listeners.splice(i, 1);return true;}}return false;},resume: function () {this.fixTime();this.startEnterFrame();this.callEvent('onresume', { target: this, type: 'onresume' });},rewind: function (time) {this.stop();this.time = (time === undefined) ? 0 : time;this.fixTime();this.update();},setDuration: function (duration) {this.duration = (duration === null || duration <= 0) ? 100000 : duration;},setFinish: function (finish) {this.change = finish - this.begin;},setPosition: function (position) {this.prevPosition = this.position;if (this.property === 'opacity') {this.object.style.opacity = Math.round(position) / 100;this.object.style.MozOpacity = Math.round(position) / 100;this.object.style.KhtmlOpacity = Math.round(position) / 100;if (this.object.style.filter !== undefined) {this.object.style.filter = 'alpha(opacity=' + Math.round(position) + ')';}} else {this.object[this.property] = Math.round(position) + this.suffix;}this.position = position;this.callEvent('onchange', { target: this, type: 'onchange' });},setTime: function (time) {this.prevTime = this.time;if (time > this.duration) {if (this.looping) {this.rewind(time - this.duration);this.update();this.callEvent('onloop', { target: this, type: 'onloop' });} else {this.time = this.duration;this.update();this.stop();this.callEvent('onfinish', { target: this, type: 'onfinish' });}} else if (time < 0) {this.rewind();this.update();} else {this.time = time;this.update();}},start: function () {this.rewind();this.startEnterFrame();this.callEvent('onstart', { target: this, type: 'onstart' });},startEnterFrame: function () {this.stopEnterFrame();this.isPlaying = true;this.onEnterFrame();},startTime: 0,stop: function () {this.stopEnterFrame();this.callEvent('onstop', { target: this, type: 'onstop' });},stopEnterFrame: function () {this.isPlaying = false;},time: 0,transition: function (t, b, c, d) {return c * t / d + b;},update: function () {this.setPosition(this.getPosition(this.time));},yoyo: function () {this.continueTo(this.begin, this.time);}};return instance.initialize();}.extend({backIn: function (t, b, c, d, s) {s = s || 1.70158;return c * (t /= d) * t * ((s + 1) * t - s) + b;},backOut: function (t, b, c, d, s) {s = s || 1.70158;return c * ((t = t / d - 1) * t * ((s + 1) * t + s) + 1) + b;},backInOut: function (t, b, c, d, s) {s = s || 1.70158;if ((t /= d / 2) < 1) {return c / 2 * (t * t * (((s *= (1.525)) + 1) * t - s)) + b;}return c / 2 * ((t -= 2) * t * (((s  = (1.525)) + 1) * t + s) + 2) + b;},bounceIn: function (t, b, c, d) {return c - animate.bounceOut(d - t, 0, c, d) + b;},bounceOut: function (t, b, c, d) {if ((t /= d) < (1 / 2.75)) {return c * (7.5625 * t * t) + b;} else if (t < (2 / 2.75)) {return c * (7.5625 * (t -= (1.5 / 2.75)) * t + 0.75) + b;} else if (t < (2.5 / 2.75)) {return c * (7.5625 * (t -= (2.25 / 2.75)) * t + 0.9375) + b;} else {return c * (7.5625 * (t -= (2.625 / 2.75)) * t + 0.984375) + b;}},bounceInOut: function (t, b, c, d) {if (t < d / 2) {return animate.bounceIn(t * 2, 0, c, d) * 0.5 + b;}return animate.bounceOut(t * 2 - d, 0, c, d) * 0.5 + c * 0.5 + b;},easeIn: function (t, b, c, d) {return c * (t /= d) * t + b;},easeOut: function (t, b, c, d) {return -c * (t /= d) * (t - 2) + b;},easeInOut: function (t, b, c, d) {if ((t /= d / 2) < 1) {return c / 2 * t * t + b;}return -c / 2 * ((t -= 1) * (t - 2) - 1) + b;},snapIn: function (t, b, c, d) {return c * (t /= d) * t * t * t * t + b;},snapOut: function (t, b, c, d) {return c * ((t = t / d - 1) * t * t * t * t + 1) + b;},snapInOut: function (t, b, c, d) {if ((t /= d / 2) < 1) {return c / 2 * t * t * t * t * t + b;}return c / 2 * ((t -= 2) * t * t * t * t + 2) + b;},version: (function () {var build = new Date(1295491101051), versioning = [2, String(build.getFullYear()).slice(2), String((build.getMonth() + 1) / 100).slice(2)];return versioning.join('.') + ' (' + parseInt(build.valueOf() / 1000, 10) + ')';}())});/*Lightbox 3.11.01, Copyright (c) 2011 Analogue Web Design LLC, all rights reserved.*//*Based upon Lightbox v2.04 by Lokesh Dhakar. Licensed under the Creative Commons Attribution 2.5 License <http://creativecommons.org/licenses/by/2.5/>.*/var lightbox = (function (window, root) {"use strict";var build = new Date(1295808998228), getPageScroll = function () {return {x: window.pageXOffset || root.scrollLeft || 0,y: window.pageYOffset || root.scrollTop || 0};}, getPageSize = typeof window.innerWidth === 'number' ? function () {return {height: window.innerHeight,width: window.innerWidth,x: root.scrollWidth,y: root.scrollHeight};} : function () {var height = root.offsetHeight, width = root.offsetWidth, x = root.scrollWidth, y = root.scrollHeight;return {height: height,width: width,x: x > width ? x : width,y: y > height ? y : height};}, getBorderWidth = function (element) {if (element.currentStyle) {return parseInt(element.currentStyle.borderWidth, 10);} else if (window.getComputedStyle) {return parseInt(window.getComputedStyle(element, null).getPropertyValue('border-top-width'), 10);}return 0;}, pause = function (milliseconds) {var current, date = new Date();do {current = new Date();} while (current - date < milliseconds);}, versioning = [3, String(build.getFullYear()).slice(2), String((build.getMonth() + 1) / 100).slice(2)];return {changeImage: function (imageNumber) {this.slideShowPause();this.imageCurrent = imageNumber;this.lightboxHeader.style.visibility = 'hidden';this.lightboxImage.style.display = 'none';this.lightboxFooter.style.display = 'none';this.lightboxPrevLink.style.display = 'none';this.lightboxNextLink.style.display = 'none';var imgPreloader = new Image();imgPreloader.onload = function () {this.lightboxImage.src = this.imageArray[this.imageCurrent][0];this.resizeContainer(imgPreloader.width, imgPreloader.height);}.bind(this);imgPreloader.src = this.imageArray[this.imageCurrent][0];},end: function () {document.onkeydown = function () {};window.onresize = function () {};this.slideShowPause();this.lightbox.style.display = 'none';if (this.imageArray.length === 1) {this.lightboxFrame.setProperty('style', 'height: 250px; width: 250px');}this.lightboxImage.style.display = 'none';this.overlayEffect = animate(this.overlay, 'opacity', animate.easeIn, this.overlayOpacity, 0, this.resizeDuration / 2, '');this.overlayEffect.start();this.overlayEffect.onfinish = function () {this.overlay.style.display = 'none';}.bind(this);},getImages: function () {var anchor, anchors = document.get('a[rel^="lightbox"]') || [], click = function (anchor) {return function (event) {this.start(anchor);event.preventDefault();};}, i, ii;for (i = 0, ii = anchors.length; i < ii; i += 1) {anchor = anchors[i];anchor.addEvent('click', click(anchor).bind(this));}},initialize: function (overlayOpacity, resizeSpeed, slideShow, slideShowSpeed) {var create = document.set, i, ii, id, ids = 'overlay,lightbox,lightboxHeader,lightboxCaption,lightboxCloseLink,lightboxFrame,lightboxImage,lightboxFooter,lightboxControls,lightboxNextLink,lightboxPlayLink,lightboxPauseLink,lightboxPrevLink,lightboxImageSet'.split(',');this.getImages();this.overlayOpacity = overlayOpacity || 80;if (this.overlayOpacity > 100) {this.overlayOpacity = 100;} else if (this.overlayOpacity < 0) {this.overlayOpacity = 0;}this.resizeSpeed = resizeSpeed || 8;if (this.resizeSpeed > 10) {this.resizeSpeed = 10;} else if (this.resizeSpeed < 1) {this.resizeSpeed = 1;}this.resizeDuration = (11 - this.resizeSpeed) * 0.15;this.slideShow = slideShow || false;this.slideShowSpeed = slideShowSpeed || 5000;this.slideShowPlaying = this.slideShow;document.body.appendChild(create('div', {'id': 'overlay', 'onclick': function (event) {this.end();event.preventDefault();}.bind(this)}));document.body.appendChild(create('div', {'id': 'lightbox'}, [create('div', {'class': 'clear', 'id': 'lightboxHeader'}, [create('div', {'id': 'lightboxCaption'}),create('a', {'id': 'lightboxCloseLink', 'href': '#', 'onclick': function (event) {this.end();event.preventDefault();}.bind(this), 'title': 'Close'})]),create('div', {'id': 'lightboxFrame'}, [create('img', {'id': 'lightboxImage'})]),create('div', {'class': 'clear', 'id': 'lightboxFooter'}, [create('div', {'id': 'lightboxControls'}, [create('a', {'id': 'lightboxNextLink', 'href': '#', 'title': 'Next'}),create('a', {'id': 'lightboxPlayLink', 'href': '#', 'onclick': function (event) {this.slideShowPlay();event.preventDefault();}.bind(this), 'title': 'Play'}),create('a', {'id': 'lightboxPauseLink', 'href': '#', 'onclick': function (event) {this.slideShowStop();event.preventDefault();}.bind(this), 'title': 'Pause'}),create('a', {'id': 'lightboxPrevLink', 'href': '#', 'title': 'Previous'})]),create('span', {'id': 'lightboxImageSet'})])]));for (i = 0, ii = ids.length; i < ii; i += 1) {id = ids[i];this[id] = document.get([id]);}this.lightboxImageEffect = animate(this.lightboxImage, 'opacity', animate.snapOut, 0, 100, this.resizeDuration, '');this.lightboxImageEffect.onfinish = function () {this.lightboxHeader.style.visibility = 'visible';this.lightboxHeaderEffect = animate(this.lightboxHeader, 'opacity', animate.snapOut, 0, 100, this.resizeDuration * 2, '');this.lightboxHeaderEffect.start();if (this.imageArray.length > 1) {this.lightboxFooter.style.display = 'block';this.lightboxFooterEffect = animate(this.lightboxFooter, 'opacity', animate.snapOut, 0, 100, this.resizeDuration * 2, '');this.lightboxFooterEffect.start();}}.bind(this);this.borderWidth = getBorderWidth(this.lightboxFrame) * 2;},onkeydown: function () {document.onkeydown = function (e) {var escape, key, keycode;if (!e) {keycode = event.keyCode;escape = 27;} else {keycode = e.which;escape = e.DOM_VK_ESCAPE;}key = String.fromCharCode(keycode).toLowerCase();if (key === 'x' || key === 'o' || key === 'c' || keycode === escape) {this.end();} else if (key === 'p' || keycode === 37) {if (this.imageCurrent !== 0) {document.onkeydown = function () {};this.changeImage(this.imageCurrent - 1);}} else if (key === 'n' || keycode === 39) {if (this.imageCurrent !== (this.imageArray.length - 1)) {document.onkeydown = function () {};this.changeImage(this.imageCurrent + 1);}} else if (key === 's') {this.slideShowToggle();}}.bind(this);},onresize: function () {window.onresize = function () {this.overlay.style.height = getPageSize().y + 'px';}.bind(this);},preloadImages: function () {var preloadNextImage, preloadPrevImage;if ((this.imageArray.length - 1) > this.imageCurrent) {preloadNextImage = new Image();preloadNextImage.src = this.imageArray[this.imageCurrent + 1][0];}if (this.imageCurrent > 0) {preloadPrevImage = new Image();preloadPrevImage.src = this.imageArray[this.imageCurrent - 1][0];}},resizeContainer: function (width, height) {var heightDifference = (this.lightboxFrame.offsetHeight - this.borderWidth) - height, widthDifference = (this.lightboxFrame.offsetWidth - this.borderWidth) - width;this.lightboxImageWidth = animate(this.lightboxFrame.style, 'width', animate.easeIn, this.lightboxFrame.offsetWidth - this.borderWidth, width, this.resizeDuration, 'px');this.lightboxImageWidth.onfinish = function () {this.lightboxImage.style.display = 'block';this.lightboxImageEffect.start();}.bind(this);this.lightboxImageHeight = animate(this.lightboxFrame.style, 'height', animate.easeIn, this.lightboxFrame.offsetHeight - this.borderWidth, height, this.resizeDuration, 'px');this.lightboxImageHeight.start();this.lightboxImageHeight.onfinish = function () {this.lightboxImageWidth.start();}.bind(this);if ((heightDifference === 0) && (widthDifference === 0)) {if (window.msie) {pause(500);} else {pause(100);}}this.lightboxHeader.style.width = width + (this.borderWidth) + 'px';this.lightboxFooter.style.width = width + (this.borderWidth) + 'px';this.updateDetails();this.preloadImages();},slideShowPlay: function () {var lightbox = this;this.lightboxPlayLink.style.display = 'none';this.lightboxPauseLink.style.display = 'block';this.slideShowPlaying = true;this.slideShowTimer = setInterval(function () {lightbox.changeImage(this.imageCurrent !== (this.imageArray.length - 1) ? this.imageCurrent + 1 : 0);}.bind(lightbox), 6000);},slideShowPause: function () {this.lightboxPlayLink.style.display = 'block';this.lightboxPauseLink.style.display = 'none';if (this.slideShowTimer) {clearInterval(this.slideShowTimer);}},slideShowStop: function () {this.slideShowPlaying = false;this.lightboxPlayLink.style.display = 'block';this.lightboxPauseLink.style.display = 'none';if (this.slideShowTimer) {clearInterval(this.slideShowTimer);}},slideShowToggle: function () {if (this.slideShowPlaying) {this.slideShowStop();} else {this.slideShowPlay();}},start: function (link) {var anchor, anchors, i, ii, imageNumber = 0, pageScroll = getPageScroll(), pageSize = getPageSize();this.overlay.setProperty('style', 'display:block; height:' + pageSize.y + 'px;');this.overlayEffect = animate(this.overlay, 'opacity', animate.easeOut, 0, this.overlayOpacity, this.resizeDuration, '');this.overlayEffect.start();this.imageArray = [];if (typeof link === 'string' && window[link]) {this.imageArray = window[link];} else if ((link.getProperty('rel') === 'lightbox')) {this.imageArray.push([link.getProperty('href'), link.getProperty('title')]);} else {anchors = document.get('a[rel="' + link.getProperty('rel') + '"]') || [];for (i = 0, ii = anchors.length; i < ii; i += 1) {anchor = anchors[i];this.imageArray.push([anchor.getProperty('href'), anchor.getProperty('title')]);}while (this.imageArray[imageNumber][0] !== link.getProperty('href')) {imageNumber += 1;}}this.lightbox.setProperty('style', 'display:block; top:' + pageScroll.y + 'px; left:' + pageScroll.x + 'px;');this.changeImage(imageNumber);},updateDetails: function () {this.lightboxCaption.innerHTML = this.imageArray[this.imageCurrent][1];if (this.imageArray.length > 1) {this.lightboxImageSet.style.display = 'block';this.lightboxImageSet.innerHTML = 'Image ' + (this.imageCurrent + 1) + ' of ' + this.imageArray.length;}if (this.imageCurrent !== 0) {this.lightboxPrevLink.style.display = 'block';this.lightboxPrevLink.onclick = function () {this.changeImage(this.imageCurrent - 1);if (window.msie) {window.event.returnValue = false;}return false;}.bind(this);}if (this.imageCurrent !== (this.imageArray.length - 1)) {this.lightboxNextLink.style.display = 'block';this.lightboxNextLink.onclick = function () {this.changeImage(this.imageCurrent + 1);if (window.msie) {window.event.returnValue = false;}return false;}.bind(this);}this.onkeydown();this.onresize();if (this.slideShow && this.imageArray.length > 1) {if (this.slideShowPlaying) {this.slideShowPlay();} else {this.slideShowStop();}}},version: versioning.join('.') + ' (' + parseInt(build.valueOf() / 1000, 10) + ')'};}(this, document.documentElement));/*Google Analytics*/var _gaq = _gaq || [];_gaq.push(['_setAccount', 'UA-4258366-2'], ['_trackPageview']);(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].appendChild(ga);}());/*Link.Tracking 1.11.01, Copyright (c) 2011 Analogue Web Design LLC, all rights reserved.*/document.addEvent('ready', function () {var click = function (action, label) {return function () {_gaq.push(['_trackEvent', 'Links', action, label]);};}, files = /\.(do(c|t)(x)?|pdf|ppt(x)?|xls(x)?|zip?)$/, i, ii, link, links = document.links;for (i = 0, ii = links.length; i < ii; i += 1) {link = links[i];if ((/^mailto:/).test(link.href)) {link.addEvent('click', click('MailTo', link.href.split(':')[1]));} else if (link.title === '' && link.hostname.length > 0 && link.hostname.search(location.hostname) === -1 && (/^http(s)?:/).test(link.href)) {link.addEvent('click', click('External', link.href.split('//')[1]));link.target = '_blank';link.title = 'Link opens in new window';} else if (files.test(link.href)) {link.addEvent('click', click('Files', link.href.split(location.host)[1]));if (link.rel === 'external') {link.target = '_blank';link.title = 'Link opens in new window';}}}});document.addEvent('ready', function () {var click = function (event) {lightbox.start('flickrSet' + this.getProperty('rel'));event.preventDefault();}, i, ii, links = document.get('a.slideshow') || [], nav = document.get('nav');document.get('li.contact a')[0].addEvent('mouseover', function () {nav.setProperty('style', 'background-position:-960px 0;');}).addEvent('mouseout', function () {nav.setProperty('style', 'background-position:0 0;');});if (links.length > 0) {document.loadScript('Assets/Js/FlickrSets');for (i = 0, ii = links.length; i < ii; i += 1) {links[i].addEvent('click', click);}}if (document.getElementsByClassName('thumbnails').length > 0) {lightbox.initialize(85, 8, false, 5000);} else {lightbox.initialize(85, 8, true, 5000);}});
