var NS4=0, IE4=0, ver4=0, isMac=0, sTrans=0;

NS4 = (document.layers) ? 1 : 0;
IE4 = (document.all) ? 1 : 0;
NS6 = (document.getElementById);

ver4 = (NS4 || IE4 || NS6) ? 1 : 0;
isMac = (navigator.appVersion.indexOf("Mac") != -1) ? 1 : 0;

if (NS4) {
	origWidth = innerWidth;
    origHeight = innerHeight;
}

function reDo() {
	if (innerWidth != origWidth || innerHeight != origHeight) {
		location.reload();
	}
}

if (NS4) onresize = reDo;

function playSndInWindow(sound_name, mode) {

    if (mode == 'realplay') {
      if (navigator.appName.indexOf("Microsoft") >= 0) {
          awinh = window.open("rplayer.html?'" + sound_name + "'", "RealPlayer", "width=260,height=100,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,top=50,left=150");
      } else {
          awinh = window.open("rplayer.html?'" + sound_name + "'", "RealPlayer", "toolbar=no,titlebar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,screenX=150,screenY=50,width=260,height=100");
      }
      awinh.focus();
    }
    if (mode == 'mp3') {
            playMp3(sound_name);
    }

 }

 	function playMp3(Mp3File) {
		location.href=Mp3File;
		return false;
	}


function FindImage(doc, name, j) {

    var theImage = false;
    if (doc.images) {
        theImage = doc.images[name];
    }
    if (theImage) {
        return theImage;
    }
    if (doc.layers) {
        for (j = 0; j < doc.layers.length; j++) {
            theImage = FindImage(doc.layers[j].document, name, 0);
            if (theImage) {
                return (theImage);
            }
        }
    }
    return 0;
}

function showWindow(fname, param, w, h, title) {
     var myUrl = top.location.href;
     var x = (screen.availWidth - w);
     fUrl = fname + "?" + param;
     if (!title) {
	 title = "Video";
     }
     if (IE4) {
          awinh = window.open(fUrl, "", "width=" + w + ", height=" + h + ", toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=yes, top=50,left=" + x);
     } else {
          awinh = window.open(fUrl, title, "toolbar=no, titlebar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=yes, screenX=" + x + ", screenY=50, width=" + w + ", height=" + h);
     }

     awinh.moveTo(x, 50);
     awinh.resizeTo(w, h);
     awinh.focus();
     awinh.opener = document;
}

/*
// Legt Variablen für Betriebssystem und Browser fest
var agt=navigator.userAgent.toLowerCase();
var ie = (agt.indexOf("msie") != -1);
var ns = (navigator.appName.indexOf("Netscape") != -1);
var win = ((agt.indexOf("win")!=-1) || (agt.indexOf("32bit")!=-1));
var mac = (agt.indexOf("mac")!=-1);


// sucht nach dem Plugins
if (ie && win) { 
	pluginlist = detectIE("QuickTimeCheckObject.QuickTimeCheck.1","QuickTime") + detectIE("MediaPlayer.MediaPlayer.1","Windows Media Player"); 
	
}
if (ns || !win) {
	nse = ""; 
	for (var i=0;i<navigator.mimeTypes.length;i++) 
		nse += navigator.mimeTypes[i].type.toLowerCase();
		pluginlist = detectNS("video/quicktime","QuickTime") + detectNS("application/x-mplayer2","Windows Media Player");
}

function detectIE(ClassID,name) { 
	result = false; 
	document.write('<SCRIPT LANGUAGE=VBScript>n on error resume next n result = IsObject(CreateObject("' + ClassID + '"))</SCRIPT>n'); 
	if (result) 
		return name+','; 
	else 
		return ''; 
}

function detectNS(ClassID,name) { 
	n = ""; 
	if (nse.indexOf(ClassID) != -1) 
		if (navigator.mimeTypes[ClassID].enabledPlugin != null) 
			n = name+","; 
			
	return n; 
}

if (pluginlist.length > 0) 
	pluginlist = pluginlist.substring(0,pluginlist.length-1);

*/
