/* notes
copyright 2004-2006 by Webdesign Andreas Spitzer
*/
function other_trans(foreign_subnavi_id, this_subnavi_id, this_mainnavi_id, foreign_mainnavi_id)
{
    document.getElementById(foreign_subnavi_id).style.display  = 'none';  
    document.getElementById(this_subnavi_id).style.display     = 'block';   
    document.getElementById(this_mainnavi_id).style.color      = '#CD9967';   
    document.getElementById(this_mainnavi_id).style.backgroundImage = 'url(images/icon_main_navi_bright.gif)';   
    document.getElementById(foreign_mainnavi_id).style.color      = '#7C2D42';   
    document.getElementById(foreign_mainnavi_id).style.backgroundImage = 'url(images/icon_main_navi_dark.gif)';   

}


function setOpacity(obj, opacity) {
  opacity = (opacity == 100)?99.999:opacity;

  // IE/Win
  obj.style.filter = "alpha(opacity:"+opacity+")";

  // Safari<1.2, Konqueror
  obj.style.KHTMLOpacity = opacity/100;

  // Older Mozilla and Firefox
  obj.style.MozOpacity = opacity/100;

  // Safari 1.2, newer Firefox and Mozilla, CSS3
  obj.style.opacity = opacity/100;
}

function fadeIn(objId,opacity) {
  if (document.getElementById) {
    obj = document.getElementById(objId);
    if (opacity <= 100) {
      setOpacity(obj, opacity);
      opacity += 10;
      window.setTimeout("fadeIn('"+objId+"',"+opacity+")", 100);
    }
  }
}

function initImage(picto) {
  imageId = picto;
  image = document.getElementById(imageId);
  setOpacity(image, 0);
  image.style.visibility = 'visible';
  fadeIn(imageId,0);
}




function newwin(wurl,wname,width,height)
{
    fenster=window.open(wurl,wname,
    "status=no,"+
    "toolbar=no,"+
    "resizable=no,"+
    "scrollbars=no,"+
    "menubar=no,"+
    "width="+width+","+
    "top=10,"+
    "left=10,"+
    "height="+height+"");
    fenster.focus();
}


function newwin_scroll(wurl,wname,width,height)
{
    fenster=window.open(wurl,wname,
    "status=no,"+
    "toolbar=no,"+
    "resizable=no,"+
    "scrollbars=yes,"+
    "menubar=no,"+
    "width="+width+","+
    "top=10,"+
    "left=10,"+
    "height="+height+"");
    fenster.focus();
}


function autark_gal1_change_pics(picsrc,url)
{
    var newpic2 = '<img src="' +url+ '" border="0">';
    div = document.getElementById(picsrc);
    div.innerHTML = newpic2;
}


// Get base url
url = document.location.href;
xend = url.lastIndexOf("/") + 1;
var base_url = url.substring(0, xend);
//standard ajax: hole url/datei
function ajax_do(url)
{
        // Does URL begin with http?
        if (url.substring(0, 4) != 'http') {
              url = base_url + url;
   }

        // Create new JS element
        var jsel  = document.createElement('SCRIPT');
        jsel.type = 'text/javascript';
        jsel.src  = url;

        // Append JS element (therefore executing the 'AJAX' call)
        document.body.appendChild (jsel);
}

function ajax_close(box)
{
    div = document.getElementById(box);
    div.innerHTML = "";
    div.style.visibility = "hidden";
}



//ToolTip
var Initialisierung = 0
var Ex, Ey, TitelFarbe, TextFarbe, ContentInfo;


function ToolTipBewegen(layerName, FromTop, FromLeft, e)
{
	document.getElementById(layerName).style.top = FromTop + 14;
	document.getElementById(layerName).style.left = FromLeft + 15;
}

function Aktivieren()
{
	Initialisierung=1;
}

function Deaktivieren()
{
	Initialisierung=0;
}

function Starten(e)
{
	if(Initialisierung)
	{

        Ex = document.all ? document.body.scrollLeft+event.clientX : e.pageX;
		Ey = document.all ? document.body.scrollTop+event.clientY : e.pageY;

        ToolTipBewegen("ToolTip", Ey, Ex, e);
		document.getElementById('ToolTip').style.visibility = "visible";
	}
	else
	{
		ToolTipBewegen("ToolTip", 0, 0);
		document.getElementById('ToolTip').style.visibility = "hidden";
	}
}

function ToolTip(layerName, TTitel, TInhalt)
{
	ContentInfo = '<table border="0" id="tooltip_breite" cellspacing="0" cellpadding="0">'+'<tr><td width="100%" id="tooltip_rahmen_color">'+'<table border="0" width="100%" cellspacing="1" cellpadding="0">'+'<tr><td width="100%" id="tooltip_titel_bgcolor">'+'<table border="0" width="90%" cellspacing="0" cellpadding="0" align="center">'+'<tr><td width="100%">'+'<font class="ToolTipTitel"> '+TTitel+'</font>'+'</td></tr>'+'</table>'+'</td></tr>'+'<tr><td width="100%" id="tooltip_text_bgcolor">'+'<table border="0" width="95%" cellpadding="0" cellspacing="1" align="center">'+'<tr><td width="100%">'+'<font class="ToolTipInhalt">'+TInhalt+'</font>'+'</td></tr>'+'</table>'+'</td></tr>'+'</table>'+'</td></tr>'+'</table>';
	document.getElementById(layerName).innerHTML = ContentInfo;
}
