var img_level = "";

//***************************************
//	Browser-Check
//***************************************
is = new BrowserCheck();
function BrowserCheck() {
	var b = navigator.appName;
	if (b=="Netscape") this.b = "nc"
	else if (b=="Microsoft Internet Explorer") this.b = "ie"
	else this.b = b
	this.v = parseInt(navigator.appVersion);
	this.nc = (this.b=="nc" && this.v>=4);
	this.nc4 = (this.b=="nc" && this.v==4);
	this.nc6 = (this.b=="nc" && this.v>=5);
	this.ie = (this.b=="ie" && this.v>=4);
	this.ie4 = (navigator.userAgent.indexOf('MSIE 4')>0&&navigator.userAgent.indexOf('Opera')<0);
	this.ie5 = (navigator.userAgent.indexOf('MSIE 5')>0&&navigator.userAgent.indexOf('Opera')<0);
	this.ie6 = (navigator.userAgent.indexOf('MSIE 6')>0&&navigator.userAgent.indexOf('Opera')<0);
	this.badie = (this.b=="ie" && !(navigator.userAgent.indexOf('MSIE 5.5')>0) && !(navigator.userAgent.indexOf('6')>0));
	if (this.ie5) this.v = 5
	if (this.ie6) this.v = 6
	this.min = (this.nc||this.ie);
}

//***************************************
//	Flash-Aufruf
//***************************************
function getFlash(swf,width,height) {
		document.write('<object border="0" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+width+'" height="'+height+'">');
		document.write(' <param name="movie" value="'+swf+'">');
		document.write(' <param name="quality" value="high">');
		document.write(' <param name="menu" value="false">');
		document.write(' <param name="wmode" value="transparent">');
		document.write(' <embed src="'+swf+'" quality="high" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+width+'" height="'+height+'"></embed>');
		document.write('</object>');
}

var useRedirect = false;
var flash2Installed = false;
var flash3Installed = false;
var flash4Installed = false;
var flash5Installed = false;
var flash6Installed = false;
var flash7Installed = false;
var flash8Installed = false;
var maxVersion = 8;
var actualVersion = 0;
var jsVersion = 1.0;
var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.indexOf("Windows") != -1) ? true : false;
var hasRightVersion;
var ObjectName;
var ImageName; 
var Link; 
var bLink = true;
var Target; 
var requiredVersion;
var width;
var height;
var Container;
var ContainerStringNN4;

jsVersion = 1.1;
if(isIE && isWin) {
	document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
	document.write('on error resume next \n');
	document.write('flash2Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.2"))) \n');
	document.write('flash3Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.3"))) \n');
	document.write('flash4Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4"))) \n');
	document.write('flash5Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5"))) \n');  
	document.write('flash6Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6"))) \n');  
	document.write('flash7Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.7"))) \n');
	document.write('flash8Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.8"))) \n');
	if (navigator.appVersion.indexOf("MSIE 7.") != -1) document.write('flash6Installed = true \n');  
	document.write('</SCR' + 'IPT\> \n');
}

function getFlash2(swf,png,width,height,title) {
	requiredVersion = 6;
	if(title==null) title="";
	/*
	if (is.ie) {
		document.write('<object border="0" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" style="width:'+width+';height:'+height+';">');
		document.write(' <param name="movie" value="images/'+swf+'">');
		document.write(' <param name="quality" value="high">');
		document.write(' <param name="menu" value="false">');
		document.write(' <param name="wmode" value="transparent">');
		document.write(' <embed src="flash/'+swf+'" quality="high" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" style="width:'+width+';height:'+height+';"></embed>');
		document.write('</object>');
	}
	else {
		document.write('<img src="images/'+png+'" width="100%">');
	}
	*/
	// Existiert navigator.plugins
	if (navigator.plugins) {
		// Flash 2 oder 3
		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
			var isVersion2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
			var flashDescription = navigator.plugins["Shockwave Flash" + isVersion2].description;
			var flashVersion= parseInt(flashDescription.charAt(flashDescription.indexOf(".") - 1));
			flash2Installed = flashVersion == 2;    
			flash3Installed = flashVersion == 3;
			flash4Installed = flashVersion == 4;
			flash5Installed = flashVersion == 5;
			flash6Installed = flashVersion == 6;
			flash7Installed = flashVersion == 7;
			flash8Installed = flashVersion >= 8;
		}
	}
  
	for (var i = 2; i <= maxVersion; i++) {  
		if (eval("flash" + i + "Installed") == true) actualVersion = i;
	}
  
 	if(navigator.userAgent.indexOf("WebTV") != -1) actualVersion = 3;  
	//alert("actualVersion: "+actualVersion+", requiredVersion: "+requiredVersion);
	// falls benoetigtes FlashPlugin vorhanden
	if (actualVersion >= requiredVersion ) {	
		showFlash = true;
		document.write('<object border="0" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" title="'+title+'" width="'+width+'" height="'+height+'">');
		document.write(' <param name="movie" value="'+swf+'">');
		document.write(' <param name="quality" value="high">');
		document.write(' <param name="menu" value="false">');
		document.write(' <param name="wmode" value="transparent">');
		document.write(' <embed src="'+swf+'" quality="high" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" title="'+title+'" width="'+width+'" height="'+height+'"></embed>');
		document.write('</object>');
	}
	// falls FlashPlugin nicht vorhanden oder zu niedrige Version Ersatzbild anzeigen
	else {
		document.write('<img src="'+png+'" width="'+width+'" title="'+title+'">');
	}
	
}
//***************************************
//	Opacity-Effekt
//***************************************
function opacity(id, opacStart, opacEnd, millisec) { 
    //speed for each frame 
    var speed = Math.round(millisec / 100); 
    var timer = 0; 

    //determine the direction for the blending, if start and end are the same nothing happens 
    if(opacStart > opacEnd) { 
        for(i = opacStart; i >= opacEnd; i--) { 
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); 
            timer++; 
        } 
    } else if(opacStart < opacEnd) { 
        for(i = opacStart; i <= opacEnd; i++) 
            { 
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); 
            timer++; 
        } 
    } 
} 
//change the opacity for different browsers 
function changeOpac(opacity, id) { 
    var object = document.getElementById(id).style; 
    object.opacity = (opacity / 100); 
    object.MozOpacity = (opacity / 100); 
    object.KhtmlOpacity = (opacity / 100); 
    object.filter = "alpha(opacity=" + opacity + ")"; 
} 

document.write('<style type="text/css">');
document.write('#content {opacity: 0;-moz-opacity: 0;-khtml-opacity: 0;filter: alpha(opacity=0);}');
document.write('</style>');

function initStart() {
	opacity('content', 0, 100, 1000);
	
}

YAHOO.util.Event.addListener(window, "load", initStart);