if (document.images) 
{
pic1= new Image(20,20); 
pic1.src="bilder/nav_bar.gif"; 
}


function setZIndex(id, pos, z) {
	document.getElementById(id + pos).style.zIndex = z;//} 
}
function findPosX(obj)
  {
    var curleft = 0;
    if(obj.offsetParent)
        while(1) 
        {
          curleft += obj.offsetLeft;
          if(!obj.offsetParent)
            break;
          obj = obj.offsetParent;
        }
    else if(obj.x)
        curleft += obj.x;
    return curleft;
  }

  function findPosY(obj)
  {
    var curtop = 0;
    if(obj.offsetParent)
        while(1)
        {
          curtop += obj.offsetTop;
          if(!obj.offsetParent)
            break;
          obj = obj.offsetParent;
        }
    else if(obj.y)
        curtop += obj.y;
    return curtop;
  }

function showDesc() {
	var id = String(this.parentNode.parentNode.id).substr(3);
	var y = Number(id.substr(0,1));
	var x = Number(id.substr(1,1));
	var info = document.getElementById('info'+y+x);
	var opa = document.getElementById('opa'+y+x);
	var IEpx = 0;
	//<?php echo "alert('asdf')";?>
		//if (navigator.userAgent.indexOf('MSIE')==-1) {IEpx = 0;}
		if (x>2) {
			info.style.left = "0%";
			info.style.width = "199%";
			info.style.borderLeft = "1px solid rgb(167,167,218)";
			var t1 = new Tween(info.style,'left',Tween.regularEaseOut,0,-202,0.2,'%');
		} else {
			if (navigator.userAgent.indexOf('MSIE')!=-1) info.style.width = "199%";
			else info.style.width = "202%";
			info.style.left = "100%";
			info.style.borderRight ="1px solid rgb(167,167,218)";
		}
		info.style.display = 'block';
		showOpa(opa,info.parentNode,IEpx);
		info.parentNode.style.zIndex = 4;
		info.parentNode.parentNode.style.zIndex = 3;
		//document.getElementById("logo").style.zIndex = 2;
		var t3 = new Tween(info.style,'width',Tween.regularEaseOut,0,202,0.2,'%');
		if (x>2) t1.start();
		t3.start();
}
function showOpa(opa,parent,IEpx) {
	var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
	opa.style.display = 'block';
		
		opa.style.top = '-'+(findPosY(parent))+'px';
		opa.style.left = '-'+(findPosX(parent)+IEpx)+'px';
		opa.style.width = myWidth+'px';
		opa.style.height = myHeight+'px';
		opacityTween = new OpacityTween(opa,Tween.regularEaseOut, 0, 75, 0.5);
		opacityTween.start();
	
	}
function hideOpa (opa) {
	
	
	Tween2 = new OpacityTween(opa,Tween.regularEaseOut, 50, 0, 0.5);
	Tween2.onMotionFinished = function () {
		opa.style.display = 'none'; }
	Tween2.start();
	
	
	}
function hideDesc() {

	var id = String(this.parentNode.parentNode.id).substr(3);
	var y = Number(id.substr(0,1));
	var x = Number(id.substr(1,1));
	var info = document.getElementById('info'+y+x);
	var opa = document.getElementById('opa'+y+x);
	
	info.parentNode.style.zIndex = 0;
	info.parentNode.parentNode.style.zIndex = 0;
	//document.getElementById("logo").style.zIndex = 0;
	info.style.display = 'none';
	opa.style.display = 'none';
}
function bName() {
  // return 1 for Internet Explorer
  if (navigator.appName == "Microsoft Internet Explorer")
    return 1;

  // return 2 for Navigator
  if (navigator.appName == "Netscape")
    return 2;

  // return 0 for other browsers
  return 0;
}


function watchit() {
	if (!(navigator.userAgent.indexOf('MSIE') != -1 && navigator.userAgent.indexOf('Mac') != -1)) {
		if (document.getElementsByTagName)
			var x = document.getElementsByTagName('A');
		else if (document.all)
			var x = document.all.tags('A');
		
		if (x) {
			for (var i=0; i<x.length; i++) {
				if (x[i].parentNode.parentNode != null && x[i].parentNode.parentNode.id != null && String(x[i].parentNode.parentNode.id).substring(0,3) == 'pic') {
					x[i].onmouseover = showDesc;
					x[i].onmouseout = hideDesc;
					var did = String(x[i].parentNode.parentNode.id).substr(3);
					var dy = Number(did.substr(0,1));
					var dx = Number(did.substr(1,1));
					if (dx>2) {
						//alert('dx'+dx);
						
						x[i].parentNode.parentNode.style.borderLeft = "1px solid #999999";
						if (dx==4) x[i].parentNode.parentNode.style.borderRight = "1px solid #999999";
					}else {
						x[i].parentNode.parentNode.style.borderRight = "0px solid #F7F7F7";
					}
				//	x[i].parentNode.parentNode.parentNode.style.zIndex = dy*2;
					//alert(x[i].parentNode.parentNode.parentNode.id);
				}
			}
		}
	}
}



