﻿// Analogue + Analogue.Forms v1.08.8, Copyright (c) 2008 Analogue Web Design LLC, all rights reserved.
if(window!=top){top.location.href=window.location.href}document.documentElement.className='hasJs';window.query=!!document.querySelector;window.xpath=!!document.evaluate;if(!window.opera){if(/*@cc_on!@*/false){window.msie={version:!window.XMLHttpRequest?6:!document.documentMode?7:8}}else if(document.childNodes&&!document.all&&!navigator.taintEnabled){if(navigator.vendor=='KDE'){window.khtml=true}else{window.webkit={version:!window.xpath?418:525}}}else if(navigator.product=='Gecko'&&document.getBoxObjectFor!==null){window.gecko=true}}var analogue=function(){var build=new Date(2008,8,30),versioning=[1,build.getFullYear().toString().slice(2),build.getMonth().toString()];return{bind:function(object,method){if(!method){method=this}return function(){return method.apply(object,arguments)}},extend:function(object,source){if(!source){source=object;object=this}for(var i in source){if(source.hasOwnProperty(i)&&!object[i]){object[i]=source[i]}}return object},path:'/assets/js/Analogue.',version:versioning.join('.')+' ('+build.valueOf()+')'}}();analogue.elements=function(){var booleans={'checked':'checked','defer':'defer','disabled':'disabled','ismap':'ismap','multiple':'multiple','readonly':'readOnly','selected':'selected'},i,properties={'accesskey':'accessKey','class':'className','enctype':'encType','for':'htmlFor','html':'innerHTML','maxlength':'maxLength','tabindex':'tabIndex','text':window.msie?'innerText':'textContent','title':'title','usemap':'useMap','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'){return this.style.cssText.toLowerCase()}if(window.msie&&attribute.match(/^(href|src|type)$/i)){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 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'){this.style.cssText=value}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}}}();analogue.events=function(){var guid=0;return{add:function(type,listener){if(this.addEventListener){this.addEventListener(type,listener,false)}else{if(!listener.guid){listener.guid=guid+=1}if(!this.queue){this.queue={}}var listeners=this.queue[type];if(!listeners){listeners=this.queue[type]={};if(this['on'+type]){listeners[0]=this['on'+type]}}listeners[listener.guid]=listener;this['on'+type]=analogue.events.handle}return this},fix:function(event){event.relatedTarget=event.fromElement==event.srcElement?event.toElement:event.fromElement;event.pageX=event.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft||0);event.pageY=event.clientY+(document.documentElement.scrollTop||document.body.scrollTop||0);event.preventDefault=function(){this.returnValue=false};event.stopPropagation=function(){this.cancelBubble=true};event.target=event.srcElement;event.timeStamp=new Date().getTime();event.which=event.charCode=event.keyCode;if(!event.which&&event.button){event.which=(event.button==1?1:(event.button==2?3:(event.button==4?2:0)))}return event},handle:function(event){event=event||analogue.events.fix(window.event);var i,listeners=this.queue[event.type];for(i in listeners){if(listeners.hasOwnProperty(i)&&(listeners[i].call(this,event)===false)){return false}}return true},remove:function(type,listener){if(this.removeEventListener){this.removeEventListener(type,listener,false)}else{if(this.queue&&this.queue[type]&&listener.guid){delete this.queue[type][listener.guid]}}return this}}}();analogue.methods=function(){var method=window.query?'query':window.xpath?'xpath':'basic';return{addEvent:analogue.events.add,delegateEvent:function(type,listener,tag){return this.addEvent(type,function(event){var target=event.target;if(window.webkit&&target.nodeType==3){target=target.parentNode}if(!tag||target.nodeName.toLowerCase()==tag){listener.apply(target,arguments)}})},getElementsByAttribute:function(name,value,tag){return analogue.selectors[method](this,(tag?tag:'')+'['+name+(value?'~="'+value+'"':'')+']')},getElementsByClassName:function(value,tag){return analogue.selectors[method](this,(tag?tag:'')+'.'+value.replace(' ','.'))},getElementsBySelector:function(selector){return analogue.selectors[method](this,selector)},removeEvent:analogue.events.remove}}();analogue.selectors=function(){var trim=function(string){return string.replace(/^\s+|\s+$/g,'')},getElements=function(context,tag,combinator){tag=(tag?tag:'*').toLowerCase();var child,children,collection=[],element,elements,i,ii,j;for(i=0,ii=context.length;i<ii;i+=1){switch(combinator){case'>':children=context[i].childNodes;for(j=0;(child=children[j]);j+=1){if(child.nodeType==1&&child.nodeName!='!'){if(tag!='*'&&child.nodeName.toLowerCase()!=tag){continue}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;continue}}break;default:elements=context[i].getElementsByTagName(tag);for(j=0;(element=elements[j]);j+=1){collection.push(element)}}}return collection},guid=0,parse=function(context,selector){context=[context];selector=trim(selector.replace(/\s*(>|\+)\s*/g,' $1'));var combinator,element,elements,i,ii,j,k,kk,match,parts,property,token,tokens=selector.split(' ');for(i=0,ii=tokens.length;i<ii;i+=1){token=trim(tokens[i]);if((match=(/^(>|\+)/i).exec(token))){combinator=match[1];token=token.replace(combinator,'')}if(token.indexOf('#')>-1){parts=token.split('#');element=document.getElementById(parts[1]);if(!element||(parts[0]&&element.nodeName.toLowerCase()!=parts[0])){return[]}context=[element];continue}if(token.indexOf('.')>-1){parts=token.split('.');elements=getElements(context,parts[0],combinator);context=[];for(j=0;(element=elements[j]);j+=1){match=true;for(k=1,kk=parts.length;k<kk;k+=1){if(!element.className||!element.className.match(new RegExp('(^|\\s)'+parts[k]+'(\\s|$)'))){match=false;break}}if(match){context.push(element)}}continue}if((match=(/^(\w*)\[(\w+)([=~\|\^\$\*]?)=?"?([^\]"]*)"?\]$/i).exec(token))){elements=getElements(context,match[1],combinator);context=[];for(j=0;(element=elements[j]);j+=1){if(!(property=element.getProperty(match[2]))){continue}else if(match[3]=='='&&property!=match[4]){continue}else if(match[3]=='~'&&!property.match(new RegExp('(^|\\s)'+match[4]+'(\\s|$)'))){continue}else if(match[3]=='^'&&property.indexOf(match[4])!==0){continue}else if(match[3]=='$'&&property.lastIndexOf(match[4])!=(property.length-match[4].length)){continue}else if(match[3]=='*'&&!(property.indexOf(match[4])+1)){continue}else if(match[3]=='|'&&!property.match(new RegExp('^'+match[4]+'-'))){continue}context.push(element)}continue}context=getElements(context,token,combinator)}return context},resolve=function(rule){var index=1,last=null,match,parts=['//','*'];while(rule.length&&rule!=last){last=rule;rule=trim(rule);if(!rule.length){break}if((match=(/^([#.]?)([a-z0-9\\*_\-]*)((\|)([a-z0-9\\*_\-]*))?/i).exec(rule))){if(!match[1]){if(match[5]){parts[index]=match[5]}else if(match[2]!==''){parts[index]=match[2]}}else if(match[1]=='#'){parts.push('[@id="'+match[2]+'"]')}else if(match[1]=='.'){parts.push('[contains(concat(" ", @class, " "), " '+match[2]+' ")]')}rule=rule.slice(match[0].length)}if((match=(/^\[(\w+)([=~\|\^\$\*]?)=?"?([^\]"]*)"\s*\]/i).exec(rule))){switch(match[2]){case'~':parts.push('[contains(concat(" ", @'+match[1]+', " "), " '+match[3]+' ")]');break;case'^':parts.push('[starts-with(@'+match[1]+', "'+match[3]+'")]');break;case'$':parts.push('[substring(@'+match[1]+', (string-length(@'+match[1]+') - '+(match[3].length-1)+'), '+match[3].length+') = "'+match[3]+'"]');break;case'*':parts.push('[contains(@'+match[1]+', "'+match[3]+'")]');break;case'|':parts.push('[starts-with(@'+match[1]+', "'+match[3]+'-")]');break;default:parts.push('[@'+match[1]+'="'+match[3]+'"]')}rule=rule.slice(match[0].length)}else if((match=(/^\[([^\]]*)\]/i).exec(rule))){parts.push('[@'+match[1]+']');rule=rule.slice(match[0].length)}while((match=(/^:([a-z_\-])+/i).exec(rule))){rule=rule.slice(match[0].length)}if((match=(/^(\s*[>+\s])?/i).exec(rule))&&match[0].length){if(match[0].indexOf('>')!=-1){parts.push('/child::')}else if(match[0].indexOf('+')!=-1){parts.push('/following-sibling::*[1]/self::')}else{parts.push('//')}index=parts.length;parts.push('*');rule=rule.slice(match[0].length)}if((match=(/^\s*,/i).exec(rule))){parts.push(' | ','//','*');index=parts.length-1;rule=rule.slice(match[0].length)}}return parts.join('')},unique=function(collection){var element,filtered=[],i;for(i=0;(element=collection[i]);i+=1){if(!element.included&&element.nodeName!='!'){element.included=true;filtered.push(element)}}for(i=0;(element=filtered[i]);i+=1){element.included=null}return filtered};return{basic: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)},query:function(context,selector){if(window.msie&&context!=document){if(context.id===''){context.setProperty('id',context.tagName.toLowerCase()+(guid+=1))}context=document.querySelector('#'+context.id)}var collection=[],elements=context.querySelectorAll(selector),i,ii;for(i=0,ii=elements.length;i<ii;i+=1){collection.push(elements[i])}return collection},xpath:function(context,selector){if(context!=document){if(context.id===''){context.setProperty('id',context.tagName.toLowerCase()+(guid+=1))}selector='#'+context.id+' '+selector}var collection=[],element,elements=document.evaluate(resolve(selector),document,null,0,null);while((element=elements.iterateNext())){collection.push(element)}return collection}}}();analogue.extend(Function.prototype,{bind:analogue.bind,extend:analogue.extend,inherit:function(object){this.prototype=object;return this},inherits:function(Parent,inheritance){this.constructor=Parent;this.prototype=new Parent();if(inheritance){this.extend(this.prototype,inheritance)}return this}});analogue.extend(window,{addEvent:function(){analogue.events.add.apply(window,arguments)},removeEvent:function(){analogue.events.remove.apply(window,arguments)}});analogue.extend(document,{addEvent:function(type,listener){if(type=='ready'||type=='domready'||type=='DOMContentLoaded'){if(!this.ready.fired){this.ready.queue.push(listener)}else{listener()}return this}analogue.events.add.apply(this,arguments)},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){if(!this.ready.fired&&(window.msie||(window.webkit&&window.webkit.version==418))){this.write(window.unescape('%3Cscript src="'+source+'" type="text/javascript"%3E%3C/script%3E'))}else{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(this.ready.fired){return}this.ready.fired=true;for(var i=0,ii=this.ready.queue.length;i<ii;i+=1){this.ready.queue[i]()}this.ready.queue=[];if(this.removeEventListener){this.removeEventListener('DOMContentLoaded',this.ready,false)}window.removeEvent('load',this.ready)},set:function(tag,attributes,content){var element,i,ii;if(window.msie&&attributes){for(i in attributes){if(i.match(/^(checked|multiple|name|readonly|type)$/i)){tag+=' '+i+'="'+attributes[i]+'"';delete attributes[i]}}tag='<'+tag+'>'}element=this.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(this.createTextNode(content))}else{for(i=0,ii=content.length;i<ii;i+=1){if(typeof content[i]=='string'){content[i]=this.createTextNode(content[i])}element.appendChild(content[i])}}}return element}});analogue.extend(document.ready,{fired:false,queue:[]});analogue.extend(document,analogue.methods);analogue.extend(analogue.elements,analogue.methods);if(window.webkit&&window.webkit.version==418){HTMLElement=function(){};HTMLElement.prototype=window['[[DOMElement.prototype]]'];document.loadScript(analogue.path+'webkit418.js')}if(typeof HTMLElement=='undefined'){document.create=document.createElement;document.createElement=function(tag){return analogue.extend(document.create(tag),analogue.elements)};document.addEvent('ready',function(){var element,elements=document.getElementsByTagName('*'),i;for(i=0;(element=elements[i]);i+=1){analogue.extend(element,analogue.elements)}})}else{analogue.extend(HTMLElement.prototype,analogue.elements)}if(window.msie){document.loadScript(analogue.path+'msie'+window.msie.version+'.js')}if(document.addEventListener){document.addEventListener('DOMContentLoaded',document.ready,false)}window.addEvent('load',document.ready);analogue.forms=function(){var mxLookup=function(value){var path=analogue.path+'mx/',request=new XMLHttpRequest();if(!request){return true}else{request.open('GET',path+'?email='+value.split('@')[1]+'&nocache='+new Date().getTime(),false);request.send(null);if(request.status==200){if(request.responseText.indexOf('ERROR')){return true}return false}return true}},validate={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:'34,37'},{length:'16',name:'Discover',prefix:'6011,65'},{length:'16',name:'MasterCard',prefix:'51,52,53,54,55'},{length:'13,16',name:'Visa',prefix:'4'}];return{length:function(element){var i,ii,lengths=cards[element.cardType].length.split(','),value=element.value;element.cardLength=false;for(i=0,ii=lengths.length;i<ii;i+=1){if(value.length==lengths[i]){return true}}return false},luhn10: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,j,jj,prefixes,value=element.value;element.cardPrefix=element.cardType=false;if(value.length>1){for(i=0,ii=cards.length;i<ii;i+=1){prefixes=cards[i].prefix.split(',');for(j=0,jj=prefixes.length;j<jj;j+=1){if(value.match(new RegExp('^'+prefixes[j]))){element.cardPrefix=true;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){var result=(/^([\w\-]+(?:\.[\w\-]+)*)@((?:[\w\-]+\.)*\w[\w\-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/).test(value);if(result){return mxLookup(value)}return result},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)}};return{focus:false,getLabel:function(element,form){var i,label,labels=form.getElementsByTagName('label');if(element.parentNode.nodeName.toLowerCase()=='label'){return element.parentNode}for(i=0;(label=labels[i]);i+=1){if(label.htmlFor&&label.htmlFor==element.id){return label}}return false},setFocus:function(){var element,elements=analogue.forms.focus.elements,i;for(i=0;(element=elements[i]);i+=1){if(element.nodeName.toLowerCase()!='fieldset'&&element.type.toLowerCase()!='hidden'&&!element.disabled){element.focus();break}}},submit:function(event){var count,element,elements=this.getElementsByClassName('isRequired'),error,errors=[],i,j,jj,match,message,span,tag,title,valid,value;for(i=0;(element=elements[i]);i+=1){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)&&(count=parseInt(RegExp.$1,10))){if(!(valid=count<=validate.group(element))){errors.push('Please select at least '+count+' options in the '+title+' group.')}}else if(!(valid=validate.group(element))){errors.push('Please select an option in the '+title+' group.')}if(valid&&(/atMost-(\d+)/).test(element.className)&&(count=parseInt(RegExp.$1,10))){if(!(valid=count>=validate.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=validate.empty(value))){errors.push('The '+title+' field is required.')}else if(element.hasClass('useAlpha')&&(!(valid=validate.alpha(value)))){errors.push('The '+title+' field may contain letters only, no numbers or other characters.')}else if(element.hasClass('useAlphaNumeric')&&(!(valid=validate.alphaNumeric(value)))){errors.push('The '+title+' field may contain letters and numbers only.')}else if(element.hasClass('useCreditCard')){value=element.value=element.value.replace(/\W/gi,'');if((!(valid=validate.numeric(value)))){errors.push('The Credit Card number may contain numbers only, no letters or other characters.')}else if(!(valid=validate.creditCard.prefix(element))){errors.push('The Credit Card number you entered is an unknown or unsupported card type.')}else if(!(valid=validate.creditCard.length(element))){errors.push('Your '+element.cardName+' card number has too many or too few digits.')}else if(!(valid=validate.creditCard.luhn10(value))){errors.push('Your '+element.cardName+' card number is invalid.')}}else if(element.hasClass('useDate')&&(!(valid=validate.date(value)))){errors.push(value+' does not appear to be a valid date.')}else if(element.hasClass('useEmail')&&(!(valid=validate.email(value)))){errors.push(value+' does not appear to be a valid e-mail address.')}else if(element.hasClass('useMatch')&&(!(valid=validate.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('useNumeric')&&(!(valid=validate.numeric(value)))){errors.push('The '+title+' field may contain numbers only, no letters or other characters.')}else if(element.hasClass('usePhone')&&(!(valid=validate.phone(value)))){errors.push(value+' does not appear to be a valid phone number.')}}break;case'select':if(element.hasClass('useIndex')){valid=element.selectedIndex!='0'}else{valid=validate.empty(element.options[element.selectedIndex].value)}if(!valid){errors.push('Please select an option from the '+title+' list.')}break;case'textarea':if(!(valid=validate.empty(value))){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')&&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')){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},validate:function(method){return validate[method]}}}();document.addEvent('ready',function(){var element,elements,form,forms=document.getElementsByTagName('form'),i,j;for(i=0;(form=forms[i]);i+=1){if(!this.focus&&form.hasClass('setFocus')){this.focus=form}elements=form.getElementsByClassName('isRequired');if(elements.length>0){form.addEvent('submit',this.submit);for(j=0;(element=elements[j]);j+=1){element.label=this.getLabel(element,form)}}}if(this.focus){window.addEvent('load',this.setFocus)}}.bind(analogue.forms));document.loadScript((('https:'==document.location.protocol)?'https://ssl.':'http://www.')+'google-analytics.com/ga.js');