/*

*	globale Browsererkennung

*/



dom = (document.getElementById) ? true : false;

ie = (document.all && !document.getElementById) ? true : false;

nn = (document.layers) ? true : false;

aktivTable = new Array();



/*

*	Menuseite: Farbwechsel

*/

function changeMenuColor(id, farbe)

{

   

   if (id != aktivTable[0] && aktivTable.length > 0)

   {

      //alert(aktivTable[0]);

      changeMenuColorBack(aktivTable[0], 'CCCCCC');

   }

         

	if(dom)

	{

		for (i=1; i<4; i++)

		{

			document.getElementById(eval("id + i")).style.backgroundColor = farbe;

         	document.getElementById(eval("id + i")).style.color  = 'ffffff';

		}

	}

	if(ie)

	{

		for (i=1; i<4; i++)

		{

			document.all.eval("id + i").style.backgroundColor = farbe;

         	document.getElementById(eval("id + i")).style.color  = 'ffffff';

		}

	}

   

   aktivTable[0] = id;

}



function changeMenuColorBack(id, color)

{

	if(dom)

	{

		for (i=1; i<4; i++)

		{

			//alert(' in seleon.js ' + eval("id + i"));

			document.getElementById(eval("id + i")).style.backgroundColor = color;

         	document.getElementById(eval("id + i")).style.color  = '000000';

		}

	}

	if(ie)

	{

		for (i=1; i<4; i++)

		{

			document.all.eval("id + i").style.backgroundColor = color;

         	document.getElementById(eval("id + i")).style.color  = '000000';

		}

	}

}





/*

*	Menuseite: Farbwechsel bei Layern

*/

function changeLayerMenuColor()

{

	if(dom)

	{

		for (i=0; i< changeLayerMenuColor.arguments.length; i++)

		{

			document.getElementById(changeLayerMenuColor.arguments[i]).style.backgroundColor = '666666';

			document.getElementById(changeLayerMenuColor.arguments[i]).style.color  = 'ffffff';

		}

	}

	if(ie)

	{

		document.all.id.style.backgroundColor = 'ffffff';

	}

}



function changeLayerMenuColorBack()

{

	if(dom)

		for (i=0; i< changeLayerMenuColorBack.arguments.length; i++)

		{

			document.getElementById(changeLayerMenuColorBack.arguments[i]).style.backgroundColor = 'CCCCCC';

			document.getElementById(changeLayerMenuColorBack.arguments[i]).style.color  = '000000';

		}

	if(ie)

	{

		document.all.id.style.backgroundColor = 'ffffff';

	}

}



function sucheStarten()

{

   oben = screen.availHeight - (screen.availHeight - 5);

   links = screen.availWidth - 450

   

	if (document.suche.suchbegriff.value.length < 3)

	{

		alert('Bitte geben Sie mindestens 3 Zeichen ein.');

		return;

	}

	else

	{

	   

	   if ( !window.Suchfenster || Suchfenster.closed )

	  	{

			Suchfenster = window.open('../../../cgi-bin/search.pl', 'Suchfenster', 'width=500, height=400, top=' + oben + ', left=' + links + ', scrollbars=1');

			//opener.document.suche.action = '../../../cgi-bin/search.pl';

			//opener.document.suche.target = 'Suchfenster';

			//opener.document.suche.submit();

		}

	   else

	   {

	      	Suchfenster.location = '../../../cgi-bin/search.pl', 'Suchfenster';

	   }

	   

	   	Suchfenster.focus();

		document.suche.submit();

	}

}	





function imprPopup(url, name)

{

   oben = screen.availHeight - (screen.availHeight - 5);

   links = screen.availWidth - 350;



   var features = ('left='+ links + ', top=' + oben + ',width=330,height=450,scrollbars=1');

   

   if ( !window.Impressum || Impressum.closed )

  	{

  		Impressum = window.open(url, name, features);

	}

   else

   {

      	Impressum.location = url,name,features;

   }

   

   Impressum.focus();

}



function rechtlHinweisPopup(url, name)

{

   oben = screen.availHeight - (screen.availHeight - 5);

   links = screen.availWidth - 470;



   var features = ('left='+ links + ', top=' + oben + ',width=430,height=400,scrollbars=1');

   

   if ( !window.Impressum || Impressum.closed )

  	{

  		Impressum = window.open(url, name, features);

	}

   else

   {

      	Impressum.location = url,name,features;

   }

   

   Impressum.focus();

}



function isoPopup(url, name)

{

   oben = screen.availHeight - (screen.availHeight - 5);

   links = screen.availWidth - 620;



   var features = ('left='+ links + ', top=' + oben + ',width=810,height=650,scrollbars=1,resizable=1');

   

   if ( !window.Impressum || Impressum.closed )

  	{

  		Impressum = window.open(url, name, features);

	}

   else

   {

      	Impressum.location = url,name,features;

   }

   

   Impressum.focus();

}

function anfahrtPopup(url, name)

{

   oben = screen.availHeight - (screen.availHeight - 5);

   links = screen.availWidth - 720;



   var features = ('left='+ links + ', top=' + oben + ',width=750,height=680,scrollbars=1,resizable=1');

   

   if ( !window.Anfahrt || Anfahrt.closed )

  	{

  		Anfahrt = window.open(url, name, features);

	}

   else

   {

      	Anfahrt.location = url,name,features;

   }

   

   Anfahrt.focus();

}

function siteMapPopup(url, name)

{

   oben = screen.availHeight - (screen.availHeight - 5);

   links = screen.availWidth - 350;



   var features = ('left='+ links + ', top=' + oben + ',width=400,height=850,scrollbars=1');

   

   if ( !window.siteMap || siteMap.closed )

  	{

  		siteMap = window.open(url, name, features);

	}

   else

   {

      	siteMap.location = url,name,features;

   }

   

   siteMap.focus();

}


function heilbronnAnfahrtPopup(url, name)

{

   oben = screen.availHeight - (screen.availHeight - 5);

   links = screen.availWidth - 350;



   var features = ('left='+ links + ', top=' + oben + ',width=800,height=850,scrollbars=1');

   

   if ( !window.siteMap || siteMap.closed )

  	{

  		siteMap = window.open(url, name, features);

	}

   else

   {

      	siteMap.location = url,name,features;

   }

   

   siteMap.focus();

}


function muenchenAnfahrtPopup(url, name)

{

   oben = screen.availHeight - (screen.availHeight - 5);

   links = screen.availWidth - 350;



   var features = ('left='+ links + ', top=' + oben + ',width=1100,height=850,scrollbars=1');

   

   if ( !window.siteMap || siteMap.closed )

  	{

  		siteMap = window.open(url, name, features);

	}

   else

   {

      	siteMap.location = url,name,features;

   }

   

   siteMap.focus();

}

function flashVideo(url, name){

   oben = 200;
   links = 200;

   var features = ('left='+ links + ', top=' + oben + ',width=410,height=330,scrollbars=0');

   if ( !window.siteMap || siteMap.closed )	{
  		siteMap = window.open(url, name, features);
	}
   else{
      	siteMap.location = url,name,features;
   }
   siteMap.focus();
}
