function Cookiemanager(name,defaultExpiration,expirationUnits,defaultDomain,defaultPath)
{
	this.name = name;
	this.defaultExpiration = this.getExpiration(defaultExpiration,expirationUnits);
	this.defaultDomain = (defaultDomain)?defaultDomain:(document.domain.search(/[a-zA-Z]/) == -1)?document.domain:document.domain.substring(document.domain.indexOf('.') + 1,document.domain.length);
	this.defaultPath = (defaultPath)?defaultPath:'/';
	this.cookies = new Object();
	this.expiration = new Object();
	this.domain = new Object();
	this.path = new Object();
	window.onunload = new Function (this.name+'.setDocumentCookies();');
	this.getDocumentCookies();
}
Cookiemanager.prototype.getExpiration = function(expiration,units)
{
	expiration = (expiration)?expiration:7;
	units = (units)?units:'days';
	var date = new Date();
	switch (units)
	{
		case 'years':
			date.setFullYear(date.getFullYear() + expiration);
			break;
		case 'months':
			date.setMonth (date.getMonth() + expiration);
			break;
		case 'days':
			date.setTime (date.getTime()+(expiration*24*60*60*1000));
			break;
		case 'hours':
			date.setTime (date.getTime()+(expiration*60*60*1000));
			break;
		case 'minutes':
			date.setTime (date.getTime()+(expiration*60*1000));
			break;
		case 'seconds':
			date.setTime (date.getTime()+(expiration*1000));
			break;
		default:
			date.setTime (date.getTime()+expiration);
			break;
	}
	return date.toGMTString ();
}
Cookiemanager.prototype.getDocumentCookies = function()
{
	var cookie,pair;
	var cookies = document.cookie.split(';');
	var len = cookies.length;
	for(var i = 0;i < len;i ++)
	{
		cookie = cookies[i];
		while (cookie.charAt (0) == ' ') cookie = cookie.substring (1,cookie.length);
		pair = cookie.split('=');
		this.cookies[pair[0]] = pair[1];
	}
}
Cookiemanager.prototype.setDocumentCookies = function()
{
	var expires = '';
	var cookies = '';
	var domain = '';
	var path = '';
	for(var name in this.cookies)
	{
		expires = (this.expiration[name])?this.expiration[name]:this.defaultExpiration;
		path = (this.path[name])?this.path[name]:this.defaultPath;
		domain = (this.domain[name])?this.domain[name]:this.defaultDomain;
		cookies = name + '=' + this.cookies[name] + '; expires=' + expires + ';	path=' + path + '; domain=' + domain;
		document.cookie = cookies;
	}
	return true;
}
Cookiemanager.prototype.getCookie = function(cookieName)
{
	var cookie = this.cookies[cookieName]
	return (cookie)?cookie:false;
}
Cookiemanager.prototype.setCookie = function(cookieName,cookieValue,expiration,expirationUnits,domain,path)
{
	this.cookies[cookieName] = cookieValue;
	if (expiration) this.expiration[cookieName] = this.getExpiration(expiration,expirationUnits);
	if (domain) this.domain[cookieName] = domain;
	if (path) this.path[cookieName] = path;
	return true;
}
var cookieManager = new Cookiemanager('cookieManager',1,'years');
var efa_default = 83;
var efa_increment = 10;
var efa_bigger = ['<b>Font size<'+'/b><br>',
				  'bigger',
				  'bigger',
				  'schrift',
				  '',
				  '',
				  '',
				  '',
				  '',
				  '',
				  '<br> '
				  ]
var efa_reset = ['',
				 'reset',
				 'reset',
				 'schrift',
				 '',
				 '',
				 '',
				 '',
				 '',
				 '',
				 '<br> '
				 ]
var efa_smaller = ['',
				   'smaller',
				   'smaller',
				   'schrift',
				   '',
				   '',
				   '',
				   '',
				   '',
				   '',
				   '<br>'
				   ]
