<!--
var isFirefox = navigator.userAgent.search("Firefox") > -1;
var isSafari = navigator.userAgent.search("Safari") > -1;
var link_total=new Array();
var showADiv_time;
var fixADiv_time;
var rush_time;
var yes_rush_time;
var rush_height;
var pub_num;
var function_time = 40 ;//函式更新秒速
var stay_time = 3000 ;//停留時間
var speed = 44;//圖片移動速度
function getElementByName(mytag,myname){
	var myElements=new Array()
	var alltag=document.getElementsByTagName(mytag)
	for(var i=0;i<alltag.length;i++){
	  	if(alltag[i].getAttribute("name")==myname){
	   		myElements.push(alltag[i])
		}
	}
	if(myElements.length==1)
	  	return myElements[0]
	else
	  	return myElements
}
 
function starRush(){
  if(isFirefox){
    document.getElementById('content-center-ad-pic').style.top=0+'px';
  }else{
    document.getElementById('content-center-ad-pic').style.top=0;
  }
	link_total=getElementByName('li','content-center-ad-menu-name');
	rush_height=parseInt(document.getElementById('content-center-ad-pic').offsetHeight)/link_total.length;
  changeType('1');
  showADiv('1');
	var new_top = 0-rush_height;
	rush_time=setTimeout("goAC('2','"+new_top+"','"+speed+"','yes');changeType('2');",stay_time);
}

function setRush(rush_num,rush_type){
	clearTimeout(yes_rush_time);
  if(rush_type==''){
    clearTimeout(rush_time);
  	changeType(rush_num);
  	var new_top = 0-((parseInt(rush_num)-1)*parseInt(rush_height));
  	goAC(rush_num,new_top,speed,'');
  }
  if(rush_type=='yes'){
    if(rush_num==link_total.length) rush_num = '1' ; else rush_num++;
  	var new_top = 0-((parseInt(rush_num)-1)*parseInt(rush_height));
    yes_rush_time=setTimeout("goAC('"+rush_num+"','"+new_top+"','"+speed+"','yes');changeType('"+rush_num+"');",stay_time); 
  }
}

function changeType(rush_num){
  clearTimeout(fixADiv_time);
	clearTimeout(showADiv_time);
  for(var i=0;i<=link_total.length-1;i++){
    if(i == rush_num-1){
			link_total[i].className='content-center-ad-menu-1';
		}else{
			link_total[i].className='content-center-ad-menu-2';
		}
    if(isFirefox){
      document.getElementById('content-center-ad-div-'+(i+1)).style.top=226+'px';
    }else{
      document.getElementById('content-center-ad-div-'+(i+1)).style.top=226;
    }
	}
}

function showADiv(rush_num){
  clearTimeout(showADiv_time);
  var past_top = parseInt(document.getElementById('content-center-ad-div-'+rush_num).style.top);
  if( past_top > 137 ){
      if(isFirefox || isSafari){
        document.getElementById('content-center-ad-div-'+rush_num).style.top = (past_top-3)+'px';
        showADiv_time=setTimeout("showADiv('"+rush_num+"');",10);  
      }else{
        document.getElementById('content-center-ad-div-'+rush_num).style.top = past_top-15;
        showADiv_time=setTimeout("showADiv('"+rush_num+"');",1); 
      }
      	
  }else if(past_top <= 137){
       fixADiv(rush_num);
  }
}

function fixADiv(rush_num){
  clearTimeout(fixADiv_time);
  var past_top = parseInt(document.getElementById('content-center-ad-div-'+rush_num).style.top);
  if( past_top < 146 ){
      if(isFirefox || isSafari){
        document.getElementById('content-center-ad-div-'+rush_num).style.top = (past_top+2)+'px';
        fixADiv_time=setTimeout("fixADiv('"+rush_num+"');",40);  
      }else{
        document.getElementById('content-center-ad-div-'+rush_num).style.top = past_top+4;
        fixADiv_time=setTimeout("fixADiv('"+rush_num+"');",1); 
      }	
  }
}

function goAC(rush_num,new_top,rush_speed,rush_type){
  clearTimeout(yes_rush_time);
  clearTimeout(rush_time);
	var now_top = parseInt(document.getElementById('content-center-ad-pic').style.top);
	rush_speed=parseInt(rush_speed);
	if (Math.abs(now_top-new_top)<=230 && rush_speed-5 > 0 )rush_speed=rush_speed-5;
	if(now_top < new_top){
		if(now_top+rush_speed < new_top){
		  if(isFirefox){
        document.getElementById('content-center-ad-pic').style.top = (now_top+rush_speed)+'px';
      }else{
        document.getElementById('content-center-ad-pic').style.top = now_top+rush_speed;
      }
		}else if(now_top+rush_speed >= new_top){
		  if(isFirefox){
        document.getElementById('content-center-ad-pic').style.top = new_top+'px';
      }else{
        document.getElementById('content-center-ad-pic').style.top = new_top;
      } 
		}
		rush_time=setTimeout("goAC('"+rush_num+"','"+new_top+"','"+rush_speed+"','"+rush_type+"');",function_time);
	}else if(now_top > new_top){
		if(now_top-rush_speed > new_top){
		  if(isFirefox){
        document.getElementById('content-center-ad-pic').style.top = (now_top-rush_speed)+'px';
      }else{
        document.getElementById('content-center-ad-pic').style.top = now_top-rush_speed;
      }
		}else if(now_top-rush_speed <= new_top){
      if(isFirefox){
        document.getElementById('content-center-ad-pic').style.top = new_top+'px';
      }else{
        document.getElementById('content-center-ad-pic').style.top = new_top;
      }
		}
		rush_time=setTimeout("goAC('"+rush_num+"','"+new_top+"','"+rush_speed+"','"+rush_type+"');",function_time);
	}else{
		showADiv(rush_num);
		if(rush_type=='yes') setRush(rush_num,'yes');
	}
}
-->