function enableActiveX (containerID)
// Use it, improve it
// by Dirk Alban Adler // KLITSCHE.DE
{
	// No IE = no need to enable
    if (getInternetExplorerVersion () != -1)
    {
        // Get container
        var container = document.getElementById (containerID);
        // Get html in noscript 
        var html = container.innerHTML; 
        // Write html back to container
        container.innerHTML = html;
    }
}
function getInternetExplorerVersion()
// Returns the version of Internet Explorer or a -1
// Found at: 
// http://msdn.microsoft.com/workshop/author/dhtml/overview/browserdetection.asp
{
    var rv = -1; // Return value assumes failure
    if (navigator.appName == 'Microsoft Internet Explorer')
    {
        var ua = navigator.userAgent;
        var re  = new RegExp ("MSIE ([0-9]{1,}[\.0-9]{0,})");
        if (re.exec (ua) != null)
        {
        	rv = parseFloat (RegExp.$1);
        }
    }
    return rv;
}

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 openTrailer(url){
	breite  = 352;
	hoehe	= 380;
	Fenster = window.open(url,"Zweitfenster","Width=352,Height=380,status=no");
	Fenster.innerWidth = breite;
	Fenster.innerHeight = hoehe;
	Fenster.focus();
}

function checkForm() {
	
	var error = false;
	
	if( document.mail.EMail.value == "" ) {
		alert("Sie müssen Ihre EMail angeben!");
		return false;
	}
	
	if( document.mail.Name.value == "" ) {
		alert("Sie müssen einen Namen angeben!");
		return false;
	}
	
	if( document.mail.Betreff.value == "" ) {
		alert("Sie müssen einen Betreff angeben!");
		return false;
	}
	
	if( document.mail.Text.value == "" ) {
		alert("Sie müssen eine Nachricht angeben!");
		return false;
	}
	
	if( error == false ) {
	
		return true;
		
	}
}

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 openContent(myUrl,winName)
{
    winName = winName + String(Math.floor(Math.random()*1000));
    window.open(myUrl, winName, "scrollbars=yes,menubar=no,toolbar=yes,status=no,resizable=no,width=792,height=620");
}

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+"'");
  }
}
