//********************************************************************************
// This scipt is free to any usage, but the header author reference and istructions
// have to be included
//
// Author     : Claudio Michael Klemp 	email       claudio.klemp@gmail.com 
//										clickofono  http://www.clickofono.net/admin/
//
// Build      : bookmark.js version 1.0 (01-april-2010 not a joke)
// Download   : http://www.dunia.org/bookmark-1-0.zip
// Compatible : Opera, Safari, Firefox, Google Chrome and unbelievable 
//              Internet Explorer up to version 8, even if it is java and DOM
//
// This script allows whoever to bookmark your site on different social networks
// and blogging engines, and :
// obtain the correct hyperlink and text for a good SEO Link on external websites
// the link can be defined out of your title, meta keywords or meta description 
//
//********************************************************************************
// installation and usage
//********************************************************************************
// This link to us script requires in your html page somewhere, best at the end :
//
// <div id="Bookmark" style="position:absolute;top:220px;left:10px;width:420px;">
// </div>
//
// and just behind it the script loader :
//
// <script type="text/javascript">
// linkToUs("initialize");
// </script>
//
// or just uncomment the linkToUs call at the bottom of this script, 
// but make sure the call to the javascript is just shortly before the 
// closing </body> tag
// <script type="text/javascript" src="/bookmark/bookmark.js"></script>
//******************************************************************************
function linkToUs(Element){
	if (!Element) {
		Element = "title";
	}
	var LinkOptDiv   = '<div id="LinkMeNowHere" style="display:none;border-style: solid; border-color: rgb(178, 178, 178) rgb(74, 73, 74) rgb(74, 73, 74) rgb(178, 178, 178); border-width: 1px;  background-color: rgb(214, 211, 206); z-index: 999; >" onmouseout="this.style.display='+"'none';"+'" ><table bgcolor="#C0C0C0" border="0" padding: 5px; ><td align="right" bgcolor="navy"><a href="javascript:void(0)" onclick="linkToUs('+"'close'"+')"><img src="/bookmark/_close.gif" width="16px" height="16px" valign="top" margin="2px" border="0" alt="Close Link editor" /></a></td></tr><tr><td valign="top"><center><h3>Help us to build a better Web, your oppinion is  very important for us !</h3>Mouth to mouth propaganda helps to become even more useful for other people like me and you, so please let me know.<br /> Take a few seconds , let your friends and the world know, inform about this site or link this page, using the shortcuts here. <br />For any suggestion to build a better web, I am at your disposal<p>claudio.klemp@gmail.com<p></center></td></tr></table></div>'; 
	var LinkOptStart = '<table bgcolor="#C0C0C0" border="0" padding: 5px; ><td align="right" bgcolor="navy"><a href="javascript:void(0)" onclick="linkToUs('+"'close'"+')"><img src="/bookmark/_close.gif" width="16px" height="16px" valign="top" margin="2px" border="0" alt="Close Link editor" /></a></td></tr><tr><td valign="top"><textarea rows="4" cols="60">';
	var LinkOptEnd = '</textarea></td></tr><tr><td align="center">by <a href="javascript:void(0)" onclick="linkToUs('+"'title'"+')">Title</a> <a href="javascript:void(0)" onclick="linkToUs('+"'description'"+')">Description</a> <a href="javascript:void(0)" onclick="linkToUs('+"'keywords'"+')">Keywords</a> <a href="http://www.dunia.org" target="_blank"> a free script by Dunia LLc</a></td></tr></table>';
	var MyFooterStart	= "<p>(c) by Dunia LLc &nbsp;</p>"; 
	var MyFooterEnd		= '<a href="javascript:void(0);" onclick="linkToUs('+"'"+Element +"'"+')"><img  height="16" border="0" alt="Link to this Page" src="/bookmark/LinkToUs.png" /></a>'; 
	var MyAddress 		= document.location.href;
	var myTitle 		= document.title;
	var myMetaKeys		= getmetaContents('keywords')
	var myMetaDescr		= getmetaContents('description')
	if (Element == "title") {
		document.getElementById('Bookmark').innerHTML= LinkOptStart +'<a href="'+MyAddress+'">'+myTitle+'</a>' + LinkOptEnd  ;
		alert('You selected to use the page title as link text :\n\r\n\r '+myTitle+'\n\r\n\r Select the content of the textbox with your mouse,  \n\r then  copy (Control + c) and paste (Contol + v) it into your page.\n\r Thank you for linking the team of '  + MyAddress + ' \n\r\n\r (a free script by Claudio Klemp on behalf of Dunia LLc www.dunia.org )\n\r');
	} else if (Element == "keywords") {
		document.getElementById('Bookmark').innerHTML= LinkOptStart +'<a href="'+MyAddress+'">'+myMetaKeys+'</a>' + LinkOptEnd;
		alert('You selected to use the page keywords as link text :\n\r\n\r '+myMetaKeys+'\n\r\n\r Select the content of the textbox with your mouse,  \n\r then  copy (Control + c) and paste (Contol + v) it into your page.\n\r Thank you for linking the team of '  + MyAddress );
	} else if (Element == "description") {
		document.getElementById('Bookmark').innerHTML= LinkOptStart +'<a href="'+MyAddress+'">'+myMetaDescr+'</a>' + LinkOptEnd;
		alert('You selected to use the page desciption as link text :\n\r\n\r '+myMetaDescr+'\n\r\n\r Select the content of the textbox with your mouse,  \n\r then  copy (Control + c) and paste (Contol + v) it into your page.\n\r Thank you for linking the team of '  + MyAddress );
	} else {
		var LinkText ='<center><span onmouseover="var toshow=document.getElementById('+"'LinkMeNowHere'"+');toshow.style.display='+"'block';"+'">';
		LinkText = LinkText + '<a href="http://www.facebook.com/share.php?u='+MyAddress+'" target="_blank" >';
		LinkText = LinkText + ' <img src="/bookmark/facebook.gif" width="16px" height="16px" border="0" alt="Share this page on Facebook" /></a>';
		LinkText = LinkText + '<a href="http://www.google.com/bookmarks/mark?op=add&amp;bkmk='+MyAddress+'&amp;title='+myTitle+'" target="_blank" >';
		LinkText = LinkText + ' <img src="/bookmark/google.gif" width="16px" height="16px" border="0" alt="Share this page on Google"></a>';
		LinkText = LinkText + '<a href="http://technorati.com/faves/?add='+MyAddress+'" target="_blank" >';
		LinkText = LinkText + ' <img src="/bookmark/technorati.gif" width="16px" height="16px" border="0" alt="Share this page on Technorati"></a>';
		LinkText = LinkText + '<a href="http://del.icio.us/post?url='+MyAddress+'" target="_blank" >';
		LinkText = LinkText + ' <img src="/bookmark/delicious.gif" width="16px" height="16px" border="0" alt="Share this page on Delicio us"></a>';
		LinkText = LinkText + '<a href="http://oknotizie.com/post?url='+MyAddress+'&amp;title='+myTitle+'" target="_blank" >';
		LinkText = LinkText + ' <img src="/bookmark/oknotizie.gif" width="16px" height="16px" border="0" alt="Share this page on Ok Notizie (italian)"></a>';
		LinkText = LinkText + '<a href="http://www.squidoo.com/lensmaster/bookmark?'+MyAddress+'" target="_blank" >';
		LinkText = LinkText + ' <img src="/bookmark/squidoo.png" width="16px" height="16px" border="0" alt="Share this page on Squidoo"></a>';
		LinkText = LinkText + '<a href="http://www.wikio.it/vote?url='+MyAddress+'" target="_blank" >';
		LinkText = LinkText + ' <img src="/bookmark/wikio.jpg" width="16px" height="16px" border="0" alt="Share this page on Wikio"></a>';
		LinkText = LinkText + '<a href="http://twitthis.com/twit?url='+MyAddress+'" target="_blank" >';
		LinkText = LinkText + ' <img src="/bookmark/twitter.png" width="16px" height="16px" border="0" alt="Share this page on Twitter"></a>';
		LinkText = LinkText + '<a href="http://www.stumbleupon.com/submit?url='+MyAddress+'" target="_blank" >';
		LinkText = LinkText + ' <img src="/bookmark/Stumbleupon.png" width="16px" height="16px" border="0" alt="Share this page on Stumble upon"></a>';
		LinkText = LinkText + '<a href="http://yigg.de/neu?exturl='+MyAddress+'" target="_blank" >';
		LinkText = LinkText + ' <img src="/bookmark/jigg.gif" width="16px" height="16px" border="0" alt="Share this page on Jigg"></a>';
		LinkText = LinkText + '<a href="http://myweb2.search.yahoo.com/myresults/bookmarklet?t='+myTitle+'&amp;u='+MyAddress+'" target="_blank" >';
		LinkText = LinkText + ' <img src="/bookmark/yahoo.gif" width="16px" height="16px" border="0" alt="Share this page on Yahoo "></a>';
		LinkText = LinkText + '<a href="http://www.mister-wong.de/index.php?action=addurl&bm_url='+MyAddress+'&amp;bm_description='+myMetaDescr+'" target="_blank" >';
		LinkText = LinkText + ' <img src="/bookmark/mrwong.gif" width="16px" height="16px" border="0" alt="Share this page on MR.Wong (german) "></a>';
		LinkText = LinkText + '<a href="http://www.shadows.com/features/tcr.htm?url='+MyAddress+'&amp;title='+myTitle+'" target="_blank" >';
		LinkText = LinkText + ' <img src="/bookmark/shadows.gif" width="16px" height="16px" border="0" alt="Share this page on Shadows"></a>';
		LinkText = LinkText + '<a href="http://www.linkarena.com/linkadd.php?linkName='+myTitle+'&amp;linkURL=='+MyAddress+'" target="_blank" >';
		LinkText = LinkText + ' <img src="/bookmark/linkarena.gif" width="16px" height="16px" border="0" alt="Share this page on LinkArena"></a>';
		LinkText = LinkText + '<a href="http://www.spurl.net/spurl.php?title='+myTitle+'&amp;url='+MyAddress+'" target="_blank" >';
		LinkText = LinkText + ' <img src="/bookmark/spurl.gif" width="16px" height="16px" border="0" alt="Share this page on Spurl"></a>';
		LinkText = LinkText + '<a href="http://digg.com/submit?phase=2&url='+MyAddress+'" target="_blank" >';
		LinkText = LinkText + ' <img src="/bookmark/digg.gif" width="16px" height="16px" border="0" alt="Share this page on Google"></a>';
		LinkText = LinkText + '<a href="http://www.newsvine.com/_tools/seed&save?u='+MyAddress+'&amp;h='+myTitle+'" target="_blank" >';
		LinkText = LinkText + ' <img src="/bookmark/newsvine.gif" width="16px" height="16px" border="0" alt="Share this page on Google"></a>';
		LinkText = LinkText + '<a href="http://www.blinklist.com/index.php?Action=Blink/addblink.php&Url='+MyAddress+'&amp;Title='+myTitle+'" target="_blank" >';
		LinkText = LinkText + ' <img src="/bookmark/blinklist.gif" width="16px" height="16px" border="0" alt="Share this page on BlinkList"></a>';
		LinkText = LinkText + '<a href="http://ma.gnolia.com/bookmarklet/add?url='+MyAddress+'&amp;title='+myTitle+'" target="_blank" >';
		LinkText = LinkText + ' <img src="/bookmark/magnolia.gif" width="16px" height="16px" border="0" alt="Share this page on Magnolia"></a>';
		LinkText = LinkText + '<a href="http://furl.net/storeIt.jsp?t='+myTitle+'&amp;u='+MyAddress+'" target="_blank" >';
		LinkText = LinkText + ' <img src="/bookmark/furl.gif" width="16px" height="16px" border="0" alt="Share this page on Furl"></a>';
		LinkText = LinkText + '<a href="http://reddit.com/submit?url='+MyAddress+'&amp;title='+myTitle+'" target="_blank" >';
		LinkText = LinkText + ' <img src="/bookmark/reddit.gif" width="16px" height="16px" border="0" alt="Share this page on Reddit"></a>';
		LinkText = LinkText + ' <a href="javascript:void(0)" onclick="linkToUs('+"'title'"+');"><img  height="20px" border="0" alt="Link to this Page" src="/bookmark/LinkToUs.png"/> </a></center></span>';
		document.getElementById('Bookmark').innerHTML=  LinkText + LinkOptDiv;
	}
}
function getmetaContents(mn){ 
  var m = document.getElementsByTagName('meta'); 
  for(var i in m){ 
   if(m[i].name == mn){ 
     return m[i].content; 
   } 
  } 
}
//*******************************************************************
// if you activate this autorun, please make sure that the
// javaloading istruction is shortly before the closing </body> tag
// as you need it requires the <div=Bookmark" ..></div> to be loaded
//********************************************************************
linkToUs("initialize");
