$(document).ready(function() {

    var COOKIE_NAME = 'FONTSIZE';
    var options = { path: '/', expires: 10 };
    var size = ($.cookie(COOKIE_NAME)) ? $.cookie(COOKIE_NAME) : 12;
    $('html').css('font-size', size);

    // Increase Font Size
    $("#FontIncrease, #font-increase").click(function() {
        
        var currentFontSize = $('html').css('font-size');
       
        var currentFontSizeNum = parseFloat(currentFontSize, 10);
        var newFontSize = currentFontSizeNum * 1.2;
        newFontSize = (newFontSize > 16) ? 17 : newFontSize;
        $('html').css('font-size', newFontSize);
        $.cookie(COOKIE_NAME, newFontSize, options);
        return false;
    });
    // Decrease Font Size
    $("#FontDecrease, #font-decrease").click(function() {
        
        var currentFontSize = $('html').css('font-size');
        
        var currentFontSizeNum = parseFloat(currentFontSize, 10);
        var newFontSize = currentFontSizeNum * 0.8;
        newFontSize = (newFontSize < 10) ? 10 : newFontSize;
        $('html').css('font-size', newFontSize);
        $.cookie(COOKIE_NAME, newFontSize, options);
        return false;
    });
    // LANGUAGE
    // get random language
    var ran = Math.floor(Math.random() * languages.length);
    var img = "url('/common/images/languages/" + languages[ran] + ".gif')";
    $("#Languages a").css("background-image", img);

    Shadowbox.init({
        players: ["iframe", "img"]
    });

    $('#Bookmark').bookmark({ popup: true, sites:
        ['delicious', 'digg', 'linkedin', 'stumbleupon']
    });
});

var languages = ["English", "Arabic", "Bosnian", "Farsi", "Russian", "Spanish", "Vietnamese"];
