/*********************************************************************************************/
/* Globale Variablen
/*********************************************************************************************/
var globalDHtmlPopup23 = null;
Version = new Object();

/*********************************************************************************************/
/* Browserversion ermitteln */
/*********************************************************************************************/
a  = navigator.userAgent;
ie = a.indexOf("MSIE");
/* Netscape Version ermitteln */
Version.Netscape   = a.indexOf("Gecko") + 1 ? parseFloat(a.substring(a.lastIndexOf("/") + 1))
                   : a.indexOf("Mozilla") + 1 && !(ie + 1) ? parseFloat(a.substring(a.indexOf("/") + 1, a.indexOf(" "))) 
				   : 0;
/* Internet-Explorer Version ermitteln */					  
Version.MSIE       = ie + 1 ? parseFloat(a.substring(ie + 5, a.indexOf(";", ie + 5))) : 0;
/* Javascript-Version ermitteln */
Version.JavaScript = window.clearInterval ? 1.2 : window.blur ? 1.1 : 1.0;

/* Unbenutzte Objekte wieder freigeben */
delete a;
delete ie;

/*********************************************************************************************/
/* Version.IE
/*********************************************************************************************/
Version.IE = function(V) { 
	return((V <= this.MSIE) || (!V && this.MSIE) ? true : false); 
}
/*********************************************************************************************/
/* Version.IE
/*********************************************************************************************/
Version.JS = function(V) { 
	return( V <= this.JavaScript ? true : false); 
}
/*********************************************************************************************/
/* Version.IE
/*********************************************************************************************/
Version.NS = function(V) { 
	return((V <= this.Netscape) || (!V && this.Netscape) ? true : false); 
}



var URLoader_Works = (Version.NS(6) || Version.IE(5));

/*********************************************************************************************/
//* Object:      URLoader
//*
//* Properties:  Frame   - IFRAME Element
//*              OnLoad  - OnLoad Callback Function
//*              Timeout - setTimeout() ID
//*
//* Methods:     Get     - Load URL
//*              Clear   - Clear IFRAME
/*********************************************************************************************/
var URLoader = new Object();

/*********************************************************************************************/
//* Method:      URLoader.Get
//*
//* Parameters:  URL         - URL to Retrieve
//*              OnLoad      - OnLoad Callback Function
//*
//* Description: Builds a hidden IFRAME, if necessary, and loads 'URL' into it.
//*              When the URL is fully loaded, 'OnLoad' is called with the
//*              IFRAME.document.documentElement property.
/*********************************************************************************************/
URLoader.Get = function(URL,OnLoad) {
	
	if (!URLoader_Works) {
    	//alert('URLoader does not work in this browser.');
    	return false;
    }
	

  //*---------------------------------------------------------*
  //* Create the invisible IFRAME at the end of the document. *
  //*---------------------------------------------------------*
	if (!this.fr) {
   		f                  = document.createElement('IFRAME'); 
    	f.style.visibility = 'hidden';    
    	document.body.appendChild(f);
    	this.fr  =  window.frames[window.length-1];
    }
	

  //*--------------------------------------------------------------*
  //* Save the OnLoad method, set the Timeout to check for load    *
  //* in MSIE, specify the onload method for NS, and load the URL. *
  //*--------------------------------------------------------------*
  this.OnLoad         = OnLoad;  
  this.Timeout        = setTimeout("URLoader_Timeout()",100);
  this.fr.onload      = URLoader_OnLoad;
  this.fr.location   =  URL;
  return true;
}

//*****************************************************************************
//* Handler:     URLoader_OnLoad
//*
//* Parameters:  none
//*
//* Description: Handles the onload event for the IFRAME window.  The Timeout
//*              is cleared and the OnLoad Callback is called with the 
//*              IFRAME.document.documentElement property.
//*
//*              This works in Netscape but not IE.  In IE, this handler is 
//*              called by the Timeout handler.
//*
//*              In NN, the IFRAME document is cleared otherwise the onload
//*              event will not be triggered if the same document is loaded
//*              again.
//*****************************************************************************
function URLoader_OnLoad() {
  clearTimeout(URLoader.Timeout);
  DocElem = URLoader.fr.document.documentElement;

  if (Version.NS()) {
    //URLoader.Frame.location = 'about:blank';
  }
  URLoader.OnLoad(DocElem);
}

