/*******************************************************************************
Copyright (c) 1999 Thomas Brattli (www.bratta.com)

eXperience DHTML coolFrameMenus - Get it at www.bratta.com
Version Beta 1.0
This script can be used freely as long as all copyright messages are
intact. 

All files that goes in the "main" frame must have this file linked to it
(after the body tag!!)
*******************************************************************************/
function makeMenus(){
	if(parent.frmMenu){
		if(parent.frmMenu.oCFMenu){
			if(parent.frmMenu.oCFMenu.frameString2){
				document.write(parent.frmMenu.oCFMenu.frameString)
				if(parent.frmMenu.bw.ns5){
					document.close()
					document.body.innerHTML+=parent.frmMenu.oCFMenu.frameString2
				}else{
					document.write(parent.frmMenu.oCFMenu.frameString2)
					document.close()
				}
				parent.frmMenu.oCFMenu.refresh()
			}
		}
	}
}
function unload(){
	if(parent.frmMenu){
		if(parent.frmMenu.oCFMenu){
			parent.frmMenu.oCFMenu.loaded=0
		}
	}
}
makeMenus()
window.onunload=unload;





/*********************************************************************
Function to find a spesified frame - loops all frames 3 levels deep 
(should be enough in most cases, I was to lazy to make a proper one)
*********************************************************************/
function cm_findFrame(frameName){
	obj=parent; var frameObj=0;
	for(i=0;i<obj.frames.length;i++){
		if(obj.frames[i].name==frameName){frameObj=obj.frames[i]; break;}; ln=obj.frames[i].frames.length
		for(j=0;j<ln;j++){
			if(obj.frames[i].frames[j].name==frameName){frameObj=obj.frames[i].frames[j];  break}; ln2=obj.frames[i].frames[j].frames.length
			for(a=0;a<ln2;a++){
				if(obj.frames[i].frames[j].frames[a].name==frameName){frameObj=obj.frames[i].frames[j].frames[a]; break}
			}
		}
	}return frameObj
}


function cm_bwcheck(){
		this.ver=navigator.appVersion
	this.agent=navigator.userAgent.toLowerCase()
	this.dom=document.getElementById?1:0
	this.ns4=(!this.dom && document.layers)?1:0;	this.op=window.opera 
	this.moz=(this.agent.indexOf("gecko")>-1 || window.sidebar)
	this.ie=this.agent.indexOf("msie")>-1 && !this.op
	if(this.op){
		this.op5=(this.agent.indexOf("opera 5")>-1 || this.agent.indexOf("opera/5")>-1)
		this.op6=(this.agent.indexOf("opera 6")>-1 || this.agent.indexOf("opera/6")>-1)
		this.op7=this.dom&&!this.op5&&!this.op6 //So all higher opera versions will use it
	}else if(this.moz) this.ns6 = 1
	else if(this.ie){
		this.ie4 = !this.dom && document.all
  	this.ie5 = (this.agent.indexOf("msie 5")>-1)
  	this.ie55 = (this.ie5 && this.agent.indexOf("msie 5.5")>-1)
  	this.ie6 = this.dom && !this.ie4 && !this.ie5 && ! this.ie55
	}
	this.mac=(this.agent.indexOf("mac")>-1)
	this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.op5 || this.op6 || this.op7)
  this.usedom= this.ns6||this.op7//Use dom creation
  this.reuse = this.ie||this.op7||this.usedom //Reuse layers
  this.px=this.dom&&!this.op5?"px":""
	return this
}
var bw=new cm_bwcheck()






// Search-Suggestion Code

var artikelsuche=cm_findFrame("artikelsuche");
var leftFrame=cm_findFrame("frmMenu1"); 
var contentFrame=cm_findFrame("ausgabe");
if (artikelsuche){leftFrame=artikelsuche;}




function closenowSearchSuggestion() {
 if (leftFrame.aktiv) {
       window.clearTimeout(leftFrame.aktiv);  
  }
  leftFrame.closeSearchSuggestion();
}

function frameFireCloseSearchSuggestion(e) { 
  if (!e)  e = window.event;
  if (e!=null)  {
     var tg = (window.event) ? e.srcElement : e.target;
     if (tg==null) {return;}
     if (tg.nodeName == 'TBODY' || tg.nodeName == 'TABLE' || tg.nodeName=='TD' || tg.nodeName=='A')  {
       leftFrame.dontCloseSearchSuggestion();return;
     }
  }
  if (leftFrame.aktiv) {
       window.clearTimeout(leftFrame.aktiv);  
  }
 // leftFrame.aktiv=window.setTimeout("leftFrame.closeSearchSuggestion()",8000);
}


if (bw.usedom) {
  var div=document.createElement("DIV"); div.id="searchSuggestionWindow"; 
  div.innerHTML='';
  div.style.position='absolute';
  div.style.height=520;
  div.style.width=580; 
  div.onmouseout=frameFireCloseSearchSuggestion;
  div.style.overflow='visible';
  div.style.visibility='hidden';
  div.style.zindex=-1;
//  div.style.left=0;div.style.top=0; div.style.visibility='visible';
// div.style.backgroundColor='#f00';
  contentFrame.document.body.appendChild(div);




//  var div=document.createElement("DIV"); div.id="dark"; 
//  div.style.opacity=0.0;
// //  div.filters.alpha.opacity=0
//  div.style.backgroundColor='#000';
//  div.style.left='0px';
//  div.style.top='0px';
//  div.style.width='0px';
//  div.style.height='0px';
//  div.style.zindex=1;
//  div.style.position='absolute';
//  div.style.display='none';
//  contentFrame.document.body.appendChild(div);

} else {
  var dstr='<div id="searchSuggestionWindow" onMouseOut="frameFireCloseSearchSuggestion()" style="height:720px;width:560px;visibility:hidden;left:0px;top:0px;position:absolute;overlow:auto;z-index:3"></div>';
  document.write(dstr);
  var dstr='<div id="dark" style="background-color:#000;opacity:0.0;filter:alpha(opacity=00);left:0px;top:0px;width:0px;height:0px;z-index:1;position:absolute;display:none"></div>';
  document.write(dstr);

 
}
