if(window.FXGeoTagger===undefined){var FXGeoTagger={is_admin:0,root_url:"http://sl5.cdn.fwix.com/tools/geotagger/",static_url:"http://fxstatic2.fwix.com/1.6.82/tools/geotagger/",is_ie:navigator.appName=="Microsoft Internet Explorer",setup:function(){var a,b,c;FXGeoTagger.is_admin=document.location.hash=="#fwix_admin"?1:0;if(FXGeoTagger.is_admin)FXGeoTagger.root_url="http://fwix.com/tools/geotagger/";a=document.getElementsByTagName("a");b=0;for(c=a.length;b<c;++b)a[b].getAttribute("fx:apikey")&&new FXGeoTagger.Badge(a[b])},
constructEventFxns:function(){if(window.addEventListener){FXGeoTagger.addEventListener=function(a,b,c){a.addEventListener(b,c,false)};FXGeoTagger.docReady=function(a){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);a()},false)}}else if(document.attachEvent){FXGeoTagger.addEventListener=function(a,b,c){var e;e=b+c;a[e]=function(){var d=window.event;d.target=d.srcElement;d.which=d.keyCode?d.keyCode:d.button;d.preventDefault=
function(){window.event.returnValue=false};c(d)};a.attachEvent("on"+b,a[e])};FXGeoTagger.docReady=function(a){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);a()}})}}},getOffsetLeft:function(a){var b;a=a;for(b=0;a&&a!=document;){b+=a.offsetLeft;a=a.parentNode}return b},cookieGet:function(a){var b;if(document.cookie.length>0){b=document.cookie.indexOf(a+"=");if(b!=-1){b=b+a.length+1;a=document.cookie.indexOf(";",
b);if(a==-1)a=document.cookie.length;return unescape(document.cookie.substring(b,a))}}return""}};FXGeoTagger.Badge=function(a){var b,c,e,d,f,g,h,i;if(a.rel!="nofollow"){a.href="http://fwix.com/about/cities?ref=geotagger_badge";e=document.createElement("span");a.parentNode.insertBefore(e,a);a.parentNode.removeChild(a);e.appendChild(a);d=document.createElement("img");this.anchor=a;this.container=e;this.iframe_width=415;this.iframe_height=203;this.img=d;this.height=this.width=0;this.target_url=a.getAttribute("fx:url")||
window.location;c=this;FXGeoTagger.addEventListener(d,"load",function(){c.width=e.offsetWidth;c.height=e.offsetHeight});f=a.getAttribute("fx:lat")||"";g=a.getAttribute("fx:lng")||"";h=a.getAttribute("fx:postcode")||"";b=a.getAttribute("fx:apikey");i=a.getAttribute("fx:size")||"";d.style.border="0";d.src=FXGeoTagger.root_url+"badge.php?target_url="+encodeURIComponent(this.target_url)+"&apikey="+encodeURIComponent(b)+"&badge_size="+i+"&title="+encodeURIComponent(document.title)+"&lat="+encodeURIComponent(f)+
"&lon="+encodeURIComponent(g)+"&postcode="+encodeURIComponent(h);a.innerHTML="";a.appendChild(d);this.apikey=b;this.buildIframe()}};FXGeoTagger.Badge.prototype.buildIframe=function(){var a,b,c;a=this.container;a.style.position="relative";this.container.style.zIndex="0";this.anchor.style.position="relative";this.info_window=c=document.createElement("div");c.style.display="none";c.style.width=this.iframe_width+"px";c.style.position="absolute";c.style.margin="0px";c.style.left="0px";this.iframe=b=document.createElement("iframe");
c.appendChild(b);b.style.border="0";b.width=this.iframe_width+"px";b.height=this.iframe_height+"px";b.frameBorder="0";b.scrolling="no";b.allowTransparency="true";b.src=FXGeoTagger.root_url+"infowindow.php?api_key="+this.apikey+"&is_admin="+FXGeoTagger.is_admin+"&target_url="+encodeURIComponent(this.target_url);this.carrot=carrot=document.createElement("div");c.appendChild(carrot);carrot.style.width="12px";carrot.style.height="7px";carrot.style.background="url("+FXGeoTagger.static_url+"images/carrot_1.png)";
carrot.style.overflow="hidden";carrot.style.position="absolute";FXGeoTagger.addEventListener(a,"mouseover",this.mouseoverHandler());FXGeoTagger.addEventListener(a,"mouseout",this.mouseoutHandler());a.appendChild(c)};FXGeoTagger.Badge.prototype.mouseoverHandler=function(){var a=this;return function(){a.container.style.zIndex="1";a.info_window.style.display="block";a.positionInfoWindow()}};FXGeoTagger.Badge.prototype.mouseoutHandler=function(){var a=this;return function(){a.container.style.zIndex="0";
a.info_window.style.display="none"}};FXGeoTagger.Badge.prototype.positionInfoWindow=function(){var a,b,c,e;a=this.carrot;b=this.info_window;c=FXGeoTagger.getOffsetLeft(this.container)-10;e=this.container.offsetTop+20;if(document.body.clientWidth-(c-document.body.scrollLeft)<450){a.style.left=this.iframe_width-28+"px";b.style.left=this.width-this.iframe_width+"px"}else{a.style.left="15px";b.style.left="0px"}if(document.body.clientHeight-(e-document.body.scrollTop)<250){a.style.backgroundPosition="0px -7px";
b.style.padding="0px 0px 12px 0px";if(FXGeoTagger.is_ie){b.style.top=9-this.iframe_height-this.height+"px";a.style.top=this.iframe_height-6+"px"}else{b.style.top=4-this.iframe_height-this.height+"px";a.style.top=this.iframe_height-5+"px"}}else{a.style.backgroundPosition="0px 0px";a.style.top="5px";b.style.padding="7px 0px 0px 0px";b.style.top=FXGeoTagger.is_ie?this.height+"px":this.height-4+"px"}};FXGeoTagger.constructEventFxns();FXGeoTagger.docReady(FXGeoTagger.setup)};

