var currentlyactive = "";
var bigImage = "";
document.onLoad = function() {

	bigImage = new Image();
	bigImage.src = "CTC-Karte-Original-beige.gif";

}

function getEventObject(e) {  // utility function to retrieve object from event
    if (navigator.appName == "Microsoft Internet Explorer") {
        return e.srcElement;
    } else {  // is mozilla/netscape
        // need to crawl up the tree to get the first "real" element
        // i.e. a tag, not raw text
        var o = e.target;
        while (!o.tagName) {
            o = o.parentNode;
        }
        return o;
    }
}

function addEvent(name, obj, funct) { // utility function to add event handlers

    if (navigator.appName == "Microsoft Internet Explorer") {
        obj.attachEvent("on"+name, funct);
    } else {  // is mozilla/netscape
        obj.addEventListener(name, funct, false);
    }
}


function deleteEvent(name, obj, funct) { // utility function to delete event handlers

    if (navigator.appName == "Microsoft Internet Explorer") {
        obj.detachEvent("on"+name, funct);
    } else {  // is mozilla/netscape
        obj.removeEventListener(name, funct, false);
    }
}

function setCursor(obj) {
   if (navigator.appName == "Microsoft Internet Explorer") {
        obj.style.cursor = "hand";
    } else {  // is mozilla/netscape
        obj.style.cursor = "pointer";
    }
}

function Point(iX, iY)
{
   this.x = iX;
   this.y = iY;
}


function getPoint(aTag)
{
   var oTmp = aTag;  
   var point = new Point(0,0);
  
   do 
   {
      point.x += oTmp.offsetLeft;
      point.y += oTmp.offsetTop;
      oTmp = oTmp.offsetParent;
   } 
   while (oTmp.tagName != "BODY");

   return point;
}

function hideCurrentMenu() {
	if (currentlyactive != "") {
		hideMenu(currentlyactive);
	}
}

function showMenu(aTag, theId) {
	hideCurrentMenu();
	if (theId != currentlyactive) {
		var point = getPoint(aTag);
		document.getElementById(theId).style.visibility = "visible";
		document.getElementById(theId).style.left = point.x + "px";
		document.getElementById(theId).style.top = (point.y + 20) + "px";
		currentlyactive = theId;
	} else {
		hideMenu(theId);
		currentlyactive = "";
	}
}

function hideMenu(theId) {
	document.getElementById(theId).style.visibility = "hidden";
	document.getElementById(theId).style.left = 0 + "px";
	document.getElementById(theId).style.top = 0 + "px";	
}

function showImage() {
	var point = getPoint(document.getElementById("img15"));
	document.getElementById("VerstecktesBild").style.visibility = "visible";
	document.getElementById("VerstecktesBild").style.left = ( point.x - 150) + "px";
	document.getElementById("VerstecktesBild").style.top = (point.y - 50) + "px";
}

function hideImage() {
	document.getElementById("VerstecktesBild").style.visibility = "hidden";
	document.getElementById("VerstecktesBild").style.left = 0 + "px";
	document.getElementById("VerstecktesBild").style.top = 0 + "px";	
}

function createAttrib(name, value) {
	var attrib = document.createAttribute(name);
	attrib.nodeValue = value;
	return attrib;
}