<!--
var ab = true;
var paypal = unescape('<span>Spenden</span>\n<form action="https://www.paypal.com/cgi-bin/webscr" method="post">\n<input type="hidden" name="cmd" value="_s-xclick">\n<input type="hidden" name="hosted_button_id" value="4254122">\n<input type="image" src="https://www.paypal.com/de_DE/DE/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="Unterstütze fun-fox.de.">\n<img alt="" border="0" src="https://www.paypal.com/de_DE/i/scr/pixel.gif" width="1" height="1">\n</form>');

var position = -1;
var pictures_urls = new Array();
var pictures_titles = new Array();

window.onload=function()
{
	var links=document.getElementsByTagName("a");
	for(var i=0; i<links.length; i++)
	{ 
		if(links[i].getAttribute("rel") && links[i].getAttribute("rel")=="thumbnail")
		{	
			pictures_urls.push(links[i].getAttribute("href"));
			pictures_titles.push(links[i].getAttribute("title"));		
			links[i].onclick=function()
			{
				var title = this.getAttribute("title");
				if(!title)title = "";
				imagePreload(this.getAttribute("href"),title);
				return false;
			}
		}
	}
	if(ab)
		document.getElementById("ads").innerHTML = paypal;
}

document.onkeypress=function(key)
{
	key = !key ? event:key;
	code = key.keyCode ? key.keyCode:key.which;
	if(code==27)
		remove();
}

window.onresize=movePicture;

function imagePreload(url,title)
{
	var img_f = new Image();
	var img_b = new Image();
	
	if(pictures_urls.length > 1)
		var navigation = "<span onclick=\"navigate('back')\" id=\"bf_picture_nb\">back</span> | <span onclick=\"navigate('forward')\" id=\"bf_picture_nf\">forward</span>";
	else
		var navigation = "<span id=\"bf_picture_nb\"></span><span id=\"bf_picture_nf\"></span>";

	document.getElementById("show").innerHTML = "<table id=\"bf_picture\"><tr><td><img id=\"bf_picture_img\"  src=\""+url+"\" onload=\"movePicture();\" /></td></tr><tr><td><table><tr><td id=\"bf_picture_title\">" + title + "</td><td id=\"bf_navigation\">"+navigation+"</td></tr></table><a href=\"javascript:remove()\"id=\"bf_close\"  title=\"Click or press ESC to close\">x</a></td></tr></table>";
	
	document.getElementById("bf_picture").style.visibility = "hidden";

	updatePosition(url);
	
	img_f.src=pictures_urls[nextIndex('forward')];
	img_b.src=pictures_urls[nextIndex('back')];
	
	return;
}

function movePicture()
{
	var picture = document.getElementById("bf_picture");
	var x_close = document.getElementById("bf_close");
	
	var heightPicture = picture.offsetHeight;
	var heightScreen = document.documentElement.clientHeight;
	if (window.innerWidth)
		var heightWindow = window.pageYOffset;
	else
		var heightWindow = document.documentElement.scrollTop;
	
	var top = Math.round(heightWindow + (heightScreen - heightPicture)/2);
	if(top < 0) top = 0;
	
	picture.style.top = top + "px";
	
	var widthPicture = picture.offsetWidth;
	var widthScreen = document.documentElement.clientWidth;
	
	var left = Math.round((widthScreen - widthPicture)/2);
	if(left < 0) left = 0;
	
	picture.style.left = left + "px";
	
	var x_close_top = (heightWindow - top);

	if(x_close_top<0) x_close_top = 0;
	x_close.style.top = x_close_top + "px";
	
	picture.style.visibility = "visible";
	return;
}

function navigate(direction)
{
	var img = document.getElementById("bf_picture_img");
	var title = document.getElementById("bf_picture_title");
	var img_x = new Image();
	
	position = nextIndex(direction);			
	img.setAttribute("src", pictures_urls[position], 1);
	if(pictures_titles[position])
		title.innerHTML = pictures_titles[position];
	else
		title.innerHTML = "";
	img_x.src=pictures_urls[nextIndex(direction)];
	
	return;
}

function updatePosition(url) 
{
	var key = '';
	for(key in pictures_urls)
	{
		if(pictures_urls[key] == url)
		{
			position = key;
		}
	}
	return;
}

function nextIndex(direction)
{
	var l = pictures_urls.length;
	if(direction == "forward")
	{
		if(position >= l-1)
			return 0;
		else
			return Number(position)+1;
	}
	if(direction == "back")
	{
		if(position <= 0)
			return l-1;
		else
			return position-1;		
	}
	return;
}

function remove()
{
	document.getElementById("show").innerHTML = "";
	return;
}

function showSmileys(id)
{
	document.write("<span onclick=\"divResize('mittelteil');\" style=\"cursor:pointer\">&rArr; Smileys</span><br /><div id=\"mittelteil\" style=\"height:0px; border:0px; overflow: hidden;\">");
	for (var i = 1; i <= 29; i++)
		document.write("<img src=\"smilies/" + i + ".gif\" alt=\"" + i + "\" onclick=\"javascript:addSmiley(' :" + i + ": ','" + id + "')\" style=\"cursor: pointer; margin: 2px;\" />");
	document.write('</div>');
	return;
}

function divResize(id)
{
	var hoehe = document.getElementById(id).style.height;
	if (hoehe == "0px")
		document.getElementById(id).style.height="70px";
	else
		document.getElementById(id).style.height="0px";
	return;
}

function addSmiley(Smiley,id)
{
	var currentMessage = document.getElementById(id).value;
	var revisedMessage = currentMessage + Smiley;
	document.getElementById(id).value = revisedMessage;
	document.getElementById(id).focus();
	return;
}

function menue(id)
{
	if(id==0)
		document.getElementById("sub").innerHTML = "<div class=\"sub\">\n<span>Programierung</span>\n- <a href=\"bbcode_smileys.php\" title=\"BBcode und Smiley Script.\">BBcode Script</a><br />- <a href=\"bilder-fokus.php\" title=\"Bilder im gleichen Fenster anzeigen.\">Bilder Fokus</a><br />\n- <a href=\"kontaktformular.php\" title=\"Das Konaktformular für deine Seite!\">Kontaktformular</a><br /></div>";
	else if(id==1)
		document.getElementById("sub").innerHTML = "<div class=\"sub\">\n<span>Spiele</span>\n- <a href=\"street-fighter.php\" title=\"Super Nintendo - Street Fighter\">Street Fighter</a><br /></div>";
	else if(id==2)
		document.getElementById("sub").innerHTML = "<div class=\"sub\"><span>&nbsp;Fotografie&nbsp;</span>- <a href=\"fotografie.php\" title=\"Fotografie\">Fotografie</a><br />- <a href=\"fotokunst.php\" title=\"Fotokunst\">Fotokunst</a><br /></div>";
	return;
}
//-->
