$.fn.ImageRotation = function (width, height, Inerval) {
    if (Inerval == undefined) Inerval = 3000;
    var Id = "#" + $(this)[0].id;
    var count = $(Id + " div a").length;
    $(Id + " div a:not(:first-child)").hide();
    $(Id).attr("timeLine", 0);
    $(Id).attr("n", 0);
    var _ul = document.createElement("ul");
    for (i = 0; i < count; i++) {
        var _li = document.createElement("li");
        _li.innerHTML = (i + 1);
        _ul.appendChild(_li);
    }
    $(Id)[0].appendChild(_ul);
    $(Id).css(
    {
        "width": width, "height": height
    }
    );
    $(Id + " li").eq(0).css(
    {
        "background": "#be2424", 'color': '#000'
    }
    ).siblings().css(
    {
        "background": "#6f4f67", 'color': '#fff'
    }
    );
    $(Id + " li").click(function () {
        var i = $(this).text() - 1;
        $(Id).attr("n", i);
        var count = $(Id + " div a").length;
        if (i >= count) return;
        $(Id + " div a").filter(":visible").fadeOut(1000).parent().children().eq(i).fadeIn(1000);
        $(this).css(
    {
        "background": "#be2424", 'color': '#000'
    }
    ).siblings().css(
    {
        "background": "#6f4f67", 'color': '#fff'
    }
    );
    }
);
    $(Id).attr("timeLine", setInterval("Rotation_showAuto('" + Id + "')", Inerval));
    $(Id).hover(function () {
        clearInterval($(Id).attr("timeLine"))
    }
, function () {
    $(Id).attr("timeLine", setInterval("Rotation_showAuto('" + Id + "')", Inerval));
}
);
};
function Rotation_showAuto(divId) {
    var n = $(divId).attr("n");
    var count = $(divId + " div a").length;
    n = n >= (count - 1) ? 0 : ++n;
    $(divId + " li").eq(n).trigger('click');
}

