//<script language=javascript>
// Centered top Popup Windows
// Aufruf mit: <a href="popupurl.html" onClick="ShowPopupWindow(this.href,'toolbar=yes,location=no,status=no,menubar=yes,scrollbars=yes,resizable=yes','600','400') ;return false; " target="name">Link</a>
//       oder: <a href="popupurl.html" onClick="ShowPopupWindow(this.href) ;return false; " target="name">Link</a>

var tB_Window = null;
// hoeherstellen (Toolbar 28 und Browsertopleiste ca. 24 ) - abhaengig von Features...
var popWinHigher = 28 + 24;

function ShowPopupWindow(popWinURL,popWinWidth,popWinHeight,popWinFeatures,cWinName)
{
   var popWinx, popWiny, popWinAttributes
   //alert(popWinURL+"/"+popWinWidth+"/"+popWinHeight+"/"+popWinFeatures);
   if ( ! popWinFeatures )
      popWinFeatures = 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no,dependent=yes';

   if ( popWinWidth && window.screen.width > popWinWidth ) 
      {
      popWinx = ((window.screen.width-popWinWidth) / 2);
      popWinAttributes += ',width='+popWinWidth+',left='+popWinx
      //popWinAttributes += ',innerWidth=='+popWinWidth+',left='+popWinx
      }
   if ( popWinHeight && (window.screen.height-popWinHigher) > popWinHeight )
      {
      popWiny = ((window.screen.height-popWinHigher-popWinHeight) / 2);
      popWinAttributes += ',height='+popWinHeight+',top='+popWiny
      //popWinAttributes += ',innerHeight='+popWinHeight+',top='+popWiny
      }
   popWinAttributes += ( popWinFeatures ? ','+popWinFeatures : '' );

	 if ( ! cWinName ) cWinName = '_blank';
   tB_Window = window.open(popWinURL,cWinName,popWinAttributes);
   if (tB_Window.opener == null) // for Nav 2.0x 
  	   tB_Window.opener = self // this creates and sets a new property 
   
   //tB_Window.window.focus();
   return tB_Window;
}

function ShowPopupWindowWithImage(popWinURL,popWinFeatures,popWinWidth,popWinHeight,popImage)
{
   var popWinx, popWiny, popWinAttributes
   
   if ( ! popWinFeatures )
      popWinFeatures = 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no,dependent=yes';

   if ( popWinWidth && window.screen.width > popWinWidth ) 
      {
      popWinx = ((window.screen.width-popWinWidth) / 2);
      popWinAttributes += ',width='+popWinWidth+',left='+popWinx
      }
   if ( popWinHeight && (window.screen.height-popWinHigher) > popWinHeight )
      {
      popWiny = ((window.screen.height-popWinHigher-popWinHeight) / 2);
      popWinAttributes += ',height='+popWinHeight+',top='+popWiny
      }
   popWinAttributes += ( popWinFeatures ? ','+popWinFeatures : '' );

   tB_Window = window.open(popWinURL + '?i=' + popImage,'',popWinAttributes);   
   tB_Window.window.focus();
}

function ShowStatusMsg(msgStr)
{ 
  status=msgStr;
  return true;
}

function ReloadCenter(nWidth,nHeight)
{ 
/*   var bversion;

   bversion = parseInt(navigator.appVersion);

   if ((navigator.appName == "Netscape") && (bversion >= 4))
   {
      if (window.menubar.visible)
      {
         netscape.security.PrivilegeManager.enablePrivilege('UniversalBrowserWrite');
         window.menubar.visible = false;
         window.toolbar.visible = false;
         window.locationbar.visible = false;
         window.statusbar.visible = false;
         //window.personalbar.visible=false;
         alert(navigator.appName+"/"+bversion);
         //netscape.security.PrivilegeManager.disablePrivilege("UniversalBrowserWrite"); 
      }
      //self.resizeTo(nWidth,nHeight+popWinHigher);
      //self.moveTo((screen.availWidth-nWidth)/2,(screen.availHeight-nHeight)/2);
   }
   else*/
   {
      if ( self.location.search.indexOf("reload") < 0 )
      {
         ShowPopupWindow(self.location+"&reload=0",nWidth,nHeight,
            'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no');
         close();
      }
   }
}


function PrintContent(cSpr)
{
   var Okay,bversion,cTxt;

   bversion = parseInt(navigator.appVersion);

   if ((navigator.appName == "Netscape") && (bversion >= 4))
      Okay="1";
   else if ((navigator.appName == "Microsoft Internet Explorer") && (navigator.userAgent.substring(30,33) >= 5))
      Okay="1";
   else
      Okay="0";
                      
   if (Okay == "1")
      self.print();
   else
   {
      if ( cSpr == 'EN' )
         cTxt = "This browser doesn't support this function";
      else if ( cSpr == 'IT' )
         cTxt = "Questo Browser non supporta la funzione richiesta!";
      else if ( cSpr == 'FL' )
         cTxt = "Deze browser ondersteunt deze functie niet!";
      else
         cTxt = "Dieser Browser unterstützt diese Funktion nicht!";
      alert(cTxt);
   }
}

