var o = new Object;
var i_1 = 0;
var timer_1 = 500;
var obj_imgChange = ".bannerChange";
var len_obj_imgChange = 0;
var obj_nn = ".ctrlimg li";
$(function() {
    len_obj_imgChange = $(obj_imgChange).length;
   
	for(var i =0 ;i<len_obj_imgChange;i++)
	{
		$(".ctrlimg").append('<li>'+(i+1)+'</li>');
	}
	var obj = $(obj_nn);
	obj.eq(0).addClass("current");
    o.msOut();
	$(obj_nn).hover(function(){
		o.msOver(this);
	},function(){
		o.msOut();
	});
});
o.msOver = function (e) {
    clearInterval(xx);
    if (i_1 == $(e).prevAll().length) {
        return false;
    }
    i_1 = $(e).prevAll().length;
    $(obj_nn).removeClass("current").eq(i_1).addClass("current");
    o.effects(obj_imgChange, 10);
};
o.msOut = function() {
    $.autoFn(obj_imgChange, 10);
};
o.effects = function(e) {
    $(e).stop().animate({
        opacity: '0.5'
    },
    timer_1,
    function() {

        $(e).css("display", "none").eq(i_1).stop().animate({
            opacity: '1'
        },
        timer_1).css("display", "block");
    })
};
$.autoFn = function(e,x) {
    var timer_x = timer_1 * x;
    xx = setInterval(function() {
        $(e).stop().animate({
            opacity: '0.5'
        },
        timer_1,
        function() {
            $(obj_nn).removeClass("current").eq(i_1).addClass("current");

            $(e).css("display", "none").eq(i_1).css("display", "block").stop().animate({
                opacity: '1'
            },
            timer_1);
        }); ++i_1;
        if (i_1 == len_obj_imgChange) {
            i_1 = 0;
        }
    },
    timer_x);
};
