/*
COPYRIGHT:  
	CPEACH - INTERNET SERVICE
    FRANK GEBHARD
	KASTANIENALLEE 40
	38104 BRAUNSCHWEIG, GERMANY
	info@cpeach.de
*/
    var actMenuFontSize="12px";
   	var actTextFontSize="11px";

	function changeClass(objID, classID)
    {
    //EINE ANDERE CSS-CLASS WIRD ZUGEORDNET
        //document.getElementById(objID).className = classID;;
    }

    function getFontSize()
    {
	    a = document.cookie;
        if(a) //Cookie vorhanden
        {
        	cookiename = a.substr(0,a.search('='));
        	cw = a.substr(a.search('=')+1,a.search(';'));
	            if(cw == '')
	            {
	                cw = a.substr(a.search('=')+1,a.length);
	            }
        }
        else
        {
        	cw = actTextFontSize;

        }
	    return cw;
    }

    function initFontSize()
    {
        i=getFontSize();
        if(i.substr(0,i.search('px')))
        {
            document.getElementById("textfeld").style.fontSize =actTextFontSize;
            sizeMenu(actMenuFontSize);
            document.getElementById("menubar").style.overflow="visible";
        }
        else
        {
            document.getElementById("textfeld").style.fontSize =i;
            document.getElementById("menubar").style.overflow="auto";
            j=parseFloat(i.substr(0,i.search('em')));
            j=(j+0.1)+"em";
            sizeMenu(j);
        }
    }


    function resetFontSize()
    {
        var a = new Date();
        a = new Date(a.getTime() +1000*60*60*24*365);
        document.cookie = 'fontSize=11px; expires='+a.toGMTString()+';';
        document.getElementById("textfeld").style.fontSize ="11px";
        document.getElementById("menubar").style.overflow="visible";
        sizeMenu("12px");
    }

    function saveFontSize(fsz)
    {
        //AKT. TEXT FONT SIZE WIRD GEAENDERT
        actTextFontSize= fsz;
        //ERSTELLEN DES COOKIE
        var a = new Date();
	    a = new Date(a.getTime() +1000*60*60*24*365);
	    document.cookie = 'fontSize='+actTextFontSize+'; expires='+a.toGMTString()+';';
	    document.getElementById("textfeld").style.fontSize =actTextFontSize;
        j=parseFloat(fsz.substr(0,actTextFontSize.search('em')));
        j=(j+0.1)+"em";
        //AKT. MENU FONT SIZE WIRD GEAENDERT
        sizeMenu(j);
    }

    function showBorder(obj,borderWidth)
    {
       obj.parentNode.style.borderWidth=borderWidth;
    }

    function sizeFont(mathFunc)
    {
        //i=getFontSize();
        i=actTextFontSize;
        document.getElementById("menubar").style.overflow="auto";
       // alert("font "+i);
        if(i.substr(0,i.search('em')))
        {
            //alert("in 1");
            j=parseFloat(i.substr(0,i.search('em')));
            if(mathFunc)
            {
                //alert("in 1a");
                j=(j+0.1)+"em";
            }
            else
            {
            //alert("in 1b");
                j=(j-0.1)+"em";
            }
            saveFontSize(j);
        }
        else
        {
            //alert("in 2");
            saveFontSize('0.8em');
        }
    }

    function sizeMenu(objSize)
    {
    	//AKT. MENU FONT SIZE WIRD GEAENDERT
        actMenuFontSize= objSize;
        //AKT. MENU FONT SIZE WIRD AUF ALLE LINKS UEBERTRAGEN
        objA= document.getElementsByTagName("a");
        for(i=0;i<objA.length;i++)
        {
         	document.getElementsByTagName("a")[i].style.fontSize= actMenuFontSize;

        }
    }