Warning: count(): Parameter must be an array or an object that implements Countable in /home3/atlants1/public_html/squirrelcart/functions/db/sc_query.func.php on line 117

Warning: count(): Parameter must be an array or an object that implements Countable in /home3/atlants1/public_html/squirrelcart/functions/db/sc_query.func.php on line 117

Warning: count(): Parameter must be an array or an object that implements Countable in /home3/atlants1/public_html/squirrelcart/functions/db/sc_query.func.php on line 117

Warning: count(): Parameter must be an array or an object that implements Countable in /home3/atlants1/public_html/squirrelcart/functions/db/sc_query.func.php on line 117

Warning: count(): Parameter must be an array or an object that implements Countable in /home3/atlants1/public_html/squirrelcart/functions/db/sc_query.func.php on line 117

Warning: count(): Parameter must be an array or an object that implements Countable in /home3/atlants1/public_html/squirrelcart/functions/db/sc_query.func.php on line 117

Warning: count(): Parameter must be an array or an object that implements Countable in /home3/atlants1/public_html/squirrelcart/functions/db/sc_query.func.php on line 117

Warning: count(): Parameter must be an array or an object that implements Countable in /home3/atlants1/public_html/squirrelcart/functions/db/sc_query.func.php on line 117

Warning: count(): Parameter must be an array or an object that implements Countable in /home3/atlants1/public_html/squirrelcart/functions/db/sc_query.func.php on line 117

Warning: count(): Parameter must be an array or an object that implements Countable in /home3/atlants1/public_html/squirrelcart/functions/db/sc_query.func.php on line 117

Warning: Cannot modify header information - headers already sent by (output started at /home3/atlants1/public_html/squirrelcart/functions/db/sc_query.func.php:117) in /home3/atlants1/public_html/squirrelcart/functions/cms/sc_javascript_cache.func.php on line 16

Warning: Cannot modify header information - headers already sent by (output started at /home3/atlants1/public_html/squirrelcart/functions/db/sc_query.func.php:117) in /home3/atlants1/public_html/squirrelcart/functions/cms/sc_javascript_cache.func.php on line 17

