/* Fuer den Domainchecker - Fehler-Meldungen */

document.small_error1_top = -200;
document.small_error1_left = -200;

/* ######################################################################################################## */
/* UTF-8-Encoder fuer Domainchecker nur fuer IE */
function encode_utf8(rohtext) {
    if(navigator.appName == "Microsoft Internet Explorer") {
        if(document.charset != "utf-8") { 
            for(var i=0; i<rohtext.length; i++) {
            var a=rohtext.charCodeAt(i);
                if(a==223)
                {
                var tmp=rohtext.split("");
                tmp[i]="ss";
                rohtext=tmp.join("");
                }
            }
            // dient der Normalisierung des Zeilenumbruchs
            //rohtext = rohtext.replace(/g,"\n");
            var utftext = "";
                for(var n=0; n<rohtext.length; n++) {
                // ermitteln des Unicodes des  aktuellen Zeichens
                var c=rohtext.charCodeAt(n);
                // alle Zeichen von 0-127 => 1byte
                    if (c<128)
                        utftext += String.fromCharCode(c);
                    // alle Zeichen von 127 bis 2047 => 2byte
                    else if((c>127) && (c<2048)) {
                       utftext += String.fromCharCode((c>>6)|192);
                       utftext += String.fromCharCode((c&63)|128);
                    }
                 // alle Zeichen von 2048 bis 66536 => 3byte
                    else {
                        utftext += String.fromCharCode((c>>12)|224);
                        utftext += String.fromCharCode(((c>>6)&63)|128);
                        utftext += String.fromCharCode((c&63)|128);
                   }
                }
            document.getElementById("small").value=utftext;
            document.forms[0].submit();

            }
            else {
            document.getElementById("small").value=rohtext;
            document.forms[0].submit();
            }
        }
    else {
        document.getElementById("small").value=rohtext;
        document.forms[0].submit();
    }
}

/* ######################################################################################################## */
/**
* Funktion fuer Buttons, die aus einem Popup heraus geoeffnet werden 
* altes Popup-Fenster schliessen und neue Seite im Browser-Fenster oeffnen
*/

function openInNewWindow(_url){
	var url = _url;
	window.opener.location.href = url;
	window.close();
}
/* ######################################################################################################## */


/* ######################################################################################################## */

/* Einfache Ein- und Ausblenden Funktion */
function showArea(iNumber) {

	if (! iNumber || iNumber != parseInt(iNumber)) { return; }
	var iLauf = 0;
	while ( ++iLauf > 0 && window.document.getElementById('show_'+iLauf+'_3')
	) {
		if (iNumber == iLauf) {
			window.document.getElementById('show_'+iLauf+'_1').style.display = "none";
			window.document.getElementById('show_'+iLauf+'_2').style.display = "block";
			window.document.getElementById('show_'+iLauf+'_3').style.display = "block";
		} else {
			window.document.getElementById('show_'+iLauf+'_1').style.display = "block";
			window.document.getElementById('show_'+iLauf+'_2').style.display = "none";
			window.document.getElementById('show_'+iLauf+'_3').style.display = "none";
		}
	}
}//showArea

function hideArea(iNumber) {

	if (! iNumber || iNumber != parseInt(iNumber)) { return; }
	var iLauf = 0;
	while ( ++iLauf > 0 && window.document.getElementById('show_'+iLauf+'_3')
	) {
		if (iNumber == iLauf) {
			window.document.getElementById('show_'+iLauf+'_1').style.display = "block";
			window.document.getElementById('show_'+iLauf+'_2').style.display = "none";
			window.document.getElementById('show_'+iLauf+'_3').style.display = "none";
		} else {
			window.document.getElementById('show_'+iLauf+'_1').style.display = "block";
			window.document.getElementById('show_'+iLauf+'_2').style.display = "none";
			window.document.getElementById('show_'+iLauf+'_3').style.display = "none";
		}
	}
}//hideArea


/* ######################################################################################################## */


/* Einfache Einblenden Funktion */
function showSimple(iNumber) {

	if (! iNumber || iNumber != parseInt(iNumber)) { return; }
	var iLauf = 0;
	while ( ++iLauf > 0 && window.document.getElementById('showSimple_'+iLauf)
	) {
		if (iNumber == iLauf) {
			window.document.getElementById('showSimple_'+iLauf).style.display = "block";
		} else {
			window.document.getElementById('showSimple_'+iLauf).style.display = "none";

		}
	}
}//showSimple
/* ######################################################################################################## */


