if(typeof STIPPLE==="undefined")STIPPLE={};if(!this.JSON)this.JSON={};
(function(){function k(m){return m<10?"0"+m:m}function c(m){t.lastIndex=0;return t.test(m)?'"'+m.replace(t,function(q){var l=A[q];return typeof l==="string"?l:"\\u"+("0000"+q.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+m+'"'}function i(m,q){var l,n,u,y,w=o,r,j=q[m];if(j&&typeof j==="object"&&typeof j.toJSON==="function")j=j.toJSON(m);if(typeof v==="function")j=v.call(q,m,j);switch(typeof j){case "string":return c(j);case "number":return isFinite(j)?String(j):"null";case "boolean":case "null":return String(j);
case "object":if(!j)return"null";o+=s;r=[];if(Object.prototype.toString.apply(j)==="[object Array]"){y=j.length;for(l=0;l<y;l+=1)r[l]=i(l,j)||"null";u=r.length===0?"[]":o?"[\n"+o+r.join(",\n"+o)+"\n"+w+"]":"["+r.join(",")+"]";o=w;return u}if(v&&typeof v==="object"){y=v.length;for(l=0;l<y;l+=1){n=v[l];if(typeof n==="string")if(u=i(n,j))r.push(c(n)+(o?": ":":")+u)}}else for(n in j)if(Object.hasOwnProperty.call(j,n))if(u=i(n,j))r.push(c(n)+(o?": ":":")+u);u=r.length===0?"{}":o?"{\n"+o+r.join(",\n"+o)+
"\n"+w+"}":"{"+r.join(",")+"}";o=w;return u}}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+k(this.getUTCMonth()+1)+"-"+k(this.getUTCDate())+"T"+k(this.getUTCHours())+":"+k(this.getUTCMinutes())+":"+k(this.getUTCSeconds())+"Z":null};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()}}var t=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
o,s,A={"\u0008":"\\b","\t":"\\t","\n":"\\n","\u000c":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},v;if(typeof JSON.stringify!=="function")JSON.stringify=function(m,q,l){var n;s=o="";if(typeof l==="number")for(n=0;n<l;n+=1)s+=" ";else if(typeof l==="string")s=l;if((v=q)&&typeof q!=="function"&&(typeof q!=="object"||typeof q.length!=="number"))throw new Error("JSON.stringify");return i("",{"":m})}})();
(function(){var k=location.protocol+"//",c,i={},t,o=0,s=k+"a.stipplestatic.com/dots/",A=k+"a.stipplestatic.com/external/",v,m={},q,l,n,u,y,w,r,j,B,C,D,z,F,G,E,H;(function(){i=i||{};var a=function(b){return new Function("obj","var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push('"+b.replace(/[\r\t\n]/g," ").replace(/'(?=[^%]*%>)/g,"\t").split("'").join("\\'").split("\t").join("'").replace(/<%=(.+?)%>/g,"',$1,'").split("<%").join("');").split("%>").join("p.push('")+"');}return p.join('');")};
i.autocomplete_box=a('<div class="stipple-autocomplete-box">  <ul class="stipple-autocomplete-items">  </ul></div>');i.autocomplete_item=a('<li class="stipple-autocomplete-item">  <span class="stipple-autocomplete-partial-match"><%= text.substr(0, boldLength) %></span><%= text.substr(boldLength) %></li>');i.button=a('<a href="<%= link %>" class="<%= cssClass %> stipple-toolbar-button" <%= newWindow ? \'target="_stippledash"\' : \'\' %>><%= text %></a>');i.dot=a('<img class="stipple-dot" src="<%= image_url %>" />');
i.dot_box_button=a('<a href="<%= link %>" class="<%= cssClass %> stipple-dot-box-button <% if (selected) { %>stipple-selected<% } %>" target="_stippleNewWindow" >  <div class="stipple-button-image"></div>  <div class="stipple-button-label"><%= label %></div></a>');i.dot_info=a('<div class="stipple-dot-box stipple-dot-box-info">  <div class="stipple-dot-box-inner">    <% if (link && link.length) { %>      <a href="<%= link %>"><%= helpers.truncateStringOnSpace(title, 23) %></a>    <% } else { %>      <%= title %>    <% } %>      <% if (note) { %>      <div class="stipple-note">        <%= note %>      </div>    <% } %>  </div></div>');
i.dot_product=a('<div class="stipple-dot-box stipple-dot-box-product" <% if (has_product) { %> data-product-id="<%= product_id %>" <% } %>>  <div class="stipple-dot-box-inner">    <div class="stipple-title">      <% if (brand && model) { %>        <div class="stipple-model">          <%= helpers.truncateStringOnSpace(model, 23) %>        </div>        <div class="stipple-brand-subtitle">          by           <span class="stipple-brand">            <%= brand %>          </span>        </div>      <% } else { %>        <%= title %>      <% } %>    </div>    <div class="stipple-product-info">      <img src="<%= image_url %>" title="<%= title %>" alt="Image for <%= title %>" />      <div class="stipple-price-and-links">        <% if (has_offer) { %>          <%= JST.dot_box_button({link: buy_now_link, cssClass: \'stipple-shop\', label: \'shop\', selected: false}) %>        <% } %>                <% if (has_product) { %>          <%= JST.dot_box_button({link: \'#\', cssClass: \'stipple-want\', label: \'want\', selected: is_wanted}) %>        <% } %>                  <%= JST.dot_box_button({link: landing_link, cssClass: \'stipple-landing\', label: \'info\', selected: false}) %>        <div class="stipple-price"><%= price %></div>      </div>    </div>  </div></div>');
i.dot_wrapper=a('<div class="stipple-dottable-wrapper" style="height: <%= height %>; width: <%= width %>; display: <%= display %>; position: <%= position %>;"></div>');i.external_css=a("<style type=\"text/css\">  /*   * If a rule is added, it should be !important unless there's a reason for it not to be.   * This is to prevent issues on client sites where they have a lot of specific styles setup.   * If a rule should not be !important, it should be commented as such. Non-!important, uncommented   * rules should be assumed to be missing the !important.   */      /*   * DOT IMAGES   */  img.stipple-dot {    width: 25px !important;    height: 25px !important;  }    /*   * TOOLBAR LOGO   */  .stipple-logo {    z-index: 100000 !important;    height: 37px !important;    width: 37px !important;    position: absolute !important;    left: 0 !important;    bottom: 0 !important;  }    /*   * WRAPPER OVERLAY   */  .stipple-new-dot-overlay {    display: none; /* NOT !important */    position: absolute !important;    left: 0 !important;    top: 0 !important;    height: 100% !important;    width: 100% !important;    background-color: transparent; /* NOT !important or cannot be overridden for IE, which does not fire clicks on transparent divs */  }    /*    * BUTTONS   */  a.stipple-dot-box-button {    -moz-border-radius: 6px !important;    -webkit-border-radius: 6px !important;    color: white !important;    cursor: pointer !important;    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif !important;    font-size: 13px !important;    height: 20px !important;    text-decoration: none !important;    display: block !important;  }    a.stipple-toolbar-button {    -moz-border-radius: 6px !important;    -webkit-border-radius: 6px !important;    color: white !important;    cursor: pointer !important;    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif !important;    font-size: 13px !important;    height: 20px !important;    line-height: 20px !important;    text-align: center !important;    text-decoration: none !important;    display: inline-block !important;    margin: 7px 3px 1px 0 !important;    background-color: #41AEE5 !important;    width: 80px !important;  }      /*   * DOT BOX POPUPS   */  .stipple-dot-box {    position: absolute !important;    display: none; /* NOT !important or dot boxes stop appearing */    z-index: 100001 !important;  }    .stipple-dot-box .stipple-dot-box-inner {    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif !important;  }    .stipple-dot-box-info .stipple-dot-box-inner {    max-width: 180px !important;    -moz-border-radius: 6px !important;    -webkit-border-radius: 6px !important;    background-color: white !important;    padding: 4px 8px !important;  }    .stipple-dot-box-info a, .stipple-dot-box-info a:visited {    color: #41AEE5 !important;    font-size: 14px !important;      }    .stipple-dot-box-info a:hover {    color: #41AEE5 !important;  }    .stipple-dot-box-product .stipple-dot-box-inner {    width: 180px !important;  }    .stipple-dot-box-product .stipple-title {    -moz-border-radius-topleft: 5px !important;    -moz-border-radius-topright: 5px !important;    -webkit-border-top-left-radius: 5px !important;    -webkit-border-top-right-radius: 5px !important;    background-color: #222 !important;    color: white !important;    font-size: 14px !important;    padding: 4px 6px !important;    word-wrap: break-word !important;  }    .stipple-dot-box-product .stipple-brand-subtitle {    font-size: 10px !important;  }    .stipple-dot-box-product .stipple-brand-subtitle .stipple-brand {    font-weight: bold !important;  }    .stipple-dot-box-product .stipple-product-info {    -moz-border-radius-bottomleft: 5px !important;    -moz-border-radius-bottomright: 5px !important;    -webkit-border-bottom-left-radius: 5px !important;    -webkit-border-bottom-right-radius: 5px !important;    background-color: white !important;    padding: 5px 0 0 5px !important;  }          .stipple-dot-box-product .stipple-product-info img {    display: inline-block !important;    height: 96px !important;    width: 96px !important;    word-wrap: break-word !important;    overflow: hidden !important;  }          .stipple-dot-box-product .stipple-price-and-links {    display: inline-block !important;    vertical-align: top !important;    width: 70px !important;    margin-left: 1px !important;  }    /* we need context for selected since we use selected elsewhere */  .stipple-price-and-links a.stipple-selected {     background-color: #CC0033 !important;   }    .stipple-price-and-links a.stipple-selected:hover, a.stipple-dot-box-button:hover {    background-color: #41AEE5 !important;  }    a.stipple-dot-box-button .stipple-button-image {    height: 10px !important;    width: 13px !important;    margin: 5px 5px 5px 11px !important;    float: left !important;  }    a.stipple-dot-box-button .stipple-button-label {    float: left !important;    margin-top: -1px !important;  }    a.stipple-shop, a.stipple-want {    margin-bottom: 5px !important;  }      a.stipple-shop {    background-color: #444 !important;  }    a.stipple-shop .stipple-button-image {    background: transparent url(<%= externalImgPath %>buttons.png) 0 0 no-repeat !important;  }    a.stipple-want {    background-color: #555 !important;  }    a.stipple-want .stipple-button-image {    background: transparent url(<%= externalImgPath %>buttons.png) 0 -11px no-repeat !important;  }    a.stipple-landing {    background-color: #666 !important;  }    a.stipple-landing .stipple-button-image {    background: transparent url(<%= externalImgPath %>buttons.png) 0 -22px no-repeat !important;  }    .stipple-dot-box-product .stipple-price-and-links .stipple-price {    color: #333 !important;    font-size: 13px !important;    word-wrap: break-word !important;    text-align: center !important;    margin-top: 5px !important;  }  /*   * AUTOCOMPLETE STUFF   */  .stipple-autocomplete-box {    width: 200px !important;    position: absolute !important;    display: none; /* NOT !important */    z-index: 100001 !important;    background-color: red !important;  }          .stipple-autocomplete-box .stipple-autocomplete-items {    list-style: none !important;    padding: 0 !important;    margin: 0 !important;  }          .stipple-autocomplete-box .stipple-autocomplete-item {    padding: 5px !important;  }    .stipple-autocomplete-box .stipple-autocomplete-partial-match {    text-decoration: underline !important;    font-weight: bold !important;  }          /*   * TOOLBAR   */  .stipple-toolbar {    line-height: 1.5 !important;    display: none; /* NOT !important */    color: white !important;    position: absolute !important;    left: 0 !important;    bottom: 0 !important;    width: 100% !important;    z-index: 99999 !important;    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif !important;    font-size: 11px !important;  }          .stipple-toolbar .stipple-toolbar-overlay {    z-index: 150000 !important;    text-align: center !important;    width: 100% !important;    display: none; /* NOT !important */  }      .stipple-toolbar .stipple-toolbar-overlay img.loading {    width: 128px !important;    height: 15px !important;    margin-top: 5px !important;    margin-bottom: 5px !important;    border: none !important;  }          .stipple-toolbar .stipple-caption {    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif !important;    font-size: 16px !important;    padding: 6px 20px !important;    text-align: center !important;    word-wrap: break-word !important;  }          .stipple-toolbar .stipple-controls {    display: none; /* NOT !important */    padding: 0 20px 5px 45px !important;    text-align: left !important;  }          .stipple-toolbar .stipple-controls .stipple-buttons {    text-align: left !important;  }  .stipple-toolbar .stipple-controls .stipple-add-a-dot-controls,  .stipple-toolbar .stipple-controls .stipple-delete-a-dot-controls {    margin-top: 5px !important;    display: none; /* NOT !important */  }  .stipple-toolbar .stipple-controls .stipple-add-dot-info {    display: none; /* NOT !important */    padding-top: 10px !important;  }      .stipple-toolbar .stipple-controls .stipple-add-dot-info .stipple-dot-type-image {    display: inline-block !important;  }      .stipple-toolbar .stipple-controls .stipple-add-dot-info .stipple-dot-type-image img,  .stipple-new-dot {    height: 25px !important;    width: 25px !important;    padding: 0px !important;    border: none !important;    padding: 0 !important;    background: transparent !important;    /* platform specific hacks ... concerned this will grow but not sure how we can do a global reset of all attributes on a single element... */    -moz-box-shadow: none !important; /* for blogspot */   }        .stipple-toolbar .stipple-controls .stipple-add-dot-info .stipple-dot-type-image span {    display: inline-block !important;    margin-top: 3px !important;    vertical-align: top !important;  }  .stipple-toolbar .stipple-controls .stipple-add-dot-info .stipple-product-fields .stipple-item {    margin-bottom: 5px !important;    margin-right: 5px !important;  }  .stipple-toolbar .stipple-controls .stipple-add-dot-info .stipple-product-fields .stipple-item input {    display: block; /* NOT !important */    width: 225px !important;    padding: 2px !important;    border: 1px solid #AAA !important;    color: #333 !important;    font-size: 11px !important;    font-family: 'Lucida Grande', Arial, sans-serif !important;  }  .stipple-toolbar .stipple-controls .stipple-add-dot-info .stipple-product-fields .stipple-item .stipple-model,  .stipple-toolbar .stipple-controls .stipple-add-dot-info .stipple-product-fields .stipple-item .stipple-specific-category {    margin-top: 5px !important;  }    .stipple-toolbar .stipple-controls .stipple-add-dot-info .stipple-product-fields .stipple-item .stipple-title-vs-brand-model-chooser {    width: 225px !important;    margin-bottom: 5px !important;  }      .stipple-toolbar .stipple-controls .stipple-add-dot-info .stipple-product-fields .stipple-item .stipple-title-vs-brand-model-chooser a,   .stipple-toolbar .stipple-controls .stipple-add-dot-info .stipple-product-fields .stipple-item .stipple-title-vs-brand-model-chooser div {    display: inline-block !important;  }      .stipple-toolbar .stipple-controls .stipple-add-dot-info .stipple-product-fields .stipple-item .stipple-title-vs-brand-model-chooser a {    color: white !important;    padding: 2px !important;  }    .stipple-toolbar .stipple-controls .stipple-add-dot-info .stipple-product-fields .stipple-item .stipple-title-vs-brand-model-chooser a.stipple-selected {    color: black !important;    background-color: white !important;    -moz-border-radius: 2px !important;    -webkit-border-radius: 2px !important;    text-decoration: none !important;  }    .stipple-toolbar .stipple-controls .stipple-add-dot-info .stipple-product-fields .stipple-item .stipple-doesnt-know-brand-model-fields,  .stipple-toolbar .stipple-controls .stipple-add-dot-info .stipple-product-fields .stipple-item .stipple-knows-brand-model-fields {    display: none; /* NOT !important */  }    .stipple-toolbar .stipple-controls .stipple-add-dot-info .stipple-product-fields .stipple-item .stipple-specific-category {    display: none; /* NOT !important */  }    .stipple-toolbar .stipple-controls .stipple-add-dot-info .stipple-product-fields .stipple-item .stipple-category-select {    width: 230px !important;    display: none; /* NOT !important */    margin-bottom: 5px !important;  }  .stipple-toolbar .stipple-controls .stipple-add-dot-info .stipple-product-fields .stipple-description {    vertical-align: top !important;    display: none; /* NOT !important */  }  .stipple-toolbar .stipple-controls .stipple-add-dot-info .stipple-product-fields .stipple-description textarea {    display: block; /* NOT !important */    width: 225px !important;    height: 60px !important;    padding: 2px !important;    border: 1px solid #AAA !important;    color: #333 !important;    font-size: 11px !important;    font-family: 'Lucida Grande', Arial, sans-serif !important;  }  .stipple-toolbar .stipple-controls .stipple-add-dot-info .stipple-new-info-dot-form {    display: none; /* NOT !important */  }  .stipple-toolbar .stipple-controls .stipple-add-dot-info .stipple-info-fields input,  .stipple-toolbar .stipple-controls .stipple-add-dot-info .stipple-info-fields textarea {    display: block !important;    width: 225px !important;    margin-top: 5px !important;    padding: 2px !important;    border: 1px solid #AAA !important;    color: #333 !important;    font-size: 11px !important;    font-family: 'Lucida Grande', Arial, sans-serif !important;  }  .stipple-toolbar .stipple-controls .stipple-add-dot-info .stipple-info-fields textarea {    height: 60px !important;  }  .stipple-toolbar .stipple-controls .stipple-general-info-controls {    height: 110px; /* NOT !important - breaks slideDown transition when opening form */    position: relative !important;    display: none; /* NOT !important */    text-align: left !important;  }  .stipple-toolbar .stipple-controls .stipple-general-info-controls input {    display: block !important;     width: 190px !important;    margin-top: 5px !important;    padding: 2px !important;    border: 1px solid #AAA !important;    color: #333 !important;    font-size: 11px !important;    font-family: 'Lucida Grande', Arial, sans-serif !important;  }  .stipple-toolbar .stipple-controls .stipple-general-info-controls input.stipple-caption-input {    margin-top: 10px !important;  }  .stipple-toolbar .stipple-controls .stipple-general-info-controls .stipple-step-buttons {    position: absolute !important;    bottom: 0 !important;    left: 0 !important;  }</style>");
i.external_css_ie7=a('<!--[if IE 7]>  <style type="text/css">    a.stipple-toolbar-button,    .stipple-dot-box .stipple-dot-box-inner .stipple-info img,    .stipple-dot-box .stipple-price-and-links,    .stipple-toolbar .stipple-controls .stipple-add-dot-info .stipple-dot-type-image,    .stipple-toolbar .stipple-controls .stipple-add-dot-info .stipple-dot-type-image span {      display: inline !important;      zoom: 1 !important;    }        .stipple-toolbar .stipple-controls .stipple-general-info-controls {      height: 120px; /* NOT !important - breaks slideDown transition when opening form */    }        .stipple-toolbar .stipple-controls .stipple-add-dot-info .stipple-dot-specific-fields {      height: 170px !important;    }  </style><![endif]--\>');
i.logo=a('<div class="stipple-logo" title="<%= title %>" style="cursor: <%= cursor %>; background: url(<%= image_host %>/external/hint.png) no-repeat scroll left bottom transparent;"></div>');i.toolbar=a('<div class="stipple-toolbar stipple-template" style="background: url(<%= image_host %>/external/meta-bg.png);">  <div class="stipple-toolbar-overlay"><img src="<%= image_host %>/external/loading.gif" class="loading" /></div>  <div class="stipple-toolbar-contents">    <div class="stipple-caption">      <%= photoCaption %>    </div>    <div class="stipple-controls">      <div class="stipple-buttons">        <%= JST.button({text: "add dot", cssClass: "stipple-add-a-dot-button", link: "#", newWindow: false}) %>        <%= JST.button({text: "delete dot", cssClass: "stipple-delete-a-dot-button", link: "#", newWindow: false}) %>        <%= JST.button({text: "caption", cssClass: "stipple-edit-general-info-button", link: "#", newWindow: false}) %>        <%= JST.button({text: "dashboard", cssClass: "stipple-dashboard-button", link: hostName + "/dashboard", newWindow: true}) %>      </div>      <div class="stipple-add-a-dot-controls stipple-sub-controls">        <div class="stipple-place-dot stipple-step">          Click anywhere in the picture to start.        </div>      </div>      <div class="stipple-delete-a-dot-controls stipple-sub-controls">        <div class="stipple-select-dot stipple-step">          Click a dot to delete.        </div>      </div>      <div class="stipple-add-dot-info stipple-step">        <div class="stipple-dot-type">          <div class="stipple-dot-type-images">            <div class="stipple-dot-type-image" data-stipple-dot-type="product">              <img src="<%= image_host %>/dots/product-blue.png" />              <span>Product</span>            </div>            <div class="stipple-dot-type-image" data-stipple-dot-type="info">              <img src="<%= image_host %>/dots/info.png" />              <span>Info</span>            </div>          </div>        </div>        <form class="stipple-new-product-dot-form stipple-form">          <input type="hidden" name="dot[dot_type]" value="product"/>          <input type="hidden" name="dot[site_id]" value="<%= site_id %>" />          <input type="hidden" name="dot[url]" value="<%= encodeURIComponent(location.href) %>" />          <input type="hidden" name="dot[start_x]" value="0" />          <input type="hidden" name="dot[start_y]" value="0" />          <input type="hidden" name="image_height" value="<%= imageHeight %>" />          <input type="hidden" name="image_width" value="<%= imageWidth %>" />          <input type="hidden" name="url" value="<%= encodeURIComponent(photoUrl) %>" />          <div class="stipple-product-fields stipple-dot-specific-fields">            <div class="stipple-item">              <div class="stipple-title-vs-brand-model-chooser">                <div>Do you know the brand or model?</div>                <a href="#" data-stipple-class-to-show="stipple-knows-brand-model-fields">Yes</a>                <a href="#" data-stipple-class-to-show="stipple-doesnt-know-brand-model-fields">No</a>              </div>                          <select name="dot[category]" class="stipple-category-select">                <option selected="selected">Choose a Category</option>                <option value="clothing">Clothing</option>                <option value="electronics">Electronics</option>                <option value="home/office/garden">Home/Garden/Office</option>                <option value="sports">Sports</option>                <option value="automotive">Automotive</option>                <option value="other">Other</option>              </select>                          <div class="stipple-title-vs-brand-model-chooser-fields">                <div class="stipple-knows-brand-model-fields">                  <input type="text" name="dot[brand]" class="stipple-brand" data-stipple-empty-val="brand" value="brand" autocomplete="off" />                  <%= JST.autocomplete_box({}) %>                              <input type="text" name="dot[model]" class="stipple-model" data-stipple-empty-val="model" value="model" autocomplete="off"/>                  <%= JST.autocomplete_box({}) %>                </div>                            <div class="stipple-doesnt-know-brand-model-fields" >                  <input type="text" name="dot[title]" class="stipple-title" data-stipple-empty-val="title" value="title" />                </div>              </div>                          <input type="text" name="dot[tag_list]" class="stipple-specific-category" data-stipple-empty-val="comma, separated, tags" value="comma, separated, tags" />            </div>            <div class="stipple-description">              <textarea name="dot[note]" data-stipple-empty-val="description">description</textarea>            </div>          </div>        </form>        <form class="stipple-new-info-dot-form stipple-form">          <input type="hidden" name="dot[dot_type]" value="info"/>          <input type="hidden" name="dot[site_id]" value="<%= site_id %>" />          <input type="hidden" name="dot[url]" value="<%= encodeURIComponent(location.href) %>" />          <input type="hidden" name="dot[start_x]" value="0" />          <input type="hidden" name="dot[start_y]" value="0" />          <input type="hidden" name="image_height" value="<%= imageHeight %>" />          <input type="hidden" name="image_width" value="<%= imageWidth %>" />          <input type="hidden" name="url" value="<%= encodeURIComponent(photoUrl) %>" />          <div class="stipple-info-fields stipple-dot-specific-fields">            <input type="text" name="dot[title]" class="stipple-freebase-object" value="title" data-stipple-empty-val="title"/>            <input type="text" name="dot[link]" value="url" data-stipple-empty-val="url" />            <textarea name="dot[note]" data-stipple-empty-val="description">description</textarea>          </div>        </form>        <div class="stipple-step-buttons">          <%= JST.button({text: "&lt; move", cssClass: "stipple-change-position-button", link: "#", newWindow: false}) %>          <%= JST.button({text: "finish &gt;", cssClass: "stipple-new-dot-finish-button", link: "#", newWindow: false}) %>          <%= JST.button({text: "cancel", cssClass: "stipple-cancel-button", link: "#", newWindow: false}) %>        </div>      </div>      <div class="stipple-general-info-controls stipple-sub-controls">        <form class="stipple-form">          <input type="hidden" name="image_height" value="<%= imageHeight %>" />          <input type="hidden" name="image_width" value="<%= imageWidth %>" />          <input type="hidden" name="image_src" value="<%= encodeURIComponent(photoUrl) %>" />          <input type="hidden" name="site_id" value="<%= site_id %>" />          <input type="hidden" name="site_url" value="<%= encodeURIComponent(location.href) %>" />          <input type="text" class="stipple-caption-input" name="caption" value="<%= photoCaption || \'caption\' %>" data-stipple-empty-val="caption" />          <input type="text" name="location" data-stipple-freebase-type="location" class="stipple-freebase-object" value="<%= photoLocation || \'where is this?\' %>" data-stipple-empty-val="where is this?" />                    <input type="text" name="event" data-stipple-freebase-type="event" class="stipple-freebase-object" value="<%= photoEvent  || \'event\' %>" data-stipple-empty-val="event" />        </form>        <div class="stipple-step-buttons">          <%= JST.button({text: "save", cssClass: "stipple-save-caption-button", link: "#", newWindow: false}) %>          <%= JST.button({text: "cancel", cssClass: "stipple-cancel-button", link: "#", newWindow: false}) %>        </div>      </div>    </div>  </div></div>')})();
var I=function(){var a,b,d=1,e;return{postMessage:function(g,f,h){if(f){h=h||parent;if(window.postMessage)h.postMessage(g,f.replace(/([^:]+:\/\/[^\/]+).*/,"$1"));else if(f)h.location=f.replace(/#.*$/,"")+"#"+ +new Date+d++ +"&"+g}},receiveMessage:function(g,f){if(window.postMessage){if(g)e=function(h){if(typeof f==="string"&&h.origin!==f||Object.prototype.toString.call(f)==="[object Function]"&&f(h.origin)===false)return false;g(h)};window.addEventListener?window[g?"addEventListener":"removeEventListener"]("message",
e,false):window[g?"attachEvent":"detachEvent"]("onmessage",e)}else{a&&clearInterval(a);a=null;if(g)a=setInterval(function(){var h=document.location.hash,p=/^#?\d+&/;if(h!==b&&p.test(h)){b=h;g({data:h.replace(p,"")})}},100)}}}}();v={truncateStringOnSpace:function(a,b){var d=a.substring(0,b),e;if(a.length<=b)return a;if(a[b]!==" "){e=d.lastIndexOf(" ");d=d.substring(0,e)}return d}};q=function(a){a||(a=c);return!(a.browser.msie&&parseFloat(a.browser.version)<7)&&!/playstation 3/i.test(navigator.userAgent)};
l=function(){return c.browser.msie};n=function(){return c.browser.msie&&parseFloat(c.browser.version)===7};u=function(){return c.browser.webkit};y=function(a){var b={};a=a.split(/\s+/);c(a).each(function(){if(this.indexOf("stippleit-sid-")!==-1){var d=this.split("-");b[d[1]]=d[2]}});return b};w=function(a){var b;a=a.attr("src")||a.css("background-image");if(b=/url\(['"]?([a-zA-Z0-9_\$\.\+!\*\(\)-:\/]+)['"]?\)/.exec(a))a=b[1];if(!/^https?:/.test(a))if(a.charAt(0)==="/")a=k+location.host+a;else{if(location.pathname.charAt(location.pathname.length-
1)!=="/")a="/"+a;a=k+location.host+location.pathname+a}return a};r=function(){var a={};c("[class*=stippleit-sid-]").each(function(){var b=c(this),d=y(b.attr("class"));a[d.sid]=a[d.sid]||[];a[d.sid].push(b)});return a};j=function(a){var b,d,e;b=a.css("position")==="static"?"relative":a.css("position");d=a.css("display")==="inline"?"inline-block":a.css("display");if(a.parent().is(".stipple-dottable-wrapper")){e=a.parent();e.css({height:a.css("height"),width:a.css("width")});a.siblings(":not(.stipple-new-dot-overlay)").remove()}else{e=
c(i.dot_wrapper({height:a.css("height"),width:a.css("width"),display:d,position:b}));e=a.wrap(e).parent();a.css({position:"",display:""});b=c('<div class="stipple-new-dot-overlay" />');b.appendTo(e);l()&&b.css({"background-color":"black",opacity:0.01});b=["margin-top","margin-right","margin-left","margin-bottom"];if(a.is("img"))b=b.concat(["padding-top","padding-right","padding-left","padding-bottom"]);c.each(b,function(g,f){if(a.css(f).length){e.css(f,a.css(f));a.css(f,0)}})}e.attr("data-stipple-dom-id",
o);o+=1;return e};B=function(a,b){var d,e,g,f,h;d=j(a);d.data("photoData",b);d.data("site_id",a.data("site_id"));e=w(a);if((f=b.user_can_edit)||b.caption&&c.trim(b.caption).length>0||b.dots&&b.dots.length>0){f=c(i.logo({title:f?"Click here for edit mode":"",cursor:f?"pointer":"auto",image_host:k+"a.stipplestatic.com"}));f.appendTo(d)}f=a.width()||parseInt(a.css("width"),10);h=a.height()||parseInt(a.css("height"),10);e=c(i.toolbar({JST:i,photoUrl:e,imageWidth:f,imageHeight:h,site_id:a.data("site_id"),
image_host:k+"a.stipplestatic.com",hostName:k+"stippleit.com",photoCaption:b.caption,photoLocation:b.location,photoEvent:b.event}));e.appendTo(d);n()&&e.css("width",f);!b||c.isEmptyObject(b)||!b.dots||c.each(b.dots,function(){g=c(i.dot({image_url:s+"plain.png"}));g.data("dotData",this).css({opacity:0.4,position:"absolute",left:this.start_x-12,top:this.start_y-12,display:"block"}).appendTo(d).animate({opacity:0},1500)})};C=function(a){var b;c.each(a,function(d,e){c.each(e,function(g,f){b=w(f);f.data("site_id",
d);c.get(k+"stippleit.com/recall_dots/"+d+"/",{url:b},function(h){var p;u()&&f.is("img")&&(!f.width()||!f.height())?f.load(function(){B(f,h)}):B(f,h);if(p=f.data("stipple-callbackBatches")){c.each(p,function(x){m[x].stillLoading-=1;if(!m[x].stillLoading){m[x].callback(a);delete m[x]}});f.removeData("stipple-callbackBatches")}},"jsonp")})})};D=function(a){return setTimeout(function(){a.data("removeTimer",0).stippleDisappear()},300)};F=function(){var a,b=k+"stippleit.com";if(t)return t;a=n()?encodeURIComponent(k+
location.host+location.pathname+location.search):encodeURIComponent(k+location.host);a=k+"stippleit.com/external_embeds/?cachebust="+Date.parse(new Date)+"&parent_href="+a;if(n())b=a+"#";t=c('<iframe src="'+a+'" style="display: none;"/>');c("body").append(t);I.receiveMessage(function(d){var e=c.parseJSON(d.data);d=c("div[data-stipple-dom-id="+e.dom_id+"]");var g;if(n())location.hash="";switch(e.action){case "dot:create":d.stippleEnableForms();if(e.status==="success"){d.stippleDisableNewDotMode();
g=d.data("photoData");g.dots=g.dots||[];g.dots.push(e.data);d.find(".stipple-new-dot").removeClass("stipple-new-dot").addClass("stipple-dot").attr("src",s+"plain.png").data("dotData",e.data).end().find(".stipple-buttons, .stipple-add-dot-info").slideToggle("fast").end().find(".stipple-dot:hidden").show().end().find(".stipple-add-dot-info form").find("input[data-stipple-empty-val]").each(function(){var p=c(this);p.val(p.attr("data-stipple-empty-val"))}).end().find("textarea").val("").end().find("select option:first").attr("selected",
"selected")}else{try{g=e.data.join("\n")}catch(f){g=e.message}alert("There was an error creating your dot. The errors were:\n\n"+g)}break;case "photo:caption":d.stippleEnableForms();if(e.status==="success"){d.stippleDisableNewDotMode();d.data("photoData",e.data).find(".stipple-caption").text(e.data.caption).end().find(".stipple-buttons, .stipple-general-info-controls").slideToggle("fast")}else{try{g=e.data.join("\n")}catch(h){g=e.message}alert("There was an error adding information to this image. The errors were:\n\n"+
g)}break;case "dot:delete":if(e.status==="success"){d.removeData("wrapperMode").stippleEnableForms().find(".stipple-deleteable-dot").removeClass("stipple-deleteable-dot").end().find(".stipple-dot-to-delete").fadeOut("fast",function(){c(this).remove()}).stippleCancelEditMode();d.find(".stipple-logo").stippleChangeLogoMode("normal");g=d.data("photoData");g.dots=c.grep(g.dots,function(){return this.id!==e.data});d.data("photoData",g);c.each(d.data("photoData").dots,function(){})}else alert("There was an error deleting the dot. The message was: "+
e.message);break;case "user:toggle_want_for":if(e.status==="success"){d=d.find(".stipple-want");e.message==="wanted"?d.addClass("stipple-selected"):d.removeClass("stipple-selected")}else alert(e.message);break}},b);return t};z=function(a){var b=k+"stippleit.com";if(t){if(n())b=t.attr("src");I.postMessage(a,b,t[0].contentWindow)}};G=function(){c.fn.stippleFadeToDistance=function(a,b){var d=c(this);c.each(d,function(){var e=c(this),g,f;g=parseInt(e.css("left"),10)+12;f=parseInt(e.css("top"),10)+12;
g=g-a;f=f-b;f=Math.sqrt(g*g+f*f);f=Math.round(f);f<100?e.attr("src",s+e.data("dotData").dot_type+".png"):e.attr("src",s+"plain.png");g=0.4;if(f<200){g=1-f/200;g=Math.max(0.4,g)}e.css({opacity:g})});return d};c.fn.stippleChangeLogoMode=function(a){var b,d=c(this);b={normal:"hint.png",hover:"hint-edit.png",editing:"hint-exit.png"};b=b[a]||b.normal;d.data("logoMode",a);return d.css("background-image","url("+A+b+")")};c.fn.stippleUserCanEdit=function(){var a=c(this).stippleWrapper().data("photoData");
return a&&a.user_can_edit};c.fn.stippleWrapper=function(){return c(this).closest(".stipple-dottable-wrapper")};c.fn.stippleDisappear=function(){var a=c(this);a.stop().fadeTo("fast",0,function(){a.hide()});return a};c.fn.stippleAppear=function(){var a=c(this);a.stop().show().fadeTo("fast",1);return a};c.fn.stippleCancelEditMode=function(){var a=c(this).stippleWrapper(),b=a.find(".stipple-toolbar"),d=b.find(".stipple-controls"),e=b.find(".stipple-caption");a.stippleDisableNewDotMode();a.children(".stipple-dot:hidden").show().end().children(".stipple-new-dot").fadeOut("fast",
function(){c(this).remove()}).end().children(".stipple-deleteable-dot").css("cursor","auto").removeClass("stipple-deleteable-dot");b.find(".stipple-caption, .stipple-controls").slideToggle("fast",function(){d.children(".stipple-buttons:hidden").show().end().children(":not(.stipple-buttons):visible").hide()});c.trim(e.text())===""&&b.stippleDisappear();return a};c.fn.stippleUpdateFormCoordinates=function(a,b){var d=c(this);d.find("input[name=dot[start_x]]").val(a);d.find("input[name=dot[start_y]]").val(b)};
c.fn.stippleSetDotFormType=function(a){var b=c(this);b.find(".stipple-dot-type-images").children("div").each(function(){var d=c(this);d.attr("data-stipple-dot-type")===a?d.css("cursor","auto").find("img").attr("src",s+d.attr("data-stipple-dot-type")+"-blue.png"):d.css("cursor","pointer").find("img").attr("src",s+d.attr("data-stipple-dot-type")+".png")}).end().end().find("form.stipple-new-"+a+"-dot-form").slideDown("fast").end().find("form:not(.stipple-new-"+a+"-dot-form)").slideUp("fast");return b};
c.fn.stippleNewAutoCompleteSuggestions=function(a,b){var d=c(this),e=d.children(".stipple-autocomplete-items");e.empty();c.each(a,function(){e.append(i.autocomplete_item({text:this,boldLength:b}))});d.removeData("selectedIndex").find(".stipple-selected").removeClass("stipple-selected");return d};c.fn.stippleArrowPressed=function(a,b){var d=c(this),e=d.data("acBox"),g,f;if(!e)return d;g=e.data("selectedIndex");f=e.find("li");if(typeof g==="undefined")g=a;else{f.eq(g).css({color:"white","background-color":"red"}).removeClass("stipple-selected");
g=b(g,f.length-1)}e.data("selectedIndex",g);f.eq(g).css({color:"red","background-color":"white"}).addClass("stipple-selected");return d};c.fn.stippleUpArrowPressed=function(){var a=c(this),b=a.data("acBox");if(!b)return a;b=b.find("li.stipple-autocomplete-item");return a.stippleArrowPressed(b.length-1,function(d,e){d-=1;if(d<0)d=e;return d})};c.fn.stippleDownArrowPressed=function(){var a=c(this),b=a.data("acBox");if(!b)return a;b.find("li.stipple-autocomplete-item");return a.stippleArrowPressed(0,
function(d,e){d+=1;if(d>e)d=0;return d})};c.fn.stippleDisableForms=function(){var a=c(this);a.stippleWrapper().data("disableForms",true).find(".stipple-toolbar-overlay").slideDown().siblings(".stipple-toolbar-contents").slideUp();return a};c.fn.stippleEnableForms=function(){var a=c(this);a.stippleWrapper().removeData("disableForms").find(".stipple-toolbar-overlay").slideUp().siblings(".stipple-toolbar-contents").slideDown();return a};c.fn.stippleEnableNewDotMode=function(){var a=c(this);a.stippleWrapper().data("wrapperMode",
"new_dot").children(".stipple-new-dot-overlay").show();return a};c.fn.stippleDisableNewDotMode=function(){var a=c(this);a.stippleWrapper().removeData("wrapperMode").children(".stipple-new-dot-overlay").hide();return a};c(".stipple-dot-type-image").live("click",function(){var a=c(this);a.closest(".stipple-add-dot-info").stippleSetDotFormType(a.attr("data-stipple-dot-type"));return false});c(".stipple-dot").live("mouseenter",function(){var a=c(this),b=a.stippleWrapper(),d=b.data("wrapperMode"),e=a.data("dotData"),
g=e.dot_type||"product",f=a.data("dotBox"),h,p;if(d==="new_dot")return true;a.attr("src",s+g+"-blue.png");if(!f){f=c(i["dot_"+g]({JST:i,model:e.model,brand:e.brand,title:e.title,image_url:e.product_image,price:e.product_price,buy_now_link:e.buy_product_link,landing_link:e.landing_link,product_id:e.product_id,is_wanted:e.is_wanted,note:e.note,link:e.link,has_offer:e["has_offer?"],has_product:e["has_product?"],helpers:v}));a.data("dotBox",f);f.appendTo(a.stippleWrapper())}if(f.data("removeTimer")){clearTimeout(f.data("removeTimer"));
f.removeData("removeTimer")}g=function(x){return x-f.height()-8};h=function(x){return x-f.width()/2+12};d=g(a.offset().top);g=g(a.position().top);p=h(a.offset().left);h=h(a.position().left);if(g<0||d<c(window).scrollTop())g+=a.height()+f.height()+16;if(h<0||p<c(window).scrollLeft())h+=f.width()/2+12;else if(h+f.width()>b.width()||p+f.width()>c(window).width()+c(window).scrollLeft())h-=f.width()/2+12;f.css({opacity:0,top:g,left:h}).stop().show().fadeTo("fast",1);z(c.param({act:"dot:mouseover",id:e.id}))}).live("mouseleave",
function(){var a=c(this),b=a.data("dotData"),d=a.data("dotBox");a.attr("src",k+"stippleit.com"+b.image_file);if(d){a=D(d);d.data("removeTimer",a)}});c(".stipple-dot-box").live("mouseenter",function(){var a=c(this);if(a.data("removeTimer")){clearTimeout(a.data("removeTimer"));a.removeData("removeTimer")}}).live("mouseleave",function(){var a=c(this),b;b=D(a);a.data("removeTimer",b)});c(".stipple-dottable-wrapper").live("mouseenter",function(){var a=c(this);if(a.find(".stipple-logo").data("logoMode")===
"editing")return false;if(a.data("photoData")){a.data("photoData").caption&&a.find(".stipple-toolbar").stippleAppear();a.data("photoData").id&&z(c.param({act:"photo:mouseover",id:a.data("photoData").id}))}}).live("mouseleave",function(){var a=c(this);if(a.data("wrapperMode")==="delete_dot")return false;a.find(".stipple-dot").stop().animate({opacity:0},{queue:false,duration:200},"linear",function(){c(this).hide()}).end().find(".stipple-toolbar").each(function(){if(a.find(".stipple-logo").data("logoMode")===
"editing")return false;a.data("photoData")&&a.data("photoData").caption&&c(this).stippleDisappear()})});c(".stipple-new-dot-overlay").live("click",function(a){var b=c(this).stippleWrapper(),d,e;if(!b.stippleUserCanEdit()||b.data("wrapperMode")!=="new_dot"||b.children(".stipple-new-dot").length)return false;d=b.children(":not(.stipple-new-dot-overlay):first");e=Math.round(a.pageX-d.offset().left);a=Math.round(a.pageY-d.offset().top);c(i.dot({image_url:s+"plain-blue.png"})).css({position:"absolute",
left:e-12,top:a-12,display:"block",width:"1px",height:"1px"}).removeClass("stipple-dot").addClass("stipple-new-dot").css("opacity",0).appendTo(b).fadeTo("fast",1);b.find(".stipple-toolbar").stippleUpdateFormCoordinates(e,a);b.find(".stipple-add-a-dot-controls, .stipple-add-dot-info").slideToggle("fast");return false});c("[class*=stippleit-sid-]").live("mousemove",function(a){var b=c(this),d=b.stippleWrapper().data("wrapperMode");d!=="new_dot"&&d!=="delete_dot"&&b.siblings(".stipple-dot").stippleFadeToDistance(a.pageX-
b.offset().left,a.pageY-b.offset().top)});c(".stipple-logo").live("mouseenter",function(a){var b=c(this),d=b.siblings("[class*=stippleit-sid-]"),e=b.stippleWrapper().data("wrapperMode");e!=="new_dot"&&e!=="delete_dot"&&b.siblings(".stipple-dot").stippleFadeToDistance(a.pageX-d.offset().left,a.pageY-d.offset().top);!b.stippleUserCanEdit()||b.data("logoMode")==="editing"||b.stippleChangeLogoMode("hover")}).live("mouseleave",function(){var a=c(this);!a.stippleUserCanEdit()||a.data("logoMode")==="editing"||
a.stippleChangeLogoMode()}).live("click",function(){var a=c(this),b,d,e;if(!a.stippleUserCanEdit()||a.stippleWrapper().data("disableForms"))return true;b=a.siblings(".stipple-toolbar");d=b.find(".stipple-controls");e=b.find(".stipple-caption");if(a.data("logoMode")==="editing"){a.stippleCancelEditMode();b="hover"}else{b.is(":hidden")&&b.stippleAppear();d.slideToggle("fast");e.slideToggle("fast");b="editing"}a.stippleChangeLogoMode(b);return false});c(".stipple-toolbar").live("mouseenter",function(a){var b=
c(this),d=b.siblings("[class*=stippleit-sid-]"),e=b.stippleWrapper().data("wrapperMode");e!=="new_dot"&&e!=="delete_dot"&&b.siblings(".stipple-dot").stippleFadeToDistance(a.pageX-d.offset().left,a.pageY-d.offset().top)}).find("input[type=text], textarea, select").live("click",function(){if(!c(this).stippleWrapper().parent().is("a"))return true;c(this).is("select")&&c(this).blur();return false});c(".stipple-add-a-dot-button").live("click",function(){var a=c(this).stippleWrapper();if(a.data("disableForms"))return false;
a.stippleEnableNewDotMode().children(".stipple-new-dot-overlay").show().end().find(".stipple-buttons, .stipple-add-a-dot-controls").slideToggle("fast").end().find(".stipple-dot").stippleDisappear();return false});c(".stipple-delete-a-dot-button").live("click",function(){var a=c(this).stippleWrapper();if(a.data("disableForms"))return false;a.data("wrapperMode","delete_dot").find(".stipple-buttons, .stipple-delete-a-dot-controls").slideToggle("fast").end().find(".stipple-dot").stippleAppear().addClass("stipple-deleteable-dot").css("cursor",
"pointer");return false});c(".stipple-edit-general-info-button").live("click",function(){var a=c(this).stippleWrapper();if(a.data("disableForms"))return false;a.find(".stipple-buttons, .stipple-general-info-controls").slideToggle("fast");return false});c(".stipple-change-position-button").live("click",function(){c(this).stippleWrapper().find(".stipple-add-dot-info, .stipple-add-a-dot-controls").slideToggle("fast").end().find(".stipple-new-dot").fadeOut("fast",function(){c(this).remove()});return false});
c(".stipple-cancel-button").live("click",function(){var a=c(this);a.stippleCancelEditMode();a.stippleWrapper().find(".stipple-logo").stippleChangeLogoMode("normal");return false});c(".stipple-new-dot-finish-button").live("click",function(){var a,b;a=c(this).stippleWrapper();if(!a.data("disableForms")){a.stippleDisableForms();b=a.find(".stipple-add-dot-info form:visible");b.find("[data-stipple-empty-val]").each(function(){var d=c(this);d.attr("data-stipple-empty-val")===d.val()&&d.val("")});b=b.serialize();
b+="&act="+encodeURIComponent("dot:create");b+="&dom_id="+a.attr("data-stipple-dom-id");z(b);return false}});c(".stipple-save-caption-button").live("click",function(){var a,b;a=c(this).stippleWrapper();if(a.data("disableForms"))return false;a.stippleDisableForms();b=a.find(".stipple-general-info-controls form:visible");b.find("[data-stipple-empty-val]").each(function(){var d=c(this);d.attr("data-stipple-empty-val")===d.val()&&d.val("")});b=b.serialize();b+="&act="+encodeURIComponent("photo:caption");
b+="&dom_id="+a.attr("data-stipple-dom-id");z(b);return false});c("[data-stipple-empty-val]").live("focus",function(){var a=c(this);a.val()===a.attr("data-stipple-empty-val")&&a.val("")}).live("blur",function(){var a=c(this);c.trim(a.val())===""&&a.val(a.attr("data-stipple-empty-val"))});c(".stipple-title-vs-brand-model-chooser a").live("click",function(){var a=c(this),b=a.closest(".stipple-product-fields"),d=b.find("."+a.attr("data-stipple-class-to-show"));a.addClass("stipple-selected").siblings("a").removeClass("stipple-selected");
d.slideDown().siblings().slideUp();b.find(".stipple-category-select, .stipple-specific-category, .stipple-description").slideDown();return false});(function(){var a=function(b,d,e,g){var f=b.data("acBox"),h;if(!f){f=b.nextAll(".stipple-autocomplete-box:first");b.data("acBox",f);f.data("input",b)}if(b.val().length<2)f.is(":visible")&&f.stippleDisappear();else{h=f.find("li.stipple-selected");switch(d.keyCode){case 38:b.stippleUpArrowPressed();return false;case 40:b.stippleDownArrowPressed();return false;
case 9:case 13:h.length&&b.val(c.trim(h.text()));f.stippleDisappear();return d.keyCode===9}c.get(k+"stippleit.com/"+e+"/"+encodeURIComponent(b.val()),g,function(p){if(p.length)f.stippleNewAutoCompleteSuggestions(p,b.val().length).stippleAppear();else f.is(":visible")&&f.stippleDisappear()},"jsonp");return true}};c("input.stipple-brand").live("keyup keydown",function(b){if(b.type==="keyup"&&b.keyCode!==9||b.type==="keydown"&&b.keyCode===9)return a(c(this),b,"brand_ac",{})});c("input.stipple-model").live("keyup keydown",
function(b){var d,e;if(b.type==="keyup"&&b.keyCode!==9||b.type==="keydown"&&b.keyCode===9){d=c(this);d=d.prevAll(".stipple-brand");e=d.val();if(e===d.attr("data-stipple-empty-val"))e="";return a(c(this),b,"product_ac",{brand:e})}})})();c("input.stipple-brand, input.stipple-model").live("focusout",function(){var a=c(this).data("acBox");a&&a.is(":visible")&&a.stippleDisappear()});c(".stipple-autocomplete-item").live("mouseenter",function(){c(this).addClass("stipple-selected").css({color:"red","background-color":"white"})}).live("mouseleave",
function(){c(this).removeClass("stipple-selected").css({color:"white","background-color":"red"})}).live("click",function(){var a=c(this),b=a.closest(".stipple-autocomplete-box");b.data("input").val(c.trim(a.text()));b.stippleDisappear();return false});c(".stipple-form").live("submit",function(){return false});c(".stipple-deleteable-dot").live("click",function(){var a=c(this),b=a.stippleWrapper();if(a.siblings(".stipple-dot-to-delete").length||b.data("disableForms"))return false;a.addClass("stipple-dot-to-delete");
if(confirm("Are you sure you want to delete dot '"+a.data("dotData").title+"'?")){b.stippleDisableForms();z(c.param({act:"dot:delete",id:a.data("dotData").id,dom_id:a.stippleWrapper().attr("data-stipple-dom-id")}))}});c(".stipple-want").live("click",function(){var a=c(this);z(c.param({act:"user:toggle_want_for",data:{product_id:a.closest(".stipple-dot-box-product").attr("data-product-id")},dom_id:a.stippleWrapper().attr("data-stipple-dom-id")}));return false})};E=function(){c(function(){c(i.external_css({externalImgPath:A})).appendTo("head");
c(i.external_css_ie7({})).appendTo("head");C(r());G();F()})};H=function(a,b,d){var e={},g,f;a=c(a);if(d&&typeof d==="object")if(d.afterAll){g=(new Date).getTime().toString()+Math.floor(Math.random()*1E3);m[g]={callback:d.afterAll,stillLoading:a.length};a.each(function(){f=(f=c(this).data("stipple-callbackBatches"))||{};f[g]=1;c(this).data("stipple-callbackBatches",f)})}a.addClass("stippleit-sid-"+b);e[b]=a.map(function(){return c(this)});C(e)};STIPPLE.load=function(a,b,d){if(typeof c==="undefined")setTimeout(function(){STIPPLE.load(a,
b,d)},40);else H(a,b,d)};(function(){var a,b;if(typeof jQuery!=="undefined"&&jQuery.fn.jquery==="1.4.2"){c=jQuery;E(c)}else{a=document.createElement("script");a.src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js";document.documentElement.getElementsByTagName("HEAD")[0].appendChild(a);b=setInterval(function(){if(typeof jQuery!=="undefined"&&jQuery.fn.jquery==="1.4.2"){clearInterval(b);c=jQuery.noConflict(true);q(c)&&E(c)}},25)}})()})();
