////////////////////////////////////////////////////////////////
//
// Anzupassende Variablen:
//
// Rahmen, in den die Seiten zu laden sind, falls kein Ziel angegeben wurde 
//("top" fuer Nonframe).
var frameContent = "inhalt";
//
// Falls Cookies zur Weitergabe von NavId verwendet werden sollen (0 = aus, 1 = ein).
var useCookiesNavId = 0;
//
// Falls Cookies zur Weitergabe von PageId verwendet werden sollen (0 = aus, 1 = ein).
var useCookiesPageId = 0;
//
// Aktiviert den Debugmodus zur Fehlersuche (0 = aus, 1 = ein).
var cacheMode = 0;
//
// Aktiviert den Debugmodus zur Fehlersuche (0 = aus, 1 = ein).
var debugMode = 0;
//
// Optionen des standard Popupfensters.
var optionsPopup = "scrollbars=yes,resizable=yes,menubar=yes,location=no,width=600,height=480";
//
// Optionen des ersten Popupfensters.
var optionsPopup1 = "scrollbars=yes,resizable=yes,menubar=no,location=no,width=240,height=360";
//
// Optionen des zweiten Popupfensters.
var optionsPopup2 = "scrollbars=yes,resizable=yes,menubar=no,location=no,width=160,height=160";
//
////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////
//
// Beschreibung: Browsererkennung
//
////////////////////////////////////////////////////////////////

var ns  = (document.layers) ? 1 : 0;
var ie  = (document.all) ? 1 : 0;
var dom = (document.getElementById) ? 1 : 0;
var mac = (navigator.platform.indexOf("Mac") != -1) ? 1 : 0;

////////////////////////////////////////////////////////////////
//
// Beschreibung: Ermittelt den Weblication-Benutzernamen
//
// Return: Benutzername
//
////////////////////////////////////////////////////////////////
  
function getUserName(){

  var cookieStr = document.cookie;  
  var userName  = "";
  var checkIsLogedin = /wId=WSESSIONID/;
  
  if(checkIsLogedin.test(cookieStr) == true){
    var checkUser       = /WSESSIONID\%40([\w|\d|-|_]+)\%40([\w|\d|-|_]*)\%40/;
    var checkUserPublic = /WSESSIONID\%40p%3A([\w|\d|-|_]+)\%40([\w|\d|-|_]*)\%40/;  
    if(checkUser.test(cookieStr) == true){
      userName = RegExp.$1;
      //userLang = RegExp.$2; 
    }
    else if(checkUserPublic.test(cookieStr) == true){
      userName = RegExp.$1;
      //userLang = RegExp.$2; 
    }
  }
  return userName;  
}

////////////////////////////////////////////////////////////////
//
// Beschreibung: Oeffnet ein Popup-Fenster
//
////////////////////////////////////////////////////////////////

function openPopup(url){

 if(debugMode == 1){
  alert(url);
 }

 window.open(url, "popup", optionsPopup);
}

////////////////////////////////////////////////////////////////
//
// Beschreibung: Oeffnet ein Popup-Fenster vom Typ 1
//
////////////////////////////////////////////////////////////////

function openPopup1(url){

 if(debugMode == 1){
  alert(url);
 }

 window.open(url, "popup", optionsPopup2);
}

////////////////////////////////////////////////////////////////
//
// Beschreibung: Oeffnet ein Popup-Fenster vom Typ 2
//
////////////////////////////////////////////////////////////////

function openPopup2(url){

 if(debugMode == 1){
  alert(url);
 }

 window.open(url, "popup", optionsPopup2);
}

////////////////////////////////////////////////////////////////
//
// Beschreibung: Wechselt ein Bild aus
// 
// Parameter: picOldId  = ID des Bildes, das ersetzt werden soll
//
// Parameter: picNewObj = Neues Bildobjekt das eingesetzt werden soll
//
////////////////////////////////////////////////////////////////

function changePic(picOldId, picNewObj){

 if(debugMode == 1){
  alert("picOldId = " + picOldId + "\npicNewObj = " + picNewObj);
 }
 
 if(document.images[picOldId]){
  if(document.images[picOldId].src && picNewObj){
   document.images[picOldId].src = picNewObj.src;
  }
 }
} 

////////////////////////////////////////////////////////////////
//
// Beschreibung: Druckt das aktuelle Dokument
//
////////////////////////////////////////////////////////////////

function printDocument(){  

 if(ie){
  var browser = '<object id="webBrowser" width="0" height="0" classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></object>';
  document.body.insertAdjacentHTML('beforeEnd', browser);
  webBrowser.ExecWB(6, 2);
 }
 else{
  window.print() ;  
 }
}

////////////////////////////////////////////////////////////////
//
// Beschreibung: Sendet das Formular
// 
// Parameter: form = Formular, das gesendet werden soll.
//
////////////////////////////////////////////////////////////////

function submitForm(form, cacheMode){

 var messageObligation = " ist ein Pflichtfeld!\n"; //erscheint wenn ein Pflichtfeld nicht ausgefüllt wurde
 var messageEmail      = " enthält keine gültige Email Adresse!\n"; //erscheint wenn ein Pflichtfeld nicht ausgefüllt wurde

 var isObligation = /\|\w*o\w*$/i;  //Pflichtfeld, wenn Feldname am Schluss |o  enthaelt   (z.B.: "Strasse|o")
 var isEmail      = /\|\w*e\w*$/i;  //Emailfeld wenn Feldname am Schluss |e enthaelt       (z.B.: "eMail|e")
 var isCache      = /\|\w*c\w*$/i;  //Wird fuer weitere Formulare gespeichert am Schluss |c enthaelt       (z.B.: "eMail|c")
          //Pflicht- und Emailfeld, wenn am Schluss |oe oder |eo (z.B.: "eMail|eo") 

 var checkEmail   = /.*\@.*\.\w+/i;
 var formElement;
 var formElementNameOrig;
 var alertStr = "";

 var cookieStr = "";

  for(var i = 0; i <= form.elements.length - 1; i++){
    var formElement = form.elements[i];
    if(formElement){
      if(formElement.type == "text" || formElement.type == "textarea"){
        formElementNameOrig = formElement.name.replace(/\|\w+/, ''); 
        if(formElementNameOrig == "Email"){
          if(form.from.value == ""){
            form.from.value = formElement.value;
          }
        }
        if(isObligation.test(formElement.name) == true){  
          if(formElement.value == ""){
            alertStr += formElementNameOrig + messageObligation;                     
          }
        } 
        if(isEmail.test(formElement.name) == true){  
          if (checkEmail.test(formElement.value) == false){
            alertStr += formElementNameOrig + messageEmail;                     
          }
        } 
        if(cacheMode == "1"){    
          if(isCache.test(formElement.name) == true){ 
            if(formElement.value != ""){
              cookieStr += "wFc_" + formElementNameOrig + "=" + formElement.value + ":";
            }
          }    
        }     
      }
	  else if(formElement.type == "checkbox"){
        formElementNameOrig = formElement.name.replace(/\|\w+/, ''); 	  
        if(isObligation.test(formElement.name) == true){  
          if(formElement.checked == false){
            alertStr += formElementNameOrig + messageObligation;                     
          }
        } 
	  }
    }
  }

  if(alertStr != ""){
    alert(alertStr);  
  }
  else{
    if(cacheMode == 1){   
      cookieStr += "; path=/";  
      document.cookie = cookieStr; 
    }
    form.submit();
  }
}

