var unreserved = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_.~";
var reserved = "!*'();:@&=+$,/?%#[]";
var allowed = unreserved + reserved;
var hexchars = "0123456789ABCDEFabcdef";
function gethex(decimal) { return "%" + hexchars.charAt(decimal >> 4) + hexchars.charAt(decimal & 0xF);  }
function dourlencode(s)
{
 var decoded = s;
 var encoded = "";
 for(var i = 0; i < decoded.length; i++ )
 {
  var ch = decoded.charAt(i);
  if (unreserved.indexOf(ch) != -1) { encoded = encoded + ch; }
  else
  {
   var charcode = decoded.charCodeAt(i);
   if (charcode < 128){ encoded += gethex(charcode); }
   else if (charcode > 127 && charcode < 2048){ encoded += gethex((charcode >> 6) | 0xC0) + gethex((charcode & 0x3F) | 0x80); }
   else if (charcode > 2047 && charcode < 65536){ encoded += gethex((charcode >> 12) | 0xE0) + gethex(((charcode >> 6) & 0x3F) | 0x80) + gethex((charcode & 0x3F) | 0x80); }
   else if (charcode > 65535)
   {
    encoded += gethex((charcode >> 18) | 0xF0) + gethex(((charcode >> 12) & 0x3F) | 0x80) +
               gethex(((charcode >> 6) & 0x3F) | 0x80) + gethex((charcode & 0x3F) | 0x80);
   }
  }
 }
 return encoded;
}

function clk(na)
{
 var img = new Image();
 img.src = 'http://www.traveling-world.de/web20clk.php?na='+dourlencode(na)+'&t='+(new Date()).getTime();
}

function closeLink(r)
{
 h = document.getElementById('itsalinksetter'+r);
 h.innerHTML = '';
}

function openLink(r)
{
 h = document.getElementById('itsalinksetter'+r);
 h.style.position = 'absolute';
 h.style.left = '0px';
 h.style.top = '0px';
 h.innerHTML = '<div style="width:300px; border:1px solid #BFBFBF; background-color:#FFFEE1; position:relative;"><table width="100%"><tr><td style="font-size:9pt;">URL:</td><td><input style="font-size:9pt;" type="Text" name="" value="'+location.href+'" onfocus="this.select()" style="width:200px;"></td></tr><tr><td style="font-size:9pt;">HTML-Code:</td><td><input style="font-size:9pt;" type="Text" name="" value="&lt;a href=&quot;'+location.href+'&quot;&gt;'+document.title+'&lt;/a&gt;" style="width:200px;" onfocus="this.select()"></td></tr><tr><td style="font-size:9pt;">BB-Code:</td><td><input style="font-size:9pt;" type="Text" name="" value="[url='+location.href+']'+document.title+'[/url]" style="width:200px;" onfocus="this.select()"></td></tr></table><div style="position:absolute; left:280px; top:5px;"><a href="#" onclick="closeLink('+r+')"><img src="http://www.traveling-world.de/btn_del.gif" width="16" height="16" border="0" alt="Schließen"></a></div></div>';
 return false;
}

function setbookmark(title,url)
{
 if (window.sidebar){ window.sidebar.addPanel(title, url, "");} //firefox
 else if(window.opera && window.print)
 { // opera
  var elem = document.createElement('a');
  elem.setAttribute('href',url);
  elem.setAttribute('title',title);
  elem.setAttribute('rel','sidebar');
  elem.click();
 }
 else if(document.all){ window.external.AddFavorite(url, title); }// ie
}

