//mzy
var EdImg = {
    nIndex:0,
	init : function() {
        EdImg.nCount = $("#NChild li").size() || 5;
	    //
	    for(var i=1;i<=EdImg.nCount;i++){
	        var obj=document.createElement("li");
	        obj.innerHTML=i;
	        EdImg.getObj("NNum").appendChild(obj);
	    }
	    $("#NNum li").click(function() {
		    var index = $(this).text();
		    $("#NChild li").filter(":visible").hide("slow");
		    $("#NChild li").eq(index-1).show("slow");
		    $(this).attr("class","on").siblings().attr("class","");
		    EdImg.nIndex=index-1;
	    });
	    //
	    $("#NChild li:not(:first-child)").hide();
	    $("#NNum li:first").attr("class","on");
	    EdImg.nTimer = setInterval(EdImg.start, 4000);
	    $("#NParent").hover(function(){clearInterval(EdImg.nTimer)}, function(){EdImg.nTimer = setInterval(EdImg.start, 4000);});
	},
	getObj: function(strobj){
	    return document.getElementById(strobj);
	},
	start : function(){
	    EdImg.nIndex = (EdImg.nIndex >= (EdImg.nCount - 1)) ? 0 : (EdImg.nIndex + 1);
	    $("#NNum li").eq(EdImg.nIndex).trigger('click');
	}
}