function Efa_Fontsize(increment,bigger,reset,smaller,def)
{
	this.w3c = (document.getElementById);
	this.ms = (document.all);
	this.userAgent = navigator.userAgent.toLowerCase ();
	this.isOldOp = ((this.userAgent.indexOf ('opera') != -1) && (parseFloat (this.userAgent.substr(this.userAgent.indexOf ('opera')+5)) <= 7));
	if ((this.w3c || this.ms) && !this.isOldOp && !this.isMacIE)
	{
		this.name = "efa_fontSize";
		this.cookieName = 'efaSize';
		this.increment = increment;
		this.def = def;
		this.defPx = Math.round (16*(def/100))
		this.base = 1;
		this.pref = this.getPref();
		this.testHTML = '<div id="efaTest" style="position:absolute;visibility:hidden;line-height:1em;">&nbsp;</div>';
		this.biggerLink = this.getLinkHtml(1,bigger);
		this.resetLink = this.getLinkHtml(0,reset);
		this.smallerLink = this.getLinkHtml(-1,smaller);
	} else {
		this.biggerLink = '';
		this.resetLink = '';
		this.smallerLink = '';
		this.efaInit = new Function ('return true;');
	}
	this.allLinks = this.biggerLink + this.resetLink + this.smallerLink;
}
Efa_Fontsize.prototype.efaInit = function()
{
		document.writeln (this.testHTML);
		this.body = (this.w3c)?document.getElementsByTagName('body')[0].style:document.all.tags('body')[0].style;
		this.efaTest = (this.w3c)?document.getElementById('efaTest'):document.all['efaTest'];
		var h = (this.efaTest.clientHeight)?parseInt (this.efaTest.clientHeight):(this.efaTest.offsetHeight)?parseInt (this.efaTest.offsetHeight):999;
		if (h < this.defPx) this.base = this.defPx/h;
		this.body.fontSize = Math.round (this.pref*this.base) + '%';
}
Efa_Fontsize.prototype.getLinkHtml = function(direction,properties)
{
	var html = properties[0] + '<a href="#" onclick="efa_fontSize.setSize(' + direction + '); return false;"';
	html += (properties[2])?'title="' + properties[2] + '"':'';
	html += (properties[3])?'class="' + properties[3] + '"':'';
	html += (properties[4])?'id="' + properties[4] + '"':'';
	html += (properties[5])?'name="' + properties[5] + '"':'';
	html += (properties[6])?'accesskey="' + properties[6] + '"':'';
	html += (properties[7])?'onmouseover="' + properties[7] + '"':'';
	html += (properties[8])?'onmouseout="' + properties[8] + '"':'';
	html += (properties[9])?'onfocus="' + properties[9] + '"':'';
	return html += '>'+ properties[1] + '<' + '/a>' + properties[10];
}
Efa_Fontsize.prototype.getPref = function()
{
	var pref = this.getCookie(this.cookieName);
	if (pref) return parseInt (pref);
	else return this.def;
}
Efa_Fontsize.prototype.setSize = function(direction)
{
	this.pref = (direction)?this.pref+(direction*this.increment):this.def;
	this.setCookie(this.cookieName,this.pref);
	this.body.fontSize = Math.round(this.pref*this.base) + '%';
}
Efa_Fontsize.prototype.getCookie = function(cookieName)
{
	var cookie = cookieManager.getCookie(cookieName);
	return (cookie)?cookie:false;
}
Efa_Fontsize.prototype.setCookie = function(cookieName,cookieValue)
{
	return cookieManager.setCookie(cookieName,cookieValue);
}
var  efa_fontSize = new Efa_Fontsize(efa_increment,efa_bigger,efa_reset,efa_smaller,efa_default);
function setActiveStyleSheet(title)
{
	var i, a, main;
	for(i = 0; (a = document.getElementsByTagName("link")[i]); i++)
	{
		if(a.getAttribute("rel") && a.getAttribute("rel").indexOf ("style") != -1 && a.getAttribute("title"))
		{
			a.disabled = true;
			if(a.getAttribute("title") == title)
			{
				a.disabled = false;
				cookieManager.setCookie("style", title, 365);
			}
		}
	}
}
function getActiveStyleSheet()
{
	var i, a;
	for(i = 0; (a = document.getElementsByTagName("link")[i]); i ++)
	{
		if (a.getAttribute("rel").indexOf ("style") != -1 && a.getAttribute("title") && !a.disabled) return a.getAttribute("title");
	}
	return null;
}
function getPreferredStyleSheet()
{
	var i, a;
	for(i = 0; (a = document.getElementsByTagName("link")[i]); i ++)
	{
		if (a.getAttribute("rel").indexOf ("style") != -1 && a.getAttribute("rel").indexOf ("alt") == -1 && a.getAttribute("title")) return a.getAttribute("title");
	}
	return null;
}
var cookie = cookieManager.getCookie("style");
var title = cookie ? cookie : getPreferredStyleSheet();
setActiveStyleSheet(title);

