/* Based on Pinterest bookmarklet code from http://assets.pinterest.com/js/pinmarklet.js Modified by Cameron Clark */ function selectPinImage(prepend,append,hidden,within,elements){var m={k:"PIN_"+(new Date).getTime(),checkDomain:{url:"//api.pinterest.com/v2/domains/filter_nopin/"},cdn:{"https:":"https://a248.e.akamai.net/passets.pinterest.com.s3.amazonaws.com","http:":"http://passets-cdn.pinterest.com"},embed:"//pinterest.com/embed/?",pin:"pinterest.com/pin/create/bookmarklet/",minImgSize:80,maxCheckCount:20,thumbCellSize:200,check:elements||["meta","iframe","embed","object","img","video","a"],checkHidden:(typeof hidden!=="undefined"?hidden:false),parentElement:within||document,prependText:prepend||"",appendText:append||"",url:{fivehundredpx:/^https?:\/\/500px\.com\/photo\//,etsy:/^https?:\/\/.*?\.etsy\.com\/listing\//,facebook:/^https?:\/\/.*?\.facebook\.com\//,flickr:/^https?:\/\/www\.flickr\.com\//,googleImages:/^https?:\/\/.*?\.google\.com\/search/,googleReader:/^https?:\/\/.*?\.google\.com\/reader\//,kickstarter:/^https?:\/\/.*?\.kickstarter\.com\/projects\//,netflix:/^https?:\/\/.*?\.netflix\.com/,pinterest:/^https?:\/\/.*?\.?pinterest\.com\//,slideshare:/^https?:\/\/.*?\.slideshare\.net\//,soundcloud:/^https?:\/\/soundcloud\.com\//,stumbleUpon:/^https?:\/\/.*?\.stumbleupon\.com\//,tumblr:/^https?:\/\/www\.tumblr\.com/,vimeo:/^https?:\/\/vimeo\.com\//,youtube:/^https?:\/\/www\.youtube\.com\/watch\?/},via:{og:{tagName:"meta",property:"property",content:"content",field:{"og:type":"pId","og:url":"pUrl","og:image":"pImg"}}},seek:{etsy:{id:"etsymarketplace:item",via:{tagName:"meta",property:"property",content:"content",field:{"og:title":"pTitle","og:type":"pId","og:url":"pUrl","og:image":"pImg","etsymarketplace:price_value":"pPrice","etsymarketplace:currency_symbol":"pCurrencySymbol"}},fixImg:{find:/_570xN/,replace:"_fullxfull"},fixTitle:{suffix:". %s%, via Etsy."},checkNonCanonicalImages:true},fivehundredpx:{id:"five_hundred_pixels:photo",via:"og",fixImg:{find:/\/3.jpg/,replace:"/4.jpg"},fixTitle:{find:/^500px \/ Photo /,replace:"",suffix:", via 500px."}},flickr:{via:{tagName:"link",property:"rel",content:"href",field:{canonical:"pUrl",image_src:"pImg"}},fixImg:{find:/_m.jpg/,replace:"_z.jpg"},fixTitle:{find:/ \| Flickr(.*)$/,replace:"",suffix:", via Flickr."}},kickstarter:{id:"kickstarter:project",via:"og",media:"video",fixTitle:{find:/ \u2014 Kickstarter$/,replace:"",suffix:", via Kickstarter."}},slideshare:{id:"article",via:"og",media:"video"},soundcloud:{id:"soundcloud:sound",via:"og",media:"video",fixTitle:{find:/ on SoundCloud(.*)$/,replace:"",suffix:", via SoundCloud."}},youtube:{id:"video",via:"og",fixTitle:{find:/ - YouTube$/,replace:"",suffix:", via YouTube."}}},stumbleFrame:["tb-stumble-frame","stumbleFrame"],tag:{img:{flickr:{att:"src",match:[/staticflickr.com/,/static.flickr.com/]},fivehundredpx:{att:"src",match:[/pcdn\.500px\.net/]},behance:{att:"src",match:[/^http:\/\/behance\.vo\.llnwd\.net/]},netflix:{att:"src",match:[/^http:\/\/cdn-?[0-9]\.nflximg\.com/,/^http?s:\/\/netflix\.hs\.llnwd\.net/]},youtube:{att:"src",match:[/ytimg.com\/vi/,/img.youtube.com\/vi/]}},video:{youtube:{att:"src",match:[/videoplayback/]}},embed:{youtube:{att:"src",match:[/^http:\/\/s\.ytimg\.com\/yt/,/^http:\/\/.*?\.?youtube-nocookie\.com\/v/]}},iframe:{youtube:{att:"src",match:[/^http:\/\/www\.youtube\.com\/embed\/([a-zA-Z0-9\-_]+)/]},vimeo:{att:"src",match:[/^http?s:\/\/vimeo.com\/(\d+)/,/^http:\/\/player\.vimeo\.com\/video\/(\d+)/]}},object:{youtube:{att:"data",match:[/^http:\/\/.*?\.?youtube-nocookie\.com\/v/]}}},msg:{check:"",cancelTitle:"Cancel",grayOut:"Sorry, cannot pin this image.",noPinIncompletePage:"Sorry, can't pin from non-HTML pages. If you're trying to upload an image, please visit pinterest.com.",bustFrame:"We need to hide the StumbleUpon toolbar to Pin from this page. After pinning, you can use the back button in your browser to return to StumbleUpon. Click OK to continue or Cancel to stay here.",noPin:"Sorry, pinning is not allowed from this domain. Please contact the site operator if you have any questions.",privateDomain:"Sorry, can't pin directly from %privateDomain%.",notFound:"Sorry, couldn't find any pinnable images or video on this page.",installed:"The bookmarklet is installed! Now you can click your Pin It button to pin images as you browse sites around the web."},pop:"status=no,resizable=yes,scrollbars=yes,personalbar=no,directories=no,location=no,toolbar=no,menubar=no,width=632,height=270,left=0,top=0",rules:["#_shim {z-index:8675309; position: absolute; background: transparent; top:0; right:0; bottom:0; left:0; width: 100%; border: 0;}","#_bg {z-index:8675310; position: absolute; top:0; right:0; bottom:0; left:0; background-color:#f2f2f2; opacity:.95; width: 100%; }","#_bd {z-index:8675311; position: absolute; text-align: center; width: 100%; top: 0; left: 0; right: 0; font:16px hevetica neue,arial,san-serif; }","#_bd #_hd { z-index:8675312; -moz-box-shadow: 0 1px 2px #aaa; -webkit-box-shadow: 0 1px 2px #aaa; box-shadow: 0 1px 2px #aaa; position: fixed; *position:absolute; width:100%; top: 0; left: 0; right: 0; height: 45px; line-height: 45px; font-size: 14px; font-weight: bold; display: block; margin: 0; background: #fbf7f7; border-bottom: 1px solid #aaa; }","#_bd #_hd a#_x { display: block; cursor: pointer; color: #524D4D; line-height: 45px; text-shadow: 0 1px #fff; float: right; text-align: center; width: 100px; height: 45px; border-left: 1px solid #aaa; }","#_bd #_hd a#_x:hover { color: #524D4D; background: #e1dfdf; text-decoration: none; }","#_bd #_hd a#_x:active { color: #fff; background: #cb2027; text-decoration: none; text-shadow:none;}","#_bd #_hd #_logo {height: 43px; width: 100px; display: inline-block; margin-right: -100px; background: transparent url(_cdn/images/LogoRed.png) 50% 50% no-repeat; border: none;}","#_bd #_spacer { display: block; height: 50px; }","#_bd span._pinContainer { height:200px; width:200px; display:inline-block; background:#fff; position:relative; -moz-box-shadow:0 0 2px #555; -webkit-box-shadow: 0 0 2px #555; box-shadow: 0 0 2px #555; margin: 10px; }","#_bd span._pinContainer { zoom:1; *border: 1px solid #aaa; }","#_bd span._pinContainer img { margin:0; padding:0; border:none; }","#_bd span._pinContainer span.img, #_bd span._pinContainer span._play { position: absolute; top: 0; left: 0; height:200px; width:200px; overflow:hidden; }","#_bd span._pinContainer span._play { background: transparent url(_cdn/images/bm/play.png) 50% 50% no-repeat; }","#_bd span._pinContainer cite, #_bd span._pinContainer cite span { position: absolute; bottom: 0; left: 0; right: 0; width: 200px; color: #000; height: 22px; line-height: 24px; font-size: 10px; font-style: normal; text-align: center; overflow: hidden; }","#_bd span._pinContainer cite span._mask { background:#eee; opacity:.75; *filter:alpha(opacity=75); }","#_bd span._pinContainer cite span._behance { background: transparent url(_cdn/images/attrib/behance.png) 180px 3px no-repeat; }","#_bd span._pinContainer cite span._flickr { background: transparent url(_cdn/images/attrib/flickr.png) 182px 3px no-repeat; }","#_bd span._pinContainer cite span._fivehundredpx { background: transparent url(_cdn/images/attrib/fivehundredpx.png) 180px 3px no-repeat; }","#_bd span._pinContainer cite span._kickstarter { background: transparent url(_cdn/images/attrib/kickstarter.png) 182px 3px no-repeat; }","#_bd span._pinContainer cite span._slideshare { background: transparent url(_cdn/images/attrib/slideshare.png) 182px 3px no-repeat; }","#_bd span._pinContainer cite span._soundcloud { background: transparent url(_cdn/images/attrib/soundcloud.png) 182px 3px no-repeat; }","#_bd span._pinContainer cite span._vimeo { background: transparent url(_cdn/images/attrib/vimeo.png) 180px 3px no-repeat; }","#_bd span._pinContainer cite span._vimeo_s { background: transparent url(_cdn/images/attrib/vimeo.png) 180px 3px no-repeat; }","#_bd span._pinContainer cite span._youtube { background: transparent url(_cdn/images/attrib/youtube.png) 180px 3px no-repeat; }","#_bd span._pinContainer a { text-decoration:none; background:transparent url(_cdn/images/bm/button.png) 60px 300px no-repeat; cursor:pointer; position:absolute; top:0; left:0; height:200px; width:200px; }","#_bd span._pinContainer a { -moz-transition-property: background-color; -moz-transition-duration: .25s; -webkit-transition-property: background-color; -webkit-transition-duration: .25s; transition-property: background-color; transition-duration: .25s; }","#_bd span._pinContainer a:hover { background-position: 60px 80px; background-color:rgba(0, 0, 0, 0.5); }","#_bd span._pinContainer a._hideMe { background: rgba(128, 128, 128, .5); *background: #aaa; *filter:alpha(opacity=75); line-height: 200px; font-size: 10px; color: #fff; text-align: center; font-weight: normal!important; }"]};var a=window[m.k]={w:window,d:document,n:navigator,a:m,s:{},f:function(){return{callback:[],kill:function(b){if(typeof b==="string"){b=a.d.getElementById(b)}b&&b.parentNode&&b.parentNode.removeChild(b)},get:function(b,c){var d=null;return d=typeof b[c]==="string"?b[c]:b.getAttribute(c)},set:function(b,c,d){if(typeof b[c]==="string"){b[c]=d}else{b.setAttribute(c,d)}},make:function(b){var c=false,d,e;for(d in b){if(b[d].hasOwnProperty){c=a.d.createElement(d);for(e in b[d]){b[d][e].hasOwnProperty&&typeof b[d][e]==="string"&&a.f.set(c,e,b[d][e])}break}}return c},listen:function(b,c,d){if(typeof a.w.addEventListener!=="undefined"){b.addEventListener(c,d,false)}else{typeof a.w.attachEvent!=="undefined"&&b.attachEvent("on"+c,d)}},getSelection:function(){return(""+(a.w.getSelection?a.w.getSelection():a.d.getSelection?a.d.getSelection():a.d.selection.createRange().text)).replace(/(^\s+|\s+$)/g,"")},pin:function(b){var c=a.a.pin+"?",d="false",e=a.f.get(b,"pinImg"),g=a.f.get(b,"pinUrl")||a.d.URL,f=a.v.selectedText||a.f.get(b,"pinDesc")||a.d.title;f=a.a.prependText+f+a.a.appendText;g=g.split("#")[0];if(b.rel==="video"){d="true"}c=c+"media="+encodeURIComponent(e);c=c+"&url="+encodeURIComponent(g);c=c+"&title="+encodeURIComponent(a.d.title.substr(0,500));c=c+"&is_video="+d;c=c+"&description="+encodeURIComponent(f.substr(0,500));if(a.v.inlineHandler){c=c+"&via="+encodeURIComponent(a.d.URL)}if(a.v.hazIOS){a.w.setTimeout(function(){a.w.location="pinit12://"+c},25);a.w.location="http://"+c}else{a.w.open("http://"+c,"pin"+(new Date).getTime(),a.a.pop)}},close:function(b){if(a.s.bg){a.d.b.removeChild(a.s.shim);a.d.b.removeChild(a.s.bg);a.d.b.removeChild(a.s.bd)}a.w.hazPinningNow=false;b&&a.w.alert(b);a.v.hazGoodUrl=false;a.w.scroll(0,a.v.saveScrollTop)},click:function(b){b=b||a.w.event;var c=null;if(c=b.target?b.target.nodeType===3?b.target.parentNode:b.target:b.srcElement){if(c===a.s.x){a.f.close()}else{if(c.className!==a.a.k+"_hideMe"){if(c.className===a.a.k+"_pinThis"){a.f.pin(c);a.w.setTimeout(function(){a.f.close()},10)}}}}},keydown:function(b){((b||a.w.event).keyCode||null)===27&&a.f.close()},behavior:function(){a.f.listen(a.s.bd,"click",a.f.click);a.f.listen(a.d,"keydown",a.f.keydown)},presentation:function(){var b=a.f.make({STYLE:{type:"text/css"}}),c=a.a.cdn[a.w.location.protocol]||a.a.cdn["http:"],d=a.a.rules.join("\n");d=d.replace(/#_/g,"#"+m.k+"_");d=d.replace(/\._/g,"."+m.k+"_");d=d.replace(/_cdn/g,c);if(b.styleSheet){b.styleSheet.cssText=d}else{b.appendChild(a.d.createTextNode(d))}a.d.h.appendChild(b)},addThumb:function(b,c,d){(d=b.getElementsByTagName(d)[0])?b.insertBefore(c,d):b.appendChild(c)},thumb:function(b){if(b.src){if(!b.media){b.media="image"}var c=a.a.k+"_thumb_"+b.src,d=a.f.make({SPAN:{className:a.a.k+"_pinContainer"}}),e=a.f.make({A:{className:a.a.k+"_pinThis",rel:b.media,href:"#"}}),g=a.f.make({SPAN:{className:"img"}}),f=new Image;a.f.set(f,"nopin","nopin");b.page&&a.f.set(e,"pinUrl",b.page);if(a.v.canonicalTitle||b.title){a.f.set(e,"pinDesc",a.v.canonicalTitle||b.title)}b.desc&&a.f.set(e,"pinDesc",b.desc);f.style.visibility="hidden";f.onload=function(){var i=this.width,h=this.height;if(h===i){this.width=this.height=a.a.thumbCellSize}if(h>i){this.width=a.a.thumbCellSize;this.height=a.a.thumbCellSize*(h/i);this.style.marginTop=0-(this.height-a.a.thumbCellSize)/2+"px"}if(h1000&&a.f.getExtendedInfo("src="+c+"&id="+b)},googleImages:function(){a.v.inlineHandler="google"},tumblr:function(){a.v.inlineHandler="tumblr"},netflix:function(){a.v.inlineHandler="netflix"},pinterest:function(){a.f.close(a.a.msg.installed)},facebook:function(){a.f.close(a.a.msg.privateDomain.replace(/%privateDomain%/,"Facebook"))},googleReader:function(){a.f.close(a.a.msg.privateDomain.replace(/%privateDomain%/,"Google Reader"))},stumbleUpon:function(){var b=0,c=a.a.stumbleFrame.length,d;for(b=0;b1000&&a.v.inlineHandler&&a.v.inlineHandler==="netflix"&&a.f.getExtendedInfo("src=netflix&id="+id)}}},youtube:{img:function(b){b=b.src.split("?")[0].split("#")[0].split("/");b.pop();(id=b.pop())&&a.f.getExtendedInfo("src=youtube&id="+id)},iframe:function(b){(b=a.f.getId({u:b.src}))&&a.f.getExtendedInfo("src=youtube&id="+b)},video:function(b){(b=a.f.get(b,"data-youtube-id"))&&a.f.getExtendedInfo("src=youtube&id="+b)},embed:function(b){var c=a.f.get(b,"flashvars"),d="";if(c){if(d=c.split("video_id=")[1]){d=d.split("&")[0]}d=encodeURIComponent(d)}else{d=a.f.getId({u:b.src})}d&&a.f.getExtendedInfo("src=youtube&id="+d)},object:function(b){b=a.f.get(b,"data");var c="";if(b){(c=a.f.getId({u:b}))&&a.f.getExtendedInfo("src=youtube&id="+c)}}},vimeo:{iframe:function(b){b=a.f.getId({u:b.src,r:10});b>1000&&a.f.getExtendedInfo("src=vimeo&id="+b)}}},parse:function(b,c){b=b.split(c);if(b[1]){return b[1].split("&")[0]}return""},handleInline:{google:function(b){if(b){var c,d=0,e=0,g=a.f.get(b,"src");if(g){e=b.parentNode;if(e.tagName==="A"&&e.href){b=a.f.parse(e.href,"&imgrefurl=");c=a.f.parse(e.href,"&imgurl=");d=parseInt(a.f.parse(e.href,"&w="));e=parseInt(a.f.parse(e.href,"&h="));c&&g&&b&&e>a.a.minImgSize&&d>a.a.minImgSize&&a.f.thumb({thumb:g,src:c,page:b,height:e,width:d});a.v.checkThisDomain[c.split("/")[2]]=true}}}},tumblr:function(b){var c=[];c=null;c="";if(b.src){for(c=b.parentNode;c.tagName!=="LI"&&c!==a.d.b;){c=c.parentNode}if(c.tagName==="LI"&&c.parentNode.id==="posts"){c=c.getElementsByTagName("A");(c=c[c.length-1])&&c.href&&a.f.thumb({src:b.src,page:c.href,height:b.height,width:b.width})}}}},hazTag:{img:function(b){if(a.v.inlineHandler&&typeof a.f.handleInline[a.v.inlineHandler]==="function"){a.f.handleInline[a.v.inlineHandler](b)}else{if(!b.src.match(/^data/)){if(b.height&&b.height>0&&b.width&&b.width>0){a.f.checkImg(b,b.height,b.width)}else{if(a.a.checkHidden){d=new Image;d.onload=function(){a.f.checkImg(b,this.height,this.width)};d.src=b.src}}}}}},checkImg:function(img,h,w){if(h>a.a.minImgSize&&w>a.a.minImgSize){a.f.thumb({src:img.src,height:h,width:w,title:img.title||img.alt});if(img.parentNode.tagName==="A"&&img.parentNode.href){var c=img.parentNode,d=c.href.split(".").pop().split("?")[0].split("#")[0];if(d==="gif"||d==="jpg"||d==="jpeg"||d==="png"){d=new Image;d.onload=function(){a.f.thumb({src:this.src,height:this.height,width:this.width,title:this.title,dupe:this.getAttribute("dupe")})};d.setAttribute("dupe",img.src);d.title=c.title||c.alt||img.title||img.alt;d.src=c.href}}}},checkTags:function(){var b,c,d,e,g,f,i,h,l;b=0;for(c=a.a.check.length;ba.a.maxCheckCount){a.f.call(b,a.f.ping.checkDomain);b=a.a.checkDomain.url+"?domains=";d=0}}}d>0&&a.f.call(b,a.f.ping.checkDomain)},isVisible:function(obj){if(obj==document){return true}if(!obj){return false}if(!obj.parentNode){return false}if(obj.style){if(obj.style.display=="none"){return false}if(obj.style.visibility=="hidden"){return false}}if(window.getComputedStyle){var style=window.getComputedStyle(obj,"");if(style.display=="none"){return false}if(style.visibility=="hidden"){return false}}var style=obj.currentStyle;if(style){if(style.display=="none"){return false}if(style.visibility=="hidden"){return false}}return a.f.isVisible(obj.parentNode)},init:function(){a.d.d=a.d.documentElement;a.d.b=a.d.getElementsByTagName("BODY")[0];a.d.h=a.d.getElementsByTagName("HEAD")[0];if(!a.d.b||!a.d.h){a.f.close(a.a.msg.noPinIncompletePage)}else{if(a.w.hazPinningNow!==true){a.w.hazPinningNow=true;var b=a.n.userAgent;a.v={saveScrollTop:a.w.pageYOffset,hazGoodUrl:true,hazAtLeastOneGoodThumb:0,awaitingCallbacks:0,thumbed:[],hazIE:function(){return/msie/i.test(b)&&!/opera/i.test(b)}(),hazIOS:function(){return b.match(/iP/)!==null}(),firstScript:a.d.getElementsByTagName("SCRIPT")[0],selectedText:a.f.getSelection(),hazCalledForInfo:{},checkThisDomain:{},checkDomainDone:{},badDomain:{},meta:a.d.getElementsByTagName("META"),tag:[],canonicalTitle:""};a.v.checkThisDomain[a.w.location.host]=true;a.f.checkDomainBlacklist();a.f.presentation();a.f.structure();if(a.f.checkPage()){if(a.v.hazGoodUrl===true){a.f.behavior();if(a.f.callback.length>1){a.v.waitForCallbacks=a.w.setInterval(function(){if(a.v.awaitingCallbacks===0){if(a.v.hazAtLeastOneGoodThumb===0||a.v.tag.length===0){a.w.clearInterval(a.v.waitForCallbacks);a.f.close(a.a.msg.notFound)}}},500)}else{if(!a.v.canonicalImage&&(a.v.hazAtLeastOneGoodThumb===0||a.v.tag.length===0)){a.f.close(a.a.msg.notFound)}}}}}}}}}()};a.f.init()};