function setCookie (name, value) {
  document.cookie = name + "=" + value + "; path=/; domain=163.com";
}

function getCookie(name) {
  var search;
  search = name + "="
  offset = document.cookie.indexOf(search) 
  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()  {
  	frmauto.btnauto.value="Í£Ö¹²¥·Å";
	sTimer = setTimeout("shownext()",frmauto.time.value*1000);
	setCookie("autoplay","1");
	setCookie("autotime",frmauto.time.value);

  }
  
  
 function clickauto()  {
          if (frmauto.btnauto.value=="Í£Ö¹²¥·Å")
          {
          	frmauto.btnauto.value="×Ô¶¯²¥·Å";
          	clearTimeout(sTimer);
          	setCookie("autoplay","0");
			setBbs();          	
          }
          else
          {
          	frmauto.btnauto.value="Í£Ö¹²¥·Å";
          	sTimer = setTimeout("shownext()",frmauto.time.value*1000);
          	setCookie("autoplay","1");
          	setCookie("autotime",frmauto.time.value);
			
          }
  }
  
 
 function changetime()  {
    if (frmauto.time.value<1) return;
    if (sOldTime==frmauto.time.value) return;
    
    sOldTime=frmauto.time.value;
    if (frmauto.btnauto.value=="Í£Ö¹²¥·Å")
    {
    	clearTimeout(sTimer);
    	sTimer = setTimeout("shownext()",frmauto.time.value*1000);
    }
    setCookie("autotime",frmauto.time.value);
  }
  

function startview(){
 var str=getCookie("autoplay");
frmauto.time.value=getCookie("autotime");
if (frmauto.time.value<1) 
{
	frmauto.time.value=15;
	autoview();
}
else if (str=="1")
{
	autoview();
}

setInterval("changetime()",100);

}