

var pagew = $(document).outerWidth(true) + (window.innerWidth - document.body.clientWidth);
var pageh = $(window).innerHeight();

try {

}
catch (e) { }

function countup1(_obj) {
    try {
        var settings = {
            'time': 600,
            'delay': 5
        };

        var $this = _obj;
        var $settings = settings;

        if (!$this.data('counterupTo')) {
            $this.data('counterupTo', $this.text());
        }
        var time = parseInt($this.data("counter-time")) > 0 ? parseInt($this.data("counter-time")) : $settings.time;
        var delay = parseInt($this.data("counter-delay")) > 0 ? parseInt($this.data("counter-delay")) : $settings.delay;
        var divisions = time / delay;
        var num = $this.attr("data-counterupTo");
        var nums = [num];
        var isComma = /[0-9]+,[0-9]+/.test(num);
        num = num.replace(/,/g, '');
        var isInt = /^[0-9]+$/.test(num);
        var isFloat = /^[0-9]+\.[0-9]+$/.test(num);
        var decimalPlaces = isFloat ? (num.split('.')[1] || []).length : 0;

        for (var i = divisions; i >= 1; i--) {

            var newNum = parseInt(Math.round(num / divisions * i));

            if (isFloat) {
                newNum = parseFloat(num / divisions * i).toFixed(decimalPlaces);
            }
            if (isComma) {
                while (/(\d+)(\d{3})/.test(newNum.toString())) {
                    newNum = newNum.toString().replace(/(\d+)(\d{3})/, '$1' + ',' + '$2');
                }
            }

            nums.unshift(newNum);
        }

        $this.data('counterup-nums', nums);
        $this.text('0');

        var f = function () {
            try {
                if ($this.data('counterup-nums') != "") {
                    $this.text($this.data('counterup-nums').shift());
                    if ($(".zhaq_01_c").attr("class") == "zhaq_01_c") {
                        if ($this.data('counterup-nums').shift() <= 20) {
                            $(".zhaq_01_c").find(".img1").css({ "opacity": "1" });
                            $(".zhaq_01_c").find(".img2").css({ "opacity": "0" });
                            $(".zhaq_01_c").find(".img3").css({ "opacity": "0" });
                        }
                        else if ($this.data('counterup-nums').shift() <= 60) {
                            $(".zhaq_01_c").find(".img1").css({ "opacity": "0" });
                            $(".zhaq_01_c").find(".img2").css({ "opacity": "1" });
                            $(".zhaq_01_c").find(".img3").css({ "opacity": "0" });
                        }
                        else if ($this.data('counterup-nums').shift() <= 100) {
                            $(".zhaq_01_c").find(".img1").css({ "opacity": "0" });
                            $(".zhaq_01_c").find(".img2").css({ "opacity": "0" });
                            $(".zhaq_01_c").find(".img3").css({ "opacity": "1" });
                        }
                    }
                }

                if ($this.data('counterup-nums').length) {
                    setTimeout($this.data('counterup-func'), delay);
                } else {
                    delete $this.data('counterup-nums');
                    $this.data('counterup-nums', null);
                    $this.data('counterup-func', null);
                }
            }
            catch (e) { }
        };
        $this.data('counterup-func', f);

        setTimeout($this.data('counterup-func'), delay);
    }
    catch (e) { }
}