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 A=this;this.observe(window,"load",function(){A.onload()});var B=document.getElementById("snap_preview_anywhere");if(B&&B.defer){this.timer_id.partial=this.sto(function(){A.partial_check()},this.cfg.partial_check.delay)}},clear_timer:function(A){if(this.timer_id[A]){window.clearTimeout(this.timer_id[A]);this.timer_id[A]=0}},campaign:function(B){var C=window.location.host.replace(/:\d+$/,"");if(this.cfg.flavor=="xanga"){var A=window.location.pathname.match(/(\/\w+)/);C+=A[1]}return"spa"+(B?("_"+B):"")+"!"+C},is_internal_link:function(G){var F=/^(http|file)s?:\/\/(www\.)?(.*?)\//;if(this.domain===null){var B=document.location.href.match(F);if(B){this.domain=B[3]}else{this.domain=""}}var A=G.href.match(F);if(A&&(this.domain==A[3])){if(this.cfg.redirect_param){var C="[\\?&]"+this.cfg.redirect_param+"=([^]*)";var E=new RegExp(C);var D=E.exec(G.href);if(D==null){return true}else{return false}}else{return true}}else{return false}},is_valid_link:function(B){var C=B.href.match(/^(http)s?:\/\/([^#]*)/);var A=document.location.href.match(/^(http|file)s?:\/\/([^#]*)/);if(!C||!A||(C[2]==A[2])||(C[1]!=="http")){return false}return true},add_spa:function(B){var D=this;B.snap_preview_added="spa";B.text_trigger=false;if((this.cfg.show_link_icon=="off"||this.cfg.preview_trigger!="icon"||B.parent_link_icon=="no"||B.parent_link_icon=="both"||B.className.indexOf("snap_no_icon")!=-1||B.className.indexOf("snap_trigger_both")!=-1)&&B.className.indexOf("snap_trigger_icon")==-1&&B.parent_link_icon!="icon"){B.text_trigger=true}B.icon_trigger=false;var C=/
]*>/ig;var A=D.trim(B.innerHTML.replace(C,""));if((this.cfg.show_link_icon=="on"||B.className.indexOf("snap_trigger_both")!=-1||B.className.indexOf("snap_trigger_icon")!=-1||B.parent_link_icon=="icon"||B.parent_link_icon=="both")&&B.className.indexOf("snap_no_icon")==-1&&B.snap_icon_added!="no"&&A!=""){B.icon_trigger=true}B.act_suffix="";if(B.text_trigger&&B.icon_trigger){B.act_suffix=2}if(B.text_trigger){this.observe(B,"mouseover",function(E){D.show_delay(E,D.cfg.delay.show,D.cfg.delay.move,"link"+B.act_suffix)});this.observe(B,"mouseout",function(E){D.hide_delay(E,D.cfg.delay.hide)})}this.add_link_icon(B)},add_link_icon:function(B){var C=this;if(B.icon_trigger){var A=document.createElement("img");A.style.margin="0 0 0 0";A.style.padding="1px 0 0 0";A.style.width="14px";A.style.height="12px";A.style.border="0";if(!this.needs_png_fix||B.offsetHeight>14){A.style.verticalAlign="top"}A.style.display="inline";A.style.fontStyle="normal";A.style.fontWeight="normal";A.style.fontFamily='"trebuchet ms", arial, helvetica, sans-serif';A.style.textDecoration="none";A.style.cssFloat="none";A.style.styleFloat="none";A.style.background="";A.style.backgroundColor="transparent";A.style.backgroundImage="url("+this.cfg.img.palette+")";A.style.backgroundPosition=this.cfg.palette.link_icon.loc;A.style.backgroundRepeat="no-repeat";A.className="snap_preview_icon";A.src=this.cfg.img.link_icon;B.appendChild(A);A.snap_preview_added="spa";this.observe(A,"mouseover",function(D){C.show_delay(D,C.cfg.delay.show,C.cfg.delay.move,"icon"+B.act_suffix)});this.observe(A,"mouseout",function(D){C.hide_delay(D,C.cfg.delay.hide)})}B.snap_icon_added="spa"},conditional_add_spa:function(C,B,A){if(C.snap_preview_added){return }else{if(C.className.indexOf("snap_nopreview")!=-1){C.snap_preview_added="no";return }}if((C.className.indexOf("snap_preview")!==-1)||(C.className.indexOf("snap_trigger_icon")!==-1)||(C.className.indexOf("snap_trigger_both")!==-1)||((C.href.indexOf("https://")!=0)&&(this.cfg.auto_preview||B)&&(this.cfg.show_internal||!this.is_internal_link(C))&&(this.is_valid_link(C)))){C.parent_link_icon=A;this.add_spa(C)}else{C.snap_preview_added="no"}},add_link_events:function(O){var N;var M=[];var J=[];var A=[];var C=["a","area"];var L=document;if(O&&O.tagName){L=O}if(this.cfg.show_link_icon=="on"){var K;if(this.cfg.preview_trigger=="icon"){K=" snap_trigger_icon"}else{K=" snap_trigger_both"}if(this.cfg.platform=="blogger"){this.cfg.show_link_icon="off";var F=L.getElementsByTagName("div");for(var G=0;G-1){F[G].className+=K}}}if(this.cfg.platform=="typepad"){this.cfg.show_link_icon="off";var F=L.getElementsByTagName("div");for(var G=0;G-1){F[G].className+=K}}}}var Q=[];switch(this.cfg.el_scan){case"all":Q=["*"];break;case"default":Q=["div","span"];break}for(var I=0;I=F.length){B=L;H=false}if(B.tagName!="A"&&B.tagName!="AREA"){if(B.className.indexOf("snap_nopreview")!=-1){M.push(B)}else{if(B.className.indexOf("snap_preview")!=-1||B.className.indexOf("snap_no_icon")!=-1||B.className.indexOf("snap_trigger_icon")!=-1||B.className.indexOf("snap_trigger_both")!=-1){J.push(B)}}if(this.cfg.show_link_icon&&B.className.indexOf("snap_no_icon")!=-1){A.push(B)}}}}for(var G=0;G\n\n\n
& Disable\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(H){E.highlight(true)});this.observe(this.div.main,"mouseout",function(M){var N=M.relatedTarget||M.toElement;if(N==null){return }if(E.isOpera){var L=E.getTop(E.div.main);var J=E.getLeft(E.div.main);var I=E.getBottom(E.div.main);var O=E.getRight(E.div.main);var H=M.pageX||(M.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft));var P=M.pageY||(M.clientY+(document.documentElement.scrollTop||document.body.scrollTop));var K=(H>J&&HL&&P(P/2))?"b":"t";A+=(G>(F/2))?"r":"l"}else{var A=(N.clientY>(P/2))?"b":"t";A+=(N.clientX>(F/2))?"r":"l"}var M=null;if(C){var I=C;for(var B=0;(B<5)||(!I);B++){if((I.tagName=="A"||I.tagName=="AREA")&&I.href){M=I;break}I=I.parentNode}}if(M){var O=this;if(!this.is_valid_link(M)){return }if(this.div.main.style.visibility!="visible"){this.timer_id.show=this.sto(function(){O.show(M,L,J,A,C,K)},D)}else{if(!C||(this.current_element!=C)){this.timer_id.show=this.sto(function(){O.show(M,L,J,A,C,K)},H)}}}},show:function(F,E,C,B,D,H){this.div.body.style.display="inline";this.div.options.style.display="none";if(this.div.url_a.href!=F.href){this.raise_loading_img()}if(!B){B=this.current_orientation}this.orientation(B);this.div.box.value=this.cfg.text.SearchTheWeb;this.div.box.blur();var G=this;this.sto(function(){G.show_part2(F,E,C,B,D,H)},0);var A=this.cfg.prefix.spasense+"rk.php?key="+this.cfg.key+"&url="+F.href+"&html="+F.innerHTML+"&cp="+this.campaign("spasense")+"&size="+this.cfg.size+"&src="+encodeURIComponent(this.cfg.source);if(this.cfg.search_type=="spasense"&&this.cfg.search_box==true){if(this.div.spasense_iframe.src!=A){this.div.spasense_iframe.src=A}}else{this.div.spasense_iframe.src=""}},show_part2:function(E,D,B,A,C,F){this.preview_url(E,F);if(A.substr(0,1)=="b"){B-=(this.div.main.offsetHeight+5)}else{B+=10}if(A.substr(1,1)=="r"){D-=this.div.main.offsetWidth}this.move(D,B);this.current_element=C;this.div.main.style.visibility="visible"},orientation:function(B,A){var C=this.cfg.prefix.bg;switch(B){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[B].x+"px";this.div.ether.style.top=this.cfg.ether[B].y+"px";C+="_"+B;C+=(A?"_d.png":".png");if(this.needs_png_fix){this.div.bg_img.runtimeStyle.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+C+"',sizingMethod='scale')"}else{this.div.main.style.background="url("+C+")"}this.current_orientation=B},highlight:function(A){this.clear_timer("show");this.orientation(this.current_orientation,A)},preview_url:function(F,G){var C=F.href;var H=F.target;this.current_url=C;this.div.url_a.href=C;this.div.url_a.target=H;this.div.img_a.href=C;this.div.img_a.target=H;if(this.cfg.redirect_param){var B="[\\?&]"+this.cfg.redirect_param+"=([^]*)";var E=new RegExp(B);var D=E.exec(C);if(D==null){this.div.url_a.innerHTML=C.replace(/\w+:\/\/(www\.)?/,"")}else{this.div.url_a.innerHTML=D[1].replace(/(\w+:\/\/)?(www\.)?/,"");C=D[1]}}else{this.div.url_a.innerHTML=C.replace(/\w+:\/\/(www\.)?/,"")}var A=C.match(/\w+:\/\/(.*)/);if(A){this.div.preview.title=this.cfg.text.GoToURL.replace(/%URL/,A[1]);this.div.loading_img.title=this.cfg.text.GoToURL.replace(/%URL/,A[1])}else{this.div.preview.title="";this.div.loading_img.title=""}this.clear_timer("retry");if(this.retry_url_list[C]){this.div.preview.src=this.retry_url_list[C]}else{this.div.preview.src=this.cfg.prefix.preview+"preview/?url="+encodeURIComponent(C)+"&key="+this.cfg.key+"&src="+encodeURIComponent(this.cfg.source)+"&cp="+this.campaign("preview")+"&sb="+(this.cfg.search_box?"1":"0")+"&v="+this.cfg.version+"&size="+this.cfg.size+"&lang="+this.cfg.lang+"&search_type="+this.cfg.search_type+"&act="+G}},link_click:function(E,C){var F=false;switch(E){case"up":var A=0;if(typeof (C.which)=="number"){A=C.which}else{if(typeof (C.button)=="number"){A=C.button}}if((this.isIE&&A==4)||(!this.isIE&&A==2)){F=true}break;case"click":F=true;break}if(F){var B=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=B+"&tol=url";this.div.img_a.href=B+"&tol=image";var D=this;this.sto(function(){D.div.url_a.href=D.current_url;D.div.img_a.href=D.current_url},0)}},check_image_status:function(D){this.lower_loading_img();if(this.div.preview.width==274){var A=1;var C=this.div.preview.src;var G=/retry=(\d+)/;var F=C.match(G);if(F){A=Number(F[1])+1;C=C.replace(G,"retry="+A)}else{C+="&retry="+A}if(A>this.cfg.retry_interval.length){return }if(A==this.cfg.retry_interval.length){C+="&final=1"}this.retry_url_list[this.div.url_a.href]=C;if(this.div.main.style.visibility=="visible"){var E=this;var B=this.cfg.retry_interval[A-1];this.clear_timer("retry");this.timer_id.retry=this.sto(function(){E.div.preview.src=C},B)}}},form_submit:function(B){var C=false;if(this.div.box.value===this.cfg.text.SearchTheWeb){this.div.form_campaign.value=this.campaign("defaulttext");if(this.cfg.search_type!="adult"){C=true}}else{if(this.div.box.value===""){this.div.form_campaign.value=this.campaign("emptybox");C=true}else{this.div.form_campaign.value=this.campaign("bsb")}}if(C){var A=this.cfg.prefix.search+"?source="+encodeURIComponent(this.cfg.source)+"&campaign="+this.div.form_campaign.value;if(this.cfg.search_type=="image"){A+="&query=sunflower"}window.open(A,"_blank");B.returnValue=false;if(B.preventDefault){B.preventDefault()}return false}},sto:function(B,A){if(this.cfg.flavor=="xanga"){return window.restrictedSetTimeout(B,A)}else{return window.setTimeout(B,A)}},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(){" 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(B){var A=B.pageX;if(!A&&0!==A){A=B.clientX||0;if(this.isIE){A+=this._getScrollLeft()}}return A},getPageY:function(A){var B=A.pageY;if(!B&&0!==B){B=A.clientY||0;if(this.isIE){B+=this._getScrollTop()}}return B},_getScrollLeft:function(){return this._getScroll()[1]},_getScrollTop:function(){return this._getScroll()[0]},_getScroll:function(){var A=document.documentElement,B=document.body;if(A&&(A.scrollTop||A.scrollLeft)){return[A.scrollTop,A.scrollLeft]}else{if(B){return[B.scrollTop,B.scrollLeft]}else{return[0,0]}}},getViewportHeight:function(){var A=-1;var B=document.compatMode;if((B||this.isIE)&&!this.isOpera){switch(B){case"CSS1Compat":A=document.documentElement.clientHeight;break;default:A=document.body.clientHeight}}else{A=self.innerHeight}return A},getViewportWidth:function(){var A=-1;var B=document.compatMode;if(B||this.isIE){switch(B){case"CSS1Compat":A=document.documentElement.clientWidth;break;default:A=document.body.clientWidth}}else{A=self.innerWidth}return A},getWidth:function(A){if(A==document.body||A==document||A==window){return window.getWidth()}else{if(A){var B=parseInt(A.offsetWidth);return(B==0)?parseInt(A.style.width):B}else{return null}}},getHeight:function(B){if(B==document.body||B==document||B==window){return window.getHeight()}else{if(B){var A=parseInt(B.offsetHeight);return(A==0)?parseInt(B.style.height):A}else{return null}}},getLeft:function(A){return A.offsetLeft},getRight:function(A){return this.getLeft(A)+this.getWidth(A)},getTop:function(A){return A.offsetTop},getBottom:function(A){return this.getTop(A)+this.getHeight(A)},trim:function(A){return A.replace(/^\s*|\s*$/g,"")},yahoo_yui_section_end:function(){},log:function(B,A){if(!this.isFirefox||typeof console=="undefined"){return }if(A){console.log(B,A)}else{console.log(B)}},Rescan:function(A){if(A===null){return }this.add_link_events(A)}};var snap_preview_anywhere=new snapPreviewAnywhere();