function BrowserWeiche(path)
{
	if ( navigator.userAgent.indexOf("Mac") != -1 )
	{
		document.write('<LINK REL="stylesheet" TYPE="text/css" HREF="' + path + 'stylesheets/mac_ie.css">');
	}
	else
	{
		document.write('<LINK REL="stylesheet" TYPE="text/css" HREF="' + path + 'stylesheets/win_ie.css">');
	}
}

/*
 *
 * OnTextBoxFocus prüft ob der eingebene Text in der TextBox mit der Vorbelegung übereinstimmt.
 * Falls ja wird der Text gelöscht und der User kann seine Eingaben machen.
 * Hat der User nun seine Eingaben gemacht stimmen Sie nicht mehr mit der Vorbelegung überein,
 * und der Text wird nicht mehr herausgelöscht.
 *
 */
function onTextBoxFocus(control, text)
{
	if(control.value == text)
	{
		control.value = "";
	}
}

/*
 *
 * OnTextBoxBlur prüft ob in der TextBox nichts eingegeben wurde wenn ja dann wird wieder
 * die Vorbelegung in die TextBox gefüllt. Andernfalls bleibt der Text erhalten, welcher
 * vom User eingegeben wurde.
 *
 */
function onTextBoxBlur(control, text)
{
	if(control.value == '')
	{
		control.value = text;
	}
}



/* Javascript zur Behebung eines Netscape-Darstellungsfehlers */
/* von CSS-Schriften bei einer Aenderung der Fenstergroesse */
function MM_reloadPage(init)
  {  //reloads the window if Nav4 resized
  if (init==true) with (navigator)
    {
    if ((appName=="Netscape")&&(parseInt(appVersion)==4))
      {
      document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage;
      }
    }
    else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
    }
MM_reloadPage(true);
/* Netscape-Fehlerbehebung - Ende */

/* Javascript zur vergroesserten Darstellung von Bildern - Anfang */
/* Dieter Schmidt 12.11.2001 */ 
function GrossesBild(Bild_URL,FensterBreite,FensterHoehe,BildUnterschrift)
  {
  neuesFenster = window.open("","neuesFenster","width="+FensterBreite+",height="+FensterHoehe+",scrollbars=1,resizable=1");
  neuesFenster.document.open();
  neuesFenster.document.write('<HTML>'); 
  neuesFenster.document.write('<HEAD><TITLE>'+BildUnterschrift+'</TITLE><META HTTP-EQUIV="content-type" CONTENT="text/html; charset=iso-8859-1"></HEAD>'); 
  neuesFenster.document.write('<BODY BGCOLOR="#FFFFFF" MARGINHEIGHT="10" TOPMARGIN="10" MARGINWIDTH="10" LEFTMARGIN="10" onBlur="self.close()"><DIV ALIGN="center">'); 
  neuesFenster.document.write('<P><IMG SRC="'+Bild_URL+'" BORDER="1" ALT="'+BildUnterschrift+'"></P>'); 
  neuesFenster.document.write('<P ALIGN="center"><SPAN STYLE="font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-style: normal; font-weight: bold; color: #000000;">'+BildUnterschrift+'<BR>&nbsp;</SPAN></P>');
  neuesFenster.document.write('</DIV></BODY>');
  neuesFenster.document.write('</HTML>');
  neuesFenster.document.close();
  neuesFenster.focus();
  } 

/* Javascript zur vergroesserten Darstellung von Bildern - Ende */
/*Zoomfunktionen Thomas Leclaire*/

// Christoph Zielinski:
// Zoom geht nicht bei Firefox. Es könnte aber mit MozTransform funktionieren:
//window.parent.document.body.style.MozTransform = "scale(2)"; 
//aktuell werden nur beim IE die Zoom Images eingeblendet
          


var vergr_ok 	= false;
var zoomLevel 	= 0;

function initZoomCk() {
    var cookieValue = ReadCookieValue();
    if (cookieValue!='') {
        zoomLevel = cookieValue;
        	
        if (zoomLevel != 0) {
            vergr_ok=true;
            if (typeof(window.parent.document.body.style.zoom) == "undefined") // firefox
            {
                if (window.parent.document.body.style.MozTransform != null)
                {}
            }
            else
            {
	            window.parent.document.body.style.zoom=Math.pow(1.281, zoomLevel);
	        }
	    }
    }
}

function SiteZoomGr() {
    vergr_ok=true;
    if (typeof(window.parent.document.body.style.zoom) == "undefined") // firefox
    {
    }
    else
    {   
        if (window.parent.document.body.style.zoom!=0) 
            window.parent.document.body.style.zoom*=1.281;
        else 
            window.parent.document.body.style.zoom=1.281; 
    }
    zoomLevel++;
    SetCookieValue(zoomLevel);
}

function SiteZoomKl() {
          
    if (zoomLevel != 0) {
	    vergr_ok=true;
        if (typeof(window.parent.document.body.style.zoom) == "undefined") // firefox
        {
        }
        else
        {
		    if (window.parent.document.body.style.zoom!=0) 
		        window.parent.document.body.style.zoom*=0.78125;
            else 
		        window.parent.document.body.style.zoom=0.78125; 
		}
        zoomLevel--;
	    SetCookieValue(zoomLevel);
    } else {
	    alert("Die Seite kann nicht weiter verkleinert werden!");
    }
}

function ReadCookieValue() {
    var cookieName = 'ZoomLevel';

	if (document.cookie.length == 0) { 
	    return '';
    } else {
		var firstChar, lastChar;
		var theBigCookie = document.cookie;
		firstChar = theBigCookie.indexOf(cookieName);
		if(firstChar != -1)  {
			firstChar += cookieName.length + 1;
			lastChar = theBigCookie.indexOf(';', firstChar);
			if(lastChar == -1) lastChar = theBigCookie.length;
			return unescape(theBigCookie.substring(firstChar, lastChar));   
		} else {
	    	return '';
		}
	}
}

function SetCookieValue(cookieValue) {
    document.cookie = 'ZoomLevel=' + cookieValue + ";PATH=/;";
}



// Zoom initialisieren
initZoomCk();

// clear authentication cache insb. für smart card logout

function clearAuthCache()
{
    try
    { 
        var browser = navigator.userAgent.toLowerCase();
       
        if (browser.indexOf("msie") != -1)
        {
            var cmd = "ClearAuthenticationCache";
            var supported = document.queryCommandSupported && document.queryCommandSupported(cmd);
            //var enabled = document.queryCommandEnabled && document.queryCommandEnabled(cmd);

            // IE clear HTTP Auth
            if (supported && document.execCommand && document.execCommand(cmd))
                return;
        }

        var xmlhttp = new XMLHttpRequest();
        // let's send invalid creds, and then abort
        xmlhttp.open("GET", "/@@", true, "logout", "logout");
        xmlhttp.send("");
        xmlhttp.abort();
    }
    catch(e){}
}

