var ns4=(document.layers)?true:false

function NCreloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.NCpgW=innerWidth; document.NCpgH=innerHeight; onresize=NCreloadPage; }}
  else if (innerWidth!=document.NCpgW || innerHeight!=document.NCpgH) location.reload();
}
NCreloadPage(true)

/** 滚动框程序段开始 **/
var currentDnum=0
var nextDnum
var timeID
var mouseHover=false
var outHover=false

var divClipTop=0
var divClipBottom=-moveSpace

function writeDivs(){
	if (ns4){
		document.write("<ilayer name=divOuter width="+divWidth+" height="+divHeight+">")
		for (i=0;i<st.length;i++){
			document.write("<layer name=d"+i+" width="+divWidth+" height="+divHeight+" onMouseover='Javascript:mouseHover=true;mvStop()' onMouseout='Javascript:mouseHover=false;moveUpDiv()'>"+st[i]+"</layer>\n")
		}
		document.write("</ilayer>")
		document.close()
	}else{
		document.write("<div id=divOuter style='position:relative' height="+divHeight+" onmouseMove='javascript:outHover=true' onMouseover='javascript:outHover=true' onMouseout='javascript:outHover=false'>")
		
		if(st.length==1){
			st.length=2;
			st[1]=st[0];
		}
			
		for (i=0;i<st.length;i++){
			document.write("<div id=d"+i+" style='position:absolute;top:0;clip:rect(0,"+divWidth+","+divHeight+",0); width:"+divWidth+";height:"+divHeight+"' onMouseover='Javascript:mvStop()' onMouseout='Javascript:moveUpDiv()'>"+st[i]+"</div>\n")
		}		

		document.write("</div>")
	}
}

function initDivPlace(){
	for (i=1;i<st.length;i++){
		if (ns4){
			eval("document.divOuter.document.d"+i+".top=document.divOuter.document.d"+parseInt(i-1)+".clip.bottom")
			//eval("document.divOuter.document.d"+i+".clip.bottom=document.divOuter.document.d"+i+"clip.top")
		}else{
			eval("document.all.d"+i+".style.clip='rect(0,"+divWidth+",0,0)'")
		}
	}
}

function mvStart(){
	timeID=setTimeout(moveUpDiv,moveRelax)
}

function mvStop(){
	clearTimeout(timeID)
}

function moveUpDiv(){
	nextDnum=(currentDnum+1)%st.length
	if (ns4){
		if (eval("document.divOuter.document.d"+currentDnum+".clip.bottom>0")){
			eval("document.divOuter.document.d"+currentDnum+".top-=moveStep")
			eval("document.divOuter.document.d"+nextDnum+".top=document.divOuter.document.d"+currentDnum+".top+divHeight+moveSpace")
		}
		if ( eval("document.divOuter.document.d"+nextDnum+".top<=0") ){
			currentDnum=nextDnum
			mvStop()
			if ( (!mouseHover) && (eval("document.divOuter.document.d"+currentDnum+".top<=0")) ){
				timeID=setTimeout(moveUpDiv,moveRelax)
			}
		}else{
			timeID=setTimeout(moveUpDiv,moveInterval)
		}
		
	}else{	
		
		if (parseInt(eval("document.all.d"+currentDnum+".currentStyle.clipBottom"))>0){
			divClipTop=parseInt(eval("document.all.d"+currentDnum+".currentStyle.clipTop"))
			divClipTop+=moveStep
			divClipBottom+=moveStep
	
			eval("document.all.d"+currentDnum+".style.pixelTop=eval('document.all.d'+currentDnum+'.style.pixelTop')-moveStep")
			eval("document.all.d"+currentDnum+".style.clip='rect("+divClipTop+","+divWidth+","+divHeight+",0)'")
			
			eval("document.all.d"+nextDnum+".style.pixelTop=document.all.d"+currentDnum+".style.pixelTop+divHeight+moveSpace")
			eval("document.all.d"+nextDnum+".style.clip='rect("+0+","+divWidth+","+divClipBottom+",0)'")
		}
		if ( parseInt(eval("document.all.d"+nextDnum+".style.top"))<=0 ){
			currentDnum=nextDnum
			divClipTop=0
			divClipBottom=-moveSpace
			mvStop()
			if ( (!outHover) && (parseInt(eval("document.all.d"+currentDnum+".currentStyle.clipTop"))==0) ){
				timeID=setTimeout(moveUpDiv,moveRelax)
			}
		}else{
			timeID=setTimeout(moveUpDiv,moveInterval)
		}
	}
}
/** 滚动框程序段结束 **/