/* Auswahl der LearningGateways */
function GatewayMenu(winName,selObj,restore){
//  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
	winName=winName+String(Math.floor(Math.random()*1000));
	window.open(selObj.options[selObj.selectedIndex].value, winName, "scrollbars=yes,menubar=no,toolbar=no,status=no,resizable=yes,location=no,width=885,height=700");
  if (restore) selObj.selectedIndex=0;
}

function initbox(){
	if (!dom&&!ie&&!ns4)
	return
	crossobj=(dom)?document.getElementById("dropin").style : ie? document.all.dropin : document.dropin
	scroll_top=(ie)? document.body.scrollTop : window.pageYOffset
	crossobj.top=scroll_top-250
	crossobj.visibility=(dom||ie)? "visible" : "show"
	dropstart=setInterval("dropin()",50)
}

function dropin(){
	scroll_top=(ie)? document.body.scrollTop : window.pageYOffset
		if (parseInt(crossobj.top)<100+scroll_top)
		crossobj.top=parseInt(crossobj.top)+40
		else{
		clearInterval(dropstart)
		bouncestart=setInterval("bouncein()",50)
		}
}

function bouncein(){
	crossobj.top=parseInt(crossobj.top)-bouncelimit
		if (bouncelimit<0)
		bouncelimit+=8
		bouncelimit=bouncelimit*-1
		if (bouncelimit==0){
		clearInterval(bouncestart)
		}
}

function dismissbox(){
	if (window.bouncestart) clearInterval(bouncestart)
	crossobj.visibility="hidden"
}

function open_news(id) {
	if (document.getElementById("newsdiv_"+id).style.display == "none") {
		document.getElementById("newsdiv_"+id).style.display = "block";
		document.getElementById("newsdiv_intro_"+id).style.display = "none";
	} else {
		document.getElementById("newsdiv_"+id).style.display = "none";
		document.getElementById("newsdiv_intro_"+id).style.display = "block";
	}
}

function ImageOpen (url,breite,hoehe,options){
	if( !breite && !hoehe ) {
		Fenster = window.open(url,"Zweitfenster","Width=10,Height=10,status=no,"+options);
	} else {
		Fenster = window.open(url,"Zweitfenster","Width="+breite+",Height="+hoehe+",status=no,"+options);
	}
	Fenster.innerWidth = breite;
	Fenster.innerHeight = hoehe;
	Fenster.focus();
}

function OpenBrWindow(i,theURL,winName,w,h,scroll) {
var i;
var xsize = new Array();
var ysize = new Array();
var xpos = new Array();
var ypos = new Array();
var wide = screen.availWidth;
var high  = screen.availHeight;

xsize[0] = w; // Breite des zu öffnenden Fensters
ysize[0] = h; // Höhe des zu öffnenden Fensters
xpos[0] = (wide/2)-(xsize[i]/2);
ypos[0] = (high/2)-(ysize[i]/2);

features = "width=" + xsize[i] + ",height=" + ysize[i] + ",screenX=" + xpos[i] + ",screenY=" + ypos[i] + ",left=" + xpos[i] + ",top=" + ypos[i]
features += ",menubar=0,location=0,locationbar=0,personalbar=0,resizable=1,scrollbars="+scroll+",directories=0,status=0,statusbar=0,toolbar=0";

popupwindow=window.open(theURL,winName,features);
}

function openMovieClip(myUrl,winName)
{
    winName = winName + String(Math.floor(Math.random()*1000));
    window.open(myUrl, winName, "scrollbars=no,menubar=no,toolbar=no,status=no,resizable=no,width=320,height=240");
}

function openCameraTrack(url) {
	options = 'toolbar=no,location=no,status=yes,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=650,height=518';
	pop = open(url, "CameraTrack", options );
	if(navigator.appName == "Netscape"){
		pop.focus();
    }
}

function openMail(myUrl,winName)
{ 
  var myWin = null;  
  winName=winName+String(Math.floor(Math.random()*1000));
  myWin = window.open(myUrl, winName, "scrollbars=yes,menubar=no,toolbar=no,status=no,resizable=no,location=no,width=420,height=360");
}


function openMediaWindow( theUrl, theWidth, theHeight ) {
	
	theWidth  = 540+18;
	theHeight = theHeight+105;
	
	var wide = screen.availWidth;
	var high  = screen.availHeight;
	
	xpos = (wide/2)-(theWidth/2);
	ypos = (high/2)-(theHeight/2);
	
	winName	   = "ICT"+String(Math.floor(Math.random()*1000));
	
	winOptions = "width=" + theWidth + ",height=" + theHeight + ",screenX=" + xpos + ",screenY=" + ypos + ",left=" + xpos + ",top=" + ypos + ","+
				 "menubar=0,location=0,locationbar=0,personalbar=0,resizable=1,scrollbars=no,directories=0,status=0,statusbar=0,toolbar=0";
	
	popUp = window.open( theUrl, winName, winOptions );
	
}

function viewStepByStep(url) {
	options = 'toolbar=no,location=no,status=yes,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=754,height=565';
	pop = open(url, "StepByStep", options );
	if(navigator.appName == "Netscape"){
		pop.focus();
    }
}

function openMediaFile(url) {
	var winName = "Media" + String(Math.floor(Math.random()*1000));
	if( url.toLowerCase().substr( url.length-4, url.length ) == ".swf" ) {
	    options = 'toolbar=no,location=no,status=yes,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=900,height=500';
	} else {
		options = 'toolbar=yes,location=no,status=yes,menubar=yes,scrollbars=no,resizable=yes,copyhistory=no,width=900,height=500';
	}
	pop = open(url, winName, options );
	if(navigator.appName == "Netscape"){
		pop.focus();
    }
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_changeProp(objName,x,theProp,theValue) { //v6.0
  var obj = MM_findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
    if (theValue == true || theValue == false)
      eval("obj."+theProp+"="+theValue);
    else eval("obj."+theProp+"='"+theValue+"'");
  }
}