// singleton if( ! document.wikioSharePopupButton ) { (function(){ var ext = { buttons: {}, popups: {} }; document.write(""); // document.ready var ie = !!(window.attachEvent && !window.opera); var wk = /webkit\/(\d+)/i.test(navigator.userAgent) && (RegExp.$1 1) return; if (ie) (function () { try { d.documentElement.doScroll('left'); run(); } catch (err) { setTimeout(arguments.callee, 0); } })(); else if (wk) var t = setInterval(function () { if (/^(loaded|complete)$/.test(d.readyState)) clearInterval(t), run(); }, 0); }; // addEventSimple function addEventSimple(obj,evt,fn) { if (obj.addEventListener) obj.addEventListener(evt,fn,false); else if (obj.attachEvent) obj.attachEvent('on'+evt, function() { fn.call( obj, window.event ) } ); } function removeEventSimple(obj,evt,fn) { if (obj.removeEventListener) obj.removeEventListener(evt,fn,false); else if (obj.detachEvent) obj.detachEvent('on'+evt,fn); } ext.addEventSimple = addEventSimple; ext.removeEventSimple = removeEventSimple; // findPos (thanks, PPK) function findPos( obj ) { var curleft = curtop = 0; if( obj.offsetParent ) { do { curleft += obj.offsetLeft; curtop += obj.offsetTop; } while( obj = obj.offsetParent ); } return { left: curleft, top: curtop }; } ext.findPos = findPos; // windowSize (thanks www.howtocreate.co.uk) function windowSize() { var myWidth = 0, myHeight = 0; if( typeof( window.innerWidth ) == 'number' ) { //Non-IE myWidth = window.innerWidth; myHeight = window.innerHeight; } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { //IE 6+ in 'standards compliant mode' myWidth = document.documentElement.clientWidth; myHeight = document.documentElement.clientHeight; } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) { //IE 4 compatible myWidth = document.body.clientWidth; myHeight = document.body.clientHeight; } return { width: myWidth, height: myHeight }; } ext.windowSize = windowSize; // scrollOffset (thanks www.howtocreate.co.uk) function scrollOffset() { var scrOfX = 0, scrOfY = 0; if( typeof( window.pageYOffset ) == 'number' ) { //Netscape compliant scrOfY = window.pageYOffset; scrOfX = window.pageXOffset; } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) { //DOM compliant scrOfY = document.body.scrollTop; scrOfX = document.body.scrollLeft; } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) { //IE6 standards compliant mode scrOfY = document.documentElement.scrollTop; scrOfX = document.documentElement.scrollLeft; } return { left: scrOfX, top: scrOfY }; } ext.scrollOffset = scrollOffset; // animateShadow var shadow; function cancelShadow() { if( shadow.AP && shadow.AP.timer != null ) { clearInterval( shadow.AP.timer ); shadow.AP.timer = null; shadow.style.display = "none"; } } function animateShadow( r1, r2, cb ) { if( ! shadow ) { shadow = document.createElement( "div" ); shadow.style.position = "absolute"; shadow.style.display = "none"; shadow.style.border = "solid 1px #a0a0a0"; shadow.style.overflow = "hidden"; shadow.style.padding = "0px"; shadow.style.zIndex = 1; document.body.appendChild( shadow ); } else cancelShadow(); var s = 7, dw = Math.round( ( r2.width - r1.width ) / s ), dh = Math.round( ( r2.height - r1.height ) / s ), dl = Math.round( ( r2.left - r1.left ) / s ), dt = Math.round( ( r2.top - r1.top ) / s ); shadow.style.left = r1.left + "px"; shadow.style.top = r1.top + "px"; shadow.style.width = r1.width + "px"; shadow.style.height = r1.height + "px"; shadow.style.display = "block"; shadow.AP = { timer: null, rect: { left: r1.left, top: r1.top, width: r1.width, height: r1.height }, rect1: r1, rect2: r2, dw: dw, dh: dh, dl: dl, dt: dt }; shadow.AP.timer = setInterval( function() { shadow.style.left = ( shadow.AP.rect.left += shadow.AP.dl ) + "px"; shadow.style.top = ( shadow.AP.rect.top += shadow.AP.dt ) + "px"; shadow.style.width = ( shadow.AP.rect.width += shadow.AP.dw ) + "px"; shadow.style.height = ( shadow.AP.rect.height += shadow.AP.dh ) + "px"; --s; if( s == 0 ) { cancelShadow(); cb(); } }, 30 ); } ext.cancelShadow = cancelShadow; ext.animateShadow = animateShadow; function showPopup( t ) { var b = ext.buttons[t.key]; cancelShow( t ); t.style.display = "block"; // position popup (to avoid leaking it off the screen) var pos = findPos( b ); var wsize = windowSize(); var pageoff = scrollOffset(); wsize.width -= 20; wsize.height -= 20; // scrollbars var bottom = pageoff.top + wsize.height; var right = pageoff.left + wsize.width; var top, left; if( pos.top + b.offsetHeight + t.offsetHeight > bottom ) if( pos.top - t.offsetHeight right ) left = right - t.offsetWidth; else left = pos.left; t.style.left = left + "px"; t.style.top = top + "px"; // show animation and then popup animateShadow( { left: pos.left, top: pos.top, width: b.offsetWidth, height: b.offsetHeight }, { left: left, top: top, width: t.offsetWidth, height: t.offsetHeight }, function() { t.style.visibility = "visible"; } ); } function hidePopup( t ) { cancelHide( t ); t.style.visibility = "hidden"; t.style.display = "none"; } function cancelShow( t ) { if( t.showTimer != null ) { clearInterval( t.showTimer ); t.showTimer = null; } } function cancelHide( t ) { if( t.hideTimer != null ) { clearInterval( t.hideTimer ); t.hideTimer = null; } } var f1 = function( e ) { var t = ext.popups[this.key ? this.key : this.href]; cancelShow( t ); cancelHide( t ); if( t.style.visibility != "visible" && ! ( shadow && shadow.AP.timer != null ) ) t.showTimer = setInterval( function(){showPopup(t);}, 140 ); //open popup delay } var f2 = function( e ) { var el = e ? this : window.event.srcElement; var t = ext.popups[el.key ? el.key : el.href]; cancelShow( t ); cancelHide( t ); t.hideTimer = setInterval( function(){hidePopup(t);}, 300 ); //hide popup delay } function pushPopup( key, a0, a1 ) { ext.popups[key] = document.wikioSharePopupButton.popupFactory( key, a0, a1 ); } ext.pushPopup = pushPopup; function popupFactory( key, listRss, listGadget ) { // helper factory function listFactory( list ) { var t1, t2, t3; t1 = document.createElement( "ul" ); t1.className = "wikio-choice"; for( i = 0; i 0 ) { t1 = document.createElement( "span" ); t1.appendChild( document.createTextNode( "Share this article: " ) ); res.appendChild( t1 ); res.appendChild( listFactory( listRss ) ); } if(listGadget.length > 0 ) { t1 = document.createElement( "span" ); t1.appendChild( document.createTextNode( "LABEL_20__sharethis_createwidget" ) ); res.appendChild( t1 ); res.appendChild( listFactory( listGadget ) ); } t1 = document.createElement( "span" ); t1.id = "wikio-footer"; t1.appendChild( document.createTextNode( "Service powered by" ) ); foot=document.createElement( "a" ); foot.href= "https://web.archive.org/web/20202020202002/http://www.wikio.de/tools/sharethis"; foot.appendChild( t1 ); res.appendChild( foot ); res.style.visibility = "hidden"; res.style.display = "none"; // res.showPopup = showPopup; // res.hidePopup = hidePopup; // res.cancelShow = cancelShow; // res.cancelHide = cancelHide; res.showTimer = null; res.hideTimer = null; res.key = key; res.f1 = f1; res.f2 = f2; return res; } ext.popupFactory = popupFactory; document.wikioSharePopupButton = ext; var shadow; document.wikioSharePopupButton.ready( function() { var popup, ext = document.wikioSharePopupButton, lnk, i, b; var ls = []; for( i = 0; i