var snap_preview_anywhere_config = {version:"1.18.1",prefix:{image:"http://spa.snap.com/images/v1.18.1/",theme:"http://spa.snap.com/images/v1.18.1/theme/silver/",link:"http://spa.snap.com/",options:"http://spa.snap.com/",preview:"http://spa.snap.com/",spasense:"http://spa.snap.com/",bg:"http://spa.snap.com/images/v1.18.1/theme/silver/bg/bg_305x308",snap:"http://www.snap.com/",search:"http://www.snap.com/"},theme:"silver",key:"e5a3c1e6dff5de35b1c6e7c470411886",source:"pub-2311827-www.wordpress.com",flavor:"wordpress",search_box:true,auto_preview:false,show_internal:true,platform:false,show_link_icon:"off",preview_trigger:"both",search_type:"snap",redirect_param:null,delay:{show:500,hide:150,move:200},text:{search_box:"Search the Web"},img:{cobrand:"http://spa.snap.com/images/v1.18.1/theme/silver//logo_wordpress.gif",submit:"http://spa.snap.com/images/v1.18.1/t.gif"},css_pos:{main:{x:0,y:0,w:305,h:308},ether:{x:null,y:null,w:258,h:32},body:{x:0,y:0,w:305,h:230},bg_img:{x:0,y:0,w:305,h:308},url:{x:14,y:4,w:215,h:20},url_a:{x:0,y:0,w:null,h:null},close_a:{x:236,y:7,w:9,h:9},ques_a:{xr:20,y:5,w:null,h:null},preview_div:{x:13,y:24,w:270,h:161},preview:{x:0,y:0,w:null,h:null},loading_img:{x:0,y:0,w:null,h:null},search:{x:13,y:195,w:272,h:30},logo_a:{x:182,y:229,w:107,h:21},box:{x:5,y:5,w:210,h:20},submit:{x:220,y:5,w:46,h:20},cobrand_img:{x:13,y:231,w:null,h:null},cobrand_a:{x:13,y:231,w:100,h:20},options:{x:0,y:0,w:305,h:null},option_a:{xr:20,y:5,w:null,h:null},option_iframe:{x:13,y:21,w:275,h:230},spasense_iframe:{x:13,y:195,w:274,h:32}},style:{ques_a:{fontSize:"10px",fontWeight:"normal",color:"#857a7a",borderBottom:"1px dotted #857a7a",textDecoration:"none"},option_a:{fontSize:"10px",fontWeight:"normal",color:"#857a7a",borderBottom:"1px dotted #857a7a",textDecoration:"none"},url_a:{fontSize:"12px",fontWeight:"bold",color:"#003399",borderBottom:"1px dotted #003399",textDecoration:"none",textAlign:"left"},url:{overflow:"hidden"},preview_div:{border:"2px solid #827874",overflow:"hidden",backgroundColor:"#FFFFFF"},search:{backgroundColor:"#f5f5f6",border:"1px solid #d9ddce"},box:{fontSize:"10px",border:"1px solid #999999",color:"#333333",backgroundColor:"#ffffff"}},offset:{body:{top:40,bottom:10},options:{top:40,bottom:10},search_box:38},hidden:["options","spasense_iframe"],retry_interval:[8000,5000,5000,5000,5000,5000],partial_check:{delay:2000,attempts:5},href:{logo:"http://www.snap.com/",cobrand:"http://wordpress.com/snap"},palette:{submit:"-107px 0",close_a:"-255px 0",logo_a:"0 0"},ether:{tl:{x:47,y:0},tr:{x:0,y:0},bl:{x:47,y:276},br:{x:0,y:276}},el_scan:"all",color:{bubble:"#ffffff",bubble_rollover:"#fffeee",bubble_border:"#a4a3a3",url:"#003399",url_down:"#ff0000",preview_border:"#827874",preview_border_down:"#ff0000",options:"#857a7a",options_down:"#ff0000",search_box:"#f5f5f6",search_box_border:"#d9ddce",search_field:"#ffffff",search_field_border:"#999999"},fl:""};
function snapPreviewAnywhere(){this.init();}snapPreviewAnywhere.prototype={div:null,timer_id:null,current_orientation:"lr",retry_url_list:{},div_added:null,current_element:null,current_url:null,init:function(){this.div={};this.retry_url_list={};this.timer_id={retry:null,show:null,partial:null};this.div_added=false;this.current_element=null;this.current_url=null;this.domain=null;this.cfg=snap_preview_anywhere_config;var _1=this;this.observe(window,"load",function(){_1.onload();});var _2=document.getElementById("snap_preview_anywhere");if(_2&&_2.defer){this.timer_id.partial=window.setTimeout(function(){_1.partial_check();},this.cfg.partial_check.delay);}},clear_timer:function(_3){if(this.timer_id[_3]){window.clearTimeout(this.timer_id[_3]);this.timer_id[_3]=0;}},campaign:function(_4){return "spa"+(_4?("_"+_4):"")+"!"+window.location.host.replace(/:\d+$/,"");},is_internal_link:function(_5){var _6=/^(http|file)s?:\/\/(www\.)?(.*?)\//;if(this.domain===null){var m=document.location.href.match(_6);if(m){this.domain=m[3];}else{this.domain="";}}var _8=_5.href.match(_6);if(_8&&(this.domain==_8[3])){if(this.cfg.redirect_param){var _9="[\\?&]"+this.cfg.redirect_param+"=([^]*)";var _a=new RegExp(_9);var _b=_a.exec(_5.href);if(_b==null){return true;}else{return false;}}else{return true;}}else{return false;}},is_valid_link:function(_c){var _d=_c.href.match(/^(http)s?:\/\/([^#]*)/);var _e=document.location.href.match(/^(http|file)s?:\/\/([^#]*)/);if(!_d||!_e||(_d[2]==_e[2])||(_d[1]!=="http")){return false;}return true;},add_spa:function(_f){var spa=this;_f.snap_preview_added="spa";if((this.cfg.show_link_icon=="off"||this.cfg.preview_trigger!="icon"||_f.parent_link_icon=="no"||_f.parent_link_icon=="both"||_f.className.indexOf("snap_no_icon")!=-1||_f.className.indexOf("snap_trigger_both")!=-1)&&_f.className.indexOf("snap_trigger_icon")==-1&&_f.parent_link_icon!="icon"){this.observe(_f,"mouseover",function(ev){spa.show_delay(ev,spa.cfg.delay.show,spa.cfg.delay.move);});this.observe(_f,"mouseout",function(ev){spa.hide_delay(ev,spa.cfg.delay.hide);});}this.add_link_icon(_f);},add_link_icon:function(_13){var spa=this;var _15=/
]*>/ig;var _16=spa.trim(_13.innerHTML.replace(_15,""));if((this.cfg.show_link_icon=="on"||_13.className.indexOf("snap_trigger_both")!=-1||_13.className.indexOf("snap_trigger_icon")!=-1||_13.parent_link_icon=="icon"||_13.parent_link_icon=="both")&&_13.className.indexOf("snap_no_icon")==-1&&_13.snap_icon_added!="no"&&_16!=""){var _17=document.createElement("img");_17.style.margin="0 0 0 0";_17.style.padding="1px 0 0 0";_17.style.width="14px";_17.style.height="12px";_17.style.border="0";_17.style.verticalAlign="top";_17.style.background="";_17.style.display="inline";_17.style.fontStyle="normal";_17.style.fontWeight="normal";_17.style.fontFamily="\"trebuchet ms\", arial, helvetica, sans-serif";_17.style.textDecoration="none";_17.style.cssFloat="none";_17.style.styleFloat="none";_17.src=this.cfg.prefix.theme+"iconLink.gif";_13.appendChild(_17);_17.snap_preview_added="spa";this.observe(_17,"mouseover",function(ev){spa.show_delay(ev,400,200);});this.observe(_17,"mouseout",function(ev){spa.hide_delay(ev,150);});}_13.snap_icon_added="spa";},conditional_add_spa:function(_1a,_1b,_1c){if(_1a.snap_preview_added){return;}else{if(_1a.className.indexOf("snap_nopreview")!=-1){_1a.snap_preview_added="no";return;}}if((_1a.className.indexOf("snap_preview")!==-1)||(_1a.className.indexOf("snap_trigger_icon")!==-1)||(_1a.className.indexOf("snap_trigger_both")!==-1)||((_1a.href.indexOf("https://")!=0)&&(this.cfg.auto_preview||_1b)&&(this.cfg.show_internal||!this.is_internal_link(_1a))&&(this.is_valid_link(_1a)))){_1a.parent_link_icon=_1c;this.add_spa(_1a);}else{_1a.snap_preview_added="no";}},add_link_events:function(){var _1d;var _1e=[];var _1f=[];var _20=[];var _21=["a","area"];if(this.cfg.show_link_icon=="on"){var _22;if(this.cfg.preview_trigger=="icon"){_22=" snap_trigger_icon";}else{_22=" snap_trigger_both";}if(this.cfg.platform=="blogger"){this.cfg.show_link_icon="off";var els=document.getElementsByTagName("div");for(var i=0;i-1){els[i].className+=_22;}}}if(this.cfg.platform=="typepad"){this.cfg.show_link_icon="off";var els=document.getElementsByTagName("div");for(var i=0;i-1){els[i].className+=_22;}}}}var _25=[];switch(this.cfg.el_scan){case "all":_25=["*"];break;case "default":_25=["div","span"];break;}for(var tt=0;tt<_25.length;tt++){var els=document.getElementsByTagName(_25[tt]);for(var i=0;i\n\n\n
\n
Options\n
\n
\n
\n \n
\n
\n

\n
\n
\n
\n\n";this.get_all_spa_nodes(this.div.main,this.div);this.set_css();this.raise_loading_img();this.observe(this.div.main,"mouseover",function(ev){spa.highlight(true);});this.observe(this.div.main,"mouseout",function(ev){var _3e=ev.relatedTarget||ev.toElement;if(_3e==null){return;}if(spa.isOpera){var top=spa.getTop(spa.div.main);var _40=spa.getLeft(spa.div.main);var _41=spa.getBottom(spa.div.main);var _42=spa.getRight(spa.div.main);var _43=ev.pageX||(ev.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft));var _44=ev.pageY||(ev.clientY+(document.documentElement.scrollTop||document.body.scrollTop));var _45=(_43>_40&&_43<_42&&_44>top&&_44<_41);if(_45){return;}}spa.highlight(false);spa.hide_delay(ev,100);});var spa=this;this.observe(this.div.preview,"load",function(ev){spa.check_image_status(ev);});this.observe(this.div.ether,"mouseover",function(ev){spa.highlight(false);spa.hide_delay(ev,100);if(ev.preventDefault){ev.preventDefault();ev.stopPropagation();ev.returnValue=false;ev.cancelBubble=true;}else{ev.returnValue=false;ev.cancelBubble=true;}});spa.opt_url=this.cfg.prefix.options+"options.php?source="+encodeURIComponent(this.cfg.source)+"&key="+this.cfg.key+"&sb="+(this.cfg.search_box?"1":"0")+"&th="+this.cfg.theme;this.observe(this.div.option_iframe,"mouseout",function(_49){_49.returnValue=false;_49.cancelBubble=true;});this.observe(this.div.ques_a,"click",function(ev){return spa.option_frame(ev,true,false);});this.observe(this.div.close_a,"click",function(ev){return spa.option_frame(ev,true,true);});this.observe(this.div.option_a,"click",function(ev){return spa.option_frame(ev,false,false);});this.observe(this.div.ques_a,"mouseover",function(ev){spa.div.ques_a.style.borderBottom="none";});this.observe(this.div.ques_a,"mouseout",function(ev){spa.div.ques_a.style.borderBottom="1px dotted "+spa.cfg.color.options;});this.observe(this.div.option_a,"mouseover",function(ev){spa.div.option_a.style.borderBottom="none";});this.observe(this.div.option_a,"mouseout",function(ev){spa.div.option_a.style.borderBottom="1px dotted "+spa.cfg.color.options;});this.observe(this.div.url_a,"mouseover",function(ev){spa.div.url_a.style.borderBottom="none";});this.observe(this.div.url_a,"mouseout",function(ev){spa.div.url_a.style.borderBottom="1px dotted "+spa.cfg.color.url;});var _53=["img_a","url_a"];for(var i=0;i<_53.length;i++){this.observe(this.div[_53[i]],"click",function(ev){spa.link_click("click");});}this.observe(document,"mousewheel",function(ev){spa.disabled=true;clearTimeout(spa.disableTimer);spa.disableTimer=setTimeout(function(){spa.disabled=false;},200);});this.observe(this.div.search_form,"submit",function(ev){spa.form_submit(ev);});this.div.box.value=this.cfg.text.search_box;this.observe(this.div.box,"focus",function(ev){if(spa.div.box.value===spa.cfg.text.search_box){spa.div.box.value="";}});var _59="?source="+encodeURIComponent(this.cfg.source)+"&campaign=";this.div.logo_a.href=this.cfg.href.logo+_59+this.campaign("bsblogo");this.div.cobrand_a.href=this.cfg.href.cobrand;if(this.div.cobrand_a.href.indexOf(this.cfg.prefix.snap)==0){this.div.cobrand_a.href+=_59+this.campaign("link");}this.div.search_form.action=this.cfg.prefix.search;var el=document.createElement("input");el.type="hidden";el.name="source";el.value=encodeURIComponent(this.cfg.source);this.div.search_form.appendChild(el);var el=document.createElement("input");el.type="hidden";el.name="campaign";el.value="";this.div.search_form.appendChild(el);this.div.form_campaign=el;this.orientation("bl");},option_frame:function(ev,_5c,_5d){this.div.body.style.display=_5c?"none":"inline";this.div.options.style.display=_5c?"inline":"none";if(_5c){var url=this.opt_url+(_5d?"&hl=disable":"");if(this.div.option_iframe.src!=url){this.div.option_iframe.src=url;}}ev.returnValue=false;if(ev.preventDefault){ev.preventDefault();}return false;},raise_loading_img:function(){this.div.loading_img.style.zIndex=Number(this.div.preview.style.zIndex)+1;},lower_loading_img:function(){this.div.loading_img.style.zIndex=Number(this.div.preview.style.zIndex)-1;},move:function(x,y){this.div.main.style.left=x+"px";this.div.main.style.top=y+"px";},hide_delay:function(ev,_62){this.clear_timer("show");var spa=this;this.timer_id.show=window.setTimeout(function(){spa.hide();},_62);},hide:function(){if(this.div.options.style.display!="none"){this.div.options.style.display="none";this.div.body.style.display="inline";}this.div.main.style.visibility="hidden";},show_delay:function(ev,_65,_66){this.clear_timer("show");if(this.disabled){return;}var _67;if(ev.srcElement){_67=ev.srcElement;}else{if(ev.target){_67=ev.target;}}var ex=this.getPageX(ev);var ey=this.getPageY(ev);var _6a=this.getViewportWidth();var _6b=this.getViewportHeight();if((/Safari|Konqueror|KHTML/gi).test(navigator.userAgent)){var _6c=ev.pageX-window.pageXOffset;var _6d=ev.pageY-window.pageYOffset;var _6e=(_6d>(_6b/2))?"b":"t";_6e+=(_6c>(_6a/2))?"r":"l";}else{var _6e=(ev.clientY>(_6b/2))?"b":"t";_6e+=(ev.clientX>(_6a/2))?"r":"l";}var _6f=null;if(_67){var _70=_67;for(var i=0;(i<5)||(!_70);i++){if((_70.tagName=="A"||_70.tagName=="AREA")&&_70.href){_6f=_70;break;}_70=_70.parentNode;}}if(_6f){var spa=this;if(!this.is_valid_link(_6f)){return;}if(this.div.main.style.visibility!="visible"){this.timer_id.show=window.setTimeout(function(){spa.show(_6f,ex,ey,_6e,_67);},_65);}else{if(!_67||(this.current_element!=_67)){this.timer_id.show=window.setTimeout(function(){spa.show(_6f,ex,ey,_6e,_67);},_66);}}}},show:function(_73,ex,ey,_76,_77){if(this.div.url_a.href!=_73.href){this.raise_loading_img();}if(!_76){_76=this.current_orientation;}this.orientation(_76);this.div.box.value=this.cfg.text.search_box;this.div.box.blur();var spa=this;window.setTimeout(function(){spa.show_part2(_73,ex,ey,_76,_77);},0);var _79=this.cfg.prefix.spasense+"spasense.php?key="+this.cfg.key+"&url="+_73.href+"&cp="+this.campaign("spasense")+"&src="+encodeURIComponent(this.cfg.source);if(this.cfg.search_type=="spasense"&&this.cfg.search_box==true){if(this.div.spasense_iframe.src!=_79){this.div.spasense_iframe.src=_79;}}else{this.div.spasense_iframe.src="";}},show_part2:function(_7a,ex,ey,_7d,_7e){this.preview_url(_7a);var pad=5;if(_7d.substr(0,1)=="b"){ey-=(this.div.main.offsetHeight+pad);}else{ey+=pad;}if(_7d.substr(1,1)=="r"){ex-=this.div.main.offsetWidth;}this.move(ex,ey);this.current_element=_7e;this.div.main.style.visibility="visible";},orientation:function(_80,_81){var _82=this.cfg.prefix.bg;switch(_80){case "bl":this.div.body.style.top=this.cfg.offset.body.bottom+"px";this.div.options.style.top=this.cfg.offset.options.bottom+"px";break;case "br":this.div.body.style.top=this.cfg.offset.body.bottom+"px";this.div.options.style.top=this.cfg.offset.options.bottom+"px";break;case "tl":this.div.body.style.top=this.cfg.offset.body.top+"px";this.div.options.style.top=this.cfg.offset.options.top+"px";break;case "tr":this.div.body.style.top=this.cfg.offset.body.top+"px";this.div.options.style.top=this.cfg.offset.options.top+"px";break;default:return;break;}this.div.ether.style.left=this.cfg.ether[_80].x+"px";this.div.ether.style.top=this.cfg.ether[_80].y+"px";_82+="_"+_80;_82+=(_81?"_d.png":".png");if(this.needs_png_fix){this.div.bg_img.runtimeStyle.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+_82+"',sizingMethod='scale')";}else{this.div.main.style.background="url("+_82+")";}this.current_orientation=_80;},highlight:function(_83){this.clear_timer("show");this.orientation(this.current_orientation,_83);},preview_url:function(_84){var url=_84.href;var _86=_84.target;this.current_url=url;this.div.url_a.href=url;this.div.url_a.target=_86;this.div.img_a.href=url;this.div.img_a.target=_86;if(this.cfg.redirect_param){var _87="[\\?&]"+this.cfg.redirect_param+"=([^]*)";var _88=new RegExp(_87);var _89=_88.exec(url);if(_89==null){this.div.url_a.innerHTML=url.replace(/\w+:\/\/(www\.)?/,"");}else{this.div.url_a.innerHTML=_89[1].replace(/(\w+:\/\/)?(www\.)?/,"");url=_89[1];}}else{this.div.url_a.innerHTML=url.replace(/\w+:\/\/(www\.)?/,"");}var m=url.match(/\w+:\/\/([^\/]*)/);if(m){this.div.preview.title="Go to "+m[1];this.div.loading_img.title="Go to "+m[1];}else{this.div.preview.title="";this.div.loading_img.title="";}this.clear_timer("retry");if(this.retry_url_list[url]){this.div.preview.src=this.retry_url_list[url];}else{this.div.preview.src=this.cfg.prefix.preview+"preview/?url="+encodeURIComponent(url)+"&key="+this.cfg.key+"&src="+encodeURIComponent(this.cfg.source)+"&cp="+this.campaign("preview")+"&sb="+(this.cfg.search_box?"1":"0")+"&v="+this.cfg.version;}},link_click:function(_8b){switch(_8b){case "click":var _8c=this.cfg.prefix.preview+"explore/"+Math.floor((Math.random()*100000))+"/?url="+encodeURIComponent(this.current_url)+"&key="+this.cfg.key+"&src="+encodeURIComponent(this.cfg.source)+"&cp="+this.campaign("redir");this.div.url_a.href=_8c+"&tol=url";this.div.img_a.href=_8c+"&tol=image";break;}},check_image_status:function(ev){this.lower_loading_img();if(this.div.preview.width==274){var _8e=1;var url=this.div.preview.src;var _90=/retry=(\d+)/;var _91=url.match(_90);if(_91){_8e=Number(_91[1])+1;url=url.replace(_90,"retry="+_8e);}else{url+="&retry="+_8e;}if(_8e>this.cfg.retry_interval.length){return;}if(_8e==this.cfg.retry_interval.length){url+="&final=1";}this.retry_url_list[this.div.url_a.href]=url;if(this.div.main.style.visibility=="visible"){var spa=this;var _93=this.cfg.retry_interval[_8e-1];this.clear_timer("retry");this.timer_id.retry=window.setTimeout(function(){spa.div.preview.src=url;},_93);}}},form_submit:function(ev){var _95=false;if(this.div.box.value===this.cfg.text.search_box){this.div.form_campaign.value=this.campaign("defaulttext");_95=true;}else{if(this.div.box.value===""){this.div.form_campaign.value=this.campaign("emptybox");_95=true;}else{this.div.form_campaign.value=this.campaign("bsb");}}if(_95){var _96=this.cfg.prefix.search+"?source="+encodeURIComponent(this.cfg.source)+"&campaign="+this.div.form_campaign.value;if(this.cfg.search_type=="image"){_96+="&query=sunflower";}window.open(_96,"_blank");ev.returnValue=false;if(ev.preventDefault){ev.preventDefault();}return false;}},needs_png_fix:(navigator.userAgent.match(/msie (5\.5|6)/i)&&navigator.platform=="Win32"),isFirefox:(navigator.userAgent.match(/firefox/i)),yahoo_yui_section_being:function(){"The following section of code adapted from the Yahoo YUI Library";" Copyright (c) 2006, Yahoo! Inc. All rights reserved.";" Code licensed under the BSD License:";" http://developer.yahoo.net/yui/license.txt";" Version: 0.11.4";},isSafari:(/Safari|Konqueror|KHTML/gi).test(navigator.userAgent),isIE:(!this.isSafari&&!navigator.userAgent.match(/opera/gi)&&navigator.userAgent.match(/msie/gi)),isOpera:(navigator.userAgent.match(/Opera/gi)),getPageX:function(ev){var x=ev.pageX;if(!x&&0!==x){x=ev.clientX||0;if(this.isIE){x+=this._getScrollLeft();}}return x;},getPageY:function(ev){var y=ev.pageY;if(!y&&0!==y){y=ev.clientY||0;if(this.isIE){y+=this._getScrollTop();}}return y;},_getScrollLeft:function(){return this._getScroll()[1];},_getScrollTop:function(){return this._getScroll()[0];},_getScroll:function(){var dd=document.documentElement,db=document.body;if(dd&&(dd.scrollTop||dd.scrollLeft)){return [dd.scrollTop,dd.scrollLeft];}else{if(db){return [db.scrollTop,db.scrollLeft];}else{return [0,0];}}},getViewportHeight:function(){var _9c=-1;var _9d=document.compatMode;if((_9d||this.isIE)&&!this.isOpera){switch(_9d){case "CSS1Compat":_9c=document.documentElement.clientHeight;break;default:_9c=document.body.clientHeight;}}else{_9c=self.innerHeight;}return _9c;},getViewportWidth:function(){var _9e=-1;var _9f=document.compatMode;if(_9f||this.isIE){switch(_9f){case "CSS1Compat":_9e=document.documentElement.clientWidth;break;default:_9e=document.body.clientWidth;}}else{_9e=self.innerWidth;}return _9e;},getWidth:function(_a0){if(_a0==document.body||_a0==document||_a0==window){return window.getWidth();}else{if(_a0){var _a1=parseInt(_a0.offsetWidth);return (_a1==0)?parseInt(_a0.style.width):_a1;}else{return null;}}},getHeight:function(_a2){if(_a2==document.body||_a2==document||_a2==window){return window.getHeight();}else{if(_a2){var _a3=parseInt(_a2.offsetHeight);return (_a3==0)?parseInt(_a2.style.height):_a3;}else{return null;}}},getLeft:function(_a4){return _a4.offsetLeft;},getRight:function(_a5){return this.getLeft(_a5)+this.getWidth(_a5);},getTop:function(_a6){return _a6.offsetTop;},getBottom:function(_a7){return this.getTop(_a7)+this.getHeight(_a7);},trim:function(str){return str.replace(/^\s*|\s*$/g,"");},yahoo_yui_section_end:function(){"End Yahoo YUI Library adapted code section";},log:function(msg,obj){if(!this.isFirefox||typeof console=="undefined"){return;}if(obj){console.log(msg,obj);}else{console.log(msg);}}};var snap_preview_anywhere=new snapPreviewAnywhere();