////////////////////////////////////////////////////////////////
//
// Beschreibung: Initialisiert das Formular
// 
// Parameter: form = Formular, das initialisiert werden soll.
//
////////////////////////////////////////////////////////////////

function initForm(form){

  var isCache      = /\|\w*c\w*$/i;  //Wird fuer weitere Formulare gespeichert am Schluss |c enthaelt       (z.B.: "eMail|c")

  var formElement;
  var formElementNameOrig;

  var cookieStr    = document.cookie;
  var elementValue = "";

  if(form){
    for(var i = 0; i <= form.elements.length - 1; i++){
      var formElement = form.elements[i];
      if(formElement){
        if(formElement.name){      
          if(isCache.test(formElement.name) == true){ 
            if(formElement.value == ""){
              formElementNameOrig = formElement.name.replace(/\|\w+/, ''); 
              var getElementValue = eval("/wFc_" + formElementNameOrig + "\=([^\:]+)\:/");
              if(getElementValue.test(cookieStr) == true){
                elementValue = RegExp.$1;
                formElement.value = elementValue;
              }  
            }
          }
        }
      }
    }
  }
  else{
    //alert("Formular wurde nicht gefunden!\n Wurde es schon geladen?");
  }
}

////////////////////////////////////////////////////////////////
//
// Beschreibung: Startet die Suche in einem neuen Fenster
// 
////////////////////////////////////////////////////////////////

function startSearch(){
  var form = document.frmSearch;
  if(form.term.value == "" || form.term.value == " suchen"){
    alert("Sie haben noch keinen Suchbegriff eingegeben!");
    form.term.focus();
    return;
  }
  var win = window.open ("", "winSearch","height=440,width=540,status=no,menubar=no,scrollbars=yes");
  var x = (screen.width-540)/2;
  win.moveTo(x,30);
  win.focus();
  form.submit();
}


////////////////////////////////////////////////////////////////
//
// Beschreibung: Zeigt einen Layer an
// 
// Parameter: layerId = ID des anzuzeigenden Layers
//
////////////////////////////////////////////////////////////////

function showLayer(layerId){

 if(ie){
  if(document.all[layerId]){
   document.all[layerId].style.visibility = 'visible';
  }  
 }
 else if(ns){
  if(document.layers[layerId]){
   document.layers[layerId].visibility = 'visible'; 
  } 
 }
 else if(dom){
  if(document.getElementById(layerId)){
   document.getElementById(layerId).style.visibility = 'visible';  
  }
 } 
}
     
////////////////////////////////////////////////////////////////
//
// Beschreibung: Schliest einen Layer
// 
// Parameter: layerId = ID des zu schliesenden Layers
//
////////////////////////////////////////////////////////////////

function hideLayer(layerId){

 if(ie){
  if(document.all[layerId]){
   document.all[layerId].style.visibility = 'hidden';
  }  
 }
 else if(ns){
  if(document.layers[layerId]){
   document.layers[layerId].visibility = 'hide'; 
  } 
 }
 else if(dom){
  if(document.getElementById(layerId)){
   document.getElementById(layerId).style.visibility = 'hidden';  
  }
 } 
}
     
////////////////////////////////////////////////////////////////
//
// Beschreibung: Prueft, ob ein Layer angezeigt wird
// 
// Parameter: layerId = ID des zu pruefenden Layers
//
// Return: 0 = unsichtbar, 1 = sichbar
//
////////////////////////////////////////////////////////////////

function isVisibleLayer(layerId){

 if(ie){
  if(document.all[layerId].style.visibility == 'visible'){
   return 1;
  }  
  else{
   return 0;
  }  
 }
 else if(ns){
  if(document.layers[layerId].visibility == 'visible'){        
   return 1;
  }  
  else{
   return 0;
  } 
 }
 else if(dom){
  if(document.getElementById(layerId).style.visibility == 'visible'){        
   return 1;
  }  
  else{
   return 0;
  }
 }    
}

