function MM_preloadImages()
{ //v3.0

    var d = document; if ( d.images ) {
            if ( !d.MM_p ) d.MM_p = new Array();

            var i, j = d.MM_p.length, a = MM_preloadImages.arguments; for ( i = 0; i < a.length; i++ )

            if ( a[ i ].indexOf( "#" ) != 0 ) { d.MM_p[ j ] = new Image; d.MM_p[ j++ ].src = a[ i ];}
        }
}


var prefsLoaded = false;
var defaultFontSize = 100;
var currentFontSize = defaultFontSize;

function setFontSize( fontSize ) {
    document.body.style.fontSize = fontSize + '%';
    currentFontSize = fontSize;
};


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=/";
    document.cookie = name + "=" + value + "; 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( "fontSize" );
            currentFontSize = cookie ? cookie : defaultFontSize;
            setFontSize( currentFontSize );
            prefsLoaded = true;
        }

}

window.onunload = saveSettings;

function saveSettings() {
    createCookie( "fontSize", currentFontSize, 365 );
}