var ie = (window.document.all) ? true:false;
var ns6 = (window.document.getElementById) ? true:false;
function anzeigen(nr)
{
	if (i)
	{
		for (var i = 0;i < 31;i ++)
		{
			document.all['popup_menu'+i].style.visibility = 'hidden';
		}
		document.all[nr].style.visibility = 'visible';
	}
	if (ns6)
	{
		for (var i = 0;i < 31;i ++)
		{
			document.getElementById('popup_menu'+i).style.visibility = 'hidden';
		}
		document.getElementById(nr).style.visibility = 'visible';
	}
}

function fenster_news_popup()
{
	var fenster = window.open('contents/news_popup.html','news_popup','width=495,height=550,top=50,left=200,scrollbars=yes');
	fenster.focus();
}
function fenster_archiv_popup()
{
	var fenster = window.open('contents/news/news_2008_popup.html','archiv_popup','width=495,height=550,top=50,left=200,scrollbars=yes');
	fenster.focus();
}
function fenster_sendenetz_vhf_popup()
{
	var fenster = window.open('sendenetz_vhf_popup.html','sendenetz_popup','width=630,height=550,top=50,left=100,scrollbars=yes');
	fenster.focus();
}
function fenster_sendenetz_l_popup()
{
	var fenster = window.open('sendenetz_l_popup.html','sendenetz_popup','width=630,height=550,top=50,left=100,scrollbars=yes');
	fenster.focus();
}

function fensterfoto1_popup()
{
	var fenster = window.open('foto1.html','sendenetz_popup','width=640,height=490,top=50,left=100,scrollbars=yes');
	fenster.focus();
}

function fensterfoto2_popup()
{
	var fenster = window.open('foto2.html','sendenetz_popup','width=640,height=490,top=50,left=100,scrollbars=yes');
	fenster.focus();
}

function fensterfoto3_popup()
{
	var fenster = window.open('foto3.html','sendenetz_popup','width=640,height=490,top=50,left=100,scrollbars=yes');
	fenster.focus();
}

function fensterfoto4_popup()
{
	var fenster = window.open('foto4.html','sendenetz_popup','width=640,height=490,top=50,left=100,scrollbars=yes');
	fenster.focus();
}

function fensterfoto5_popup()
{
	var fenster = window.open('foto5.html','sendenetz_popup','width=640,height=490,top=50,left=100,scrollbars=yes');
	fenster.focus();
}

function fensterfoto6_popup()
{
	var fenster = window.open('foto6.html','sendenetz_popup','width=640,height=490,top=50,left=100,scrollbars=yes');
	fenster.focus();
}

function fensterfoto7_popup()
{
	var fenster = window.open('foto7.html','sendenetz_popup','width=640,height=490,top=50,left=100,scrollbars=yes');
	fenster.focus();
}

function fensterfoto21_popup()
{
	var fenster = window.open('foto21.html','sendenetz_popup','width=640,height=490,top=50,left=100,scrollbars=yes');
	fenster.focus();
}

function fensterfoto22_popup()
{
	var fenster = window.open('foto22.html','sendenetz_popup','width=640,height=490,top=50,left=100,scrollbars=yes');
	fenster.focus();
}

function fensterfoto23_popup()
{
	var fenster = window.open('foto23.html','sendenetz_popup','width=640,height=490,top=50,left=100,scrollbars=yes');
	fenster.focus();
}

function fensterfoto24_popup()
{
	var fenster = window.open('foto24.html','sendenetz_popup','width=640,height=490,top=50,left=100,scrollbars=yes');
	fenster.focus();
}

function fensterfoto25_popup()
{
	var fenster = window.open('foto25.html','sendenetz_popup','width=640,height=490,top=50,left=100,scrollbars=yes');
	fenster.focus();
}

function fensterfoto26_popup()
{
	var fenster = window.open('foto26.html','sendenetz_popup','width=640,height=490,top=50,left=100,scrollbars=yes');
	fenster.focus();
}

function fensterfoto27_popup()
{
	var fenster = window.open('foto27.html','sendenetz_popup','width=640,height=490,top=50,left=100,scrollbars=yes');
	fenster.focus();
}
function fensterfoto28_popup()
{
	var fenster = window.open('foto28.html','sendenetz_popup','width=640,height=490,top=50,left=100,scrollbars=yes');
	fenster.focus();
}

function fensterfoto29_popup()
{
	var fenster = window.open('foto29.html','sendenetz_popup','width=640,height=490,top=50,left=100,scrollbars=yes');
	fenster.focus();
}

function fenster_image_popup(img)
{
	var fenster = window.open(img,'img_popup','width=520,height=405,top=50,left=200,scrollbars=no');
	fenster.focus();
}
