// Fehlende PopUp-Funktionen für die CDA. 16.08.07 grf

function popup(ort,x,y) {
  win = window.open(ort, 'Fenster','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width='+x+',height='+y);
  win.focus();
}

function popupNoScroll(ort,x,y) {
  win = window.open(ort, 'Fenster','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width='+x+',height='+y);
  win.focus();
}


var fsCookie = 0;
var fsString = new Array();

if(document.cookie.indexOf('fontsize=3') >= 0) {
    fsCookie = 3;
    document.write('<link rel="stylesheet" type="text/css" href="/misc/ms/mslife/font3.css" />\n');
} else if (document.cookie.indexOf('fontsize=2') >= 0) {
    fsCookie = 2;
    document.write('<link rel="stylesheet" type="text/css" href="/misc/ms/mslife/font2.css" />\n');
} else if (document.cookie.indexOf('fontsize=1') >= 0) {
    fsCookie = 1;
    document.write('<link rel="stylesheet" type="text/css" href="/misc/ms/mslife/font1.css" />\n');
} else {
    fsCookie = 0;
}

function fsMinus() {
    if (fsCookie > 0) {
        fontScale(fsCookie-1);
    }
}
function fsPlus() {
    if (fsCookie < 3) {
        fontScale(fsCookie+1);
    }
}

function fsImage(portal) {
    fsString[0] = '<img src="/img/ll/cda/' + portal + '/klein.gif" width="106" height="17" border="0" alt="klein" title="">';
    fsString[1] = '<img src="/img/ll/cda/' + portal + '/mittel.gif" width="106" height="17" border="0" alt="mittel" title="">';
    fsString[2] = '<img src="/img/ll/cda/' + portal + '/gross.gif" width="106" height="17" border="0" alt="gross" title="">';
    fsString[3] = '<img src="/img/ll/cda/' + portal + '/sehr_gross.gif" width="106" height="17" border="0" alt="sehr gross" title="">';

    document.write(fsString[fsCookie]);
}

function fontScale(fontgr) {
    if (navigator.cookieEnabled) {
        var datum = new Date();
        datum.setTime(datum.getTime() + (1000 * 3600 * 24 * 365));
        document.cookie = 'fontsize=' + fontgr + '; ' + 'expires=' + datum.toGMTString() + '; ' + 'path=/';
//        self.location = self.location;
        window.location.reload(false);
    } else {
        window.alert("Diese Funktion setzt das Akzeptieren von Cookies voraus!");
    }
}


function addLoadEvent(func) {
  	var oldonload = window.onload;
  	if (typeof window.onload != 'function') {
    	window.onload = func;
  	} else {
    	window.onload = function() {
      		if (oldonload) {	oldonload();	}
      		func();
    	}
  	}
}


function fixCss(fsize){
	var ua=navigator.userAgent.toLowerCase();
	if(/msie (\d)/.test(ua)	&& RegExp.$1 <= 6){
		if(fsize > 1){
			$('menu').getElementsByClassName('sub0').each( function(e)	
			{	
				if($('menu').getElementsByClassName('sub0')[0] != e)
				e.style.borderTop = "1px solid #fff";	
			});
		}
	
	
	}
}


addLoadEvent(function() {

	fixCss(fsCookie);

});

