/* Js for , Version=1762304699 */
 v.theme = {"template":"mobile","theme":"default","device":"mobile"};;$(function()
{
    var $commentForm = $('#commentForm'),
        $commentBox = $('#commentBox'),
        $commentContent = localStorage.getItem('commentContent');

    if($commentContent)
    {
        $commentForm.find('#commentContent').val($commentContent);
    }

    $.refreshCommentList = function ()
    {
        $('.pager-pull-up').removePullUpPager();
        $('#commentsListAsync').load(window.location.href + ' #commentsListWrapper', function ()
        {
            $('.pager-pull-up').initPullUpPager();
            moreRepliesHide();
            moreReliesBind();
            pupLoadBind();
        });
    };

    var pupLoadBind = function ()
    {
        $('.pager-pull-up').on('pupLoad', function ()
        {
            moreRepliesHide();
            moreReliesBind();
        });
    };
    pupLoadBind();

    $commentBox.find('.pager').on('click', 'a', function()
    {
        $commentBox.load($(this).attr('href'));
        return false;
    });

    $commentForm.ajaxform({
        onSubmit: function () 
        {
            localStorage.setItem('commentContent', $commentForm.find('#commentContent').val());
        },
        onSuccess: function(response)
        {
            if(response.result == 'success')
            {
                localStorage.setItem('commentContent', '');
                $commentForm.find('#commentContent').val('');
                setTimeout($.refreshCommentList, 200);
                $('.comment-list, .message-list').show();
            }
        }
    });

    var moreRepliesHide = function ()
    {
        $('.comment').each(function ()
        {
            var i = 0;
            $(this).children('.replies').find('.reply-heading').each(function ()
            {
                i++;
                if(i > 3) $(this).hide();
            });
            var j = 0;
            $(this).children('.replies').find('.reply-body').each(function ()
            {
                j++;
                if(j > 3) $(this).hide();
            });
            if(j > 3)
            {
                $(this).find('.more-replies-amount').html(j - 3);
            } else {
                $(this).find('.more-replies').hide();
            }
        });
    };
    moreRepliesHide();

    var moreReliesBind = function ()
    {
        $('.more-replies').on('click', function ()
        {
            $(this).hide();
            $(this).parent().parent().children('.replies').find('.reply-heading,.reply-body').show();
        });
    };
    moreReliesBind();
});

;$().ready(function() { $('#execIcon').click(function(){ $('#execInfoBar').toggle();});}); ;$(function()
{
    var $commentForm = $('#commentForm'),
        $commentBox = $('#commentBox'),
        $commentContent = localStorage.getItem('commentContent');

    if($commentContent)
    {
        $commentForm.find('#commentContent').val($commentContent);
    }

    $.refreshCommentList = function ()
    {
        $('.pager-pull-up').removePullUpPager();
        $('#commentsListAsync').load(window.location.href + ' #commentsListWrapper', function ()
        {
            $('.pager-pull-up').initPullUpPager();
            moreRepliesHide();
            moreReliesBind();
            pupLoadBind();
        });
    };

    var pupLoadBind = function ()
    {
        $('.pager-pull-up').on('pupLoad', function ()
        {
            moreRepliesHide();
            moreReliesBind();
        });
    };
    pupLoadBind();

    $commentBox.find('.pager').on('click', 'a', function()
    {
        $commentBox.load($(this).attr('href'));
        return false;
    });

    $commentForm.ajaxform({
        onSubmit: function () 
        {
            localStorage.setItem('commentContent', $commentForm.find('#commentContent').val());
        },
        onSuccess: function(response)
        {
            if(response.result == 'success')
            {
                localStorage.setItem('commentContent', '');
                $commentForm.find('#commentContent').val('');
                setTimeout($.refreshCommentList, 200);
                $('.comment-list, .message-list').show();
            }
        }
    });

    var moreRepliesHide = function ()
    {
        $('.comment').each(function ()
        {
            var i = 0;
            $(this).children('.replies').find('.reply-heading').each(function ()
            {
                i++;
                if(i > 3) $(this).hide();
            });
            var j = 0;
            $(this).children('.replies').find('.reply-body').each(function ()
            {
                j++;
                if(j > 3) $(this).hide();
            });
            if(j > 3)
            {
                $(this).find('.more-replies-amount').html(j - 3);
            } else {
                $(this).find('.more-replies').hide();
            }
        });
    };
    moreRepliesHide();

    var moreReliesBind = function ()
    {
        $('.more-replies').on('click', function ()
        {
            $(this).hide();
            $(this).parent().parent().children('.replies').find('.reply-heading,.reply-body').show();
        });
    };
    moreReliesBind();
});

;
$(function()
{
    var countLink  = '/index.php/cart-count.mhtml';
    var browseLink = '/index.php/cart-browse.mhtml';
    
    $.refreshCart = function(twinkle)
    {
        $.getJSON(countLink, function(data)
        {
            if($.isPlainObject(data) && data.result === 'success')
            {
                var $count = $('.cart-count').text(data.count).toggleClass('hide', data.count < 1);
                if(data.count > 0 && twinkle)
                {
                    $count.addClass('twinkle');
                    setTimeout(function(){$count.removeClass('twinkle')}, 200);
                    if(window.v && window.v.addToCartSuccess) $.messager.success(window.v.addToCartSuccess + "<div><a class='btn success dismiss' href=" + browseLink + ">" + window.v.gotoCart + " <i class='icon-arrow-right'></i></a><div class='msger-cart-count'><i class='icon icon-shopping-cart icon-s3'></i><strong class='cart-count badge'>" + data.count + "</strong></div></div>", {time: 10000, cssClass: 'msger-cart'});
                }
            }
        });
    };
    
    $.refreshCart();
});
;
  var logLink = "/index.php/log-record.mhtml";
  var browserLanguage = navigator.language || navigator.userLanguage; 
  var resolution      = screen.availWidth + ' X ' + screen.availHeight;
  $.get(logLink, {browserLanguage:browserLanguage, resolution:resolution});
  