

function getObject(obj)
{
	var theObj
	if (typeof obj=="string")  	{if (document.all) {theObj = eval("document.all." + obj  );}	else {theObj = eval("document.getElementById('" + obj + "')" );}} 
	else {theObj=obj}
	return theObj	
}




function hide_MainMenuPopup(layerid)
{
var theObj;
// nur unsichtbar machen WENN ungleich MainMenuPopupVisible
if (MainMenuPopupVisible != layerid)  
	{
	theObj = getObject(layerid);
	theObj = theObj.style;
	theObj.visibility="hidden";
	}
}





function show_l_at(layerid,showAtObjectID,offset_x,offset_y)
{
	var theObj;
	theObj = getObject(layerid);
	theObj = theObj.style;
	tPostion = getPosition(showAtObjectID)
	theObj.left = tPostion.x + offset_x+ 'px';
	theObj.top = tPostion.y + offset_y + 'px';
	theObj.visibility="visible";
}


function show_hide_l_at(layerid,showAtObjectID,offset_x,offset_y)
{
	var theObj;
	theObj = getObject(layerid);
	theObj = theObj.style;
	
	if (theObj.visibility == "visible") 	
		{
		theObj.visibility="hidden";
		}
	else 	
		{
		tPostion = getPosition(showAtObjectID);
		theObj.left = tPostion.x + offset_x+ 'px';
		theObj.top = tPostion.y + offset_y + 'px';
		theObj.visibility="visible";
		}

}





function show_l(layerid)
{
	var theObj;
	theObj = getObject(layerid);
	theObj = theObj.style;
	theObj.visibility="visible";
} 

function hide_l(layerid)
{
	var theObj;
	theObj = getObject(layerid);
	theObj = theObj.style;
	theObj.visibility="hidden";
}


function show_hide_layer(LayerToShow,force_display)
{
	var theObj
	theObj = getObject(LayerToShow);
	theObj = theObj.style;
	if (force_display== 0) 
		{if ( theObj.display == "none" ) {theObj.display = "block";} else {theObj.display = "none";}} 
	else 
		{theObj.display = force_display;}
}



function changeHeight(layer,NewH)
{
	var theObj;
	theObj = getObject(layer);
	theObj = theObj.style;
	theObj.height = NewH + 'px';

}



function changeOpacity(layer,value)
{
	var theObj;
	theObj = getObject(layer);
	theObj = theObj.style;
	theObj.filter = 'Alpha(Opacity='+value+')';
	theObj.MozOpacity = value/100;
}


function blurObject(ObjectToBlur,setBlur)
{
var theObj;
theObj = getObject(ObjectToBlur);
theObj = theObj.style;
if (setBlur==1)  {theObj.filter="progid:DXImageTransform.Microsoft.Blur(PixelRadius='3', MakeShadow='false', ShadowOpacity='0,1', ";} 
if (setBlur==0) { theObj.filter=""; }
}



function openPopup(URL,name,breite,hoehe,resize) 
{
		var height_kw = "Height";
		var width_kw = "Width";
		var main_opts = "location=0,scrollbars=1,status=1,resizable="+resize+",directories=0,menubar=0";
		var this_opts = main_opts + ',' + width_kw + '=' + breite + ',' + height_kw + '=' + hoehe;
		var this_win = open(URL,name,this_opts);
		this_win.moveTo((screen.width-breite)/4,(screen.height-hoehe)/4);
		if( window.focus) {this_win.focus();}
}





// --------- --------- --------- --------- --------- --------- --------- --------- --------- --------- --------- --------- --------- --------- --------- --------- --------- --------- --------- --------- --------- --------- --------- 
function getPosition(element)
 /*   http://droeppez.de/download/js-tut/js-tut/tutorial/position.html  der Aufruf dieser Funktion ermittelt die absoluten Koordinaten   des Objekts element */ 
{
	element_object = getObject(element);
	var elem = element_object
	var elem2 = element_object
	
	var tagname="",x=0,y=0;
	var element_object
	
	

 /* solange elem ein Objekt ist und die Eigenschaft offsetTop enthaelt   wird diese Schleife fuer das Element und all seine Offset-Eltern ausgefuehrt */ 
 while ( (typeof(elem)=="object")&&(typeof(elem.tagName)!="undefined") )
	{
		    y += elem.offsetTop;     /* Offset des jeweiligen Elements addieren */ 
		    x += elem.offsetLeft;    /* Offset des jeweiligen Elements addieren */ 
	
		    tagname=elem.tagName.toUpperCase(); /* tag-Name ermitteln, Grossbuchstaben */
		 /* wenn beim Body-tag angekommen elem fuer Abbruch auf 0 setzen */ 
		    if (tagname=="BODY") {elem=0;}
			
		 /* wenn elem ein Objekt ist und offsetParent enthaelt   Offset-Elternelement ermitteln */ 
		    if (typeof(elem)=="object") {if (typeof(elem.offsetParent)=="object") {elem=elem.offsetParent;}}
	}
	

		  
		  

	
	/* Objekt mit x und y zurueckgeben */
	  position=new Object();
	  position.x=x;
	  position.y=y;
	
	  return position;
}
// --------- --------- --------- --------- --------- --------- --------- --------- --------- --------- --------- --------- --------- --------- --------- --------- --------- --------- --------- --------- --------- --------- --------- 












