var isIE = /msie/.test(navigator.userAgent.toLowerCase());
var iCur = 0;

var sImgPath = new Array();

sImgPath[0] = "http://img7.hxsd.com/newstopic/091021miluwang/1.jpg";
sImgPath[1] = "http://img8.hxsd.com/newstopic/091021miluwang/2.jpg";
sImgPath[2] = "http://img9.hxsd.com/newstopic/091021miluwang/3.jpg";
sImgPath[3] = "http://img0.hxsd.com/newstopic/091021miluwang/4.jpg";
sImgPath[4] = "http://img1.hxsd.com/newstopic/091021miluwang/5.jpg";
sImgPath[5] = "http://img2.hxsd.com/newstopic/091021miluwang/6.jpg";
sImgPath[6] = "http://img3.hxsd.com/newstopic/091021miluwang/7.jpg";
sImgPath[7] = "http://img4.hxsd.com/newstopic/091021miluwang/8.jpg";
sImgPath[8] = "http://img5.hxsd.com/newstopic/091021miluwang/9.jpg";
sImgPath[9] = "http://img6.hxsd.com/newstopic/091021miluwang/10.jpg";
sImgPath[10] = "http://img7.hxsd.com/newstopic/091021miluwang/11.jpg";
sImgPath[11] = "http://img8.hxsd.com/newstopic/091021miluwang/12.jpg";
sImgPath[12] = "http://img9.hxsd.com/newstopic/091021miluwang/13.jpg";
sImgPath[13] = "http://img0.hxsd.com/newstopic/091021miluwang/14.jpg";
sImgPath[14] = "http://img1.hxsd.com/newstopic/091021miluwang/15.jpg";



function $(obj) {
	return typeof obj == "string"?document.getElementById(obj):obj;
}

function addEvent(oTar , eType , funcHandler) {
	 if (oTar.addEventListener) {
        oTar.addEventListener(eType, funcHandler, false);
    } else if (oTar.attachEvent) {
        oTar.attachEvent("on" + eType, funcHandler);
    } else {
        oTar["on" + eType] = funcHandler;
    }
}

function removeEvent(oTar , eType , funcHandler) {
	 if (oTar.removeEventListener) {
        oTar.removeEventListener(eType, funcHandler, false);
    } else if (oTar.detachEvent) {
        oTar.detachEvent("on" + eType, funcHandler);
    } else {
        oTar["on" + eType] = null;
    }
}

function change_opacity(count) {
    if(count == 10){
		if(isIE){
			obj.style.filter = "Alpha(Opacity=100)";
		}else {
			obj.style.opacity = 1;
		}
		return;
	}
    if(count == 5){
        iCur = (iCur+1)%sImgPath.length;
        obj.innerHTML = "<img src='"+sImgPath[iCur]+"' />";
    }
	if(isIE){
		obj.style.filter = "Alpha(Opacity="+Math.abs(count-5)*20+")";
	}else {
		obj.style.opacity = Math.abs(count-5)/5;
	}
	count++;
	setTimeout(function(){change_opacity(count);},50);
}

addEvent(window,"load",function(){
    obj = document.getElementById("show");
	setInterval(function(){change_opacity(0)},3000);
});
