Scotty is currently beaming up... Please wait while we gather your data.
'; } function initController(loc, t, o){ if(t) setPending(t, loc, null); else if(!isWildcard(loc)) refresh('/404'); core.switchUserCallback(); } function setRoutes(d){ o = d; } function setPending(t, s, wcv){ if(isDefined(pending) && isDefined(pending.exit)) pending.exit(); notifications.setLoading(); pendingLoc = s; pendingT = t; pending = window[t.controller](core, target, data, delayedUpdate, wcv); } function isWildcard(s){ var lio = s.lastIndexOf('/') + 1, k = s.substring(0, lio) + '*', wcv = s.substring(lio), t = o[k]; if(!isDefined(t)) return false; else { setPending(t, s, wcv); return true; } } function delayedUpdate(){ setTimeout(update, 1); } function update(loc, t){ exitCheck(); updateCurrent(t); notifications.setSuccess('Load success!'); } function updateCurrent(t){ if(isDefined(pendingT)){ var t = pendingT; currentLoc = pendingLoc; current = pending; pendingLoc = null; pending = null; pendingT = null; breadcrumbs.update(t.breadcrumbs); if(isDefined(current)){ core.search.setTarget(current.search); } if(!current || current.hasCart !== true){ core.shoppingCart.hide(); } } } function exitCheck(){ if(isDefined(current) && current.exit) current.exit(); } }; var Search = function(){ var events = new EventManager(), ns = document.getElementById('navSearch'), t = getSearch(), state = true, targetFn = null; this.setTarget = setTarget; this.update = update; refresh(); bindSearch(); function setTarget(fn){ targetFn = fn; refresh(); } function refresh(){ if(isFunction(targetFn)){ show(); } else { hide(); } } function update(){ events.reset(); t = getSearch(); bindSearch(); } function bindSearch(){ events.add(t, 'keyup', cb); } function show(){ if(state){ return; } ns.classList.remove('noDisplay'); state = true; } function hide(){ if(!state){ return; } ns.classList.add('noDisplay'); state = false; } function getSearch(){ ns = document.getElementById('navSearch'); if(ns === null){ return null; } return ns.querySelector('input'); } function cb(e){ if(!state){ return; } targetFn(e); } }; if(element) init(data); }; var Footer = function(main, data){ this.update = update; var element = main.querySelector('footer'); function update(){} }; var NoficationManager = function(target){ var notification = new Notification(target, '', { 'data' : {}, 'id' : 'loading', 'cssTransition' : 'linearShort' }, unset), loadingStd = 'Scotty is currently beaming up... Please wait while we gather your data.', element = notification.getElement(), content = element.querySelector('div'), templates = new Templates, state = false, closeDuration = 6000, freshDuration = 1200, closeTimeout = null, freshTimeout = null, isFresh = false, queue = null; this.setLoading = setLoading; this.setSuccess = setSuccess; this.setMissingFields = setMissingFields/*Cookies*/; this.setError = setError; this.setErrors = setErrors; this.unset = unset; function loading(message){ standardUpdate('loading', message || loadingStd); } function success(message){ standardUpdate('success', message); setCloseTimer(); setFresh(); } function missingFields(array){ standardUpdate('missingFields', array); setCloseTimer(); setFresh(); } function error(message){ standardUpdate('error', message); setCloseTimer(); setFresh(); } function errors(array){ standardUpdate('errors', array); setCloseTimer(); setFresh(); } function standardUpdate(templateKey, data){ clearCloseTimer(); content.innerHTML = render(templates[templateKey], data); open(); setFresh(); } function getQueueClosure(fn, m){ return function(fn, m){ return function(){ fn(m); }; }(fn, m); } function setLoading(message){ if(isFresh === false) loading(message); else queue = loading; } function setSuccess(message){ if(isFresh === false) success(message); else queue = getQueueClosure(success, message); } function setError(message){ if(isFresh === false) error(message); else queue = getQueueClosure(error, message); } function setErrors(array){ if(isFresh === false){ // Do stuff errors(array); return; } queue = getQueueClosure(errors, array); } function setMissingFields(array){ if(isFresh === false) missingFields(array); else queue = getQueueClosure(missingFields, array); } function setFresh(){ isFresh = true; setFreshTimer(); } function setCloseTimer(){ clearCloseTimer(); closeTimeout = setTimeout(close, closeDuration); } function setFreshTimer(){ clearFreshTimer(); freshTimeout = setTimeout(unsetFresh, freshDuration); } function unset(){ close(); } function unsetFresh(){ isFresh = false; if(isDefined(queue)) queue(); queue = null; } function clearCloseTimer(){ if(closeTimeout != null){ clearTimeout(closeTimeout); closeTimeout = null; } } function clearFreshTimer(){ if(freshTimeout != null){ clearTimeout(freshTimeout); freshTimeout = null; } } function open(){ if(state === false){ clearCloseTimer(); state = true; element.className = 'active'; } } function close(){ if(state === true){ state = false; element.className = ''; } } function Templates(){ this.loading = '{{ . }}
'; this.success = '{{ . }}
Please complete the required fields
{{ . }}
The following errors occurred