function setImagePath(path)

{

ApplicationPath = new String();

ApplicationPath = path;

img = new Array();



img[0] = new Image();

img[0].src = path + 'img/mainMenuOn.gif';

img[1] = new Image();

img[1].src = path + 'img/mainMenuOff.gif';

}



function highlight(id , ParentId)

{

  var browser = new Array();
  browser = browserCheck();

if (img)
{
		if(ParentId == id) //Parent = 1 ==> oberste Menüebene

		{
			if(browser[1] <= 5 && browser[2] == "macppc" && browser[0] == 'Microsoft Internet Explorer')
			{

		document.getElementById('td' + id).style.backgroundImage= "url(" + img[0].src + ")";

			}
			else
			{
			document.getElementById('td' + id).style.background= "url('" + img[0].src + "')";
			}

		
			if (browser[0] == 'Microsoft Internet Explorer' && browser[1] >= 4)

		{   

			document.getElementById('td' + id).style.cursor = 'hand';

			document.getElementById('td' + ParentId).style.cursor = 'hand';

		}

	  

		else

		{

			document.getElementById('td' + id).style.cursor = 'pointer';

			document.getElementById('td' + ParentId).style.cursor = 'pointer';

		}

	}

	else

	{

		if ((browser[0] == 'Microsoft Internet Explorer' && browser[1] >= 4) || (browser[0] == 'Safari'))

		{   

			//document.getElementById('td' + id).style.backgroundColor = '#F2F9F1';

			document.getElementById('td' + id).style.backgroundColor = '#D9EDD4';

			document.getElementById('td' + id).style.color = '#000000';

			document.getElementById('td' + id).style.cursor = 'hand';

			document.getElementById('td' + ParentId).style.cursor = 'hand';

		}

	  

		else

		{
			document.getElementById('td' + id).style.cursor = 'pointer';

			document.getElementById('td' + ParentId).style.cursor = 'pointer';

		}

	}	

	     

	var el = document.getElementById('t' + ParentId);

	if (el)

	{
	//if (browser[0] != 'Microsoft Internet Explorer' || browser[1] < 4 || (browser[1] <= 5 && browser[2] == "macppc") && ParentId == id)

	//{//sollte auch für MAC IE 5 funktionieren!!!

		var elWidth = document.getElementById('menuTable').width *0.2;

		var elLeft = findPosX(document.getElementById('td' + id));

		var elTop = findPosY(document.getElementById('td' + id));
	 
		if(browser[0] == 'Safari')
		{
			elLeft += 15;
			elTop -= 1;
		}
		    
		if(browser[1] <= 5 && browser[2] == "macppc" && browser[0] == 'Microsoft Internet Explorer')
		{
	  
			if (ParentId == id)
			{
				elTop = 0;
			}	
			else 
			{
				elWidth -= 1;
			}
		}
	       
	       
		el.style.width = elWidth + 1;

		el.style.left = elLeft - 1;

		el.style.top = elTop + 20;

	//}
	   
	el.style.display = 'inline';
	   
	}
  }
}



function highlight2(id , ParentId)

{

  var browser = new Array();

  browser = browserCheck();

  //document.getElementById('td' + id).style.backgroundColor = '#F2F9F1';

  document.getElementById('td' + id).style.backgroundColor = '#D9EDD4';

  //document.getElementById('td' + id).style.backgroundColor = '#40A629';

  document.getElementById('td' + id).style.color = '#000000';

  

  if (browser[0] != 'Microsoft Internet Explorer' || browser[1] < 4)

	document.getElementById('td' + id).style.cursor = 'pointer';

  else

	document.getElementById('td' + id).style.cursor = 'hand';

  

  if (browser[0] != 'Microsoft Internet Explorer' || browser[1] < 4)

	document.getElementById('td' + ParentId).style.cursor = 'pointer';

  else

    document.getElementById('td' + ParentId).style.cursor = 'hand';

}



function highlightout(id, stay)

{
  var browser = new Array();

  browser = browserCheck();
  
  if (stay != '0')

  {

      if(browser[1] <= 5 && browser[2] == "macppc" && browser[0] == 'Microsoft Internet Explorer')
        {

	  document.getElementById('td' + id).style.backgroundImage= "url(" + img[1].src + ")";

        }
        else
        {	
          document.getElementById('td' + id).style.background = "url('" + img[1].src+ "')";
        }

  }

  document.getElementById('td' + id).style.color = '#000000';

  var el = document.getElementById('t' + id);

  if (el)

  {
    el.style.display = 'none';

  }

}



function highlightout2(id)

