window.bearhug={queue:[],ready:function(){for(var a=0;a<this.queue.length;a++){var b=this.queue[a];b.fn.apply(b.bind,b.args)}},load:function(b,c,a){if(!b){return}this.queue.push({fn:b,bind:c||window,args:a||[]})}};bearhug.embed={load:function(f,e,c,g,b){var h=bearhug.random.id("bearhug_embed_callback_");c=(c||[]).concat(["callback="+h]);g=g||this.success;b=b||this.failure;var d=setTimeout(function(){b(f)},10000);window[h]=function(i){clearInterval(d);g(i,f)};var a=document.createElement("script");a.type="text/javascript";a.src=bearhug.url.base("/embed"+e+"?"+c.join("&"));document.getElementsByTagName("head")[0].appendChild(a)},success:function(a,b){b.innerHTML=a.html},failure:function(a){a.innerHTML="Request Failed"},form:function(e){var d=function(f){var h=parseInt(bearhug.css.get(f,"paddingLeft"))+parseInt(bearhug.css.get(f,"paddingRight"));var g=parseInt(bearhug.css.get(f,"width"));f.style.width=(g-h-20)+"px"};var b=e.getElementsByTagName("input");for(var c=0;c<b.length;c++){if(b[c].type!="text"){continue}d(b[c])}var a=e.getElementsByTagName("textarea");for(var c=0;c<a.length;c++){d(a[c])}}};bearhug.embed.idea={list:function(d,b){b=b||{};var e=[];var a=b.order?b.order:"latest";var c=b.product?b.product:"all-products";if(b.limit){e.push("limit="+b.limit)}bearhug.load(function(){bearhug.embed.load(document.getElementById(d),"/ideas/list/"+a+"/"+c,e)},this)},create:function(c,a){a=a||{};var d=[];if(a.width){d.push("width="+a.width)}var b=a.product?a.product:"All Products";if(a.disableProductSelection){d.push("disableProductSelection=1")}bearhug.load(function(){bearhug.embed.load(document.getElementById(c),"/ideas/create/"+b,d,function(e,f){bearhug.embed.success(e,f);bearhug.embed.form(f.getElementsByTagName("form")[0])})},this)}};bearhug.embed.question={list:function(e,b){b=b||{};var a=b.order||"latest";var d=b.product||"all-products";var c=b.type||"any";var f=[];if(b.tags){f.push("tags="+b.tags)}if(b.featured){f.push("featured=1")}if(b.limit){f.push("limit="+b.limit)}bearhug.load(function(){bearhug.embed.load(document.getElementById(e),"/questions/list/"+a+"/"+d+"/"+c,f)},this)},create:function(c,a){a=a||{};var d=[];if(a.width){d.push("width="+a.width)}var b=a.product?a.product:"All Products";if(a.disableProductSelection){d.push("disableProductSelection=1")}bearhug.load(function(){bearhug.embed.load(document.getElementById(c),"/questions/create/"+b,d,function(j,l){bearhug.embed.success(j,l);var f=l.getElementsByTagName("form")[0];bearhug.embed.form(f);var n=Sizzle(".field-tags",f);if(n.length){n=n[0]}else{return}var e=function(q,r,i){return function(s){if(!s){var s=window.event}if(s.stopPropagation){s.stopPropagation()}if(s.preventDefault){s.preventDefault()}q.apply(r||q,i||[]);return false}};var p=function(){var q=Sizzle("#review_create_product",f)[0];var i=Sizzle("option[selected]",q);q.value=i.length?i[0].value:"all";return q};var g=function(t){n.style.display="none";var q=Sizzle("a.tag",n);for(var r=0;r<q.length;r++){q[r].style.display="none";q[r].className="tag"}var u=Sizzle("input",n);for(var r=0;r<u.length;r++){u[r].checked=false}var s=Sizzle("a.tag[rel="+t+"]");for(var r=0;r<s.length;r++){s[r].style.display="block"}if(s.length){n.style.display="block"}};p().onchange=e(function(){g(p().value)});g(p().value);var o=function(r){var q=Sizzle("a.tag[id=button_"+r+"]",n)[0];q.className="tag tag-selected";var i=Sizzle("input[value="+r+"]",n)[0];i.checked=true};var h=function(r){var q=Sizzle("a.tag[id=button_"+r+"]",n)[0];q.className="tag";var i=Sizzle("input[value="+r+"]",n)[0];i.checked=false};var m=Sizzle("a.tag",f);for(var k=0;k<m.length;k++){m[k].onclick=e(function(){if(this.className=="tag tag-selected"){h(this.id.replace("button_",""))}else{o(this.id.replace("button_",""))}},m[k])}})},this)}};bearhug.embed.review={list:function(d,b){b=b||{};var a=b.order?b.order:"top";var c=b.product?b.product:"all-products";var e=[];if(b.minRating){e.push("minRating="+b.minRating)}if(b.limit){e.push("limit="+b.limit)}bearhug.load(function(){bearhug.embed.load(document.getElementById(d),"/reviews/list/"+a+"/"+c,e)},this)},create:function(c,a){a=a||{};var d=[];if(a.width){d.push("width="+a.width)}var b=a.product?a.product:"All Products";if(a.disableProductSelection){d.push("disableProductSelection=1")}bearhug.load(function(){bearhug.embed.load(document.getElementById(c),"/reviews/create/"+b,d,function(g,j){bearhug.embed.success(g,j);bearhug.embed.form(j.getElementsByTagName("form")[0]);var e=Sizzle(".field-rating .stars label",j);var f=function(m){for(var l=0;l<5;l++){e[l].style.backgroundPosition=l<m?"0 -16px":"0 0"}};var k=function(){var n=0;var l=Sizzle(".field-rating .stars input",j);for(var m=0;m<l.length;m++){if(l[m].checked){n=parseInt(l[m].value);break}}f(n)};for(var h=0;h<e.length;h++){e[h].onmouseover=(function(l){return function(){f(l)}})(h+1);e[h].onmouseout=k}k()})},this)}};bearhug.embed.status={list:function(c,a){a=a||{};var b=a.product?a.product:"all-products";bearhug.load(function(){bearhug.embed.load(document.getElementById(c),"/status/list/"+b)},this)}};bearhug.css={get:function(b,a){var c=b.currentStyle?b.currentStyle:document.defaultView.getComputedStyle(b,null);return c[a]}};bearhug.random={id:function(a){return(a||"")+this.string(20)+(new Date()).getTime().toString()},string:function(c){var b="abcdefghijklmnoprstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";var d=[];for(var a=0;a<c;a++){d.push(b[Math.round(Math.random()*b.length)])}return d.join("")}};(function(){var d=false;var c=false;var a=(function(){var f=navigator.userAgent.toLowerCase();return{version:(f.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[])[1],safari:/webkit/.test(f),opera:/opera/.test(f),msie:(/msie/.test(f))&&(!/opera/.test(f)),mozilla:(/mozilla/.test(f))&&(!/(compatible|webkit)/.test(f))}})();var b=function(){if(c){return}c=true;bearhug.ready()};var e=function(){if(d){return}d=true;if(a.msie&&window==top){(function(){if(c){return}try{document.documentElement.doScroll("left")}catch(g){setTimeout(arguments.callee,0);return}b()})()}else{if(a.safari&&a.version<525){(function(){if(c){return}if(document.readyState!="loaded"&&document.readyState!="complete"){setTimeout(arguments.callee,0);return}b()})()}else{if(document.addEventListener){document.addEventListener("DOMContentLoaded",b,false)}}}if(typeof window.onload=="function"){var f=window.onload;window.onload=function(){f();b()}}else{window.onload=b}};e()})();
/*
 * Sizzle CSS Selector Engine - v1.0
 *  Copyright 2009, The Dojo Foundation
 *  Released under the MIT, BSD, and GPL Licenses.
 *  More information: http://sizzlejs.com/
 */