//*****************************************************************************
//* Handler:     URLoader_Timeout
//*
//* Parameters:  none
//*
//* Description: Handles the Timeout event for the URLoader object. This gives
//*              NN the opportunity to load the URL and trigger the onload 
//*              event.  For IE, the document.readyState property is checked 
//*              for "complete" and the onload event handler is called.
//*****************************************************************************
function URLoader_Timeout() {
  if (Version.IE() && URLoader.fr.document.readyState == "complete")
    URLoader_OnLoad();
  else
    URLoader.Timeout = setTimeout("URLoader_Timeout()",100);
}


/*********************************************************************************************/
/* DHtmlPopup
/*********************************************************************************************/
function DHtmlPopup() {

	globalDHtmlPopup23 = this;
				
	this.dragging 	= false;
	this.dragOffsetX 	= 0;
	this.dragOffsetY 	= 0;
	this.dragTimeout 	= null;
	this.onCloseHandler = null;
	
	document.onmousemove = function(evt) {
		globalDHtmlPopup23.drag(evt);
	}
	document.onclick = function(evt) {
		globalDHtmlPopup23.endDrag(evt);
	}
	
	/*
	progid:DXImageTransform.Microsoft.Shadow(color=#666666, direction=135);
	*/
	var html =  '<table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%">'
			  + '<tr><td id="dhtmlPopupTitleTd23" style="padding-top:4px">&nbsp;</td>'
			  + '</tr><tr><td colspan="2" valign="top" id="dhtmlPopupContentTd23" height="100%"></td></tr></table>';
	
	/****************************************************************************************/
	/*
	/****************************************************************************************/
	this.startDrag = function(evt) {
	
		var scrollPos = this.getScrollPos();
		var popupDiv = document.getElementById("dhtmlPopupDiv23");
		var posLeft = popupDiv.style.left;
		var posTop = popupDiv.style.top;
		
		posLeft = (typeof(posLeft)=='string'?parseInt(posLeft):posLeft);
		posTop = (typeof(posTop)=='string'?parseInt(posTop):posTop);
			
		if (Version.IE(5)) {	
			this.dragOffsetX = window.event.x - posLeft + scrollPos[0];;
			this.dragOffsetY = window.event.y - posTop + scrollPos[1];
		} else if (Version.NS(6)) {
			this.dragOffsetX = evt.pageX - posLeft;
			this.dragOffsetY = evt.pageY - posTop;
		}
		
		this.dragging = true;
		
		return false;
	}
	
	/****************************************************************************************/
	/* 
	/****************************************************************************************/
	this.setOnCloseHandler = function(onCloseHandler) {
		this.onCloseHandler = onCloseHandler;
	}
	
	/****************************************************************************************/
	/*
	/****************************************************************************************/
	this.endDrag = function(e) {
		this.dragging = false;
		//this.hide();
	}
	
	/****************************************************************************************/
	/*
	/****************************************************************************************/
	this.drag = function(e) {
		if (this.dragging == true) {
		    var scrollPos = this.getScrollPos();
			var popupDiv = document.getElementById("dhtmlPopupDiv23");
			var posLeft = 0;
			var posTop = 0;
			
			if (Version.IE(5)) {
				posLeft = window.event.x - this.dragOffsetX + scrollPos[0];
	    		posTop  = window.event.y - this.dragOffsetY + scrollPos[1];
			} else if (Version.NS(6)) {
				posLeft = e.pageX - this.dragOffsetX;
		    	posTop  = e.pageY - this.dragOffsetY;
			}

			popupDiv.style.top  = posTop;
			popupDiv.style.left = posLeft;
		}
	}
	/**************************************************************************************************/
	/* createHtml
	/*
	/* Verwendung:
	/* Die Methode erzeugt den Html-Code, der für das Anzeigen des HTML-PopUps notwendig ist.
	/* 
	/**************************************************************************************************/
	this.createHtml = function() {
		/* Es wird ein neues "Div", in welchem der IFrame mit dem entsprechenden 
			 Inhalt angezeigt werden soll, in den HTML-Elementenbaum eingefügt. */

		/* Div erzeugen  */
		var popUpDiv   = document.createElement('div');
		/* Attribute für Div erzeugen */
		/* Id-Attribut */
		var popUpDivId = document.createAttribute("id");
	  	popUpDivId.nodeValue = "dhtmlPopupDiv23";
	  	popUpDiv.setAttributeNode(popUpDivId);
		/* Style-Attribut */
		/*
		var popUpDivStyle = document.createAttribute("style");
		popUpDivStyle.nodeValue = "position:absolute; left:45px; top:23px; width:400px; "
			  										+ "height: 250px;"
		popUpDiv.setAttributeNode(popUpDivStyle);*/
		popUpDiv.style.position   = "absolute";
		popUpDiv.style.filter     = "progid:DXImageTransform.Microsoft.Fade(duration=0.7) "
			+ "progid:DXImageTransform.Microsoft.Shadow(color=#666666, direction=135, strength=4) ";													
		popUpDiv.style.width  	  = 300;
		popUpDiv.style.height 	  = 300;
		popUpDiv.style.visibility = "hidden";
		popUpDiv.style.left		  = "45px"; 
		popUpDiv.style.top		  = "23px";
		popUpDiv.style.border     = "1px solid #666666";

	
		/* Div unterhalb von BODY plazieren */
		var bodyElement = document.getElementsByTagName('body');
	 	document.body.appendChild(popUpDiv);
			
		/* Div mit Inhalt füllen */
		var div = document.getElementById('dhtmlPopupDiv23');
		div.innerHTML = html;	
		
		var td = document.getElementById("dhtmlPopupTitleTd23");
		td.onmousemove = function(evt) {globalDHtmlPopup23.drag(evt)};
		td.onmouseup   = function(evt) {globalDHtmlPopup23.endDrag(evt)};
		td.onmousedown = function(evt) {globalDHtmlPopup23.startDrag(evt)};
		td.onmouseexit = function(evt) {globalDHtmlPopup23.drag(evt)};
		td.onmouseleave = function(evt) {globalDHtmlPopup23.drag(evt)};
	}
	/**************************************************************************************************/
	/* */
	/**************************************************************************************************/
	this.loadDocument = function(url) {
		URLoader.Get(url, 
	   
	   function(documentNode) {
		 	globalDHtmlPopup23.documentReady(documentNode)
	   }
	  
	  );
	}
	
	/**************************************************************************************************/
	/* */
	/**************************************************************************************************/
	this.documentReady = function(documentNode) {
		var dhtmlPopupContentTd23 = document.getElementById('dhtmlPopupContentTd23');
	  	var bodyElem = documentNode.getElementsByTagName("body")[0];
		dhtmlPopupContentTd23.innerHTML = bodyElem.innerHTML;
	}
	
	/**************************************************************************************************/
	/* */
	/**************************************************************************************************/
	this.getScrollPos = function() {
  		var scrOfX = 0, scrOfY = 0;
 		if( typeof( window.pageYOffset ) == 'number' ) {
    		//Netscape compliant
    		scrOfY = window.pageYOffset;
    		scrOfX = window.pageXOffset;
  		} else {
    		if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
      			//DOM compliant
      			scrOfY = document.body.scrollTop;
      			scrOfX = document.body.scrollLeft;
    		} else {
      			if( document.documentElement &&
          			( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
	      			//IE6 standards compliant mode
    	    		scrOfY = document.documentElement.scrollTop;
        			scrOfX = document.documentElement.scrollLeft;
      		  }
    	   }
		}
		result = new Array();
		result[0] = scrOfX;
		result[1] = scrOfY;
  		return result;
  	}
	
	/**************************************************************************************************/
	/* */
	/**************************************************************************************************/
	this.getClientSize = function() {
	
  		var width = 0, height = 0;
  		if( typeof( window.innerWidth ) == 'number' ) {
    		//Non-IE
    		width = window.innerWidth;
    		height = window.innerHeight;
  		} else {
    		if( document.documentElement &&
        		( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
      			//IE 6+ in 'standards compliant mode'
      			width = document.documentElement.clientWidth;
      			height = document.documentElement.clientHeight;
    		} else {
      			if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
        			//IE 4 compatible
        			width = document.body.clientWidth;
        			height = document.body.clientHeight;
      			}
    		}
  		}
		result = new Array();
		result[0] = width;
		result[1] = height;
  		return result;
	}
	/**************************************************************************************************/
	/* setSize
	/**************************************************************************************************/
	this.setSize = function (privWidth, privHeight) {
		if (privWidth != null) {
			document.getElementById("dhtmlPopupDiv23").style.width = privWidth;
		}
	  if (privHeight != null) {
			document.getElementById("dhtmlPopupDiv23").style.height = privHeight;
	  }
	}
	/**************************************************************************************************/
	/* setPosition
	/**************************************************************************************************/
	this.setPosition = function(x, y) {
		var popupDiv = document.getElementById("dhtmlPopupDiv23");
		var posLeft = 0;
		var posTop = 0;		
		if (x == null && y == null) {
			var clientSize = this.getClientSize();
			var scrollPos = this.getScrollPos();
			
			posLeft = popupDiv.style.width;
			posTop =  popupDiv.style.height;
			
			posLeft = (typeof(posLeft)=='string'?parseInt(posLeft):posLeft);
			posTop = (typeof(posTop)=='string'?parseInt(posTop):posTop);
		
			posLeft = (clientSize[0] - posLeft) / 2 + scrollPos[0];
			posTop = (clientSize[1] - posTop) / 2 + scrollPos[1];
			
		} else {
			posLeft = x;
			posTop = y;
		}
		popupDiv.style.left = posLeft;
		popupDiv.style.top = posTop;
	} // function setPosition
	/**************************************************************************************************/
	/* show
	/**************************************************************************************************/
	this.show = function() {
		var dhtmlPopupContentTd23 = document.getElementById('dhtmlPopupContentTd23');
	  	dhtmlPopupContentTd23.innerHTML = "";
		
		var popupDiv = document.getElementById("dhtmlPopupDiv23");
		
		if (Version.IE(5.5) && popupDiv.filters) {
			popupDiv.filters[0].Apply();
			popupDiv.style.visibility = "visible";
			popupDiv.filters[0].Play();
		} else {
			popupDiv.style.visibility = "visible";
		}
		
	}
	/**************************************************************************************************/
	/* hide
	/**************************************************************************************************/
	this.hide = function() {
		if (this.onCloseHandler != null) {
			this.onCloseHandler();
		}
		
		var popupDiv = document.getElementById("dhtmlPopupDiv23");
		if (Version.IE(5.5) && popupDiv.filters) {
			popupDiv.filters[0].Apply();
			popupDiv.style.visibility = "hidden";
			popupDiv.filters[0].Play();
		} else {
			popupDiv.style.visibility = "hidden";
		}
	}
	/**************************************************************************************************/
	/* titleHTML */
	/**************************************************************************************************/
	this.setTitle = function(titleHTML) {
		var titleTd = document.getElementById("dhtmlPopupTitleTd23");
		titleTd.innerHTML = titleHTML;
	}
	
	/**************************************************************************************************/
	/* setBackgroundImage
	/**************************************************************************************************/
	this.setBackgroundImage = function(imageUrl) {
		var popupDiv = document.getElementById("dhtmlPopupDiv23");
		popupDiv.style.backgroundImage = "url(" + imageUrl + ")";
		popupDiv.style.backgroundPosition = "center";
		popupDiv.style.backgroundRepeat = "no-repeat";
	}
	
	/**************************************************************************************************/
	/* setBackgroundColor
	/**************************************************************************************************/
	this.setBackgroundColor = function(color) {
		var popupDiv = document.getElementById("dhtmlPopupDiv23");
		popupDiv.style.backgroundColor = color;
	}
	/**************************************************************************************************/
	/* setTitleBackgroundColor
	/**************************************************************************************************/
	this.setTitleBackgroundColor = function(color) {
		var titleTd = document.getElementById("dhtmlPopupTitleTd23");
		titleTd.style.backgroundColor = color;
	}
	
	this.setBorder = function(border) {
		var popUpDiv = document.getElementById("dhtmlPopupDiv23");
		popUpDiv.style.border = border;
	}
}	// Klassenende

function popup(url, width, height) {
		window.open(url, "popup", "width=" + width + ",height=" + height);
}
