/**
 * @fileoverview jQuery插件
 */
/*
 * jqModal - Minimalist Modaling with jQuery
 *   (http://dev.iceburg.net/jquery/jqModal/)
 *
 * Copyright (c) 2007,2008 Brice Burgess <bhb@iceburg.net>
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 * 
 * $Version: 03/01/2009 +r14
 */
(function($) {
    $.fn.jqm = function(o) {
        var p = {
            overlay: 1,
            overlayClass: 'jqmOverlay',
            closeClass: 'jqmClose',
            trigger: '.jqModal',
            ajax: F,
            ajaxText: '',
            target: F,
            modal: F,
            toTop: F,
            onShow: F,
            onHide: F,
            onLoad: F
        };
        return this.each(function() {
            if (this._jqm)return H[this._jqm].c = $.extend({}, H[this._jqm].c, o);
            s++;
            this._jqm = s;
            H[s] = {c:$.extend(p, $.jqm.params, o),a:F,w:$(this).addClass('jqmID' + s),s:s};
            if (p.trigger)$(this).jqmAddTrigger(p.trigger);
        });
    };

    $.fn.jqmAddClose = function(e) {
        return hs(this, e, 'jqmHide');
    };
    $.fn.jqmAddTrigger = function(e) {
        return hs(this, e, 'jqmShow');
    };
    $.fn.jqmShow = function(t) {
        return this.each(function() {
            t = t || window.event;
            $.jqm.open(this._jqm, t);
        });
    };
    $.fn.jqmHide = function(t) {
        return this.each(function() {
            t = t || window.event;
            $.jqm.close(this._jqm, t)
        });
    };

    $.jqm = {
        hash:{},
        open:function(s, t) {
            var h = H[s],c = h.c,cc = '.' + c.closeClass,z = (parseInt(h.w.css('z-index'))),z = (z > 0) ? z : 10000 + s,o = $('<div></div>').css({height:'100%',width:'100%',position:'fixed',left:0,top:0,'z-index':z - 1,opacity:c.overlay / 100});
            if (h.a)return F;
            h.t = t;
            h.a = true;
            h.w.css('z-index', z);
            if (c.modal) {
                if (!A[0])L('bind');
                A.push(s);
            }
            else if (c.overlay > 0);
            else o = F;

            h.o = (o && $("div." + c.overlayClass).length == 0) ? o.addClass(c.overlayClass).prependTo('body') : F;
            if (ie6) {
                $('html,body').css({height:'100%',width:'100%'});
                if (o) {
                    var jqDocument = $(document);
                    //显示遮罩时的定位
                    $.extend(o.css({position:'absolute'})[0].style, {
                        top:jqDocument.scrollTop(),
                        left:jqDocument.scrollLeft()
                    });
                    $(window).scroll(function() {
                        //适时调整遮罩位置
                        o.css({
                            top:jqDocument.scrollTop(),
                            left:jqDocument.scrollLeft()
                        });
                    });
                }
            }
            if (c.ajax) {
                var r = c.target || h.w,u = c.ajax,r = (typeof r == 'string') ? $(r, h.w) : $(r),u = (u.substr(0, 1) == '@') ? $(t).attr(u.substring(1)) : u;
                r.html(c.ajaxText).load(u, function(d) {
                    if (d.indexOf("{\"flag\":") > -1) {
                        if (typeof(SII) != "undefined")SII.AjaxErr(101);
                        return;
                    }
                    ;
                    if (c.onLoad)c.onLoad.call(this, h);
                    if (cc)h.w.jqmAddClose($(cc, h.w));
                    e(h);
                });
            }
            else if (cc)h.w.jqmAddClose($(cc, h.w));

            if (c.toTop && h.o)h.w.before('<span id="jqmP' + h.w[0]._jqm + '"></span>').insertAfter(h.o);
            (c.onShow) ? c.onShow(h) : h.w.show();
            if (ie6) {
                //ie6下弹出浮层时，页面部分元素浮动的bug
                $(document.body).addClass("clearfix");
            }
            e(h);
            return F;
        },
        close:function(s) {
            var h = H[s];
            if (!h.a)return F;
            h.a = F;
            if (A[0]) {
                A.pop();
                if (!A[0])L('unbind');
            }
            if (h.c.toTop && h.o)$('#jqmP' + h.w[0]._jqm).after(h.w).remove();
            if (h.c.onHide)h.c.onHide(h); else {
                h.w.hide();
                if (h.o)h.o.remove();
            }

            return F;
        },
        closeAll:function() {
            for (var i = 1; i <= s; i++)
            {
                this.close(i);
            }
        },
        params:{}};
    var s = 0,H = $.jqm.hash,A = [],ie6 = $.browser.msie && ($.browser.version == "6.0"),F = false,
            i = $('<iframe src="javascript:false;document.write(\'\');" class="jqm"></iframe>').css({opacity:0}),
            e = function(h) {
                if (ie6)if (h.o)h.o.html('<p style="width:100%;height:100%"/>').prepend(i); else if (!$('iframe.jqm', h.w)[0])h.w.prepend(i);
                f(h);
            },
            f = function(h) {
                try {
                    $(':input:visible', h.w)[0].focus();
                } catch(_) {
                }
            },
            L = function(t) {
                $()[t]("keypress", m)[t]("keydown", m)[t]("mousedown", m);
            },
            m = function(e) {
                var h = H[A[A.length - 1]],r = (!$(e.target).parents('.jqmID' + h.s)[0]);
                if (r)f(h);
                return !r;
            },
            hs = function(w, t, c) {
                return w.each(function() {
                    var s = this._jqm;
                    $(t).each(function() {
                        if (!this[c]) {
                            this[c] = [];
                            $(this).click(function() {
                                for (var i in {jqmShow:1,jqmHide:1})for (var s in this[i])if (H[this[i][s]])H[this[i][s]].w[i](this);
                                return F;
                            });
                        }
                        this[c].push(s);
                    });
                });
            };
})(jQuery);

