// aktuelle Flash Version
var _flash_version = 0;

// UserAgent speichern
var agent = navigator.userAgent.toLowerCase();

// ##################################################
// Funktion:     get_flash_version()
// Beschreibung: Liest die aktuelle Version des FLash-Plugins aus
// Autor:        Roland Brueggemann
// Parameter:    -
// Rueckgabe:    (int) Version des Flash-Plugins
// Aufruf:       version = get_flash_version();
// ##################################################

// wird am Anfang jeder Seite aufgerufen
function get_flash_version() {

// NS3+ und Opera3+ (unterstuetzen das plugin-Array):
if (navigator.plugins != null && navigator.plugins.length > 0) {
var flashPlugin = navigator.plugins['Shockwave Flash'];
if (typeof flashPlugin == 'object') { 
if (flashPlugin.description.indexOf('7.') != -1) flashVersion = 7;
else if (flashPlugin.description.indexOf('6.') != -1) flashVersion = 6;
else if (flashPlugin.description.indexOf('5.') != -1) flashVersion = 5;
else if (flashPlugin.description.indexOf('4.') != -1) flashVersion = 4;
else if (flashPlugin.description.indexOf('3.') != -1) flashVersion = 3;
}
}

// IE4+ auf Win32: Plugin ueber ein ActiveX-Object auslesen
else if (agent.indexOf("msie") != -1 && parseInt(navigator.appVersion) >= 4 && agent.indexOf("win")!=-1 && agent.indexOf("16bit")==-1) {
document.write('<scr' + 'ipt language="VBScript"\> \n');
document.write('Private i, x \n');
document.write('On Error Resume Next \n');
document.write('flashControlInstalled = False \n');
document.write('For i = 7 To 1 Step -1 \n');
document.write('Set x = CreateObject("ShockwaveFlash.ShockwaveFlash." & i) \n');
document.write('flashControlInstalled = IsObject(x) \n');
document.write('If flashControlInstalled Then \n');
document.write('flashControlVersion = CStr(i) \n');
document.write('Exit For \n');
document.write('End If \n');
document.write('Next \n');
document.write('</scr' + 'ipt\> \n');

if (flashControlInstalled != null) flashVersion = flashControlVersion;
}

// WebTV 2.5 unterstuetzt Flash 3
else if (agent.indexOf("webtv/2.5") != -1) {
flashVersion = 3;
}

// older WebTV unterstuetzt Flash 2
else if (agent.indexOf("webtv") != -1) {
flashVersion = 2;
}

// gefundene Version zurueckgeben
return(flashVersion);
}


// ##################################################
// Funktion:     flash_movie()
// Beschreibung: Bindet einen beliebigen Flash-Film ein. Wenn dass erforderliche (angegebene) 
//               Plugin nicht vorhanden ist, kann eine Alternativgrafik inkl. Link dargestellt
//               werden
// Autor:        Roland Brueggemann
// Parameter:    
//    minversion Minimal benoetigte Version des Flash-Plugins
//    movie      Pfad zum Flash-Film
//    width      Breite des Flash-Films
//    height     Hoehe des Flash-Films
//    altimage   Pfad zur Alternativgrafik
//    altlink    Link der Alternativgrafik
//    alttarget  Zielframe des Links der Alternativgrafik
// Rueckgabe:    -
// Aufruf:       flash_movie(5, 'test.swf', 250, 100, 'test.gif', 'http://www.mehrkanal.com', '_blank')
// ##################################################

function flash_movie(minversion, movie, width, height, altimage, altlink, alttarget) {

if (!alttarget) {
alttarget = "_self";
}

if (_flash_version >= minversion) {
document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+minversion+',0,0,0" width="'+width+'" height="'+height+'">');
document.write('<param name="movie" value="'+movie+'" />');
document.write('<param name="quality" value="high" />');
document.write('<embed src="'+movie+'" width="'+width+'" height="'+height+'" quality="high" type="application/x-shockwave-flash"></embed>');
document.write('</object>');
} else {
if (altimage) {
if (altlink) {
document.write('<a href="'+altlink+'" target="'+alttarget+'">');
}
document.write('<img src="'+altimage+'" width="'+width+'" height="'+height+'" alt="" border="0">');
if (altlink) {
document.write('</a>');
}
}
}
}

// ##################################################
// Initialisierung
// ##################################################

// Aktuelle Flash Version einlesen
_flash_version = get_flash_version();




//image preload
function vorlader() { 
  var d=document; if(d.images){ if(!d.p) d.p=new Array();
    var i,j=d.p.length,a=vorlader.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf('#')!=0){ d.p[j]=new Image; d.p[j++].src=a[i];}}
}
var globalClicks=0;
function submitForm() { 
  if (globalClicks>0) { return false; }
  globalClicks = globalClicks + 1;
  return true;
}
//mouseoverscript start
function imgHersteller() { 
  var i,x,a=document.sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.osrc;i++) x.src=x.osrc;
}
function Bildwechsel() { 
  var i,j=0,x,a=Bildwechsel.arguments; document.sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=findeObj(a[i]))!=null){document.sr[j++]=x; if(!x.osrc) x.osrc=x.src; x.src=a[i+2];}
}
function findeObj(n, d) { 
  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=findeObj(n,d.layers[i].document); return x;
}
//mouseoverscript end
//oeffnescript 
function popup(FContent, FWidth, FHeight, FTitel, FScroll) {
	window.open(FContent,FTitel,'width='+FWidth+',height='+FHeight+',resizable=no,scrollbars='+FScroll+',scrolling='+FScroll+',resizable=yes');
}




//layer-script:

var layerRef	="";
var styleSwitch	="";
if (window.opera) OP = 1;
else OP=0;

if (document.layers) {
	hilk1="";
	hilk2="";
	layerRef="document.layers.";
	styleSwitch="";
}
if (document.all) {
	hilk1="";
	hilk2="";
	layerRef="";
	styleSwitch=".style";
}

if(document.getElementById){
	hilk1="";
	hilk2="";
	layerRef='document.getElementById("';
	styleSwitch='").style';
}

function setAttrib(layerName0, name, neuWert) {
	if (layerName0){
		if (navigator.appName == "Netscape"){
			eval(layerRef+hilk1+layerName0+hilk2+styleSwitch+'.'+name+'=neuWert');
		}else{
			eval(layerRef+hilk1+layerName0+hilk2+styleSwitch+'.setAttribute("'+name+'","'+neuWert+'","false")');
		}
	}
}


function navOver() {
		setAttrib('navLeistungen', 'display', 'block');
		setAttrib('td2', 'display', 'block');
		
		setAttrib('navLeistungen', 'background', '#CCE2F1');
		setAttrib('td2', 'background', '#CCE2F1');
		
		setAttrib('leistungen', 'background', '#CCE2F1');
}

function navOut() {
		setAttrib('navLeistungen', 'display', 'none');
		setAttrib('td2', 'display', 'none');
		
		setAttrib('navLeistungen', 'background', '#ffffff');
		setAttrib('td2', 'background', '#ffffff');
		
		setAttrib('leistungen', 'background', '#ffffff');
}



