// JavaScript Document

function NewPopup(mypage,myname,w,h,features)
{
	var win = null;

  var winl = (screen.width-w)/2;
  var wint = (screen.height-h)/2;
  if (winl < 0) winl = 0;
  if (wint < 0) wint = 0;
  var settings = 'height=' + h + ',';
  settings += 'width=' + w + ',';
  settings += 'top=' + wint + ',';
  settings += 'left=' + winl + ',';
  settings += features;
  win = window.open(mypage,myname,settings);
  win.window.focus();
}

absLeft=function(Element)
{
	return (Element.offsetParent) ? Element.offsetLeft+absLeft(Element.offsetParent) : Element.offsetLeft;
};

absTop=function(Element)
{
	return (Element.offsetParent) ? Element.offsetTop+absTop(Element.offsetParent) : Element.offsetTop;
};

var InlinePopupTimer;


DisplayInlinePopup=function()
{	
	Container=document.getElementById('inline_popup');
	Container.style.display="block";
};


ShowInlinePopup=function(Obj,ImageID,Quality)
{
	Container=document.getElementById('inline_popup');
	
	Container.style.display="none";
	
	if (typeof  Quality=='undefined')
	{
		Container.innerHTML='<img src="http://images.redauktion.de/auctions/low/large/large_'+ImageID+'" height="250" alt="Laden...">';
	}
	else
	{
		Container.innerHTML='<img src="http://images.redauktion.de/auctions/quality/large/large_'+ImageID+'" height="250" alt="Laden...">';
	}
	
	if (window.innerHeight && window.scrollMaxY)
	{
		ClientWidth = window.innerWidth + window.scrollMaxX;
		ClientHeight = window.innerHeight + window.scrollMaxY;
	}
	else if (document.body.scrollHeight > document.body.offsetHeight)
	{
		ClientWidth = document.body.scrollWidth;
		ClientHeight = document.body.scrollHeight;
	}
	else
	{
		ClientWidth = document.body.offsetWidth + document.body.offsetLeft; 
		ClientHeight = document.body.offsetHeight + document.body.offsetTop;
	}
	
	
	
	var ImageWidth=Container.offsetWidth;
	var ImageHeight=Container.offsetHeight;
	
	if (((absLeft(Obj)+Obj.offsetWidth+10)+ImageWidth+10)>ClientWidth) {var LeftPos=(absLeft(Obj)-ImageWidth-15);}
	else {var LeftPos=(absLeft(Obj)+Obj.offsetWidth+15);}
	
	if ((absTop(Obj)+ImageHeight+10)>ClientHeight) {var TopPos=ClientHeight-ImageHeight-15;}
	else {var TopPos=absTop(Obj);}
	
	Container.style.left=LeftPos+"px";
	Container.style.top=TopPos+"px";
	
	InlinePopupTimer=window.setTimeout("DisplayInlinePopup()",1000);
};

HideInlinePopup=function()
{
	window.clearTimeout(InlinePopupTimer);
	document.getElementById('inline_popup').style.display="none";
};