///////////////////////////////////////////////////
// Prüft die Richtigkeit der Eingaben in Formularen
// by Maciej Homziuk
///////////////////////////////////////////////////
// Naming of a field oenName of field
// Empty values: text and select-one "".
	function checkForm (iForm, paramNameSubmit, paramSchicken, paramToday) {
		
		var checkVar = /^(o|x)(ex|xn|dx|dd|xx)/;
		//zusätzliche Variablen für das überprüfen von Checkboxen		
		var cbCounter = 0;
		var cbChecked = false;
		var cbName = "";
		var nameDelimiterPos = 0;
		
		for (x=0; x<document.forms[iForm].elements.length; x++) {
			blnObligatory = false;
			blnEmail = false;
			blnDate = false;
			blnNumeric = false;
			blnEmpty = false;
			blnAt = false;
			blnPoint = false;
			blnCheckNumeric = true;
			blnCheckDate = true;
			blnDateFromPast = true
			strMaxLength = "";
			strTextAreaName = "";
			fieldName = "";
			
			fieldName = document.forms[iForm].elements[x].name;
			fieldType = document.forms[iForm].elements[x].type;
	
			if (typeof(fieldName) != "undefined"){
				if (checkVar.test(fieldName.charAt(0)+fieldName.charAt(1)+fieldName.charAt(2)) == true){
					
					//Checking if the field is obligatory.
					if (fieldName.charAt(0) == "o") {blnObligatory = true}
					//Checking if the field is a date field.
					if (fieldName.charAt(1) == "d") {blnDate = true}
					//Checking if the field cannot contain the date from the past.
					if (fieldName.charAt(2) == "d") {blnDateFromPast = false}
					//Checking if the field is an email field.
					if (fieldName.charAt(1) == "e") {blnEmail = true}
					//Checking if the field is "only numeric values" field.
					if (fieldName.charAt(2) == "n") {blnNumeric = true}
		
					strRealName = fieldName.slice(3);
					if (strRealName == "Email") {
						strRealName = "E-Mail";
					} else if (strRealName == "Email2") {
						strRealName = "Bestätigung der E-Mail";
					} else if (strRealName == "Dienst") {
						strRealName = "Innen- / Außendienst";
					} else if (strRealName == "Vermittler Profil") {
						strRealName = "Vermittlerprofil";
					} else if (strRealName == "Passwort2") {
						strRealName = "Bestätigung des Passworts";
					} else if (strRealName == "VJBeschreibung") {
						strRealName = "Kurzbeschreibung zur Veröffentlichung im VersicherungsJournal";
					} else if (strRealName == "Wogehoert") {
						strRealName = "\"Wo gehört\"";
					}
					strValue = document.forms[iForm].elements[x].value;
					// Whole procedure for the obligatory field.
					if (blnObligatory) {
						//Checking if the obligatory field wans't filled in the form.
						if (fieldType == "text" || fieldType == "textarea" || fieldType == "password") {
							if (strValue == "") {
								blnEmpty = true;
								emptyAlert = "Bitte füllen Sie das Feld \""+strRealName+"\" aus!";
							}
						} else if (fieldType == "select-one" || fieldType == "select-multiple") {
							if (strValue == "") {
								blnEmpty = true;
								emptyAlert = "Bitte treffen Sie im Feld \""+strRealName+"\" eine Wahl!";
							}
						} else if (fieldType == "checkbox") {

							//wirklichen Namen der Checkbox ermitteln
							nameDelimiterPos = fieldName.search(/_/);
							if (nameDelimiterPos != -1) {
								//falls ein neues Checkboxfeld geprueft wird ... check Variable und Zaehler zuruecksetzen und Namen speichern
								if (cbName != fieldName.substring(0, nameDelimiterPos)) {
									cbChecked = false;
									cbName =  fieldName.substring(0, nameDelimiterPos);
									cbCounter = 0;
								}
							} else {
								cbChecked = false;
								cbCounter = 0;
								cbName = "";
							}
							
							//pruefen ob diese Checkbox angekreuzt wurde
							if (document.forms[iForm].elements[x].checked == false && !cbChecked) {
								if (document.forms[iForm].elements[x + 1].type == "checkbox" && document.forms[iForm].elements[x + 1].name.substring(0, cbName.length) == cbName ) {
									cbCounter++;
								} else {
									blnEmpty = true;
									if (cbCounter == 0) {
										emptyAlert = "Sie muessen unsere AGB akzeptieren!!!";
									} else {
										emptyAlert = "Sie muessen mindestens eine Auswahl treffen!!!";
									}
								}
							} else {
								cbChecked = true;
							}
							
						} else if (fieldType == "radio") {
							blnRadioOK = false;
							intAnzahlElemente = document.getElementsByName(document.forms[iForm].elements[x].name).length;
							for (var i=0; i<intAnzahlElemente; i++) {
								if (document.getElementsByName(document.forms[iForm].elements[x].name)[i].checked) {
									blnRadioOK = true;
								}
							}
							if (!blnRadioOK) {
								blnEmpty = true;
								emptyAlert = "Bitte eine Option im Feld \""+strRealName+"\" auswählen !!!";
							}
						}
						
						if (blnEmpty == true) {
							alert (emptyAlert);
							document.forms[iForm].elements[x].focus();
							return false;
						}
					}
		
					// Whole procedure for the email field.
					strIllegalChar = "";
					if (blnEmail && (strValue != "")) {
						for (y = 0; y < document.forms[iForm].elements[x].value.length; y++) {
							if (document.forms[iForm].elements[x].value.charAt(y) == "@")
								{blnAt = true}
							if (document.forms[iForm].elements[x].value.charAt(y) == ".")
								{blnPoint = true}
							if (document.forms[iForm].elements[x].value.charAt(y).match(/(,|;|:|#|!| |ä|ö|ü|ä|ü|ö|ß)/))
								{strIllegalChar = document.forms[iForm].elements[x].value.charAt(y);}
						}
						if (strIllegalChar != "") {
							alert("Unerlaubtes Zeichen in der E-Mailadresse: \""+strIllegalChar+"\" !");
							document.forms[iForm].elements[x].focus();
							return false;
						}
						if (! (blnAt && blnPoint)) {
							alert("Geben Sie bitte im Feld "+strRealName+" eine Emailadresse ein !");
							document.forms[iForm].elements[x].focus();
							return false;
						}
					}
		
					// Whole procedure for the date field.
					if (blnDate && (strValue != "")) {
						for (y = 0; y < document.forms[iForm].elements[x].value.length; y++) {
							if (document.forms[iForm].elements[x].value.length != 10) {
								blnCheckDate = false;
							}
							if (y == 4 || y == 7) {
								if (document.forms[iForm].elements[x].value.charAt(y) != "-") {
									blnCheckDate = false;
								}
							} else {
								if (document.forms[iForm].elements[x].value.charAt(y) < "0" || 
									document.forms[iForm].elements[x].value.charAt(y) > "9") {
									blnCheckDate = false;
								}
							}
							if (! blnCheckDate) {
								alert("Geben Sie bitte im Feld "+strRealName+" ein Datum im Format JJJJ-MM-TT ein !");
								document.forms[iForm].elements[x].focus();
								return false;
							}
							if (! blnDateFromPast) {
								if (document.forms[iForm].elements[x].value < paramToday && document.forms[iForm].elements[x].value != "0000-00-00") {
									alert("Bitte bei "+strRealName+" kein Datum aus der Vergangenheit eingeben.");
									document.forms[iForm].elements[x].focus();
									return false;
								}
							}
						}
					}			
					
					// Whole procedure for numeric field.
					if (blnNumeric && (strValue != "")) {
						for (y = 0; y < document.forms[iForm].elements[x].value.length; y++) {
							if ((document.forms[iForm].elements[x].value.charAt(y) < "0" ||
								document.forms[iForm].elements[x].value.charAt(y) > "9") && 
								(document.forms[iForm].elements[x].value.charAt(y) != ","))
								{
									blnCheckNumeric = false;
								}
							if (! blnCheckNumeric) {
								alert("Geben Sie bitte im Feld "+strRealName+" einen numerischen Wert ein !");
								document.forms[iForm].elements[x].focus();
								return false;
							}
						}
					}
					
					//Checking if the text in textarea is not too long.
					if (fieldType == "textarea") {
						//Checking if this textarea has limited characters number allowed.
						for (y = 0; y < fieldName.length; y++) {
							if (fieldName.charAt(y) >= 0 || fieldName.charAt(y) <= 9) {
								strMaxLength = strMaxLength + fieldName.charAt(y);
							} else if (y > 2) {
								strTextAreaName = strTextAreaName + fieldName.charAt(y);
							}
						}
						//Checking if the value entered in the textarea is not too long.
						if (strMaxLength != "" && strMaxLength > 99) {
							if (document.forms[iForm].elements[x].value.length > strMaxLength) {
								document.forms[iForm].elements[x].focus();
								alert("Der Text im Feld "+strTextAreaName+" kann maximal aus "+strMaxLength+" Zeichen bestehen.");
								return false;
							}
						}
					}
					
					// Checking if the email adresses and passwords are in booths fields the same.
					if (strRealName == "Bestätigung der E-Mail") {
						strEmail1 = document.forms[iForm].oexEmail.value;
						strEmail2 = document.forms[iForm].oexEmail2.value;
				  		if (strEmail1 != strEmail2) {
							alert("Die Werte im Feld \"E-Mail\" und \"E-Mail-Bestätigung\"\nstimmen nicht überein !!!");
							document.forms[iForm].oexEmail.focus();
							return false;
						}
					}
		
					if (strRealName == "Bestätigung des Passworts") {
						strEintrag1 = document.forms[iForm].oxxPasswort.value;
						strEintrag2 = document.forms[iForm].oxxPasswort2.value;
				  		if (strEintrag1 != strEintrag2) {
							alert("Die Werte im Feld \"Passwort\" und \"Passwort - Bestätigung\"\nstimmen nicht überein !!!");
							document.forms[iForm].oxxPasswort.focus();
							return false;
						}
						if (strEintrag1.length < 6) {
							alert("Das Passwort muss mindestens aus 6 Zeichen bestehen.");
							document.forms[iForm].oxxPasswort.focus();
							return false;
						}
					}
				}//end of variable name validation
			}//end of type validation
		}//end of loop 
		
		// If everything is ok then submit the form.
		if (paramNameSubmit) {
			if (window.navigator.appName == "Microsoft Internet Explorer" && paramSchicken != "nicht_schicken") {
				document.getElementById(paramNameSubmit).disabled = true;
			}
		}
		
		if (paramSchicken != "nicht_schicken") {
			document.forms[iForm].submit();
		}
		return true;
	}
	
////////////////////////////////////////////////////////////////////
//Prüft die Länge der Eingabe im Textarea.
//by Maciej Homziuk
////////////////////////////////////////////////////////////////////

	function limitTextarea(paramFeld,paramLimit)
	{
		if (paramFeld.value.length > paramLimit) {
			alert("Sie können maximal "+(paramLimit+1)+" Zeichen eingeben !");
			paramFeld.focus();
			strValue = paramFeld.value;
			strNewValue = strValue.slice(0,paramLimit);
			paramFeld.value = strNewValue;
			return false;
		}
	}
	
////////////////////////////////////////////////////////////////////
//Setzt den Zeiger auf das n-te (mögliche) Element im m-ten Formular
//by Maciej Homziuk
////////////////////////////////////////////////////////////////////

	function focusOn(n,m) {
		var blnGesetzt = false;
		while (!blnGesetzt && document.forms[m]) {
			if (document.forms[m].elements[n].type == "hidden" || document.forms[m].elements[n].value != "") {
				n++;
				if (n > document.forms[m].elements.length - 1) {
					return false;
				}
			} else {
				document.forms[m].elements[n].focus();
				blnGesetzt = true;
			}
		}
	} 
	
////////////////////////////////////////////////////////////////////
//Öffnet das Bestätigungsfenster, wenn bestätigt öffnet die URL
//by Maciej Homziuk
////////////////////////////////////////////////////////////////////
	
	function warnung(paramText,paramURL) {
		blnAction = confirm(paramText);
		if (blnAction == true) {
			window.location.href = paramURL;
		}
	}	

////////////////////////////////////////////////////////////////////
//Öffnet das popup Fenster mit und platziert es in der Mitte des
//Bildschirms
//by Maciej Homziuk
////////////////////////////////////////////////////////////////////

	function redirectPopup(paramZiel, paramURL) {
		alert("test");
//		paramZiel.location.href = paramURL;
	}
	
	function MM_preloadImages() {
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
	
	function mypopup(strURL,intSzer,intWys,scroll,namewindow,paramEinstellungen,showPreloader) {
		MM_preloadImages("/layout/design/img/preloader_new.gif");
		if (paramEinstellungen == "") {
			strEinstellungen = ",status=no,resizable=no";
		} else {
			strEinstellungen = paramEinstellungen;
		}
		if (showPreloader == "1") {
			picPreload = new Image(100,25); 
			picPreload.src="http://www.deutsche-versicherunsgboerse.de/layout/design/img/preloader_new.gif"; 
			windowPopup = window.open("",namewindow,"width="+intSzer+",height="+intWys+",scrollbars="+scroll+",left="+(screen.availWidth/2-0.5*intSzer)+",top="+(screen.availHeight/2-0.5*intWys)+strEinstellungen);
			windowPopup.document.write('<div style="position: absolute; width: 100%; top: 50%;margin-top: -66px;z-index:6;" align="center"><img src="/layout/design/img/preloader_new.gif" /></div><div style="position: absolute; font-family: Arial;width: 100%; left: 0;top: 50%;overflow: hidden;margin-top: -15px;z-index:6; font-size: 12px; font-weight: 900; text-align: center;">&nbsp;&nbsp;&nbsp;Bitte warten...</div>');
		}
//			strEinstellungen = strEinstellungen+",tool-bar=no,location=no,directories=no,menubar=yes,status=yes,copyhistory=yes";
		
//		if (showPreloader == "1") {
//			windowPopup.document.location.href = paramURL;
//		} else {
			windowPopup = window.open(strURL,namewindow,"width="+intSzer+",height="+intWys+",scrollbars="+scroll+",left="+(screen.availWidth/2-0.5*intSzer)+",top="+(screen.availHeight/2-0.5*intWys)+strEinstellungen);
//		}

		if (windowPopup) {
			windowPopup.focus();
		} else {
			alert("Achtung!!! Sie haben in Ihrem Browser Popups deaktiviert.\nAktivieren Sie bitte Popups für deutsche-versicherungsboerse.de, um alle Inhalte zu sehen.");
		}		
	}
	
////////////////////////////////////////////////////////////////////
//Verändert die Größe des Popup-Fensters und platziert es in der Mitte des
//Bildschirms
//by Maciej Homziuk
////////////////////////////////////////////////////////////////////
	
	function resizeAndCenter(intBreite,intHoehe) {
		window.moveTo(screen.availWidth/2-0.5*(intBreite),screen.availHeight/2-0.5*(intHoehe));
		window.resizeTo(intBreite,intHoehe);
	}
	
////////////////////////////////////////////////////////////////////
//Öffnet ein Layer mit dem Hilfetext
//by Maciej Homziuk
////////////////////////////////////////////////////////////////////

	function showHelp (paramLayerId,paramX,paramY) {
		document.getElementById(paramLayerId).style.left = paramX;
		document.getElementById(paramLayerId).style.top = paramY;
		document.getElementById(paramLayerId).style.visibility = 'visible';
	}
	
////////////////////////////////////////////////////////////////////
//Schliesst ein Layer mit dem Hilfetext
//by Maciej Homziuk
////////////////////////////////////////////////////////////////////

	function hideHelp (paramLayerId) {
		document.getElementById(paramLayerId).style.visibility = 'hidden';
	}

////////////////////////////////////////////////////////////////////
//Deaktiviert alle ausgewählten Einträge in einer DropDownListe
//by Maciej Homziuk
////////////////////////////////////////////////////////////////////
	function unselectDDList (paramListe) {
		for (x = 0; x < paramListe.length; x++)	{
			paramListe.options[x].selected = false;
		}
	}
	
	function checkTaste (Ereignis) {
		if (!Ereignis)
		Ereignis = window.event;
		if (Ereignis.keyCode == 13) {
			checkForm(0);
		}
	}	

////////////////////////////////////////////////////////////////////
//Diese Funktion aktiviert und / oder deaktiviert gleichzeitig 
//mehrere Checkboxes
//by Maciej Homziuk
////////////////////////////////////////////////////////////////////
	function markieren(paramAction,paramFeld, paramVon, paramBis, formId) {
	
		if (typeof paramVon == "undefined") {
			y = -1;
		} else {
			y = 0;
		}
		
		if (typeof(formId) == "undefined") formId = 0;

		for (x=0; x<document.forms[formId].elements.length; x++) {
			fieldType = document.forms[formId].elements[x].type;
			if (fieldType == "checkbox") {
				if (paramAction == "on") {
					if (document.forms[formId].elements[x].name.slice(0,8) == paramFeld) {
						if (y >= paramVon && y <= paramBis || y == -1) {
							document.forms[formId].elements[x].checked = true;
						}
					}
				} else if (paramAction == "off") {
					if (document.forms[formId].elements[x].name.slice(0,8) == paramFeld) {
						if (y >= paramVon && y <= paramBis || y == -1) {
							document.forms[formId].elements[x].checked = false;
						}
					}
				} else if (paramAction == "change") {
					if (document.forms[formId].elements[x].checked == true) {
						if (document.forms[formId].elements[x].name.slice(0,8) == paramFeld) {
							if (y >= paramVon && y <= paramBis || y == -1) {
								document.forms[formId].elements[x].checked = false;
							}
						}
					} else {
						if (document.forms[formId].elements[x].name.slice(0,8) == paramFeld) {
							if (y >= paramVon && y <= paramBis || y == -1) {
								document.forms[formId].elements[x].checked = true;
							}
						}
					}
				}
			}
			if (document.forms[formId].elements[x].name.slice(0,8) == paramFeld) {
				if (y != -1) {y++;}
			}
		}
	}
	/////////////////////////////////////////////////////////////////////////////////
	//Die beiden folgenden Funktionen ermitteln die absolute position eines Elements 
	////////////////////////////////////////////////////////////////////////////////
	
	//absolute Position left
	function getOffsetLeft(element){
		if(!element) return 0;
		return element.offsetLeft + getOffsetLeft(element.offsetParent);
	}
	
	//absolute Position top
	function getOffsetTop(element){
		if(!element) return 0;
		return element.offsetTop + getOffsetTop(element.offsetParent);
	}
	////////////////////////////////////////////////////////////////////
	//Die folgenden Funktionen werden von einem Formelement genutzt 
	////////////////////////////////////////////////////////////////////
	function DoAdd(id)
	{
		if (document.getElementById("availableList").selectedIndex > -1)
		{
			var strText = document.getElementById("availableList").options[document.getElementById("availableList").selectedIndex].text;
			var strId = document.getElementById("availableList").options[document.getElementById("availableList").selectedIndex].value;
			AddItem(document.getElementById("chosenList"), strText, strId);
			RemoveItem(document.getElementById("availableList"), document.getElementById("availableList").selectedIndex);
			sortSelect(document.getElementById("chosenList"));
			UpdateRealValue(id);
		}
	}
	
	function DoRemove(id)
	{
		if (document.getElementById("chosenList").selectedIndex > -1){
			var strText = document.getElementById("chosenList").options[document.getElementById("chosenList").selectedIndex].text;
			var strId = document.getElementById("chosenList").options[document.getElementById("chosenList").selectedIndex].value;
			AddItem(document.getElementById("availableList"), strText, strId);
			RemoveItem(document.getElementById("chosenList"), document.getElementById("chosenList").selectedIndex);
			//sortSelect(document.getElementById("availableList"));
			UpdateRealValue(id);
		}	
	}
	
	function AddItem(objListBox, strText, strId)
	{
		var newOpt;
		newOpt = document.createElement("OPTION");
		newOpt = new Option(strText,strId);
		newOpt.id = strId;
		objListBox.options[objListBox.length]=newOpt;
	}
	
	function RemoveItem(objListBox, strId)
	{
		if (strId > -1)
			objListBox.options[strId]=null;
	}
	
	function UpdateRealValue(id)
	{
		document.getElementById(id).value = '';
	
		var lbBox = document.getElementById("chosenList");
		document.getElementById(id).value = 'a|';
		for (var i = 0; i < lbBox.options.length; i++)
		{
			document.getElementById(id).value = document.getElementById(id).value + lbBox.options[i].value+ '|';
		}
		document.getElementById(id).value = document.getElementById(id).value + 'a';	
	}
	
	function compareText (option1, option2) {
		return option1.text < option2.text ? -1 :
		option1.text > option2.text ? 1 : 0;
	}
	
	function sortSelect (select, compareFunction) {
		if (!compareFunction)
		compareFunction = compareText;
		var options = new Array (select.options.length);
		for (var i = 0; i < options.length; i++)
		options[i] =
			new Option (
				select.options[i].text,
				select.options[i].value,
				select.options[i].defaultSelected,
				select.options[i].selected
			);
		options.sort(compareFunction);
		select.options.length = 0;
		for (var i = 0; i < options.length; i++)
		select.options[i] = options[i];
	}

	function requestAJAX(paramGetURL,paramParams,paramDivName,paramLoaderGrafik){
		
		if (typeof(paramLoaderGrafik) == "undefined") {
			paramLoaderGrafik = "little_circle.gif";
		}
		
		//erstellen des requests
		var req = null;
		
		try{
			req = new XMLHttpRequest();
		} catch (ms){
			try{
				req = new ActiveXObject("Msxml2.XMLHTTP");
			} catch (nonms){
				try{
					req = new ActiveXObject("Microsoft.XMLHTTP");
				} catch (failed){
					req = null;
				}
			}  
		}
		
		if (req == null) {
			alert("Error creating request object!");
		}
                  
		//anfrage erstellen (GET, url ist localhost, request ist asynchron
		if (req.overrideMimeType) {
			req.overrideMimeType("text/html; charset=ISO-8859-1");
		}
		req.open("POST", paramGetURL, true);
		
		req.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		req.setRequestHeader("Content-length", paramParams.length);
		req.setRequestHeader("Connection", "close");
		
		req.send(paramParams);
		
		document.getElementById(paramDivName).style.backgroundColor = "#D6D6D6";
		document.getElementById(paramDivName).innerHTML = "<table style=\"border-width: 1px; border-style: solid; border-color: #999999;\" height=100% width=100%><tr><td valign=center><center><img src=\"/includes/images/ajax_ai/"+paramLoaderGrafik+"\" alt=\"\" border=\"0\"></center></td></tr></table>";
	
		//Beim abschliessen des request wird diese Funktion ausgeführt
		req.onreadystatechange = function(){
			switch(req.readyState) {
				case 4:
				if(req.status!=200) {
					alert("Fehler:"+req.status); 
				} else {
					//schreibe die antwort in den div container mit der id content 
					document.getElementById(paramDivName).style.backgroundColor = "";
					document.getElementById(paramDivName).innerHTML = req.responseText;
				}
				break;
				
				default:
				return false;
				break;     
			}
		};
	}
	
	function embedFlash (file, width, height, id, urlStart) {
		document.write('<object classid = "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width = "'+width+'" height = "'+height+'" codebase = "'+urlStart+'download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" id = "object'+id+'" align = "middle">');
			document.write('<param name = "allowScriptAccess" value = "sameDomain" />');
			document.write('<param name = "allowFullScreen" value = "false" />');
			document.write('<param name = "movie" value = "'+urlStart+file+'" />');
			document.write('<param name = "quality" value = "high" />');
			document.write('<param name = "bgcolor" value = "#ffffff" />');
			document.write('<embed src = "'+urlStart+file+'"');
						document.write('width = "'+width+'" height = "'+height+'"');
						document.write('quality = "high" bgcolor = "#ffffff" name = "'+id+'" align = "middle"');
						document.write('allowScriptAccess = "sameDomain" allowFullScreen = "false"'); 
						document.write('type = "application/x-shockwave-flash"');
						document.write('pluginspage = "http://www.macromedia.com/go/getflashplayer" />');
		document.write('</object>');
	}
	
////////////////////////////////////////////////////////////////
//
// AkquiseSoft; Marcin; 1-April-2009
//
////////////////////////////////////////////////////////////////
//z.B. Durch Anklicken von Radio-Button mit ID a wird das DIV-Feld mit ID b sichtbar.
function if_checked(a,b) {
	if (document.getElementById(a).checked == true) {
		document.getElementById(b).style.display = "block";
	} else {
		document.getElementById(b).style.display = "none";
	}
}

function toggle_hidden(a) {<!-- MC: Ubergabe von DIV ID-Tag; z.B. unternehmensart -->
	
	if (document.getElementById(a).style.display == "block") {
	document.getElementById(a).style.display = "none";
	document.getElementById('li_'+a).style.listStyleImage = "url('/layout/design/img/arrow.jpg')";
	}  else if (document.getElementById(a).style.display == "inherit") {
	alert('Die Liste kann nicht zusammengeklappt werden, weil sie einen Inhalt hat.');
	} else {
	document.getElementById(a).style.display = "block";
	document.getElementById('li_'+a).style.listStyleImage = "url('/layout/design/img/arrow_down.jpg')";
	}
	
}

//I built a function that may be of some help to you. It works with both TR and table groupings (TBODY). If no second argument is passed to it it simply tries to reverse it's current state (so if it's hidden it will show it, if it's visible it will hide it). If the second argument is specified as TRUE it will show it, if it's specified as FALSE it will hide it. Pretty straight-forward, seems to work in both Internet Explorer and Firefox well.
function ToggleTableRow ( id ) { var obj = document.getElementById(id); var state = (arguments.length >= 2 && typeof(arguments[1]) == "boolean" ? arguments[1] : (obj.style.display.length && obj.style.display.toLowerCase() != "none" ? false : true)); if (obj) obj.style.display = (state ? (navigator.appName.indexOf("Microsoft") >= 0 ? "block" : (obj.nodeName && obj.nodeName.toLowerCase() == "tbody" ? "table-row-group" : "table-row")) : "none"); }

//	MC: Wird ausgefuhrt bei jedem Klick auf ein Checkbox (mit 2 Spalten);
//  Erlaubt die Wahl von ENTWEDER einem ODER anderem CB.
function beide_gleichzeitig(js_id) { //f.e. xxxUnternehmensart_27 nicht_xxxUnternehmensart_27
//Wenn 1 Spalte geklickt: Zugang zur zweiten durch 'nicht_'+js_id
//Wenn 2 Spalte geklickt: Zugang zur ersten durch js_id.substr(6)
	if (js_id.substr(0,6) == "nicht_") { //Nein-Spalte ist gewahlt
		if ((document.getElementById(js_id).checked == true) && (document.getElementById(js_id.substr(6)).checked == true))
			document.getElementById(js_id.substr(6)).checked = false;
	} else { //Ja-Spalte ist gewahlt
		if ((document.getElementById(js_id).checked == true) && (document.getElementById('nicht_'+js_id).checked == true))
			document.getElementById('nicht_'+js_id).checked = false;		
	}
}
//MC: Wenn ale Checkbox einer Kategorie deselected, dann kann Kommunikat mehr..
function deselected_them_all(a,b,c) { //f.e. deselected_them_all(this.id, 'xxxUnternehmensart_', 'nicht_xxxUnternehmensart_');
	document.getElementById(a).style.display = "block"; //Default: Kann zusammengeklappt werden.
	for (var i=0; i<50; i++) { //Keine Kategorie besitzt mehr als 50 Felder (TODO)
		if ((document.getElementById(b+i).checked == true) || (document.getElementById(c+i).checked == true)) {
			document.getElementById(a).style.display = "inherit"; //Falls zumindest ein Checkbox angekreuzt, dann gibt's Kommunikat beim Versuch zu schliessen
		}
		
		
	}
}

//MC: Wenn ale Checkbox einer Kategorie deselected, dann kann Kommunikat mehr..
function deselected_them(a,b) { //f.e. deselected_them_all(this.id, 'xxxUnternehmensart_', 'nicht_xxxUnternehmensart_');
	document.getElementById(a).style.display = "block"; //Default: Kann zusammengeklappt werden.
	for (var i=31; i>0; i--) { //IDs-Reihenfolge ist umgedreht (id_31, id_30, .. , id_4)
		if (document.getElementById(b+i).checked == true) {
			document.getElementById(a).style.display = "inherit"; //Falls zumindest ein Checkbox angekreuzt, dann gibt's Kommunikat beim Versuch zu schliessen
		}
		
		
	}
}

//PRELOADER: TODO: PRELOAD THE IMAGE ITSELF AT THE BEGINNING OF THE DOC
//<img src="/layout/design/img/preloader.gif" style="display:none">

//PRELOADER: NORMAL: ENTIRE PAGE: THE HEAD-PART OF THE DOC:
/*
<script type="text/javascript" src="/includes/javascripts/jquery.js"></script>
<?php 
if ($_SERVER['PHP_SELF'] == "/verwaltung/akquisesoft/auswahl_herunterladen.php") {
?>
<script type="text/javascript" src="/includes/javascripts/preLoadingMessage.js"></script>
<?php
}
?>
*/

//PRELOADER: EXAMPLE CODE: POPUP; PASTE AFTER INITIAL MYPOPUP()
//windowPopup.document.write('<div style=&quot; 	position: absolute;left: 50%;top: 50%;margin-top: -66px;margin-left: -150px;&quot;><img src=&quot;/layout/design/img/preloader_new.gif&quot; /></div><span style=&quot;position: absolute; left: 50%; top: 50%; font-family: Arial;margin-top: -15px;margin-left: -76px;&quot;>Seite wird geladen..</span>');mypopup('km_klicks_uebersicht.php?xxxId=<?=$objAnzeige->row["id"]?>',600,500,1);
	
//PRELOADER: EXAMPLE CODE: FRAMESET: PASTE IN THE ONCLICK PROPERTY OF <A HREF> LINK-FRAMESET-PAGE (NOT DESTINATION-FRAMESET-PAGE)
//parent.frames['inhalt'].document.write('<div style=&quot; 	position: absolute;left: 50%;top: 50%;margin-top: -66px;margin-left: -150px;z-index:6;&quot;><img src=&quot;/layout/design/img/preloader_new.gif&quot; /></div><div style=&quot; position: absolute; font-family: Arial;left: 50%;top: 50%;overflow: hidden;margin-top: -15px;margin-left: -76px;z-index:6;&quot;>Seite wird geladen..</div>');

/**
 * Copyright (c) 2007, Carl S. Yestrau
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *     * Redistributions of source code must retain the above copyright
 *       notice, this list of conditions and the following disclaimer.
 *     * Redistributions in binary form must reproduce the above copyright
 *       notice, this list of conditions and the following disclaimer in the
 *       documentation and/or other materials provided with the distribution.
 *     * Neither the name of Feature Blend nor the
 *       names of its contributors may be used to endorse or promote products
 *       derived from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY Carl S. Yestrau ''AS IS'' AND ANY
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL Carl S. Yestrau BE LIABLE FOR ANY
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 */
function FlashDetectBase(options){
	var self = this;
	var _release = "1.0";
	var options = options || {};
	self.installed = false;
	self.major = -1;
	self.minor = -1;
	self.revision = -1;
	self.revisionStr = "";
	self.activeXVersion = "";
	var activeXDetectRules = options.activeXDetectRules || [
		{
			"name":"ShockwaveFlash.ShockwaveFlash.7",
			"version":function(obj){return getActiveXVersion(obj);}
		},
		{
			"name":"ShockwaveFlash.ShockwaveFlash.6",
			"version":function(obj){
//				var version = "6,-1,-1,-1";
				var version = "6,0,21";
				try{
					obj.AllowScriptAccess = "always";
					version = getActiveXVersion(obj);
				}catch(err){}
				return version;
			}
		},
		{
			"name":"ShockwaveFlash.ShockwaveFlash",
			"version":function(obj){return getActiveXVersion(obj);}
		}
	];
	var getActiveXVersion = function(activeXObj){
		var version = -1;
		try{
			version = activeXObj.GetVariable("$version");
		}catch(err){}
		return version;
	}
	var getActiveXObject = function(name){
		var obj = -1;
		try{
			obj = new ActiveXObject(name);
		}catch(err){}
		return obj;
	}
	var parseActiveXVersion = function(str){
		var versionArray = str.split(",");
		return {
			"major":parseInt(versionArray[0].split(" ")[1]),
			"minor":parseInt(versionArray[1]),
			"revision":parseInt(versionArray[2]),
			"revisionStr":versionArray[2]
		};
	}
	var parseRevisionStrToInt = function(str){
		return parseInt(str.replace(/[a-zA-Z]/g,"")) || self.revision;
	}
	self.majorAtLeast = function(version){
		return self.major >= version;
	}
	self.DetectBase = function(){
		if(navigator.plugins && navigator.plugins.length>0){
			var type = 'application/x-shockwave-flash';
			var mimeTypes = navigator.mimeTypes;
			if(mimeTypes && mimeTypes[type] && mimeTypes[type].enabledPlugin && mimeTypes[type].enabledPlugin.description){
				var desc = mimeTypes[type].enabledPlugin.description;
				var descParts = desc.split(' ');
				var majorMinor = descParts[2].split('.');
				self.major = parseInt(majorMinor[0]);
				self.minor = parseInt(majorMinor[1]); 
				self.revisionStr = descParts[3];
				self.revision = parseRevisionStrToInt(self.revisionStr);
				self.installed = true;
			}
		}else if(navigator.appVersion.indexOf("Mac")==-1 && window.execScript){
			var version = -1;
			for(var i=0; i<activeXDetectRules.length && version==-1; i++){
				var obj = getActiveXObject(activeXDetectRules[i].name);
				if(typeof obj == "object"){
					self.installed = true;
					version = activeXDetectRules[i].version(obj);
					if(version!=-1){
						var versionObj = parseActiveXVersion(version);
						self.major = versionObj.major;
						self.minor = versionObj.minor; 
						self.revision = versionObj.revision;
						self.revisionStr = versionObj.revisionStr;
						self.activeXVersion = version;
					}
				}
			}
		}
	}();
}
var FlashDetect = new FlashDetectBase();

/******************************************************************************************
 ******************************************************************************************
 *Die Funktion expandWindow vergrößert bzw. verkleinert ein Objekt auf eine angegebene Größe.
 *
 *Variablen:
 *id ... ist die Id des Objektes des Größe verändert werden soll  
 *width ... ist die Breite in px die zu der aktuellen Breite des Objektes hinzugefügt werden
 *					HINWEIS: diese Größe ist beim Verkleinern natürlich negativ
 *height ... gleiche wie "width" nur bezogen auf die Höhe des Objektes
 *xDirection ... Angabe der horizontalern Richtung in die das Objekt erweitert werden soll
 *							 l ... left
 *							 r ... right  
 *yDirection ... Angabe der vertikalen Richtung in die das Objekt verändert werden soll
 *							 t ... top
 *							 b ... bottom
 *!!!Wichtig: Beim verkleinern wird immer die Richtung angegebne in der das Objekt zuvor vergrößert wurde.
 *step ... Angabe um wieviel Pixel das Objekt in jedem Zeitschritt verändert werden soll
 *speed ... Abstand der einzelnen Schritte in ms
 ******************************************************************************************
 ******************************************************************************************  
 */    

function expandWindow(id, width, height, xDirection, yDirection, step, speed) {
	
	/**********************************check parameters****************************************/
	if (typeof(width) != 'number' || typeof(height) != 'number' 
			|| typeof(step) != 'number' || typeof(speed) != 'number') {
			
			alert('expandWindow(): Einer der der numerischen Parameter wurde nicht als Zahl übergeben');
			return;
	}
		
	switch (xDirection) {
		case 'l': xDirection = -1; break;
		case 'r': xDirection = 0; break;
		default: alert('expandWindow(): Parameter xDirection muss "l" oder "r" sein!'); return; break;		
	}
	
	switch (yDirection) {
		case 't': yDirection = -1; break;
		case 'b': yDirection = 0; break;
		default: alert('expandWindow(): Parameter yDirection muss "t" oder "b" sein!'); return; break;		
	}

	if (step == '') step = 1;
	if (speed == '') speed = 10;
	
	/***************************************set variables**************************************/
	obj = document.getElementById(id);
	endSizeWidth = parseInt(obj.style.width) + width;
	endSizeHeight = parseInt(obj.style.height) + height;
	
	/*************************************call functions**************************************/
	if (endSizeWidth != parseInt(obj.style.width) && endSizeWidth > 50) {
		activWidthInterval = window.setInterval('doExpandWidth(obj, endSizeWidth, '+xDirection+', '+step+'); if (parseInt(obj.style.width) == endSizeWidth) {window.clearInterval(activWidthInterval);}', speed);
	}
	
	if (endSizeHeight != parseInt(obj.style.height) && endSizeHeight > 50) {
		activHeightInterval = window.setInterval('doExpandHeight(obj, endSizeHeight, '+yDirection+', '+step+'); if (parseInt(obj.style.height) == endSizeHeight) {window.clearInterval(activHeightInterval);}', speed);
	}
	
}

/******************************* verändert die breite eines Objektes ************************/

function doExpandWidth(obj, endSizeWidth, xDirection, step) {
	
	if (parseInt(obj.style.width) < endSizeWidth)	factor = 1;
	else factor = -1;
	
	newWidth = parseInt(obj.style.width) + (factor * step);
	newLeftPos = parseInt(obj.style.left) + (1 * xDirection * factor * step);
	
	obj.style.width = newWidth + 'px';
	obj.style.left = newLeftPos + 'px';
}

/******************************* verändert die Höhe eines Objektes ************************/

function doExpandHeight(obj, endSizeHeight, yDirection, step) {
	
	if (parseInt(obj.style.height) < endSizeHeight)	factor = 1;
	else factor = -1;
	
	newHeight = parseInt(obj.style.height) + (factor * step);
	newTopPos = parseInt(obj.style.top) + (1 * yDirection * factor * step);
	
	obj.style.height = newHeight + 'px';
	obj.style.top = newTopPos + 'px';
}

/********Seite zu den Favoriten hinzufügen************/
function addToFavorites(pageTitle) {
	var strHotkey = 'Strg + D';
	
	if (document.all) {
		window.external.AddFavorite( document.URL, pageTitle); 
	} else {
		alert('Druecken Sie '+strHotkey+' um die Seite zu Ihren Favoriten hinzuzufuegen');
	}
}

/******** Zeigt einen Preloader, bevor die Seite geladen wird ************/
// Created by: Simon Willison | http://simon.incutio.com/
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}

function showPreloader(paramFrame,newLocation) {

	MM_preloadImages("/layout/design/img/preloader_new.gif");
	if(typeof paramFrame == "undefined") {
		document.write('<div id="loading" style="position: absolute; width: 100%; top: 50%;margin-top: -66px;z-index:6;" align="center"><img src="/layout/design/img/preloader_new.gif" /><div style="position: absolute; font-family: Arial;width: 100%; left: 0;top: 50%;overflow: hidden;margin-top: -15px;z-index:6; font-size: 12px; font-weight: 900; text-align: center;">&nbsp;&nbsp;&nbsp;Bitte warten...</div></div>');
	} else {
		parent.frames[paramFrame].document.write('<div id="loading" style="position: absolute; width: 100%; top: 50%;margin-top: -66px;z-index:6;" align="center"><img src="/layout/design/img/preloader_new.gif" /><div style="position: absolute; font-family: Arial;width: 100%; left: 0;top: 50%;overflow: hidden;margin-top: -15px;z-index:6; font-size: 12px; font-weight: 900; text-align: center;">&nbsp;&nbsp;&nbsp;Bitte warten...</div></div>');
	}
	if(typeof newLocation != "undefined") {
		window.location.href=newLocation;
	}
	addLoadEvent(function() {
		document.getElementById("loading").style.display="none";
	});

}
//Marcin; Auswahl_form.php - Alle pos./neg. checkbox markieren.
        function cb2spalten2(id2,f2,cb,rtn) { //'a' == this; first *9* chars of the Checkbox' ID
            for (var i = 1; i < f2.elements.length; i++) {
                var e = f2.elements[i]; //handle for each form element
				if(id2 == (e.name).substr(0,id2.length)) //current element compared against each element's name (shortened if necessary)
					e.checked = cb;
            }
			return rtn;
        } 
		function cb2spalten(id,f,spalten) {		
		if(typeof rtn == "undefined") rtn = 0; //default: pos. aktivieren
			switch(rtn) {
			case 1:
			//alert('case 1');
				if(typeof spalten == "undefined") { //default: 2 spalten
					rtn = cb2spalten2(id,f,false,2);
					return 'Neg. aktivieren';
				} else {
					rtn = cb2spalten2(id,f,false,0);
					return 'Pos. aktivieren';
				}
				break;
			case 2:
			//alert('case 2');
				rtn = cb2spalten2('nicht_'+id,f,true,3);
				return 'Neg. aktivieren';
				break;
			case 3:
			//alert('case 3');
				rtn = cb2spalten2('nicht_'+id,f,false,0);
				return 'Pos. aktivieren';
				break;				
			case 0:
			//alert('case 0');
				rtn = cb2spalten2(id,f,true,1);
				return 'Pos. deaktivieren';
				break;	
			}
		}
