
<!--
//首页的标签切换
    function changePreview(tabNumber) {
      var tabNames;
      
      for (i = 1; i <= 5; i++) {
        document.getElementById('infotable' + i).style.display = 'none';
      }
      document.getElementById('infotable' + tabNumber).style.display = '';

      tds = document.getElementById('infotable').getElementsByTagName('td');
      for(i = 0; i < tds.length; i++) {
        if (tds[i].className == 'active menu')
          tds[i].className = 'menu';
      }
      document.getElementById('tab' + tabNumber).className = 'active menu';
    }
  
  //-->
  //鼠标透明度效果
  <!--
function makevisible(cur,which){
if (which==0)
cur.filters.alpha.opacity=100
else
cur.filters.alpha.opacity=90
}
//-->


function setTab(name,cursel,n){
 for(i=1;i<=n;i++){
  var menu=document.getElementById(name+i);
  var con=document.getElementById("con_"+name+"_"+i);
  //menu.className=i==cursel?"hover":"";
  con.style.display=i==cursel?"block":"none";
 }
}

function MM_showHideLayers() {
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_findObj(n, d) {
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}



//下面为滚动

// JavaScript Document

function $i(id){return document.getElementById(id);}

// 滚动widget
function simplescroll(c, config) {
	this.config = config ? config : {start_delay:3000, speed: 23, delay:4000, scrollItemCount:1,movecount:1};
	this.container = $i(c);
	this.pause = false;
	var _this = this;
	
	this.init = function() {
		_this.scrollTimeId = null;
		setTimeout(_this.start,_this.config.start_delay);
	}
	
	this.start = function() {
		var d = _this.container;
		var line_height = d.getElementsByTagName('li')[0].offsetHeight;
		if(d.scrollHeight-d.offsetHeight>=line_height) _this.scrollTimeId = setInterval(_this.scroll,_this.config.speed)
	};
	
	this.scroll = function() {
		if(_this.pause)return;
		var d = _this.container;d.scrollTop+=2;
		var line_height = d.getElementsByTagName('li')[0].offsetHeight;
		//alert(d.scrollTop + "%" + line_height + " : " + d.scrollTop%line_height);
		if(d.scrollTop%(line_height*_this.config.scrollItemCount)<=1){
			if(_this.config.movecount != undefined)
				for(var i=0;i<_this.config.movecount;i++){d.appendChild(d.getElementsByTagName('li')[0]);}
			else for(var i=0;i<_this.config.scrollItemCount;i++){d.appendChild(d.getElementsByTagName('li')[0]);}
			d.scrollTop=0;
			clearInterval(_this.scrollTimeId);
			setTimeout(_this.start,_this.config.delay);
		}
	}
	
	this.container.onmouseover=function(){_this.pause = true;}
	this.container.onmouseout=function(){_this.pause = false;}
}

// 横着滚动
function simpleSideScroll(c,ul,config,direction){
    this.config = config ? config : {start_delay:3000, speed: 23, delay:4000, scrollItemCount:1};
	this.c = $i(c);
	this.ul = $i(ul);
	this.direction = direction ? direction : "left";
	this.pause = false;
	this.buttonlist= new Object();
	this.delayTimeId=null;
	
	var _this = this;



	this.c.onmouseover=function(){_this.pause = true;}
	this.c.onmouseout=function(){_this.pause = false;}
	
	this.init = function() {
		_this.scrollTimeId = null;
		setTimeout(_this.start,_this.config.start_delay);
	}
	
	this.start = function() {
		var d = _this.c;
		var width = d.getElementsByTagName('li')[0].offsetWidth;
		if(d.scrollWidth-d.offsetLeft>=width) _this.scrollTimeId = setInterval(_this.scroll,_this.config.speed)
	};
	
	this.scroll = function() {
		if(_this.pause)return;
		var ul= _this.ul;
		var d = _this.c;
		var width = d.getElementsByTagName('li')[0].offsetWidth;
		if(_this.direction == 'left'){
	        d.scrollLeft += 2;
	        if(d.scrollLeft%(width*_this.config.scrollItemCount)<=1){
		        if(_this.config.movecount != undefined)
			        for(var i=0;i<_this.config.movecount;i++){ul.appendChild(ul.getElementsByTagName('li')[0]);}
		        else for(var i=0;i<_this.config.scrollItemCount;i++){ul.appendChild(ul.getElementsByTagName('li')[0]);}
		        d.scrollLeft=0;
		        clearInterval(_this.scrollTimeId);
		        
		        _this.delayTimeId=setTimeout(_this.start,_this.config.delay);
	        }
		}
		else {
		    if(d.scrollLeft==0)
		    {
		        var lis=ul.getElementsByTagName('li');
		        for(var i=0;i<_this.config.scrollItemCount;i++){
		            ul.insertBefore(lis[lis.length-1],lis[0]);
		        }
		        d.scrollLeft = width;
		    }
		    d.scrollLeft -= 2;
		    if(d.scrollLeft%(width*_this.config.scrollItemCount)<=1){
		        d.scrollLeft=0;
		        clearInterval(_this.scrollTimeId);
		        _this.delayTimeId=setTimeout(_this.start,_this.config.delay);
		    }
		}
	}
	
	this.setButton=function(id,direction){
	    if($i(id)){
	        var c=$i(id);
	        var buttonlist =_this.buttonlist;
	        if(buttonlist[id] == undefined){
	            buttonlist[id] =new Object();
	            _this.buttonlist[id][0]=c;
	            _this.buttonlist[id][1]=direction;
	            
	            c.onclick=function(){
	                 clearInterval(_this.scrollTimeId);
	                 
	                var dir=_this.buttonlist[this.id][1];
	                var d = _this.c;
	                var ul= _this.ul;


	                d.scrollLeft=0;
	                if(dir =="left")
	                {
	                    for(var i=0;i<_this.config.scrollItemCount;i++){ul.appendChild(ul.getElementsByTagName('li')[0]);}
	                }
	                else{
	                    var lis=ul.getElementsByTagName('li');
		                for(var i=0;i<_this.config.scrollItemCount;i++){
		                    ul.insertBefore(lis[lis.length-1],lis[0]);
		                }
	                }
	                    
	                _this.direction= dir;
	                clearTimeout(_this.delayTimeId);
	                _this.delayTimeId=setTimeout(_this.start,_this.config.delay);
	                return false;
	            }
	        }
	    }
	}
}

//营销中心
function toggle_tb_ad(c,tid){
    $i("tb_adb_ztc").style.display="none"
    $i("tb_adb_bp").style.display="none"
    $i("tb_adbli_ztc").className=""
    $i("tb_adbli_bp").className=""
    c.className="cur"
    $i(tid).style.display="block";
}

var banners,cooperater_run;
function init_load(){
    if ($i('banners')) {	
		banners = new tabswitch('banners', {});
		setInterval("banners.start(null, null, 1);", 6000);
	}
    if($i('cooperater_scroll')){
	    cooperater_run=new simpleSideScroll('cooperater_scroll','cooperater_scroll_ul',{start_delay:3000, speed: 23, delay:3000, scrollItemCount:1},'left')
	    cooperater_run.setButton('cooperater_scroll_left','left');
	    cooperater_run.setButton('cooperater_scroll_right','right');
	    cooperater_run.init();
	}
}

if(window.attachEvent){
    window.attachEvent("onload",init_load);
}else if(window.addEventListener){
    window.addEventListener("load",init_load,false);
}


 
function ChangeItHd(sItem) 
{ 
	if (document.getElementById(sItem).style.display=="none") {
	 document.getElementById(sItem).style.display="";
	 //document.getElementById(sItem+4).src="images/f_t_icon.gif"
	 } else {
	   document.getElementById(sItem).style.display="none"; 
	   //document.getElementById(sItem+4).src="images/f_t_icon3.gif"
	 }
  
}

function ChangeItHd2(sItem) 
{
 	if (document.getElementById(sItem).style.display=="none") {
	 document.getElementById(sItem).style.display="";
	 //document.getElementById(sItem+4).src="images/f_t_icon.gif"
	 } else {
	   //document.getElementById(sItem).style.display="none"; 
	   //document.getElementById(sItem+4).src="images/f_t_icon3.gif"
	 }
  
}

 
 