    
    
  
function getNewRequest(replacer){
  request = self.location.href;
  temp = /page.html/;  
  newRequest = request.replace(temp,replacer);
  if (request == newRequest) {
      newRequest = request + "/deutsch/" + replacer;
  }
  return newRequest;
}

	
 function MM_openBrWindow(theURL,winName,features) {
        winName = winName.replace(/[^A-Z,0-9]/gi, '');
  		x = window.open(theURL,winName,features);
  		x.focus();
	}
 

	
  
// Fenster öffnen für internen Link mit URL encoding (mozi+ie)
function MM_openBrWindowForInternalLink(theURL,winName,features) {
urlTemp = theURL.split("?");
urlTempFirstPart = escape(unescape(urlTemp[0]));
theNewURL = urlTempFirstPart+"?"+urlTemp[1];
x = window.open(theNewURL,winName,features);
x.focus();
}

	
  
	zoomStatus=0;
	function zoom(){
	        if (!document.all){
	        alert("Leider steht diese Funktion nur Benutzern des Internet Explorers zur Verfügung.");
	        return;
	        }
	        if (zoomStatus==0){
	                document.all.tags('body')[0].style.setAttribute('zoom','125%','false');
	                zoomStatus=1;
	        }
	        else{
	                document.all.tags('body')[0].style.setAttribute('zoom','100%','false');
	                zoomStatus=0;
	        }

	}


	
  
    function mailTo(){
        var myUrl = escape(parent.location.href);
        parent.location.href="mailto:Ihre%20Kontaktadresse?subject=Link-Tipp&body=Dieser%20Link%20wird%20Ihnen%20empfohlen:%20%20" + myUrl;
}

	
  
function printView(){
        printRequest = getNewRequest("print.html");
        MM_openBrWindow(printRequest,'druckAnsicht','scrollbars=yes,width=600,height=420');
}


	
  
function pdf(){
newRequest = getNewRequest ('content.pdf');
MM_openBrWindow(newRequest,'PDF','scrollbars=yes,width=800,height=600');
}

	
  
function favorite(label){
if (label==undefined) label='';
  if (!document.all){
  alert("Bitte verwenden Sie die Tastenkombination STRG+D.");
  return;
  }
  var title = self.document.all.tags("title")[0].innerText;
  getNewRequest('index_1.html');
  window.external.AddFavorite(newRequest,label+title);
}

	
function fastSearch (path) {
    //if wenn kein Suchbegriff, dann keine Suche
    if (document.fastsearch.query.value=="") {
       return;
    }
    else {
        // Suchstring basteln
        document.fastsearch.action ="/deutsch/"+path+"?conquest-searchquery-is-query=true&format=long&conquest-searchquery="
            + "metadata:(" + document.fastsearch.query.value + ")^4 "
            + "url:(" + document.fastsearch.query.value + ")^3 "
            + "title:(" + document.fastsearch.query.value + ")^2 "
            + "contents:(" + document.fastsearch.query.value +")";
       // abschickern
       document.fastsearch.submit();
    }
}


	
         
	
function checkOnSearch(unitId) {
    
    //if wenn kein Suchbegriff, dann keine Suche
    if (document.search.words.value=="") {
        return;
    } else {
        // Suchstring basteln
        document.search.action =location.pathname + "?format=long" +
            "&conquest-searchquery=url:(" + document.search.words.value + "*)^3 title:(" +
            document.search.words.value + "*)^2 contents:(" + document.search.words.value +"*)"; 
                         
        document.search.action += " AND template:training" ;
        if (unitId) {
            document.search.action += " AND unitId:" + unitId;
        }
        
        //alert(document.search.action);
        
        // abschickern
        document.search.submit();
    }
}


	
 
    
    function copyContent (id1, id2){
        objSrc = document.getElementById(id2);
        objDst = document.getElementById(id1);
            
        objDst.innerHTML = objSrc.innerHTML;    
    }

    // -- -- -- -- -- -- --

	function closeLayerById(layerId) {
    	extraLayer = document.getElementById(layerId);
    	closeLayerObj(extraLayer);
	}

	function closeLayerObj(layer) {		
        with(layer.style) {
            display="none";
        }		
	}

    function viewLayerObj(layer){
        with(layer.style) {
            display="block";
            visibility="visible";
            //position="absolute";                        
        }
    }
    
    var switchOff = 0;

	//================ Methoden fuer den rechts aufpoppenden Layer
	//Methoden fuer Time Delay
	function noShowExtra(layerId){
         switchOff = window.setTimeout("closeLayerById('"+layerId+"')",750);
	}

	function clearSwitchOff(){
         window.clearTimeout(switchOff);		         
	}
	//Ende Methoden Time Delay
   	
    function showExtra(layerId){
        extraLayer = document.getElementById(layerId);
        closeLayerObj(extraLayer);
        if (switchOff!=0) clearSwitchOff();        
        viewLayerObj(extraLayer);
    }



	
  