function CheckBrowserVersion(nMSIE,nNS)
{
	var cVersion, nVersPos, nVersion, lRet = false;
	if ( window.navigator.appName.search(/Netscape/i) >= 0 )
	{
		cVersion=window.navigator.userAgent;
		nVersPos = cVersion.search(/Netscape/i);
		if ( nVersPos >= 0 )
		{
			cVersion = cVersion.substr(nVersPos);
			nVersPos = cVersion.indexOf('/');
			nVersPos += 1;
		}
		else
		{
			cVersion=window.navigator.appVersion;
			nVersPos = 0;
		}
		nVersion = parseFloat(cVersion.substr(nVersPos,3));
		lRet = (nVersion >= nNS);
		//alert(nVersion);
	}
	else if ( window.navigator.appName.search(/Explorer/i) >= 0 )
	{
		cVersion=window.navigator.userAgent;
		nVersPos = cVersion.search(/MSIE/i);
		if ( nVersPos >= 0 )
			nVersPos += 4 + 1;
		nVersion = parseFloat(cVersion.substr(nVersPos,3));
		lRet = (nVersion >= nMSIE);
		//alert(nVersion);
	}
	//else
		//document.write('appVersion='+window.navigator.appVersion+'<br>\nuserAgent='+window.navigator.userAgent+'<br>\nappName='+window.navigator.appName+'<br>\nappCodeName='+window.navigator.appCodeName);
	
	//document.write('appVersion='+window.navigator.appVersion+'<br>\nuserAgent='+window.navigator.userAgent+'<br>\nappName='+window.navigator.appName+'<br>\nappCodeName='+window.navigator.appCodeName);
	// Netscape 6
	//appVersion=5.0 (Windows; de-DE)
	//userAgent=Mozilla/5.0 (Windows; U; Windows NT 5.0; de-DE; rv:0.9.4.1) Gecko/20020508 Netscape6/6.2.3
	//appName=Netscape
	//appCodeName=Mozilla
	// Netscape 4
	//appVersion=4.78 [de] (Windows NT 5.0; U)
	//userAgent=Mozilla/4.78 [de] (Windows NT 5.0; U)
	//appName=Netscape
	//appCodeName=Mozilla 
	// Netscape 7
	//appVersion=5.0 (Windows; de-DE)
	//userAgent=Mozilla/5.0 (Windows; U; Windows NT 5.1; de-DE; rv:1.0.1) Gecko/20020823 Netscape/7.0 (BDP) 
	//appName=Netscape 
	//appCodeName=Mozilla
	// Internetexplorer 6
	//appVersion=4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.0.3705)
	//userAgent=Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.0.3705)
	//appName=Microsoft Internet Explorer
	//appCodeName=Mozilla 
	// Internetexplorer 5.1 Mac
	//appVersion=4.0 (compatible; MSIE 5.0; Macintosh; I; PPC)
	//userAgent=Mozilla/4.0 (compatible; MSIE 5.15; Mac_PowerPC)
	//appName=Microsoft Internet Explorer
	//appCodeName=Mozilla 
	return lRet;
}

var oScrollFrame;
function ScrollFrameStart(cFrameName,iTime,iStep)
{
	oScrollFrame = top.frames[cFrameName];
	if ( oScrollFrame )
	{
		oScrollFrame.scroll(0,GetScrollTop());
		if ( ! iTime ) iTime = 100;
		if ( ! iStep ) iStep = 1;
		setTimeout('ScrollFrame('+iTime+','+iStep+');',iTime);
	}
}
function ScrollFrame(iTime,iStep)
{

	var offT = GetScrollTop();
	offT += iStep;
	oScrollFrame.scroll(0,offT);
	//if ( GetScrollTop() > 0 )
	
	{
		if ( offT != GetScrollTop() )
			oScrollFrame.scroll(0,0);
		setTimeout('ScrollFrame('+iTime+','+iStep+');',iTime);
	}
}
function GetScrollTop()
{
	var offT = 0;
	if ( oScrollFrame.window && ''+oScrollFrame.window.pageYOffset != 'undefined' )
	{
		if ( oScrollFrame.window.pageYOffset )
			offT = oScrollFrame.window.pageYOffset;
	}
	else if ( oScrollFrame.document.body && ''+oScrollFrame.document.body.scrollTop != 'undefined' )
	{
		if ( oScrollFrame.document.body.scrollTop )
			offT = oScrollFrame.document.body.scrollTop;
	}
	else if ( oScrollFrame.frameElement && ''+oScrollFrame.frameElement.scrollTop != 'undefined' )
	{
		if ( oScrollFrame.frameElement.scrollTop )
			offT = oScrollFrame.frameElement.scrollTop;
	}
	return offT;
}

//</script>
