// JavaScript Document
function menu_right() {
   if(document.all&&!window.opera) {
     var a=document.all.rightcont;
     rightcont.document.body.scroll='no';
   } else {
     var a=document.getElementsByName('rightcont')[0];
     a.scrolling='no';
   }
   var b=rightcont.document.getElementById('contr');
   var c=document.getElementById('rightscroll');

   if(a.offsetHeight<b.offsetHeight) {
     if(!c.childNodes||c.childNodes.length<1) {
      var d=document.createElement('img');
      d.src='images/menu_r_o.jpg';
      d.style.cursor='pointer';
	  d.style.width='60px';
	  d.style.height='30px';
	  d.style.marginBottom='70px';
      d.onmouseover=initUp;
      d.onmouseout=scrollStop;
      c.appendChild(d);
      d=document.createElement('br');
      c.appendChild(d);
      d=document.createElement('img');
      d.src='images/menu_r_u.jpg';
      d.style.cursor='pointer';
	  d.style.width='60px';
	  d.style.height='30px';
      d.onmouseover=initDown;
      d.onmouseout=scrollStop;
      c.appendChild(d);
     }
      } else {
      with (c) {
        for (i=0; firstChild; i++) {
          removeChild(firstChild);
        }
      }
   }
}

function sounddesc(art, text, position) {
	document.getElementById('sounddesc').style.right = position+"px";
	switch (art) {
	case "on":
		document.getElementById('sounddesc').innerHTML = text;
		break;
	case "off":
		document.getElementById('sounddesc').innerHTML = '';
		break;
	}
}

function hidePopUp(divname) {
	hideShow = 'popup_'+divname;
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(hideShow).style.visibility = 'hidden';
	} else {
		if (document.layers) { // Netscape 4
			document.hideShow.visibility = 'hidden';
		} else { // IE 4
			document.all.hideShow.style.visibility = 'hidden';
		} 
	}
}

function closeAllPopUp (expe) {
	var PopArray = new Array("destino", "ubahn", "park");
	
	for (var i = 0; i < PopArray.length; i++) {
		if (PopArray[i] != expe) {
			hidePopUp(PopArray[i]);	
		}
	}
}

function showPopUp (divname) {
	hideShow = 'popup_'+divname;
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(hideShow).style.visibility = 'visible';
	} else {
		if (document.layers) { // Netscape 4
			document.hideShow.visibility = 'visible';
		} else { // IE 4
			document.all.hideShow.style.visibility = 'visible';
		} 
	}
}

function setVisibility (divid, status) {
if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(divid).style.visibility = status;
	} else {
		if (document.layers) { // Netscape status;
		} else { // IE 4
			document.all.divid.style.visibility = status;
		} 
	}
}

function initUp () {
 scrollUp();
}

function initDown () {
 scrollDown();
}

function changePic (pic) {
  if(pic.src.indexOf('up')>0) {
    if(pic.src.indexOf('normal')>0) {
      pic.src="up_over.gif";
    } else {
      pic.src="images/menu_r_o.jpg";
    }
  } else {
    if(pic.src.indexOf('normal')>0) {
      pic.src="down_over.gif";
    } else {
      pic.src="down_normal.gif";
    }
  }
}

function scrollUp() {
  rightcont.scrollBy(0, -5);
  scr = window.setTimeout("scrollUp()",83);
}

function scrollDown() {
  rightcont.scrollBy(0, 5);
  scr = window.setTimeout("scrollDown()",83);
}

function scrollStop() {
  window.clearTimeout(scr);
}


function linedivwidth() {
	  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;
  }

	lwidth = (myWidth-850) / 2;
	document.getElementById('leftline').style.width = lwidth+50+'px';
}


function menu_left() {
   if(document.all&&!window.opera) {
     var a=document.all.leftcont;
     leftcont.document.body.scroll='no';
   } else {
     var a=document.getElementsByName('leftcont')[0];
     a.scrolling='no';
   }
   var b=leftcont.document.getElementById('contl');
   var c=document.getElementById('leftscroll');

   if(a.offsetHeight<b.offsetHeight) {
     if(!c.childNodes||c.childNodes.length<1) {
      var d=document.createElement('img');
      d.src='images/menu_l_o.jpg';
      d.style.cursor='pointer';
	  d.style.width='60px';
	  d.style.height='30px';
	  d.style.marginBottom='70px';
      d.onmouseover=initUpL;
      d.onmouseout=scrollStop;
      c.appendChild(d);
      d=document.createElement('br');
      c.appendChild(d);
      d=document.createElement('img');
      d.src='images/menu_l_u.jpg';
      d.style.cursor='pointer';
	  d.style.width='60px';
	  d.style.height='30px';
      d.onmouseover=initDownL;
      d.onmouseout=scrollStop;
      c.appendChild(d);
     }
      } else {
      with (c) {
        for (i=0; firstChild; i++) {
          removeChild(firstChild);
        }
      }
   }
}

function initUpL () {
 scrollUpL();
}

function initDownL () {
 scrollDownL();
}

function scrollUpL() {
  leftcont.scrollBy(0, -5);
  scr = window.setTimeout("scrollUpL()",83);
}

function scrollDownL() {
  leftcont.scrollBy(0, 5);
  scr = window.setTimeout("scrollDownL()",83);
}