function FontSizeChange(val) {
    if(isNumeric(val)) {
        var x = (document.body.style.fontSize)?document.body.style.fontSize:'75%';
        document.body.style.fontSize = parseFloat(x)+val+'%';
    } else {
        document.body.style.fontSize = val;
    }
    createCookie("ActiveFontSize",document.body.style.fontSize,1000);
}

function isNumeric(sText)
{
    var ValidChars = "0123456789";
    var IsNumber=true;
    var Char;
    for (i = 0; i < sText.length && IsNumber == true; i++) { 
        Char = sText.charAt(i); 
        if (ValidChars.indexOf(Char) == -1) IsNumber = false;
    }
    return IsNumber;
}

function createCookie(cookie_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 = cookie_name+"="+value+expires+"; path=/";
}
function readCookie(cooke_name) {
    regexpr = cooke_name+ '=(.*?)(;|$)';
    var results = document.cookie.match (regexpr);
    if ( results ) return ( unescape ( results[1] ) );
    else { return null; }
}

function setFont(){
    var Currentfontsize=0;
    if (readCookie('ActiveFontSize')) var Currentfontsize = readCookie('ActiveFontSize');
    FontSizeChange(Currentfontsize);
}

