var s=function(){
var interv=6000; 
var interv2=10;
var opac1=60;
var source="fade_focus"
function getTag(tag,obj){
	if(obj==null){
		return document.getElementsByTagName(tag)}else{return obj.getElementsByTagName(tag)
		}
		}
function getid(id){
	return document.getElementById(id)
	};
var opac=0,j=0,t=63,num,scton=0,timer,timer2,timer3;
var id=getid(source);id.removeChild(getTag("div",id)[0]);
var li=getTag("li",id);var div=document.createElement("div");
var title=document.createElement("div");
var span=document.createElement("span");
var sebno=document.createElement("div");
sebno.className="sebno";
for(var i=0;i<li.length;i++){
	var a=document.createElement("a");
	a.innerHTML=i+1;
	a.onclick=function(){
		clearTimeout(timer);
		clearTimeout(timer2);
		clearTimeout(timer3);
		j=parseInt(this.innerHTML)-1;
		scton=0;t=63;opac=0;fadeon();
		};
		a.className="b1";
		a.onmouseover=function(){
			this.className="b2"
			};
			a.onmouseout=function(){
				this.className="b1";sc(j)
				};
				sebno.appendChild(a);}
function alpha(obj,n){
	if(document.all){
		obj.style.filter="alpha(opacity="+n+")";}
		else{
			obj.style.opacity=(n/100);
			}			}
function sc(n){
	for(var i=0;i<li.length;i++){
		sebno.childNodes[i].className="b1"};
		sebno.childNodes[n].className="b2";}
title.className="num_list";
title.appendChild(span);
alpha(title,opac1);
id.className="d1";
div.className="d2";
id.appendChild(div);
id.appendChild(title);
id.appendChild(sebno);
var fadeon=function(){
	opac+=5;
	div.innerHTML=li[j].innerHTML;
	span.innerHTML=getTag("img",li[j])[0].alt;
	alpha(div,opac);if(scton==0){
		sc(j);num=-2;scrolltxt();scton=1
		};
		if(opac<100){
			timer=setTimeout(fadeon,interv2)}
			else{
				timer2=setTimeout(fadeout,interv);
				};
				}
var fadeout=function(){
	opac-=5;
	div.innerHTML=li[j].innerHTML;
	alpha(div,opac);if(scton==0){num=2;scrolltxt();scton=1};if(opac>0){timer=setTimeout(fadeout,interv2)}else{if(j<li.length-1){j++}else{j=0};fadeon()};}
var scrolltxt=function(){
	t+=num;
	span.style.marginTop=t+"px";if(num<0 && t>3){timer3=setTimeout(scrolltxt,interv2)}else if(num>0 && t<62){timer3=setTimeout(scrolltxt,interv2)}else{scton=0}};
fadeon();
}


//下拉新年FLASH
/*

    var time = 500;
    var h = 0;
    function addCount()
    {
        if(time>0)
        {
            time--;
            h = h+15;
        }
        else
        {
            return;
        }
        if(h>590)  //高度
        {	
			window.document.myFlash.SetVariable("flashplay", "1");
			return;
        }
        document.getElementById("ads").style.display = "";
        document.getElementById("ads").style.height = h+"px";
//		alert(document.getElementById("ads").style.height)
//		alert("dd")
        setTimeout("addCount()",30); 
    }
    
    var T = 476;
    var N = 590; //高度
	var show = 0;
	var showcon;
    function noneAds()
    { 
		if(T>0)
        {
            T--;
            N = N-15;
        }
        else
        {
            return;
        }
        if(N<10)
        {
			showcon ='<EMBED src="/templates/default/images/happy.swf" quality="high" bgcolor="#FFFFFF" WIDTH="680" HEIGHT="530" volume="0" wmode="transparent" NAME="myMovieName" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer" alt="" id="myFlash"></EMBED><div style="margin:10px auto 0; width:80px; height:25px; text-align:center; line-height:25px;" onclick="onoff();"><img src="/templates/default/images/closeflash.gif" alt="" /></div>';
			document.getElementById("ads").style.display = "none";
	        document.getElementById("edition").style.display = "block";
			document.getElementById("ads").innerHTML= " " ;
			//alert(document.getElementById("ads").outerHTML);
	        show = 1;

            return;
        }
        document.getElementById("ads").style.height = N+"px";
        setTimeout("noneAds()",30); 
	}
function onoff(){
	if(show == 1){
		document.getElementById("ads").innerHTML = showcon;
		h = 0;
		addCount();
		show = 0;
	}else{

		N = 590; //高度
		noneAds();
		show = 1;

	}

}
*/
