//var maxResolution = 1024;
var maxResolution = 990; 
var minResolution = 800; 

function showPreview(obj) {
    resetPreviews();
    document.getElementById('item-'+obj).style.display = 'block';
    document.getElementById('hover-'+obj).style.display = 'block';
}

function resetPreviews() {
    //document.getElementById('download-hover').style.display = 'none';
    for (var i=0;i<document.getElementsByTagName('div').length;i++) {
		//alert(i+" - "+document.getElementsByTagName('div')[i].className);
		if ((document.getElementsByTagName('div')[i].className == 'download-hover') || (document.getElementsByTagName('div')[i].className == 'download-preview')) {
			document.getElementsByTagName('div')[i].style.display = 'none';
        }
    }
}

function openPopup(url, width, height, winname) {
	var old = self;
	var trails="width=" + width + ",height=" + height + ",toolbar=no,directories=no,status=yes,scrollbars=yes,resizable=no,menubar=no";
	newWindow=window.open(url,winname,trails);
}

function getWidth() {
   if ((navigator.appName=="Netscape") || ((navigator.userAgent).indexOf("Opera")!=-1)) {
       width = window.innerWidth;
   } else {
	   width = document.body.offsetWidth;		
   }
   return width;
}

function getHeight() {
   if ((navigator.appName=="Netscape") || ((navigator.userAgent).indexOf("Opera")!=-1)) {
       height = window.innerHeight;
   } else {
	   height = document.body.offsetHeight;		
   }
   return height;
}

// Sets definition of iframe for different Screen resolutions (height variable)
function setIframe(url) {
  var iframeOut = "";
  height = getHeight();
  maxHeight800 = height - 78;
  maxHeight1024 = height - 62;
  if (window.screen) {
  if (height < 624) {
       iframeOut = "<iframe id=\u0022frame\u0022 src=\u0022" + url +"\u0022 width=\u0022100\u0025\u0022 height=\u0022"+maxHeight800+"\u0022 name=\u0022Content\u0022 marginheight=\u00220\u0022 marginwidth=\u00220\u0022 frameborder=\u00220\u0022><p>Ihr Browser kann leider keine eingebetteten Frames anzeigen: Sie k&ouml;nnen die eingebettete Seite &uuml;ber den folgenden Verweis aufrufen: <a href=\u0022i1s1.html\u0022>Inhalt</a></p></iframe>";
     } else {
       iframeOut = "<iframe id=\u0022frame\u0022 src=\u0022" + url +"\u0022 width=\u0022100\u0025\u0022 height=\u0022"+maxHeight1024+"\u0022 name=\u0022Content\u0022 marginheight=\u00220\u0022 marginwidth=\u00220\u0022 frameborder=\u00220\u0022><p>Ihr Browser kann leider keine eingebetteten Frames anzeigen: Sie k&ouml;nnen die eingebettete Seite &uuml;ber den folgenden Verweis aufrufen: <a href=\u0022i1s1.html\u0022>Inhalt</a></p></iframe>";
     }
   }
   return iframeOut;
 }
// End 

// Sets Table Size for different Screen resolutions
function startTable(nr) {
  var htmlOut = "";
  width = getWidth();
     if (width < maxResolution) {
	 	// 800 x 600
		if (nr == '1') {
       	htmlOut = "<table width=\u0022762\u0022 border=\u00220\u0022 cellpadding=\u00220\u0022 cellspacing=\u00220\u0022>";
		}
		else {
		htmlOut = "<table width=\u0022160\u0022 border=\u00220\u0022 cellpadding=\u00220\u0022 cellspacing=\u00220\u0022>";
		}
     } 
	 else {
	 	// 1024 x 786
		if (nr == '1') {
       	htmlOut = "<table width=\u0022986\u0022 border=\u00220\u0022 cellpadding=\u00220\u0022 cellspacing=\u00220\u0022>";
		}
		else {
		htmlOut = "<table width=\u0022220\u0022 border=\u00220\u0022 cellpadding=\u00220\u0022 cellspacing=\u00220\u0022>";
		}
     }
   return htmlOut;
 }
// End

function langswitcher() {
   var langswitch= document.getElementById('langswitch');
   if(langswitch.style.display=="block") langswitch.style.display= 'none';
   else langswitch.style.display= 'block';
}


/**
 * FLASH DETECT hr@netural 20-07-2005
 **/

var flashVersion = 0;

document.write('<scr' + 'ipt language="VBScript"\> \n');
document.write('Function VBGetSwfVer(i) \n');
document.write('on error resume next \n');
document.write('Dim swControl \n');
document.write('set swControl = CreateObject("ShockwaveFlash.ShockwaveFlash." + CStr(i)) \n');
document.write('if (IsObject(swControl)) then \n');
document.write('flashVersion = i \n');
document.write('end if \n');
document.write('End Function \n');
document.write('</scr' + 'ipt\> \n');

function getFlashVersion() {
    var agent = navigator.userAgent.toLowerCase();
    if (agent.indexOf("mozilla/3") != -1 && agent.indexOf("msie") == -1) {
        flashVersion = 0;
    }
    if (navigator.plugins != null && navigator.plugins.length > 0) {
        var flashPlugin = navigator.plugins['Shockwave Flash']; 
        if (typeof flashPlugin == 'object') {
            for (i=25;i>0;i--) {
                if (flashPlugin.description.indexOf(i+'.') != -1) {
                    flashVersion = i;
                }
            }
        }
    } else if ((agent.indexOf("msie") != -1) && (parseInt(navigator.appVersion) >= 4) && (agent.indexOf("win") != -1) && (agent.indexOf("16bit") == -1)) {
        for (i=0;i<25;i++) {
            VBGetSwfVer(i);
        }
    }
    return flashVersion;
}