var loc = dourlencode(location.href);
var tit = dourlencode(document.title);

   document.writeln('<table border="0" cellspacing="0" cellpadding="0"><tr>');
   document.writeln('<td rowspan="2" style="padding-right:8px; border-right:1px dashed #DFDFDF; font-size:9pt; white-space: nowrap;" align="right">');

   r = Math.round(Math.random()*10000);
     document.writeln('<a style="white-space: nowrap; font-size:8pt; z-index:0;" onclick="clk(\'linksetter\'); return openLink('+r+');" target="_blank" href="#">Link zu dieser<br> Seite setzen</a><span style="position:relative; z-index:0;"><span id="itsalinksetter'+r+'" style=" z-index:9999;"></span></span>');

   document.writeln('</td>');

   document.writeln('<td style="padding-right:8px; padding-left:8px; border-right:1px dashed #DFDFDF; font-size:9pt; white-space: nowrap;" align="right">');

     document.writeln('<a onclick="clk(\'blinklist\')" target="_blank" href="http://www.blinklist.com/index.php?Action=Blink/addblink.php&Description=&Url='+loc+'&Title='+tit+'"><img src="http://www.traveling-world.de/btn_blinklist.gif" width="16" height="16" border="0" alt="zu Blinklist hinzuf&uuml;gen" title="zu Blinklist hinzuf&uuml;gen"></a>');

     document.writeln('<a onclick="clk(\'del.icio.us\')" target="_blank" href="http://del.icio.us/post?url='+loc+'&title='+tit+'"><img src="http://www.traveling-world.de/btn_delic.gif" width="16" height="16" border="0" alt="zu del.icio.us hinzuf&uuml;gen" title="zu del.icio.us hinzuf&uuml;gen"></a>');

//     document.writeln('<a onclick="clk(\'digg.com\')" target="_blank" href="http://digg.com/submit?phase=2&url='+loc+'"><img src="http://www.traveling-world.de/btn_digg.gif" width="16" height="16" border="0" alt="zu Digg.com hinzuf&uuml;gen" title="zu Digg.com hinzuf&uuml;gen"></a>');

     document.writeln('<a onclick="clk(\'facebook.com\')" href="http://www.facebook.com/share.php?u='+loc+'" title="zu Facebook hinzuf&uuml;gen" target="_blank"><img src="http://www.traveling-world.de/btn_facebook.gif" width="16" height="16" alt="zu Facebook hinzuf&uuml;gen" border="0" /></a>');

     document.writeln('<a onclick="clk(\'favoriten.de\')" href="http://www.favoriten.de/url-hinzufuegen.html?bm_url='+loc+'&bm_title='+tit+'" title="zu Favoriten.de hinzuf&uuml;gen" target="_blank"><img src="http://www.traveling-world.de/btn_favoriten_de.gif" width="16" height="16" alt="zu Favoriten.de hinzuf&uuml;gen" border="0" /></a>');

     document.writeln('<a onclick="clk(\'folkd.com\')" target="_blank" href="http://www.folkd.com/submit/'+loc+'"><img src="http://www.traveling-world.de/btn_folkd.gif" width="16" height="16" border="0" alt="zu Folkd hinzuf&uuml;gen" title="zu Folkd hinzuf&uuml;gen"></a>');

//     document.writeln('<a onclick="clk(\'furl.net\')" target="_blank" href="http://www.furl.net/storeIt.jsp?u='+loc+'&t='+tit+'"><img src="http://www.traveling-world.de/btn_furl.gif" width="16" height="16" border="0" alt="zu FURL hinzuf&uuml;gen" title="zu FURL hinzuf&uuml;gen"></a>');

     document.writeln('<a onclick="clk(\'google.com\')" target="_blank" href="http://www.google.com/bookmarks/mark?op=add&hl=de&bkmk='+loc+'&title='+tit+'"><img src="http://www.traveling-world.de/btn_google.gif" width="16" height="16" border="0" alt="zu Google hinzuf&uuml;gen" title="zu Google hinzuf&uuml;gen"></a>');



    document.writeln('</td><td style="padding-right:8px; padding-left:8px; font-size:9pt; white-space: nowrap;" align="right">');

    document.writeln('<a onclick="setbookmark(document.title,location.href); clk(\'IEFavourite\')" href="#"><img src="http://www.traveling-world.de/btn_fav.gif" width="16" height="16" border="0" title="zu Favoriten hinzufügen" alt="zu Favoriten hinzufügen"></a>');

    document.writeln('</td></tr><tr><td style="padding-left:8px; padding-right:8px; border-right:1px dashed #DFDFDF; font-size:9pt; white-space: nowrap;" align="right">');

     document.writeln('<a onclick="clk(\'linkarena.com\')" target="_blank" href="http://linkarena.com/linkadd?user=&url='+loc+'"><img src="http://www.traveling-world.de/btn_linkarena.gif" width="16" height="16" border="0" alt="zu Linkarena hinzuf&uuml;gen" title="zu Linkarena hinzuf&uuml;gen"></a>');

     document.writeln('<a onclick="clk(\'mister-wong.de\')" target="_blank" href="http://www.mister-wong.de/index.php?action=addurl&bm_url='+loc+'&bm_description='+tit+'"><img src="http://www.traveling-world.de/btn_wong.gif" width="16" height="16" border="0" alt="zu Mr.Wong hinzuf&uuml;gen" title="zu Mr.Wong hinzuf&uuml;gen"></a>');

