// (c) 2001 - 2004, EIKONA Medien GmbH, it.x informationssysteme gmbh, Alle Rechte vorbehalten.

// History --------------------------------------------------------------------------------
// 01.10.02 tht displayDiv() hinzugef�gt.
// 05.10.02 tht tmt_winLaunch erweitert.
// 05.10.02 tht Neue Funktionene zum deaktivieren des Contextmen�s.
// 11.10.02 tht setcellcolor() optimiert.
// 12.10.02 tht MM_showHideLayers() eingebunden.
// 21.10.02 tht setcellcolor() �berarbeitet.
// 07.11.02 mgs Erweiterung.
// 15.11.02 mgs Anpassung der Kommentare.
// 11.12.02 mgs Bereinigung.
// 26.02.04 mwt Positionierungsfunktionen hinzugef�gt.
// 12.04.06 jsl Funktion zum Anzeigen eines Bildes bei Mouseover hinzugefuegt.
// History --------------------------------------------------------------------------------


// ----------------------------------------------------------------------------------------
// Funktionen f�r den Mouseovereffekt / Layer Ein- und Ausblendefunktionen.
// ----------------------------------------------------------------------------------------
// 12.04.06 jsl Variable fuer Bildauswahl bei Mouseover
var cache = 0;

	function MM_preloadImages()
		{ //v3.0
	  	var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
	    	var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
		if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
		}

	function MM_swapImage()
		{ //v3.0
		  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
		   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
		}

	function MM_swapImgRestore()
		{ //v3.0
	  	var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
		}

	function MM_findObj(n, d)
		{ //v3.0
	  	var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
	    	d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
		  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
		  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
		}

	function MM_showHideLayers()
		{ //v3.0
	  	var i,p,v,obj,args=MM_showHideLayers.arguments;
		  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
		    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
		    obj.visibility=v; }
		}


//	----------------------------------------------------------------------------------------
//	S Y S T E M F U N K T I O N E N
//	----------------------------------------------------------------------------------------


   // Eine Liste aller ge�ffneten Popups
   var PopupList = new Array();

   //
   // �ffnen eines Fensters.
   //
	function js_popup(str_url, str_name, str_window, int_width, int_height, int_x, int_y, str_features)
	   	{
	    str_features = str_features + ',width=' + int_width + ',height=' + int_height;

		if (int_x=='false')
	   	  str_features = str_features + ',left=' + (screen.width/2 - int_width/2) + ',top=' + (screen.height/2 - int_height/2);
	    else
	   	  str_features = str_features + ',left=' + int_x + ',top=' + int_y;

		if (PopupList[str_window] && PopupList[str_window].closed == false)
			{
			obj_window = PopupList[str_window];
			obj_window.location.href = str_url;
			obj_window.resizeTo(int_width, int_height);
			}
		else
			{
			obj_window = window.open(str_url, str_window, str_features);
			PopupList[str_window] = obj_window;
			}
		obj_window.focus();
		}

   //
   // Rahmen um ein Feld an oder aus schalten.
   //
	function js_rahmen()
		{
		var element = window.event.srcElement;
		element.className = (element.className == 'rahmen_aus' ? 'rahmen_an' : 'rahmen_aus');
		}

   //
   // Macht alle Seitenobjekte f�r die Maus unselektierbar.
   //
	function js_make_unselect()
		{
		for (i=0; i < document.all.length; i++)
				document.all(i).unselectable = "on";
		}

   //
   // Hebt die Funktion js_make_unselect() f�r gew�nschte Objekte wieder auf.
   //
	function js_make_select(id)
		{
		eval(id).unselectable = "off";
		}

   //
   // Aktiviert oder deaktiviert eine Checkbox.
   //
	function js_checkbox_switch(name)
		{
		document.form.elements[name].checked = !document.form.elements[name].checked;
		}

   //
   // Aktiviert oder deaktiviert alle Checkboxen.
   //
	function js_checkboxen_alle(name)
		{
		for (var x = 0; x < document.forms[0].elements.length; x++)
			{
			var obj = document.forms[0].elements[x];

			if (obj.name != name)
				obj.checked = document.form.elements[name].checked;
			}
		}

   //
   // �ffnet zwei Fenster gleichzeitig.
   //
	function js_zwei_frames(url_1, f_1, url_2, f_2)
	   {
	   	parent.frames[f_1].location.href=url_1;
	    parent.frames[f_2].location.href=url_2;
	   }


	/*
	 * Erzeugt JavaScript E-Mail-Links
	 */
	 function js_email_javascript(prefix, user, host, suffix)
	 	{
	 	document.write(prefix+user+'@'+host+suffix);
	 	}


