
function OpenPopUp(width,height,name,scroll) {

// FUNCTION: OpenPopUp
// DESCRIPTION: opens up a new popup window with minimal browser UI-elements (ie. no menubars etc),
// optionally with scrollbars (depending in scroll-arguments). The new window is opened up with a blank page,
// the actual file for the window comes from the HREF-parameter of the link that is used to open up the popup
// as far as the TARGET-parameter of the link is the same as the name of the popup.
// ARGUMENTS:
//   width: (positive integers) the width of the popup window. defaults to 600.
//   height: (positive integers) the height of the popup window. defaults to 400.
//   name: (string) name of the popup window. this is used as TARGET in the link that is used to open up the popup. //         defaults to nokiafiPopUp
//   scroll: (string) use scrollbars in window if value is set to "scroll", "yes" or 1.
//           otherwise no scrollbars are visible
// USAGE:
//   example: <a href="popup.html" target="popupname" onClick="OpenPopUp(750,600,'popupname','no');">open pop up</a>

	var scrollbars;
	if ( (width == null) || (width <= 0) ) {
		width = 600;
	}
	if ( (height == null) || (height <= 0) ) {
		height = 400;
	}
	if (name == null) {
		name = "nokiafiPopUp";
	}
	if ( (scroll == "scroll") || (scroll == "yes") || (scroll == 1)) {
		scrollbars = "yes";
	} else {
		scrollbars = "no";
	}

	nokiafiPopUpWin=window.open("",name,"directories=no,width="+width+",height="+height+"location=no,menubar=no,personalbar=no,resizable=no,scrollbars="+scrollbars+",status=no,toolbar=no");

}


function windowOpener(url,width,height,name,scrolls,resize)
{
	browserName = navigator.appName;
	browserVer = navigator.appVersion.substring(0,1);
	if (width==null) {width=600;}
	if (height==null) {height=400;}
	if (name==null) {name="globaltPopup"}
	if (scrolls==true) {
		scrollsOption="yes";
	} else {
		scrollsOption="no";
	}
	if (resize==null) {resize=0;}
	var topPx = (browserName=="Netscape")?"screenX":"top";
	var leftPx = (browserName=="Netscape")?"screenY":"left";
	if (browserName != "Netscape" || browserVer != 2) {
	popupwin=window.open(url,name,"toolbar=no,height="+height+",width="+width+",location=no,directories=no,status=no,menubar=no,scrollbars="+scrollsOption+",resizable="+resize+"");
	}
	if (browserName != "Netscape")   // mozilla exclude - reloads page in main window while focus
		{
		popupwin.focus();
		}
}


 
 function close_or_goto(ziel)
 {
 if (window.opener)                          // Wenn es ein Fenster 1 gibt, das dieses Fenster 2 hier geoeffnet hat, dann
  {
  if (window.opener.closed)                  // Wenn das Fenster 1, das dieses Fenster 2 hier geoeffnet hat, schon geschlossen ist, dann
   {
   window.location.href = ziel;              // Rufe das Ziel, das als Parameter mitgegeben wurde, in diesem Fenster2 hier auf
   }
  else                                       // Andernfalls
   {
   window.setTimeout("window.close()",1000); // Setze fuer dieses Fenster 2 hier einen schliessen Auftrag ab (Wartezeit 1 Sek.)
   window.opener.focus();                    // und setzte den Fokus auf das Fenster 1
   }
  }
 else                                        // Anderfalls
  {
  window.location.href = ziel;               // Rufe das Ziel, das als Parameter mitgegeben wurde, in diesem Fenster 2 hier auf
  }
 }
 

function opener_goto(ziel)
 {
 if (window.opener)                          // Wenn es ein Fenster1 gibt, das dieses Fenster2 hier geöffnet hat, dann
  {
  if (window.opener.closed)                  // Wenn das Fenster1 schon zu ist
   {
   window.open(ziel,"anderesfenster","");    // Ziel in neuem Fenster öffnen
   }
  else                                       // Andernfalls
   {
   window.opener.location.href = ziel;	     // Neue URL für das Fenster1
   window.opener.focus();                    // und setzte den Fokus auf das Fenster1
   }
  }
 }

