<!--javascript:head.js-->

//
var backcount = -1;

// Die Funktionen showObject() und hideObject() schalten den Ticker an und aus
// Die Funktion setzeCookie() merkt sich den Tickerzustand in einem Cookie
var ns6 = (!document.all && document.getElementById) ? true : false;
ns4 = (document.layers)? true:false
ie4 = (document.all)? true:false


function setzeCookie(name,value,pfadangabe) 
{
var cookieString = "";
var pfad = escape(pfadangabe);
//var domain = escape(url);
cookieString = name+ "=" +value+ "; path="+pfad;
document.cookie = cookieString;
}


function showObject(obj) {
if (ns4) document.layers[obj].visibility = "show"
else if (ie4) document.all[obj].style.visibility = "visible"
else if (ns6) document.getElementById(obj).style.visibility = "show"

if(obj =='SOMTicker')
 {
 setzeCookie("tickerSOM","an","/");
 }
}

function hideObject(obj) {
if (ns4) document.layers[obj].visibility = "hide"
else if (ie4) document.all[obj].style.visibility = "hidden"
else if (ns6) document.getElementById(obj).style.visibility = "hide"

if(obj =='SOMTicker')
 {
 setzeCookie("tickerSOM","aus","/");
 }
}

function getCookie(name)
{
//funktion zum auslesen eines cookies und rueckgabe des werts
var i=0;
var suche=name+"=";
while(i<document.cookie.length)
{
if(document.cookie.substring(i,i+suche.length)==suche)
{
var ende=document.cookie.indexOf(";",i+suche.length);
ende=(ende>-1) ? ende :document.cookie.length;
var cooks=document.cookie.substring(i+suche.length,ende);
//alert(cooks);
return unescape(cooks);
}
i++;
}
return null;
} 

//ueberpruefe, ob cookie gesetzt fuer den ticker
//und schalte die ebene dementsprechend ein oder aus
function checkCookie()
{
inhalt=getCookie("tickerSOM");
	if(inhalt!=null)
	{ 
		if(inhalt == "an")
		{
		showObject('SOMTicker');
		}
		if(inhalt == "aus")
		{
		hideObject('SOMTicker');
		}
	}
}



function imgOn( imgName )
{
	var extrakt                  = imgName.split( "_" );
	var extraktImgName           = extrakt[0];
	//document.images[imgName].src = "/icons/" +extraktImgName+"_mo.gif";
}


function imgOff( imgName )
{
	var extrakt                  = imgName.split("_");
	var extraktImgName           = extrakt[0];
	//document.images[imgName].src = "/icons/" +extraktImgName+"_s.gif";
}



function expOff()
{
	document.getElementById("Explain").innerHTML = document.getElementById("exp_start").innerHTML;
}



function expOn( which )
{
	document.getElementById("Explain").innerHTML = document.getElementById(which).innerHTML;
}

function secWin(whichFile){
	preDownload = open("/popDownload/index.php?Datei="+whichFile,"prepareDownload","width=300,height=150,top=150,left=200,resizable=no,scrollbars=no");
	}

function openPopUpWindow( side, width, height, top, left, scrollbars )
//function openPopUpWindow( side, width, height, top, left )
{
 if (side && side != null)
 {
  var newWindow = null;
 // newWindow = newWindow = document.open( side, "_blank", "width=" + width + ",height=" + height + ",top="+ top + ", left=" + left + ", toolbar=no, status=no, scrollbars=auto, location=no, menubar=no, directories=no, resizable=yes" );
  newWindow = document.open(side, "_blank", "width=" + width + ",height=" + height + ",top="+ top + ",left=" + left + ",toolbar=no,status=no,location=no,menubar=no,directories=no,resizable=no,scrollbars=" + scrollbars + ",scrolling=");
  window.name='hauptfenster';
 }
 return;
}

function pop_sofort(i,target)
    {
	
       window.open(i,target,'status=no,scrollbars=no,resizable=yes,width=566,height=566,top=460,left=10');
    } 


// setFocus(fieldName)
// setzt den Focus auf ein Formularfeld, so es existiert
// Carlo Zottmann, 2003-09-26

function setFocus(fieldName) {
	if (document.getElementsByName(fieldName)[0]) {
		document.getElementsByName(fieldName)[0].focus();
	}
}



// enableFormField(fieldName, enable)
// schaltet Eingabefeld (fieldName) an und aus (enable (bool))
// Carlo Zottmann, 2003-09-26

function enableFormField(fieldName, enable) {
	var el = document.getElementsByName(fieldName)[0];

	if (enable) {
		if (el.disabled) {
			el.style.backgroundColor = el.oldBackgroundColor;
		}
	} else {
		if (!el.disabled) {
			el.oldBackgroundColor = el.style.backgroundColor;
			el.style.backgroundColor = '#DDDDDD';
		}
	}

	el.disabled = !enable;
}


// Vollbild Popup
function popUp_Vollbild(seite){
	vollbild = window.open(seite,'_blank','fullscreen=yes');
	} 

// Kommunikationsfunktion für den Flash Ticker
// Wird von SOMTicker aufgerufen und liefert die TopLevelDomain zurück.
// Danach lädt SOMTicker die Datei(z.b. SOM_newsticker.php) mit den der Domain entsprechenden Tickerinhalten.

var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
// Handle all the the FSCommand messages in a Flash movie
function SOMTicker_DoFSCommand(command, args) {
  var SOMTickerObj = InternetExplorer ? SOMTicker : document.SOMTicker;
  //
  	if (command == "getTDL"){
		var aHostLevel = top.location.host.split(".");
	  	var TDL = aHostLevel[aHostLevel.length - 1].toUpperCase();
	  	SOMTickerObj.setvariable("_level0.myTDL",TDL);
	}
  //
}
// Hook for Internet Explorer 
if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && 
	  navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
	document.write('<SCRIPT LANGUAGE=VBScript\> \n');
	document.write('on error resume next \n');
	document.write('Sub SOMTicker_FSCommand(ByVal command, ByVal args)\n');
	document.write('  call SOMTicker_DoFSCommand(command, args)\n');
	document.write('end sub\n');
	document.write('</SCRIPT\> \n');
}

// PopUpWindow
var popUpWin=0;
function popUpWindow(URLStr, left, top, width, height)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menub ar=no,scrollbar=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}


// PopUp Samvara

var win=null;
function NewWindow(mypage,myname,w,h,pos,infocus){
if(pos=="random"){myleft=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;mytop=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){myleft=(screen.width)?(screen.width-w)/2:100;mytop=(screen.height)?(screen.height-h)/2:100;}
else if((pos!='center' && pos!="random") || pos==null){myleft=0;mytop=20}
settings="width=" + w + ",height=" + h + ",top=" + mytop + ",left=" + myleft + ",scrollbars=no,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no";win=window.open(mypage,myname,settings);
win.focus();}

var headID = document.getElementsByTagName("head")[0];         
var newScript = document.createElement('script');
newScript.type = 'text/javascript';
newScript.src = '/scripts/swfobject.js';
headID.appendChild(newScript);
<!--/javascript:head.js-->
