var txtVersion = "1.1"; var addtoInterval = null; var popupWin = ''; var sns = [ {name:'Facebook', image: 'facebook.gif', url: 'http://www.facebook.com/share.php?', urlVar: 'u', titleVar: '', noteVar: '', returnVar: '', otherVars: '' }, {name:'Twitter', image: 'twitter.gif', url: 'http://twitter.com/?', urlVar: 'status', titleVar: '', noteVar: '', returnVar: '', otherVars: '' }, {name:'Del.icio.us', image: 'delicious.gif', url: 'http://del.icio.us/post?', urlVar: 'url', titleVar: 'title', noteVar: '', returnVar: '', otherVars: '' }, {name:'Digg', image: 'digg.gif', url: 'http://digg.com/submit?', urlVar: 'url', titleVar: '', noteVar: '', returnVar: '', otherVars: '&phase: 2' }, {name:'Reddit', image: 'AddTo_Reddit.png', url: 'http://reddit.com/submit?', urlVar: 'url', titleVar: 'title', noteVar: '', returnVar: '', otherVars: '' }, {name:'Stumbleupon', image: 'stumbleupon.gif', url: 'http://www.stumbleupon.com/submit?', urlVar: 'url', titleVar: '', noteVar: '', returnVar: '', otherVars: '' }, {name:'Yahoo! MyWeb', image: 'yahoo.gif', url: 'http://myweb2.search.yahoo.com/myresults/bookmarklet?', urlVar: 'u', titleVar: 't', noteVar: '', returnVar: '', otherVars: '&d: &ei: UTF-8' }, {name:'Google', image: 'google.gif', url: 'http://fusion.google.com/add?', urlVar: 'feedurl', titleVar: '', noteVar: '', returnVar: '', otherVars: '' }, {name:'Windows Live', image: 'AddTo_Live.png', url: 'https://favorites.live.com/quickadd.aspx?', urlVar: 'url', titleVar: '', noteVar: '', returnVar: '', otherVars: '&marklet: 1&mkt: en-us&top: 1' }, {name:'Mixx', image: 'mixx.gif', url: 'http://www.mixx.com/submit?', urlVar: 'page_url', titleVar: '', noteVar: '', returnVar: '', otherVars: '' }, {name:'Newsvine', image: 'newsvine.gif', url: 'http://www.newsvine.com/_wine/save?', urlVar: 'u', titleVar: '', noteVar: '', returnVar: '', otherVars: '' } ]; function DrawLink(index, cellClass) { document.write("" + /*sns[index].name +*/ " "); } function DrawLinks(cols, width, headClass, cellClass) { if (cols > sns.length) { for (var i = 0; i < sns.length; i++) { DrawLink(i, cellClass) document.write(" "); } } else { document.writeln(""); document.writeln(""); for (var i = 0; i < sns.length; i++) { document.write(""); if ( (((i+1)%cols) == 0) && (i != (sns.length-1))) document.writeln(""); } document.writeln("
Add this article to:
"); DrawLink(i, cellClass); document.writeln("
"); } } function addtoWin(addtoFullURL) { if (!popupWin.closed && popupWin.location){ popupWin.location.href = addtoFullURL; var addtoInterval = setInterval("closeAddTo();",1000); } else{ popupWin = window.open(addtoFullURL,'addtoPopUp','width=770px,height=500px,menubar=1,toolbar=1,status=1,location=1,resizable=1,scrollbars=1,left=0,top=100'); var addtoInterval = setInterval("closeAddTo();",1000); if (!popupWin.opener) popupWin.opener = self; } if (window.focus) {popupWin.focus()} return false; } // closes the popupWin function closeAddTo() { if (!popupWin.closed && popupWin.location){ if (popupWin.location.href == AddURL) //if it's the same url as what was bookmarked, close the win popupWin.close(); } else { //if it's closed - clear the timer clearInterval(addtoInterval) return true } } function addto(index){ var addtoFullURL = sns[index].url + sns[index].urlVar + "=" + AddURL + "&" + sns[index].titleVar + "=" + AddTitle + sns[index].otherVars ; if (sns[index].noteVar != "") addtoFullURL = addtoFullURL + "&" + sns[index].noteVar + "=" + AddTitle; if (sns[index].returnVar != "") addtoFullURL = addtoFullURL + "&" + sns[index].returnVar + "=" + AddURL; if (sns[index].name == "Twitter") addtoFullURL = sns[index].url + sns[index].urlVar + "=" + AddTitle + ' ' + AddURL ; switch(addtoMethod){ case 0: // 0=direct link self.location = addtoFullURL break case 1: // 1=popup addtoWin(addtoFullURL); break default: } return false; } function toggle(div_id) { var el = document.getElementById(div_id); if ( el.style.display == 'none' ) { el.style.display = 'block';} else {el.style.display = 'none';} } function blanket_size(popUpDivVar) { if (typeof window.innerWidth != 'undefined') { viewportheight = window.innerHeight; } else { viewportheight = document.documentElement.clientHeight; } if ((viewportheight > document.body.parentNode.scrollHeight) && (viewportheight > document.body.parentNode.clientHeight)) { blanket_height = viewportheight; } else { if (document.body.parentNode.clientHeight > document.body.parentNode.scrollHeight) { blanket_height = document.body.parentNode.clientHeight; } else { blanket_height = document.body.parentNode.scrollHeight; } } var blanket = document.getElementById('blanket'); blanket.style.height = blanket_height + 'px'; var popUpDiv = document.getElementById(popUpDivVar); popUpDiv_height=blanket_height/2-150;//150 is half popup's height popUpDiv.style.top = popUpDiv_height + 'px'; } function window_pos(popUpDivVar) { if (typeof window.innerWidth != 'undefined') { viewportwidth = window.innerHeight; } else { viewportwidth = document.documentElement.clientHeight; } if ((viewportwidth > document.body.parentNode.scrollWidth) && (viewportwidth > document.body.parentNode.clientWidth)) { window_width = viewportwidth; } else { if (document.body.parentNode.clientWidth > document.body.parentNode.scrollWidth) { window_width = document.body.parentNode.clientWidth; } else { window_width = document.body.parentNode.scrollWidth; } } var popUpDiv = document.getElementById(popUpDivVar); window_width=window_width/2-150;//150 is half popup's width popUpDiv.style.left = window_width + 'px'; } function popupshare(windowname) { blanket_size(windowname); window_pos(windowname); toggle('blanket'); toggle(windowname); } // checking across domains causes errors - this is to suppress these function handleError() {return true;} window.onerror = handleError;