var isoversb = false;
function bibsonomy() {
	var url=encodeURIComponent(document.location.href);
	var title=encodeURIComponent(document.title);
	window.open("http://www.bibsonomy.org/ShowBookmarkEntry?c=b&jump=yes&url="+url+"&description="+title);
	return false;
}
function citeulike() {
	var url=encodeURIComponent(document.location.href);
	var title=encodeURIComponent(document.title);
	window.open("http://www.citeulike.org/posturl?url="+url+"&title="+title);
	return false;
}
function showsocialbookmarkpopup() {
	var obj = document.getElementById('socialbookmarkpopup');
	if (obj.style.display != 'block') {
		obj.style.display='block';
		requestMoreSocialBookmarks();
	}
	isoversb = true;
}
function hidesocialbookmarkpopup() {
	isoversb = false;
	setTimeout("hidesocialbookmarkpopuptimeout()", 1000);
}
function hidesocialbookmarkpopuptimeout() {
	if (! isoversb)
		document.getElementById('socialbookmarkpopup').style.display='none';
}

var http_request_sb = false;
function requestMoreSocialBookmarks() {
	http_request_sb = false;

	if (window.XMLHttpRequest) { // Mozilla, Safari,...
		http_request_sb = new XMLHttpRequest();
	} else if (window.ActiveXObject) { // IE
		try {
			http_request_sb = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				http_request_sb = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
		}
	}
 
	if (!http_request_sb) {
		alert('Stop :( Could not create instance of XMLHTTP');
		return false;
	}
	http_request_sb.open('GET', '/assets_local/includes/social_bookmarks_more.php', true);
	http_request_sb.onreadystatechange = setMoreSocialBookmarks;
	http_request_sb.send(null);
}
 
function setMoreSocialBookmarks() {
	if (http_request_sb.readyState == 4) {
		var answer = http_request_sb.responseText;
		if(document.getElementById("socialbookmarkpopup").innerHTML != answer){
			document.getElementById("socialbookmarkpopup").innerHTML = answer;
		} else {
			document.getElementById("socialbookmarkpopup").innerHTML = "";
		}
	}
 
}




//socialbookmark.eu

sbeuel=document.getElementsByTagName('a');
sblfound=false;
for(var i=0;i<sbeuel.length;i++){
	if(sbeuel[i].href.indexOf('socialbookmark.eu')>0){
		sblfound=true;
	}
}
if(!sblfound){
	//document.write('<a href="http://www.socialbookmark.eu">Social Bookmarking Buttons gibt es kostenlos bei socialbookmark.eu</a>');
}
function doBookmark(c){
	var cDiv=document.getElementById("socialbookmarkeu");
	var cD1=(cDiv.innerText)?cDiv.innerText:cDiv.textContent;
	var cD2=cDiv.innerHTML;
	if(cD1.length>5&&cD2.length<1000&&cD2.match(/socialbookmark/gi)){
		window.open(eval(unescape(c)));
	}
}

function sbeuInitTt(a,b){
	var c=document.getElementById('sbeuTt');
	var d=document.getElementById('sbeuTtInner');
	c.style.display='';
	c.style.width='auto';
	d.innerHTML=a;
	document.onmousemove=sbeuFM;
}
function sbeuHdTt(){
	var a=document.getElementById('sbeuTt');
	document.onmousemove='';
	a.style.display='none';
}
function sbeuFM(e){
	var a=20;var b=20;var c=0;
	var d=0;
	var f=document.getElementById('sbeuTt');
	if(!e){
		var e=window.event;
	}
	if(e.pageX||e.pageY){
		c=e.pageX;
		d=e.pageY;
	}else if(e.clientX||e.clientY){
		c=e.clientX+document.documentElement.scrollLeft;
		d=e.clientY+document.documentElement.scrollTop;
	}
	if(window.innerWidth||window.innerHeight){
		docwidth=window.innerWidth;docheight=window.innerHeight;
	}else if(document.documentElement.clientHeight||document.documentElement.clientWidth){
		docwidth=document.documentElement.clientWidth;
		docheight=document.documentElement.clientHeight;
	}else if(document.body.clientWidth||document.body.clientHeight){
		docwidth=document.body.clientWidth;docheight=document.body.clientHeight;
	}
	if((docheight-(d+b+f.offsetHeight))<0){
		b*=-1;
		b-=(f.offsetHeight+b);
	}
	if((docwidth-(c+a+f.offsetWidth))<0){
		a*=-1;
		a-=(f.offsetWidth+a);
	}
	f.style.left=c+a+'px';
	f.style.top=d+b+'px';
}