/* Browser-Abfrage*/
var ie4 = false;
var ns4 = ( document.layers ) ? true:false; //fuer Netscape Navigator 4xx
if ( ( navigator.appName == "Microsoft Internet Explorer" ) && 
( navigator.appVersion.indexOf( "MSIE 4" ) != -1 ) ) ie4 = true; //Internet Explorer 4 ( u 5 ) kompatibel
var DOMCmp	= ( document.getElementById ) ? true:false; //Means DOM 1 & 2 compatible ( NS6 && IE5 )

/* Diese Werte werden automatisch gesetzt */	
var XPos = 0;
var YPos = 0;
var toHide	= null;
var toShow	= null;
var timerX	= null;
var timerMS	= null;
/* 
showMenu( menuName, id der Zelle von wo aus aufgerufen wird );
*/
function showMenu( objName, offsetLayer ) {
	hideAllMenus( );
    
	if ( ie4 ) {
		XPos = document.all[ offsetLayer ].offsetLeft;
		YPos = eval( document.all[ offsetLayer ].offsetTop + document.all[ offsetLayer ].offsetHeight );			
    
	} else if ( DOMCmp ) { 
		XPos = document.getElementById( offsetLayer ).offsetLeft;
		YPos = eval( document.getElementById( offsetLayer ).offsetTop + document.getElementById( offsetLayer ).offsetHeight );
	}			
	YPos += 1;	
	toShow = objName;
	timerMS = window.setTimeout( "show()", 100);
}	

function show( ) {
	window.clearTimeout( timerMS );
	toShow.setTopLeft( YPos, XPos );
	toShow.adjust( );		
	toShow.show( );
}	

function hide( objName ) {
	if ( DOMCmp ) {
		toHide = objName;
		timerX = window.setTimeout( "hideAway()", 200 );
		objName.setExTimer( timerX );
		if ( document.getElementById( "qtObj" ) != null ) {
			document.getElementById( "qtObj" ).style.visibility = "visible";
		}
	}	
}

function hideAway( ) /*distribution method*/ {
	window.clearTimeout( timerX );
	toHide.hide( );
}

function hideAllMenus( ) {
	for( var j=0; j < astrAllMenus.length; j++ )
		astrAllMenus[ j ].hide( );
}	

if ( DOMCmp ) {
	document.onclick = hideAllMenus;
}	

function ShowImage(imgPath, imgName, imgDesc)
{  
  var imgs = document.images;
  for (var i=0;i< imgs.length;i++)
  {
    if (imgs[i].name == imgName)
    {
      imgs[i].src = imgPath;
    }
  }  
  var obj = null;;
  if (document.getElementById)
  {
    obj = document.getElementById('changingText');
  }
  else if (document.all)
  {
	  obj = document.all['changingText'];
  }
  else if (document.layers)
  {
   	obj = document.layers['changingText'];
  }
  if (obj){
    obj.innerHTML= imgDesc;
  }
}

if (document.layers){
  window.captureEvents(Event.MOUSEDOWN | Event.MOUSEUP)
  window.onmousedown=rightclick;
  window.onmouseup=rightclick;
  function rightclick(e) {
    if (e.which == 3) {
      alert('Die Rechte für Bilder und Texte liegen bei Firma Agfalterer!');
      return false;
    }
    else {
      return true;
    }
  }
}
if (document.all)
{      
  function click() {
    if (event.button==2) {
      alert('Die Rechte für Bilder und Texte liegen bei Firma Agfalterer!')
    }
    if (event.button==3) {
      alert('Die Rechte für Bilder und Texte liegen bei Firma Agfalterer!')
    }
  }
  document.onmousedown=click
}