//var min_width = 1004;
if (screen.width <= 1024) {
  document.write('<style type="text/css" media="screen, projection">@import "/css/background.css";</style>');
} else {
  document.write('<style type="text/css" media="screen, projection">@import "/css/background_1280.css";</style>');
}

if (screen.width <= 960) {
	document.write('<style type="text/css">#bildvergroessern{display:none;}</style>');	
}

startList = function() {
if (document.all&&document.getElementById) {
navRoot = document.getElementById("nav");
for (i=0; i<navRoot.childNodes.length; i++) {
node = navRoot.childNodes[i];
if (node.nodeName=="LI") {
node.onmouseover=function() {
this.className+=" over";
  }
  node.onmouseout=function() {
  this.className=this.className.replace(" over", "");
   }
   }
  }
 }
}
window.onload=startList;
/*
document.onclick = function (){
	document.getElementById('quicknav').getElementsByTagName('ul')[0].style.display = 'none';
	document.getElementById('toplink').style.background = '';
	document.getElementById('toplink').style.color = '';
}
function quicknav_open(){
		timeout = false;
		document.getElementById('quicknav').getElementsByTagName('ul')[0].style.display = 'block';
		document.getElementById('toplink').style.background = '';
		document.getElementById('toplink').style.color = '';
		return void(0);
}
function quicknav_close(){
		timeout = window.setTimeout("quicknav_close_t()", 300);
	}
function quicknav_close_t(){
		document.getElementById('quicknav').getElementsByTagName('ul')[0].style.display = 'none';
		document.getElementById('toplink').style.background = '';
		document.getElementById('toplink').style.color = '';
		return void(0);
}
/*
function determineWidth() {
	var browser_width;
	if(document.all) browser_width = document.body.clientWidth;
	else if ((document.layers) || (document.getElementById)) { browser_width = innerWidth; browser_width -= 30; }
	if (browser_width > min_width) { return false; }
	else { return true;	}
	alert(browser_width);
}


function setActiveStyleSheet(title) {
  var i, a, main;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
      a.disabled = true;
      if(a.getAttribute("title") == title) a.disabled = false;
    }
  }
}
*/

//function checkVisibility() {

/*
	determinator = determineWidth();
	if(determinator)  setActiveStyleSheet('');
	else setActiveStyleSheet('high'); 
}
*/
function bigbackground(){
	url = "/de-background.shtml";
	width = "1024";
	height = "768";
	newwindow=window.open(url,name,'height='+height+',width='+width);
	if (window.focus) {newwindow.focus()}
}
function fenster() {
	url = "/nav/anfahrts_plan.gif";
	width = "720";
	height = "585";
	newwindow=window.open(url,name,'height='+height+',width='+width);
	if (window.focus) {newwindow.focus()}
}
function win(url,w,h){
	newwindow=window.open(url,name,'height='+h+',width='+w);
	if (window.focus) {newwindow.focus()}
}

function drawQuicktime(pfad){
	document.write('<Object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" width="500" height="357" codebase="http://www.apple.com/qtactivex/qtplugin.cab">');
	document.write('<param name = "src" value = "' + pfad + '">');
	document.write('<param name = "autoplay" value = "true">');
	document.write('<param name = "controller" value = "true">');
	document.write('<param name = "scale" value = "tofit">');
	document.write('<embed src="' + pfad + '" width="500" height="357" cache="true" controller="true" scale="tofit" pluginspage="http://www.apple.com/quicktime/download"></embed>');
	document.write('</Object>');
}


/*/////////////////////////////////////////////////////////////
                          Flash Check
/////////////////////////////////////////////////////////////*/
<!--
// -----------------------------------------------------------------------------
// Globals
// Major version of Flash required
var requiredMajorVersion = 8;
// Minor version of Flash required
var requiredMinorVersion = 0;
// Minor version of Flash required
var requiredRevision = 0;
// the version of javascript supported
var jsVersion = 1.0;
// -----------------------------------------------------------------------------
// -->

document.write('<script language="VBScript" type="text/vbscript"\> \n');
document.write('// Visual basic helper required to detect Flash Player ActiveX control version information\n');
document.write('Function VBGetSwfVer(i)\n');
document.write('  on error resume next\n');
document.write('  Dim swControl, swVersion\n');
document.write('  swVersion = 0\n');
document.write('  set swControl = CreateObject("ShockwaveFlash.ShockwaveFlash." + CStr(i))\n');
document.write('  if (IsObject(swControl)) then\n');
document.write('    swVersion = swControl.GetVariable("$version")\n');
document.write('  end if\n');
document.write('  VBGetSwfVer = swVersion\n');
document.write('End Function\n');
document.write('//\n ');
document.write('</script\>');

<!-- // Detect Client Browser type

var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
jsVersion = 1.1;
// JavaScript helper required to detect Flash Player PlugIn version information
function JSGetSwfVer(i){
	// NS/Opera version >= 3 check for Flash plugin in plugin array
	if (navigator.plugins != null && navigator.plugins.length > 0) {
		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
			var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
      		var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
			descArray = flashDescription.split(" ");
			tempArrayMajor = descArray[2].split(".");
			versionMajor = tempArrayMajor[0];
			versionMinor = tempArrayMajor[1];
			if ( descArray[3] != "" ) {
				tempArrayMinor = descArray[3].split("r");
			} else {
				tempArrayMinor = descArray[4].split("r");
			}
      		versionRevision = tempArrayMinor[1] > 0 ? tempArrayMinor[1] : 0;
            flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
      	} else {
			flashVer = -1;
		}
	}
	// MSN/WebTV 2.6 supports Flash 4
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
	// WebTV 2.5 supports Flash 3
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
	// older WebTV supports Flash 2
	else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
	// Cant detect in all other cases
	else {
		
		flashVer = -1;
	}
	return flashVer;
} 

// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision) 
{

 	reqVer = parseFloat(reqMajorVer + "." + reqRevision);
   	// loop backwards through the versions until we find the newest version	
	
	for (i=25;i>0;i--) {	
		
		if (isIE && isWin && !isOpera) {
			versionStr = VBGetSwfVer(i);
			
		} else {
			versionStr = JSGetSwfVer(i);		
		}
		
		
		if (versionStr == -1 ) { 
			return false;
		} else if (versionStr != 0) {
			if(isIE && isWin && !isOpera) {
				tempArray         = versionStr.split(" ");
				tempString        = tempArray[1];
				versionArray      = tempString .split(",");				
			} else {
				versionArray      = versionStr.split(".");
			}
			versionMajor      = versionArray[0];
			versionMinor      = versionArray[1];
			versionRevision   = versionArray[2];
			
			versionString     = versionMajor + "." + versionRevision;   // 7.0r24 == 7.24
			versionNum        = parseFloat(versionString);
        	// is the major.revision >= requested major.revision AND the minor version >= requested minor
			if ( (versionMajor > reqMajorVer) && (versionNum >= reqVer) ) {
				return true;
			} else {
				return ((versionNum >= reqVer && versionMinor >= reqMinorVer) ? true : false );	
			}
		}
	}	
}

// Version check based upon the values entered above in "Globals"
var fl = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);

/*/////////////////////////////////////////////////////////////
                     Draw Flash Funktion
/////////////////////////////////////////////////////////////*/
/*
Aufruf:
drawFlash(pfad, width, height, wmode, bgcolor, id, alt, rw);

pfad = der Pfad zur .swf Datei
width,height = Breite und Höhe
wmode = wmode-Eigenschaf des Flash Objekts
bgcolor = Hintergrundfarbe
id = die id des <object> Tag
alt = HTML-Code der zurückgegeben wird wenn Flash nicht aktiv ist
rw = true wenn das Flash object per document.write geschrieben werden soll.
*/
/**
 * @projectDescription giebt den Quellcode für ein Flash-Object zurück oder schreibt es per document.write ins Dokument.
 * @param {String} pfad
 * @param {Int} width
 * @param {Int} height
 * @param {String} wmode
 * @param {String} bgcolor
 * @param {String} id
 * @param {String} alt
 * @param {Boolean} rw
 * @return {String}
 */
function drawFlash(pfad, width, height, wmode, bgcolor, id, alt, rw){
	ausgabe = "";
	if(fl){
		params = false;
		if(pfad.indexOf("?") != -1){
			params = pfad.split("?")[1];
			pfad = pfad.split("?")[0];
		}
		ausgabe += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" name="flash" width="' + width + '" id="' + id + '" height="' + height + '" align="middle">';
		ausgabe += '<param name="allowScriptAccess" value="sameDomain" />';
		if(wmode!=""){ausgabe += '<param name="wmode" value="' + wmode + '" />';}
		if(bgcolor!=""){ausgabe += '<param name="bgcolor" value="' + bgcolor + '" />';}
		if(params){ausgabe += '<param name="flashvars" value="' + params + '" />';}
		ausgabe += '<param name="movie" value="' + pfad + '" /><param name="menu" value="false" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />';
		ausgabe += '<embed src="' + pfad + '" width="' + width + '" height="' + height + '"';
		if(wmode!=""){ausgabe += ' wmode="' + wmode + '"';}
		if(bgcolor!=""){ausgabe += ' bgcolor="' + bgcolor + '"';}
		if(params){ausgabe += ' flashvars="' + params + '"';}
		ausgabe += ' menu="false" align="middle" quality="high" bgcolor="#ffffff" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" name="flash" />';
		ausgabe += '</object>';
	}
	else{
		ausgabe += alt;
	}
	if(rw){
		document.write(ausgabe);
	}
	return ausgabe;
}

function startSlideShow(object, path, imgarr){
	object.imgarr = imgarr;
	object.path = path;
	object.aktpic = Math.round(Math.random()*imgarr.length);
	setTimeout('runSlideShow("' + object.id + '")', 5000);
}
function runSlideShow(objectid){
	object = document.getElementById(objectid);
	if (document.all){
		object.style.filter='blendTrans(duration='+'1,5'+')';
		object.filters.blendTrans.Apply();   
	}
	zw = Math.round(Math.random()*object.imgarr.length);
	while(zw==object.aktpic && object.imgarr.length>1){
		zw = Math.round(Math.random()*object.imgarr.length);
	}
	if(!object.imgarr[zw]){
		zw=0;
	}
	object.aktpic=zw;
	object.src = object.path + object.imgarr[object.aktpic];
	if (document.all){
		object.filters.blendTrans.Play();
	}
	setTimeout('runSlideShow("' + objectid + '")', 5000);
}