var position=1;
    var time=null;
    var stepTime=4000;
	var imgStep=1;
    var switchers=new Array();
  
	function getRoundNum(){
	 return Math.random()*22+1
	}
	function initTxImg(imgurl,context,link,index){
		
		
		var container=document.getElementById("cmcontaint");
		
		var divStr="<div id='switch_"+index+"'><span style='cursor:hand'  onmouseover='stop()' onmouseout='start()'><a href='"+link+"' target='_blank' style='color:white;text-decoration:none;'> <img  src='"+imgurl+"' class='weiHei'   /></a</span>";
	    container.insertAdjacentHTML('afterBegin', divStr);
		
		switchers[index]=new Array(); 
       switchers[index]["title"]=context;
	   switchers[index]["link"]=link;
	}
    

    function init(){
	switch_img(position);
    time=window.setTimeout("repeat()",stepTime);
	}
    function switch_img(current){
		 var container=document.getElementById("cmcontaint");
		
      container.filters[0].Apply();
      if (current > (switchers.length-1)) {
	 	current = 1 ;
	  }
	 
     for(var j=1;j<=(switchers.length-1);j++){
	
       var obj=document.getElementById("switch_"+j);
	    
       if(current==j) {
        obj.style.display="block";
       }
       else{
        obj.style.display="none";
       }
       
    }
    showTitle(current);
    showNumber(current);
	container.filters[0].transition=getRoundNum();
	 container.filters[0].Play(duration=imgStep);
   position=current;
  
  }
  function repeat(){
   time=null;
   switch_img(position+1);
   time=window.setTimeout("repeat()",stepTime);
  
   //container.filter=" progid:DXImageTransform.Microsoft.Wipe(GradientSize=1.0,wipeStyle=0, motion='forward')";
  }
  
 
  
  
  function showTitle(pos){
   var str="";
   str="<a href='"+switchers[pos]['link']+"' class='forDivA' target='_blank' >"+switchers[pos]['title']+" </a>";
 //  str+="<p><a href='"+switchers[pos]['link']+"' class='forDivA'>"+switchers[pos]['next']+" </a></p>";
   document.getElementById("links").innerHTML=str;
  }
  function showNumber(pos){
    var str="";
   for(var i=1;i<=(switchers.length-1);i++){
     if(i==pos) str+="<li class='listyle' ><a  href='javascript://'  onmouseover='stop()' onmouseout='start()' class='selected_A'>"+i+"</a></li>";
     else str+="<li class='listyle'><a href='javascript:click_li("+i+")' onmouseover='stop()' onmouseout='start()' class='nosa'>"+i+"</a></li>";
   
    document.getElementById("number").innerHTML=str;
    } 
  }
  
  function stop(){
  window.clearTimeout(time);
  }
 function start(){
 window.clearTimeout(time);
  time=window.setTimeout("repeat()",stepTime);
 }
 
 function click_li(i){
 window.clearTimeout(time);
 position=i-1;
 repeat();
 
 }

//男人女人

function gccc(o){return document.getElementById(o);}
function HoverLi2ccc(n){
for(var iccc=1;iccc<=2;iccc++){gccc('tb2_ccc'+iccc).className='normaltab1ccc';gccc('tbc1ccc_0'+iccc).className='undisccc';}gccc('tbc1ccc_0'+n).className='disccc';gccc('tb2_ccc'+n).className='hovertab1ccc';
}

 //悬浮公告
setTimeout(function(){toueme()},60000);

 function toueme(){
  document.getElementById("toubiao").style.display="none";
 }

var w3c = (document.getElementById) ? true : false; 
var agt = navigator.userAgent.toLowerCase(); 
var ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1) && (agt.indexOf("omniweb") == -1)); 
var mymovey = new Number(); 
function IeTrueBody(){ 
return (document.compatMode && document.compatMode!="BackCompat") ? document.documentElement : document.body;
} 
function GetScrollTop(){ 
return ie ? IeTrueBody().scrollTop : window.pageYOffset; 
} 
function heartBeat(){ 
diffY=GetScrollTop(); 
mymovey += Math.floor((diffY-document.getElementById('backi').style.top.replace("px","")+5)*0.1); 
document.getElementById('backi').style.top = mymovey+"px"; } 
window.setInterval("heartBeat()",1); 

