var selfUrl = self.location.protocol + "//" + self.location.host;
var SELF_LOCATION = self.location.href;
var REFFERER  	  = document.referrer;

if ( selfUrl.indexOf('derarchivar.de') != -1 )
{
	top.TRK = (top.TRK == "")?(Math.round(Math.random() * 1000000000)):(top.TRK);
	var page = SELF_LOCATION.substr(SELF_LOCATION.indexOf(selfUrl)+selfUrl.length,SELF_LOCATION.length);
	var ref = REFFERER.substr(REFFERER.indexOf(selfUrl)+selfUrl.length,REFFERER.length);
	var ecrmPixel = new Image();
	ecrmPixel.src = selfUrl + '/images/ecrm.gif?ID=' + top.TRK + '&PAGE=' + page + '&REF=' + ref;
}

function openWindow(URL,x,y) 
{
	var newWin;
	if ( (navigator.userAgent.indexOf('MSIE') != -1) || (navigator.userAgent.indexOf('Netscape6') != -1) ) 
	{
		n=x;
		m=y;
	}
	else 
	{
		n = parseInt(x)-10;
		m = parseInt(y)-30;
	}
	
	var posx = screen.width/2 - n/2;		
	var posy = screen.height/2 - m/2;
		
	var propsZ=(document.all)?('top=' + posy + ',left=' + posx):('screenX=' + posx + ',screenY=' + posy);
		
	props = 'scrollbar=1,toolbar=0,location=0,directories=0,status=0,width=' + n + ',height=' + m + ',menubar=0,resizable=1' + propsZ;
	newWin = window.open(URL,'pernice',props);
	newWin.resizeTo(n,m);
	newWin.moveTo(posx,posy);
	newWin.focus();
} 

