 //----------------------------------- 幻灯 ----------------------------------
   
nereidFadeObjects = new Object();
nereidFadeTimers = new Object();

function nereidFade(object, destOp, rate, delta){
	if (!document.all)
		return
	if (object != "[object]"){ 
		setTimeout("nereidFade("+object+","+destOp+","+rate+","+delta+")",0);
		return;
	}
	clearTimeout(nereidFadeTimers[object.sourceIndex]);
	diff = destOp-object.filters.alpha.opacity;
	direction = 1;
	if (object.filters.alpha.opacity > destOp){
		direction = -1;
	}
	delta=Math.min(direction*diff,delta);
	object.filters.alpha.opacity+=direction*delta;
	if (object.filters.alpha.opacity != destOp){
		nereidFadeObjects[object.sourceIndex]=object;
		nereidFadeTimers[object.sourceIndex]=setTimeout("nereidFade(nereidFadeObjects["+object.sourceIndex+"],"+destOp+","+rate+","+delta+")",rate);
	}
}
   
   
  var sTimer;
  var sOldTime; 
   
  function clickauto(obj)  {
  //alert(2)
      if (obj.src=="http://image.mop.com/acggame/images/zanting.jpg")
      {
      	obj.src="http://image.mop.com/acggame/images/play_but.jpg";
		obj.alt="点击开启幻灯自动播放模式";
      	clearTimeout(sTimer);
      	setCookie("autoplay","0");
      }
      else
      {
      	obj.src="http://image.mop.com/acggame/images/zanting.jpg";
		obj.alt="当前为幻灯自动播放模式";
      	sTimer = setTimeout("shownext()",frmauto.time.value*1000);
      	setCookie("autoplay","1");
      	setCookie("autotime",frmauto.time.value);
      }  
  }
  
  
function setCookie (name, value) {
  //alert( "setCookie ("+name+", "+value+")");
    document.cookie = name + "=" + value + "; domain=dm.game.mop.com";
}
function setTime(value){
	 setCookie("autotime",value);
	 frmauto.play.src="http://image.mop.com/acggame/images/zanting.jpg";
	 frmauto.play.alt="当前为幻灯自动播放模式";
     sTimer = setTimeout("shownext()",frmauto.time.value*1000);
     setCookie("autoplay","1");
     setCookie("autotime",frmauto.time.value);
	
}
function setPlay(){
	frmauto.play.src="http://image.mop.com/acggame/images/play_but.jpg";
	frmauto.play.alt="点击开启幻灯自动播放模式";
    clearTimeout(sTimer);
    setCookie("autoplay","0");
}

function getCookie(name) {
//alert("aaa:"+name);
  var search;

  search = name + "="
  offset = document.cookie.indexOf(search) 
  //alert("offset:"+offset);
  
  if (offset != -1) {
    offset += search.length ;
    end = document.cookie.indexOf(";", offset) ;
    if (end == -1)
      end = document.cookie.length;     
    return unescape(document.cookie.substring(offset, end));
  }
  else
    return "";
}

  function autoview()
  {
  	 sTimer = setTimeout("shownext()",frmauto.time.value*1000);
	 setCookie("autoplay","1");
	 setCookie("autotime",frmauto.time.value);
	
       
	
  }

function startview()
{
	var str=getCookie("autoplay");
	frmauto.time.value=getCookie("autotime");	
	if (frmauto.time.value<1) 
	{
		frmauto.time.value=30;		
	}
	if (str=="1"){
		frmauto.play.src="http://image.mop.com/acggame/images/zanting.jpg";
		frmauto.play.alt="当前为幻灯自动播放模式";
		autoview();

	}else{
		frmauto.play.src="http://image.mop.com/acggame/images/play_but.jpg";
		frmauto.play.alt="点击开启幻灯自动播放模式";
//		frmauto.play.src="http://image.mop.com/acggame/images/zanting.jpg";
//		frmauto.play.alt="当前为幻灯自动播放模式";
		clearTimeout(sTimer);
      	setCookie("autoplay","0");

	}

}


  function onload_flash(){
	var showstatus = 'visible';
	if(showstatus != "hidden"){
	  startview();
	}
  }

function getstatus(obj){
	var status = document.getElementById("msLayerCap");
	var strtemp="";
	status.style.visibility='visible';
	obj.hspace=0;
	obj.vspace=0;		
	//alert(getCookie("autoplay"));
	if (getCookie("autoplay")=="1"){
		strtemp="<br>当前自动播放模式！<br>间隔"+frmauto.time.value+"s！";
	}else{
		strtemp="手动播放模式！<br>点击按钮或修改时间开启自动播放！";
	}	
	status.innerHTML=strtemp;
}