{

  document.getElementById('td' + id).style.backgroundColor = '#FFFFFF';

  document.getElementById('td' + id).style.color = '#000000';

  var el = document.getElementById('t' + id);

  if (el)

  {
   el.style.display = 'none';

  }

  

 }	

 

function checkBrowserString(string)

{
  
    
	detect = navigator.userAgent.toLowerCase();

	place = detect.indexOf(string) + 1;

	thestring = string;
    
	return place;

}	



function browserCheck()

{

	var browser = "";

	var version = "";

	var bInfo = new Array();

    if (checkBrowserString('opera')) 

    {

		browser = "Opera";

	}

	else if (checkBrowserString('msie')) 

	{

		browser = "Microsoft Internet Explorer";

	}
    else if (checkBrowserString('safari'))

	{

		browser = "Safari";

		version = detect.charAt(8);

	}

	else if (!checkBrowserString('compatible'))

	{

		browser = "Netscape Navigator";

		version = detect.charAt(8);

	}
	else browser = "";

	if (!version)

	{

		version = detect.charAt(place + thestring.length);

	}

	

	bInfo[0] = browser;

	bInfo[1] = version;

	bInfo[2] = navigator.platform.toLowerCase();



	return bInfo;

}



function findPosX(obj)

{

	var curleft = 0;

	if (obj.offsetParent)

	{

		while (obj.offsetParent)

		{

			curleft += obj.offsetLeft

			obj = obj.offsetParent;

		}

	}

	else if (obj.x)

		curleft += obj.x;



	return curleft;

}



function findPosY(obj)

{

	var curtop = 0;

	if (obj.offsetParent)

	{

		while (obj.offsetParent)

		{

			curtop += obj.offsetTop

			obj = obj.offsetParent;

		}

	}

	else if (obj.y)

		curtop += obj.y;



	return curtop;

}





function movr(k) {

 if (document.images) 

  eval('document.img'+k+'.src=img'+k+'_on.src');

}



function mout(k) {

 if (document.images) 

  eval('document.img'+k+'.src=img'+k+'_off.src');

}



function agbtext(id) {

window.open(ApplicationPath + '/Texts.aspx?content=5','editPerson','scrollbars,resizable,width=620,height=410,left=0,top=0');

}



function impressumtext(id) {

window.open(ApplicationPath + '/Texts.aspx?content=6','editPerson','scrollbars,resizable,width=620,height=410,left=0,top=0');

}
function clickButton(e, buttonid){ 
      var bt = document.getElementById(buttonid); 
      if (typeof bt == 'object'){ 
            if(navigator.appName.indexOf("Netscape")>(-1)){ 
                  if (e.keyCode == 13){ 
                        bt.click(); 
                        return false; 
                  } 
            } 
            if (navigator.appName.indexOf("Microsoft Internet Explorer")>(-1)){ 
                  if (event.keyCode == 13){ 
                        bt.click(); 
                        return false; 
                  } 
            } 
      } 
}

function SetSuchfeldFocus(site)
{
	var textfields = document.getElementsByTagName('input');
    var fieldCounter = 0;
	var focusFeld = document.getElementById('header1_suchtext');
	
	if (!focusFeld)
	   focusFeld = document.getElementById('header_suchtext');
	   
	   
	if (site != 'bbDetails' && site != 'SSL/gebuchteKurse')
	{
			if (textfields)
			{
				for (var i = 0;i<textfields.length;i++)
				{
					if ((textfields[i].type == 'text' && (textfields[i].id.toUpperCase() != 'header1_suchtext'.toUpperCase()
					    && textfields[i].id.toUpperCase() != 'header_suchtext'.toUpperCase()))
						|| (textfields[i].type == 'hidden' && textfields[i].id.toUpperCase() == 'CURSORFETCHER'))
					{
					fieldCounter = i;
					break;
					}
				}
			}
		
		if (fieldCounter != 0)
			focusFeld = textfields[fieldCounter];
		    
		    
		//keine fokusierung
		if (focusFeld.id.toUpperCase() == 'CURSORFETCHER')
			return;
		    
		if (focusFeld && !focusFeld.disabled && focusFeld.id != '_ctl0_txtFirmenname')
			focusFeld.focus();
	}
}

function ort(url, ortnr)
{	
	window.open (url + '/eShop/location.aspx?ortnr=' + ortnr,'','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=600,height=600');
}

function ShowBUBest(url)
{
  window.open (url,'', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=600,height=600');
}
	
function goUp(site)
{
	/*if (site == 'bbDetails')
	{
		if (window.location.href.toLowerCase().indexOf("#") == -1)
		{
			window.location.href = window.location.href + "#top";
		}
		
	}*/
	return;
}