Warning: Cannot modify header information - headers already sent by (output started at /home3/atlants1/public_html/squirrelcart/functions/db/sc_query.func.php:117) in /home3/atlants1/public_html/squirrelcart/functions/cms/sc_javascript_cache.func.php on line 23
// remote scripting library var sajax_debug_mode = false; var sajax_request_type = "POST"; var sajax_target_id = ""; var sajax_failure_redirect = ""; function sajax_debug(text) { if (sajax_debug_mode) alert(text); } function sajax_init_object() { sajax_debug("sajax_init_object() called..") var A; var msxmlhttp = new Array( 'Msxml2.XMLHTTP.6.0', 'Msxml2.XMLHTTP.3.0', 'Msxml2.XMLHTTP', 'Microsoft.XMLHTTP'); for (var i = 0; i < msxmlhttp.length; i++) { try { A = new ActiveXObject(msxmlhttp[i]); } catch (e) { A = null; } } if(!A && typeof XMLHttpRequest != "undefined") A = new XMLHttpRequest(); if (!A) sajax_debug("Could not create connection object."); return A; } var sajax_requests = new Array(); function sajax_cancel() { for (var i = 0; i < sajax_requests.length; i++) sajax_requests[i].abort(); } function sajax_do_call(func_name, args) { var i, x, n; var uri; var post_data; var target_id; sajax_debug("in sajax_do_call().." + sajax_request_type + "/" + sajax_target_id); target_id = sajax_target_id; if (typeof(sajax_request_type) == "undefined" || sajax_request_type == "") sajax_request_type = "GET"; uri = "/squirrelcart/js/storefront.js.php?no_comments=1&tct=239293001714386943"; if (sajax_request_type == "GET") { if (uri.indexOf("?") == -1) uri += "?rs=" + escape(func_name); else uri += "&rs=" + escape(func_name); uri += "&rst=" + escape(sajax_target_id); uri += "&rsrnd=" + new Date().getTime(); for (i = 0; i < args.length-1; i++) uri += "&rsargs[]=" + escape(args[i]); post_data = null; } else if (sajax_request_type == "POST") { post_data = "rs=" + escape(func_name); post_data += "&rst=" + escape(sajax_target_id); post_data += "&rsrnd=" + new Date().getTime(); for (i = 0; i < args.length-1; i++) post_data = post_data + "&rsargs[]=" + escape(args[i]); } else { alert("Illegal request type: " + sajax_request_type); } x = sajax_init_object(); if (x == null) { if (sajax_failure_redirect != "") { location.href = sajax_failure_redirect; return false; } else { sajax_debug("NULL sajax object for user agent:\n" + navigator.userAgent); return false; } } else { x.open(sajax_request_type, uri, true); sajax_requests[sajax_requests.length] = x; if (sajax_request_type == "POST") { x.setRequestHeader("Method", "POST " + uri + " HTTP/1.1"); x.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); } x.onreadystatechange = function() { if (x.readyState != 4) return; sajax_debug("received " + x.responseText); var status; var data; var txt = x.responseText.replace(/^\s*|\s*$/g,""); status = txt.charAt(0); data = txt.substring(2); if (status == "") { } else if (status == "-") alert("Error: " + data); else { if (target_id != "") document.getElementById(target_id).innerHTML = eval(data); else { try { var callback; var extra_data = false; if (typeof args[args.length-1] == "object") { callback = args[args.length-1].callback; extra_data = args[args.length-1].extra_data; } else { callback = args[args.length-1]; } callback(eval(data), extra_data); } catch (e) { sajax_debug("Caught error " + e + ": Could not eval " + data ); } } } } } sajax_debug(func_name + " uri = " + uri + "/post = " + post_data); x.send(post_data); sajax_debug(func_name + " waiting.."); delete x; return true; } function x_sc_get_discount() { sajax_do_call("sc_get_discount", x_sc_get_discount.arguments); } function x_sc_ship_estimator_get() { sajax_do_call("sc_ship_estimator_get", x_sc_ship_estimator_get.arguments); } !function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l="1.11.3",m=function(a,b){return new m.fn.init(a,b)},n=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,o=/^-ms-/,p=/-([\da-z])/gi,q=function(a,b){return b.toUpperCase()};m.fn=m.prototype={jquery:l,constructor:m,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=m.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return m.each(this,a,b)},map:function(a){return this.pushStack(m.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},m.extend=m.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||m.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(m.isPlainObject(c)||(b=m.isArray(c)))?(b?(b=!1,f=a&&m.isArray(a)?a:[]):f=a&&m.isPlainObject(a)?a:{},g[d]=m.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},m.extend({expando:"jQuery"+(l+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===m.type(a)},isArray:Array.isArray||function(a){return"array"===m.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return!m.isArray(a)&&a-parseFloat(a)+1>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==m.type(a)||a.nodeType||m.isWindow(a))return!1;try{if(a.constructor&&!j.call(a,"constructor")&&!j.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(k.ownLast)for(b in a)return j.call(a,b);for(b in a);return void 0===b||j.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(b){b&&m.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(o,"ms-").replace(p,q)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=r(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(n,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(r(Object(a))?m.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(g)return g.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=r(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(f=a[b],b=a,a=f),m.isFunction(a)?(c=d.call(arguments,2),e=function(){return a.apply(b||this,c.concat(d.call(arguments)))},e.guid=a.guid=a.guid||m.guid++,e):void 0},now:function(){return+new Date},support:k}),m.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function r(a){var b="length"in a&&a.length,c=m.type(a);return"function"===c||m.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var s=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N=M.replace("w","w#"),O="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+N+"))|)"+L+"*\\]",P=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+O+")*)|.*)\\)|)",Q=new RegExp(L+"+","g"),R=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),S=new RegExp("^"+L+"*,"+L+"*"),T=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),U=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),V=new RegExp(P),W=new RegExp("^"+N+"$"),X={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+O),PSEUDO:new RegExp("^"+P),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,aa=/[+~]/,ba=/'|\\/g,ca=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),da=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ea=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(fa){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],k=b.nodeType,"string"!=typeof a||!a||1!==k&&9!==k&&11!==k)return d;if(!e&&p){if(11!==k&&(f=_.exec(a)))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return H.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName)return H.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=1!==k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(ba,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+ra(o[l]);w=aa.test(a)&&pa(b.parentNode)||b,x=o.join(",")}if(x)try{return H.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function pa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=g.documentElement,e=g.defaultView,e&&e!==e.top&&(e.addEventListener?e.addEventListener("unload",ea,!1):e.attachEvent&&e.attachEvent("onunload",ea)),p=!f(g),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(g.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(g.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!g.getElementsByName||!g.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ca,da);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ca,da);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(g.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){var b=g.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",P)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===g||a.ownerDocument===v&&t(v,a)?-1:b===g||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,h=[a],i=[b];if(!e||!f)return a===g?-1:b===g?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?la(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},g):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ca,da),a[3]=(a[3]||a[4]||a[5]||"").replace(ca,da),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ca,da).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(Q," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(ca,da),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return W.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(ca,da).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:oa(function(){return[0]}),last:oa(function(a,b){return[b-1]}),eq:oa(function(a,b,c){return[0>c?c+b:c]}),even:oa(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:oa(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:oa(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:oa(function(a,b,c){for(var d=0>c?c+b:c;++db;b++)d+=a[b].value;return d}function sa(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function ta(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ua(a,b,c){for(var d=0,e=b.length;e>d;d++)ga(a,b[d],c);return c}function va(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function wa(a,b,c,d,e,f){return d&&!d[u]&&(d=wa(d)),e&&!e[u]&&(e=wa(e,f)),ia(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ua(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:va(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=va(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=va(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function xa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=sa(function(a){return a===b},h,!0),l=sa(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[sa(ta(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return wa(i>1&&ta(m),i>1&&ra(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&xa(a.slice(i,e)),f>e&&xa(a=a.slice(e)),f>e&&ra(a))}m.push(c)}return ta(m)}function ya(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=F.call(i));s=va(s)}H.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&ga.uniqueSort(i)}return k&&(w=v,j=t),r};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=xa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,ya(e,d)),f.selector=a}return f},i=ga.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ca,da),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ca,da),aa.test(j[0].type)&&pa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&ra(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,aa.test(a)&&pa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ja(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);m.find=s,m.expr=s.selectors,m.expr[":"]=m.expr.pseudos,m.unique=s.uniqueSort,m.text=s.getText,m.isXMLDoc=s.isXML,m.contains=s.contains;var t=m.expr.match.needsContext,u=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,v=/^.[^:#\[\.,]*$/;function w(a,b,c){if(m.isFunction(b))return m.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return m.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(v.test(b))return m.filter(b,a,c);b=m.filter(b,a)}return m.grep(a,function(a){return m.inArray(a,b)>=0!==c})}m.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?m.find.matchesSelector(d,a)?[d]:[]:m.find.matches(a,m.grep(b,function(a){return 1===a.nodeType}))},m.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(m(a).filter(function(){for(b=0;e>b;b++)if(m.contains(d[b],this))return!0}));for(b=0;e>b;b++)m.find(a,d[b],c);return c=this.pushStack(e>1?m.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(w(this,a||[],!1))},not:function(a){return this.pushStack(w(this,a||[],!0))},is:function(a){return!!w(this,"string"==typeof a&&t.test(a)?m(a):a||[],!1).length}});var x,y=a.document,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=m.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||x).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof m?b[0]:b,m.merge(this,m.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:y,!0)),u.test(c[1])&&m.isPlainObject(b))for(c in b)m.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}if(d=y.getElementById(c[2]),d&&d.parentNode){if(d.id!==c[2])return x.find(a);this.length=1,this[0]=d}return this.context=y,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):m.isFunction(a)?"undefined"!=typeof x.ready?x.ready(a):a(m):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),m.makeArray(a,this))};A.prototype=m.fn,x=m(y);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};m.extend({dir:function(a,b,c){var d=[],e=a[b];while(e&&9!==e.nodeType&&(void 0===c||1!==e.nodeType||!m(e).is(c)))1===e.nodeType&&d.push(e),e=e[b];return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),m.fn.extend({has:function(a){var b,c=m(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(m.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=t.test(a)||"string"!=typeof a?m(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&m.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?m.unique(f):f)},index:function(a){return a?"string"==typeof a?m.inArray(this[0],m(a)):m.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(m.unique(m.merge(this.get(),m(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}m.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return m.dir(a,"parentNode")},parentsUntil:function(a,b,c){return m.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return m.dir(a,"nextSibling")},prevAll:function(a){return m.dir(a,"previousSibling")},nextUntil:function(a,b,c){return m.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return m.dir(a,"previousSibling",c)},siblings:function(a){return m.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return m.sibling(a.firstChild)},contents:function(a){return m.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:m.merge([],a.childNodes)}},function(a,b){m.fn[a]=function(c,d){var e=m.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=m.filter(d,e)),this.length>1&&(C[a]||(e=m.unique(e)),B.test(a)&&(e=e.reverse())),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return m.each(a.match(E)||[],function(a,c){b[c]=!0}),b}m.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):m.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(c=a.memory&&l,d=!0,f=g||0,g=0,e=h.length,b=!0;h&&e>f;f++)if(h[f].apply(l[0],l[1])===!1&&a.stopOnFalse){c=!1;break}b=!1,h&&(i?i.length&&j(i.shift()):c?h=[]:k.disable())},k={add:function(){if(h){var d=h.length;!function f(b){m.each(b,function(b,c){var d=m.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&f(c)})}(arguments),b?e=h.length:c&&(g=d,j(c))}return this},remove:function(){return h&&m.each(arguments,function(a,c){var d;while((d=m.inArray(c,h,d))>-1)h.splice(d,1),b&&(e>=d&&e--,f>=d&&f--)}),this},has:function(a){return a?m.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],e=0,this},disable:function(){return h=i=c=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,c||k.disable(),this},locked:function(){return!i},fireWith:function(a,c){return!h||d&&!i||(c=c||[],c=[a,c.slice?c.slice():c],b?i.push(c):j(c)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!d}};return k},m.extend({Deferred:function(a){var b=[["resolve","done",m.Callbacks("once memory"),"resolved"],["reject","fail",m.Callbacks("once memory"),"rejected"],["notify","progress",m.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return m.Deferred(function(c){m.each(b,function(b,f){var g=m.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&m.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?m.extend(a,d):d}},e={};return d.pipe=d.then,m.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&m.isFunction(a.promise)?e:0,g=1===f?a:m.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&m.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;m.fn.ready=function(a){return m.ready.promise().done(a),this},m.extend({isReady:!1,readyWait:1,holdReady:function(a){a?m.readyWait++:m.ready(!0)},ready:function(a){if(a===!0?!--m.readyWait:!m.isReady){if(!y.body)return setTimeout(m.ready);m.isReady=!0,a!==!0&&--m.readyWait>0||(H.resolveWith(y,[m]),m.fn.triggerHandler&&(m(y).triggerHandler("ready"),m(y).off("ready")))}}});function I(){y.addEventListener?(y.removeEventListener("DOMContentLoaded",J,!1),a.removeEventListener("load",J,!1)):(y.detachEvent("onreadystatechange",J),a.detachEvent("onload",J))}function J(){(y.addEventListener||"load"===event.type||"complete"===y.readyState)&&(I(),m.ready())}m.ready.promise=function(b){if(!H)if(H=m.Deferred(),"complete"===y.readyState)setTimeout(m.ready);else if(y.addEventListener)y.addEventListener("DOMContentLoaded",J,!1),a.addEventListener("load",J,!1);else{y.attachEvent("onreadystatechange",J),a.attachEvent("onload",J);var c=!1;try{c=null==a.frameElement&&y.documentElement}catch(d){}c&&c.doScroll&&!function e(){if(!m.isReady){try{c.doScroll("left")}catch(a){return setTimeout(e,50)}I(),m.ready()}}()}return H.promise(b)};var K="undefined",L;for(L in m(k))break;k.ownLast="0"!==L,k.inlineBlockNeedsLayout=!1,m(function(){var a,b,c,d;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",k.inlineBlockNeedsLayout=a=3===b.offsetWidth,a&&(c.style.zoom=1)),c.removeChild(d))}),function(){var a=y.createElement("div");if(null==k.deleteExpando){k.deleteExpando=!0;try{delete a.test}catch(b){k.deleteExpando=!1}}a=null}(),m.acceptData=function(a){var b=m.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b};var M=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,N=/([A-Z])/g;function O(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(N,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:M.test(c)?m.parseJSON(c):c}catch(e){}m.data(a,b,c)}else c=void 0}return c}function P(a){var b;for(b in a)if(("data"!==b||!m.isEmptyObject(a[b]))&&"toJSON"!==b)return!1; return!0}function Q(a,b,d,e){if(m.acceptData(a)){var f,g,h=m.expando,i=a.nodeType,j=i?m.cache:a,k=i?a[h]:a[h]&&h;if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||m.guid++:h),j[k]||(j[k]=i?{}:{toJSON:m.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=m.extend(j[k],b):j[k].data=m.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[m.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[m.camelCase(b)])):f=g,f}}function R(a,b,c){if(m.acceptData(a)){var d,e,f=a.nodeType,g=f?m.cache:a,h=f?a[m.expando]:m.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){m.isArray(b)?b=b.concat(m.map(b,m.camelCase)):b in d?b=[b]:(b=m.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!P(d):!m.isEmptyObject(d))return}(c||(delete g[h].data,P(g[h])))&&(f?m.cleanData([a],!0):k.deleteExpando||g!=g.window?delete g[h]:g[h]=null)}}}m.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?m.cache[a[m.expando]]:a[m.expando],!!a&&!P(a)},data:function(a,b,c){return Q(a,b,c)},removeData:function(a,b){return R(a,b)},_data:function(a,b,c){return Q(a,b,c,!0)},_removeData:function(a,b){return R(a,b,!0)}}),m.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=m.data(f),1===f.nodeType&&!m._data(f,"parsedAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=m.camelCase(d.slice(5)),O(f,d,e[d])));m._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){m.data(this,a)}):arguments.length>1?this.each(function(){m.data(this,a,b)}):f?O(f,a,m.data(f,a)):void 0},removeData:function(a){return this.each(function(){m.removeData(this,a)})}}),m.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=m._data(a,b),c&&(!d||m.isArray(c)?d=m._data(a,b,m.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=m.queue(a,b),d=c.length,e=c.shift(),f=m._queueHooks(a,b),g=function(){m.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return m._data(a,c)||m._data(a,c,{empty:m.Callbacks("once memory").add(function(){m._removeData(a,b+"queue"),m._removeData(a,c)})})}}),m.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.lengthh;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},W=/^(?:checkbox|radio)$/i;!function(){var a=y.createElement("input"),b=y.createElement("div"),c=y.createDocumentFragment();if(b.innerHTML="
a",k.leadingWhitespace=3===b.firstChild.nodeType,k.tbody=!b.getElementsByTagName("tbody").length,k.htmlSerialize=!!b.getElementsByTagName("link").length,k.html5Clone="<:nav>"!==y.createElement("nav").cloneNode(!0).outerHTML,a.type="checkbox",a.checked=!0,c.appendChild(a),k.appendChecked=a.checked,b.innerHTML="",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue,c.appendChild(b),b.innerHTML="",k.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,k.noCloneEvent=!0,b.attachEvent&&(b.attachEvent("onclick",function(){k.noCloneEvent=!1}),b.cloneNode(!0).click()),null==k.deleteExpando){k.deleteExpando=!0;try{delete b.test}catch(d){k.deleteExpando=!1}}}(),function(){var b,c,d=y.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(k[b+"Bubbles"]=c in a)||(d.setAttribute(c,"t"),k[b+"Bubbles"]=d.attributes[c].expando===!1);d=null}();var X=/^(?:input|select|textarea)$/i,Y=/^key/,Z=/^(?:mouse|pointer|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=/^([^.]*)(?:\.(.+)|)$/;function aa(){return!0}function ba(){return!1}function ca(){try{return y.activeElement}catch(a){}}m.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=m.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return typeof m===K||a&&m.event.triggered===a.type?void 0:m.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(E)||[""],h=b.length;while(h--)f=_.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=m.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=m.event.special[o]||{},l=m.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&m.expr.match.needsContext.test(e),namespace:p.join(".")},i),(n=g[o])||(n=g[o]=[],n.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?n.splice(n.delegateCount++,0,l):n.push(l),m.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m.hasData(a)&&m._data(a);if(r&&(k=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=_.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=m.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,n=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=n.length;while(f--)g=n[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(n.splice(f,1),g.selector&&n.delegateCount--,l.remove&&l.remove.call(a,g));i&&!n.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||m.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)m.event.remove(a,o+b[j],c,d,!0);m.isEmptyObject(k)&&(delete r.handle,m._removeData(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,l,n,o=[d||y],p=j.call(b,"type")?b.type:b,q=j.call(b,"namespace")?b.namespace.split("."):[];if(h=l=d=d||y,3!==d.nodeType&&8!==d.nodeType&&!$.test(p+m.event.triggered)&&(p.indexOf(".")>=0&&(q=p.split("."),p=q.shift(),q.sort()),g=p.indexOf(":")<0&&"on"+p,b=b[m.expando]?b:new m.Event(p,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=q.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:m.makeArray(c,[b]),k=m.event.special[p]||{},e||!k.trigger||k.trigger.apply(d,c)!==!1)){if(!e&&!k.noBubble&&!m.isWindow(d)){for(i=k.delegateType||p,$.test(i+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),l=h;l===(d.ownerDocument||y)&&o.push(l.defaultView||l.parentWindow||a)}n=0;while((h=o[n++])&&!b.isPropagationStopped())b.type=n>1?i:k.bindType||p,f=(m._data(h,"events")||{})[b.type]&&m._data(h,"handle"),f&&f.apply(h,c),f=g&&h[g],f&&f.apply&&m.acceptData(h)&&(b.result=f.apply(h,c),b.result===!1&&b.preventDefault());if(b.type=p,!e&&!b.isDefaultPrevented()&&(!k._default||k._default.apply(o.pop(),c)===!1)&&m.acceptData(d)&&g&&d[p]&&!m.isWindow(d)){l=d[g],l&&(d[g]=null),m.event.triggered=p;try{d[p]()}catch(r){}m.event.triggered=void 0,l&&(d[g]=l)}return b.result}},dispatch:function(a){a=m.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(m._data(this,"events")||{})[a.type]||[],k=m.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=m.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,g=0;while((e=f.handlers[g++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(e.namespace))&&(a.handleObj=e,a.data=e.data,c=((m.event.special[e.origType]||{}).handle||e.handler).apply(f.elem,i),void 0!==c&&(a.result=c)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(e=[],f=0;h>f;f++)d=b[f],c=d.selector+" ",void 0===e[c]&&(e[c]=d.needsContext?m(c,this).index(i)>=0:m.find(c,this,null,[i]).length),e[c]&&e.push(d);e.length&&g.push({elem:i,handlers:e})}return h]","i"),ha=/^\s+/,ia=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,ja=/<([\w:]+)/,ka=/\s*$/g,ra={option:[1,""],legend:[1,"
","
"],area:[1,"",""],param:[1,"",""],thead:[1,"","
"],tr:[2,"","
"],col:[2,"","
"],td:[3,"","
"],_default:k.htmlSerialize?[0,"",""]:[1,"X
","
"]},sa=da(y),ta=sa.appendChild(y.createElement("div"));ra.optgroup=ra.option,ra.tbody=ra.tfoot=ra.colgroup=ra.caption=ra.thead,ra.th=ra.td;function ua(a,b){var c,d,e=0,f=typeof a.getElementsByTagName!==K?a.getElementsByTagName(b||"*"):typeof a.querySelectorAll!==K?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||m.nodeName(d,b)?f.push(d):m.merge(f,ua(d,b));return void 0===b||b&&m.nodeName(a,b)?m.merge([a],f):f}function va(a){W.test(a.type)&&(a.defaultChecked=a.checked)}function wa(a,b){return m.nodeName(a,"table")&&m.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function xa(a){return a.type=(null!==m.find.attr(a,"type"))+"/"+a.type,a}function ya(a){var b=pa.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function za(a,b){for(var c,d=0;null!=(c=a[d]);d++)m._data(c,"globalEval",!b||m._data(b[d],"globalEval"))}function Aa(a,b){if(1===b.nodeType&&m.hasData(a)){var c,d,e,f=m._data(a),g=m._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)m.event.add(b,c,h[c][d])}g.data&&(g.data=m.extend({},g.data))}}function Ba(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!k.noCloneEvent&&b[m.expando]){e=m._data(b);for(d in e.events)m.removeEvent(b,d,e.handle);b.removeAttribute(m.expando)}"script"===c&&b.text!==a.text?(xa(b).text=a.text,ya(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),k.html5Clone&&a.innerHTML&&!m.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&W.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}m.extend({clone:function(a,b,c){var d,e,f,g,h,i=m.contains(a.ownerDocument,a);if(k.html5Clone||m.isXMLDoc(a)||!ga.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(ta.innerHTML=a.outerHTML,ta.removeChild(f=ta.firstChild)),!(k.noCloneEvent&&k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||m.isXMLDoc(a)))for(d=ua(f),h=ua(a),g=0;null!=(e=h[g]);++g)d[g]&&Ba(e,d[g]);if(b)if(c)for(h=h||ua(a),d=d||ua(f),g=0;null!=(e=h[g]);g++)Aa(e,d[g]);else Aa(a,f);return d=ua(f,"script"),d.length>0&&za(d,!i&&ua(a,"script")),d=h=e=null,f},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,l,n=a.length,o=da(b),p=[],q=0;n>q;q++)if(f=a[q],f||0===f)if("object"===m.type(f))m.merge(p,f.nodeType?[f]:f);else if(la.test(f)){h=h||o.appendChild(b.createElement("div")),i=(ja.exec(f)||["",""])[1].toLowerCase(),l=ra[i]||ra._default,h.innerHTML=l[1]+f.replace(ia,"<$1>")+l[2],e=l[0];while(e--)h=h.lastChild;if(!k.leadingWhitespace&&ha.test(f)&&p.push(b.createTextNode(ha.exec(f)[0])),!k.tbody){f="table"!==i||ka.test(f)?""!==l[1]||ka.test(f)?0:h:h.firstChild,e=f&&f.childNodes.length;while(e--)m.nodeName(j=f.childNodes[e],"tbody")&&!j.childNodes.length&&f.removeChild(j)}m.merge(p,h.childNodes),h.textContent="";while(h.firstChild)h.removeChild(h.firstChild);h=o.lastChild}else p.push(b.createTextNode(f));h&&o.removeChild(h),k.appendChecked||m.grep(ua(p,"input"),va),q=0;while(f=p[q++])if((!d||-1===m.inArray(f,d))&&(g=m.contains(f.ownerDocument,f),h=ua(o.appendChild(f),"script"),g&&za(h),c)){e=0;while(f=h[e++])oa.test(f.type||"")&&c.push(f)}return h=null,o},cleanData:function(a,b){for(var d,e,f,g,h=0,i=m.expando,j=m.cache,l=k.deleteExpando,n=m.event.special;null!=(d=a[h]);h++)if((b||m.acceptData(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)n[e]?m.event.remove(d,e):m.removeEvent(d,e,g.handle);j[f]&&(delete j[f],l?delete d[i]:typeof d.removeAttribute!==K?d.removeAttribute(i):d[i]=null,c.push(f))}}}),m.fn.extend({text:function(a){return V(this,function(a){return void 0===a?m.text(this):this.empty().append((this[0]&&this[0].ownerDocument||y).createTextNode(a))},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wa(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wa(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?m.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||m.cleanData(ua(c)),c.parentNode&&(b&&m.contains(c.ownerDocument,c)&&za(ua(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&m.cleanData(ua(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&m.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return m.clone(this,a,b)})},html:function(a){return V(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(fa,""):void 0;if(!("string"!=typeof a||ma.test(a)||!k.htmlSerialize&&ga.test(a)||!k.leadingWhitespace&&ha.test(a)||ra[(ja.exec(a)||["",""])[1].toLowerCase()])){a=a.replace(ia,"<$1>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(m.cleanData(ua(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,m.cleanData(ua(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,n=this,o=l-1,p=a[0],q=m.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&na.test(p))return this.each(function(c){var d=n.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(i=m.buildFragment(a,this[0].ownerDocument,!1,this),c=i.firstChild,1===i.childNodes.length&&(i=c),c)){for(g=m.map(ua(i,"script"),xa),f=g.length;l>j;j++)d=i,j!==o&&(d=m.clone(d,!0,!0),f&&m.merge(g,ua(d,"script"))),b.call(this[j],d,j);if(f)for(h=g[g.length-1].ownerDocument,m.map(g,ya),j=0;f>j;j++)d=g[j],oa.test(d.type||"")&&!m._data(d,"globalEval")&&m.contains(h,d)&&(d.src?m._evalUrl&&m._evalUrl(d.src):m.globalEval((d.text||d.textContent||d.innerHTML||"").replace(qa,"")));i=c=null}return this}}),m.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){m.fn[a]=function(a){for(var c,d=0,e=[],g=m(a),h=g.length-1;h>=d;d++)c=d===h?this:this.clone(!0),m(g[d])[b](c),f.apply(e,c.get());return this.pushStack(e)}});var Ca,Da={};function Ea(b,c){var d,e=m(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:m.css(e[0],"display");return e.detach(),f}function Fa(a){var b=y,c=Da[a];return c||(c=Ea(a,b),"none"!==c&&c||(Ca=(Ca||m("':"vimeo"===f.type&&(c=''),a('
'+c+"
").insertAfter(e.find(".owl-video")),this._playing=e.addClass("owl-video-playing"))},e.prototype.isInFullScreen=function(){var b=c.fullscreenElement||c.mozFullScreenElement||c.webkitFullscreenElement;return b&&a(b).parent().hasClass("owl-video-frame")},e.prototype.destroy=function(){var a,b;this._core.$element.off("click.owl.video");for(a in this._handlers)this._core.$element.off(a,this._handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.Video=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this.core=b,this.core.options=a.extend({},e.Defaults,this.core.options),this.swapping=!0,this.previous=d,this.next=d,this.handlers={"change.owl.carousel":a.proxy(function(a){a.namespace&&"position"==a.property.name&&(this.previous=this.core.current(),this.next=a.property.value)},this),"drag.owl.carousel dragged.owl.carousel translated.owl.carousel":a.proxy(function(a){a.namespace&&(this.swapping="translated"==a.type)},this),"translate.owl.carousel":a.proxy(function(a){a.namespace&&this.swapping&&(this.core.options.animateOut||this.core.options.animateIn)&&this.swap()},this)},this.core.$element.on(this.handlers)};e.Defaults={animateOut:!1,animateIn:!1},e.prototype.swap=function(){if(1===this.core.settings.items&&a.support.animation&&a.support.transition){this.core.speed(0);var b,c=a.proxy(this.clear,this),d=this.core.$stage.children().eq(this.previous),e=this.core.$stage.children().eq(this.next),f=this.core.settings.animateIn,g=this.core.settings.animateOut;this.core.current()!==this.previous&&(g&&(b=this.core.coordinates(this.previous)-this.core.coordinates(this.next),d.one(a.support.animation.end,c).css({left:b+"px"}).addClass("animated owl-animated-out").addClass(g)),f&&e.one(a.support.animation.end,c).addClass("animated owl-animated-in").addClass(f))}},e.prototype.clear=function(b){a(b.target).css({left:""}).removeClass("animated owl-animated-out owl-animated-in").removeClass(this.core.settings.animateIn).removeClass(this.core.settings.animateOut),this.core.onTransitionEnd()},e.prototype.destroy=function(){var a,b;for(a in this.handlers)this.core.$element.off(a,this.handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.Animate=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this._core=b,this._interval=null,this._paused=!1,this._handlers={"changed.owl.carousel":a.proxy(function(a){a.namespace&&"settings"===a.property.name&&(this._core.settings.autoplay?this.play():this.stop())},this),"initialized.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.autoplay&&this.play()},this),"play.owl.autoplay":a.proxy(function(a,b,c){a.namespace&&this.play(b,c)},this),"stop.owl.autoplay":a.proxy(function(a){a.namespace&&this.stop()},this),"mouseover.owl.autoplay":a.proxy(function(){this._core.settings.autoplayHoverPause&&this._core.is("rotating")&&this.pause()},this),"mouseleave.owl.autoplay":a.proxy(function(){ this._core.settings.autoplayHoverPause&&this._core.is("rotating")&&this.play()},this)},this._core.$element.on(this._handlers),this._core.options=a.extend({},e.Defaults,this._core.options)};e.Defaults={autoplay:!1,autoplayTimeout:5e3,autoplayHoverPause:!1,autoplaySpeed:!1},e.prototype.play=function(d,e){this._paused=!1,this._core.is("rotating")||(this._core.enter("rotating"),this._interval=b.setInterval(a.proxy(function(){this._paused||this._core.is("busy")||this._core.is("interacting")||c.hidden||this._core.next(e||this._core.settings.autoplaySpeed)},this),d||this._core.settings.autoplayTimeout))},e.prototype.stop=function(){this._core.is("rotating")&&(b.clearInterval(this._interval),this._core.leave("rotating"))},e.prototype.pause=function(){this._core.is("rotating")&&(this._paused=!0)},e.prototype.destroy=function(){var a,b;this.stop();for(a in this._handlers)this._core.$element.off(a,this._handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.autoplay=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){"use strict";var e=function(b){this._core=b,this._initialized=!1,this._pages=[],this._controls={},this._templates=[],this.$element=this._core.$element,this._overrides={next:this._core.next,prev:this._core.prev,to:this._core.to},this._handlers={"prepared.owl.carousel":a.proxy(function(b){b.namespace&&this._core.settings.dotsData&&this._templates.push('
'+a(b.content).find("[data-dot]").andSelf("[data-dot]").attr("data-dot")+"
")},this),"added.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.dotsData&&this._templates.splice(a.position,0,this._templates.pop())},this),"remove.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.dotsData&&this._templates.splice(a.position,1)},this),"changed.owl.carousel":a.proxy(function(a){a.namespace&&"position"==a.property.name&&this.draw()},this),"initialized.owl.carousel":a.proxy(function(a){a.namespace&&!this._initialized&&(this._core.trigger("initialize",null,"navigation"),this.initialize(),this.update(),this.draw(),this._initialized=!0,this._core.trigger("initialized",null,"navigation"))},this),"refreshed.owl.carousel":a.proxy(function(a){a.namespace&&this._initialized&&(this._core.trigger("refresh",null,"navigation"),this.update(),this.draw(),this._core.trigger("refreshed",null,"navigation"))},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this.$element.on(this._handlers)};e.Defaults={nav:!1,navText:["prev","next"],navSpeed:!1,navElement:"div",navContainer:!1,navContainerClass:"owl-nav",navClass:["owl-prev","owl-next"],slideBy:1,dotClass:"owl-dot",dotsClass:"owl-dots",dots:!0,dotsEach:!1,dotsData:!1,dotsSpeed:!1,dotsContainer:!1},e.prototype.initialize=function(){var b,c=this._core.settings;this._controls.$relative=(c.navContainer?a(c.navContainer):a("
").addClass(c.navContainerClass).appendTo(this.$element)).addClass("disabled"),this._controls.$previous=a("<"+c.navElement+">").addClass(c.navClass[0]).html(c.navText[0]).prependTo(this._controls.$relative).on("click",a.proxy(function(a){this.prev(c.navSpeed)},this)),this._controls.$next=a("<"+c.navElement+">").addClass(c.navClass[1]).html(c.navText[1]).appendTo(this._controls.$relative).on("click",a.proxy(function(a){this.next(c.navSpeed)},this)),c.dotsData||(this._templates=[a("
").addClass(c.dotClass).append(a("")).prop("outerHTML")]),this._controls.$absolute=(c.dotsContainer?a(c.dotsContainer):a("
").addClass(c.dotsClass).appendTo(this.$element)).addClass("disabled"),this._controls.$absolute.on("click","div",a.proxy(function(b){var d=a(b.target).parent().is(this._controls.$absolute)?a(b.target).index():a(b.target).parent().index();b.preventDefault(),this.to(d,c.dotsSpeed)},this));for(b in this._overrides)this._core[b]=a.proxy(this[b],this)},e.prototype.destroy=function(){var a,b,c,d;for(a in this._handlers)this.$element.off(a,this._handlers[a]);for(b in this._controls)this._controls[b].remove();for(d in this.overides)this._core[d]=this._overrides[d];for(c in Object.getOwnPropertyNames(this))"function"!=typeof this[c]&&(this[c]=null)},e.prototype.update=function(){var a,b,c,d=this._core.clones().length/2,e=d+this._core.items().length,f=this._core.maximum(!0),g=this._core.settings,h=g.center||g.autoWidth||g.dotsData?1:g.dotsEach||g.items;if("page"!==g.slideBy&&(g.slideBy=Math.min(g.slideBy,g.items)),g.dots||"page"==g.slideBy)for(this._pages=[],a=d,b=0,c=0;e>a;a++){if(b>=h||0===b){if(this._pages.push({start:Math.min(f,a-d),end:a-d+h-1}),Math.min(f,a-d)===f)break;b=0,++c}b+=this._core.mergers(this._core.relative(a))}},e.prototype.draw=function(){var b,c=this._core.settings,d=this._core.items().length<=c.items,e=this._core.relative(this._core.current()),f=c.loop||c.rewind;this._controls.$relative.toggleClass("disabled",!c.nav||d),c.nav&&(this._controls.$previous.toggleClass("disabled",!f&&e<=this._core.minimum(!0)),this._controls.$next.toggleClass("disabled",!f&&e>=this._core.maximum(!0))),this._controls.$absolute.toggleClass("disabled",!c.dots||d),c.dots&&(b=this._pages.length-this._controls.$absolute.children().length,c.dotsData&&0!==b?this._controls.$absolute.html(this._templates.join("")):b>0?this._controls.$absolute.append(new Array(b+1).join(this._templates[0])):0>b&&this._controls.$absolute.children().slice(b).remove(),this._controls.$absolute.find(".active").removeClass("active"),this._controls.$absolute.children().eq(a.inArray(this.current(),this._pages)).addClass("active"))},e.prototype.onTrigger=function(b){var c=this._core.settings;b.page={index:a.inArray(this.current(),this._pages),count:this._pages.length,size:c&&(c.center||c.autoWidth||c.dotsData?1:c.dotsEach||c.items)}},e.prototype.current=function(){var b=this._core.relative(this._core.current());return a.grep(this._pages,a.proxy(function(a,c){return a.start<=b&&a.end>=b},this)).pop()},e.prototype.getPosition=function(b){var c,d,e=this._core.settings;return"page"==e.slideBy?(c=a.inArray(this.current(),this._pages),d=this._pages.length,b?++c:--c,c=this._pages[(c%d+d)%d].start):(c=this._core.relative(this._core.current()),d=this._core.items().length,b?c+=e.slideBy:c-=e.slideBy),c},e.prototype.next=function(b){a.proxy(this._overrides.to,this._core)(this.getPosition(!0),b)},e.prototype.prev=function(b){a.proxy(this._overrides.to,this._core)(this.getPosition(!1),b)},e.prototype.to=function(b,c,d){var e;d?a.proxy(this._overrides.to,this._core)(b,c):(e=this._pages.length,a.proxy(this._overrides.to,this._core)(this._pages[(b%e+e)%e].start,c))},a.fn.owlCarousel.Constructor.Plugins.Navigation=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){"use strict";var e=function(c){this._core=c,this._hashes={},this.$element=this._core.$element,this._handlers={"initialized.owl.carousel":a.proxy(function(c){c.namespace&&"URLHash"===this._core.settings.startPosition&&a(b).trigger("hashchange.owl.navigation")},this),"prepared.owl.carousel":a.proxy(function(b){if(b.namespace){var c=a(b.content).find("[data-hash]").andSelf("[data-hash]").attr("data-hash");if(!c)return;this._hashes[c]=b.content}},this),"changed.owl.carousel":a.proxy(function(c){if(c.namespace&&"position"===c.property.name){var d=this._core.items(this._core.relative(this._core.current())),e=a.map(this._hashes,function(a,b){return a===d?b:null}).join();if(!e||b.location.hash.slice(1)===e)return;b.location.hash=e}},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this.$element.on(this._handlers),a(b).on("hashchange.owl.navigation",a.proxy(function(a){var c=b.location.hash.substring(1),e=this._core.$stage.children(),f=this._hashes[c]&&e.index(this._hashes[c]);f!==d&&f!==this._core.current()&&this._core.to(this._core.relative(f),!1,!0)},this))};e.Defaults={URLhashListener:!1},e.prototype.destroy=function(){var c,d;a(b).off("hashchange.owl.navigation");for(c in this._handlers)this._core.$element.off(c,this._handlers[c]);for(d in Object.getOwnPropertyNames(this))"function"!=typeof this[d]&&(this[d]=null)},a.fn.owlCarousel.Constructor.Plugins.Hash=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){function e(b,c){var e=!1,f=b.charAt(0).toUpperCase()+b.slice(1);return a.each((b+" "+h.join(f+" ")+f).split(" "),function(a,b){return g[b]!==d?(e=c?b:!0,!1):void 0}),e}function f(a){return e(a,!0)}var g=a("").get(0).style,h="Webkit Moz O ms".split(" "),i={transition:{end:{WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd",transition:"transitionend"}},animation:{end:{WebkitAnimation:"webkitAnimationEnd",MozAnimation:"animationend",OAnimation:"oAnimationEnd",animation:"animationend"}}},j={csstransforms:function(){return!!e("transform")},csstransforms3d:function(){return!!e("perspective")},csstransitions:function(){return!!e("transition")},cssanimations:function(){return!!e("animation")}};j.csstransitions()&&(a.support.transition=new String(f("transition")),a.support.transition.end=i.transition.end[a.support.transition]),j.cssanimations()&&(a.support.animation=new String(f("animation")),a.support.animation.end=i.animation.end[a.support.animation]),j.csstransforms()&&(a.support.transform=new String(f("transform")),a.support.transform3d=j.csstransforms3d())}(window.Zepto||window.jQuery,window,document); !function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):window.jQuery||window.Zepto)}(function(a){var b,c,d,e,f,g,h="Close",i="BeforeClose",j="AfterClose",k="BeforeAppend",l="MarkupParse",m="Open",n="Change",o="mfp",p="."+o,q="mfp-ready",r="mfp-removing",s="mfp-prevent-close",t=function(){},u=!!window.jQuery,v=a(window),w=function(a,c){b.ev.on(o+a+p,c)},x=function(b,c,d,e){var f=document.createElement("div");return f.className="mfp-"+b,d&&(f.innerHTML=d),e?c&&c.appendChild(f):(f=a(f),c&&f.appendTo(c)),f},y=function(c,d){b.ev.triggerHandler(o+c,d),b.st.callbacks&&(c=c.charAt(0).toLowerCase()+c.slice(1),b.st.callbacks[c]&&b.st.callbacks[c].apply(b,a.isArray(d)?d:[d]))},z=function(c){return c===g&&b.currTemplate.closeBtn||(b.currTemplate.closeBtn=a(b.st.closeMarkup.replace("%title%",b.st.tClose)),g=c),b.currTemplate.closeBtn},A=function(){a.magnificPopup.instance||(b=new t,b.init(),a.magnificPopup.instance=b)},B=function(){var a=document.createElement("p").style,b=["ms","O","Moz","Webkit"];if(void 0!==a.transition)return!0;for(;b.length;)if(b.pop()+"Transition"in a)return!0;return!1};t.prototype={constructor:t,init:function(){var c=navigator.appVersion;b.isIE7=-1!==c.indexOf("MSIE 7."),b.isIE8=-1!==c.indexOf("MSIE 8."),b.isLowIE=b.isIE7||b.isIE8,b.isAndroid=/android/gi.test(c),b.isIOS=/iphone|ipad|ipod/gi.test(c),b.supportsTransition=B(),b.probablyMobile=b.isAndroid||b.isIOS||/(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent),d=a(document),b.popupsCache={}},open:function(c){var e;if(c.isObj===!1){b.items=c.items.toArray(),b.index=0;var g,h=c.items;for(e=0;e(a||v.height())},_setFocus:function(){(b.st.focus?b.content.find(b.st.focus).eq(0):b.wrap).focus()},_onFocusIn:function(c){return c.target===b.wrap[0]||a.contains(b.wrap[0],c.target)?void 0:(b._setFocus(),!1)},_parseMarkup:function(b,c,d){var e;d.data&&(c=a.extend(d.data,c)),y(l,[b,c,d]),a.each(c,function(a,c){if(void 0===c||c===!1)return!0;if(e=a.split("_"),e.length>1){var d=b.find(p+"-"+e[0]);if(d.length>0){var f=e[1];"replaceWith"===f?d[0]!==c[0]&&d.replaceWith(c):"img"===f?d.is("img")?d.attr("src",c):d.replaceWith(''):d.attr(e[1],c)}}else b.find(p+"-"+a).html(c)})},_getScrollbarSize:function(){if(void 0===b.scrollbarSize){var a=document.createElement("div");a.style.cssText="width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;",document.body.appendChild(a),b.scrollbarSize=a.offsetWidth-a.clientWidth,document.body.removeChild(a)}return b.scrollbarSize}},a.magnificPopup={instance:null,proto:t.prototype,modules:[],open:function(b,c){return A(),b=b?a.extend(!0,{},b):{},b.isObj=!0,b.index=c||0,this.instance.open(b)},close:function(){return a.magnificPopup.instance&&a.magnificPopup.instance.close()},registerModule:function(b,c){c.options&&(a.magnificPopup.defaults[b]=c.options),a.extend(this.proto,c.proto),this.modules.push(b)},defaults:{disableOn:0,key:null,midClick:!1,mainClass:"",preloader:!0,focus:"",closeOnContentClick:!1,closeOnBgClick:!0,closeBtnInside:!0,showCloseBtn:!0,enableEscapeKey:!0,modal:!1,alignTop:!1,removalDelay:0,prependTo:null,fixedContentPos:"auto",fixedBgPos:"auto",overflowY:"auto",closeMarkup:'',tClose:"Close (Esc)",tLoading:"Loading..."}},a.fn.magnificPopup=function(c){A();var d=a(this);if("string"==typeof c)if("open"===c){var e,f=u?d.data("magnificPopup"):d[0].magnificPopup,g=parseInt(arguments[1],10)||0;f.items?e=f.items[g]:(e=d,f.delegate&&(e=e.find(f.delegate)),e=e.eq(g)),b._openClick({mfpEl:e},d,f)}else b.isOpen&&b[c].apply(b,Array.prototype.slice.call(arguments,1));else c=a.extend(!0,{},c),u?d.data("magnificPopup",c):d[0].magnificPopup=c,b.addGroup(d,c);return d};var C,D,E,F="inline",G=function(){E&&(D.after(E.addClass(C)).detach(),E=null)};a.magnificPopup.registerModule(F,{options:{hiddenClass:"hide",markup:"",tNotFound:"Content not found"},proto:{initInline:function(){b.types.push(F),w(h+"."+F,function(){G()})},getInline:function(c,d){if(G(),c.src){var e=b.st.inline,f=a(c.src);if(f.length){var g=f[0].parentNode;g&&g.tagName&&(D||(C=e.hiddenClass,D=x(C),C="mfp-"+C),E=f.after(D).detach().removeClass(C)),b.updateStatus("ready")}else b.updateStatus("error",e.tNotFound),f=a("
");return c.inlineElement=f,f}return b.updateStatus("ready"),b._parseMarkup(d,{},c),d}}});var H,I="ajax",J=function(){H&&a(document.body).removeClass(H)},K=function(){J(),b.req&&b.req.abort()};a.magnificPopup.registerModule(I,{options:{settings:null,cursor:"mfp-ajax-cur",tError:'The content could not be loaded.'},proto:{initAjax:function(){b.types.push(I),H=b.st.ajax.cursor,w(h+"."+I,K),w("BeforeChange."+I,K)},getAjax:function(c){H&&a(document.body).addClass(H),b.updateStatus("loading");var d=a.extend({url:c.src,success:function(d,e,f){var g={data:d,xhr:f};y("ParseAjax",g),b.appendContent(a(g.data),I),c.finished=!0,J(),b._setFocus(),setTimeout(function(){b.wrap.addClass(q)},16),b.updateStatus("ready"),y("AjaxContentAdded")},error:function(){J(),c.finished=c.loadError=!0,b.updateStatus("error",b.st.ajax.tError.replace("%url%",c.src))}},b.st.ajax.settings);return b.req=a.ajax(d),""}}});var L,M=function(c){if(c.data&&void 0!==c.data.title)return c.data.title;var d=b.st.image.titleSrc;if(d){if(a.isFunction(d))return d.call(b,c);if(c.el)return c.el.attr(d)||""}return""};a.magnificPopup.registerModule("image",{options:{markup:'
',cursor:"mfp-zoom-out-cur",titleSrc:"title",verticalFit:!0,tError:'The image could not be loaded.'},proto:{initImage:function(){var c=b.st.image,d=".image";b.types.push("image"),w(m+d,function(){"image"===b.currItem.type&&c.cursor&&a(document.body).addClass(c.cursor)}),w(h+d,function(){c.cursor&&a(document.body).removeClass(c.cursor),v.off("resize"+p)}),w("Resize"+d,b.resizeImage),b.isLowIE&&w("AfterChange",b.resizeImage)},resizeImage:function(){var a=b.currItem;if(a&&a.img&&b.st.image.verticalFit){var c=0;b.isLowIE&&(c=parseInt(a.img.css("padding-top"),10)+parseInt(a.img.css("padding-bottom"),10)),a.img.css("max-height",b.wH-c)}},_onImageHasSize:function(a){a.img&&(a.hasSize=!0,L&&clearInterval(L),a.isCheckingImgSize=!1,y("ImageHasSize",a),a.imgHidden&&(b.content&&b.content.removeClass("mfp-loading"),a.imgHidden=!1))},findImageSize:function(a){var c=0,d=a.img[0],e=function(f){L&&clearInterval(L),L=setInterval(function(){return d.naturalWidth>0?void b._onImageHasSize(a):(c>200&&clearInterval(L),c++,void(3===c?e(10):40===c?e(50):100===c&&e(500)))},f)};e(1)},getImage:function(c,d){var e=0,f=function(){c&&(c.img[0].complete?(c.img.off(".mfploader"),c===b.currItem&&(b._onImageHasSize(c),b.updateStatus("ready")),c.hasSize=!0,c.loaded=!0,y("ImageLoadComplete")):(e++,200>e?setTimeout(f,100):g()))},g=function(){c&&(c.img.off(".mfploader"),c===b.currItem&&(b._onImageHasSize(c),b.updateStatus("error",h.tError.replace("%url%",c.src))),c.hasSize=!0,c.loaded=!0,c.loadError=!0)},h=b.st.image,i=d.find(".mfp-img");if(i.length){var j=document.createElement("img");j.className="mfp-img",c.el&&c.el.find("img").length&&(j.alt=c.el.find("img").attr("alt")),c.img=a(j).on("load.mfploader",f).on("error.mfploader",g),j.src=c.src,i.is("img")&&(c.img=c.img.clone()),j=c.img[0],j.naturalWidth>0?c.hasSize=!0:j.width||(c.hasSize=!1)}return b._parseMarkup(d,{title:M(c),img_replaceWith:c.img},c),b.resizeImage(),c.hasSize?(L&&clearInterval(L),c.loadError?(d.addClass("mfp-loading"),b.updateStatus("error",h.tError.replace("%url%",c.src))):(d.removeClass("mfp-loading"),b.updateStatus("ready")),d):(b.updateStatus("loading"),c.loading=!0,c.hasSize||(c.imgHidden=!0,d.addClass("mfp-loading"),b.findImageSize(c)),d)}}});var N,O=function(){return void 0===N&&(N=void 0!==document.createElement("p").style.MozTransform),N};a.magnificPopup.registerModule("zoom",{options:{enabled:!1,easing:"ease-in-out",duration:300,opener:function(a){return a.is("img")?a:a.find("img")}},proto:{initZoom:function(){var a,c=b.st.zoom,d=".zoom";if(c.enabled&&b.supportsTransition){var e,f,g=c.duration,j=function(a){var b=a.clone().removeAttr("style").removeAttr("class").addClass("mfp-animated-image"),d="all "+c.duration/1e3+"s "+c.easing,e={position:"fixed",zIndex:9999,left:0,top:0,"-webkit-backface-visibility":"hidden"},f="transition";return e["-webkit-"+f]=e["-moz-"+f]=e["-o-"+f]=e[f]=d,b.css(e),b},k=function(){b.content.css("visibility","visible")};w("BuildControls"+d,function(){if(b._allowZoom()){if(clearTimeout(e),b.content.css("visibility","hidden"),a=b._getItemToZoom(),!a)return void k();f=j(a),f.css(b._getOffset()),b.wrap.append(f),e=setTimeout(function(){f.css(b._getOffset(!0)),e=setTimeout(function(){k(),setTimeout(function(){f.remove(),a=f=null,y("ZoomAnimationEnded")},16)},g)},16)}}),w(i+d,function(){if(b._allowZoom()){if(clearTimeout(e),b.st.removalDelay=g,!a){if(a=b._getItemToZoom(),!a)return;f=j(a)}f.css(b._getOffset(!0)),b.wrap.append(f),b.content.css("visibility","hidden"),setTimeout(function(){f.css(b._getOffset())},16)}}),w(h+d,function(){b._allowZoom()&&(k(),f&&f.remove(),a=null)})}},_allowZoom:function(){return"image"===b.currItem.type},_getItemToZoom:function(){return b.currItem.hasSize?b.currItem.img:!1},_getOffset:function(c){var d;d=c?b.currItem.img:b.st.zoom.opener(b.currItem.el||b.currItem);var e=d.offset(),f=parseInt(d.css("padding-top"),10),g=parseInt(d.css("padding-bottom"),10);e.top-=a(window).scrollTop()-f;var h={width:d.width(),height:(u?d.innerHeight():d[0].offsetHeight)-g-f};return O()?h["-moz-transform"]=h.transform="translate("+e.left+"px,"+e.top+"px)":(h.left=e.left,h.top=e.top),h}}});var P="iframe",Q="//about:blank",R=function(a){if(b.currTemplate[P]){var c=b.currTemplate[P].find("iframe");c.length&&(a||(c[0].src=Q),b.isIE8&&c.css("display",a?"block":"none"))}};a.magnificPopup.registerModule(P,{options:{markup:'
',srcAction:"iframe_src",patterns:{youtube:{index:"youtube.com",id:"v=",src:"//www.youtube.com/embed/%id%?autoplay=1"},vimeo:{index:"vimeo.com/",id:"/",src:"//player.vimeo.com/video/%id%?autoplay=1"},gmaps:{index:"//maps.google.",src:"%id%&output=embed"}}},proto:{initIframe:function(){b.types.push(P),w("BeforeChange",function(a,b,c){b!==c&&(b===P?R():c===P&&R(!0))}),w(h+"."+P,function(){R()})},getIframe:function(c,d){var e=c.src,f=b.st.iframe;a.each(f.patterns,function(){return e.indexOf(this.index)>-1?(this.id&&(e="string"==typeof this.id?e.substr(e.lastIndexOf(this.id)+this.id.length,e.length):this.id.call(this,e)),e=this.src.replace("%id%",e),!1):void 0});var g={};return f.srcAction&&(g[f.srcAction]=e),b._parseMarkup(d,g,c),b.updateStatus("ready"),d}}});var S=function(a){var c=b.items.length;return a>c-1?a-c:0>a?c+a:a},T=function(a,b,c){return a.replace(/%curr%/gi,b+1).replace(/%total%/gi,c)};a.magnificPopup.registerModule("gallery",{options:{enabled:!1,arrowMarkup:'',preload:[0,2],navigateByImgClick:!0,arrows:!0,tPrev:"Previous (Left arrow key)",tNext:"Next (Right arrow key)",tCounter:"%curr% of %total%"},proto:{initGallery:function(){var c=b.st.gallery,e=".mfp-gallery",g=Boolean(a.fn.mfpFastClick);return b.direction=!0,c&&c.enabled?(f+=" mfp-gallery",w(m+e,function(){c.navigateByImgClick&&b.wrap.on("click"+e,".mfp-img",function(){return b.items.length>1?(b.next(),!1):void 0}),d.on("keydown"+e,function(a){37===a.keyCode?b.prev():39===a.keyCode&&b.next()})}),w("UpdateStatus"+e,function(a,c){c.text&&(c.text=T(c.text,b.currItem.index,b.items.length))}),w(l+e,function(a,d,e,f){var g=b.items.length;e.counter=g>1?T(c.tCounter,f.index,g):""}),w("BuildControls"+e,function(){if(b.items.length>1&&c.arrows&&!b.arrowLeft){var d=c.arrowMarkup,e=b.arrowLeft=a(d.replace(/%title%/gi,c.tPrev).replace(/%dir%/gi,"left")).addClass(s),f=b.arrowRight=a(d.replace(/%title%/gi,c.tNext).replace(/%dir%/gi,"right")).addClass(s),h=g?"mfpFastClick":"click";e[h](function(){b.prev()}),f[h](function(){b.next()}),b.isIE7&&(x("b",e[0],!1,!0),x("a",e[0],!1,!0),x("b",f[0],!1,!0),x("a",f[0],!1,!0)),b.container.append(e.add(f))}}),w(n+e,function(){b._preloadTimeout&&clearTimeout(b._preloadTimeout),b._preloadTimeout=setTimeout(function(){b.preloadNearbyImages(),b._preloadTimeout=null},16)}),void w(h+e,function(){d.off(e),b.wrap.off("click"+e),b.arrowLeft&&g&&b.arrowLeft.add(b.arrowRight).destroyMfpFastClick(),b.arrowRight=b.arrowLeft=null})):!1},next:function(){b.direction=!0,b.index=S(b.index+1),b.updateItemHTML()},prev:function(){b.direction=!1,b.index=S(b.index-1),b.updateItemHTML()},goTo:function(a){b.direction=a>=b.index,b.index=a,b.updateItemHTML()},preloadNearbyImages:function(){var a,c=b.st.gallery.preload,d=Math.min(c[0],b.items.length),e=Math.min(c[1],b.items.length);for(a=1;a<=(b.direction?e:d);a++)b._preloadItem(b.index+a);for(a=1;a<=(b.direction?d:e);a++)b._preloadItem(b.index-a)},_preloadItem:function(c){if(c=S(c),!b.items[c].preloaded){var d=b.items[c];d.parsed||(d=b.parseEl(c)),y("LazyLoad",d),"image"===d.type&&(d.img=a('').on("load.mfploader",function(){d.hasSize=!0}).on("error.mfploader",function(){d.hasSize=!0,d.loadError=!0,y("LazyLoadError",d)}).attr("src",d.src)),d.preloaded=!0}}}});var U="retina";a.magnificPopup.registerModule(U,{options:{replaceSrc:function(a){return a.src.replace(/\.\w+$/,function(a){return"@2x"+a})},ratio:1},proto:{initRetina:function(){if(window.devicePixelRatio>1){var a=b.st.retina,c=a.ratio;c=isNaN(c)?c():c,c>1&&(w("ImageHasSize."+U,function(a,b){b.img.css({"max-width":b.img[0].naturalWidth/c,width:"100%"})}),w("ElementParse."+U,function(b,d){d.src=a.replaceSrc(d,c)}))}}}}),function(){var b=1e3,c="ontouchstart"in window,d=function(){v.off("touchmove"+f+" touchend"+f)},e="mfpFastClick",f="."+e;a.fn.mfpFastClick=function(e){return a(this).each(function(){var g,h=a(this);if(c){var i,j,k,l,m,n;h.on("touchstart"+f,function(a){l=!1,n=1,m=a.originalEvent?a.originalEvent.touches[0]:a.touches[0],j=m.clientX,k=m.clientY,v.on("touchmove"+f,function(a){m=a.originalEvent?a.originalEvent.touches:a.touches,n=m.length,m=m[0],(Math.abs(m.clientX-j)>10||Math.abs(m.clientY-k)>10)&&(l=!0,d())}).on("touchend"+f,function(a){d(),l||n>1||(g=!0,a.preventDefault(),clearTimeout(i),i=setTimeout(function(){g=!1},b),e())})})}h.on("click"+f,function(){g||e()})})},a.fn.destroyMfpFastClick=function(){a(this).off("touchstart"+f+" click"+f),c&&v.off("touchmove"+f+" touchend"+f)}}(),A()}); // Firefox 18 breaks Mootools 1.2. This line below fixes it. // Without this fix, trying to grab an element via a CSS selector like $('.qty') will incorrectly match on an element with a class like "qtyBlah" where it String.prototype.contains = undefined; var MooTools={version:"1.2.5",build:"008d8f0f2fcc2044e54fdd3635341aaab274e757"};var Native=function(l){l=l||{};var a=l.name;var j=l.legacy;var b=l.protect;var c=l.implement;var i=l.generics;var g=l.initialize;var h=l.afterImplement||function(){};var d=g||j;i=i!==false;d.constructor=Native;d.$family={name:"native"};if(j&&g){d.prototype=j.prototype;}d.prototype.constructor=d;if(a){var f=a.toLowerCase();d.prototype.$family={name:f};Native.typize(d,f);}var k=function(o,m,p,n){if(!b||n||!o.prototype[m]){o.prototype[m]=p;}if(i){Native.genericize(o,m,b);}h.call(o,m,p);return o;};d.alias=function(o,m,q){if(typeof o=="string"){var p=this.prototype[o];if((o=p)){return k(this,m,o,q);}}for(var n in o){this.alias(n,o[n],m);}return this;};d.implement=function(n,m,q){if(typeof n=="string"){return k(this,n,m,q);}for(var o in n){k(this,o,n[o],m);}return this;};if(c){d.implement(c);}return d;};Native.genericize=function(b,c,a){if((!a||!b[c])&&typeof b.prototype[c]=="function"){b[c]=function(){var d=Array.prototype.slice.call(arguments);return b.prototype[c].apply(d.shift(),d);};}};Native.implement=function(d,c){for(var b=0,a=d.length;b-1:this.indexOf(a)>-1;},trim:function(){return this.replace(/^\s+|\s+$/g,"");},clean:function(){return this.replace(/\s+/g," ").trim();},camelCase:function(){return this.replace(/-\D/g,function(a){return a.charAt(1).toUpperCase();});},hyphenate:function(){return this.replace(/[A-Z]/g,function(a){return("-"+a.charAt(0).toLowerCase());});},capitalize:function(){return this.replace(/\b[a-z]/g,function(a){return a.toUpperCase();});},escapeRegExp:function(){return this.replace(/([-.*+?^${}()|[\]\/\\])/g,"\\$1");},toInt:function(a){return parseInt(this,a||10);},toFloat:function(){return parseFloat(this);},hexToRgb:function(b){var a=this.match(/^#?(\w{1,2})(\w{1,2})(\w{1,2})$/);return(a)?a.slice(1).hexToRgb(b):null;},rgbToHex:function(b){var a=this.match(/\d{1,3}/g);return(a)?a.rgbToHex(b):null;},stripScripts:function(b){var a="";var c=this.replace(/]*>([\s\S]*?)<\/script>/gi,function(){a+=arguments[1]+"\n";return"";});if(b===true){$exec(a);}else{if($type(b)=="function"){b(a,c);}}return c;},substitute:function(a,b){return this.replace(b||(/\\?\{([^{}]+)\}/g),function(d,c){if(d.charAt(0)=="\\"){return d.slice(1);}return(a[c]!=undefined)?a[c]:"";});}});try{delete Function.prototype.bind;}catch(e){}Function.implement({extend:function(a){for(var b in a){this[b]=a[b];}return this;},create:function(b){var a=this;b=b||{};return function(d){var c=b.arguments;c=(c!=undefined)?$splat(c):Array.slice(arguments,(b.event)?1:0);if(b.event){c=[d||window.event].extend(c);}var f=function(){return a.apply(b.bind||null,c);};if(b.delay){return setTimeout(f,b.delay);}if(b.periodical){return setInterval(f,b.periodical);}if(b.attempt){return $try(f);}return f();};},run:function(a,b){return this.apply(b,$splat(a));},pass:function(a,b){return this.create({bind:b,arguments:a});},bind:function(b,a){return this.create({bind:b,arguments:a});},bindWithEvent:function(b,a){return this.create({bind:b,arguments:a,event:true});},attempt:function(a,b){return this.create({bind:b,arguments:a,attempt:true})();},delay:function(b,c,a){return this.create({bind:c,arguments:a,delay:b})();},periodical:function(c,b,a){return this.create({bind:b,arguments:a,periodical:c})();}});Number.implement({limit:function(b,a){return Math.min(a,Math.max(b,this));},round:function(a){a=Math.pow(10,a||0);return Math.round(this*a)/a;},times:function(b,c){for(var a=0;a");d=(a.name=="x");}catch(b){}var c=function(f){return(""+f).replace(/&/g,"&").replace(/"/g,""");};Document.implement({newElement:function(f,g){if(g&&g.checked!=null){g.defaultChecked=g.checked;}if(d&&g){f="<"+f;if(g.name){f+=' name="'+c(g.name)+'"';}if(g.type){f+=' type="'+c(g.type)+'"';}f+=">";delete g.name;delete g.type;}return this.id(this.createElement(f)).set(g);},newTextNode:function(f){return this.createTextNode(f);},getDocument:function(){return this;},getWindow:function(){return this.window;},id:(function(){var f={string:function(i,h,g){i=g.getElementById(i);return(i)?f.element(i,h):null;},element:function(g,j){$uid(g);if(!j&&!g.$family&&!(/^object|embed$/i).test(g.tagName)){var h=Element.Prototype;for(var i in h){g[i]=h[i];}}return g;},object:function(h,i,g){if(h.toElement){return f.element(h.toElement(g),i);}return null;}};f.textnode=f.whitespace=f.window=f.document=$arguments(0);return function(h,j,i){if(h&&h.$family&&h.uid){return h;}var g=$type(h);return(f[g])?f[g](h,j,i||document):null;};})()});})();if(window.$==null){Window.implement({$:function(a,b){return document.id(a,b,this.document);}});}Window.implement({$$:function(a){if(arguments.length==1&&typeof a=="string"){return this.document.getElements(a);}var g=[];var c=Array.flatten(arguments);for(var d=0,b=c.length;d1);a.each(function(f){var g=this.getElementsByTagName(f.trim());(b)?c.extend(g):c=g;},this);return new Elements(c,{ddup:b,cash:!d});}});(function(){var i={},g={};var j={input:"checked",option:"selected",textarea:(Browser.Engine.webkit&&Browser.Engine.version<420)?"innerHTML":"value"};var c=function(m){return(g[m]||(g[m]={}));};var h=function(o,m){if(!o){return;}var n=o.uid;if(m!==true){m=false;}if(Browser.Engine.trident){if(o.clearAttributes){var r=m&&o.cloneNode(false);o.clearAttributes();if(r){o.mergeAttributes(r);}}else{if(o.removeEvents){o.removeEvents();}}if((/object/i).test(o.tagName)){for(var q in o){if(typeof o[q]=="function"){o[q]=$empty;}}Element.dispose(o);}}if(!n){return;}i[n]=g[n]=null;};var d=function(){Hash.each(i,h);if(Browser.Engine.trident){$A(document.getElementsByTagName("object")).each(h);}if(window.CollectGarbage){CollectGarbage();}i=g=null;};var k=function(o,m,t,n,q,s){var p=o[t||m];var r=[];while(p){if(p.nodeType==1&&(!n||Element.match(p,n))){if(!q){return document.id(p,s);}r.push(p);}p=p[m];}return(q)?new Elements(r,{ddup:false,cash:!s}):null;};var f={html:"innerHTML","class":"className","for":"htmlFor",defaultValue:"defaultValue",text:(Browser.Engine.trident||(Browser.Engine.webkit&&Browser.Engine.version<420))?"innerText":"textContent"};var b=["compact","nowrap","ismap","declare","noshade","checked","disabled","readonly","multiple","selected","noresize","defer"];var l=["value","type","defaultValue","accessKey","cellPadding","cellSpacing","colSpan","frameBorder","maxLength","readOnly","rowSpan","tabIndex","useMap"];b=b.associate(b);Hash.extend(f,b);Hash.extend(f,l.associate(l.map(String.toLowerCase)));var a={before:function(n,m){if(m.parentNode){m.parentNode.insertBefore(n,m);}},after:function(n,m){if(!m.parentNode){return;}var o=m.nextSibling;(o)?m.parentNode.insertBefore(n,o):m.parentNode.appendChild(n);},bottom:function(n,m){m.appendChild(n);},top:function(n,m){var o=m.firstChild;(o)?m.insertBefore(n,o):m.appendChild(n);}};a.inside=a.bottom;Hash.each(a,function(m,n){n=n.capitalize();Element.implement("inject"+n,function(o){m(this,document.id(o,true));return this;});Element.implement("grab"+n,function(o){m(document.id(o,true),this);return this;});});Element.implement({set:function(q,n){switch($type(q)){case"object":for(var o in q){this.set(o,q[o]);}break;case"string":var m=Element.Properties.get(q);(m&&m.set)?m.set.apply(this,Array.slice(arguments,1)):this.setProperty(q,n);}return this;},get:function(n){var m=Element.Properties.get(n);return(m&&m.get)?m.get.apply(this,Array.slice(arguments,1)):this.getProperty(n);},erase:function(n){var m=Element.Properties.get(n);(m&&m.erase)?m.erase.apply(this):this.removeProperty(n);return this;},setProperty:function(n,o){var m=f[n];if(o==undefined){return this.removeProperty(n);}if(m&&b[n]){o=!!o;}(m)?this[m]=o:this.setAttribute(n,""+o);return this;},setProperties:function(m){for(var n in m){this.setProperty(n,m[n]);}return this;},getProperty:function(n){var m=f[n];var o=(m)?this[m]:this.getAttribute(n,2);return(b[n])?!!o:(m)?o:o||null;},getProperties:function(){var m=$A(arguments);return m.map(this.getProperty,this).associate(m);},removeProperty:function(n){var m=f[n];(m)?this[m]=(m&&b[n])?false:"":this.removeAttribute(n);return this;},removeProperties:function(){Array.each(arguments,this.removeProperty,this);return this;},hasClass:function(m){return this.className.contains(m," ");},addClass:function(m){if(!this.hasClass(m)){this.className=(this.className+" "+m).clean();}return this;},removeClass:function(m){this.className=this.className.replace(new RegExp("(^|\\s)"+m+"(?:\\s|$)"),"$1");return this;},toggleClass:function(m){return this.hasClass(m)?this.removeClass(m):this.addClass(m);},adopt:function(){Array.flatten(arguments).each(function(m){m=document.id(m,true);if(m){this.appendChild(m);}},this);return this;},appendText:function(n,m){return this.grab(this.getDocument().newTextNode(n),m);},grab:function(n,m){a[m||"bottom"](document.id(n,true),this);return this;},inject:function(n,m){a[m||"bottom"](this,document.id(n,true));return this;},replaces:function(m){m=document.id(m,true);m.parentNode.replaceChild(this,m);return this;},wraps:function(n,m){n=document.id(n,true);return this.replaces(n).grab(n,m);},getPrevious:function(m,n){return k(this,"previousSibling",null,m,false,n);},getAllPrevious:function(m,n){return k(this,"previousSibling",null,m,true,n);},getNext:function(m,n){return k(this,"nextSibling",null,m,false,n);},getAllNext:function(m,n){return k(this,"nextSibling",null,m,true,n);},getFirst:function(m,n){return k(this,"nextSibling","firstChild",m,false,n);},getLast:function(m,n){return k(this,"previousSibling","lastChild",m,false,n);},getParent:function(m,n){return k(this,"parentNode",null,m,false,n);},getParents:function(m,n){return k(this,"parentNode",null,m,true,n);},getSiblings:function(m,n){return this.getParent().getChildren(m,n).erase(this);},getChildren:function(m,n){return k(this,"nextSibling","firstChild",m,true,n);},getWindow:function(){return this.ownerDocument.window;},getDocument:function(){return this.ownerDocument;},getElementById:function(p,o){var n=this.ownerDocument.getElementById(p);if(!n){return null;}for(var m=n.parentNode;m!=this;m=m.parentNode){if(!m){return null;}}return document.id(n,o);},getSelected:function(){return new Elements($A(this.options).filter(function(m){return m.selected;}));},getComputedStyle:function(n){if(this.currentStyle){return this.currentStyle[n.camelCase()];}var m=this.getDocument().defaultView.getComputedStyle(this,null);return(m)?m.getPropertyValue([n.hyphenate()]):null;},toQueryString:function(){var m=[];this.getElements("input, select, textarea",true).each(function(n){if(!n.name||n.disabled||n.type=="submit"||n.type=="reset"||n.type=="file"){return;}var o=(n.tagName.toLowerCase()=="select")?Element.getSelected(n).map(function(p){return p.value;}):((n.type=="radio"||n.type=="checkbox")&&!n.checked)?null:n.value;$splat(o).each(function(p){if(typeof p!="undefined"){m.push(n.name+"="+encodeURIComponent(p));}});});return m.join("&");},clone:function(p,m){p=p!==false;var s=this.cloneNode(p);var o=function(w,v){if(!m){w.removeAttribute("id");}if(Browser.Engine.trident){w.clearAttributes();w.mergeAttributes(v);w.removeAttribute("uid");if(w.options){var x=w.options,t=v.options;for(var u=x.length;u--;){x[u].selected=t[u].selected;}}}var y=j[v.tagName.toLowerCase()];if(y&&v[y]){w[y]=v[y];}};if(p){var q=s.getElementsByTagName("*"),r=this.getElementsByTagName("*");for(var n=q.length;n--;){o(q[n],r[n]);}}o(s,this);return document.id(s);},destroy:function(){Element.empty(this);Element.dispose(this);h(this,true);return null;},empty:function(){$A(this.childNodes).each(function(m){Element.destroy(m);});return this;},dispose:function(){return(this.parentNode)?this.parentNode.removeChild(this):this;},hasChild:function(m){m=document.id(m,true);if(!m){return false;}if(Browser.Engine.webkit&&Browser.Engine.version<420){return $A(this.getElementsByTagName(m.tagName)).contains(m);}return(this.contains)?(this!=m&&this.contains(m)):!!(this.compareDocumentPosition(m)&16);},match:function(m){return(!m||(m==this)||(Element.get(this,"tag")==m));}});Native.implement([Element,Window,Document],{addListener:function(p,o){if(p=="unload"){var m=o,n=this;o=function(){n.removeListener("unload",o);m();};}else{i[this.uid]=this;}if(this.addEventListener){this.addEventListener(p,o,false);}else{this.attachEvent("on"+p,o);}return this;},removeListener:function(n,m){if(this.removeEventListener){this.removeEventListener(n,m,false);}else{this.detachEvent("on"+n,m);}return this;},retrieve:function(n,m){var p=c(this.uid),o=p[n];if(m!=undefined&&o==undefined){o=p[n]=m;}return $pick(o);},store:function(n,m){var o=c(this.uid);o[n]=m;return this;},eliminate:function(m){var n=c(this.uid);delete n[m];return this;}});window.addListener("unload",d);})();Element.Properties=new Hash;Element.Properties.style={set:function(a){this.style.cssText=a;},get:function(){return this.style.cssText;},erase:function(){this.style.cssText="";}};Element.Properties.tag={get:function(){return this.tagName.toLowerCase();}};Element.Properties.html=(function(){var c=document.createElement("div");var a={table:[1,"
","
"],select:[1,""],tbody:[2,"","
"],tr:[3,"","
"]};a.thead=a.tfoot=a.tbody;var b={set:function(){var f=Array.flatten(arguments).join("");var g=Browser.Engine.trident&&a[this.get("tag")];if(g){var h=c;h.innerHTML=g[1]+f+g[2];for(var d=g[0];d--;){h=h.firstChild;}this.empty().adopt(h.childNodes);}else{this.innerHTML=f;}}};b.erase=b.set;return b;})();if(Browser.Engine.webkit&&Browser.Engine.version<420){Element.Properties.text={get:function(){if(this.innerText){return this.innerText;}var a=this.ownerDocument.newElement("div",{html:this.innerHTML}).inject(this.ownerDocument.body);var b=a.innerText;a.destroy();return b;}};}(function(){Element.implement({scrollTo:function(i,j){if(b(this)){this.getWindow().scrollTo(i,j);}else{this.scrollLeft=i;this.scrollTop=j;}return this;},getSize:function(){if(b(this)){return this.getWindow().getSize();}return{x:this.offsetWidth,y:this.offsetHeight};},getScrollSize:function(){if(b(this)){return this.getWindow().getScrollSize();}return{x:this.scrollWidth,y:this.scrollHeight};},getScroll:function(){if(b(this)){return this.getWindow().getScroll();}return{x:this.scrollLeft,y:this.scrollTop};},getScrolls:function(){var j=this,i={x:0,y:0};while(j&&!b(j)){i.x+=j.scrollLeft;i.y+=j.scrollTop;j=j.parentNode;}return i;},getOffsetParent:function(){var i=this;if(b(i)){return null;}if(!Browser.Engine.trident){return i.offsetParent;}while((i=i.parentNode)&&!b(i)){if(d(i,"position")!="static"){return i;}}return null;},getOffsets:function(){if(this.getBoundingClientRect){var k=this.getBoundingClientRect(),n=document.id(this.getDocument().documentElement),q=n.getScroll(),l=this.getScrolls(),j=this.getScroll(),i=(d(this,"position")=="fixed");return{x:k.left.toInt()+l.x-j.x+((i)?0:q.x)-n.clientLeft,y:k.top.toInt()+l.y-j.y+((i)?0:q.y)-n.clientTop};}var m=this,o={x:0,y:0};if(b(this)){return o;}while(m&&!b(m)){o.x+=m.offsetLeft;o.y+=m.offsetTop;if(Browser.Engine.gecko){if(!g(m)){o.x+=c(m);o.y+=h(m);}var p=m.parentNode;if(p&&d(p,"overflow")!="visible"){o.x+=c(p);o.y+=h(p);}}else{if(m!=this&&Browser.Engine.webkit){o.x+=c(m);o.y+=h(m);}}m=m.offsetParent;}if(Browser.Engine.gecko&&!g(this)){o.x-=c(this);o.y-=h(this);}return o;},getPosition:function(l){if(b(this)){return{x:0,y:0};}var m=this.getOffsets(),j=this.getScrolls();var i={x:m.x-j.x,y:m.y-j.y};var k=(l&&(l=document.id(l)))?l.getPosition():{x:0,y:0};return{x:i.x-k.x,y:i.y-k.y};},getCoordinates:function(k){if(b(this)){return this.getWindow().getCoordinates();}var i=this.getPosition(k),j=this.getSize();var l={left:i.x,top:i.y,width:j.x,height:j.y};l.right=l.left+l.width;l.bottom=l.top+l.height;return l;},computePosition:function(i){return{left:i.x-f(this,"margin-left"),top:i.y-f(this,"margin-top")};},setPosition:function(i){return this.setStyles(this.computePosition(i));}});Native.implement([Document,Window],{getSize:function(){if(Browser.Engine.presto||Browser.Engine.webkit){var j=this.getWindow();return{x:j.innerWidth,y:j.innerHeight};}var i=a(this);return{x:i.clientWidth,y:i.clientHeight};},getScroll:function(){var j=this.getWindow(),i=a(this);return{x:j.pageXOffset||i.scrollLeft,y:j.pageYOffset||i.scrollTop};},getScrollSize:function(){var j=a(this),i=this.getSize();return{x:Math.max(j.scrollWidth,i.x),y:Math.max(j.scrollHeight,i.y)};},getPosition:function(){return{x:0,y:0};},getCoordinates:function(){var i=this.getSize();return{top:0,left:0,bottom:i.y,right:i.x,height:i.y,width:i.x};}});var d=Element.getComputedStyle;function f(i,j){return d(i,j).toInt()||0;}function g(i){return d(i,"-moz-box-sizing")=="border-box";}function h(i){return f(i,"border-top-width");}function c(i){return f(i,"border-left-width");}function b(i){return(/^(?:body|html)$/i).test(i.tagName);}function a(i){var j=i.getDocument();return(!j.compatMode||j.compatMode=="CSS1Compat")?j.html:j.body;}})();Element.alias("setPosition","position");Native.implement([Window,Document,Element],{getHeight:function(){return this.getSize().y;},getWidth:function(){return this.getSize().x;},getScrollTop:function(){return this.getScroll().y;},getScrollLeft:function(){return this.getScroll().x;},getScrollHeight:function(){return this.getScrollSize().y;},getScrollWidth:function(){return this.getScrollSize().x;},getTop:function(){return this.getPosition().y;},getLeft:function(){return this.getPosition().x;}});var Event=new Native({name:"Event",initialize:function(a,g){g=g||window;var l=g.document;a=a||g.event;if(a.$extended){return a;}this.$extended=true;var k=a.type;var h=a.target||a.srcElement;while(h&&h.nodeType==3){h=h.parentNode;}if(k.test(/key/)){var b=a.which||a.keyCode;var n=Event.Keys.keyOf(b);if(k=="keydown"){var d=b-111;if(d>0&&d<13){n="f"+d;}}n=n||String.fromCharCode(b).toLowerCase();}else{if(k.match(/(click|mouse|menu)/i)){l=(!l.compatMode||l.compatMode=="CSS1Compat")?l.html:l.body;var j={x:a.pageX||a.clientX+l.scrollLeft,y:a.pageY||a.clientY+l.scrollTop};var c={x:(a.pageX)?a.pageX-g.pageXOffset:a.clientX,y:(a.pageY)?a.pageY-g.pageYOffset:a.clientY};if(k.match(/DOMMouseScroll|mousewheel/)){var i=(a.wheelDelta)?a.wheelDelta/120:-(a.detail||0)/3;}var f=(a.which==3)||(a.button==2);var m=null;if(k.match(/over|out/)){switch(k){case"mouseover":m=a.relatedTarget||a.fromElement;break;case"mouseout":m=a.relatedTarget||a.toElement;}if(!(function(){while(m&&m.nodeType==3){m=m.parentNode;}return true;}).create({attempt:Browser.Engine.gecko})()){m=false;}}}}return $extend(this,{event:a,type:k,page:j,client:c,rightClick:f,wheel:i,relatedTarget:m,target:h,code:b,key:n,shift:a.shiftKey,control:a.ctrlKey,alt:a.altKey,meta:a.metaKey});}});Event.Keys=new Hash({enter:13,up:38,down:40,left:37,right:39,esc:27,space:32,backspace:8,tab:9,"delete":46});Event.implement({stop:function(){return this.stopPropagation().preventDefault();},stopPropagation:function(){if(this.event.stopPropagation){this.event.stopPropagation();}else{this.event.cancelBubble=true;}return this;},preventDefault:function(){if(this.event.preventDefault){this.event.preventDefault();}else{this.event.returnValue=false;}return this;}});Element.Properties.events={set:function(a){this.addEvents(a);}};Native.implement([Element,Window,Document],{addEvent:function(f,h){var i=this.retrieve("events",{});i[f]=i[f]||{keys:[],values:[]};if(i[f].keys.contains(h)){return this;}i[f].keys.push(h);var g=f,a=Element.Events.get(f),c=h,j=this;if(a){if(a.onAdd){a.onAdd.call(this,h);}if(a.condition){c=function(k){if(a.condition.call(this,k)){return h.call(this,k);}return true;};}g=a.base||g;}var d=function(){return h.call(j);};var b=Element.NativeEvents[g];if(b){if(b==2){d=function(k){k=new Event(k,j.getWindow());if(c.call(j,k)===false){k.stop();}};}this.addListener(g,d);}i[f].values.push(d);return this;},removeEvent:function(c,b){var a=this.retrieve("events");if(!a||!a[c]){return this;}var g=a[c].keys.indexOf(b);if(g==-1){return this;}a[c].keys.splice(g,1);var f=a[c].values.splice(g,1)[0];var d=Element.Events.get(c);if(d){if(d.onRemove){d.onRemove.call(this,b);}c=d.base||c;}return(Element.NativeEvents[c])?this.removeListener(c,f):this;},addEvents:function(a){for(var b in a){this.addEvent(b,a[b]);}return this;},removeEvents:function(a){var c;if($type(a)=="object"){for(c in a){this.removeEvent(c,a[c]);}return this;}var b=this.retrieve("events");if(!b){return this;}if(!a){for(c in b){this.removeEvents(c);}this.eliminate("events");}else{if(b[a]){while(b[a].keys[0]){this.removeEvent(a,b[a].keys[0]);}b[a]=null;}}return this;},fireEvent:function(d,b,a){var c=this.retrieve("events");if(!c||!c[d]){return this;}c[d].keys.each(function(f){f.create({bind:this,delay:a,"arguments":b})();},this);return this;},cloneEvents:function(d,a){d=document.id(d);var c=d.retrieve("events");if(!c){return this;}if(!a){for(var b in c){this.cloneEvents(d,b);}}else{if(c[a]){c[a].keys.each(function(f){this.addEvent(a,f);},this);}}return this;}});try{if(typeof HTMLElement!="undefined"){HTMLElement.prototype.fireEvent=Element.prototype.fireEvent;}}catch(e){}Element.NativeEvents={click:2,dblclick:2,mouseup:2,mousedown:2,contextmenu:2,mousewheel:2,DOMMouseScroll:2,mouseover:2,mouseout:2,mousemove:2,selectstart:2,selectend:2,keydown:2,keypress:2,keyup:2,focus:2,blur:2,change:2,reset:2,select:2,submit:2,load:1,unload:1,beforeunload:2,resize:1,move:1,DOMContentLoaded:1,readystatechange:1,error:1,abort:1,scroll:1};(function(){var a=function(b){var c=b.relatedTarget;if(c==undefined){return true;}if(c===false){return false;}return($type(this)!="document"&&c!=this&&c.prefix!="xul"&&!this.hasChild(c));};Element.Events=new Hash({mouseenter:{base:"mouseover",condition:a},mouseleave:{base:"mouseout",condition:a},mousewheel:{base:(Browser.Engine.gecko)?"DOMMouseScroll":"mousewheel"}});})();Element.Properties.styles={set:function(a){this.setStyles(a);}};Element.Properties.opacity={set:function(a,b){if(!b){if(a==0){if(this.style.visibility!="hidden"){this.style.visibility="hidden";}}else{if(this.style.visibility!="visible"){this.style.visibility="visible";}}}if(!this.currentStyle||!this.currentStyle.hasLayout){this.style.zoom=1;}if(Browser.Engine.trident){this.style.filter=(a==1)?"":"alpha(opacity="+a*100+")";}this.style.opacity=a;this.store("opacity",a);},get:function(){return this.retrieve("opacity",1);}};Element.implement({setOpacity:function(a){return this.set("opacity",a,true);},getOpacity:function(){return this.get("opacity");},setStyle:function(b,a){switch(b){case"opacity":return this.set("opacity",parseFloat(a));case"float":b=(Browser.Engine.trident)?"styleFloat":"cssFloat";}b=b.camelCase();if($type(a)!="string"){var c=(Element.Styles.get(b)||"@").split(" ");a=$splat(a).map(function(f,d){if(!c[d]){return"";}return($type(f)=="number")?c[d].replace("@",Math.round(f)):f;}).join(" ");}else{if(a==String(Number(a))){a=Math.round(a);}}this.style[b]=a;return this;},getStyle:function(h){switch(h){case"opacity":return this.get("opacity");case"float":h=(Browser.Engine.trident)?"styleFloat":"cssFloat";}h=h.camelCase();var a=this.style[h];if(!$chk(a)){a=[];for(var g in Element.ShortStyles){if(h!=g){continue;}for(var f in Element.ShortStyles[g]){a.push(this.getStyle(f));}return a.join(" ");}a=this.getComputedStyle(h);}if(a){a=String(a);var c=a.match(/rgba?\([\d\s,]+\)/);if(c){a=a.replace(c[0],c[0].rgbToHex());}}if(Browser.Engine.presto||(Browser.Engine.trident&&!$chk(parseInt(a,10)))){if(h.test(/^(height|width)$/)){var b=(h=="width")?["left","right"]:["top","bottom"],d=0;b.each(function(i){d+=this.getStyle("border-"+i+"-width").toInt()+this.getStyle("padding-"+i).toInt();},this);return this["offset"+h.capitalize()]-d+"px";}if((Browser.Engine.presto)&&String(a).test("px")){return a;}if(h.test(/(border(.+)Width|margin|padding)/)){return"0px";}}return a;},setStyles:function(b){for(var a in b){this.setStyle(a,b[a]);}return this;},getStyles:function(){var a={};Array.flatten(arguments).each(function(b){a[b]=this.getStyle(b);},this);return a;}});Element.Styles=new Hash({left:"@px",top:"@px",bottom:"@px",right:"@px",width:"@px",height:"@px",maxWidth:"@px",maxHeight:"@px",minWidth:"@px",minHeight:"@px",backgroundColor:"rgb(@, @, @)",backgroundPosition:"@px @px",color:"rgb(@, @, @)",fontSize:"@px",letterSpacing:"@px",lineHeight:"@px",clip:"rect(@px @px @px @px)",margin:"@px @px @px @px",padding:"@px @px @px @px",border:"@px @ rgb(@, @, @) @px @ rgb(@, @, @) @px @ rgb(@, @, @)",borderWidth:"@px @px @px @px",borderStyle:"@ @ @ @",borderColor:"rgb(@, @, @) rgb(@, @, @) rgb(@, @, @) rgb(@, @, @)",zIndex:"@",zoom:"@",fontWeight:"@",textIndent:"@px",opacity:"@"});Element.ShortStyles={margin:{},padding:{},border:{},borderWidth:{},borderStyle:{},borderColor:{}};["Top","Right","Bottom","Left"].each(function(h){var g=Element.ShortStyles;var b=Element.Styles;["margin","padding"].each(function(i){var j=i+h;g[i][j]=b[j]="@px";});var f="border"+h;g.border[f]=b[f]="@px @ rgb(@, @, @)";var d=f+"Width",a=f+"Style",c=f+"Color";g[f]={};g.borderWidth[d]=g[f][d]=b[d]="@px";g.borderStyle[a]=g[f][a]=b[a]="@";g.borderColor[c]=g[f][c]=b[c]="rgb(@, @, @)";});var Fx=new Class({Implements:[Chain,Events,Options],options:{fps:50,unit:false,duration:500,link:"ignore"},initialize:function(a){this.subject=this.subject||this;this.setOptions(a);this.options.duration=Fx.Durations[this.options.duration]||this.options.duration.toInt();var b=this.options.wait;if(b===false){this.options.link="cancel";}},getTransition:function(){return function(a){return -(Math.cos(Math.PI*a)-1)/2;};},step:function(){var a=$time();if(a=(7-4*d)/11){f=c*c-Math.pow((11-6*d-11*g)/4,2);break;}}return f;},Elastic:function(b,a){return Math.pow(2,10*--b)*Math.cos(20*b*Math.PI*(a[0]||1)/3);}});["Quad","Cubic","Quart","Quint"].each(function(b,a){Fx.Transitions[b]=new Fx.Transition(function(c){return Math.pow(c,[a+2]);});});Fx.Tween=new Class({Extends:Fx.CSS,initialize:function(b,a){this.element=this.subject=document.id(b);this.parent(a);},set:function(b,a){if(arguments.length==1){a=b;b=this.property||this.options.property;}this.render(this.element,b,a,this.options.unit);return this;},start:function(c,f,d){if(!this.check(c,f,d)){return this;}var b=Array.flatten(arguments);this.property=this.options.property||b.shift();var a=this.prepare(this.element,this.property,b);return this.parent(a.from,a.to);}});Element.Properties.tween={set:function(a){var b=this.retrieve("tween");if(b){b.cancel();}return this.eliminate("tween").store("tween:options",$extend({link:"cancel"},a));},get:function(a){if(a||!this.retrieve("tween")){if(a||!this.retrieve("tween:options")){this.set("tween",a);}this.store("tween",new Fx.Tween(this,this.retrieve("tween:options")));}return this.retrieve("tween");}};Element.implement({tween:function(a,c,b){this.get("tween").start(arguments);return this;},fade:function(c){var f=this.get("tween"),d="opacity",a;c=$pick(c,"toggle");switch(c){case"in":f.start(d,1);break;case"out":f.start(d,0);break;case"show":f.set(d,1);break;case"hide":f.set(d,0);break;case"toggle":var b=this.retrieve("fade:flag",this.get("opacity")==1);f.start(d,(b)?0:1);this.store("fade:flag",!b);a=true;break;default:f.start(d,arguments);}if(!a){this.eliminate("fade:flag");}return this;},highlight:function(c,a){if(!a){a=this.retrieve("highlight:original",this.getStyle("background-color"));a=(a=="transparent")?"#fff":a;}var b=this.get("tween");b.start("background-color",c||"#ffff88",a).chain(function(){this.setStyle("background-color",this.retrieve("highlight:original"));b.callChain();}.bind(this));return this;}});var Request=new Class({Implements:[Chain,Events,Options],options:{url:"",data:"",headers:{"X-Requested-With":"XMLHttpRequest",Accept:"text/javascript, text/html, application/xml, text/xml, */*"},async:true,format:false,method:"post",link:"ignore",isSuccess:null,emulation:true,urlEncoded:true,encoding:"utf-8",evalScripts:false,evalResponse:false,noCache:false},initialize:function(a){this.xhr=new Browser.Request();this.setOptions(a);this.options.isSuccess=this.options.isSuccess||this.isSuccess;this.headers=new Hash(this.options.headers);},onStateChange:function(){if(this.xhr.readyState!=4||!this.running){return;}this.running=false;this.status=0;$try(function(){this.status=this.xhr.status;}.bind(this));this.xhr.onreadystatechange=$empty;if(this.options.isSuccess.call(this,this.status)){this.response={text:this.xhr.responseText,xml:this.xhr.responseXML};this.success(this.response.text,this.response.xml);}else{this.response={text:null,xml:null};this.failure();}},isSuccess:function(){return((this.status>=200)&&(this.status<300));},processScripts:function(a){if(this.options.evalResponse||(/(ecma|java)script/).test(this.getHeader("Content-type"))){return $exec(a);}return a.stripScripts(this.options.evalScripts);},success:function(b,a){this.onSuccess(this.processScripts(b),a);},onSuccess:function(){this.fireEvent("complete",arguments).fireEvent("success",arguments).callChain();},failure:function(){this.onFailure();},onFailure:function(){this.fireEvent("complete").fireEvent("failure",this.xhr);},setHeader:function(a,b){this.headers.set(a,b);return this;},getHeader:function(a){return $try(function(){return this.xhr.getResponseHeader(a);}.bind(this));},check:function(){if(!this.running){return true;}switch(this.options.link){case"cancel":this.cancel();return true;case"chain":this.chain(this.caller.bind(this,arguments));return false;}return false;},send:function(l){if(!this.check(l)){return this;}this.running=true;var j=$type(l);if(j=="string"||j=="element"){l={data:l};}var d=this.options;l=$extend({data:d.data,url:d.url,method:d.method},l);var h=l.data,b=String(l.url),a=l.method.toLowerCase();switch($type(h)){case"element":h=document.id(h).toQueryString();break;case"object":case"hash":h=Hash.toQueryString(h);}if(this.options.format){var k="format="+this.options.format;h=(h)?k+"&"+h:k;}if(this.options.emulation&&!["get","post"].contains(a)){var i="_method="+a;h=(h)?i+"&"+h:i;a="post";}if(this.options.urlEncoded&&a=="post"){var c=(this.options.encoding)?"; charset="+this.options.encoding:"";this.headers.set("Content-type","application/x-www-form-urlencoded"+c);}if(this.options.noCache){var g="noCache="+new Date().getTime();h=(h)?g+"&"+h:g;}var f=b.lastIndexOf("/");if(f>-1&&(f=b.indexOf("#"))>-1){b=b.substr(0,f);}if(h&&a=="get"){b=b+(b.contains("?")?"&":"?")+h;h=null;}this.xhr.open(a.toUpperCase(),b,this.options.async);this.xhr.onreadystatechange=this.onStateChange.bind(this);this.headers.each(function(n,m){try{this.xhr.setRequestHeader(m,n);}catch(o){this.fireEvent("exception",[m,n]);}},this);this.fireEvent("request");this.xhr.send(h);if(!this.options.async){this.onStateChange();}return this;},cancel:function(){if(!this.running){return this;}this.running=false;this.xhr.abort();this.xhr.onreadystatechange=$empty;this.xhr=new Browser.Request();this.fireEvent("cancel");return this;}});(function(){var a={};["get","post","put","delete","GET","POST","PUT","DELETE"].each(function(b){a[b]=function(){var c=Array.link(arguments,{url:String.type,data:$defined});return this.send($extend(c,{method:b}));};});Request.implement(a);})();Element.Properties.send={set:function(a){var b=this.retrieve("send");if(b){b.cancel();}return this.eliminate("send").store("send:options",$extend({data:this,link:"cancel",method:this.get("method")||"post",url:this.get("action")},a));},get:function(a){if(a||!this.retrieve("send")){if(a||!this.retrieve("send:options")){this.set("send",a);}this.store("send",new Request(this.retrieve("send:options")));}return this.retrieve("send");}};Element.implement({send:function(a){var b=this.get("send");b.send({data:this,url:a||b.options.url});return this;}});Request.HTML=new Class({Extends:Request,options:{update:false,append:false,evalScripts:true,filter:false},processHTML:function(c){var b=c.match(/]*>([\s\S]*?)<\/body>/i);c=(b)?b[1]:c;var a=new Element("div");return $try(function(){var d=""+c+"",h;if(Browser.Engine.trident){h=new ActiveXObject("Microsoft.XMLDOM");h.async=false;h.loadXML(d);}else{h=new DOMParser().parseFromString(d,"text/xml");}d=h.getElementsByTagName("root")[0];if(!d){return null;}for(var g=0,f=d.childNodes.length;g1),cash:!h});}});Element.implement({match:function(b){if(!b||(b==this)){return true;}var d=Selectors.Utils.parseTagAndID(b);var a=d[0],f=d[1];if(!Selectors.Filters.byID(this,f)||!Selectors.Filters.byTag(this,a)){return false;}var c=Selectors.Utils.parseSelector(b);return(c)?Selectors.Utils.filter(this,c,{}):true;}});var Selectors={Cache:{nth:{},parsed:{}}};Selectors.RegExps={id:(/#([\w-]+)/),tag:(/^(\w+|\*)/),quick:(/^(\w+|\*)$/),splitter:(/\s*([+>~\s])\s*([a-zA-Z#.*:\[])/g),combined:(/\.([\w-]+)|\[(\w+)(?:([!*^$~|]?=)(["']?)([^\4]*?)\4)?\]|:([\w-]+)(?:\(["']?(.*?)?["']?\)|$)/g)};Selectors.Utils={chk:function(b,c){if(!c){return true;}var a=$uid(b);if(!c[a]){return c[a]=true;}return false;},parseNthArgument:function(i){if(Selectors.Cache.nth[i]){return Selectors.Cache.nth[i];}var f=i.match(/^([+-]?\d*)?([a-z]+)?([+-]?\d*)?$/);if(!f){return false;}var h=parseInt(f[1],10);var d=(h||h===0)?h:1;var g=f[2]||false;var c=parseInt(f[3],10)||0;if(d!=0){c--;while(c<1){c+=d;}while(c>=d){c-=d;}}else{d=c;g="index";}switch(g){case"n":f={a:d,b:c,special:"n"};break;case"odd":f={a:2,b:0,special:"n"};break;case"even":f={a:2,b:1,special:"n"};break;case"first":f={a:0,special:"index"};break;case"last":f={special:"last-child"};break;case"only":f={special:"only-child"};break;default:f={a:(d-1),special:"index"};}return Selectors.Cache.nth[i]=f;},parseSelector:function(f){if(Selectors.Cache.parsed[f]){return Selectors.Cache.parsed[f];}var d,i={classes:[],pseudos:[],attributes:[]};while((d=Selectors.RegExps.combined.exec(f))){var j=d[1],h=d[2],g=d[3],b=d[5],c=d[6],k=d[7];if(j){i.classes.push(j);}else{if(c){var a=Selectors.Pseudo.get(c);if(a){i.pseudos.push({parser:a,argument:k});}else{i.attributes.push({name:c,operator:"=",value:k});}}else{if(h){i.attributes.push({name:h,operator:g,value:b});}}}}if(!i.classes.length){delete i.classes;}if(!i.attributes.length){delete i.attributes;}if(!i.pseudos.length){delete i.pseudos;}if(!i.classes&&!i.attributes&&!i.pseudos){i=null;}return Selectors.Cache.parsed[f]=i;},parseTagAndID:function(b){var a=b.match(Selectors.RegExps.tag);var c=b.match(Selectors.RegExps.id);return[(a)?a[1]:"*",(c)?c[1]:false];},filter:function(g,c,f){var d;if(c.classes){for(d=c.classes.length;d--;d){var h=c.classes[d];if(!Selectors.Filters.byClass(g,h)){return false;}}}if(c.attributes){for(d=c.attributes.length;d--;d){var b=c.attributes[d];if(!Selectors.Filters.byAttribute(g,b.name,b.operator,b.value)){return false;}}}if(c.pseudos){for(d=c.pseudos.length;d--;d){var a=c.pseudos[d];if(!Selectors.Filters.byPseudo(g,a.parser,a.argument,f)){return false;}}}return true;},getByTagAndID:function(b,a,d){if(d){var c=(b.getElementById)?b.getElementById(d,true):Element.getElementById(b,d,true);return(c&&Selectors.Filters.byTag(c,a))?[c]:[];}else{return b.getElementsByTagName(a);}},search:function(p,o,u){var b=[];var c=o.trim().replace(Selectors.RegExps.splitter,function(k,j,i){b.push(j);return":)"+i;}).split(":)");var q,f,B;for(var A=0,w=c.length;A":function(j,h,k,a,g){var c=Selectors.Utils.getByTagAndID(h,k,a);for(var f=0,d=c.length;fa){return false;}}return(c==a);},even:function(b,a){return Selectors.Pseudo["nth-child"].call(this,"2n+1",a);},odd:function(b,a){return Selectors.Pseudo["nth-child"].call(this,"2n",a);},selected:function(){return this.selected;},enabled:function(){return(this.disabled===false);}});var Swiff=new Class({Implements:[Options],options:{id:null,height:1,width:1,container:null,properties:{},params:{quality:"high",allowScriptAccess:"always",wMode:"transparent",swLiveConnect:true},callBacks:{},vars:{}},toElement:function(){return this.object;},initialize:function(m,n){this.instance="Swiff_"+$time();this.setOptions(n);n=this.options;var b=this.id=n.id||this.instance;var a=document.id(n.container);Swiff.CallBacks[this.instance]={};var f=n.params,h=n.vars,g=n.callBacks;var i=$extend({height:n.height,width:n.width},n.properties);var l=this;for(var d in g){Swiff.CallBacks[this.instance][d]=(function(o){return function(){return o.apply(l.object,arguments);};})(g[d]);h[d]="Swiff.CallBacks."+this.instance+"."+d;}f.flashVars=Hash.toQueryString(h);if(Browser.Engine.trident){i.classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000";f.movie=m;}else{i.type="application/x-shockwave-flash";i.data=m;}var k='';}}k+="";this.object=((a)?a.empty():new Element("div")).set("html",k).firstChild;},replaces:function(a){a=document.id(a,true);a.parentNode.replaceChild(this.toElement(),a);return this;},inject:function(a){document.id(a,true).appendChild(this.toElement());return this;},remote:function(){return Swiff.remote.apply(Swiff,[this.toElement()].extend(arguments));}});Swiff.CallBacks={};Swiff.remote=function(obj,fn){var rs=obj.CallFunction(''+__flash__argumentsToXML(arguments,2)+"");return eval(rs);}; MooTools.More={version:"1.2.5.1",build:"254884f2b83651bf95260eed5c6cceb838e22d8e"};(function(){var a={language:"en-US",languages:{"en-US":{}},cascades:["en-US"]}; var b;MooTools.lang=new Events();$extend(MooTools.lang,{setLanguage:function(c){if(!a.languages[c]){return this;}a.language=c;this.load();this.fireEvent("langChange",c); return this;},load:function(){var c=this.cascade(this.getCurrentLanguage());b={};$each(c,function(e,d){b[d]=this.lambda(e);},this);},getCurrentLanguage:function(){return a.language; },addLanguage:function(c){a.languages[c]=a.languages[c]||{};return this;},cascade:function(e){var c=(a.languages[e]||{}).cascades||[];c.combine(a.cascades); c.erase(e).push(e);var d=c.map(function(f){return a.languages[f];},this);return $merge.apply(this,d);},lambda:function(c){(c||{}).get=function(e,d){return $lambda(c[e]).apply(this,$splat(d)); };return c;},get:function(e,d,c){if(b&&b[e]){return(d?b[e].get(d,c):b[e]);}},set:function(d,e,c){this.addLanguage(d);langData=a.languages[d];if(!langData[e]){langData[e]={}; }$extend(langData[e],c);if(d==this.getCurrentLanguage()){this.load();this.fireEvent("langChange",d);}return this;},list:function(){return Hash.getKeys(a.languages); }});})();(function(){var i=this.Date;if(!i.now){i.now=$time;}i.Methods={ms:"Milliseconds",year:"FullYear",min:"Minutes",mo:"Month",sec:"Seconds",hr:"Hours"}; ["Date","Day","FullYear","Hours","Milliseconds","Minutes","Month","Seconds","Time","TimezoneOffset","Week","Timezone","GMTOffset","DayOfYear","LastMonth","LastDayOfMonth","UTCDate","UTCDay","UTCFullYear","AMPM","Ordinal","UTCHours","UTCMilliseconds","UTCMinutes","UTCMonth","UTCSeconds","UTCMilliseconds"].each(function(p){i.Methods[p.toLowerCase()]=p; });var d=function(q,p){return new Array(p-String(q).length+1).join("0")+q;};i.implement({set:function(t,r){switch($type(t)){case"object":for(var s in t){this.set(s,t[s]); }break;case"string":t=t.toLowerCase();var q=i.Methods;if(q[t]){this["set"+q[t]](r);}}return this;},get:function(q){q=q.toLowerCase();var p=i.Methods;if(p[q]){return this["get"+p[q]](); }return null;},clone:function(){return new i(this.get("time"));},increment:function(p,r){p=p||"day";r=$pick(r,1);switch(p){case"year":return this.increment("month",r*12); case"month":var q=this.get("date");this.set("date",1).set("mo",this.get("mo")+r);return this.set("date",q.min(this.get("lastdayofmonth")));case"week":return this.increment("day",r*7); case"day":return this.set("date",this.get("date")+r);}if(!i.units[p]){throw new Error(p+" is not a supported interval");}return this.set("time",this.get("time")+r*i.units[p]()); },decrement:function(p,q){return this.increment(p,-1*$pick(q,1));},isLeapYear:function(){return i.isLeapYear(this.get("year"));},clearTime:function(){return this.set({hr:0,min:0,sec:0,ms:0}); },diff:function(q,p){if($type(q)=="string"){q=i.parse(q);}return((q-this)/i.units[p||"day"](3,3)).round();},getLastDayOfMonth:function(){return i.daysInMonth(this.get("mo"),this.get("year")); },getDayOfYear:function(){return(i.UTC(this.get("year"),this.get("mo"),this.get("date")+1)-i.UTC(this.get("year"),0,1))/i.units.day();},getWeek:function(){return(this.get("dayofyear")/7).ceil(); },getOrdinal:function(p){return i.getMsg("ordinal",p||this.get("date"));},getTimezone:function(){return this.toString().replace(/^.*? ([A-Z]{3}).[0-9]{4}.*$/,"$1").replace(/^.*?\(([A-Z])[a-z]+ ([A-Z])[a-z]+ ([A-Z])[a-z]+\)$/,"$1$2$3"); },getGMTOffset:function(){var p=this.get("timezoneOffset");return((p>0)?"-":"+")+d((p.abs()/60).floor(),2)+d(p%60,2);},setAMPM:function(p){p=p.toUpperCase(); var q=this.get("hr");if(q>11&&p=="AM"){return this.decrement("hour",12);}else{if(q<12&&p=="PM"){return this.increment("hour",12);}}return this;},getAMPM:function(){return(this.get("hr")<12)?"AM":"PM"; },parse:function(p){this.set("time",i.parse(p));return this;},isValid:function(p){return !isNaN((p||this).valueOf());},format:function(p){if(!this.isValid()){return"invalid date"; }p=p||"%x %X";p=k[p.toLowerCase()]||p;var q=this;return p.replace(/%([a-z%])/gi,function(s,r){switch(r){case"a":return i.getMsg("days")[q.get("day")].substr(0,3); case"A":return i.getMsg("days")[q.get("day")];case"b":return i.getMsg("months")[q.get("month")].substr(0,3);case"B":return i.getMsg("months")[q.get("month")]; case"c":return q.toString();case"d":return d(q.get("date"),2);case"D":return q.get("date");case"e":return q.get("date");case"H":return d(q.get("hr"),2); case"I":return((q.get("hr")%12)||12);case"j":return d(q.get("dayofyear"),3);case"m":return d((q.get("mo")+1),2);case"M":return d(q.get("min"),2);case"o":return q.get("ordinal"); case"p":return i.getMsg(q.get("ampm"));case"s":return Math.round(q/1000);case"S":return d(q.get("seconds"),2);case"U":return d(q.get("week"),2);case"w":return q.get("day"); case"x":return q.format(i.getMsg("shortDate"));case"X":return q.format(i.getMsg("shortTime"));case"y":return q.get("year").toString().substr(2);case"Y":return q.get("year"); case"T":return q.get("GMTOffset");case"Z":return q.get("Timezone");case"z":return d(q.get("ms"),3);}return r;});},toISOString:function(){return this.format("iso8601"); }});i.alias("toISOString","toJSON");i.alias("diff","compare");i.alias("format","strftime");var k={db:"%Y-%m-%d %H:%M:%S",compact:"%Y%m%dT%H%M%S",iso8601:"%Y-%m-%dT%H:%M:%S%T",rfc822:"%a, %d %b %Y %H:%M:%S %Z","short":"%d %b %H:%M","long":"%B %d, %Y %H:%M"}; var g=[];var e=i.parse;var n=function(s,u,r){var q=-1;var t=i.getMsg(s+"s");switch($type(u)){case"object":q=t[u.get(s)];break;case"number":q=t[u];if(!q){throw new Error("Invalid "+s+" index: "+u); }break;case"string":var p=t.filter(function(v){return this.test(v);},new RegExp("^"+u,"i"));if(!p.length){throw new Error("Invalid "+s+" string");}if(p.length>1){throw new Error("Ambiguous "+s); }q=p[0];}return(r)?t.indexOf(q):q;};i.extend({getMsg:function(q,p){return MooTools.lang.get("Date",q,p);},units:{ms:$lambda(1),second:$lambda(1000),minute:$lambda(60000),hour:$lambda(3600000),day:$lambda(86400000),week:$lambda(608400000),month:function(q,p){var r=new i; return i.daysInMonth($pick(q,r.get("mo")),$pick(p,r.get("year")))*86400000;},year:function(p){p=p||new i().get("year");return i.isLeapYear(p)?31622400000:31536000000; }},daysInMonth:function(q,p){return[31,i.isLeapYear(p)?29:28,31,30,31,30,31,31,30,31,30,31][q];},isLeapYear:function(p){return((p%4===0)&&(p%100!==0))||(p%400===0); },parse:function(r){var q=$type(r);if(q=="number"){return new i(r);}if(q!="string"){return r;}r=r.clean();if(!r.length){return null;}var p;g.some(function(t){var s=t.re.exec(r); return(s)?(p=t.handler(s)):false;});return p||new i(e(r));},parseDay:function(p,q){return n("day",p,q);},parseMonth:function(q,p){return n("month",q,p); },parseUTC:function(q){var p=new i(q);var r=i.UTC(p.get("year"),p.get("mo"),p.get("date"),p.get("hr"),p.get("min"),p.get("sec"),p.get("ms"));return new i(r); },orderIndex:function(p){return i.getMsg("dateOrder").indexOf(p)+1;},defineFormat:function(p,q){k[p]=q;},defineFormats:function(p){for(var q in p){i.defineFormat(q,p[q]); }},parsePatterns:g,defineParser:function(p){g.push((p.re&&p.handler)?p:l(p));},defineParsers:function(){Array.flatten(arguments).each(i.defineParser);},define2DigitYearStart:function(p){h=p%100; m=p-h;}});var m=1900;var h=70;var j=function(p){return new RegExp("(?:"+i.getMsg(p).map(function(q){return q.substr(0,3);}).join("|")+")[a-z]*");};var a=function(p){switch(p){case"x":return((i.orderIndex("month")==1)?"%m[-./]%d":"%d[-./]%m")+"([-./]%y)?"; case"X":return"%H([.:]%M)?([.:]%S([.:]%s)?)? ?%p? ?%T?";}return null;};var o={d:/[0-2]?[0-9]|3[01]/,H:/[01]?[0-9]|2[0-3]/,I:/0?[1-9]|1[0-2]/,M:/[0-5]?\d/,s:/\d+/,o:/[a-z]*/,p:/[ap]\.?m\.?/,y:/\d{2}|\d{4}/,Y:/\d{4}/,T:/Z|[+-]\d{2}(?::?\d{2})?/}; o.m=o.I;o.S=o.M;var c;var b=function(p){c=p;o.a=o.A=j("days");o.b=o.B=j("months");g.each(function(r,q){if(r.format){g[q]=l(r.format);}});};var l=function(r){if(!c){return{format:r}; }var p=[];var q=(r.source||r).replace(/%([a-z])/gi,function(t,s){return a(s)||t;}).replace(/\((?!\?)/g,"(?:").replace(/ (?!\?|\*)/g,",? ").replace(/%([a-z%])/gi,function(t,s){var u=o[s]; if(!u){return s;}p.push(s);return"("+u.source+")";}).replace(/\[a-z\]/gi,"[a-z\\u00c0-\\uffff]");return{format:r,re:new RegExp("^"+q+"$","i"),handler:function(v){v=v.slice(1).associate(p); var s=new i().clearTime(),u=v.y||v.Y;if(u!=null){f.call(s,"y",u);}if("d" in v){f.call(s,"d",1);}if("m" in v||"b" in v||"B" in v){f.call(s,"m",1);}for(var t in v){f.call(s,t,v[t]); }return s;}};};var f=function(p,q){if(!q){return this;}switch(p){case"a":case"A":return this.set("day",i.parseDay(q,true));case"b":case"B":return this.set("mo",i.parseMonth(q,true)); case"d":return this.set("date",q);case"H":case"I":return this.set("hr",q);case"m":return this.set("mo",q-1);case"M":return this.set("min",q);case"p":return this.set("ampm",q.replace(/\./g,"")); case"S":return this.set("sec",q);case"s":return this.set("ms",("0."+q)*1000);case"w":return this.set("day",q);case"Y":return this.set("year",q);case"y":q=+q; if(q<100){q+=m+(q0.75*a){e=c;}break;}f/=a;e=c+"s";}return Date.getMsg(e+d,f).substitute({delta:f.round()});}});Date.defineParsers({re:/^(?:tod|tom|yes)/i,handler:function(a){var b=new Date().clearTime(); switch(a[0]){case"tom":return b.increment();case"yes":return b.decrement();default:return b;}}},{re:/^(next|last) ([a-z]+)$/i,handler:function(e){var f=new Date().clearTime(); var b=f.getDay();var c=Date.parseDay(e[2],true);var a=c-b;if(c<=b){a+=7;}if(e[1]=="last"){a-=7;}return f.set("date",f.getDate()+a);}});Fx.Elements=new Class({Extends:Fx.CSS,initialize:function(b,a){this.elements=this.subject=$$(b); this.parent(a);},compute:function(g,h,j){var c={};for(var d in g){var a=g[d],e=h[d],f=c[d]={};for(var b in a){f[b]=this.parent(a[b],e[b],j);}}return c; },set:function(b){for(var c in b){if(!this.elements[c]){continue;}var a=b[c];for(var d in a){this.render(this.elements[c],d,a[d],this.options.unit);}}return this; },start:function(c){if(!this.check(c)){return this;}var h={},j={};for(var d in c){if(!this.elements[d]){continue;}var f=c[d],a=h[d]={},g=j[d]={};for(var b in f){var e=this.prepare(this.elements[d],b,f[b]); a[b]=e.from;g[b]=e.to;}}return this.parent(h,j);}});var Drag=new Class({Implements:[Events,Options],options:{snap:6,unit:"px",grid:false,style:true,limit:false,handle:false,invert:false,preventDefault:false,stopPropagation:false,modifiers:{x:"left",y:"top"}},initialize:function(){var b=Array.link(arguments,{options:Object.type,element:$defined}); this.element=document.id(b.element);this.document=this.element.getDocument();this.setOptions(b.options||{});var a=$type(this.options.handle);this.handles=((a=="array"||a=="collection")?$$(this.options.handle):document.id(this.options.handle))||this.element; this.mouse={now:{},pos:{}};this.value={start:{},now:{}};this.selection=(Browser.Engine.trident)?"selectstart":"mousedown";this.bound={start:this.start.bind(this),check:this.check.bind(this),drag:this.drag.bind(this),stop:this.stop.bind(this),cancel:this.cancel.bind(this),eventStop:$lambda(false)}; this.attach();},attach:function(){this.handles.addEvent("mousedown",this.bound.start);return this;},detach:function(){this.handles.removeEvent("mousedown",this.bound.start); return this;},start:function(e){if(e.rightClick){return;}if(this.options.preventDefault){e.preventDefault();}if(this.options.stopPropagation){e.stopPropagation(); }this.mouse.start=e.page;this.fireEvent("beforeStart",this.element);var a=this.options.limit;this.limit={x:[],y:[]};var d=this.element.getStyles("left","right","top","bottom"); this._invert={x:this.options.modifiers.x=="left"&&d.left=="auto"&&!isNaN(d.right.toInt())&&(this.options.modifiers.x="right"),y:this.options.modifiers.y=="top"&&d.top=="auto"&&!isNaN(d.bottom.toInt())&&(this.options.modifiers.y="bottom")}; var g,f;for(g in this.options.modifiers){if(!this.options.modifiers[g]){continue;}var c=this.element.getStyle(this.options.modifiers[g]);if(c&&!c.match(/px$/)){if(!f){f=this.element.getCoordinates(this.element.getOffsetParent()); }c=f[this.options.modifiers[g]];}if(this.options.style){this.value.now[g]=(c||0).toInt();}else{this.value.now[g]=this.element[this.options.modifiers[g]]; }if(this.options.invert){this.value.now[g]*=-1;}if(this._invert[g]){this.value.now[g]*=-1;}this.mouse.pos[g]=e.page[g]-this.value.now[g];if(a&&a[g]){for(var b=2; b--;b){if($chk(a[g][b])){this.limit[g][b]=$lambda(a[g][b])();}}}}if($type(this.options.grid)=="number"){this.options.grid={x:this.options.grid,y:this.options.grid}; }this.document.addEvents({mousemove:this.bound.check,mouseup:this.bound.cancel});this.document.addEvent(this.selection,this.bound.eventStop);},check:function(a){if(this.options.preventDefault){a.preventDefault(); }var b=Math.round(Math.sqrt(Math.pow(a.page.x-this.mouse.start.x,2)+Math.pow(a.page.y-this.mouse.start.y,2)));if(b>this.options.snap){this.cancel();this.document.addEvents({mousemove:this.bound.drag,mouseup:this.bound.stop}); this.fireEvent("start",[this.element,a]).fireEvent("snap",this.element);}},drag:function(a){if(this.options.preventDefault){a.preventDefault();}this.mouse.now=a.page; for(var b in this.options.modifiers){if(!this.options.modifiers[b]){continue;}this.value.now[b]=this.mouse.now[b]-this.mouse.pos[b];if(this.options.invert){this.value.now[b]*=-1; }if(this._invert[b]){this.value.now[b]*=-1;}if(this.options.limit&&this.limit[b]){if($chk(this.limit[b][1])&&(this.value.now[b]>this.limit[b][1])){this.value.now[b]=this.limit[b][1]; }else{if($chk(this.limit[b][0])&&(this.value.now[b]=3){c="rgb"; b=Array.slice(arguments,0,3);}else{if(typeof b=="string"){if(b.match(/rgb/)){b=b.rgbToHex().hexToRgb(true);}else{if(b.match(/hsb/)){b=b.hsbToRgb();}else{b=b.hexToRgb(true); }}}}c=c||"rgb";switch(c){case"hsb":var a=b;b=b.hsbToRgb();b.hsb=a;break;case"hex":b=b.hexToRgb(true);break;}b.rgb=b.slice(0,3);b.hsb=b.hsb||b.rgbToHsb(); b.hex=b.rgbToHex();return $extend(b,this);}});Color.implement({mix:function(){var a=Array.slice(arguments);var c=($type(a.getLast())=="number")?a.pop():50; var b=this.slice();a.each(function(d){d=new Color(d);for(var e=0;e<3;e++){b[e]=Math.round((b[e]/100*(100-c))+(d[e]/100*c));}});return new Color(b,"rgb"); },invert:function(){return new Color(this.map(function(a){return 255-a;}));},setHue:function(a){return new Color([a,this.hsb[1],this.hsb[2]],"hsb");},setSaturation:function(a){return new Color([this.hsb[0],a,this.hsb[2]],"hsb"); },setBrightness:function(a){return new Color([this.hsb[0],this.hsb[1],a],"hsb");}});var $RGB=function(d,c,a){return new Color([d,c,a],"rgb");};var $HSB=function(d,c,a){return new Color([d,c,a],"hsb"); };var $HEX=function(a){return new Color(a,"hex");};Array.implement({rgbToHsb:function(){var b=this[0],c=this[1],j=this[2],g=0;var i=Math.max(b,c,j),e=Math.min(b,c,j); var k=i-e;var h=i/255,f=(i!=0)?k/i:0;if(f!=0){var d=(i-b)/k;var a=(i-c)/k;var l=(i-j)/k;if(b==i){g=l-a;}else{if(c==i){g=2+d-l;}else{g=4+a-d;}}g/=6;if(g<0){g++; }}return[Math.round(g*360),Math.round(f*100),Math.round(h*100)];},hsbToRgb:function(){var c=Math.round(this[2]/100*255);if(this[1]==0){return[c,c,c];}else{var a=this[0]%360; var e=a%60;var g=Math.round((this[2]*(100-this[1]))/10000*255);var d=Math.round((this[2]*(6000-this[1]*e))/600000*255);var b=Math.round((this[2]*(6000-this[1]*(60-e)))/600000*255); switch(Math.floor(a/60)){case 0:return[c,b,g];case 1:return[d,c,g];case 2:return[g,c,b];case 3:return[g,d,c];case 4:return[b,g,c];case 5:return[c,g,d]; }}return false;}});String.implement({rgbToHsb:function(){var a=this.match(/\d{1,3}/g);return(a)?a.rgbToHsb():null;},hsbToRgb:function(){var a=this.match(/\d{1,3}/g); return(a)?a.hsbToRgb():null;}});MooTools.lang.set("en-US","Date",{months:["January","February","March","April","May","June","July","August","September","October","November","December"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dateOrder:["month","date","year"],shortDate:"%m/%d/%Y",shortTime:"%I:%M%p",AM:"AM",PM:"PM",ordinal:function(a){return(a>3&&a<21)?"th":["th","st","nd","rd","th"][Math.min(a%10,4)]; },lessThanMinuteAgo:"less than a minute ago",minuteAgo:"about a minute ago",minutesAgo:"{delta} minutes ago",hourAgo:"about an hour ago",hoursAgo:"about {delta} hours ago",dayAgo:"1 day ago",daysAgo:"{delta} days ago",weekAgo:"1 week ago",weeksAgo:"{delta} weeks ago",monthAgo:"1 month ago",monthsAgo:"{delta} months ago",yearAgo:"1 year ago",yearsAgo:"{delta} years ago",lessThanMinuteUntil:"less than a minute from now",minuteUntil:"about a minute from now",minutesUntil:"{delta} minutes from now",hourUntil:"about an hour from now",hoursUntil:"about {delta} hours from now",dayUntil:"1 day from now",daysUntil:"{delta} days from now",weekUntil:"1 week from now",weeksUntil:"{delta} weeks from now",monthUntil:"1 month from now",monthsUntil:"{delta} months from now",yearUntil:"1 year from now",yearsUntil:"{delta} years from now"}); $extend(Element.NativeEvents, { 'paste': 2, 'input': 2 }); Element.Events.paste = { base : (Browser.Engine.presto || (Browser.Engine.gecko && Browser.Engine.version < 19)) ? 'input' : 'paste', condition: function(e){ this.fireEvent('paste', e, 1); return false; } }; var isMac = navigator.appVersion.indexOf("Mac")!=-1 ? true : false; var isFireFox = navigator.userAgent.indexOf("Firefox")!=-1 ? true : false; var isFF = isFireFox; var isSafari = navigator.userAgent.indexOf("Safari")!=-1 ? true : false; var isNetscape = navigator.appName == "Netscape" ? true : false; var isOpera = navigator.userAgent.indexOf("Opera")!=-1 ? true : false; var isIE = document.all && !isOpera ? true : false; var isMoz = isFF || (isNetscape && !isSafari) ? true : false; window.addEvent('domready', function() { scDatePickerSetup(); scFormSetup(); }); // optionally support time selection with additional class of dateTimeFld function scDatePickerSetup() { $$('.dateFld, .dateTimeFld').each(function(datePickerFld) { if (datePickerFld.hasAttribute('readonly') || datePickerFld.hasClass('datePickerSetup') || datePickerFld.type != 'text') return; var datePickerBtnId = datePickerFld.id + '_toggle'; var datePickerBtn = new Element('a', {'class': 'datePickerBtn', 'id': datePickerBtnId}); datePickerBtn.inject(datePickerFld,'after'); if (datePickerFld.hasClass('dateTimeFld')) { var timePicker = true; var dateFormat = '%b %d, %Y %I:%M %p'; } else { var timePicker = false; var dateFormat = '%b %d, %Y'; } new DatePicker( datePickerFld, { pickerClass: 'datepicker_vista', toggle: datePickerFld.id + '_toggle', timePicker: datePickerFld.hasClass('dateTimeFld'), format: dateFormat } ); if (datePickerFld.getStyle('display') == 'none') $(datePickerFld.id + '_toggle').setStyle('display','none'); datePickerFld.addClass('datePickerSetup'); }); } function scFormSetup() { // so that when you enter 3 numbers, it jumps to the next field automatically. $$('.phone1, .phone2').addEvent('keyup', function(e){ if (this.value.length == 3 && e.code != 16 && e.code != 9 && e.code != 17 && e.code !=37 && e.code != 39) { var parent = this.getParent(); var nextFld = parent.getElement(this.hasClass('phone1') ? '.phone2' : '.phone3'); if (nextFld) nextFld.focus(); } }); } // this is here, because IE doesn't support CSS pseudo classes "hover, active, etc..." // elemRef is optional...if left out, the element that was moused over will get it's className swapped // elemId is the ID of the elemnt you want to swap. function swapClass(evtRef, elemRef, elemId) { if (!evtRef) return; if (!elemRef && elemId) elemRef = document.getElementById(elemId); if (!elemRef) var elemRef = evtRef.target ? evtRef.target : evtRef.srcElement; if (!elemRef.oldClassName) elemRef.oldClassName = elemRef.className; if (evtRef.type == "mouseover" || evtRef.type == "mousedown") { if (elemRef.className.indexOf('click') == -1) elemRef.className = elemRef.oldClassName + "-" + evtRef.type; } else if (evtRef.type == "click"){ if (elemRef.className.indexOf('click') == -1) { elemRef.className = elemRef.oldClassName + "-click" } else { elemRef.className = elemRef.oldClassName; } } else { if (elemRef.className.indexOf('click') == -1) elemRef.className = elemRef.oldClassName; } } function swapDisplay(elemRef) { elemRef = typeof(elemRef) == 'object' ? elemRef : document.getElementById(elemRef); if (elemRef) { // doesn't have an inline style, set one based on class if possible if (!elemRef.style.display && (elemRef.className.indexOf('sc_hide') != -1 || elemRef.className.indexOf('sc_show') != -1)) { if (elemRef.className.indexOf('sc_hide') != -1) { elemRef.className = elemRef.className.replace('sc_hide','sc_show'); } else if (elemRef.className.indexOf('sc_show') != -1) { elemRef.className = elemRef.className.replace('sc_show','sc_hide'); } } else { elemRef.style.display = elemRef.style.display == 'none' ? '' : 'none'; } elemRef.style.zoom = '1'; } } function getFirstChildElement(elemRef) { if (typeof(elemRef) == 'string') elemRef = document.getElementById(elemRef); if (elemRef) { // IE prior to 6.0 still treats a comment as node type 1, so we add something to throw that out by nodeName firstChildRef = elemRef.firstChild; if (firstChildRef) { if (firstChildRef.nodeType != 1 || firstChildRef.nodeName == '!') { firstChildRef = firstChildRef.nextSibling; } if (firstChildRef) { if (firstChildRef.nodeType != 1 || firstChildRef.nodeName == '!') { firstChildRef = firstChildRef.nextSibling; } } if (firstChildRef) { if (firstChildRef.nodeType != 1 || firstChildRef.nodeName == '!') { firstChildRef = firstChildRef.nextSibling; } } } if (firstChildRef) return firstChildRef; } } function getElementsByPartialId(parent,tag,match) { var i; var matches = new Array(); if (typeof (parent) == 'string') { parent = document.getElementById(parent); } if (!parent) return false; var allTags = parent.getElementsByTagName(tag); if (!allTags) return matches; for(i=0;allTags[i];i++) { if (allTags[i].id.indexOf(match) != -1) { matches[matches.length] = allTags[i]; } } return matches; } function dumpElement(elemRef) { // into a table showing each prop and its value var t; var dumpArr = new Array(); var propArr = new Array(); var prop; for(prop in elemRef) { dumpArr[prop] = elemRef[prop]; propArr[propArr.length] = prop; } propArr.sort(); t += ''; for(i=0; i < propArr.length; i++) { prop = propArr[i]; t += ''; } t += '
' + prop + ''; if (prop == 'innerHTML' || prop == 'outerHTML') { t += 'HTML ...'; } else { t += dumpArr[prop]; } t += ' 
'; var newWin = window.open(); newWin.document.write(t); } // useful when you need to simulate tabbing to the next field via focus. function findNextTabStop(el) { var universe = document.querySelectorAll('input, button, select, textarea, a[href]'); var list = Array.prototype.filter.call(universe, function(item) {return item.tabIndex >= "0"}); var index = list.indexOf(el); return list[index + 1] || list[0]; } function formatDecimal (num, decplaces) { num = parseFloat(num); if (!isNaN(num)) { // round the result to the nearest integer; var str = "" + Math.round (eval(num) * Math.pow(10,decplaces)); if (str.indexOf("e") != -1) { return "Out of Range"; } // to the left of the number while (str.length <= decplaces) { str = "0" + str; } var decpoint = str.length - decplaces; // the decimal point; (b) the decimal point; and (c) the balance return str.substring(0,decpoint) + "." + str.substring(decpoint,str.length); } else { return "NaN"; } } function formatCommas(numString) { if (numString == 'NaN') return; var re = /(\.\d*)/; var dec = numString.match(re)[0]; numString = numString.replace(dec,''); re = /(-?\d+)(\d{3})/; while (re.test(numString)) { numString = numString.replace(re, "$1,$2"); } numString += dec; return numString; } function formatCurrency(num) { if (typeof(num) != 'string') num = num.toString(); return formatCommas(formatDecimal(num,2)); } function setIFrameHeight(iFrame) { if (!iFrame) return; if (typeof(iFrame) == 'string') iFrame = document.getElementById(iFrame); var extraHeight = 20; var firstDiv = getFirstChildElement(iFrame.contentWindow.document.body); if (firstDiv && firstDiv.nodeName == 'DIV' && firstDiv.offsetTop > 0) extraHeight += firstDiv.offsetTop; iFrame.style.height = (iFrame.contentWindow.document.body.scrollHeight + extraHeight) + 'px'; var waitDiv = document.getElementById(iFrame.id.replace('post_frame_','post_frame_wait_')); if (waitDiv && waitDiv.nodeName == 'DIV') waitDiv.style.display = 'none'; iFrame.style.visibility = 'visible'; } function trim(str) { return str.replace(/^\s*|\s*$/g,""); } function validColorHex(str) { return str.match(/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/); } function validEmail(str){ return str.match(/^(([A-Za-z0-9]+_+)|([A-Za-z0-9]+\-+)|([A-Za-z0-9]+\.+)|([A-Za-z0-9]+\++))*[A-Za-z0-9]+@((\w+\-+)|(\w+\.))*\w{1,63}\.[a-zA-Z]{2,6}$/); } function validNonHTML(str) { return !str.match(/<(\"[^\"]*\"|'[^']*'|[^'\">])*>/); } function validURL(str) { return str.match(/^(ht|f)tp(s?)\:\/\/[a-zA-Z0-9-\._]+([a-zA-Z0-9\-\._]*(\.[a-zA-Z0-9\-\._]+){2,})?(\/?)([a-zA-Z0-9:\-\.\?\,\'\/\\\+&%\$#_~]*)?$/); } function validURLFolder(str) { return str.match(/^[_a-zA-Z0-9-]*$/); } function validRelativePathNoDots(str) { return str.match(/^[_a-zA-Z0-9-\/]*$/); } function validRelativePath(str) { return str.match(/^[_a-zA-Z0-9-\/\.]*$/); } function validInteger(str) { return str.match(/^[0-9]*$/); } // matches: // 1 // 1.245 function validAmount(str) { return str.match(/^[0-9]*(\.[0-9]*)?$/); } function scCreateCookie(name,value,days) { if (days) { var date = new Date(); date.setTime(date.getTime()+(days*24*60*60*1000)); var expires = "; expires="+date.toGMTString(); } else var expires = ""; document.cookie = name+"="+value+expires+"; path=/"; } function scReadCookie(name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for(var i=0;i < ca.length;i++) { var c = ca[i]; while (c.charAt(0)==' ') c = c.substring(1,c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); } return null; } function scEraseCookie(name) { createCookie(name,"",-1); } if (typeof (typeOf) != 'function') { function typeOf(e) { return typeof e; } } function contactForm(elem, evt) { if (elem.id == 'State_Other' && evt.type == 'keyup') { if (elem.value.length) { if (document.getElementById('State_or_Province')) document.getElementById('State_or_Province').value = 2 } } else if (elem.id == 'State_or_Province' && evt.type == 'change') { if (document.getElementById('State_Other')) { var stateOther = document.getElementById('State_Other'); if (elem.options[elem.selectedIndex].value == '2') { stateOther.value = ''; stateOther.focus(); } else { stateOther.value=''; } } } } function rvSetRating(starA) { var raterID = starA.parentNode.parentNode.id; if (typeof raterID != 'string') return; var currentRatingLI = getFirstChildElement(document.getElementById(raterID)); var ratingNumber = starA.innerHTML; var ratingInt = parseInt(ratingNumber); var ratingPercent = ratingInt * 20; document.getElementById(raterID + '_rating').value = ratingNumber; currentRatingLI.style.backgroundPosition = 'left bottom'; currentRatingLI.style.width = ratingPercent.toString() + '%'; document.getElementById(raterID + '_your_rating_number').innerHTML = ratingNumber; document.getElementById(raterID + '_rv_your_rating_info').style.display = 'inline'; } Slideshow = new Class({ Implements: [Chain, Events, Options], options: {/* onComplete: $empty, onEnd: $empty, onStart: $empty,*/ captions: false, center: true, classes: [], controller: false, delay: 2000, duration: 750, fast: false, height: false, href: '', hu: '', linked: false, loader: {'animate': ['css/loader-#.png', 12]}, loop: true, match: /\?slide=(\d+)$/, overlap: true, paused: false, properties: ['href', 'rel', 'rev', 'title'], random: false, replace: [/(\.[^\.]+)$/, 't$1'], resize: 'width', slide: 0, thumbnails: false, titles: true, transition: function(p){return -(Math.cos(Math.PI * p) - 1) / 2;}, width: false }, initialize: function(el, data, options){ this.setOptions(options); this.slideshow = $(el); if (!this.slideshow) return; this.slideshow.set('styles', {'display': 'block', 'position': 'relative', 'z-index': 0}); var match = window.location.href.match(this.options.match); this.slide = (this.options.match && match) ? match[1].toInt() : this.options.slide; this.counter = this.delay = this.transition = 0; this.direction = 'left'; this.paused = false; if (!this.options.overlap) this.options.duration *= 2; var anchor = this.slideshow.getElement('a') || new Element('a'); if (!this.options.href) this.options.href = anchor.get('href') || ''; if (this.options.hu.length && !this.options.hu.test(/\/$/)) this.options.hu += '/'; if (this.options.fast === true) this.options.fast = 2; var keys = ['slideshow', 'first', 'prev', 'play', 'pause', 'next', 'last', 'images', 'captions', 'controller', 'thumbnails', 'hidden', 'visible', 'inactive', 'active', 'loader']; var values = keys.map(function(key, i){ return this.options.classes[i] || key; }, this); this.classes = values.associate(keys); this.classes.get = function(){ var str = '.' + this.slideshow; for (var i = 0, l = arguments.length; i < l; i++) str += ('-' + this[arguments[i]]); return str; }.bind(this.classes); if (!data){ this.options.hu = ''; data = {}; var thumbnails = this.slideshow.getElements(this.classes.get('thumbnails') + ' img'); this.slideshow.getElements(this.classes.get('images') + ' img').each(function(img, i){ var src = img.get('src'); var caption = $pick(img.get('alt'), img.get('title'), ''); var parent = img.getParent(); var properties = (parent.get('tag') == 'a') ? parent.getProperties : {}; var href = img.getParent().get('href') || ''; var thumbnail = (thumbnails[i]) ? thumbnails[i].get('src') : ''; data[src] = {'caption': caption, 'href': href, 'thumbnail': thumbnail}; }); } var loaded = this.load(data); if (!loaded) return; this.events = $H({'keydown': [], 'keyup': [], 'mousemove': []}); var keyup = function(e){ switch(e.key){ case 'left': this.prev(e.shift); break; case 'right': this.next(e.shift); break; case 'p': this.pause(); break; } }.bind(this); this.events.keyup.push(keyup); document.addEvent('keyup', keyup); var el = this.slideshow.getElement(this.classes.get('images')); var images = (el) ? el.empty() : new Element('div', {'class': this.classes.get('images').substr(1)}).inject(this.slideshow); var div = images.getSize(); this.height = this.options.height || div.y; this.width = this.options.width || div.x; images.set({'styles': {'display': 'block', 'height': this.height, 'overflow': 'hidden', 'position': 'relative', 'width': this.width}}); this.slideshow.store('images', images); this.a = this.image = this.slideshow.getElement('img') || new Element('img'); if (Browser.Engine.trident && Browser.Engine.version > 4) this.a.style.msInterpolationMode = 'bicubic'; this.a.set('styles', {'display': 'none', 'position': 'absolute', 'zIndex': 1}); this.b = this.a.clone(); [this.a, this.b].each(function(img){ anchor.clone().cloneEvents(anchor).grab(img).inject(images); }); if (this.options.captions) this._captions(); if (this.options.controller) this._controller(); if (this.options.loader) this._loader(); if (this.options.thumbnails) this._thumbnails(); this._preload(); }, go: function(n, direction){ if ((this.slide - 1 + this.data.images.length) % this.data.images.length == n || $time() < this.transition) return; $clear(this.timer); this.delay = 0; this.direction = (direction) ? direction : ((n < this.slide) ? 'right' : 'left'); this.slide = n; if (this.preloader) this.preloader = this.preloader.destroy(); this._preload(this.options.fast == 2 || (this.options.fast == 1 && this.paused)); }, first: function(){ this.prev(true); }, prev: function(first){ var n = 0; if (!first){ if (this.options.random){ if (this.showed.i < 2) return; this.showed.i -= 2; n = this.showed.array[this.showed.i]; } else n = (this.slide - 2 + this.data.images.length) % this.data.images.length; } this.go(n, 'right'); }, pause: function(p){ if ($chk(p)) this.paused = (p) ? false : true; if (this.paused){ this.paused = false; this.delay = this.transition = 0; this.timer = this._preload.delay(100, this); [this.a, this.b].each(function(img){ ['morph', 'tween'].each(function(p){ if (this.retrieve(p)) this.get(p).resume(); }, img); }); if (this.options.controller) this.slideshow.getElement('.' + this.classes.pause).removeClass(this.classes.play); } else { this.paused = true; this.delay = Number.MAX_VALUE; this.transition = 0; $clear(this.timer); [this.a, this.b].each(function(img){ ['morph', 'tween'].each(function(p){ if (this.retrieve(p)) this.get(p).pause(); }, img); }); if (this.options.controller) this.slideshow.getElement('.' + this.classes.pause).addClass(this.classes.play); } }, next: function(last){ var n = (last) ? this.data.images.length - 1 : this.slide; this.go(n, 'left'); }, last: function(){ this.next(true); }, load: function(data){ this.firstrun = true; this.showed = {'array': [], 'i': 0}; if ($type(data) == 'array'){ this.options.captions = false; data = new Array(data.length).associate(data.map(function(image, i){ return image + '?' + i })); } this.data = {'images': [], 'captions': [], 'hrefs': [], 'thumbnails': []}; for (var image in data){ var obj = data[image] || {}; var caption = (obj.caption) ? obj.caption.trim() : ''; var href = (obj.href) ? obj.href.trim() : ((this.options.linked) ? this.options.hu + image : this.options.href); var thumbnail = (obj.thumbnail) ? obj.thumbnail.trim() : image.replace(this.options.replace[0], this.options.replace[1]); this.data.images.push(image); this.data.captions.push(caption); this.data.hrefs.push(href); this.data.thumbnails.push(thumbnail); } if (this.options.random) this.slide = $random(0, this.data.images.length - 1); if (this.options.thumbnails && this.slideshow.retrieve('thumbnails')) this._thumbnails(); if (this.slideshow.retrieve('images')){ [this.a, this.b].each(function(img){ ['morph', 'tween'].each(function(p){ if (this.retrieve(p)) this.get(p).cancel(); }, img); }); this.slide = this.transition = 0; this.go(0); } return this.data.images.length; }, destroy: function(p){ this.events.each(function(array, e){ array.each(function(fn){ document.removeEvent(e, fn); }); }); this.pause(1); if (this.options.loader) $clear(this.slideshow.retrieve('loader').retrieve('timer')); if (this.options.thumbnails) $clear(this.slideshow.retrieve('thumbnails').retrieve('timer')); this.slideshow.uid = Native.UID++; if (p) this.slideshow[p](); }, _preload: function(fast){ if (!this.preloader) this.preloader = new Asset.image(this.options.hu + this.data.images[this.slide], {'onload': function(){ this.store('loaded', true); }}); if (this.preloader.retrieve('loaded') && $time() > this.delay && $time() > this.transition){ if (this.stopped){ if (this.options.captions) this.slideshow.retrieve('captions').get('morph').cancel().start(this.classes.get('captions', 'hidden')); this.pause(1); if (this.end) this.fireEvent('end'); this.stopped = this.end = false; return; } this.image = (this.counter % 2) ? this.b : this.a; this.image.set('styles', {'display': 'block', 'height': 'auto', 'visibility': 'hidden', 'width': 'auto', 'zIndex': this.counter}); ['src', 'height', 'width'].each(function(prop){ this.image.set(prop, this.preloader.get(prop)); }, this); this._resize(this.image); this._center(this.image); var anchor = this.image.getParent(); if (this.data.hrefs[this.slide]) anchor.set('href', this.data.hrefs[this.slide]); else anchor.erase('href'); var text = (this.data.captions[this.slide]) ? this.data.captions[this.slide].replace(/<.+?>/gm, '').replace(//g, '>').replace(/"/g, "'") : ''; this.image.set('alt', text); if (this.options.titles) anchor.set('title', text); if (this.options.loader) this.slideshow.retrieve('loader').fireEvent('hide'); if (this.options.captions) this.slideshow.retrieve('captions').fireEvent('update', fast); if (this.options.thumbnails) this.slideshow.retrieve('thumbnails').fireEvent('update', fast); this._show(fast); this._loaded(); } else { if ($time() > this.delay && this.options.loader) this.slideshow.retrieve('loader').fireEvent('show'); this.timer = (this.paused && this.preloader.retrieve('loaded')) ? null : this._preload.delay(100, this, fast); } }, _show: function(fast){ if (!this.image.retrieve('morph')){ var options = (this.options.overlap) ? {'duration': this.options.duration, 'link': 'cancel'} : {'duration': this.options.duration / 2, 'link': 'chain'}; $$(this.a, this.b).set('morph', $merge(options, {'onStart': this._start.bind(this), 'onComplete': this._complete.bind(this), 'transition': this.options.transition})); } var hidden = this.classes.get('images', ((this.direction == 'left') ? 'next' : 'prev')); var visible = this.classes.get('images', 'visible'); var img = (this.counter % 2) ? this.a : this.b; if (fast){ img.get('morph').cancel().set(hidden); this.image.get('morph').cancel().set(visible); } else { if (this.options.overlap){ img.get('morph').set(visible); this.image.get('morph').set(hidden).start(visible); } else { var fn = function(hidden, visible){ this.image.get('morph').set(hidden).start(visible); }.pass([hidden, visible], this); hidden = this.classes.get('images', ((this.direction == 'left') ? 'prev' : 'next')); img.get('morph').set(visible).start(hidden).chain(fn); } } }, _loaded: function(){ this.counter++; this.delay = (this.paused) ? Number.MAX_VALUE : $time() + this.options.duration + this.options.delay; this.direction = 'left'; this.transition = (this.options.fast == 2 || (this.options.fast == 1 && this.paused)) ? 0 : $time() + this.options.duration; if (this.slide + 1 == this.data.images.length && !this.options.loop && !this.options.random) this.stopped = this.end = true; if (this.options.random){ this.showed.i++; if (this.showed.i >= this.showed.array.length){ var n = this.slide; if (this.showed.array.getLast() != n) this.showed.array.push(n); while (this.slide == n) this.slide = $random(0, this.data.images.length - 1); } else this.slide = this.showed.array[this.showed.i]; } else this.slide = (this.slide + 1) % this.data.images.length; if (this.image.getStyle('visibility') != 'visible') (function(){ this.image.setStyle('visibility', 'visible'); }).delay(1, this); if (this.preloader) this.preloader = this.preloader.destroy(); this._preload(); }, _center: function(img){ if (this.options.center){ var size = img.getSize(); img.set('styles', {'left': (size.x - this.width) / -2, 'top': (size.y - this.height) / -2}); } }, _resize: function(img){ if (this.options.resize){ var h = this.preloader.get('height'), w = this.preloader.get('width'); var dh = this.height / h, dw = this.width / w, d; if (this.options.resize == 'length') d = (dh > dw) ? dw : dh; else d = (dh > dw) ? dh : dw; img.set('styles', {height: Math.ceil(h * d), width: Math.ceil(w * d)}); } }, _start: function(){ this.fireEvent('start'); }, _complete: function(){ if (this.firstrun && this.options.paused){ this.firstrun = false; this.pause(1); } this.fireEvent('complete'); }, _captions: function(){ if (this.options.captions === true) this.options.captions = {}; var el = this.slideshow.getElement(this.classes.get('captions')); var captions = (el) ? el.empty() : new Element('div', {'class': this.classes.get('captions').substr(1)}).inject(this.slideshow); captions.set({ 'events': { 'update': function(fast){ var captions = this.slideshow.retrieve('captions'); var empty = (this.data.captions[this.slide] === ''); if (fast){ var p = (empty) ? 'hidden' : 'visible'; captions.set('html', this.data.captions[this.slide]).get('morph').cancel().set(this.classes.get('captions', p)); } else { var fn = (empty) ? $empty : function(n){ this.slideshow.retrieve('captions').set('html', this.data.captions[n]).morph(this.classes.get('captions', 'visible')) }.pass(this.slide, this); captions.get('morph').cancel().start(this.classes.get('captions', 'hidden')).chain(fn); } }.bind(this) }, 'morph': $merge(this.options.captions, {'link': 'chain'}) }); this.slideshow.store('captions', captions); }, _controller: function(){ if (this.options.controller === true) this.options.controller = {}; var el = this.slideshow.getElement(this.classes.get('controller')); var controller = (el) ? el.empty() : new Element('div', {'class': this.classes.get('controller').substr(1)}).inject(this.slideshow); var ul = new Element('ul').inject(controller); $H({'first': 'Shift + Leftwards Arrow', 'prev': 'Leftwards Arrow', 'pause': 'P', 'next': 'Rightwards Arrow', 'last': 'Shift + Rightwards Arrow'}).each(function(accesskey, action){ var li = new Element('li', { 'class': (action == 'pause' && this.options.paused) ? this.classes.play + ' ' + this.classes[action] : this.classes[action] }).inject(ul); var a = this.slideshow.retrieve(action, new Element('a', { 'title': ((action == 'pause') ? this.classes.play.capitalize() + ' / ' : '') + this.classes[action].capitalize() + ' [' + accesskey + ']' }).inject(li)); a.set('events', { 'click': function(action){this[action]();}.pass(action, this), 'mouseenter': function(active){this.addClass(active);}.pass(this.classes.active, a), 'mouseleave': function(active){this.removeClass(active);}.pass(this.classes.active, a) }); }, this); controller.set({ 'events': { 'hide': function(hidden){ if (!this.retrieve('hidden')) this.store('hidden', true).morph(hidden); }.pass(this.classes.get('controller', 'hidden'), controller), 'show': function(visible){ if (this.retrieve('hidden')) this.store('hidden', false).morph(visible); }.pass(this.classes.get('controller', 'visible'), controller) }, 'morph': $merge(this.options.controller, {'link': 'cancel'}) }).store('hidden', false); var keydown = function(e){ if (['left', 'right', 'p'].contains(e.key)){ var controller = this.slideshow.retrieve('controller'); if (controller.retrieve('hidden')) controller.get('morph').set(this.classes.get('controller', 'visible')); switch(e.key){ case 'left': this.slideshow.retrieve((e.shift) ? 'first' : 'prev').fireEvent('mouseenter'); break; case 'right': this.slideshow.retrieve((e.shift) ? 'last' : 'next').fireEvent('mouseenter'); break; default: this.slideshow.retrieve('pause').fireEvent('mouseenter'); break; } } }.bind(this); this.events.keydown.push(keydown); var keyup = function(e){ if (['left', 'right', 'p'].contains(e.key)){ var controller = this.slideshow.retrieve('controller'); if (controller.retrieve('hidden')) controller.store('hidden', false).fireEvent('hide'); switch(e.key){ case 'left': this.slideshow.retrieve((e.shift) ? 'first' : 'prev').fireEvent('mouseleave'); break; case 'right': this.slideshow.retrieve((e.shift) ? 'last' : 'next').fireEvent('mouseleave'); break; default: this.slideshow.retrieve('pause').fireEvent('mouseleave'); break; } } }.bind(this); this.events.keyup.push(keyup); var mousemove = function(e){ var images = this.slideshow.retrieve('images').getCoordinates(); if (e.page.x > images.left && e.page.x < images.right && e.page.y > images.top && e.page.y < images.bottom) this.slideshow.retrieve('controller').fireEvent('show'); else this.slideshow.retrieve('controller').fireEvent('hide'); }.bind(this); this.events.mousemove.push(mousemove); document.addEvents({'keydown': keydown, 'keyup': keyup, 'mousemove': mousemove}); this.slideshow.retrieve('controller', controller).fireEvent('hide'); }, _loader: function(){ if (this.options.loader === true) this.options.loader = {}; var loader = new Element('div', { 'class': this.classes.get('loader').substr(1), 'morph': $merge(this.options.loader, {'link': 'cancel'}) }).store('hidden', false).store('i', 1).inject(this.slideshow.retrieve('images')); if (this.options.loader.animate){ for (var i = 0; i < this.options.loader.animate[1]; i++) img = new Asset.image(this.options.loader.animate[0].replace(/#/, i)); if (Browser.Engine.trident4 && this.options.loader.animate[0].contains('png')) loader.setStyle('backgroundImage', 'none'); } loader.set('events', { 'animate': function(){ var loader = this.slideshow.retrieve('loader'); var i = (loader.retrieve('i').toInt() + 1) % this.options.loader.animate[1]; loader.store('i', i); var img = this.options.loader.animate[0].replace(/#/, i); if (Browser.Engine.trident4 && this.options.loader.animate[0].contains('png')) loader.style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="' + img + '", sizingMethod="scale")'; else loader.setStyle('backgroundImage', 'url(' + img + ')'); }.bind(this), 'hide': function(){ var loader = this.slideshow.retrieve('loader'); if (!loader.retrieve('hidden')){ loader.store('hidden', true).morph(this.classes.get('loader', 'hidden')); if (this.options.loader.animate) $clear(loader.retrieve('timer')); } }.bind(this), 'show': function(){ var loader = this.slideshow.retrieve('loader'); if (loader.retrieve('hidden')){ loader.store('hidden', false).morph(this.classes.get('loader', 'visible')); if (this.options.loader.animate) loader.store('timer', function(){this.fireEvent('animate');}.periodical(50, loader)); } }.bind(this) }); this.slideshow.retrieve('loader', loader).fireEvent('hide'); }, _thumbnails: function(){ if (this.options.thumbnails === true) this.options.thumbnails = {}; var el = this.slideshow.getElement(this.classes.get('thumbnails')); var thumbnails = (el) ? el.empty() : new Element('div', {'class': this.classes.get('thumbnails').substr(1)}).inject(this.slideshow); thumbnails.setStyle('overflow', 'hidden'); var ul = new Element('ul', {'tween': {'link': 'cancel'}}).inject(thumbnails); this.data.thumbnails.each(function(thumbnail, i){ var li = new Element('li').inject(ul); var a = new Element('a', { 'events': { 'click': function(i){ this.go(i); return false; }.pass(i, this), 'loaded': function(){ this.data.thumbnails.pop(); if (!this.data.thumbnails.length){ var div = thumbnails.getCoordinates(); var props = thumbnails.retrieve('props'); var limit = 0, pos = props[1], size = props[2]; thumbnails.getElements('li').each(function(li){ var li = li.getCoordinates(); if (li[pos] > limit) limit = li[pos]; }, this); thumbnails.store('limit', div[size] + div[props[0]] - limit); } }.bind(this) }, 'href': this.options.hu + this.data.images[i], 'morph': $merge(this.options.thumbnails, {'link': 'cancel'}) }).inject(li); if (this.data.captions[i] && this.options.titles) a.set('title', this.data.captions[i].replace(/<.+?>/gm, '').replace(//g, '>').replace(/"/g, "'")); var img = new Asset.image(this.options.hu + thumbnail, { 'onload': function(){this.fireEvent('loaded');}.bind(a) }).inject(a); }, this); thumbnails.set('events', { 'scroll': function(n, fast){ var div = this.getCoordinates(); var ul = this.getElement('ul').getPosition(); var props = this.retrieve('props'); var axis = props[3], delta, pos = props[0], size = props[2], value; var tween = this.getElement('ul').get('tween', {'property': pos}); if ($chk(n)){ var li = this.getElements('li')[n].getCoordinates(); delta = div[pos] + (div[size] / 2) - (li[size] / 2) - li[pos] value = (ul[axis] - div[pos] + delta).limit(this.retrieve('limit'), 0); if (fast) tween.set(value); else tween.start(value); } else{ var area = div[props[2]] / 3, page = this.retrieve('page'), velocity = -0.2; if (page[axis] < (div[pos] + area)) delta = (page[axis] - div[pos] - area) * velocity; else if (page[axis] > (div[pos] + div[size] - area)) delta = (page[axis] - div[pos] - div[size] + area) * velocity; if (delta){ value = (ul[axis] - div[pos] + delta).limit(this.retrieve('limit'), 0); tween.set(value); } } }.bind(thumbnails), 'update': function(fast){ var thumbnails = this.slideshow.retrieve('thumbnails'); thumbnails.getElements('a').each(function(a, i){ if (i == this.slide){ if (!a.retrieve('active', false)){ a.store('active', true); var active = this.classes.get('thumbnails', 'active'); if (fast) a.get('morph').set(active); else a.morph(active); } } else { if (a.retrieve('active', true)){ a.store('active', false); var inactive = this.classes.get('thumbnails', 'inactive'); if (fast) a.get('morph').set(inactive); else a.morph(inactive); } } }, this); if (!thumbnails.retrieve('mouseover')) thumbnails.fireEvent('scroll', [this.slide, fast]); }.bind(this) }) var div = thumbnails.getCoordinates(); thumbnails.store('props', (div.height > div.width) ? ['top', 'bottom', 'height', 'y'] : ['left', 'right', 'width', 'x']); var mousemove = function(e){ var div = this.getCoordinates(); if (e.page.x > div.left && e.page.x < div.right && e.page.y > div.top && e.page.y < div.bottom){ this.store('page', e.page); if (!this.retrieve('mouseover')){ this.store('mouseover', true); this.store('timer', function(){this.fireEvent('scroll');}.periodical(50, this)); } } else { if (this.retrieve('mouseover')){ this.store('mouseover', false); $clear(this.retrieve('timer')); } } }.bind(thumbnails); this.events.mousemove.push(mousemove); document.addEvent('mousemove', mousemove); this.slideshow.store('thumbnails', thumbnails); } }); function selectText(elem) { if (document.selection) { var range = document.body.createTextRange(); range.moveToElementText(elem); range.select(); } else if (window.getSelection) { var range = document.createRange(); range.selectNode(elem); window.getSelection().addRange(range); } } function testimonialForm(elem, evt) { if (elem.id == 'State_Other' && evt.type == 'keyup') { if (elem.value.length) { if (document.getElementById('State_or_Province')) document.getElementById('State_or_Province').value = 2 } } else if (elem.id == 'State_or_Province' && evt.type == 'change') { if (document.getElementById('State_Other')) { var stateOther = document.getElementById('State_Other'); if (elem.options[elem.selectedIndex].value == '2') { stateOther.value = ''; stateOther.focus(); } else { stateOther.value=''; } } } } window.addEvent('domready', function() { scQtSetup(); scQtUpdateAll(); }); function getPseudoAttribute(elemRef, attr) { elemRef = typeof(elemRef) == 'object' ? elemRef : document.getElementById(elemRef); if (typeof(elemRef) != 'object') return null; var className = elemRef.className; if (!className) return null; var re = new RegExp(attr + "([^\\s]*)\\s?"); var attrMatch = className.match(re); if (!attrMatch) return null; if (attrMatch[1]) { return attrMatch[1]; } else if (attrMatch[0]) { return attrMatch[0]; } else { return null; } } function scQtBail(trigger, qtOuterDiv, isMultiAdd, noMultiAdd) { scQtHide(qtOuterDiv); if (isMultiAdd && !noMultiAdd) scQtUpdateAll(trigger); } var qtLastIdPrefix; function scQtChange(trigger) { var prodDiv = trigger.getParent('.prod'); if (!prodDiv) return; var prodRnFld = prodDiv.getElement('.prod_rn'); var prodRn = prodRnFld.value; var idPrefix = prodRnFld.id.replace('prod_rn',''); qtLastIdPrefix = idPrefix; var qtyFld = $(idPrefix + 'quantity'); var isMultiAdd = qtyFld.name == 'MULTI_ADD_' + prodRn + '_quantity'; var namePrefix = isMultiAdd ? 'MULTI_ADD_' + prodRn + '_' : ''; var discountsPresent = prodDiv.getElement('input[name=' + namePrefix + 'discounts_present]') ? 1 : 0; var isAddOn = trigger.getParent('.add_on_products'); if (trigger.id == idPrefix + 'quantity' && discountsPresent && !isAddOn) { var qty = trigger.value; if (qty) { qty = parseInt(qty); if (qty) x_sc_get_discount('product',prodRn,0,0,0,0,qty,scQtUpdate); } else { scQtUpdate(trigger); } } else { scQtUpdate(trigger); } } function scQtHide(qtOuterDiv) { qtOuterDiv.setStyle('display','none'); } function scQtSetup() { $$('#sc .prod input, #sc .prod textarea').addEvents({ keyup: function() {scQtChange(this);}, paste: function() {scQtChange(this);} }); $$('#sc .prod input[type="file"], #sc .prod input[type="checkbox"]').addEvent('change', function(){scQtChange(this); return false;}); $$('#sc .prod select, #sc .prod input[type="radio"]').addEvents({ click: function(){scQtChange(this);}, keyup: function(){scQtChange(this);} }); } function scQtShow(qtOuterDiv, prodTotal) { prodTotal = formatCurrency(prodTotal); qtOuterDiv.getElement('.quick_total_total').set('html', '$' + prodTotal + ''); qtOuterDiv.setStyle('display','block'); var modal = qtOuterDiv.getParent('.modal'); if (modal) scModalSize(modal); } function scQtUpdate(trigger, noMultiAdd) { var prodRn; var discountPrice = 0; var discountedQty = 0; var discountedQtyInCart = 0; if ($type(trigger) == 'string') { var discountArray = trigger.split('^^^'); var prodRn = discountArray[0]; discountPrice = discountArray[1]; discountedQty = discountArray[2]; discountedQtyInCart = discountArray[3]; trigger = qtLastIdPrefix.contains(prodRn) ? $(qtLastIdPrefix + 'quantity') : $('P' + prodRn + '_' + 'quantity'); } var prodDiv = trigger.getParent('.prod'); if (!prodDiv) return; var qtOuterDiv = prodDiv.getElement('.quick_total'); if (!qtOuterDiv) return; var qtTotalDiv = qtOuterDiv.getElement('.quick_total_total'); if (!qtTotalDiv) return scQtHide(qtOuterDiv); var prodRnInput = prodDiv.getElement('.prod_rn'); if (!prodRn) prodRn = prodRnInput.value; var prodForm = trigger.getParent('form'); if (!prodForm) return scQtHide(qtOuterDiv); var prodTotal = 0; var opsPrice = 0; var liOpsPrice = 0; var idPrefix = prodRnInput.id.replace('prod_rn',''); var qtyFld = $(idPrefix + 'quantityCopy') || $(idPrefix + 'quantity'); var qty; if (qtyFld.type == 'checkbox') { var qtyMain = 0; var qtyLabel = qtyFld.getParent('label'); if (!qtyLabel) { var qtyWrap = qtyFld.getParent('.add_on_qty_wrap'); if (qtyWrap) qtyLabel = qtyWrap.getElement('label'); } if (qtyLabel && qtyLabel.id) { var qtyMainId = qtyLabel.id.replace(idPrefix + 'ADDON_FOR_',''); qtyMainId = 'P' + qtyMainId + '_quantity'; var qtyMainFld = $(qtyMainId); if (qtyMainFld) { qtyMain = qtyMainFld.type == 'checkbox' && qtyMainFld.checked ? 1 : qtyMainFld.value; } } qty = qtyFld.checked ? qtyMain : 0; } else { qty = qtyFld.value.toFloat(); } var isMultiAdd = qtyFld.name == 'MULTI_ADD_' + prodRn + '_quantity'; var isInModal = qtyFld.getParent('.modal'); var namePrefix = isMultiAdd ? 'MULTI_ADD_' + prodRn + '_' : ''; var basePrice = $(idPrefix + 'b_price'); var optCountFld = $(idPrefix + 'option_count'); var optCount = optCountFld ? optCountFld.value.toInt() : 0; var basePrice = !basePrice ? 0 : basePrice.value.toFloat(); if (isNaN(qty) || !qty) { return scQtBail(trigger, qtOuterDiv, isMultiAdd, noMultiAdd); } if (discountArray) { if (discountedQty) { prodDiv.getElement('input[name=' + namePrefix + 'discount_price]').value = discountPrice; prodDiv.getElement('input[name=' + namePrefix + 'discounted_qty]').value = discountedQty; prodDiv.getElement('input[name=' + namePrefix + 'discounted_qty_in_cart]').value = discountedQtyInCart; } else { prodDiv.getElement('input[name=' + namePrefix + 'discount_price]').value = 0; prodDiv.getElement('input[name=' + namePrefix + 'discounted_qty]').value = 0; prodDiv.getElement('input[name=' + namePrefix + 'discounted_qty_in_cart]').value = 0; } } var optsHandled = 0; var optIndex = 0; while(optsHandled != optCount) { val = 0; isPercentage = 0; fld = prodDiv.getElements('*[name=' + namePrefix + 'option_' + optIndex + ']'); if (fld && fld.length) { var isPerLineItem = fld.getParent('.opt_calculate2') != ''; if (fld.length == 1) fld = fld[0]; if (prodForm['saved_option_' + (optIndex)] && prodForm['saved_option_' + (optIndex)].value.length > 0) fld = prodForm['saved_option_' + (optIndex)]; optQtyFld = prodDiv.getElementById(idPrefix + 'QTY_option_' + (optIndex)); if (optQtyFld) { optQty = optQtyFld.nodeName == 'SELECT' ? optQtyFld.options[optQtyFld.options.selectedIndex].value : optQtyFld.value; } else { optQty = 1; } if (!fld.nodeName) { x=0; while (opt = fld[x]) { if (opt.checked) val = parseFloat(getPseudoAttribute(opt, 'qt_price-')); isPercentage = getPseudoAttribute(opt, 'qt_percentage'); if (val > 0) break x++; } } else if (fld.nodeName == 'SELECT') { val = parseFloat( getPseudoAttribute(fld.options[fld.options.selectedIndex], 'qt_price-') ); isPercentage = getPseudoAttribute(fld.options[fld.options.selectedIndex], 'qt_percentage'); } else if (fld.hasClass('opt_var_price')) { val = parseFloat(fld.value); isPercentage = 0; } else if ( ( (fld.type == 'text' || fld.type == 'textarea' || fld.type == 'file') && fld.value.length > 0 ) || ( fld.type == 'checkbox' && fld.checked ) || ( fld.type == 'radio' && fld.checked ) || ( fld.type == 'hidden' && optQty ) ) { val = parseFloat(getPseudoAttribute(fld, 'qt_price-')); isPercentage = getPseudoAttribute(fld, 'qt_percentage'); } else { val = 0; isPercentage = 0; } if (!val) val = 0; val *= optQty; if (fld.nodeName) { pricePoint = getPseudoAttribute(fld, 'qt_price_point-'); if (pricePoint == 'char' || pricePoint == 'char_spaces') { if (pricePoint == 'char_spaces') { val *= fld.value.length; } else if (pricePoint == 'char') { val *= fld.value.replace(/\s/g,'').length; } } } if (isPercentage == '1') { percentOpts[percentOpts.length] = val; } else if (isPerLineItem) { liOpsPrice += val; } else { opsPrice += val; } } else if (prodDiv.getElements('*[name=' + namePrefix + 'option_' + optIndex + '\[0\]]')) { var choiceIndex = 0; while (fld = prodDiv.getElement('*[name="' + namePrefix + 'option_' + optIndex + '[' + choiceIndex + ']"]')) { if (fld.type == 'hidden') { val = parseFloat(getPseudoAttribute(fld, 'qt_price-')); optQtyFld = prodDiv.getElementById(idPrefix + 'QTY_option_' + optIndex + '_' + choiceIndex); if (optQtyFld) { if (optQtyFld.type == 'text') { optQty = parseFloat(optQtyFld.value); } else if (optQtyFld.nodeName == 'SELECT') { optQty = optQtyFld.options[optQtyFld.options.selectedIndex].value; } if (optQty > 0) { val = val * optQty; } else { val = 0; } } } else if (fld.type == 'checkbox') { val = fld.checked ? parseFloat(getPseudoAttribute(fld, 'qt_price-')) : 0; } if (isNaN(val)) val = 0; if (isPerLineItem) { liOpsPrice += val; } else { opsPrice += val; } choiceIndex++; } } optsHandled++; optIndex++; } var discountedQty = prodDiv.getElement('input[name=' + namePrefix + 'discounted_qty]'); discountedQty = discountedQty && discountedQty.value ? discountedQty.value.toInt() : 0; if (discountedQty) { if (discountedQty >= qty) discountedQty = qty; var discountPrice = prodDiv.getElement('input[name=' + namePrefix + 'discount_price]'); if (!isNaN(discountPrice.value)) { discountPrice = discountPrice.value.toFloat(); } else { discountPrice = basePrice; } var discountedQtyInCart = parseInt(prodDiv.getElement('input[name=' + namePrefix + 'discounted_qty_in_cart]').value); if (isNaN(discountedQtyInCart)) discountedQtyInCart = 0; var regPriceQty = qty - discountedQty; var discountedTotal = (opsPrice + discountPrice) * discountedQty; var regTotal = (opsPrice + basePrice) * regPriceQty; prodTotal = discountedTotal + regTotal; prodTotal += liOpsPrice; } else { prodTotal = basePrice + opsPrice; if (qty) { prodTotal *= qty; } else { prodTotal = 0; } prodTotal += liOpsPrice; } if (qty.toString().length > 14) prodTotal = basePrice; if (prodTotal == 0 || (prodTotal == basePrice && !isMultiAdd && !isInModal)) { scQtHide(qtOuterDiv); } else { scQtShow(qtOuterDiv, prodTotal); } if (isMultiAdd && !noMultiAdd) scQtUpdateAll(trigger); if (!isNaN(prodTotal)) { return prodTotal; } else { return 0; } } function scQtUpdateAll() { var qtyFlds = $$('.qty'); var grandTotal = 0; var quickTotalMultiDiv = $$('.multi_add_footer .quick_total'); var isMultiAdd = quickTotalMultiDiv.length > 0; qtyFlds.each( function(qtyFld) { if (isMultiAdd) { prodTotal = scQtUpdate(qtyFld, true); if (!isNaN(prodTotal)) grandTotal += prodTotal; } else { scQtChange(qtyFld); } } ); if (grandTotal) scQtShow(quickTotalMultiDiv, grandTotal); } window.addEvent('domready', function() { scStoreSetup(); }); window.addEvent('load', function() { scSmartFloatSetup(); }); (function($){ $(document).ready(function(){ scCarouselSetup(); scCartFormSetup(); scLightboxSetup(); }); $(window).load(function(){ }); function scCarouselSetup() { $('.sc_carousel').each(function(){ var csl = $(this); var prodXtraMode; var opItems = parseInt(csl.attr('data-csl-items')) || 3; var opAutoWidth = false; var opResponsive = {}; var opMargin = 0; var opAutoplay = csl.attr('data-csl-autoplay') == 1; var opLoop = csl.attr('data-csl-loop') == 1; var opAutoplayHoverPause = opAutoplay ? true : false; var opLazyLoad = csl.attr('data-csl-lazyload') == 1; var opNav = csl.attr('data-csl-nav') != 0; var opAnimateOut= csl.attr('data-csl-animateout') || false; var prodOuter = csl.parents('.prod_img_outer'); var res = csl.attr('data-csl-responsive'); if (res) { var resPieces = res.split(','); var resOpt; $.each(resPieces, function(i, value) { resOpt = value.split(':'); opResponsive[resOpt[0]] = {items: parseInt(resOpt[1])}; }); } if (csl.hasClass('prod_img1')) { prodXtraMode = 1; opItems = 1; opAnimateOut = 'fadeOut'; } else if (prodOuter.hasClass('prod_img2')) { prodXtraMode = 2; opNav = false; var mainImgA = prodOuter.find('.prod_img a').first(); var xtraImgsA = csl.find('a'); csl.find('a').on('click', function(evt){ evt.preventDefault(); evt.stopImmediatePropagation(); var xtraImgA = $(this).first(); var xtraImgAHref = xtraImgA.attr('href'); var xtraImg = xtraImgA.find('img').first(); var xtraImgSrc = xtraImg.attr('src'); var mainImg = mainImgA.find('img').first(); var mainImgAHref = mainImgA.attr('href'); mainImg .attr('src', xtraImgA.attr('data-csl-reg-img')); mainImgA.attr('href',xtraImgAHref); mainImgA.attr('data-csl-img-thumb', xtraImgSrc); xtraImgA.attr('href',mainImgAHref); }) } else if (csl.hasClass('opt_carousel')) { opItems = 6; } var opAutoWidth = prodXtraMode == 2; if (csl.hasClass('opt_carousel')) { var imgCount = csl.find('img').length; opMargin = 10; var inModal = $(csl).parents('.modal').length; if (inModal) { opItems = 4; } else { opResponsive = {0:{items: 4},320:{items: 4},380:{items: 5},420:{items: 6},480:{items: 7},560:{items: 5},750:{items: 6},780:{items: 7},890:{items: 8},1045:{items: 9}}; for (prop in opResponsive) { if (prop < 750 && opResponsive[prop].items > imgCount) opResponsive[prop].items = imgCount; } } } csl.owlCarousel({ nav: opNav, items: opItems, autoWidth: opAutoWidth, autoplay: opAutoplay, loop: opLoop, autoplayHoverPause: opAutoplayHoverPause, lazyLoad: opLazyLoad, animateOut: opAnimateOut, margin: opMargin, responsive: opResponsive }); }); } function scCartFormSetup() { var cartForm = $('form#cart'); if (cartForm.length) { var formAction = cartForm.attr('action'); var shipEstZip = $('#Ship_Est_Postal_Code'); if (shipEstZip.length) { shipEstZip.on('touchstart', function(){cartForm.removeAttr('action')}); shipEstZip.on('blur', function(){cartForm.attr('action',formAction)}); shipEstZip.on('keypress', function(evt){ var code = evt.keyCode || evt.which; if (code == 13) { scShipEstGet(); evt.preventDefault(); evt.stopImmediatePropagation(); return false; } }); } } } function scLightboxSetup() { var links = $('a[data-rel]'); if (!links.length) return; links.each(function(){ var link = $(this); if (link.hasClass('setup')) return; var dataRel = link.attr('data-rel'); if(dataRel.indexOf('[') != -1) { grpLinks = $('a[data-rel="' + dataRel + '"]'); grpLinks.magnificPopup({ type: 'image', gallery: { enabled: grpLinks.length > 1 } }); grpLinks.addClass('setup'); } else { link.magnificPopup({type: 'image'}); link.addClass('setup'); } }); } })(jQuery); function acctForm(elem, evt) { if (elem.id == 'State_Other' && evt.type == 'keyup') { if (elem.value.length) { if (document.getElementById('State_or_Province')) document.getElementById('State_or_Province').value = 2 } } else if (elem.id == 'State_or_Province' && evt.type == 'change') { if (document.getElementById('State_Other')) { var stateOther = document.getElementById('State_Other'); if (elem.options[elem.selectedIndex].value == '2') { stateOther.value = ''; stateOther.focus(); } else { stateOther.value=''; } } } } function addrForm(elem, evt) { if (elem.id == 'Bill_State_Other' && evt.type == 'keyup') { if (elem.value.length) { if (document.getElementById('Bill_State_or_Province')) document.getElementById('Bill_State_or_Province').value = 2 } } else if (elem.id == 'Ship_State_Other' && evt.type == 'keyup') { if (elem.value.length) { if (document.getElementById('Ship_State_or_Province')) document.getElementById('Ship_State_or_Province').value = 2 } } else if (elem.id == 'Bill_State_or_Province' && evt.type == 'change') { if (document.getElementById('Bill_State_Other')) { var stateOther = document.getElementById('Bill_State_Other'); if (elem.options[elem.selectedIndex].value == '2') { stateOther.value = ''; stateOther.focus(); } else { stateOther.value=''; } } } else if (elem.id == 'Ship_State_or_Province' && evt.type == 'change') { if (document.getElementById('Ship_State_Other')) { var stateOther = document.getElementById('Ship_State_Other'); if (elem.options[elem.selectedIndex].value == '2') { stateOther.value = ''; stateOther.focus(); } else { stateOther.value=''; } } } } function scAddressCopy(evt) { evt.stop(); var form = document.address_form; var billFldId, shipFldId, billFld, shipFld; for(x=0; x < form.elements.length; x++) { billFldId = form.elements[x].id; billFld = form.elements[x]; if (billFldId.indexOf('Bill_') != -1) { shipFldId = billFldId.replace('Bill_','Ship_'); shipFld = document.getElementById(shipFldId); if (shipFld) { shipFld.value = billFld.value; if (shipFldId == 'Ship_Country' || shipFldId == 'Ship_State_or_Province') shipFld.fireEvent('change'); } } } } // - list: Array the list of elements to autocomplete from // - mode: string the autocomplete mode ('tag' or 'text'), default 'text' // - render: function(value) the function called when rendering an element from the list // - set: function(value) the function called when putting an element from the list into the input element (detauls to the get function) function MooComplete(element, options) { options = options || {}; var list = options.list || []; this.setList = function(l) { list = l; } if (!options.filters) { options.filters = [ function(o, v) { return (o.indexOf(v) == 0); }, function(o, v) { return ((v.length > 1) && (o.indexOf(v) > 0)); } ]; } options.size = options.size || 10; options.mode = options.mode || 'text'; options.showonkeydown = (typeof options.showonkeydown == 'undefined') ? true : false; if (!options.render) { options.render = function(v) { return new Element('span', { 'text': v }); }; } if (!options.get) { options.get = function(v) { return v; }; } if (!options.set) { options.set = options.get; } element = typeOf(element)==='string' ? $(element) : element; element.setAttribute('autocomplete', 'off'); element.setAttribute('autocorrect', 'off'); element.setAttribute('autocapitalize', 'off'); var xtraClass = options.xtraClass ? options.xtraClass : ''; var box = new Element('div', { 'class': 'moocomplete ' + xtraClass, 'styles': { 'position': 'absolute', 'display': 'none' } }).inject(document.body); var old, hover = -1, hiding = false, suggestions = 0; function position() { box.setStyles({ 'width': (element.getWidth() - 2) + 'px', 'top': (element.getCoordinates().top + element.getHeight()) + 'px', 'left': element.getCoordinates().left +'px' }); } window.addEvent('resize', position); function getNeedle() { if (options.mode === 'tag') { element.store('input_value', element.get('value').substring(0, element.get('value').lastIndexOf(',') + 1)); return element.get('value').substr(element.get('value').lastIndexOf(',') + 1 || 0).toLowerCase().trim(); } else { return element.get('value').toLowerCase(); } } function showSuggestions(noEmpty) { var v = getNeedle(); if ((v.length == 0) && !noEmpty) { box.setStyle('display', 'none'); return; } suggestions = 0; box.empty(); options.filters.each(function(f) { if (suggestions == options.size) { return; } list.every(function(o) { if (f(options.get(o).toLowerCase(), v)) { var li = suggestions++; box.adopt(new Element('div', { 'events': { 'mousemove': function() { if (!hiding) { hover = li; showHover(); } } } }).adopt(options.render(o)).store('val', o)); if (suggestions == options.size) { return false; } } return true; }); }); position(); if (suggestions > 0) { box.setStyle('display', 'block'); } else { box.setStyle('display', 'none'); } } this.showSuggestions = showSuggestions; function showHover() { var c = box.getChildren(); c.removeClass('hovered'); if (hover >= 0) { c[hover].addClass('hovered'); if (options.mode==='tag') { element.set('value', element.retrieve('input_value') + options.set(c[hover].retrieve('val'))); } else { element.set('value', options.set(c[hover].retrieve('val'))); } } } element.addEvents({ 'keydown': function(e) { if (box.getStyle('display') == 'none') { if (options.showonkeydown && (e.code == 40)) { showSuggestions(true); } return; } if (e.code == 38) { if (hover >= 0) { if (hover == 0) { element.set('value', options.set(old)); } --hover; showHover(); } } else if (e.code == 40) { if (hover < (suggestions - 1)) { ++hover; showHover(); } } else { hover = -1; } }, 'keyup': function(e) { if (e.code == 27) { box.setStyle('display', 'none'); } else if ((e.code != 38) && (e.code != 40)) { old = element.retrieve('val'); if (e.code != 13) { showSuggestions(); } else { box.setStyle('display', 'none'); } } }, 'focus': function() { hiding = false; if (box.getStyle('display') == 'none') { showSuggestions(); } }, 'blur': function() { hover = -1; old = element.retrieve('val'); hiding = true; (function() { box.setStyle('display', 'none'); }).delay(100); }, 'mousemove': function() { if (hover >= 0) { element.set('value', options.set(old)); hover = -1; showHover(); } } }); } function scAutoComplete(fld, list, setFunc, showLength) { fld.addEvent('keyup', function(){ if (!showLength || fld.value.length >= showLength) { $$('.moocomplete').setStyle('opacity',1) } else { $$('.moocomplete').setStyle('opacity',0) } }); fld.addEvent('keydown', function(event) { if (event.key == 'enter') { event.preventDefault(); return false; } }); fld.mooList = []; opts = { list: fld.mooList, size: 1000, xtraClass: 'moocomplete_' + fld.id } if (typeOf(setFunc) === 'function') { opts.set = function(val) {setFunc(fld, val); return fld.value; } } fld.mooComplete = new MooComplete( fld.id, opts ) if (typeOf(list) == 'function') { fld.addEvent('keyup', function(event){ if (event.key != 'down' && event.key != 'up' && event.key != 'enter') list(fld); fld.lastKey = event.key; }); list(fld); } else { fld.mooComplete.setList(list); } } function scAutoCompleteUpdate(fld, list) { fld.mooComplete.setList(list); var activeElement = document.activeElement; if (activeElement && activeElement.id == fld.id && fld.lastKey != 'enter') fld.mooComplete.showSuggestions(); } function payMethodOn(fldId,methodType) { radio = document.getElementById(fldId); if (radio.type == 'radio') radio.checked = 1; paySectionOn(methodType); } function paySectionOn(methodType) { var ccSection = $('pay_cc'); var echeckSection = $('pay_echeck'); var poSection = $('pay_purchase_order'); var payBtn = $('place_order_btn_link'); if (ccSection && ccSection.className) ccSection.className = ccSection.className.replace('sc_show','sc_hide'); if (echeckSection && echeckSection.className) echeckSection.className = echeckSection.className.replace('sc_show','sc_hide'); if (poSection && poSection.className) poSection.className = poSection.className.replace('sc_show','sc_hide'); if (methodType) { if (methodType == 'cc') ccSection.className = ccSection.className.replace('sc_hide','sc_show'); if (methodType == 'echeck') echeckSection.className = echeckSection.className.replace('sc_hide','sc_show'); if (methodType == 'purchase_order') poSection.className = poSection.className.replace('sc_hide','sc_show'); if (typeof(Braintree) !== 'undefined') { var payForm = ccSection.getParent('form'); if (methodType != 'cc') payBtn.addEvent('click', function(evt) {payForm.submit();}); } if (payGwyUsesIframe && payHideSubmit && methodType == 'cc') { payBtn.setStyle('display', 'none'); } else { payBtn.setStyle('display',''); } } } function scAdminLinkClasses() { $$('.sc_admin_edit, .sc_smaller').each(function(btn) {btn.setStyle('font','normal 10px Arial');}); } function scButtonClasses() { $$('.btn').each( function(btn) { if (!btn.hasClass('btn_tiny') && !btn.hasClass('btn_bigger') && !btn.hasClass('btn_smaller')) btn.addClass('btn_reg'); } ); } function scCheckCookies() { } function scDisableAutoComplete() { var flds = $$('.qty, #card_number, #id_number, #bank_routing_number, #bank_account_number'); if (flds) flds.setProperty('autocomplete','off'); } function scDisableSubmitBtn(evt, btn) { if (btn.hasClass('btn_no_disable') || !$('sc').hasClass('btn_wait_toggle')) return; if (btn.hasClass('btn_checkout')) { btn.addClass('btn_please_wait'); btn.oldHTML = btn.get('html'); btn.set('html','Please Wait...'); return; } var btnSizeClass = 'btn_reg'; if (btn.hasClass('btn_smaller')) { btnSizeClass = 'btn_smaller'; } else if (btn.hasClass('btn_bigger')) { btnSizeClass = 'btn_reg'; } else if (btn.hasClass('btn_tiny')) { btnSizeClass = 'btn_tiny'; } var waitBtn = new Element('a', {'class': btnSizeClass + ' btn btn_please_wait', 'html': 'Please Wait...', id: btn.id + '_' + 'wait'}); var btnSize = btn.getSize(); waitBtn.inject(btn,'after'); var borderLeftWidth = waitBtn.getStyle('border-left-width'); var borderRightWidth = waitBtn.getStyle('border-right-width'); borderLeftWidth = borderLeftWidth.replace('px','').toInt(); borderRightWidth = borderRightWidth.replace('px','').toInt(); var borderWidth = borderLeftWidth + borderRightWidth; waitBtn.setStyle('width', btnSize.x - borderWidth + 'px'); waitBtn.setStyle('margin', btn.getStyle('margin')); btn.addClass('sc_hide'); } function scHideToolTip(tipId) { var tipElem = document.getElementById(tipId); if (tipElem) tipElem.onmouseout(); } var popupLinkConfig = new Array; popupLinkConfig["medium_popup"] = new Array ( "", "width=625,height=400,scrollbars=1,menubar=1,resizable=1"); function scInitPopupLinks() { if (!document.getElementsByTagName) return true; var pageLinks = document.getElementsByTagName("a"); for (var i = 0; i < pageLinks.length; i++) { if (((pageLinks[i].className != null) && (pageLinks[i].className != "")) || ((pageLinks[i].parentNode.className != null) && (pageLinks[i].parentNode.className != ""))) { var linkClass = " " + pageLinks[i].className + " "; if ((linkClass == " ") && (pageLinks[i].parentNode.className != "")) { linkClass = " " + pageLinks[i].parentNode.className + " "; } for (var theKey in popupLinkConfig) { if (linkClass.indexOf(" " + theKey + " ") > -1) { if ((pageLinks[i].target == "") || (pageLinks[i].target == null)) { pageLinks[i].target = (popupLinkConfig[theKey][0] != "") ? popupLinkConfig[theKey][0] : theKey; } pageLinks[i].settings = popupLinkConfig[theKey][1]; pageLinks[i].onclick = scPopUp; } } } } return true; } function scMicroTimes() { var microTimes = $$('.microtime'); if (microTimes.length) { microTimes.each( function(microTime) { microTime.value += ( $random(1,1000)); } ); } } function scOnLoad() {} var payHideSubmit, payGwyUsesIframe; function scPayFormSetup() { var payBtn = $('place_order_btn_link'); if (!payBtn) return; payGwyUsesIframe =
Warning: count(): Parameter must be an array or an object that implements Countable in /home3/atlants1/public_html/squirrelcart/functions/db/sc_query.func.php on line 117
false; payHideSubmit =
Warning: count(): Parameter must be an array or an object that implements Countable in /home3/atlants1/public_html/squirrelcart/functions/db/sc_query.func.php on line 117
false; var payMethod = $$('.pay_method_row input[type="radio"]:checked'); var payType = ''; if (payMethod[0]) payType = payMethod[0].getAttribute('data-paytype'); paySectionOn(payType); var nonCCPresent = false; $$('.pay_method_row input').each(function(payMethod){ if (payMethod.getAttribute('data-paytype') != 'cc') { nonCCPresent = true; } }); if (payGwyUsesIframe) { if (!nonCCPresent) { $('pay_methods').addClass('sc_hide'); var payMethod1 = $$('.pay_method_row input'); payMethod1[0].checked = true;; paySectionOn('cc'); } } } function scPopUp() { newWin = window.open(this.href, this.target, this.settings); newWin.focus(); return false; } function scProdOptsFileChange(changeLink) { var optId = changeLink.id.replace('change_',''); var savedOptId = optId.replace('_option','_saved_option'); var savedDiv = $(optId + '_saved_div'); savedDiv.removeClass('sc_show'); savedDiv.addClass('sc_hide'); $(optId + '_edit_div').removeClass('sc_hide') $(savedOptId).value = ''; } function scProdOptsSetup() { $$('.change_file_option').addEvent('click', function() {scProdOptsFileChange(this); return false;}); $$('.prod_options input[maxlength!=-1], textarea.maxlength').addEvents({ keyup: function() {scShowCharLimit(this); return false;}, paste: function() {scShowCharLimit(this); return false;} }); var selectables = $$('.prod_options select, .prod_options input[type=radio], .prod_options input[type=checkbox]'); if (selectables.length) { selectables.addEvent('change', function() { scSelectOpt(this.id, this.value, this); }); selectables.each(function(fld){ if ((fld.nodeName == 'INPUT' && fld.checked) || fld.nodeName == 'SELECT') scSelectOpt(fld.id, fld.value) }); } } function scShowCharLimit(fld) { var charLimitSpan = $(fld.id + '_chars_left'); var charLimitOuter = $(fld.id + '_chars_left_outer'); var maxLength = fld.nodeName == 'TEXTAREA' ? $(fld.id + '_max_length').value : fld.get('maxlength'); if (!fld.value) { charLimitOuter.setStyle('display','none'); return; } if (!maxLength) return; var charsLeft = maxLength - fld.value.length; charLimitSpan.set('html', charsLeft > 0 ? charsLeft : 'No'); if (charsLeft < 0) fld.value = fld.value.substr(0,maxLength); charLimitOuter.setStyle('display','block'); if (!fld.hasClass('charLimitSetup')) { var modal = fld.getParent('.modal'); if (modal) { scModalSize(modal); fld.addClass('charLimitSetup'); } } } function scShowToolTip(tipId) { var tipElem = document.getElementById(tipId); if (tipElem) tipElem.onmouseover(); } function scSmartFloatSetup() { window.addEvent('resize', function(){scSmartFloatAdjustAll();}); scSmartFloatAdjustAll(); } function scSmartFloatAdjustAll() { $$('.smart_float').each(function(sf){scSmartFloatAdjust(sf)}); } function scSmartFloatAdjust(sf) { var sfLeft = sf.getElement('.left'); var sfRight = sf.getElement('.right'); if (!sfLeft || !sfRight) return; var sfImg = sfLeft.getElement('img'); var sfText = sfRight.getElement(':first-child'); if (!sfImg || !sfText) return; var sfWidth = sf.getSize().x; var sfImgSize = sfImg.getSize(); var sfImgWidth = sfImgSize.x; var sfImgHeight = sfImgSize.y; var sfTextHeight = sfText.getSize().y; sfImgWidthPercent = sfImgWidth / sfWidth * 100; sf.removeClass('wrap'); sf.removeClass('wrap_all'); if (sfImgWidthPercent > 65) { sf.addClass('wrap_all'); } else if (sfTextHeight > sfImgHeight) { sf.addClass('wrap'); } } var isIOS = false; function scStoreSetup() { scMaskSetup(); scCheckCookies(); scInitPopupLinks(); scMicroTimes(); scPayFormSetup(); scProdOptsSetup(); scDisableAutoComplete(); scThemeChooserSetup(); scButtonClasses(); ssoSetup(); scBdayFieldSetup(); scAddressFieldSetup(); scProdFormSetup(); scModalSetup(); scShipEstSetup(); $$('.date_wrap, .datetime-local_wrap').addEvent('click', function(){this.getElement('input').focus()}); $$('.btn_same_as_billing').addEvent('click',function(evt) {scAddressCopy(evt);}); var scDiv = $('sc'); if (scDiv && !scDiv.hasClass('btns_old')) $$('button.btn[type=submit], input.btn[type=submit], .btn_disable_on_click').addEvent('click',function(evt) {scDisableSubmitBtn(evt,this);}); $$('.error_field').addEvent('change',function() {this.removeClass('error_field')}); } var scMask; function scMaskSetup() { var scDiv = $('sc'); if (!scDiv) return; scMask = $('sc_mask'); if (!scMask) { scMask = new Element('div', {id: 'sc_mask'}); scMask.inject(scDiv); } } function scMaskShow(forceScrollFix) { scMask.setStyle('display','block'); var html = $(document.documentElement); var body = $$('body'); var htmlBeforeX = html.clientWidth; var isBadSafari = 'Unknown' == 'sf' && '0' == '0'; html.addClass('modal_is_open'); if (!isBadSafari || window.getSize().x < 1030 || forceScrollFix) { var top = window.pageYOffset || document.documentElement.scrollTop; html.oldTop = top; html.setStyle('top', '-' + top + 'px'); html.addClass('ios_scroll_fix'); } body.oldMarginRight = body.getStyle('margin-right'); if (html.clientWidth > htmlBeforeX) { body.setStyle('margin-right', (html.clientWidth - htmlBeforeX) + 'px'); } } function scMaskHide() { if (scMask.getStyle('display') == 'none') return; scMask.setStyle('display','none'); var html = $(document.documentElement); var body = $$('body'); html.removeClass('modal_is_open'); html.removeClass('ios_scroll_fix'); body.setStyle('margin-right',body.oldMarginRight); if (html.oldTop) window.scrollTo(0,html.oldTop); } function scProdFormSetup() { var addOnQtys = $$('.add_on_products input.qty[type=number]'); if (addOnQtys.length) { addOnQtys.addEvent('keyup', function(){ if (this.id.contains('Copy')) { var qtyId = this.id.replace('Copy',''); var qtyFld = $(qtyId); if (qtyFld) qtyFld.value = this.value; } }); } $$('.prod_detail form, .prod_thumb form').addEvent('submit', function(evt){ return scProdFormSubmit(this, evt);}); var scAddOnMsgs = $$('.add_on_products .cat_products .sc_msg'); scAddOnMsgs.each(function(msg){ var msgX = new Element('a', {href: '#', class: 'sc_msg_close'}); msgX.inject(msg); msgX.addEvent('click', function(){this.getParent('.sc_msg').addClass('sc_hide'); return false}); }); } function scProdFormSubmit(prodForm, evt) { var modalAddOns = $('modal_add_ons'); if (modalAddOns && !modalAddOns.yes_clicked && !modalAddOns.no_clicked) { var addOns = $$('.add_on_products'); if (addOns.length) { addOns = addOns[0]; var prodRn = addOns.id.replace('add_ons_',''); if ($('updating_item_' + prodRn)) return true; var addOnsChecked = addOns.getElement('.qty:checked'); if (addOnsChecked) return true; var addOnQtys = addOns.getElements('input.qty[type=number]'); if (addOnQtys.length) { for(x=0; x < addOnQtys.length; x++) { if (addOnQtys[x].value) return true; } } scModalShow(modalAddOns); return scProdFormSubmitStop(prodForm); } } var modalThumbOpts = prodForm.getElement('.modal_prodthumb_opts'); if (modalThumbOpts) { if (modalThumbOpts.hasClass('show')) { return true; } else { scModalShow(modalThumbOpts); return scProdFormSubmitStop(prodForm); } } return true; } function scProdFormSubmitStop(prodForm) { $$('.btn_please_wait').setStyle('display','none');; $$('.btn_add_to_cart').removeClass('sc_hide'); return false; } function scSelectOpt(fldId, fldValue, trigger, fireClick) { var fld = $(fldId); var radioFix; if (!fld) { fld = $(fldId + fldValue); if (fld.type == 'radio') radioFix = true; } if (!fld) return; var triggerCheckBox = trigger && trigger.type=='checkbox'; var noSelectImg = triggerCheckBox && !fld.checked; if (fld.nodeName == 'INPUT' && (fld.type == 'radio' || fld.type == 'checkbox')) { if (!triggerCheckBox) fld.set('checked',true); } else { fld.set('value', fldValue); } if (fireClick) fld.fireEvent('click'); var optImgAID; optImgAID = fldId + '_' + fldValue + '_img'; if (fld.type == 'radio' && !radioFix) optImgAID = fldId.replace('-','-_') + '_img'; var optImgA = $(optImgAID); if (optImgA) { var optImgParent; if (fld.type == 'radio') { optImgParent = optImgA.getParent('.radios'); } else { optImgParent = optImgA.getParent('.opt_carousel'); } if (optImgParent) optImgParent.getElements('a').removeClass('selected'); if (!noSelectImg) optImgA.addClass('selected'); } } var scModalA; function scModalAlert(text, title, ok) { if (!scModalA) { scModalA = new Element('div', {id: 'modal_js', class: 'modal modal_closeable'}); if (title) { var h4 = new Element('h4');; h4.inject(scModalA); } var modalInner = new Element('div', {class: 'inner' }); modalInner.inject(scModalA); scModalA.inject($('sc')); } if (ok) text += '
'; scModalA.getElement('.inner').set('html', text); scModalA.getElement('h4').set('html', title); scModalA.removeClass('setup'); scModalSetup(); scModalShow(scModalA); } function scModalClose(modal) { modal.removeClass('show'); var modalReturn = modal.getParent('.modal_return'); if (modalReturn) { var modalBack = $(modalReturn.getAttribute('data-modal-return')); scModalShow(modalBack); } else if (modal.hasClass('modal_backable')) { var modalBack = $(modal.getAttribute('data-modal-back')); scModalShow(modalBack); } else { scMaskHide(); } } function scModalCloseAll() { $$('.modal').removeClass('show'); scMaskHide(); } function scModalSetup() { scModalTipSetup(); var modals = $$('.modal:not(".setup")'); var modal; if (modals.length) { for(x=0; x < modals.length; x++) { modal = modals[x]; modal.addClass('setup'); if (modal.hasClass('modal_closeable')) { modalX = new Element('a', {href: '#', class: 'modal_close modal_closex'}); modalX.inject(modal); } window.addEvent('resize',function(){ $$('.modal.show').each(function(modal){ scModalSize(modal); }); }); modal.getElements('.btn_select_fld').addEvent('click', function(){ var fldId = this.getAttribute('data-field-id'); var fldValue = this.getAttribute('data-field-value'); scSelectOpt(fldId, fldValue, 0, true); }); } } $$('.modal_close').addEvent('click', function(){ scModalClose(this.getParent('.modal')); if (this.getAttribute('href') == '#') return false; }); $$('.modal .btn_yes').addEvent('click', function(){ modal.yes_clicked = true; }); $$('.modal .btn_no').addEvent('click', function(){ modal.no_clicked = true; }); $$('#modal_add_ons .btn_yes').addEvent('click', function(){ var addOns = $$('.add_on_products'); if (addOns.length) { addOns.addClass('add_ons_review'); } }); $$('.modal_addon_opts .modal_ok').addEvent('click', function() { var modal = this.getParent('.modal'); var qtyId = modal.id.replace('opts_modal','quantity'); var qty = $(qtyId); qty.checked = true; scModalClose(modal); modal.addClass('add_on_selected'); return false; }); $$('.modal_addon_opts .modal_cancel').addEvent('click', function() { var modal = this.getParent('.modal'); var qtyId = modal.id.replace('opts_modal','quantity'); var qty = $(qtyId); var qtyFldCopy = $(qtyId + 'Copy'); qty.checked = false; if (qtyFldCopy) { qtyFldCopy.value = ''; qtyFldCopy.fireEvent('keyup'); } scModalClose(modal); modal.removeClass('add_on_selected'); return false; }); $$('.modal_open').addEvent('click', function(evt){ var modalId = this.getAttribute('data-modal'); if (modalId) { var modal = $(modalId); if (modal) { scModalShow(modal); evt.cancelBubble=true; evt.stop(); return false; } else { return true; } } }); scMask.addEvent('click',function(){scModalCloseAll();}); } function scModalFixIE(modal) { var modalSize = modal.getSize(); var modalLeft = Math.round(modalSize.x/2); var modalTop = Math.round(modalSize.y/2); modal.setStyle('-ms-transform', 'translate(-' + modalLeft + 'px, -' + modalTop + 'px)'); modal.setStyle('transform', 'translate(-' + modalLeft + 'px, -' + modalTop + 'px)'); } function scModalSize(modal, stripWrapHeight) { if (!modal || !modal.getElement) return; var title = modal.getElement('h4'); var inner = modal.getElement('.inner'); if (title && inner) { inner.setStyle('height','auto'); var modalSize = modal.getSize(); modalSize.y -= title.getSize().y; inner.setStyle('height', modalSize.y + 1); if (stripWrapHeight) modal.getElements('.lazy_load_wrap img').setStyle('height','auto'); } scModalFixIE(modal); } function scModalShow(modal, skipLazyLoad) { scModalCloseAll(); $(document.body).fireEvent('click') var isLazyLoad = false; if (!skipLazyLoad) { var imgs = $(modal).getElements('img'); var img, src; if (imgs.length) { for(x=0; x < imgs.length; x++) { img = imgs[x]; src = img.getAttribute('data-src'); if (src) { img.setAttribute('src',src); img.removeAttribute('data-src'); isLazyLoad = img; } } if (isLazyLoad) isLazyLoad.addEvent('load',function(){scModalSize(isLazyLoad.getParent('.modal'), 1);}); } } modal.getElement('.inner').scrollTo(0,0); modal.addClass('show'); modal.shown = true; scMaskShow(); scModalSize(modal); } function scModalTipSetup() { if (window.getSize().x > 1045 && !isIOS) return; var scDiv = $('sc'); if (!scDiv) return; var tips = $$('.ico_info.tip, .tip_modal.tip'); if (!tips.length) return; var tip, modalId, modal, modalInner, modalTitle, modalParent, modalBackClass, modalBackBtn; for(x=0; x < tips.length; x++) { tip = tips[x]; if (!tip.title) continue; modalId = 'modal_dyn_' + x; tip.addClass('modal_open'); tip.setAttribute('data-modal', modalId); modalParent = tip.getParent('.modal'); if (modalParent) modalBackClass = 'modal_backable'; modal = new Element('div', {id: modalId, class: 'modal modal_info modal_closeable ' + modalBackClass}); if (modalParent) modal.setAttribute('data-modal-back', modalParent.id); modalTitle = new Element('h4'); modalTitle.inject(modal); modalInner = new Element('div', {class: 'inner', html: tip.title + '
'}); modalBackBtn = new Element('a', {class: 'modal_back modal_close', href: '#', text: 'Back'}); modalBackBtn.inject(modalTitle); modalInner.inject(modal); modal.inject(scDiv); } } var scCountriesByAlpha2 = new Object(); var scStatesByAbbrev = new Object(); scCountriesByAlpha2 = { US: '180', SX: '252', CW: '251', }; scStatesByAbbrev = { C180_AL: '3', C180_AZ: '5', C180_AR: '6', C180_CA: '7', C180_CO: '8', C180_CT: '9', C180_DE: '10', C180_DC: '11', C180_FL: '12', C180_GA: '13', C180_ID: '15', C180_IL: '16', C180_IN: '17', C180_IA: '18', C180_KS: '19', C180_KY: '20', C180_LA: '21', C180_ME: '22', C180_MD: '23', C180_MA: '24', C180_MI: '25', C180_MN: '26', C180_MS: '27', C180_MO: '28', C180_MT: '29', C180_NE: '30', C180_NV: '31', C180_NH: '32', C180_NJ: '33', C180_NM: '34', C180_NY: '35', C180_NC: '36', C180_ND: '37', C180_OH: '38', C180_OK: '39', C180_OR: '40', C180_PA: '41', C180_RI: '42', C180_SC: '43', C180_SD: '44', C180_TN: '45', C180_TX: '46', C180_UT: '47', C180_VT: '48', C180_VA: '49', C180_WA: '50', C180_WV: '51', C180_WI: '52', C180_WY: '53', C32_AB: '54', C32_BC: '55', C32_MB: '56', C32_NB: '57', C32_NL: '58', C32_NT: '59', C32_NS: '60', C32_ON: '61', C32_PE: '62', C32_QC: '63', C32_SK: '64', C32_YT: '65', C32_NU: '66', C10_ACT: '67', C10_JBT: '68', C10_NSW: '69', C10_NT: '70', C10_QLD: '71', C10_SA: '72', C10_TAS: '73', C10_VIC: '74', C10_WA: '75', }; function scAddressFieldSetup() { var countryFlds = $$('#Country, #Ship_Country, #Bill_Country, #Ship_Est_Country'); var stateFlds = $$('#State_or_Province, #Ship_State_or_Province, #Bill_State_or_Province, #Ship_Est_State_or_Province'); if (countryFlds) { countryFlds.addEvent('change',function() {scAddressFieldChange(this);}); stateFlds. addEvent('change',function() {scAddressFieldChange(this);}); countryFlds.each(function(fld) {scAddressFieldChange(fld,1);}); } } function scAddressFieldChange(triggerFld, init) { var prefix = ''; if (triggerFld.id.contains('Bill_')) { prefix = 'Bill_'; } else if (triggerFld.id.contains('Ship_Est_')) { prefix = 'Ship_Est_'; } else if (triggerFld.id.contains('Ship_')) { prefix = 'Ship_'; } var countryFld = $(prefix + 'Country'); var stateFld = $(prefix + 'State_or_Province'); if (!stateFld) return; var stateValue = stateFld.value; var stateLi = stateFld.getParent('li'); if (stateLi.hasClass('double')) stateLi = stateLi.getElement('div'); var stateLabel = stateLi.getElement('label'); var stateOptsSelector = '#' + stateFld.id + ' option'; var stateOtherFld = $(prefix + 'State_Other'); if (stateOtherFld) { var stateOtherLi = stateOtherFld.getParent('li'); var stateOtherLabel = stateOtherLi.getElement('label'); if (stateOtherLabel) stateOtherLabel.origHTML = stateOtherLabel.origHTML ? stateOtherLabel.origHTML : stateOtherLabel.get('html'); if (stateValue == 2) { stateOtherLi.removeClass('sc_hide'); } else { stateOtherLi.addClass('sc_hide'); } } if (!countryFld || !countryFld.value) return; if (!stateFld.savedOptions) stateFld.savedOptions = $$(stateOptsSelector).clone(); if (init || triggerFld.id.contains('Country')) { $$(stateOptsSelector).destroy(); var newStates = Array(); var statesMatched = 0; var newSelectedIndex = 0 ; stateFld.savedOptions.each( function(savedOpt) { var stateCountry = savedOpt.getAttribute('data-country'); if (stateCountry == countryFld.value || savedOpt.value == 2 || savedOpt.value == '') { savedOpt.clone().inject(stateFld); newStates.push(savedOpt.value); if (stateCountry == countryFld.value) statesMatched++; } } ); if (!statesMatched) { if (stateOtherLabel) stateOtherLabel.set('html', stateLabel.get('html')); if (stateOtherLi) { stateOtherLi.removeClass('sc_hide'); stateLi.addClass('sc_hide'); } stateFld.value = 2; } else { if (stateOtherLabel) stateOtherLabel.set('html', stateOtherLabel.origHTML); if (stateOtherLi) { if (stateValue != 2) stateOtherLi.addClass('sc_hide'); stateOtherLi.addClass('sc_hide'); } stateLi.removeClass('sc_hide'); } } if (triggerFld.id.contains('Country') && !init) stateFld.value = ''; } function scBdayFieldSetup() { $$('.bdayMonth').addEvent('change', function() {scBdayMonthChange(this);}); } function scBdayMonthChange(bdayMonthFld) { var day30Months = ['04','06','09','11']; var day31Months = ['01','03','05','07','08','10','12']; var bdayMonth = bdayMonthFld.value; var bdayMonthId = bdayMonthFld.id; var bdayDayId = bdayMonthId.replace('Month','Day'); var bdayDayFld = $(bdayDayId); var bday29opt = $(bdayDayId + '29'); var bday30opt = $(bdayDayId + '30'); var bday31opt = $(bdayDayId + '31'); if(!bday29opt || !bday30opt || !bday31opt) return; bday29opt.setStyle('display',''); bday30opt.setStyle('display',''); bday31opt.setStyle('display',''); if (day30Months.contains(bdayMonth)) { bday31opt.setStyle('display','none'); if (bdayDayFld.value == '31') bdayDayFld.set('value',''); } else if (bdayMonth == '02') { bday31opt.setStyle('display','none'); bday30opt.setStyle('display','none'); if (bdayDayFld.value == '30' || bdayDayFld.value == '31') bdayDayFld.set('value',''); } } var scShipEstWaiting = false; function scShipEstSetup() { var shipEstBtn = $('ship_est_btn'); if (!shipEstBtn) return; shipEstBtn.addEvent('click', function() {scShipEstGet(); return false}); $$('.qty_row input').addEvent('change', function() {scShipEstDisable();}); $$('.qty_row input').addEvent('keyup', function() {scShipEstDisable();}); $('ship_estimator').setStyle('display','block'); } function scShipEstGet() { var country = $('Ship_Est_Country'); var state = $('Ship_Est_State_or_Province'); var stateLi = state.getParent('li'); var stateOther = $('Ship_Est_State_Other'); var stateOtherLi= stateOther.getParent('li'); var postal = $('Ship_Est_Postal_Code'); var city = $('Ship_Est_City'); var btn = $('ship_est_btn'); var wait = $('ship_est_wait'); var err = ''; if (!country.value) err += '
  • Country
  • '; if (city && !city.value) err += '
  • City
  • '; if (!state.value && !stateLi.hasClass('sc_hide')) err += '
  • State
  • '; if (!stateOther.value && !stateOtherLi.hasClass('sc_hide')) err += '
  • State
  • '; if (!postal.value) err += '
  • Postal Code
  • '; if (err) return scModalAlert('One or more fields are missing:
      ' + err + '
    ', 'Missing info', 1); btn.setStyle('display','none'); wait.setStyle('display','inline-block'); var cityValue = city ? city.value : ''; scShipEstWaiting = true; x_sc_ship_estimator_get(country.value, state.value, stateOther.value, postal.value, cityValue, scShipEstCallback); setTimeout( 'scShipEstCallback("We were unable to determine shipping costs for your order. Please check your address information for accuracy or contact us for assistance.")', 20000 ); } function scShipEstDisable() { var shipEst = $('ship_estimator'); if (shipEst.hasClass('disabled')) return; $$('.ship_rate input').set('checked',false); shipEst.addClass('disabled'); fadeIn($('ship_est_disabled'), 'inline-block'); } function scShipEstCallback(html) { if (!scShipEstWaiting) return; $('ship_est_wait').setStyle('display','none'); $('ship_est_btn').setStyle('display',''); var shipEstRatesOuter = $('ship_est_rates_outer'); var shipEstRates = $('ship_est_rates'); shipEstRates.set('html', html); fadeIn(shipEstRatesOuter, 'block'); $$('.ship_rate_detail .sr_inner').each(function(rateDetail) { var hiddenHeight = rateDetail.scrollHeight - rateDetail.clientHeight; if (hiddenHeight > 3) { var rateOuter = rateDetail.getParent('div'); if (rateOuter) { var readMoreLink = rateOuter.getElement('.rate_detail_more'); if (readMoreLink) { readMoreLink.setStyle('visibility','visible'); readMoreLink.addEvent( 'click', function(){ var rateOuter = readMoreLink.getParent('.ship_rate_detail'); if (rateOuter) { rateDetail = rateOuter.getElement('.sr_inner') rateDetail.setStyle('display','none'); rateDetail.addClass('show_more'); fadeIn(rateDetail); readMoreLink.setStyle('display','none'); } return false; } ); } } } }); scShipEstWaiting = false; } function fadeIn(el, display) { if (display == undefined) display = 'block'; el.setStyle('opacity',0); el.setStyle('display', display); fadeIn1 = new Fx.Morph(el, {duration: 700}); fadeIn1.start({ opacity: 1 }); } function fadeOut(el) { el.setStyle('opacity', 1); el.oldHeight = el.getStyle('height'); fadeOut1 = new Fx.Morph( el, { duration: 300, onComplete: function() { this.element.setStyle('display',''); this.element.setStyle('height',el.oldHeight); } } ); fadeOut1.start({ opacity: 0, height: 0 }); } function ssoFormShow(ssoFormOuter, ssoUsBtn) { var isNavBlock = ssoFormOuter.getParent('.sc_acct_nav_block'); var ssoForm = ssoFormOuter.getElement('form'); if (isNavBlock) { var ssoUsH2 = $$('.sc_acct_nav_block .sc_title'); ssoUsH2.removeClass('sc_hide'); } ssoUsBtn.dispose(); if (!ssoForm.hasClass('acct_opts_header')) { $('login_form_outer').addClass('nav_block'); ssoForm.addClass('nav_block_content'); } fadeIn(ssoForm); ssoFormOuter.addClass('login_form_fixed'); } function ssoSetup() { var scDiv = $('sc'); if (!(scDiv && scDiv.hasClass('sso_on') && !scDiv.hasClass('logged_in'))) return; var ssoFormOuter = $$('.sso_on .login_form_outer, .sso_on #login_form_outer'); if (!ssoFormOuter) return; ssoFormOuter.each( function(ssoFormOut){ ssoFormOut.addClass('setup'); var ssoUsBtn = ssoFormOut.getElement('.sso_us'); ssoUsBtn.setStyle('display','block'); var isNavBlock = ssoFormOut.hasClass('nav_block'); if (isNavBlock) { $$('.sc_acct_nav_block .sc_title').addClass('sc_hide'); $$('.sc_acct_nav_block .nav_block').removeClass('nav_block'); } if (!ssoFormOut.hasClass('login_failed')) { ssoFormOut.removeClass('login_form_fixed'); ssoUsBtn.addEvent('click', function() { ssoFormShow(ssoFormOut, ssoUsBtn); return false;}); } else { if (isNavBlock) { var loginForm = $$('.login_form_fixed'); if (loginForm) ssoFormShow(loginForm, ssoUsBtn); } } } ); } function toggleOptionDetail() { var optDetailULs = getElementsByPartialId(document.body,'ul','opt_detail_'); if (optDetailULs) { for(var i=0;optDetailULs[i];i++) { swapDisplay(optDetailULs[i]); } } } var rateInfoState; function toggleRateInfo(courierDivId){ var rateDetails = getElementsByPartialId(courierDivId,'div','rate_detail_'); for(x=0; x < rateDetails.length; x++) { swapDisplay(rateDetails[x]); } if (scTweakColumns) scTweakColumns(); } var themeURL, defaultThemeURL; function scThemeChooserSetup() { var themeShowLink = $('theme_nav_show'); if (themeShowLink) themeShowLink.addEvent('click', function() {scThemeNavShow(this); return false}); $$('.theme_chooser select').addEvent('change', function() {scThemeChooserChange(this); return false;}); $$('.theme_chooser .themeSetButton').addEvent('click', function() {scThemeSetStartPoint(this); return false;}); $$('.theme_chooser .themeSaveButton').addEvent('click', function() {scThemeSave(this); return false;}); $$('.theme_var').each( function(themeVar) { scThemeChooserHide(themeVar,true); } ) $$('.theme_chooser .hide').getParent('li').each(function(li){if (!li) return; li.setStyle('display','none');}); if ($('starting_point_mismatch')) { var themeSaveFld = $('Custom_Variants'); var noPrompt = $$('body')[0].hasClass('demo_mode') || (themeSaveFld && !themeSaveFld.value); if (noPrompt || confirm("This theme has a starting point for customization that does not match your current theme setting.\r\nWould you like to use your current theme as a starting point?\r\n\r\nTo start with your current theme setting, click OK. To start with the previously saved starting point, click CANCEL.")) { themeSaveFld.value = $('starting_point_mismatch').value; scThemeSetStartPoint($$('.theme_chooser .themeSetButton'), noPrompt); } } if ($('record_form') && $$('.theme_chooser') && $('Custom_Variants') && !$('Custom_Variants').value) { scThemeChooserChange(); scThemeSetStartPoint($$('.theme_chooser .themeSetButton'), 1); } if ($('default_theme_chooser')) scThemeChooserChange(); } function scThemeChooserChange(fld) { if (!fld) fld = $$('.theme_var1')[0]; var themeFld = fld != undefined ? fld.getParent('.theme_chooser').getElement('.theme_name') : $$('.theme_name')[0]; var themeChooser = themeFld.getParent('.theme_chooser'); var isDefaultThemeChooser = $('default_theme_chooser'); if (fld != undefined && isDefaultThemeChooser && fld.hasClass('theme_name')) { toggleWait('on','Loading variants...'); window.location = "http://www.atlantabassgallery.com/squirrelcart/index.php?table=Themes&ctv=" + fld.value; } var recordForm = themeChooser.getParent('#record_form'); var themeVar1 = themeChooser.getElement('.theme_var1'); var themeVar2 = themeChooser.getElement('.theme_var2'); var themeVar3 = themeChooser.getElement('.theme_var3'); var themeVar4 = themeChooser.getElement('.theme_var4'); var themeVar5 = themeChooser.getElement('.theme_var5'); var themeVar6 = themeChooser.getElement('.theme_var6'); var themeVar7 = themeChooser.getElement('.theme_var7'); var themeVar8 = themeChooser.getElement('.theme_var8'); var themeVar9 = themeChooser.getElement('.theme_var9'); var themeVar10 = themeChooser.getElement('.theme_var10'); var themeVar11 = themeChooser.getElement('.theme_var11'); var themeVar12 = themeChooser.getElement('.theme_var12'); var themeVar13 = themeChooser.getElement('.theme_var13'); var themeVar14 = themeChooser.getElement('.theme_var14'); var themeVar15 = themeChooser.getElement('.theme_var15'); var themeVar16 = themeChooser.getElement('.theme_var16'); var themeVar17 = themeChooser.getElement('.theme_var17'); var themeVar18 = themeChooser.getElement('.theme_var18'); var themeVar19 = themeChooser.getElement('.theme_var19'); var themeVar20 = themeChooser.getElement('.theme_var20'); if (!themeFld || !themeFld.value) return; var themeFlds = $$('.theme_var'); themeFlds.getParent('li').setStyle('display', 'inline-block'); themeFlds.setStyle('display', 'inline'); themeFlds.each( function(themeFld) {scThemeChooserHide(themeFld)} ); var iniFieldSets = $$('fieldset.theme_ini_settings'); if (iniFieldSets.length) { iniFieldSets.setStyle('display','none'); var setBtn = themeChooser.getElement('.themeSetButton'); setBtn.set('html','Set Starting Point'); } var themeSetting; if (fld == undefined) { themeSetting = themeFld.value; } else if ($(fld).value.contains('^^')) { scThemeChooserHide(fld); themeSetting = fld.value; } else { var defaultValPieces = themeFld.value.split('^^'); var themeRn = defaultValPieces[0]; themeSetting = themeRn; if (themeVar1) themeSetting += '^^' + themeVar1.value; if (themeVar2) themeSetting += '^^' + themeVar2.value; if (themeVar3) themeSetting += '^^' + themeVar3.value; if (themeVar4) themeSetting += '^^' + themeVar4.value; if (themeVar5) themeSetting += '^^' + themeVar5.value; if (themeVar6) themeSetting += '^^' + themeVar6.value; if (themeVar7) themeSetting += '^^' + themeVar7.value; if (themeVar8) themeSetting += '^^' + themeVar8.value; if (themeVar9) themeSetting += '^^' + themeVar9.value; if (themeVar10) themeSetting += '^^' + themeVar10.value; if (themeVar11) themeSetting += '^^' + themeVar11.value; if (themeVar12) themeSetting += '^^' + themeVar12.value; if (themeVar13) themeSetting += '^^' + themeVar13.value; if (themeVar14) themeSetting += '^^' + themeVar14.value; if (themeVar15) themeSetting += '^^' + themeVar15.value; if (themeVar16) themeSetting += '^^' + themeVar16.value; if (themeVar17) themeSetting += '^^' + themeVar17.value; if (themeVar18) themeSetting += '^^' + themeVar18.value; if (themeVar19) themeSetting += '^^' + themeVar19.value; if (themeVar20) themeSetting += '^^' + themeVar20.value; } themeURL = "https://www.atlantabassgallery.com/index.php?theme_current=" + themeSetting; defaultThemeURL = "http://www.atlantabassgallery.com/squirrelcart/index.php?theme_default=" + themeSetting + "&token=b7714cb14de6b0f479a4d172b32df326"; if (themeChooser.hasClass('themeCurrent')) { window.location = themeURL; scThemeLoading(themeChooser); } else if (themeChooser.hasClass('themeSave')) { var themeSaveFld = $('Custom_Variants'); if (!themeSaveFld) { themeSaveFld = $$('.Custom_Variants'); if (themeSaveFld) themeSaveFld = themeSaveFld[0]; } if (themeSaveFld) themeSaveFld.value = themeSetting; if (recordForm && fld.hasClass('theme_name')) { toggleWait('on','Loading theme variants...'); recordForm.submit(); } } } function scThemeLoading(themeChooser) { var wait = themeChooser.getElement('.wait'); wait.removeClass('sc_hide'); wait.removeClass('hide'); wait.setStyle('display','inline'); $$('.theme_chooser li').setStyle('display','none'); var cog = themeChooser.getElement('.cog'); if (cog) cog.setStyle('display','none'); } function scThemeChooserHide(srcField, setupRun) { if (!srcField) return; if (srcField.name == 'theme_var1' && srcField.value.indexOf('^^') != -1) { $$('.theme_var').each(function(fld) {if (fld.name != 'theme_var1') fld.getParent('li').setStyle('display','none');}); return; } $$('.hideWhen' + srcField.name + 'xxx' + srcField.value).getParent('li').setStyle('display','none'); if (srcField.options.length == 1) srcField.getParent('li').setStyle('display','none'); } function scThemeNavShow(showLink) { var themeNav = $('theme_nav'); if (themeNav) { if (themeNav.hasClass('sc_show')) { fadeOut(themeNav); themeNav.removeClass('sc_show'); } else { fadeIn(themeNav); themeNav.addClass('sc_show'); } } } function scThemeSave(btn) { if (!defaultThemeURL) defaultThemeURL = 'index.php?Themes'; toggleWait('on','Setting Default Theme...'); window.location = defaultThemeURL; } function scThemeSetStartPoint(btn, noPrompt) { var recordForm = $('record_form'); var confirmMsg, resetValue; if (btn.hasClass('themeUpdateButton')) { confirmMsg = 'Click OK to continue, which will merge your custom styles with any "Starting Point" settings that have been changed. You will then be able to customize them further. \r\n\r\nWhen done, don\'t forget to save your changes.'; resetValue = 2; } else { confirmMsg = 'When setting the starting point for the custom variant of this theme, any custom styles you specified in this section will be reset to defaults.\r\n\r\nClick OK to continue, which will load the default settings for this starting point which you will then be able to customize. \r\n\r\nWhen done, don\'t forget to save your changes.'; resetValue = 1; } if ($$('body')[0].hasClass('demo_mode') || noPrompt || confirm(confirmMsg)) { toggleWait('on','Loading settings...'); $('themeIniReset').value = resetValue; recordForm.submit(); } else { toggleWait('off'); } }// bail if not on small device and not iOS if (window.getSize().x > 1045 && !isIOS) { // // qTip - CSS Tool Tips - by Craig Erskine var uniTipTag = "a,img,div,span,label"; var uniTipClass = "tip"; var uniTipX = 0; var uniTipY = 15; //______________________________________________There's no need to edit anything below this line// var offsetX = uniTipX, offsetY = uniTipY, elewidth = null, eleheight = null, tipid = null, tiptop = null, tipbot = null, tipcapin=null, tippointin=null, altText=false; var x=0, y=0, WinWidth=0, WinHeight=0, TipWidth=0, TipHeight=0, CapHeight=0, PointHeight=0; init = function () { var elementList = uniTipTag.split(","); for(var j = 0; j < elementList.length; j++) { var elements = document.getElementsByTagName(elementList[j]); if(elements) { for (var i = 0; i < elements.length; i ++) { if (uniTipClass != '') { var elClass = elements[i].className; var elClassList = uniTipClass.split(","); for (var h=0; h < elClassList.length; h++) { if (elClass.match(elClassList[h])) unitipize(elements[i]); } } else unitipize(elements[i]); } } } } unitipize = function (element) { var a = element; altText = (a.alt && a.getAttribute("alt") != '' ) ? true : false; var sTitle = (altText == true) ? a.getAttribute("alt") : a.getAttribute("title"); if(sTitle) { a.onmouseover = function() {build(a, sTitle);}; a.onmouseout = function() {hide(a, sTitle);}; } } build = function (a, sTitle) { if (a.title) a.title = ""; if (altText==true) a.alt = ""; var tipContainer = document.createElement("div"); tipContainer.setAttribute("id", "unitip"); document.body.appendChild(tipContainer); var tipContainerTop = document.createElement("div"); tipContainerTop.setAttribute("id", "unitippoint"); tipContainer.appendChild(tipContainerTop); var tipContainerMid = document.createElement("div"); tipContainerMid.setAttribute("id", "unitipmid"); tipContainer.appendChild(tipContainerMid); var tipContainerBot = document.createElement("div"); tipContainerBot.setAttribute("id", "unitipcap"); tipContainer.appendChild(tipContainerBot); tipid = document.getElementById("unitip"); tippoint = document.getElementById("unitippoint"); tipmid = document.getElementById("unitipmid"); tipcap = document.getElementById("unitipcap"); document.getElementById("unitipmid").innerHTML = sTitle; tipid.style.display = "block"; elewidth = document.getElementById("unitipmid").offsetWidth; eleheight = document.getElementById("unitip").offsetHeight; WinWidth = document.body.offsetWidth; WinHeight = (document.body.clientHeight < document.documentElement.clientHeight) ? document.body.clientHeight : document.documentElement.clientHeight; CapHeight = document.getElementById('unitipcap').offsetHeight; PointHeight = document.getElementById('unitippoint').offsetHeight; if (typeof pngfix=="function") { if (tippoint.currentStyle.backgroundImage.match(/\.png/gi)) { var tipP = tippoint.innerHTML; tippoint.id = 'unitipP'; tippoint.style.overflow = "hidden"; tippoint.style.height = PointHeight + "px"; tippoint.style.width = elewidth + "px"; tippoint.style.position = "relative"; tippoint.style.display = "block"; tippoint.innerHTML = '
    ' + tipP + '
    '; tippointin = document.getElementById("unitippoint"); tippointin.style.width = (elewidth * 2) + "px"; tippointin.style.height = (PointHeight * 2) + "px"; tippointin.style.backgroundImage = tippoint.style.backgroundImage; tippointin.style.position = "absolute"; tippoint.style.backgroundImage = "none"; } if (tipcap.currentStyle.backgroundImage.match(/\.png/gi)) { var tipC = tipcap.innerHTML; tipcap.id = 'unitipC'; tipcap.style.overflow = "hidden"; tipcap.style.height = CapHeight + "px"; tipcap.style.width = elewidth + "px"; tipcap.style.position = "relative"; tipcap.style.display = "block"; tipcap.innerHTML = '
    ' + tipP + '
    '; tipcapin = document.getElementById("unitipcap"); tipcapin.style.height = (CapHeight * 2) + "px"; tipcapin.style.backgroundImage = tipcap.style.backgroundImage; tipcapin.style.position = "absolute"; tipcap.style.backgroundImage = "none"; } pngfix(); } document.onmousemove = function (evt) {move (evt)}; } move = function (evt) { if (window.event) { x = window.event.clientX; y = window.event.clientY; if (document.documentElement.scrollLeft) tipid.style.left = (TipWidth >= WinWidth ) ? ((x - offsetX - elewidth) + document.documentElement.scrollLeft) + "px" : (x + offsetX + document.documentElement.scrollLeft) + "px"; else tipid.style.left = (TipWidth >= WinWidth ) ? ((x - offsetX - elewidth) + document.body.scrollLeft) + "px" : (x + offsetX + document.body.scrollLeft) + "px"; if (document.documentElement.scrollTop) tipid.style.top = (TipHeight >= WinHeight) ? ((y - offsetY - eleheight) + document.documentElement.scrollTop) + "px" : (y + offsetY + document.documentElement.scrollTop) + "px"; else tipid.style.top = (TipHeight >= WinHeight) ? ((y - offsetY - eleheight) + document.body.scrollTop) + "px" : (y + offsetY + document.body.scrollTop) + "px"; } else { x = evt.clientX; y = evt.clientY; tipid.style.left = (TipWidth >= WinWidth ) ? ((x - offsetX - elewidth) + window.scrollX) + "px" : (x + offsetX + window.scrollX) + "px"; tipid.style.top = (TipHeight >= WinHeight) ? ((y - offsetY - eleheight) + window.scrollY) + "px" : (y + offsetY + window.scrollY) + "px"; } TipWidth = x + elewidth + 20; TipHeight = y + eleheight + 20; if (TipHeight >= WinHeight ) { tipid.removeChild(tippoint); tipid.removeChild(tipmid); tipid.removeChild(tipcap); tipid.appendChild(tipcap); tipid.appendChild(tipmid); tipid.appendChild(tippoint); } else { tipid.removeChild(tippoint); tipid.removeChild(tipmid); tipid.removeChild(tipcap); tipid.appendChild(tippoint); tipid.appendChild(tipmid); tipid.appendChild(tipcap); } if (TipHeight >= WinHeight) { if (document.getElementById('uniTipP')) { tippointin.style.left = (TipWidth >= WinWidth ) ? "-" + elewidth + "px" : "0px"; tippointin.style.top = "-" + PointHeight + "px"; } else tippoint.style.backgroundPosition = (TipWidth >= WinWidth ) ? "right bottom" : "left bottom"; if (document.getElementById('uniTipC')) tipcapin.style.top = "-" + CapHeight + "px"; else tipcap.style.backgroundPosition = "0 -" + CapHeight + "px"; } else { if (document.getElementById('uniTipP')) { tippointin.style.left = (TipWidth >= WinWidth ) ? "-" + elewidth + "px" : "0px"; tippointin.style.top = "0px"; } else tippoint.style.backgroundPosition = (TipWidth >= WinWidth ) ? "right top" : "left top"; if (document.getElementById('uniTipC')) tipcapin.style.top = "0px"; else tipcap.style.backgroundPosition = "0 0"; } } hide = function (a, sTitle) { if (document.getElementById("unitipmid")) { document.getElementById("unitipmid").innerHTML = ""; document.onmousemove = ''; document.body.removeChild(tipid); tipid.style.display = "none"; if (altText==false) a.setAttribute("title", sTitle); else a.setAttribute("alt", sTitle); altText=false; } } if (window.addEventListener) window.addEventListener("load", init, false); if (window.attachEvent) window.attachEvent("onload", init); }//setup everything AFTER the DOM is available window.addEvent('domready', function() { window.addEvent('resize',function(){scTweakColumns()}); scMenuSetup(); }); window.addEvent('load', function() { scTweakColumns(); }); function scTweakColumns() { var columns = $$('#sc_main, #sc_col1, #sc_col2'); var max_height = 0; var scOuter = $$('.var1_layout11 #sc_outer'); var scDiv = $('sc'); if (scOuter && scDiv) { scOuter = scOuter[0]; var windowHeight = window.getSize().y; var scHeight = scDiv.getSize().y; if (windowHeight > scHeight) { scOuter.setStyle('height', scOuter.getSize().y + windowHeight - scHeight); } } var col1 = $('sc_col1'); var col2 = $('sc_col2'); var scMain = $('sc_main'); if (col1) col1.setStyle('min-height',0); if (col2) col2.setStyle('min-height',0); var col1Height = col1 ? col1.getSize().y : 0; var col2Height = col2 ? col2.getSize().y : 0; var scMainHeight= scMain.getSize().y; if (col1 && col2 && col2.getStyle('clear') == 'left') { var navHeight = col1Height + col2Height; if (navHeight < scMainHeight) { col2.setStyle('min-height', col2Height + (scMainHeight - navHeight)); col1.setStyle('min-height',0); } } else { max_height = Math.max(col1Height, col2Height, scMainHeight); columns.setStyle('min-height', max_height); } } function scMenuSetup() { var scNav = $('sc_nav'); var scDiv = $('sc'); if (!scDiv) return; if (scNav) { $$('#sc_header .ico_menu').addEvent('click', function(){scNavShow(); return false;}); scNavClose = new Element('a', {id: 'sc_nav_close', class: 'ico ico_close', href: '#'}); scNavClose.inject(scDiv); scNavClose.addEvent('click', function() {scNavShow()}); scMask.addEvent('click', function(){ scNavShow('off')}); } var menu1s = $$('.menu1_outer'); if (menu1s) { menu1s.each(function(menu){scMenu1Setup(menu)}); $(document.body).addEvent('click', function() { menu1s.each(function(menu){scMenu1Toggle(menu, 1);}); }); } } function scMenu1Click(evt, menu1) { menu1.addClass('menu1_on'); evt.stopPropagation(); } function scMenu1IcoClick(evt, ico) { menuOuter = ico.getParent('.menu1_outer'); if (menuOuter.getElement('.menu1').getStyle('visibility') == 'visible' && evt.type == 'click') { scMenu1Toggle(menuOuter,1); return false; } $$('.menu1_outer').removeClass('menu1_on'); menuOuter.removeClass('closed'); } function scMenu1Toggle(menu, close) { var menuInner = menu.getElement('.menu1'); if (close || menu.hasClass('menu1_on')) { menu.removeClass('menu1_on'); menu.addClass('closed'); } else { menu.addClass('menu1_on'); } } function scMenu1Setup(menu) { menu.addEvent('click', function(evt) { scMenu1Click(evt, this);}); var menuIco = menu.getElement('a.ico:first-child'); menuIco.addEvent('click', function(evt){scMenu1IcoClick(evt, this);}); menu.addClass('setup'); } function scNavShow(mode) { var scDiv = $('sc'); if (!scDiv) return; $(document.body).fireEvent('click'); if (scDiv.hasClass('sc_menu_on') || mode == 'off') { scMaskHide(); scDiv.removeClass('sc_menu_on'); } else { scMaskShow(true); scDiv.addClass('sc_menu_on'); } }