
/* Comment Generated by Combres - Resource '~/Scripts/jqplugins/jquery-scroll.js' (Mode: Static) */
(function($) {
    var arrayObj = new Array();
    $.fn.extend({
        Scroll: function(opt, callback) {
            //参数初始化
            if (!opt) var opt = {};
            var contariner = this;
            var timerID;
            var _this = this.eq(0).find("ul:first");
            var lineH = opt.height ? parseInt(opt.height, 10) : 48,
                     line = opt.line ? parseInt(opt.line, 10) : parseInt(this.height() / lineH, 10), //每次滚动的行数，默认为一屏，即父容器高度
                     speed = opt.speed ? parseInt(opt.speed, 10) : 500, //卷动速度，数值越大，速度越慢（毫秒）
                     timer = opt.timer ? parseInt(opt.timer, 10) : 3000; //滚动的时间间隔（毫秒）
            if (line == 0) line = 1;
            var upHeight = 0 - line * lineH;
            ArrayPush();
            //滚动函数
            scrollUp = function(tg, h, l) {
                var temp = contariner;
                var ul = $(tg).eq(0).find("ul:first");
                ul.animate({
                    marginTop: h
                }, speed, function() {
                    for (i = 1; i <= l; i++) {
                        ul.find("li:first").appendTo(ul);
                    }
                    ul.css({ marginTop: 0 });
                });
            }
            //添加对象数组
            function ArrayPush() {
                var bol = false;
                for (i = 0; i < arrayObj.length; i++) {
                    var temp = arrayObj[i].split(";");
                    if (temp[0] == contariner[0].id) bol = true;
                }
                if (!bol)
                    arrayObj.push(contariner[0].id + ";" + upHeight + ";" + line);
            }
            //激活滚动事件
            _scrollUp = function(id) {
                var _height, _line;
                for (i = 0; i < arrayObj.length; i++) {
                    var temp = arrayObj[i].split(";");
                    if (temp[0] == id) {
                        _height = temp[1];
                        _line = temp[2];
                    }
                }
                scrollUp("#" + id, _height, _line);
            }
            //鼠标事件绑定
            contariner.hover(function() {
                clearInterval(timerID);
            }, function() {
                timerID = setInterval("_scrollUp('" + contariner[0].id + "')", timer);
            }).mouseout();
        }
    })
})(jQuery);
;


/* Comment Generated by Combres - Resource '~/Scripts/Default.js' (Mode: Static) */
/// <reference path="jquery-1.4.4.js" />
//Tabs 的切换效果
$(document).ready(function() {
    //初始化Tabs
    $(".Center-index .Left .tabs-head:first,.Center-index .ContentCenter .tabs-head:first,.Center-index .Right .tabs-head:first").each(function() {
        var t = $(this);
        t.attr("class", t.attr("class") + "-selected");
        t.next("div[class*='split']:first").attr("class", "tabs-head split-right");
        $("#" + t.attr("class").split(' ')[1].replace(/-selected/, "")).css("display", "block");
    });

    $(".tabs-left div:even,.tabs-middle div:even,.tabs-right div:even").bind("mouseover", function() {
        var t = $(this);
        var parent = t.parent();
        //还原其它选项未选中
        parent.find("div[class*='selected']").each(function() {
            var c = $(this).attr("class").split(' ')[1];
            $(this).attr("class", "tabs-head " + c.replace(/-selected/, ""));
        });
        //将分隔符都换成中线
        parent.find("div[class*='split']").each(function() {
            $(this).attr("class", "tabs-head split-middle");
        });
        //设置当前选中
        t.prev("div[class*='split']:first").attr("class", "tabs-head split-left");
        t.attr("class", t.attr("class") + "-selected");
        t.next("div[class*='split']:first").attr("class", "tabs-head split-right");
        parent.parent().find(".detail:visible").hide();
        $("#" + t.attr("class").split(' ')[1].replace(/-selected/, "")).css("display", "block");
    });


	//$("#lastestReview").Scroll({ line: 2, speed: 1300, timer: 4000, height: 72 });
    //$("#lastestMessage").Scroll({ line: 2, speed: 1300, timer: 4000, height: 72 });
});

//截取字符串
function subChar(str, len) {
    var i = 0, sum = 0;
    for (i = 0; i < str.length; i++) {
        var charCode = str.charCodeAt(i);
        if (charCode >= 0 && charCode <= 255) ++sum;
        else sum += 2;
        if (sum > len) break;
    }
    return str.substr(0, i);
}
