<!--
// 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) {
}

function goSearchResult(url) {
	if(top.window.opener) {
		top.window.opener.location.href = url;
		top.window.opener.focus();
	} else {
		window.open(url);
	}
}

function openSearchWindow (url){
	openFreeWindow(url,'search','','','','','','yes',547,520,0,0);
}

function getSearchWin (languageid, dbcsessionid, path, f) {
	if (f == null) {
		var f = document.forms.search;
	}
	var needle = f.needle.value;
	var rule = f.rule.value;
	var ar = f.needle.value.split(" ");
	var clients = f.elements['client\[\]'];
	var nd = '';
	var con = '';
	var url = '';
	
	// Gucken ob von index.php oder von page.php der Aufruf kommt
	lookFor = document.location.href;
	
	if (lookFor.indexOf('?') >= 0) {
		lookForPath = lookFor.substring(0, lookFor.indexOf('?'));
	} else {
		lookForPath = lookFor;
	}
	var lastChar = lookForPath.substring(lookFor.length - 1 , lookFor.length);
	if (lookFor.indexOf('content_manager') == -1 && 
			(lookFor.indexOf('index.php') > 0
			|| lastChar == '/' // direct call to index document, invisible in path
			)
	) {
		url = './content_manager/';
	} 
	
	if (path) {
		url = path;
	}
	
	if (lookFor.indexOf('content_manager') == -1 && lookFor.indexOf('/go/') > -1) {
		if (path) {
			url = path + '/content_manager/';
		} else {
			url = '../../../../content_manager/';
		}
	}	
	
	needle = needle.replace(/%/g, '*');
	if (needle == '*') {
		nd = "'#ANYWORD#'";
	} else {
		// 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;
	
	url += 'page.php';
	url += '?ID=' + languageid;
	url += '&dbc=' + dbcsessionid;
	url += '&mod=communicate';
	url += '&searchString=' + escape(f.searchString.value);
	url += '&mod=communicate';
	url += '&needle=' + needle;
	url += '&rule=' + rule;
	
	if (f.display && f.display.checked) {
		url += '&display=' + f.display.value;
	}
	
	if (clients != undefined && clients.length > 0) {
		for (var i = 0; i < clients.length; i++) {
			if (clients[i].type == 'hidden' || (clients[i].type == 'checkbox' && clients[i].checked)) {
				url += '&client[]=' + clients[i].value;
			}
		}
	}
	
	if (f.target == '_self') {
		location.href = url;
	} else {
		window.document.iamDaSearchWindow = true;
		openSearchWindow(url);
	}
	return false;
}


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(); 

     } 

} 

//-->

