/* notes
copyright 2004-2006 by Webdesign Andreas Spitzer
*/

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;
}
