/*open Window */
/************************************************************************************************************************************************/
/*HTML Sample Code */

var LastWindowOpened = "";

function LocationPath(){
	var myLoc = location.href;
	myPath = myLoc.substring(0,myLoc.lastIndexOf(myRoot))+myRoot;
	return myPath;
	}
	
var thisY=0;
var thisX=0;

function makePopUp(thiswidth,thisheight,thisDocument,thisWindowName,thisXPosition,thisYPosition,thisScrollbar,thisPath) {
	if (bw.ie) {
	  thisX = window.screenLeft + thisXPosition;
	  thisY = window.screenTop + thisYPosition;
	  if(bw.mac){
	  	thisX = thisXPosition + 30;
	  	thisY = thisYPosition + 113;
	  	if(thisScrollbar==1){
		  	thiswidth = thiswidth -12;
		  	thisheight = thisheight -15;
	  	}
		thisDocument = thisPath + thisDocument;
	  }
	}
	/*X,Y Positionen fuer NS 4 */
	if (bw.ns4) {
		thisX = window.screenX + thisXPosition;
		thisY = window.screenY + thisYPosition + 130;
		if(bw.mac){
			thisY = window.screenY + thisYPosition + 115;

		}
	}
	/*X,Y Positionen fuer NS 6 */
	else if (bw.ns5) {
	  thisX = window.screenX +  thisXPosition + 10;
	  thisY = window.screenY + thisYPosition + 114;
	  if(bw.mac)
			thisY = window.screenY + thisYPosition + 90;
	}
	
	   OpenThisWindow = true;
   if (eval("self." + thisWindowName)){
      // If this window object exists check to see if it's closed.
      // If it isn't close it.
      if (!(eval("self." + thisWindowName + ".closed"))){
         eval ("self." + thisWindowName + ".close()");
         OpenThisWindow = true;
      }
   }

   if (OpenThisWindow){
      if(LastWindowOpened != thisWindowName){closePopup()}
      if (navigator.userAgent.indexOf("Mac") >= 0) {
				eval (thisWindowName + " = window.open(thisDocument,\"" + thisWindowName + "\",\"" + "toolbar=0,location=0,directories=0,status=0,scrollbars=" + thisScrollbar + ",resizable=0,copyhistory=1,width=" + thiswidth + ",height=" + thisheight + ",top=" + thisY + ",left=" + thisX + ",screeny=" + thisY + ",screenx=" + thisX + "\")");
				eval (thisWindowName + " = window.open(thisDocument,\"" + thisWindowName + "\",\"" + "toolbar=0,location=0,directories=0,status=0,scrollbars=" + thisScrollbar + ",resizable=0,copyhistory=1,width=" + thiswidth + ",height=" + thisheight + ",top=" + thisY + ",left=" + thisX + ",screeny=" + thisY + ",screenx=" + thisX + "\")");
      }else{
         eval (thisWindowName + " = window.open(thisDocument,\"" + thisWindowName + "\",\"" + "toolbar=0,location=0,directories=0,status=0,scrollbars=" + thisScrollbar + ",resizable=0,copyhistory=1,width=" + thiswidth + ",height=" + thisheight + ",top=" + thisY + ",left=" + thisX + ",screeny=" + thisY + ",screenx=" + thisX + "\")");
      }
        eval ("self." + thisWindowName + ".focus()");
      LastWindowOpened = thisWindowName;
   }  
}

function closePopup(){
   if (LastWindowOpened != ""){
      if (eval("self." + LastWindowOpened)){
         if (!(eval("self." + LastWindowOpened + ".closed"))){
            eval ("self." + LastWindowOpened + ".close()");
         }
      }
   }
}