(function(){var q=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,j=0,d=Object.prototype.toString,p=false,i=true;[0,0].sort(function(){i=false;return 0});var b=function(w,e,z,A){z=z||[];e=e||document;var C=e;if(e.nodeType!==1&&e.nodeType!==9){return[]}if(!w||typeof w!=="string"){return z}var x=[],t,E,H,s,v=true,u=b.isXML(e),B=w,D,G,F,y;do{q.exec("");t=q.exec(B);if(t){B=t[3];x.push(t[1]);if(t[2]){s=t[3];break}}}while(t);if(x.length>1&&k.exec(w)){if(x.length===2&&f.relative[x[0]]){E=h(x[0]+x[1],e)}else{E=f.relative[x[0]]?[e]:b(x.shift(),e);while(x.length){w=x.shift();if(f.relative[w]){w+=x.shift()}E=h(w,E)}}}else{if(!A&&x.length>1&&e.nodeType===9&&!u&&f.match.ID.test(x[0])&&!f.match.ID.test(x[x.length-1])){D=b.find(x.shift(),e,u);e=D.expr?b.filter(D.expr,D.set)[0]:D.set[0]}if(e){D=A?{expr:x.pop(),set:a(A)}:b.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&e.parentNode?e.parentNode:e,u);E=D.expr?b.filter(D.expr,D.set):D.set;if(x.length>0){H=a(E)}else{v=false}while(x.length){G=x.pop();F=G;if(!f.relative[G]){G=""}else{F=x.pop()}if(F==null){F=e}f.relative[G](H,F,u)}}else{H=x=[]}}if(!H){H=E}if(!H){b.error(G||w)}if(d.call(H)==="[object Array]"){if(!v){z.push.apply(z,H)}else{if(e&&e.nodeType===1){for(y=0;H[y]!=null;y++){if(H[y]&&(H[y]===true||H[y].nodeType===1&&b.contains(e,H[y]))){z.push(E[y])}}}else{for(y=0;H[y]!=null;y++){if(H[y]&&H[y].nodeType===1){z.push(E[y])}}}}}else{a(H,z)}if(s){b(s,C,z,A);b.uniqueSort(z)}return z};b.uniqueSort=function(s){if(c){p=i;s.sort(c);if(p){for(var e=1;e<s.length;e++){if(s[e]===s[e-1]){s.splice(e--,1)}}}}return s};b.matches=function(e,s){return b(e,null,null,s)};b.find=function(y,e,z){var x;if(!y){return[]}for(var u=0,t=f.order.length;u<t;u++){var w=f.order[u],v;if((v=f.leftMatch[w].exec(y))){var s=v[1];v.splice(1,1);if(s.substr(s.length-1)!=="\\"){v[1]=(v[1]||"").replace(/\\/g,"");x=f.find[w](v,e,z);if(x!=null){y=y.replace(f.match[w],"");break}}}}if(!x){x=e.getElementsByTagName("*")}return{set:x,expr:y}};b.filter=function(C,B,F,v){var t=C,H=[],z=B,x,e,y=B&&B[0]&&b.isXML(B[0]);while(C&&B.length){for(var A in f.filter){if((x=f.leftMatch[A].exec(C))!=null&&x[2]){var s=f.filter[A],G,E,u=x[1];e=false;x.splice(1,1);if(u.substr(u.length-1)==="\\"){continue}if(z===H){H=[]}if(f.preFilter[A]){x=f.preFilter[A](x,z,F,H,v,y);if(!x){e=G=true}else{if(x===true){continue}}}if(x){for(var w=0;(E=z[w])!=null;w++){if(E){G=s(E,x,w,z);var D=v^!!G;if(F&&G!=null){if(D){e=true}else{z[w]=false}}else{if(D){H.push(E);e=true}}}}}if(G!==undefined){if(!F){z=H}C=C.replace(f.match[A],"");if(!e){return[]}break}}}if(C===t){if(e==null){b.error(C)}else{break}}t=C}return z};b.error=function(e){throw"Syntax error, unrecognized expression: "+e};var f=b.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+\-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(e){return e.getAttribute("href")}},relative:{"+":function(x,s){var u=typeof s==="string",w=u&&!/\W/.test(s),y=u&&!w;if(w){s=s.toLowerCase()}for(var t=0,e=x.length,v;t<e;t++){if((v=x[t])){while((v=v.previousSibling)&&v.nodeType!==1){}x[t]=y||v&&v.nodeName.toLowerCase()===s?v||false:v===s}}if(y){b.filter(s,x,true)}},">":function(x,s){var v=typeof s==="string",w,t=0,e=x.length;if(v&&!/\W/.test(s)){s=s.toLowerCase();for(;t<e;t++){w=x[t];if(w){var u=w.parentNode;x[t]=u.nodeName.toLowerCase()===s?u:false}}}else{for(;t<e;t++){w=x[t];if(w){x[t]=v?w.parentNode:w.parentNode===s}}if(v){b.filter(s,x,true)}}},"":function(u,s,w){var t=j++,e=r,v;if(typeof s==="string"&&!/\W/.test(s)){s=s.toLowerCase();v=s;e=o}e("parentNode",s,t,u,v,w)},"~":function(u,s,w){var t=j++,e=r,v;if(typeof s==="string"&&!/\W/.test(s)){s=s.toLowerCase();v=s;e=o}e("previousSibling",s,t,u,v,w)}},find:{ID:function(s,t,u){if(typeof t.getElementById!=="undefined"&&!u){var e=t.getElementById(s[1]);return e&&e.parentNode?[e]:[]}},NAME:function(t,w){if(typeof w.getElementsByName!=="undefined"){var s=[],v=w.getElementsByName(t[1]);for(var u=0,e=v.length;u<e;u++){if(v[u].getAttribute("name")===t[1]){s.push(v[u])}}return s.length===0?null:s}},TAG:function(e,s){return s.getElementsByTagName(e[1])}},preFilter:{CLASS:function(u,s,t,e,x,y){u=" "+u[1].replace(/\\/g,"")+" ";if(y){return u}for(var v=0,w;(w=s[v])!=null;v++){if(w){if(x^(w.className&&(" "+w.className+" ").replace(/[\t\n]/g," ").indexOf(u)>=0)){if(!t){e.push(w)}}else{if(t){s[v]=false}}}}return false},ID:function(e){return e[1].replace(/\\/g,"")},TAG:function(s,e){return s[1].toLowerCase()},CHILD:function(e){if(e[1]==="nth"){var s=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(e[2]==="even"&&"2n"||e[2]==="odd"&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=(s[1]+(s[2]||1))-0;e[3]=s[3]-0}e[0]=j++;return e},ATTR:function(v,s,t,e,w,x){var u=v[1].replace(/\\/g,"");if(!x&&f.attrMap[u]){v[1]=f.attrMap[u]}if(v[2]==="~="){v[4]=" "+v[4]+" "}return v},PSEUDO:function(v,s,t,e,w){if(v[1]==="not"){if((q.exec(v[3])||"").length>1||/^\w/.test(v[3])){v[3]=b(v[3],null,null,s)}else{var u=b.filter(v[3],s,t,true^w);if(!t){e.push.apply(e,u)}return false}}else{if(f.match.POS.test(v[0])||f.match.CHILD.test(v[0])){return true}}return v},POS:function(e){e.unshift(true);return e}},filters:{enabled:function(e){return e.disabled===false&&e.type!=="hidden"},disabled:function(e){return e.disabled===true},checked:function(e){return e.checked===true},selected:function(e){e.parentNode.selectedIndex;return e.selected===true},parent:function(e){return !!e.firstChild},empty:function(e){return !e.firstChild},has:function(t,s,e){return !!b(e[3],t).length},header:function(e){return(/h\d/i).test(e.nodeName)},text:function(e){return"text"===e.type},radio:function(e){return"radio"===e.type},checkbox:function(e){return"checkbox"===e.type},file:function(e){return"file"===e.type},password:function(e){return"password"===e.type},submit:function(e){return"submit"===e.type},image:function(e){return"image"===e.type},reset:function(e){return"reset"===e.type},button:function(e){return"button"===e.type||e.nodeName.toLowerCase()==="button"},input:function(e){return(/input|select|textarea|button/i).test(e.nodeName)}},setFilters:{first:function(s,e){return e===0},last:function(t,s,e,u){return s===u.length-1},even:function(s,e){return e%2===0},odd:function(s,e){return e%2===1},lt:function(t,s,e){return s<e[3]-0},gt:function(t,s,e){return s>e[3]-0},nth:function(t,s,e){return e[3]-0===s},eq:function(t,s,e){return e[3]-0===s}},filter:{PSEUDO:function(t,y,x,z){var e=y[1],s=f.filters[e];if(s){return s(t,x,y,z)}else{if(e==="contains"){return(t.textContent||t.innerText||b.getText([t])||"").indexOf(y[3])>=0}else{if(e==="not"){var u=y[3];for(var w=0,v=u.length;w<v;w++){if(u[w]===t){return false}}return true}else{b.error("Syntax error, unrecognized expression: "+e)}}}},CHILD:function(e,u){var x=u[1],s=e;switch(x){case"only":case"first":while((s=s.previousSibling)){if(s.nodeType===1){return false}}if(x==="first"){return true}s=e;case"last":while((s=s.nextSibling)){if(s.nodeType===1){return false}}return true;case"nth":var t=u[2],A=u[3];if(t===1&&A===0){return true}var w=u[0],z=e.parentNode;if(z&&(z.sizcache!==w||!e.nodeIndex)){var v=0;for(s=z.firstChild;s;s=s.nextSibling){if(s.nodeType===1){s.nodeIndex=++v}}z.sizcache=w}var y=e.nodeIndex-A;if(t===0){return y===0}else{return(y%t===0&&y/t>=0)}}},ID:function(s,e){return s.nodeType===1&&s.getAttribute("id")===e},TAG:function(s,e){return(e==="*"&&s.nodeType===1)||s.nodeName.toLowerCase()===e},CLASS:function(s,e){return(" "+(s.className||s.getAttribute("class"))+" ").indexOf(e)>-1},ATTR:function(w,u){var t=u[1],e=f.attrHandle[t]?f.attrHandle[t](w):w[t]!=null?w[t]:w.getAttribute(t),x=e+"",v=u[2],s=u[4];return e==null?v==="!=":v==="="?x===s:v==="*="?x.indexOf(s)>=0:v==="~="?(" "+x+" ").indexOf(s)>=0:!s?x&&e!==false:v==="!="?x!==s:v==="^="?x.indexOf(s)===0:v==="$="?x.substr(x.length-s.length)===s:v==="|="?x===s||x.substr(0,s.length+1)===s+"-":false},POS:function(v,s,t,w){var e=s[2],u=f.setFilters[e];if(u){return u(v,t,s,w)}}}};var k=f.match.POS,g=function(s,e){return"\\"+(e-0+1)};for(var n in f.match){f.match[n]=new RegExp(f.match[n].source+(/(?![^\[]*\])(?![^\(]*\))/.source));f.leftMatch[n]=new RegExp(/(^(?:.|\r|\n)*?)/.source+f.match[n].source.replace(/\\(\d+)/g,g))}var a=function(s,e){s=Array.prototype.slice.call(s,0);if(e){e.push.apply(e,s);return e}return s};try{Array.prototype.slice.call(document.documentElement.childNodes,0)[0].nodeType}catch(l){a=function(v,u){var s=u||[],t=0;if(d.call(v)==="[object Array]"){Array.prototype.push.apply(s,v)}else{if(typeof v.length==="number"){for(var e=v.length;t<e;t++){s.push(v[t])}}else{for(;v[t];t++){s.push(v[t])}}}return s}}var c,m;if(document.documentElement.compareDocumentPosition){c=function(s,e){if(s===e){p=true;return 0}if(!s.compareDocumentPosition||!e.compareDocumentPosition){return s.compareDocumentPosition?-1:1}return s.compareDocumentPosition(e)&4?-1:1}}else{c=function(z,y){var t=[],e=[],v=z.parentNode,x=y.parentNode,A=v,w,s;if(z===y){p=true;return 0}else{if(v===x){return m(z,y)}else{if(!v){return -1}else{if(!x){return 1}}}}while(A){t.unshift(A);A=A.parentNode}A=x;while(A){e.unshift(A);A=A.parentNode}w=t.length;s=e.length;for(var u=0;u<w&&u<s;u++){if(t[u]!==e[u]){return m(t[u],e[u])}}return u===w?m(z,e[u],-1):m(t[u],y,1)};m=function(s,e,t){if(s===e){return t}var u=s.nextSibling;while(u){if(u===e){return -1}u=u.nextSibling}return 1}}b.getText=function(e){var s="",u;for(var t=0;e[t];t++){u=e[t];if(u.nodeType===3||u.nodeType===4){s+=u.nodeValue}else{if(u.nodeType!==8){s+=b.getText(u.childNodes)}}}return s};(function(){var s=document.createElement("div"),t="script"+(new Date()).getTime();s.innerHTML="<a name='"+t+"'/>";var e=document.documentElement;e.insertBefore(s,e.firstChild);if(document.getElementById(t)){f.find.ID=function(v,w,x){if(typeof w.getElementById!=="undefined"&&!x){var u=w.getElementById(v[1]);return u?u.id===v[1]||typeof u.getAttributeNode!=="undefined"&&u.getAttributeNode("id").nodeValue===v[1]?[u]:undefined:[]}};f.filter.ID=function(w,u){var v=typeof w.getAttributeNode!=="undefined"&&w.getAttributeNode("id");return w.nodeType===1&&v&&v.nodeValue===u}}e.removeChild(s);e=s=null})();(function(){var e=document.createElement("div");e.appendChild(document.createComment(""));if(e.getElementsByTagName("*").length>0){f.find.TAG=function(s,w){var v=w.getElementsByTagName(s[1]);if(s[1]==="*"){var u=[];for(var t=0;v[t];t++){if(v[t].nodeType===1){u.push(v[t])}}v=u}return v}}e.innerHTML="<a href='#'></a>";if(e.firstChild&&typeof e.firstChild.getAttribute!=="undefined"&&e.firstChild.getAttribute("href")!=="#"){f.attrHandle.href=function(s){return s.getAttribute("href",2)}}e=null})();if(document.querySelectorAll){(function(){var e=b,t=document.createElement("div");t.innerHTML="<p class='TEST'></p>";if(t.querySelectorAll&&t.querySelectorAll(".TEST").length===0){return}b=function(x,w,u,v){w=w||document;if(!v&&w.nodeType===9&&!b.isXML(w)){try{return a(w.querySelectorAll(x),u)}catch(y){}}return e(x,w,u,v)};for(var s in e){b[s]=e[s]}t=null})()}(function(){var e=document.createElement("div");e.innerHTML="<div class='test e'></div><div class='test'></div>";if(!e.getElementsByClassName||e.getElementsByClassName("e").length===0){return}e.lastChild.className="e";if(e.getElementsByClassName("e").length===1){return}f.order.splice(1,0,"CLASS");f.find.CLASS=function(s,t,u){if(typeof t.getElementsByClassName!=="undefined"&&!u){return t.getElementsByClassName(s[1])}};e=null})();function o(s,x,w,A,y,z){for(var u=0,t=A.length;u<t;u++){var e=A[u];if(e){e=e[s];var v=false;while(e){if(e.sizcache===w){v=A[e.sizset];break}if(e.nodeType===1&&!z){e.sizcache=w;e.sizset=u}if(e.nodeName.toLowerCase()===x){v=e;break}e=e[s]}A[u]=v}}}function r(s,x,w,A,y,z){for(var u=0,t=A.length;u<t;u++){var e=A[u];if(e){e=e[s];var v=false;while(e){if(e.sizcache===w){v=A[e.sizset];break}if(e.nodeType===1){if(!z){e.sizcache=w;e.sizset=u}if(typeof x!=="string"){if(e===x){v=true;break}}else{if(b.filter(x,[e]).length>0){v=e;break}}}e=e[s]}A[u]=v}}}b.contains=document.compareDocumentPosition?function(s,e){return !!(s.compareDocumentPosition(e)&16)}:function(s,e){return s!==e&&(s.contains?s.contains(e):true)};b.isXML=function(e){var s=(e?e.ownerDocument||e:0).documentElement;return s?s.nodeName!=="HTML":false};var h=function(e,y){var u=[],v="",w,t=y.nodeType?[y]:y;while((w=f.match.PSEUDO.exec(e))){v+=w[0];e=e.replace(f.match.PSEUDO,"")}e=f.relative[e]?e+"*":e;for(var x=0,s=t.length;x<s;x++){b(e,t[x],u)}return b.filter(v,u)};window.Sizzle=b})();bearhug.url={base:function(a){if(!this._base){this._base=(function(){var b=document.getElementsByTagName("script");for(var c=0;c<b.length;c++){var d=b[c].src||"";if(/\/media\/js\/integration\.js$/.test(d)){return d.substring(0,d.indexOf("/media/js/integration.js"))}}return""})()}return this._base+(a||"")}};bearhug.window={width:function(){return this.filter(window.innerWidth?window.innerWidth:0,document.documentElement?document.documentElement.clientWidth:0,document.body?document.body.clientWidth:0)},height:function(){return this.filter(window.innerHeight?window.innerHeight:0,document.documentElement?document.documentElement.clientHeight:0,document.body?document.body.clientHeight:0)},scrollLeft:function(){return this.filter(window.pageXOffset?window.pageXOffset:0,document.documentElement?document.documentElement.scrollLeft:0,document.body?document.body.scrollLeft:0)},scrollTop:function(){return this.filter(window.pageYOffset?window.pageYOffset:0,document.documentElement?document.documentElement.scrollTop:0,document.body?document.body.scrollTop:0)},filter:function(d,b,a){var c=d?d:0;if(b&&(!c||(c>b))){c=b}return a&&(!c||(c>a))?a:c}};(function(){var e=window.XMLHttpRequest;var a=!!window.controllers,h=window.document.all&&!window.opera,i=h&&window.navigator.userAgent.match(/MSIE ([\.0-9]+)/)&&RegExp.$1==7;function c(){this._object=e&&!i?new e:new window.ActiveXObject("Microsoft.XMLHTTP");this._listeners=[]}if(a&&e.wrapped){c.wrapped=e.wrapped}c.UNSENT=0;c.OPENED=1;c.HEADERS_RECEIVED=2;c.LOADING=3;c.DONE=4;c.prototype.readyState=c.UNSENT;c.prototype.responseText="";c.prototype.responseXML=null;c.prototype.status=0;c.prototype.statusText="";c.prototype.onreadystatechange=null;c.onreadystatechange=null;c.onopen=null;c.onsend=null;c.onabort=null;c.prototype.open=function(m,p,l,q,k){delete this._headers;if(arguments.length<3){l=true}this._async=l;var o=this,n=this.readyState,j;if(h&&l){j=function(){if(n!=c.DONE){d(o);o.abort()}};window.attachEvent("onunload",j)}if(c.onopen){c.onopen.apply(this,arguments)}if(arguments.length>4){this._object.open(m,p,l,q,k)}else{if(arguments.length>3){this._object.open(m,p,l,q)}else{this._object.open(m,p,l)}}if(!a&&!h){this.readyState=c.OPENED;b(this)}this._object.onreadystatechange=function(){if(a&&!l){return}o.readyState=o._object.readyState;f(o);if(o._aborted){o.readyState=c.UNSENT;return}if(o.readyState==c.DONE){d(o);if(h&&l){window.detachEvent("onunload",j)}}if(n!=o.readyState){b(o)}n=o.readyState}};c.prototype.send=function(j){if(c.onsend){c.onsend.apply(this,arguments)}if(j&&j.nodeType){j=window.XMLSerializer?new window.XMLSerializer().serializeToString(j):j.xml;if(!this._headers["Content-Type"]){this._object.setRequestHeader("Content-Type","application/xml")}}this._object.send(j);if(a&&!this._async){this.readyState=c.OPENED;f(this);while(this.readyState<c.DONE){this.readyState++;b(this);if(this._aborted){return}}}};c.prototype.abort=function(){if(c.onabort){c.onabort.apply(this,arguments)}if(this.readyState>c.UNSENT){this._aborted=true}this._object.abort();d(this)};c.prototype.getAllResponseHeaders=function(){return this._object.getAllResponseHeaders()};c.prototype.getResponseHeader=function(j){return this._object.getResponseHeader(j)};c.prototype.setRequestHeader=function(j,k){if(!this._headers){this._headers={}}this._headers[j]=k;return this._object.setRequestHeader(j,k)};c.prototype.addEventListener=function(m,l,k){for(var j=0,n;n=this._listeners[j];j++){if(n[0]==m&&n[1]==l&&n[2]==k){return}}this._listeners.push([m,l,k])};c.prototype.removeEventListener=function(m,l,k){for(var j=0,n;n=this._listeners[j];j++){if(n[0]==m&&n[1]==l&&n[2]==k){break}}if(n){this._listeners.splice(j,1)}};c.prototype.dispatchEvent=function(k){var l={type:k.type,target:this,currentTarget:this,eventPhase:2,bubbles:k.bubbles,cancelable:k.cancelable,timeStamp:k.timeStamp,stopPropagation:function(){},preventDefault:function(){},initEvent:function(){}};if(l.type=="readystatechange"&&this.onreadystatechange){(this.onreadystatechange.handleEvent||this.onreadystatechange).apply(this,[l])}for(var j=0,m;m=this._listeners[j];j++){if(m[0]==l.type&&!m[2]){(m[1].handleEvent||m[1]).apply(this,[l])}}};c.prototype.toString=function(){return"[object XMLHttpRequest]"};c.toString=function(){return"[XMLHttpRequest]"};function b(j){if(c.onreadystatechange){c.onreadystatechange.apply(j)}j.dispatchEvent({type:"readystatechange",bubbles:false,cancelable:false,timeStamp:new Date+0})}function g(l){var k=l.responseXML,j=l.responseText;if(h&&j&&k&&!k.documentElement&&l.getResponseHeader("Content-Type").match(/[^\/]+\/[^\+]+\+xml/)){k=new window.ActiveXObject("Microsoft.XMLDOM");k.async=false;k.validateOnParse=false;k.loadXML(j)}if(k){if((h&&k.parseError!=0)||!k.documentElement||(k.documentElement&&k.documentElement.tagName=="parsererror")){return null}}return k}function f(j){try{j.responseText=j._object.responseText}catch(k){}try{j.responseXML=g(j._object)}catch(k){}try{j.status=j._object.status}catch(k){}try{j.statusText=j._object.statusText}catch(k){}}function d(j){j._object.onreadystatechange=new window.Function}if(!window.Function.prototype.apply){window.Function.prototype.apply=function(j,k){if(!k){k=[]}j.__func=this;j.__func(k[0],k[1],k[2],k[3],k[4]);delete j.__func}}window.bearhug.xhr=c})();bearhug.widget={};bearhug.widget.overlay={button:function(){bearhug.load(function(b){var a=typeof b=="string"?document.getElementById(b):this._createButton(b);this._attachButton(a)},this,Array.prototype.slice.call(arguments))},open:function(){var f=this;var e=document.getElementsByTagName("embed");for(var d=0;d<e.length;d++){e[d].style.visibility="hidden"}e=document.getElementsByTagName("object");for(var d=0;d<e.length;d++){e[d].style.visibility="hidden"}if(this.iframe){this.iframe.style.display="block";this.modal.style.display="block";this.closeButton.style.display="block";return}var a=830;var j=550;var b=parseInt((bearhug.window.width()/2)-(a/2));var g=parseInt(bearhug.window.scrollTop())+parseInt((bearhug.window.height()/2)-(j/2));var c=document.createElement("iframe");c.src=bearhug.url.base()+"/overlay";c.className="bearhug-widget-overlay-iframe";c.frameBorder="0";c.scrolling="no";c.style.position="absolute";c.style.zIndex=100001;c.style.width=a+"px";c.style.height=j+"px";c.style.border="none";c.style.left=b+"px";c.style.top=g+"px";document.body.appendChild(c);this.iframe=c;var l=Math.max(Math.max(document.body.scrollHeight,document.documentElement.scrollHeight),Math.max(document.body.offsetHeight,document.documentElement.offsetHeight),Math.max(document.body.clientHeight,document.documentElement.clientHeight));var h=document.createElement("div");h.className="bearhug-widget-overlay-modal";h.style.position="absolute";h.style.top="0px";h.style.left="0px";h.style.zIndex=100000;h.style.width="100%";h.style.height=l+"px";h.style.background="#000";h.style.opacity=0.7;h.style.filter="alpha(opacity="+(70)+")";document.body.appendChild(h);this.modal=h;var k=document.createElement("div");k.style.position="absolute";k.style.top=parseInt(g+12)+"px";k.style.left=parseInt(b+a-50)+"px";k.style.zIndex=100002;k.style.width="25px";k.style.height="25px";k.style.cursor="pointer";k.style.background="url('"+bearhug.url.base()+"/media/img/overlay/close.png') no-repeat 0 0";document.body.appendChild(k);k.onclick=function(){f.close()};this.closeButton=k},close:function(){var a=document.getElementsByTagName("embed");for(var b=0;b<a.length;b++){a[b].style.visibility="visible"}a=document.getElementsByTagName("object");for(var b=0;b<a.length;b++){a[b].style.visibility="visible"}this.iframe.style.display="none";this.modal.style.display="none";this.closeButton.style.display="none"},_attachButton:function(c){if(!c){return}var d=this;var b=function(){d.open()};if(c.onclick){var a=c.onlick;c.onclick=function(){a();b()}}else{c.onclick=b}},_createButton:function(k){var k=k||{};var d=document.createElement("img");d.src=bearhug.url.base()+"/files/widget/overlay/button/"+k.id+".png";d.style.position="absolute";d.style.zIndex=100000;d.style.cursor="pointer";var h=parseInt(k.position.right);var c=parseInt(k.position.left);var g=parseInt(k.position.top);var a=parseInt(k.position.bottom);var b=h>-1?"right":"left";var i=h>-1?h:c;var e=g>-1?"top":"bottom";var f=g>-1?g:a;d.style[b]=i+"px";d.style[e]=f+"px";if(e=="top"&&f==0){var j={run:function(){var l=this;setTimeout(function(){d.style.top=bearhug.window.scrollTop()+"px";l.run()},10)}};j.run()}else{if(e=="bottom"&&f==0){var j={run:function(){var l=this;setTimeout(function(){d.style.bottom="-"+bearhug.window.scrollTop()+"px";l.run()},10)}};j.run()}}document.body.appendChild(d);return d}};
