/* WebSnapr - Preview Bubble Javascript Written by Juan Xavier Larrea http://www.websnapr.com last modified: Aug 2007, mo ported to mootools by bourne http://blog.mos.cn last modified: Feb 2008 */ var WebSnaprPreviewBubble = { // Point this variable to the correct location of the bg.png file bubbleImagePath: '/assets/plugins/websnprx/bg.png', // Insert your WebSnapr developer key here - get it free on www.websnapr.com developerKey: '...', // DO NOT EDIT BENEATH THIS start: function () { $$('a.previewlink').each(function (previewlink) { previewlink.addEvent("mouseenter", WebSnaprPreviewBubble.attachBubble); previewlink.addEvent("mouseleave", WebSnaprPreviewBubble.detachBubble); }); }, attachBubble: function (event) { var event = new Event(event); WebSnaprPreviewBubble.previewBubble = new Element('div', {style:"text-align: center; z-index: 99999; position: absolute; top: "+ (event.page.y+17) +"px ; left: "+(event.page.x+15)+"px ; background: url("+ WebSnaprPreviewBubble.bubbleImagePath +") no-repeat; width: 240px; height: 190px; padding: 0; margin: 0;"}).adopt([new Element('img', {src:"http://images.websnapr.com/?key=" + encodeURIComponent(WebSnaprPreviewBubble.developerKey) + "&url="+encodeURIComponent(event.target.href), style:"padding-top: 0; padding-left: 0; padding-right: 0; padding-bottom: 0; margin-top: 27px; margin-left: 12px; margin-bottom: 0; margin-right: 0; border: 0"})]); WebSnaprPreviewBubble.previewBubble.inject(document.body); }, detachBubble: function (event) { WebSnaprPreviewBubble.previewBubble.remove(); } }; window.addEvent('domready', WebSnaprPreviewBubble.start);