<!--

var __flashvars = ''; // wird z.B. für Seitentyp4 benötigt
var __itemCount = 0; // wird z.B. für Seitentyp4 benötigt

// Hier kommen alle Projekt individuellen JS-Funktionen rein.

function individuell()
{	
}

// Spezielle DHTML NaviEffekte, Bsp: O2
// muß dann nach der mnav im Navi Header included werden
function mnavHandler(menu,level) {
}

// Wenn man über das CMS links pflegt machen anführungszeichen probleme
function layershowhide (layID, showhide) {
	if (showhide==0) what='hidden';
	if (showhide==1) what='visible';
	layShowHide('Layer'+layID,what);
}

function openSearchWindow (url){
	openFreeWindow(
		url,			//url
		'search',	//name
		null,			//mbar
		null,			//sta
		null,			//loc
		'yes',		//tbar
		null,			//res
		1,				//scr
		550,			//width
		520,			//height
		null,			//left
		null			//top
	);
}

function goSearchResult(url) {
	if(top.window.opener) {
		top.window.opener.location.href = url;
		top.window.opener.focus();
	} else {
		window.open(url);
	}
}

function matchHeight(){ 
     var divs,contDivs,maxHeight,divHeight,d; 
     // get all <div> elements in the document 
     divs=document.getElementsByTagName('div'); 
     contDivs=[]; 
     // initialize maximum height value 
     maxHeight=0; 

     // iterate over all <div> elements in the document 

     for(var i=0;i<divs.length;i++){ 
          // make collection with <div> elements with class attribute 'container' 
          if(/\bContainer\b/.test(divs[i].className))
          { 
                d=divs[i]; 
                contDivs[contDivs.length]=d; 

                // determine height for <div> element 
                if(d.offsetHeight){ 
                     divHeight=d.offsetHeight; 
                } 

                else if(d.style.pixelHeight){ 
                     divHeight=d.style.pixelHeight; 
                } 

                // calculate maximum height 
                maxHeight=Math.max(maxHeight,divHeight); 
          } 

     } 

     // assign maximum height value to all of container <div> elements 
	minHeight=600;
     for(var i=0;i<contDivs.length;i++){ 
		  if (maxHeight<minHeight) maxHeight=minHeight; 
		  
          contDivs[i].style.height=maxHeight; 

     } 

} 

// execute function when page loads 

/*
window.onload=function(){ 

     if(document.getElementsByTagName){ 

          matchHeight(); 

     } 
}

*/
     
function getSearchWin (languageid, dbcsessionid, path, modSearch) {
	if (modSearch != null) {
		f = document.forms.module_search;
	} else {
		f = document.forms.search;
	}
	needle = f.needle.value;
	rule = f.rule.value;
	
	var ar=f.needle.value.split(" ");
	var nd="";
	var con="";
		
	// Verbindung der Suchwörter ermitteln
	if (f.rule.value) con=f.rule.value;
	if (!con) con="OR";
	
	// Wörter mit Verbindungswort verbinden
	for (i=0; i<ar.length; i++)
	{
		if ((i+1)<ar.length) nd+="'"+ar[i]+"' "+con+" ";
		else nd+="'"+ar[i]+"'";
	}
		
	f.searchString.value=nd;
	
	// Bei Mehreren Mandanten IDs hier anpassen wenn in Mandant 2,3,4... gesucht werden soll
	
	url = path + "page.php?ID="+languageid+"&dbc="+dbcsessionid+"&mod=communicate&searchString="+escape(f.searchString.value)+"&mod=communicate&needle="+needle+"&rule="+rule;
	if (modSearch != null) {
		url+= "&"+escape('client[304]')+'=304';
		
	} else {
		url+= "&"+escape('client[1]')+'=1';
		url+= "&"+escape('client[302]')+'=302';
		url+= "&"+escape('client[304]')+'=304';
		url+= "&"+escape('client[305]')+'=305';
		url+= "&"+escape('client[307]')+'=307';
		url+= "&"+escape('client[303]')+'=303';
		url+= "&"+escape('client[398]')+'=398';
		url+= "&"+escape('client[371]')+'=371';
	}
	openSearchWindow(url);
	return false;
}

function jumpTo(flashID, num)
{
	//document.getElementById(flashID).SetVariable( 'jumpTo', num );
	//eval('window.document.' + flashID + '.SetVariable( \'jumpTo\', num )');
	setFlashVar('jumpTo', num, flashID);
	/*
	var movie = getFlash(flashID);
	if (movie) {
		movie.SetVariable( 'jumpTo', num );
	}
	*/
}




function Fensterweite () {
  if (window.innerWidth) {
    return window.innerWidth;
  } else if (document.body && document.body.offsetWidth) {
    return document.body.offsetWidth;
  } else {
    return 0;
  }
}

function neuAufbau (teste) {
  	Weite = Fensterweite();
 		if (Weite<978) { Weite=978; }
		wertleft=((Weite - 1000) / 2)+739;
		wertleft=wertleft+'px';
		// Bitte bei sowas immer überprüfen ob das funktioniert bevor man die Datei schliesst
		//document.getElementById(teste).style.left = wertleft;
		//alert(document.getElementById(teste).id);
  
}



var actionLayer;
var actionTd;

function getWindowWidth() {
	if (self.innerWidth) {
		return self.innerWidth;
	} else if (document.documentElement && document.documentElement.clientWidth) {
		return document.documentElement.clientWidth;
	} else if (document.body) {
		return document.body.clientWidth;
	}
}

function getWindowHeight() {
	if (self.innerHeight) {
		return self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) {
		return document.documentElement.clientHeight;
	} else if (document.body) {
		return document.body.clientHeight;
	}
}

function showActionLayer(itemID) {
  	if (document.getElementById) {
    	actionLayer = document.getElementById('actionLayer' + itemID);
		if (actionLayer) {
			actionTd = document.getElementById('actionTd' + itemID);
			checkActionLayer();
			
			actionLayer.style.visibility = 'visible';
		}
	}
}

function checkActionLayer() {
	if (actionLayer) {
		actionTdTop = getAbsTop(actionTd);
		actionTdLeft = getAbsLeft(actionTd);
		actionLayerHeight = actionLayer.offsetHeight;
		actionLayerWidth = actionLayer.offsetWidth;
		windowWidth = getWindowWidth();
		windowHeight = getWindowHeight();
		if (windowWidth < (actionTdLeft + actionLayerWidth)) {
			actionLayerLeft = windowWidth - actionLayerWidth;
		} else {
			actionLayerLeft = actionTdLeft;
		}
		if (windowHeight < (actionTdTop + actionLayerHeight)) {
			actionLayerTop = windowHeight - actionLayerHeight;
		} else {
			actionLayerTop = actionTdTop;
		}
		actionLayer.style.top = (actionLayerTop - 22);
		actionLayer.style.left = (actionLayerLeft - 1);
	}
}
		
function hideActionLayer(itemID) {
  	if (document.getElementById) {
    	actionLayer = document.getElementById('actionLayer' + itemID);
		if (actionLayer) {
			actionLayer.style.visibility = 'hidden';
		}
	}
}

function onLoadActionLayer() {
	if(typeof(al_itemID) != 'undefined') {
		showActionLayer(al_itemID);
	}
}

window.onscroll = checkActionLayer;



function Ausrichten() {

	if (document.getElementById("Merkebox")) {
  hoehe = document.getElementById("Merkebox").offsetHeight;
  
  document.getElementById("Merkebox").style.top=485-hoehe;
    //alert(document.getElementById("Merkebox").style.top);
    
  }
  

}



//-->
