function checkGMLoad(sType) {
  var sPath = window.location.pathname;
  var gmFolder = "/de/kontakt/lageplan.php";
  if(sPath==gmFolder) {
    if(sType=="load"){
	  load();} 
    else if(sType=="unload"){
      GUnload();}
  }
}


function setRowCSS(id,sHeadRowClass,sRowClass,sAlternateRowClass,sHoverClass){
	var oTbl;
	oTbl = document.getElementById(id);
	var oRow=oTbl.getElementsByTagName('tr');
	var iRowLength = oRow.length;
	for(var i=0;i<iRowLength;i+=1){
		if(i==0){
			oRow[i].className=sHeadRowClass;}
		else{
			if((i%2)==0) { 
				oRow[i].className=sRowClass;
				addEventToObject(oRow[i],'onmouseout',function(){this.className=sRowClass;});	
			}
			else{
			oRow[i].className=sAlternateRowClass;
			addEventToObject(oRow[i],'onmouseout',function(){this.className=sAlternateRowClass;});	
			}
			addEventToObject(oRow[i],'onmouseover',function(){this.className=sHoverClass;});
		}
	}
}
function addEventToObject(obj, evt, func) { 
	var oldhandler = obj[evt]; 
	if(typeof obj[evt] != 'function'){obj[evt] = func;}
	else{obj[evt] = function(){oldhandler();func();}
	} 
} 



function setRowColor(id,sBGColor,sAlternateBGColor,sHoverBGColor){
	var oTbl;
	oTbl = document.getElementById(id);
	var oRow=oTbl.getElementsByTagName('tr');
	var iRowLength = oRow.length;
	for(var i=0;i<iRowLength;i+=1){
		if((i % 2) == 0) { 
			oRow[i].style.backgroundColor=sBGColor;	
			addEventToObject(oRow[i],'onmouseout',function(){this.style.backgroundColor=sBGColor;});	
		}
	else{
		oRow[i].style.backgroundColor=sAlternateBGColor;	
		addEventToObject(oRow[i],'onmouseout',function(){this.style.backgroundColor=sAlternateBGColor;});	
		}
	addEventToObject(oRow[i],'onmouseover',function(){this.style.backgroundColor=sHoverBGColor;});
	}
}
function addEventToObject(obj, evt, func) { 
	var oldhandler = obj[evt]; 
	if(typeof obj[evt] != 'function'){obj[evt] = func;}
	else{obj[evt] = function(){oldhandler();func();}
	} 
} 