// JavaScript Document

/*
* Link in der Hauptnavigation auf aktuelle Seite entfernen.
*/
function navigationInit()
{
	// var doc = document.baseURI.split("/").pop();
	var doc = document.URL.split("/").pop();
	// alert(doc);
	var li_arr = document.getElementsByTagName("li");
	for (var i=0; i<li_arr.length; i++)
	{
		if(doc==li_arr[i].firstChild.attributes[0].nodeValue || document.URL==li_arr[i].firstChild)
		{
			li_arr[i].innerHTML = '<div class="aktiv">' + li_arr[i].firstChild.firstChild.nodeValue + '</div>';
			break;
		}
	}
	var subnavname = (doc.split("_").length==1)? 'subnavigation_' + doc.split(".")[0] : 'subnavigation_' + doc.split("_")[0] + "_" + doc.split("_")[1];
	var subnav = findObj(subnavname);
	if (subnav!=null)
	{	
		subnav.style.display = 'block';
		var linkAktiv = findObj(doc.split(".")[0]);
		if (linkAktiv!=null) {
			linkAktiv.innerHTML = '<div class="aktiv">' + linkAktiv.firstChild.firstChild.nodeValue + '</div>';
		}
	}
} 



// Example: obj = findObj("image1");
function findObj(theObj, theDoc)
{
  var p, i, foundObj;
  
  if(!theDoc) theDoc = document;
  if( (p = theObj.indexOf("?")) > 0 && parent.frames.length)
  {
    theDoc = parent.frames[theObj.substring(p+1)].document;
    theObj = theObj.substring(0,p);
  }
  if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];
  for (i=0; !foundObj && i < theDoc.forms.length; i++) 
    foundObj = theDoc.forms[i][theObj];
  for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++) 
    foundObj = findObj(theObj,theDoc.layers[i].document);
  if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);
  
  return foundObj;
}

var ppp = null;

function popup(url)
{
	
	var image = new Image();
	image.onload = function()
	{
		if (ppp!=null) ppp.close();
		ppp = window.open("basics/popup.html#"+this.src, "popup", "width=" + this.width + ",height=" + this.height + ",left=100,top=100,status=no,toolbar=no,scrollbars=yes,resizable=yes");
		ppp.document.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Ferenc Gábor</title></head><body style="margin: 0px; padding: 0px;"><a href="javascript:window.close();"><img src="'+this.src+'" border="0"/></a></body>');
  		ppp.focus();
	}
	image.src = url;
}

// JS function for uncrypting spam-protected emails:
function mail(_var1, _var2) {
    parent.location= "mail" + "to" + ":" + _var2 + "@" + _var1;
}