/* FAQ Toggle Funktion */
function toggleFaqEntry(obj) {
	 if(obj.className == "active")
	  obj.className = "";
	 else {
	  for(i=0; i<obj.parentNode.childNodes.length; i++) {
	   obj.parentNode.childNodes[i].className = "";
	  }
	  obj.className = "active";
	 }
	}

	function openFaqEntry() {
	 document.getElementById(location.href.substring(location.href.lastIndexOf("#")+1,location.href.length)).className = "active";
	}
	
/* ######################################################################################################## */


/* Erweiterte PopUp-Funktion mit Parameteruebergabe */
function popup(url, breite, hoehe, scrol, resize){
var links = screen.width - breite; //Bildschirmbreite
var hoch = screen.height - hoehe; //Bildschirmhhe
var popleft = links/2;
var poptop = hoch/2;
obj=open(url, "popup", "width="+ breite +",height=" + hoehe +",top="+ poptop +",left="+ popleft +",resizable="+ resize +",directories=no,scrollbars="+ scrol +",menubar=no,location=no,toolbar=no")
obj.window.focus()
}

/* ######################################################################################################## */


/* Einfache PopUp-Funktion */
function openPop(URLStr, winWidthStr, winHeightStr){

var winWidth=winWidthStr; 
var winHeight=winHeightStr; 

winWidthPos =(screen.availWidth/2)-(winWidth/2); 
winHeightPos =(screen.availHeight/2)-(winHeight/2); 	
	
		
  popWin = open(URLStr, 'popUpWin', 'toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=no,width='+winWidth+'px'+',height='+winHeight+'px'+',left='+winWidthPos+', top='+winHeightPos+',screenX='+winWidthPos+',screenY='+winHeightPos+'');
}

/* ######################################################################################################## */


/* Zweite Erweiterte PopUp-Funktion mit Parameteruebergabe */

var winpop;
//var img;
//var w;
function popup2(url, winBreite, winHoehe, posLinks, posTop, linkfield, options, winname) {	
	var screenBreite = (screen.availWidth) ? screen.availWidth : 800;
	var screenHoehe = (screen.availHeight) ? screen.availHeight : 600;
	if ((winBreite != null) && (winBreite <= 100)) winBreite = 100;
	if ((winBreite == null) || (winBreite < 100) || (winBreite > screenBreite)) winBreite = screenBreite - 100;
	if ((winHoehe != null) && (winHoehe <= 100)) winHoehe = 100;
	if ((winHoehe == null) || (winHoehe < 100) || (winHoehe > screenHoehe-120)) winHoehe = screenHoehe - 120;
	if ( (posLinks == null) || (posLinks < 0) || (screenBreite < posLinks + winBreite) ) posLinks = (screenBreite - winBreite) / 2; // mitte des bildschirms
	if ( (posTop == null) || (posTop < 0) || (screenHoehe < posTop + winHoehe) ) posTop = (screenHoehe - winHoehe) / 2 - 20; // mitte des bildschirms
	if (posTop < 0) posTop = 0;
	if (winpop && (winpop.closed != true)) winpop.close();
	if (!options) options = 'toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1';
    if (!winname) winname = 'w';
	winpop = window.open(escapeZoomURL(url), winname, options + ',width=' +winBreite+ ',height=' +winHoehe+ ',left=' +posLinks+ ',top=' +posTop);
	if (linkfield) winpop.w = linkfield;
	winpop.focus();
	return false;
}

/* ######################################################################################################## */

/* =============================================================================================
ANFANG - Globales Popup-Script. Sämtliche Einstellungen lassen 
sich damit dezentral direkt im Aufruf des Popups vornehmen. 
Dadurch brauchen wir nicht mehr fuer jedes Popup eine Extra Funktion!
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
So sieht der Popup-Aufruf: <a onclick="globalPopup('/verzeichnis/seite.html','name',
'height=100,width=100,scrollbars=yes,menubar=no,toolbar=no');return false;">Link</a>
===============================================================================================*/
function globalPopup(url,name,params) {
 var sizeX = 0;
 var sizeY = 0;
 var winX = screen.availWidth;
 var winY = screen.availHeight;
 var tmpArray = params.split(',');
 for (var i = 0; i < tmpArray.length; i++) {
  if (tmpArray[i].indexOf('width') != -1) {
   var tmpArray2 = tmpArray[i].split('=');
   sizeX = tmpArray2[1];
  }
  if (tmpArray[i].indexOf('height') != -1) {
   var tmpArray2 = tmpArray[i].split('=');
   sizeY = tmpArray2[1];
  }
 }
 var centerX = Math.round(winX / 2 - sizeX / 2);
 var centerY = Math.round(winY / 2 - sizeY / 2);
 params += ',left=' + centerX + ',top=' + centerY;
 var pWindow = open(url,name,params).focus();
}
/* =====================================================================================*/
/* ENDE - Globales Popup-Scripts */ 
/* =====================================================================================*/