/*
 * Allgemeine Funktionen
 *
 * Lars Vogel
 * 11-05-2005
 *
 */
 

function go2(link) {
    if (link != "") {
         window.location.href = link;
    }
}


// Fenster absolut positionieren
/*
function getPosition () {
		self.moveTo(100, 100);
}*/

// Fenster in den Vordergrund
function getFocus() {
    window.focus();
    /*window.moveTo(400, 300);*/
}

//Pop-UP Fenster (nicht verwendet)
function popUp(link, name) {
    var w  = 730;
	var h = 200;
	//alert("top="+((screen.height/2)-(h/1.5))+", left="+((screen.width/2)-(+w/2))+"");
 	if (link!=null && name!=null) {
	    window.open(link, name,"resizable=no,scrollbars=yes,locationbar=no,menuebar=no,status=no,height="+h+",width="+w+", top="+((screen.height/2)-(h/1))+", screenY="+((screen.height/2)-(h/1.5))+", left="+((screen.width/2)-(+w/2))+",screenX="+((screen.width/2)-(+w/2)));
		//window.open(link, name,"resizable=no,scrollbars=yes,locationbar=no,menuebar=no,status=no, height="+height+", width="+width+",left="((screen.width/2-(width/2))",top="((screen.height/2)-(height/1.5)));
	} else {
    	// DEBUG
		alert("Link oder Fensternahme fehlt");
	}
}

/* Element einfärben */
function getCellOver(element, color) {

	//alert("licht an: "+status);
    self.document.getElementById(element).style.backgroundColor="#"+color+"";
	self.document.getElementById(element).style.cursor="pointer";

}
function getCellOut(element, color) {

	//alert("licht an: "+status);
    self.document.getElementById(element).style.backgroundColor="#"+color+""; 
}


/* Tabellen-Border einfärben */
function getElementBorderOver(element, color) {
	self.document.getElementById(element).style.border="1px solid " +color;
}
function getElementBorderOut(element, color) {

    self.document.getElementById(element).style.border="1px solid "+color;
}

// Fenster in den Vordergrund
function getFocus() {
	window.focus();
	//window.moveTo(60, 100);
}


// Pop Up Fenster oeffnen
function fenster(link,id,w,h) {
	//window.open(name,id,'width='+w+',height='+h);
	window.open(link, id,"resizable=no,scrollbars=no,locationbar=no,menuebar=no,status=yes,height="+h+",width="+w+", top="+((screen.height/2)-(h/1.5))+", screenY="+((screen.height/2)-(h/1.5))+", left="+((screen.width/2)-(+w/2))+",screenX="+((screen.width/2)-(+w/2)));
}

/**
 * Dreamweaver Flash Detection
 *
 *
 */
 
function MM_checkPlugin(plgIn, theURL, altURL, autoGo) { //v4.0
  var ok=false; document.MM_returnValue = false;
  with (navigator) if (appName.indexOf('Microsoft')==-1 || (plugins && plugins.length)) {
    ok=(plugins && plugins[plgIn]);
  } else if (appVersion.indexOf('3.1')==-1) { //not Netscape or Win3.1
    if (plgIn.indexOf("Flash")!=-1 && window.MM_flash!=null) ok=window.MM_flash;
    else if (plgIn.indexOf("Director")!=-1 && window.MM_dir!=null) ok=window.MM_dir;
    else ok=autoGo; }
  if (!ok) theURL=altURL; if (theURL) window.location=theURL;
}

/**
 *  Pop Up Fenster Werbung oeffnen
 *
 *
 */

function windowAd(link,id,w,h) {
	//window.open(name,id,'width='+w+',height='+h);
	window.open(link, id,"resizable=no,scrollbars=no,locationbar=no,menuebar=no,status=no,height="+h+",width="+w+", top="+((screen.height/2)-(h/1.5))+", screenY="+((screen.height/2)-(h/1.5))+", left="+((screen.width/2)-(+w/2))+",screenX="+((screen.width/2)-(+w/2)));
}

/**
 *  Pop Up uebernaommen aus alter web-seite
 *
 *
 */

<!---
Protokoll = self.location.protocol;
Pfad = self.location.pathname;
Basis = Protokoll + '//' + Pfad.substring(1,Pfad.length-11)
neues_Fenster = null;

function errorTrap() {return true;}
window.onerror = errorTrap;

function Zeigen(Bild0,Titel0,Breite0,Hoehe0)
{
   Bild = Bild0;
   Titel = Titel0;
   Breite = Breite0;
   Hoehe = Hoehe0;
   zu();
   setTimeout("sichtbar()",1000);
}

function sichtbar()
{  
   Fenster_Hoehe = Hoehe + 30;
   Fenster_Breite = Breite + 40;
   Optionen = 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,height='+Fenster_Hoehe+',width='+Fenster_Breite;
   neues_Fenster = window.open('','',Optionen)
   with (neues_Fenster) 
   {
      document.writeln('<HTML><HEAD><TITLE>' + Titel + '</TITLE></HEAD>');
      document.writeln('<BODY bgcolor="#771d10" TEXT="#FFFFFF"><DIV ALIGN=CENTER><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 VALIGN="MIDDLE"><TR><TD>');
      document.writeln('<IMG SRC="'+Bild+'" WIDTH='+Breite+' HEIGHT='+Hoehe+' BORDER=0 ALT="'+Titel+'"></TD>');
      document.writeln('</TR></TABLE></DIV></BODY></HTML>');
   }
}

function zu()
{
   if (neues_Fenster != null)
     if (!neues_Fenster.closed)
        if (neues_Fenster.close)
           neues_Fenster.close(); 
}

//--->

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//-->

// PNG-Behandlung in mangellhafte Software zur Anzeige von Dokumenten in den Seitenbeschreibungssprachen HTML, XHTML
/* 
 * correctly handle PNG transparency in Win IE 5.5 or higher.
 * SOURCE: http://xhtmlforum.de/38860-alpha-transparente-png-im-internet-explorer.html
 * 
 */

function correctPNG() 
   {
   for(var i=0; i<document.images.length; i++)
      {
	  var img = document.images[i]
	  var imgName = img.src.toUpperCase()
	  if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
	     {
		 var imgID = (img.id) ? "id='" + img.id + "' " : ""
		 var imgClass = (img.className) ? "class='" + img.className + "' " : ""
		 var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
		 var imgStyle = "display:inline-block;" + img.style.cssText 
		 if (img.align == "left") imgStyle = "float:left;" + imgStyle
		 if (img.align == "right") imgStyle = "float:right;" + imgStyle
		 if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle		
		 var strNewHTML = "<span " + imgID + imgClass + imgTitle
		 + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
	     + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
		 + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
		 img.outerHTML = strNewHTML
		 i = i-1
	     }
      }
   }
window.attachEvent("onload", correctPNG);
//-->


