﻿if ( typeof console == "undefined" || typeof console.log == "undefined" ) var console = { log: function () { } };
/****************/
$(function () {
    function _children_small(obj) {
        obj.each(fsmallfc);

        if (obj.children().length > 0) {
            _children_small(obj.children());
        }
    }
    function _children_normal(obj) {
        obj.each(fnormalfc);

        if (obj.children().length > 0) {
            _children_normal(obj.children());
        }
    }
    function _children_big(obj) {
        obj.each(fbigfc);

        if (obj.children().length > 0) {
            _children_big(obj.children());
        }
    }
    $('#fsmall').click(function () {
        _children_small($(".contentin").children());
    });
    $('#fnormal').click(function () {
        _children_normal($(".contentin").children());
    })
    $('#fbig').click(function () {
        _children_big($(".contentin").children());
    })
    function fsmallfc() {
        var wordnum = $(this).css("font-size").replace("px", "");
        if (wordnum > 12) {
            if (wordnum == 12) wordnum = 11;
            $(this).css('font-size', wordnum * 0.8);
            $(this).find('a').css('font-size', wordnum * 0.8);
            var wordnum2 = $(this).css("line-height").replace("px", "");
            $(this).css('line-height', wordnum2 * 0.8 + "px");
            $(this).find('a').css('line-height', wordnum2 * 0.8 + "px");
        }
    }
    function fnormalfc() {
        $(this).css('font-size', "");
        $(this).find('a').css('font-size', "");
        $(this).css('line-height', "");
        $(this).find('a').css('line-height', "");
    }
    function fbigfc() {
        var wordnum = $(this).css("font-size").replace("px", "");
        if (wordnum < 22) {
            if (wordnum == 12) wordnum = 15;
            $(this).css('font-size', wordnum * 1.2);
        }
    }
});