//     document.writeln('<a onclick="clk(\'oneview.de\')" target="_blank" href="http://www.oneview.de/quickadd/neu/addBookmark.jsf?URL='+loc+'&title='+tit+'"><img src="http://www.traveling-world.de/btn_onview.gif" width="16" height="16" border="0" alt="zu Oneview hinzuf&uuml;gen" title="zu Oneview hinzuf&uuml;gen"></a>');

     document.writeln('<a onclick="clk(\'technorati.com\')" target="_blank" href="http://technorati.com/faves?add='+loc+'"><img src="http://www.traveling-world.de/btn_technorati.gif" width="16" height="16" border="0" alt="zu Technorati hinzuf&uuml;gen" title="zu Technorati hinzuf&uuml;gen"></a>');

     document.writeln('<a onclick="clk(\'twitter.com\')" target="_blank" href="http://twitthis.com/twit?url='+loc+'&title='+tit+'"><img src="http://www.traveling-world.de/btn_twitter.gif" width="16" height="16" border="0" alt="zu Twitter hinzuf&uuml;gen" title="zu Twitter hinzuf&uuml;gen"></a>');

     document.writeln('<a onclick="clk(\'webnews.de\')" target="_blank" href="http://www.webnews.de/einstellen?url='+loc+'&title='+tit+'"><img src="http://www.traveling-world.de/btn_webnews.gif" width="16" height="16" border="0" alt="zu Webnews hinzuf&uuml;gen" title="zu Webnews hinzuf&uuml;gen"></a>');

     document.writeln('<a onclick="clk(\'live.com\')" target="_blank" href="https://favorites.live.com/quickadd.aspx?marklet=1&mkt=de-de&url='+loc+'&title='+tit+'&top=0"><img src="http://www.traveling-world.de/btn_windowslive.gif" width="16" height="16" border="0" alt="zu Windows Live hinzuf&uuml;gen" title="zu Windows Live hinzuf&uuml;gen"></a>');

     document.writeln('<a onclick="clk(\'yahoo.com\')" target="_blank" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u='+loc+'&t='+tit+'"><img src="http://www.traveling-world.de/btn_yahoo.gif" width="16" height="16" border="0" alt="zu Yahoo hinzuf&uuml;gen" title="zu Yahoo hinzuf&uuml;gen"></a>');

//     document.writeln('<a onclick="clk(\'yigg.de\')" target="_blank" href="http://yigg.de/neu?exturl='+loc+'"><img src="http://www.traveling-world.de/btn_yigg.gif" width="16" height="16" border="0" alt="zu Yigg hinzuf&uuml;gen" title="zu Yigg hinzuf&uuml;gen"></a>');

    document.writeln('</td><td style="padding-right:8px; padding-left:8px; font-size:9pt; white-space: nowrap;" align="right">');

    document.writeln('<a onclick="clk(\'IEHomepage\')" id="homepageid" style="behavior:url(#default#homepage);" href="javascript: document.all.homepageid.setHomePage(location)"><img src="http://www.traveling-world.de/btn_startseite.gif" width="16" height="16" border="0" alt="Als Startseite festlegen" title="Als Startseite festlegen"></a>');

    document.writeln('</td></tr></table>');