/*
 * Allgemeine Funktionen
 *
 * Lars Vogel
 * 11-05-2007
 *
 */
 
 
 // Ein+ Ausblenden von Listenelementen (CSS-Kochbuch o´reilly)
 function kadabra(zap) {
	if (document.getElementById) {
		var abra = document.getElementById(zap).style;
		if (abra.display == "block") {
			abra.display = "none";
			} else {
			abra.display = "block"
			} 
		return false
		} else {
		return true
		}
}
 
// 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  = 540;
	var h = 700;
	//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);
}



