
    var prefsLoaded = false;
    var currentFontSize = 11;
    var currentFontType = 1;
    
    function revertStyles(){
        currentFontType = 1;
        setFontFace(1);
    
        currentFontSize = 11;
        changeFontSize(0);
    }     
    
    function toggleSerif(){
        currentFontType = parseInt(currentFontType);
        if(currentFontType == 1){
            currentFontType = 2;
        }else{
            currentFontType = 1;
        }
        setFontFace(currentFontType);
    }

    function changeFontSize(sizeDifference){
        currentFontSize = parseInt(currentFontSize) + parseInt(sizeDifference);
        
        if(currentFontType == 1){
            if(currentFontSize > 12){
                currentFontSize = 12;
            }else if(currentFontSize < 9){
                currentFontSize = 9;
            }
        }else{
            if(currentFontSize > 13){
                currentFontSize = 13;
            }else if(currentFontSize < 11){
                currentFontSize = 11;
            }
        }
        setFontSize(currentFontSize);
    };
    
    function setFontSize(fontSize){
        var stObj = (document.getElementById) ? document.getElementById('bodyAll') : document.all('bodyAll');
        stObj.style.fontSize = fontSize + 'px';
    };
    
    function setFontFace(fontType){
        var stObj = (document.getElementById) ? document.getElementById('bodyAll') : document.all('bodyAll');
        if(fontType == 2){
            stObj.style.fontFamily = 'georgia,times,times new roman,serif';
            changeFontSize(1);
        }else{
            stObj.style.fontFamily = 'verdana,geneva,arial,helvetica,sans-serif';
            changeFontSize(-1);
        }
    };

    function createCookie(name,value,days) {
        if (days) {
            var date = new Date();
            date.setTime(date.getTime()+(days*24*60*60*1000));
            var expires = "; expires="+date.toGMTString();
        }
        else expires = "";
        document.cookie = name+"="+value+expires+"; path=/";
    };    
       
    function readCookie(name) {
        var nameEQ = name + "=";
        var ca = document.cookie.split(';');
        for(var i=0;i < ca.length;i++) {
            var c = ca[i];
            while (c.charAt(0)==' ') c = c.substring(1,c.length);
            if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
        }
        return null;
    };    

    window.onload = setUserOptions;

    function setUserOptions(){
    if(!prefsLoaded){
        cookie = readCookie("bdsTextType");
        currentFontType = cookie ? cookie : 1;
        setFontFace(currentFontType);

        cookie = readCookie("bdsTextSize");
        currentFontSize = cookie ? cookie : 11;
        setFontSize(currentFontSize);

        prefsLoaded = true;
        }
    }

    window.onunload = saveSettings;
    function saveSettings()
    {
        createCookie("bdsTextSize", currentFontSize, 365);
        createCookie("bdsTextType", currentFontType, 365);
    }
    

    // bookmark action

    var ver = navigator.appName
    var num = parseInt(navigator.appVersion)
        
    function add2bookmarks(url,who) {
    if ((ver == "Microsoft Internet Explorer")&&(num >= 4)) {
        window.external.AddFavorite(url,who);
        }
    }

    // print

    function show(url, w, h) {
        var features =
            "width=" + w +
            ",height=" + h +
            ",resizable=1" +
            ",scrollbars=1" +
            ",statusbar=0" +
            ",toolbar=0" +
            ",location=0" +
            ",menubar=1" +
            ",directories=0";

        site2print = window.open(url, "Druckversion", features);
        site2print.focus();
    }
