// Nav 4 resize fix
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);

// browserunabhängig objekte finden
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;
}

// ebenen ein und ausblenden
function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
if (plugin){
	plugin = parseInt(plugin.description.substring(plugin.description.indexOf(".")-1)) >= 5;
}else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && (navigator.userAgent.indexOf("Windows 95")>=0 || navigator.userAgent.indexOf("Windows 98")>=0 || navigator.userAgent.indexOf("Windows NT")>=0)){
	document.write('<SCRIPT LANGUAGE=VBScript\> \n');
	document.write('on error resume next \n');
	document.write('plugin = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5")))\n');
	document.write('if ( plugin <= 0 ) then plugin = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5")))\n');
	document.write('<\/SCRIPT\> \n');
}
if (plugin){
	showFlash = true;
}else if (!(navigator.appName && navigator.appName.indexOf("Netscape")>=0 && navigator.appVersion.indexOf("2.")>=0)){
	showFlash = false;
}

/*-------------------------------------------------------------------------
listNewsTickerClass 1.1
12.02.04 Dirk Ginader für Bartenbach & Co. Werbeagentur GmbH & Co. KG
31.03.04 Bugfix (frage nach explitizem Filter vor anwendung
Aufruf (z.B. im onLoad des Bodys):
meinTicker = new listNewsTickerClass('nameDesDivs','meinTicker',3000,true);
-------------------------------------------------------------------------*/
listNewsTickerClass = function(tickerDivID,objName,interval,pauseOnOver){
	if(document.getElementById){
		this.tickerDivID = document.getElementById(tickerDivID);
		this.objName = objName;
		this.interval = interval;
		this.tickerItems = this.tickerDivID.getElementsByTagName("li");
		this.allowTick = true;
		this.tickCount=0;
		this.hideAllItems();
		if(pauseOnOver){
			this.attachPauseOnOver();
		}
		this.tick();
	}
}
listNewsTickerClass.prototype.attachPauseOnOver = function(){
	this.tickerDivID.obj = this;
	this.tickerDivID.onmouseover=function() {
		this.obj.MouseOver();
    }
	this.tickerDivID.onmouseout=function() {
		this.obj.MouseOut();        
	}
}
listNewsTickerClass.prototype.MouseOver = function(){
	this.allowTick = false;
}
listNewsTickerClass.prototype.MouseOut = function(){
	this.allowTick = true;
}
listNewsTickerClass.prototype.tick = function(){
		if(this.allowTick){
			if(document.all){
				if(this.tickerDivID.filters && this.tickerDivID.filters.revealTrans){
					this.tickerDivID.filters.revealTrans.Apply();
				}
			}
			this.showOnlyItem(this.tickCount);
			if(document.all){
				if(this.tickerDivID.filters && this.tickerDivID.filters.revealTrans){
					this.tickerDivID.filters.revealTrans.play();
				}
			}
			this.tickCount++;
			if(this.tickCount>=this.tickerItems.length){
				this.tickCount=0;
			}
		}
		window.setTimeout(""+this.objName+".tick()",this.interval);
}
listNewsTickerClass.prototype.showOnlyItem = function(tickerItem){
	this.hideAllItems();
	this.showItem(this.tickerItems[tickerItem]);
}
listNewsTickerClass.prototype.showItem = function(tickerItem){
	tickerItem.style.display = "list-item";
}
listNewsTickerClass.prototype.hideItem = function(tickerItem){
	tickerItem.style.display = "none";
}
listNewsTickerClass.prototype.hideAllItems = function(){
	for(var i=0;i<this.tickerItems.length;i++){
		this.hideItem(this.tickerItems[i]);
	}
}

function checkFlash(){
	var debugMode = false;
	if(window.location.search == "?debug"){
		debugMode = true;
	}
	if(debugMode){alert('debugMode');}
	if(!window.checked){
		window.checked = true;
		if(showFlash){
			if(debugMode){alert('showFlash');}
			MM_showHideLayers('flashelement','','show');
			MM_showHideLayers('flashimpuls','','show');
			MM_showHideLayers('flashelementpic','','hide');
			MM_showHideLayers('flashimpulspic','','hide');
		}
		if(MM_findObj("slideshow")){
			partnerSlideshow = new listNewsTickerClass('slideshow','partnerSlideshow',3000,true);
		}
	}
}