var pix = new Array("bt_home","bt_ueberuns","bt_dienst","bt_stand","bt_partner","bt_news","bt_stellen","bt_links","bt_kontakt","bt_impressum","bt_raw","sub_wirtschaft","sub_steuer","sub_recht","bt_eworxs");
var pixName = new Array("home","ueber","dienst","stand","partner","news","stellen","links","kontakt","impressum","raw","wirtschaft","steuer","recht","eworxs");

function nav(num, over)
{
	var act = (over) ? "_act.gif" : ".gif";
	document.images[pixName[num]].src = "pix/" + pix[num] + act;
}


function preloadImg() {
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=preloadImg.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 wopen(theURL,winName,features) {
  window.open(theURL,winName,features);
}

function toggleImage(theStat, theImg)
{
var inactMarker = "_inact";
var actMarker = "_act";
var thePath = "pix/";
var fileExtension = ".jpg";

if (theStat == "act")
	{
	document.getElementById(theImg).src = thePath + theImg + actMarker + fileExtension;
	}
else if (theStat == "inact")
	{
	document.getElementById(theImg).src = thePath + theImg + inactMarker + fileExtension;
	}
}


function getRealLeft(el) {
	xPos = document.getElementById(el).offsetLeft;
	tempEl = document.getElementById(el).offsetParent;
	while (tempEl != null) {
		xPos += tempEl.offsetLeft;
		tempEl = tempEl.offsetParent;
	}
	return xPos;
}


function getRealTop(el) {
	yPos = document.getElementById(el).offsetTop;
	tempEl = document.getElementById(el).offsetParent;
	while (tempEl != null) {
		yPos += tempEl.offsetTop;
		tempEl = tempEl.offsetParent;
	}
	return yPos;
}

var previewstat = false;

function previewshow(thediv, imgid)
{
	/* mouse-position */
	if (previewstat == false)
		{
		var realX = getRealLeft(imgid);
		var realY = getRealTop(imgid);
		document.getElementById(thediv).style.left = realX + 'px';
		document.getElementById(thediv).style.top = realY + 'px';
		document.getElementById(thediv).style.visibility = 'visible';
		previewstat = true;
		}
		
//	alert("RealY: " + realY + "; RealX: " + realX);
	return true;
}

function previewhide (thediv)
{
	document.getElementById(thediv).style.visibility = 'hidden';
	previewstat = false;
	return true;
}
