if(top.location!=self.location) top.location=self.location;

document.observe('dom:loaded', function() {
	$$('a.BuchRandom').each(function(e) {
			//alert("test");
			var x=$('buchvorschau');
			e.observe('mouseover', function() {
				x.style.display="block";
				xx=window.document.body.clientWidth;
				//alert(xx);
				xx=parseInt(xx/2)-120;
				//alert(xx);
				x.style.left=xx+"px";
			});
			e.observe('mouseout', function() {
				x.style.display="none";
			});
	});
	$$('img.pferdemarktPreview').each(function(e) {
			var x=$('pferdemarktContainer');
			var tmp=$('tmp1');
			var mX,mY;

			function set_Text(Req) {
				$('pferdemarktContainer').innerHTML=Req.responseText;
			}

			e.observe('mouseover', function() {
				x.innerHTML	="<div style='padding:70px;'>Lade Vorschau...</div>";
				x.style.bottom="-200px";
				slideIt();

				//x.style.left=xx+"px";
				//x.style.top=mY+"px";
				if(tmp.value!="set") {
					var myAjax = new Ajax.Request(
						  "/inc/ajax.getPferdemarktVorschau.php?ID="+e.id,
						  { method: 'get', onComplete: set_Text }
						);
				}
				x.style.display="block";
				tmp.value="set";
			});

			e.observe('mouseout', function() {
				x.style.display="none";
				tmp.value="";
				x.innerHTML	="";
			});
	});
});

function slideIt()
{
	var slidingDiv = $('pferdemarktContainer');
	var stopPosition = 17;
	//alert($('pferdemarktContainer').style.bottom);
	if (parseInt(slidingDiv.style.bottom) < stopPosition )
	{

		slidingDiv.style.bottom = parseInt(slidingDiv.style.bottom) + 20 + "px";
		setTimeout("slideIt()", 1);

	} else $('pferdemarktContainer').style.bottom="27px";
}

function slideFeedback()
{
	var slidingDiv = $('toolbarFeedback');
	var stopPosition = 0;
	if (parseInt(slidingDiv.style.bottom) < stopPosition )
	{

		slidingDiv.style.bottom = parseInt(slidingDiv.style.bottom) + 20 + "px";
		setTimeout("slideFeedback()", 1);

	} else $('toolbarFeedback').style.bottom="20px";
}