//	----------------------------------------------------------------------------------------
//	P O S I T I O N I E R U N G S   F U N K T I O N E N
//	----------------------------------------------------------------------------------------

	//
	// Rechte Koordinate eines Elements
	//
	function js_getRight(obj_element)
		{
		if (obj_element.offsetWidth)
			return obj_element.offsetWidth + js_getLeft(obj_element);
		else
			return 20 + js_getLeft(obj_element);
		}

	//
	// Linke Koordinate eines Elements
	//
	function js_getLeft(obj_element)
		{
		if (obj_element.offsetParent)
			return js_getLeft(obj_element.offsetParent)+obj_element.offsetLeft
		else
			return obj_element.offsetLeft;
		}

	//
	// Untere Koordinate eines Elements
	//
	function js_getBottom(obj_element)
		{
		if (obj_element.offsetHeight)
			return obj_element.offsetHeight + js_getTop(obj_element);
		else
			return 20 + js_getTop(obj_element);
		}

	//
	// Obere Koordinate eines Elements
	//
	function js_getTop(obj_element)
		{
		if (obj_element.offsetParent)
			return js_getTop(obj_element.offsetParent)+obj_element.offsetTop
		else
			return obj_element.offsetTop;
		}

// jsl erweiterungen 12.04.06


// funktion zum anzeigen eines bildes bei mouseover


	function showImage(src, alt, width)
	{
		var elmImage = document.getElementById("image-rollover");
	 	elmImage.src = src;
	 	elmImage.alt = alt;
	 	elmImage.width = width;
	}


//	----------------------------------------------------------------------------------------
//	FLASH-ELEMENT FUNKTION (IE update) /AYA:27.06.2006
//	----------------------------------------------------------------------------------------

function CreateFlashControl(DivID, strHtml)
{
	var d = document.getElementById(DivID);
  	d.innerHTML = strHtml;
}

//	----------------------------------------------------------------------------------------
//	Wagner-Group.com QuickFinder
//	----------------------------------------------------------------------------------------
function quicklink()
	{
	box = document.fromsprachumschaltung.neueseite;
	str_destination = box.options[box.selectedIndex].value;
	array_destination = str_destination.split(":");
	if (array_destination)
		{
		if("link" == array_destination[0])
			document.location.href = decodeURIComponent(array_destination[1]);
		//	window.open(decodeURIComponent(array_destination[1]));
		// else
		//	window.open('http://www.wagner-group.com/portal//loader.php?seite=' + decodeURI(array_destination[1]));

		box.selectedIndex = 0;
		}
	}

//	----------------------------------------------------------------------------------------
//	Popup-Funktion von Dreiraum
//	----------------------------------------------------------------------------------------
function MM_openBrWindow(theURL,winName,features)
	{ //v2.0
	window.open(theURL,winName,features);
	}

//	----------------------------------------------------------------------------------------
//	Link um verschachtelte Elemente beim IE
//	----------------------------------------------------------------------------------------

var appVer = navigator.appVersion.toLowerCase();
var isIE  = appVer.indexOf('msie');

function gotoUrlIE(url)
	{
    if (isIE)
    	{
        document.location.href = url;
    	}
	}