function mouseover(imageName,newImageSrc){
eval("oldImageSrc = document."+imageName+".src;");
eval("document."+imageName+".src = '"+newImageSrc+"';");
}

	


//============Funktion fuer Sitemap=============================
function showNoShow(layerId){
 x = document.getElementById('sitemap'+layerId).style.display;
 picName = "image_"+layerId;
 plus = new Image(); plus.src = "/httpd/img/sitemap_plus.gif";
 down = new Image(); down.src = "/httpd/img/sitemap_down.gif";
 if (x =='none'){
         if (document.getElementById('sitemap'+layerId).hasChildNodes() == false) {
           reloadSitemap(layerId);
         }
         document.getElementById('sitemap'+layerId).style.display='block';
         eval("document."+picName+".src = down.src");
 }
 else {
         document.getElementById('sitemap'+layerId).style.display='none';
         eval("document."+picName+".src = plus.src");
 }
}

//============ Funktionen fuer das dynamische Nachladen ===========
function reloadSitemap(layerId){
         if (document.getElementById('sitemap'+layerId).innerHTML==''){
                  reference = '/sitemapReloader/'+layerId+'/part.html';
                  window.reloader.location.href = reference;
         }
         else return;
}

function changeContent(targetLayer){
         textOrig = self.reloader.document.getElementById('reloadLayer').innerHTML;
         if (textOrig.indexOf('<!--')!=-1){
            text = textOrig.substring(4,textOrig.length-3);
         }
         else
         text = textOrig;
         document.getElementById('sitemap'+targetLayer).innerHTML = text;
}
//Nachladen mit navmodule

function reloadNavresource(layerId,language){
         if (document.getElementById('sitemap'+layerId).innerHTML==''){
                  //reference = '/sitemapReloader/'+layerId+'/part.html';
                  reference = '/navresource-'+layerId+'/'+language+'//sitemapPart.html';                      
                  window.reloader.location.href = reference;
         }
         else return;
}




	

    function toggle(id) {
      if (document.getElementById(id).style.display == "none") {
        document.getElementById(id).style.display="";
      } else {
        document.getElementById(id).style.display="none";
      }
    }


	
        
            function toggleBaby(id,headId) {
              if (document.getElementById(id).style.display == "none") {
                document.getElementById(id).style.display="";
                document.getElementById(headId).className = "babygroup-headline-high";
              } else {
                document.getElementById(id).style.display="none";
                document.getElementById(headId).className = "babygroup-headline-low";
              }
            }
        
    
	
	
  
function mouseout(imageName){
eval("document."+imageName+".src = '"+oldImageSrc+"';");
}

	
         
            function useridGenerator() {
                var length = '8';
                var chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
                var pass = "";
                for(x=0;x<length;x++) {
                    i = Math.floor(Math.random() * 62);
                    pass += chars.charAt(i);
                }
                return pass;
            }
         
    
	
        
        function fastSearch2 (path) {
                var siteId = 61;
                var searchItem = document.fastsearch.cqWebSearchQuery.value;
                searchItem = encodeURI(searchItem); 
                //alert(searchItem);
                //searchItem = searchItem.replace(' ', '%20');

                //if wenn kein Suchbegriff, dann keine Suche
                if (document.fastsearch.cqWebSearchQuery.value=='' || document.fastsearch.cqWebSearchQuery.value=='Suchbegriff eingeben' || document.fastsearch.cqWebSearchQuery.value=='Full Text Search') {
                   return;
                }
                else {
                    document.fastsearch.action = "/deutsch/"+path+"?gg="+searchItem+"&amp;cqWebSearchQuery=metadata:(" + searchItem + ")^4 url:(" + searchItem + ")^3 title:(" + searchItem + ")^2 contents:(" + searchItem + ")) OR (documentName:(" + searchItem + ")^3 title:(" + searchItem + ")^2 contents:(" + searchItem + "))";
                    //alert(document.fastsearch.action);
                    document.fastsearch.gg.value = searchItem;
                   document.fastsearch.submit();
                }
            }
            
            function checkCQSearch(link, param) {
                var exp = new RegExp("(^.+\\?)(.*)("+param+"=)(\\w*)(&?.*)", 'i');
                var replace = encodeURI(link.href.match(exp)[4]);
                link.href = link.href.replace(exp, "$1$2$3"+replace+"$5");
            }
            
    