(function($) {                                          // Compliant with jquery.noConflict()
    /**
     * jCarousel Lite is a jQuery plugin that carries you on a carousel ride filled with images and HTML content.
     * Put simply, you can navigate images and/or HTML in a carousel-style widget.
     * @param o {Object} 配置参数:
     * @see <a href="http://gmarwaha.com/jquery/jcarousellite/index.php#doc">The Jcarousellite Documentation</a>
     * 扩展参数：
     * {
     *      slideOneWay:{Boolean} 当circular为true时,即循环滚动时,是否采用单向滚动方式
     * }
     * @example
     * 在id为"YourID"的元素内部生成jCarouselLite控件
     * $("#YourID").jCarouselLite({
     *      btnNext: ".RAtb",//下一个
     *      btnPrev: ".LAtb",//上一个
     *      mouseWheel: true,//支持鼠标
     *      visible:3 ,//可见个数
     *      vertical:true,//循环滚动
     *      scroll :2,//每次滚动数
     *      speed:800,//速度（单位：毫秒）
     *      slideOneWay:false//当circular为true时,即循环滚动时,采用双向滚动方式
     * });
     * @type jQuery
     */
     /*
    $.fn.jCarouselLite = function(o) {
        o = $.extend({
            btnPrev: null,
            btnNext: null,
            btnGo: null,
            mouseWheel: false,
            auto: null,
            speed: 200,
            easing: null,
            vertical: false,
            circular: true,
            visible: 3,
            start: 0,
            scroll: 1,
            beforeStart: null,
            afterEnd: null,
            //单向滚动
            slideOneWay:true
        }, o || {});
        return this.each(function() {                           // Returns the element collection. Chainable.
            var running = false, animCss = o.vertical ? "top" : "left", sizeCss = o.vertical ? "height" : "width";
            var div = $(this), ul = $("ul", div), tLi = $("li", ul), tl = tLi.size(), v = o.visible;
            if (o.circular && o.slideOneWay) {
                //双向滚动不做元素添加操作
                ul.prepend(tLi.slice(tl - v - 1 + 1).clone()).append(tLi.slice(0, v).clone());
                o.start += v;
            }
            var li = $("li", ul), itemLength = li.size(), curr = o.start;
            div.css("visibility", "visible");
            li.css({ float: o.vertical ? "none" : "left"});
            ul.css({margin: "0", padding: "0", position: "relative", "list-style-type": "none", "z-index": "1"});
            div.css({overflow: "hidden",position: "relative", "z-index": "2", left: "0px"});
            if (!o.circular && o.start == 0) {
                //默认上一页不显示
                $(o.btnPrev).css("visibility", "hidden");
            }
            if (!o.circular && (o.start + o.scroll) >= (itemLength - 1)) {
                //默认下一页不显示
                $(o.btnNext).css("visibility", "hidden");
            }
            //不满足滚动条件的判断
            if (itemLength <= o.visible)
                $(o.btnPrev + "," + o.btnNext).css("visibility", "hidden");
            if (itemLength == 0)return;
            var liSize = o.vertical ? height(li) : width(li);   // Full li size(incl margin)-Used for animation
            var ulSize = liSize * itemLength;                   // size of full ul(total length, not just for the visible items)
            var divSize = liSize * v;                           // size of entire div(total length for just the visible items)
            li.css({width: li.width(), height: li.height()});
            ul.css(sizeCss, ulSize + "px").css(animCss, -(curr * liSize));
            div.css(sizeCss, divSize + "px");                     // Width of the DIV. length of visible images
            if (o.btnPrev)
                $(o.btnPrev).click(function() {
                    return go(curr - o.scroll);
                });
            if (o.btnNext)
                $(o.btnNext).click(function() {
                    return go(curr + o.scroll);
                });
            if (o.btnGo)
                $.each(o.btnGo, function(i, val) {
                    $(val).click(function() {
                        return go(o.circular ? o.visible + i : i);
                    });
                });
            if (o.mouseWheel && div.mousewheel)
                div.mousewheel(function(e, d) {
                    return d > 0 ? go(curr - o.scroll) : go(curr + o.scroll);
                });
            if (o.auto)
                setInterval(function() {
                    go(curr + o.scroll);
                }, o.auto + o.speed);
            function vis() {
                return li.slice(curr).slice(0, v);
            }

            function go(to) {
                if (!running) {
                    if (o.beforeStart)
                        o.beforeStart.call(this, vis());
                    if (o.circular) {            // If circular we are in first or last, then goto the other end
                        if (o.slideOneWay) {
                            //单向滚动
                            if (to <= o.start - v - 1) {           // If first, then goto last
                                ul.css(animCss, -((itemLength - (v * 2)) * liSize) + "px");
                                // If "scroll" > 1, then the "to" might not be equal to the condition; it can be lesser depending on the number of elements.
                                curr = to == o.start - v - 1 ? itemLength - (v * 2) - 1 : itemLength - (v * 2) - o.scroll;
                            } else if (to >= itemLength - v + 1) { // If last, then goto first
                                ul.css(animCss, -( (v) * liSize ) + "px");
                                // If "scroll" > 1, then the "to" might not be equal to the condition; it can be greater depending on the number of elements.
                                curr = to == itemLength - v + 1 ? v + 1 : v + o.scroll;
                            } else curr = to;
                        } else {
                            //双向滚动
                            if (to < 0) {
                                //滚动到最后一项
                                curr = itemLength - v;
                            } else if (to > itemLength - v) {
                                //滚动到第一项
                                curr = 0;
                            } else {
                                curr = to;
                            }
                        }
                    } else {                    // If non-circular and to points to first or last, we just return.
                        if (to < 0 || to > itemLength - v) return;
                        else curr = to;
                    }                           // If neither overrides it, the curr will still be "to" and we can proceed.
                    // running = true;
                    ul.animate(animCss == "left" ? { left: -(curr * liSize) } : { top: -(curr * liSize) }, o.speed, o.easing, function() {
                        if (o.afterEnd)
                            o.afterEnd.call(this, vis());
                        running = false;
                    });
                    // Disable buttons when the carousel reaches the last/first, and enable when not
                    if (!o.circular) {
                        $(o.btnPrev + "," + o.btnNext).css("visibility", "visible");
                        $((curr - o.scroll < 0 && o.btnPrev) || (curr + o.scroll > itemLength - v && o.btnNext) || []).css("visibility", "hidden");
                    }
                }
                return false;
            }
        });
    };*/
    function css(el, prop) {
        return parseInt($.css(el[0], prop)) || 0;
    }

    function width(el) {
        return  el[0].offsetWidth + css(el, 'marginLeft') + css(el, 'marginRight');
    }

    function height(el) {
        return el[0].offsetHeight + css(el, 'marginTop') + css(el, 'marginBottom');
    }
})(jQuery);
//鼠标滚轮插件(无需手动调用)
(function($) {

    $.event.special.mousewheel = {
        setup: function() {
            var handler = $.event.special.mousewheel.handler;

            // Fix pageX, pageY, clientX and clientY for mozilla
            if ($.browser.mozilla)
                $(this).bind('mousemove.mousewheel', function(event) {
                    $.data(this, 'mwcursorposdata', {
                        pageX: event.pageX,
                        pageY: event.pageY,
                        clientX: event.clientX,
                        clientY: event.clientY
                    });
                });

            if (this.addEventListener)
                this.addEventListener(($.browser.mozilla ? 'DOMMouseScroll' : 'mousewheel'), handler, false);
            else
                this.onmousewheel = handler;
        },

        teardown: function() {
            var handler = $.event.special.mousewheel.handler;

            $(this).unbind('mousemove.mousewheel');

            if (this.removeEventListener)
                this.removeEventListener(($.browser.mozilla ? 'DOMMouseScroll' : 'mousewheel'), handler, false);
            else
                this.onmousewheel = function() {
                };

            $.removeData(this, 'mwcursorposdata');
        },

        handler: function(event) {
            var args = Array.prototype.slice.call(arguments, 1);

            event = $.event.fix(event || window.event);
            // Get correct pageX, pageY, clientX and clientY for mozilla
            $.extend(event, $.data(this, 'mwcursorposdata') || {});
            var delta = 0, returnValue = true;

            if (event.wheelDelta) delta = event.wheelDelta / 120;
            if (event.detail) delta = -event.detail / 3;
            if ($.browser.opera) delta = -event.wheelDelta;

            event.data = event.data || {};
            event.type = "mousewheel";

            // Add delta to the front of the arguments
            args.unshift(delta);
            // Add event to the front of the arguments
            args.unshift(event);

            return $.event.handle.apply(this, args);
        }
    };

    $.fn.extend({
        mousewheel: function(fn) {
            return fn ? this.bind("mousewheel", fn) : this.trigger("mousewheel");
        },

        unmousewheel: function(fn) {
            return this.unbind("mousewheel", fn);
        }
    });

})(jQuery);
(function($) {
    /**
     * 时间显示控件,格式为:09月11日星期五 11:23:26
     * @param str {String} 需要显示时间的初始值
     * @example
     * 在id为"YourElementID"的元素内生成时钟，初始时间为"2008-08-08 12:12:12"
     * $('#YourElementID').jclock("2008-08-08 12:12:12");
     * @type jQuery
     */
    $.fn.jclock = function(str) {
        var timedifference = new Date() - new Date(Date.parse(str.replace(/-/g, "/")));
        var jqEl = this;
        setInterval(function() {
            var nowDate = new Date(new Date() - timedifference);
            jqEl.html(getDate(nowDate) + "星期" + '日一二三四五六'.charAt(nowDate.getDay()) + " " + nowDate.toLocaleTimeString());
        }, 1000);
        return jqEl = this;
    };
    /**
     * 获取日期字符串
     * @param now {Date} 当前需要计算的日期
     * @type String
     */
    function getDate(now) {
        var month = now.getMonth() + 1;
        var date = now.getDate();
        return ((month < 10) ? "0" : "") + month + "月" + ((date < 10) ? "0" : "") + date + "日";
    }
})(jQuery);
(function($) {
    var n = 0;
    var opt_d = {begin:1910,end:2000,defaultVal:"",style:"",showDay:true};
    var mlength = [0,31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];

    function fill(s, e, o) {
        o.attr("length", 0);
		if(s>e)
		{
			for (var i = s; i >= e; i--)
			{
				$("<option/>").val(i).text(i).appendTo(o);
			}
		}
		else
		{
			for (var i = s; i <= e; i++)
			{
				$("<option/>").val(i).text(i).appendTo(o);
			}
		}
    }

    function pin(year) { //判断是否闰平年
        return(0 == year % 4 && (year % 100 != 0 || year % 400 == 0));
    }

    /**
     * 众乐网日期选择器,生成的选择器将作为子节点添加到当前对象末尾
     * @param opts {Object} 配置参数：
     * {
     *      begin:{Number} 起始年份，默认为1910,
     *      end:{Number} 终止年份，默认为2000,
     *      defaultVal:{String} 默认日期，年月日以"/"或"-"间隔,
     *      style:{String} 选择器样式类,
     *      showDay:{Boolean} 是否显示日期，默认显示
     * }
     * @type jQuery
     * @example
     * 构造生日选择器
     * $("#birthday").zllDate({begin:1930,end:2050,defaultVal:"2009/09/15",style:"",showDay:true});
     * @author WangHao 2009-7-13
     */
    $.fn.zllDate = function(opts) {
        return this.each(function() {
            var opt = $.extend(opt_d, opts);
            var _id = $(this).attr("id") || "new_zllData" + n++;
            var _y = $("<select/>").attr("name", _id + "_yearSel").attr("id", _id + "_yearSel").appendTo($(this)).addClass(opt.style);
            var _m = $("<select/>").attr("id", _id + "_monthSel").attr("name", _id + "_monthSel").appendTo($(this)).addClass(opt.style);
            if (opt.showDay)var _d = $("<select/>").attr("id", _id + "_daySel").attr("name", _id + "_daySel").appendTo($(this)).addClass(opt.style);
            fill(opt.begin, opt.end, _y);
            fill(1, 12, _m);
            if (opt.showDay)fill(1, 31, _d);
            if (opt.showDay)
                _y.change(function() {
                    var _dv = _d.val();
				
                    if (_m.val() == 2)
                    {
					   if( pin(_y.val()))
                       {
							fill(1, mlength[2] + 1, _d);
					   }
					   else
					   {
					
							fill(1, mlength[2], _d);
					   }
                    }
                    
                    setTimeout(function() {
                        _d.val(_dv < _d.children().length ? _dv : _d.children().length);
                    }, 1);
                });
            if (opt.showDay)
                _m.change(function() {
                    var _dv = _d.val();
                    if (_m.val() == 2 && pin(_y.val()))
                    {
                        fill(1, mlength[2] + 1, _d);
                    }
                    else
                    {
                        fill(1, mlength[_m.val()], _d);
                    }
                    setTimeout(function() {
                        _d.val(_dv < _d.children().length ? _dv : _d.children().length);
                    }, 1);
                });
            if (opt.defaultVal != "")
            {
                var _dval = opt.defaultVal.replace(/\//g, ",").replace(/-/g, ",").split(",");
                setTimeout(function() {
                    _y.val(_dval[0]);
                }, 1);
                setTimeout(function() {
                    _m.val(_dval[1]);
                }, 1);
                if (opt.showDay)setTimeout(function() {
                    _d.val(_dval[2]);
                }, 1);
            }
        });
    };
})(jQuery);
(function($) {
    var _configall = {
        "default":{
            template:{
                container:"<div class=\"fan_ye\"></div>",
                loop:"<a class=\"pagenew\" href=\"{url}\"><span class=\"pagenewh\"/><span class=\"pagenewb\" >{page}</span><span class=\"pagenewf\"/></a>",
                firstpage:"<a class=\"pagenew fristpage\" href=\"{url}\"><span class=\"fristpageh\"/><span class=\"fristpageb\" title=\"上一页\"/><span class=\"fristpagef\"/></a>",
                lastpage:"<a class=\"pagenew lastpage\" href=\"{url}\"><span class=\"lastpageh\"/><span class=\"lastpageb\">下一页</span><span class=\"lastpagef\"/></a>",
                dot:"<span class=\"pagenew point\">…</span>"
            },
            /**
             * 配置和初始化翻页控件
             * @param t {Object} 模板
             * @param j {jQuery} 翻页控件的容器对象
             * @param opt {Object} 翻页控件配置参数
             */
            handle:function(t, j, opt) {
                var _pnum = Math.floor(opt.recordcount / opt.pagesize) + (opt.recordcount % opt.pagesize ? 1 : 0);
                if (_pnum < 2)return;
                opt.nowpage = opt.nowpage > _pnum ? _pnum : opt.nowpage;
                var _c = $(t.container);
                var _fp = $(t.firstpage.replace(/{url}/, buildUrl(opt.url, opt.pageparameter, opt.nowpage - 1 || 1)));
                var _lp = $(t.lastpage.replace(/{url}/, buildUrl(opt.url, opt.pageparameter, opt.nowpage == _pnum ? opt.nowpage : opt.nowpage + 1)));
                if (opt.nowpage > 1)
                {
                    _c.append(_fp);
                }
                var _start = 1,_end = _pnum,_ismore = false,_lmore = true,_rmore = true;
                if (_pnum > 10)
                {
                    _end = opt.nowpage + 4;
                    _start = opt.nowpage - 4;
                    if (opt.nowpage + 4 >= _pnum)
                    {
                        _end = _pnum;
                        _start = _end - 8;
                        _rmore = false;
                    }
                    if (opt.nowpage - 4 <= 1)
                    {
                        _start = 1;
                        _end = _start + 8;
                        _lmore = false;
                    }

                    _ismore = true;

                }

                for (var i = _start,loopindex = 1; i <= _end; i++,loopindex++)
                {
                    var _loop;
                    if (_ismore)
                    {
                        _loop = $(t.loop.replace(/{url}/g, buildUrl(opt.url, opt.pageparameter, i)).replace(/{page}/g, i));
                        if ($.inArray(loopindex, [1,2]) > -1)
                        {
                            _loop = $(t.loop.replace(/{url}/g, buildUrl(opt.url, opt.pageparameter, loopindex)).replace(/{page}/g, loopindex));
                        }
                        if ($.inArray(loopindex, [8,9]) > -1)
                        {
                            _loop = $(t.loop.replace(/{url}/g, buildUrl(opt.url, opt.pageparameter, _pnum + loopindex - 9)).replace(/{page}/g, _pnum + loopindex - 9));
                        }

                        if (loopindex == 3 && _lmore)
                        {
                            _c.append($(t.dot));
                        }
                        if (loopindex == 8 && _rmore)
                        {
                            _c.append($(t.dot));
                        }
                    }
                    else
                    {
                        _loop = $(t.loop.replace(/{url}/g, buildUrl(opt.url, opt.pageparameter, i)).replace(/{page}/g, i));
                    }
                    if (i == opt.nowpage)
                    {
                        _loop.addClass("focus1");
                    }
                    _c.append(_loop);
                }
                if (opt.nowpage < _pnum)
                {
                    _c.append(_lp);
                }
                $("<div class=\"fan_ye_bottom\"/>").append(_c).appendTo(j);
            }
        },
        "tiny":{
            template:{
                container:"<div class=\"fan_ye\"></div>",
                firstpage:"<a class=\"pagenew fristpage\" href=\"{url}\"><span class=\"fristpageh\" /><span class=\"fristpageb\" title=\"上一页\"/><span class=\"fristpagef\" /></a>",
                lastpage:"<a class=\"pagenew lastpage\" href=\"{url}\"><span class=\"lastpageh\"/><span class=\"lastpageb\">下一页</span><span class=\"lastpagef\"/></a>",
                info:"<span class=\"pagenum\">{nowpage}/{allpage}</span>"
            },
            /**
             * 配置和初始化翻页控件
             * @param t {Object} 模板
             * @param j {jQuery} 翻页控件的容器对象
             * @param opt {Object} 翻页控件配置参数
             */
            handle:function(t, j, opt) {
                var _pnum = Math.floor(opt.recordcount / opt.pagesize) + (opt.recordcount % opt.pagesize ? 1 : 0);
                if (_pnum < 2)return;
                opt.nowpage = opt.nowpage > _pnum ? _pnum : opt.nowpage;
                var _c = $(t.container);
                var _info = $(t.info.replace(/{nowpage}/, opt.nowpage).replace(/{allpage}/, _pnum));
                var _fp = $(t.firstpage.replace(/{url}/, buildUrl(opt.url, opt.pageparameter, opt.nowpage - 1 || 1)));
                var _lp = $(t.lastpage.replace(/{url}/, buildUrl(opt.url, opt.pageparameter, opt.nowpage == _pnum ? opt.nowpage : opt.nowpage + 1)));
                _c.append(_info);
                if (opt.nowpage > 1)
                {
                    _c.append(_fp);
                }
                if (opt.nowpage < _pnum)
                {
                    _c.append(_lp);
                }
                $("<div class=\"fan_ye_top\"/>").append(_c).appendTo(j);
            }
        },
        //表情系统fckeditor浮层翻页控件
        smiley:{
            //模板
            template:{
                container:'<div class="tF_fenYe"></div>',
                firstpage:'<a href="{url}">上一页</a>',
                loop:'<a href="{url}">{page}</a>',
                lastpage:'<a href="{url}">下一页</a>',
                dot:'…'
            },
            /**
             * 配置和初始化翻页控件
             * @param t {Object} 模板
             * @param j {jQuery} 翻页控件的容器对象
             * @param opt {Object} 翻页控件配置参数
             */
            handle:function(t, j, opt) {
                var _pnum = Math.floor(opt.recordcount / opt.pagesize) + (opt.recordcount % opt.pagesize ? 1 : 0);
                if (_pnum < 2)return;
                opt.nowpage = parseInt(opt.nowpage > _pnum ? _pnum : opt.nowpage);
                var _c = $(t.container);
                var _fp = $(t.firstpage.replace(/{url}/, buildUrl(opt.url, opt.pageparameter, opt.nowpage - 1 || 1)));
                var _lp = $(t.lastpage.replace(/{url}/, buildUrl(opt.url, opt.pageparameter, opt.nowpage == _pnum ? opt.nowpage : opt.nowpage + 1)));
                if (opt.nowpage > 1)
                {
                    _c.append(_fp);
                }
                var _start = 1,_end = _pnum,_ismore = false,_lmore = true,_rmore = true;
                if (_pnum > 10)
                {
                    _end = opt.nowpage + 4;
                    _start = opt.nowpage - 4;
                    if (opt.nowpage + 4 >= _pnum)
                    {
                        _end = _pnum;
                        _start = _end - 8;
                        _rmore = false;
                    }
                    if (opt.nowpage - 4 <= 1)
                    {
                        _start = 1;
                        _end = _start + 8;
                        _lmore = false;
                    }

                    _ismore = true;

                }
                //页码html字符串
                var _sPageHtml="";
                for (var i = _start,loopindex = 1; i <= _end; i++,loopindex++)
                {
                    if (i == opt.nowpage)
                    {
                        //当前页元素结构
                        _sPageHtml+="<span>" + i + "</span>";
                        continue;
                    }
                    var _loop;
                    if (_ismore)
                    {
                        _loop = t.loop.replace(/{url}/g, buildUrl(opt.url, opt.pageparameter, i)).replace(/{page}/g, i);
                        if ($.inArray(loopindex, [1,2]) > -1)
                        {
                            _loop = t.loop.replace(/{url}/g, buildUrl(opt.url, opt.pageparameter, loopindex)).replace(/{page}/g, loopindex);
                        }
                        if ($.inArray(loopindex, [8,9]) > -1)
                        {
                            _loop = t.loop.replace(/{url}/g, buildUrl(opt.url, opt.pageparameter, _pnum + loopindex - 9)).replace(/{page}/g, _pnum + loopindex - 9);
                        }

                        if ((loopindex == 3 && _lmore)||(loopindex == 8 && _rmore))
                        {
                            _sPageHtml+=t.dot;
                        }
                    }
                    else
                    {
                        _loop = t.loop.replace(/{url}/g, buildUrl(opt.url, opt.pageparameter, i)).replace(/{page}/g, i);
                    }
                    _sPageHtml+=_loop;
                }
                _c.append('<span class="pageNum">'+_sPageHtml+'</span>');
                if (opt.nowpage < _pnum)
                {
                    _c.append(_lp);
                }
                _c.replaceAll(j);
            }
        }
    };
    /**
     * 构造翻页时请求的url
     * @param url {String} 翻页时需请求的url
     * @param pageparameter {String} 页码参数名称
     * @param page {Number} 页码
     * @return 翻页时请求的url，包含页码参数
     * @type String
     */
    function buildUrl(url, pageparameter, page) {
        var reg = new RegExp("([?&])" + pageparameter + "=\\d*", "g");
        url = url.replace(reg, "$1");
        return (url + (url.indexOf("?") > -1 ? "&" : "?") + pageparameter + "=" + page).replace(/&+/g, "&").replace(/\?&/g, "?");
    }

    /**
     * 众乐翻页控件
     * @param opt {Object} 配置参数：
     * {
     *      pagesize:{Number} 每页显示记录条数(默认10),
     *      nowpage:{Number} 当前页码(默认1),
     *      recordcount:{Number} 总记录数,
     *      url:{String} 链接(默认当前请求url) ,
     *      pageparameter:{String} 页数的参数名(默认"page"),
     *      config:{String} 要读取的配置（扩展用，默认"default"）
     * }
     * @type jQuery
     * @example
     * 分享信息翻页显示
     * $("#pager_num1").zllPager({recordcount: 91,pagesize: 25,nowpage: 1,url: "/mblog/share/all",pageparameter:"p"});
     * @author WangHao 众乐网分页控件V1.0 2009-7-21
     */
    $.fn.zllPager = function(opt) {
        var _defaultopt = {
            pagesize:10,
            nowpage:1,
            recordcount:100,
            url:window.location.href.toString(),
            pageparameter:"page",
            config:"default"
        };
        var _opt = $.extend(_defaultopt, opt || {});
        return this.each(function() {
            var _config = _configall[_opt.config] || _configall["default"];
            _config.handle(_config.template, $(this), _opt);
        });
    };
})(jQuery);
(function($) {
    /**
     * 提示插件
     * @param options {Object} 配置参数:
     * {
     *      trigger:{String} 触发提示信息显示的事件，默认为"hover",
     *      top:{Number} 提示箱显示时的顶端位置与鼠标位置间的偏移量，默认为3,
     *      left:{Number} 提示箱显示时的左侧位置与鼠标位置间的偏移量，默认为12,
     *      attr:{String} 存储提示信息的属性名称，默认为"tip",
     *      opacity:{Number} 提示箱的透明度，默认为0.8,
     *      autoClose:{Boolean} 是否自动关闭，默认为true,
     *      defaultVal:{String} 默认提示信息，默认为""
     * }
     * @example
     * class为"forstip"的对象添加提示箱
     * $(".forstip").sTip();
     */
    $.fn.sTip = function(options) {

        /**************************************************
         * initialize
         **************************************************/
        var opts = $.extend({}, $.fn.sTip.defaults, options);

        if ($("#SII_Tip").length == 0)
        {
            $('<div>').appendTo("body").attr("id", "SII_Tip").css({position: "absolute"}).hide();
        }

        /*******************************************
         * private function
         *********************************************/
        var closeBox = function() {
            $("#SII_Tip").hide().empty();
        };

        var getData = function(obj) {
            $("#SII_Tip").html(typeof($(obj).attr(opts.attr)) != "undefined" ? $(obj).attr(opts.attr) : opts.defaultVal);
        };

        var getPosition = function (e) {
            var top = e.pageY + opts.top;
            $("#SII_Tip").css({
                top: top,
                left: calculateLeft(e),
                zIndex:10001, //增大tip的zIndex，防止被遮挡
                opacity: opts.opacity
            }).show();
        };

        /**
         * 计算left值
         * @param e {Event} 事件对象
         */
        function calculateLeft(e) {
            var left = e.pageX + opts.left;
            var nWidth = $("#SII_Tip").width();
            //若超出body右边界,则在左侧显示tip
            return (left + nWidth > $(document.body).width()) ? (e.pageX - opts.left - nWidth) : left;
        }
        /**********************************************
         *    bind Event
         *************************************************/
        $(".SII_Tip_Close").bind("click", closeBox);
        $("#SII_Tip").bind("click", function(evt) {
            evt.stopPropagation();
        });

        if (opts.trigger == "hover") {
            $(this).bind("mouseover", function(e) {
                $("#SII_Tip").show();
                e.preventDefault();
                getData(this, e);
                return false;
            });
            $(this).bind("mousemove", function(e) {
                getPosition(e);
                return false;
            });
            $(this).bind("mouseout", function(e) {
                /* WuKan changed for IE6 090814 */
                if ($.browser.msie && $.browser.version == "6.0") {
                    $(this).children("div").eq(0).addClass("forie6tip");
                    e = e || window.event;
                    o = e.relatedTarget || e.toElement;
                    while (o && o.parentNode && !$(o).hasClass("forstip")) {
                        o = o.parentNode;
                    }
                    if (!$(o).hasClass("forstip"))
                        closeBox();
                } else {
                    closeBox();
                }
                return false;
            });
        }
        else if (opts.trigger == "click") {
            $(this).bind("click", function(e) {
                getData(this, e);
                getPosition(e);
                $("#SII_Tip").show();
                if (opts.autoClose) {
                    $(document).bind("click", closeBox);
                }
                return false;
            });
        }
    };
    /******************************************************
     *    default options
     *********************************************************/
    $.fn.sTip.defaults = {
        trigger: "hover",
        top: 3,
        left: 12,
        attr: "tip",
        opacity:  0.8,
        autoClose: true,
        defaultVal:""
    };
})(jQuery);
//浮动错误提示
(function($) {
    $.errorTip = function(evt, msg) {
        var opts = {
            top: 3,
            left: 12
        };
        var getPosition = function (e) {
            var top = e.pageY + opts.top;
            var left = e.pageX + opts.left;
            $("#SII_Err_Tip").css({
                top: top,
                left: left,
                zIndex:9999
            });
        };
        if ($("#SII_Err_Tip").length == 0)
        {
            $('<div>').appendTo("body").attr("id", "SII_Err_Tip").css({position: "absolute"}).hide();
        }
        getPosition(evt);
        if ($("#SII_Err_Tip").css("display") == "none")
            $("#SII_Err_Tip").html('<span class="lotaicon li1"/>' + msg).fadeIn("slow").fadeOut(2000);
        else
            $("#SII_Err_Tip").html('<span class="lotaicon li1"/>' + msg);
    };
})(jQuery);
(function($) {
    /**
     * When fading a html node with the .fadeIn() , .fadeOut() and .fadeTo() functions in jQuery, IE drops the windows
     * Cleartype rendering; which results in very ugly text.The most common way to solve this problem is by removing
     * the filter CSS attribute.A simple, more elegant solution would be to wrap the .fadeIn() , .fadeOut() and
     * .fadeTo() functions with a custom function via the plugin interfaceof jQuery.
     */
    /**
     * @see <a href="http://docs.jquery.com/Effects/fadeIn#speedcallback">fadeIn( speed, [callback] )</a>
     */
    $.fn.customFadeIn = function(speed, callback) {
        return this.each(function() {
            $(this).fadeIn(speed, function() {
                if (jQuery.browser.msie)
                    $(this).get(0).style.removeAttribute('filter');
                if (callback != undefined)
                    callback();
            });
        });
    };
    /**
     * @see <a href="http://docs.jquery.com/Effects/fadeOut#speedcallback">fadeOut( speed, [callback] ) </a>
     */
    $.fn.customFadeOut = function(speed, callback) {
        return this.each(function() {
            $(this).fadeOut(speed, function() {
                if (jQuery.browser.msie)
                    $(this).get(0).style.removeAttribute('filter');
                if (callback != undefined)
                    callback();
            });
        });
    };
    /**
     * @see <a href="http://docs.jquery.com/Effects/fadeTo#speedopacitycallback">fadeTo( speed, opacity, [callback] )</a>
     */
    $.fn.customFadeTo = function(speed, opacity, callback) {
        return this.each(function() {
            $(this).fadeTo(speed, opacity, function() {
                if (jQuery.browser.msie)
                    $(this).get(0).style.removeAttribute('filter');
                if (callback != undefined)
                    callback();
            });
        });
    };
})(jQuery);
(function($) {
    /**
     * 输入框中默认显示灰色文本
     * @param oConfig {Object} 配置参数，其结构为：
     * {
     *      text:{String} 默认文字,
     *      ziClass:{String} 文本默认显示的样式，默认为"zi2"
     * }
     * @type jQuery
     * @example
     * 好友搜索输入框中默认灰色文本:"我要去看谁？"
     * $(".fc_input").inputDefault({
     *      text:_."我要去看谁？"
     * });
     */
    $.fn.inputDefault = function(oConfig) {
        var ziClass = oConfig.ziClass || "zi2";
        return this.focus(function() {
            if ($(this).hasClass(ziClass))$(this).val("").removeClass(ziClass);
        }).blur(function() {
            if ($.trim($(this).val()).length == 0)$(this).val(oConfig.text).addClass(ziClass);
        }).val(oConfig.text).addClass(ziClass);
    };
})(jQuery);
$.extend($.fn, {
    /**
     * word-wrap for Mozilla/Firefox
     */
    wordWrap4Firefox:function() {
//        if (!$.browser.mozilla) {
            //仅对Mozilla/Firefox进行处理
            return this;
//        }
       /* return this.each(function() {
            //解码数组对应关系
            var aDecode = [
                ["&","&amp;"],
                ['"',"&quot;"],
                ["'","&#039;"],
                ["<","&lt;"],
                [">","&gt;"]
            ];
            //编码数组对应关系
            var aEncode = [
                ["&&#8203;","&amp;&#8203;"],
                ['"',"&quot;"],
                ["'","&#039;"],
                ["<","&lt;"],
                [">","&gt;"]
            ];
            var jTarget = $(this);
            var sHtml = jTarget.html();
            $.each(aDecode, function() {
                //解码
                sHtml = sHtml.replace(new RegExp(this[1], "g"), this[0]);
            });
            sHtml = sHtml.split('').join('&#8203;').replace(/<&#8203;\*//*[&#8203;:_\s="'\w\/\.]+>/g, function (_tag)
            {
                return _tag.replace(/&#8203;/g, '');
            });
            $.each(aEncode, function() {
                //编码
                sHtml = sHtml.replace(new RegExp(this[0], "g"), this[1]);
            });
            jTarget.html(sHtml);
        });*/
    }
});