    // DV TextMode (04/06/2004)
    // Copyright ©Industria Virtual
    
    var textsize=14;
    var increase=4;
    var decrease=4;
    var original=14;
    window.document.onkeypress=altera;
    function altera()
        {
            switch(event.keyCode)
                {
                case 43:
                    aumenta();
                    break;
                case 45:
                    diminui();
                    break;
                case 78 :case 110:
                    normal();
                    break;
                case 73 :case 105:
                    inverso();
                    break;
                case 98 :case 66:
                    corFonte("blue");
                    break;
                case 82 :case 114:
                    corFonte("red");
                    break;
                case 75 :case 107:
                    corFonte("black");
                    break;
                case 71 :case 103:
                    corFonte("green");
                    break;
                case 87 :case 119:
                    corFonte("white");
                    break;
                case 89 :case 121:
                    corFonte("yellow");
                    break;
                case 70 :case 102:
                    window.open('default.aspx','','fullscreen=yes')
                    break;
                case 63:
                    window.location.href=('default.aspx');
                    break;
                case 27:
                    window.close();
                    break;
                }
        }
    function aumenta()
        {
         textsize>150?document.body.style.fontSize=150:document.body.style.fontSize=textsize+=increase;
         SetCookie ('tamanho', textsize, exp);
        }
    function diminui()
        {
         textsize<original+decrease?document.body.style.fontSize=original:document.body.style.fontSize=textsize-=decrease;
         SetCookie ('tamanho', textsize, exp);
        }
    function normal()
        {
        document.body.style.fontSize=original;
        textsize=original;
        document.body.bgColor='white';
        document.body.style.color='black';
        SetCookie ('fundo', 'white', exp);
        SetCookie ('fonte', 'black', exp);
        SetCookie ('tamanho', textsize, exp);
        }
    function inverso()
        {
        document.body.bgColor='black';
        document.body.style.color='white';
        SetCookie ('fundo', 'black', exp);
        SetCookie ('fonte', 'white', exp);
        }
    function corFonte(cor)
        {
        document.body.style.color=cor;
        SetCookie ('fonte', cor, exp);
        }
        
    function textmode(){
        var ajuda = GetCookie('ajuda');
        var fundo = GetCookie('fundo');
        var fonte = GetCookie('fonte');
        var tamanho = GetCookie('tamanho');
        if (ajuda == null) {
            fundo=document.body.bgColor;
            fonte=document.body.style.color;
            tamanho=document.body.style.fontSize;
            window.location.href=('default.aspx');
            SetCookie ('ajuda', '1', exp);
        }
            document.body.bgColor=fundo;
            document.body.style.color=fonte;
            document.body.style.fontSize=tamanho;
            return ajuda;
        }

    var expDays = 30;
    var exp = new Date(); 
    exp.setTime(exp.getTime() + (expDays*24*60*60*1000));
    
    function getCookieVal (offset) {  
        var endstr = document.cookie.indexOf (";", offset);  
        if (endstr == -1)    
        endstr = document.cookie.length;  
        return unescape(document.cookie.substring(offset, endstr));
        }
    
    function GetCookie (name) {  
        var arg = name + "=";  
        var alen = arg.length;  
        var clen = document.cookie.length;  
        var i = 0;  
        while (i < clen) {    
        var j = i + alen;    
        if (document.cookie.substring(i, j) == arg)      
        return getCookieVal (j);    
        i = document.cookie.indexOf(" ", i) + 1;    
        if (i == 0) break;   
        }  
        return null;
        }
    
    function SetCookie (name, value) {  
        var argv = SetCookie.arguments;  
        var argc = SetCookie.arguments.length;  
        var expires = (argc > 2) ? argv[2] : null;  
        var path = (argc > 3) ? argv[3] : null;  
        var domain = (argc > 4) ? argv[4] : null;  
        var secure = (argc > 5) ? argv[5] : false;  
        document.cookie = name + "=" + escape (value) + 
        ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + 
        ((path == null) ? "" : ("; path=" + path)) +  
        ((domain == null) ? "" : ("; domain=" + domain)) +    
        ((secure == true) ? "; secure" : "");
        }
    
    function DeleteCookie (name) {  
    var exp = new Date();  
    exp.setTime (exp.getTime() - 1);  
    var cval = GetCookie (name);  
    document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
    }
