﻿function $(id){return document.getElementById(id);}
function $$(name){ return document.getElementsByName(name);}

var isIE = document.all?true:false;

function navtab()
{
    if($("rdjj"))
    {
        for(var i=0; i< $("rdjj").children[0].children.length;i++)
        {
            $("rdjj").children[0].children[i].children[0].order = i;
            $("rdjj").children[0].children[i].children[0].onmouseover=function(){navtab_act(this.order);};
        }
    }
    else{setTimeout(function(){navtab();},500);}
}

function navtab_act(obj)
{
    if($("rdjj").children[0].children[obj].children[0].className.indexOf("Sel")>0)return;
    for(var i=0;i<$("rdjj").children[0].children.length;i++)
    {        
        $("rdjj").children[0].children[i].children[0].className = $("rdjj").children[0].children[i].children[0].className.replace("Sel","");
        $("rdjj").children[0].children[i].children[1].className = $("rdjj").children[0].children[i].children[1].className.replace(" dis","");
        $("rdjj").children[0].children[i].children[1].className += " dis";
    }
    $("rdjj").children[0].children[obj].children[0].className += "Sel";
    $("rdjj").children[0].children[obj].children[1].className = $("rdjj").children[0].children[obj].children[1].className.replace(" dis","");
    
    if(obj==1){
        $("rdjj").children[1].href = "/Redianjujiao/2226/";
    }else{
        $("rdjj").children[1].href = "/Yiyuandongtai/2341/";
    }
    
}
navtab();

if(typeof(HTMLElement) != "undefined")
{
    HTMLElement.prototype.contains = function(obj) 
    {   
      while(obj != null &&  typeof(obj.tagName) != "undefind")   
      {
        if(obj == this){return true;}
        obj = obj.parentNode;
      }    
        return false;   
    }   
}

function topZqSel(obj,indx){
    obj.parentNode.parentNode.className = "sel_"+indx;
}

function topZqOut(obj){
    obj.parentNode.parentNode.className = "";
}


function jsqh(){
    if($("qwjs-list")){
        for(var i=0; i< $("qwjs-list").children[0].children.length;i++){
        if($("qwjs-list").children[0].children[i].tagName=="LI"){
                $("qwjs-list").children[0].children[i].order = i;
               if((i+1)%2){
                $("qwjs-list").children[0].children[i].onmouseover=function(){showCon(this.order);};
                }        
            }
        }      
        $("qwjs-list").onmouseout=hidCon;
    }else{setTimeout(function(){jsqh();},500);}
}

function showCon(o){
    for(var i=0; i< $("qwjs-list").children[0].children.length;i++){
        $("qwjs-list").children[0].children[i].className = "dis";
    }
    $("qwjs-list").children[0].children[o].className = "";
    $("qwjs-list").children[0].children[o+1].className = "sel";
}

function hidCon(event){
        event = event? event: window.event; 
        var obj = event.toElement ? event.toElement:event.relatedTarget;
        if(!obj) return;
        if(!this.contains(obj)){
        for(var i=0; i< $("qwjs-list").children[0].children.length;i++){
            if((i+1)%2){
            $("qwjs-list").children[0].children[i].className = "";
            }else{
            $("qwjs-list").children[0].children[i].className = "dis";
            }
        }
    }
}

jsqh();

var time=null;
var stop=false;
var nowLeft = 0;
var sl = 1;
function zjqh(){
    if($("gd")){
        var obj = $("gd");
        var count = $("gd").children.length;
        for(var i=0;i<count;i++){
            var oLi = document.createElement("LI");
            oLi.innerHTML = obj.children[i].innerHTML;
            obj.appendChild(oLi);
        }
        obj.onmouseover = function(){if(time)clearInterval(time);}
        obj.onmouseout = function(){clearInterval(time);time=setInterval(timeFox,30);}
        time=setInterval(timeFox,30);

    }else{setTimeout(function(){zjqh();},500);}
}

function timeFox(){
    if(sl){leftqh();}else{rightqh();};
}

function jsLeft(){
    var obj = $("gd").parentNode;
    
    if(sl){
        nowLeft = $("gd").children[0].offsetWidth*objOrder
    }else{
        nowLeft = $("gd").children[0].offsetWidth*(objOrder+2)-obj.offsetWidth
    }
}

var objOrder = 0;
function leftqh(){
     var obj = $("gd").parentNode;
     if(obj.scrollLeft>=nowLeft){
        nowLeft+=$("gd").children[objOrder].offsetWidth;
        stop=true;
        objOrder++;
        stopTime();
        if(objOrder>($("gd").children.length/2)){
        startTime();
        stop=false;
        nowLeft = 0;
        objOrder = 0;
        obj.scrollLeft = 0
        }
     }else{ 
        startTime();      
        stop=false;
     }
     obj.scrollLeft+=10;     
}

function rightqh(){
     var obj = $("gd").parentNode;
     if(obj.scrollLeft<=nowLeft){
        nowLeft-=$("gd").children[objOrder].offsetWidth;
        stop=true;
        objOrder--;
        stopTime();
        if(objOrder<1){
        startTime();
        stop=false;
        objOrder = ($("gd").children.length/2)+1;
        nowLeft = $("gd").children[objOrder].offsetWidth*(objOrder+2) - obj.offsetWidth;
        obj.scrollLeft = nowLeft;
        }
     }else{        
        startTime();      
        stop=false;
     }
     obj.scrollLeft-=10;     
}

function stopTime(){
    clearInterval(time); time=setTimeout(function(){time=setInterval(timeFox,30);},1500)
}

function startTime(){
    clearInterval(time);time=setInterval(timeFox,30);
}

var zjqhStop = false;
var zjTime=null;
var zjOrder=1;
var nowTop=0;
function zjqhUp(){
    var zj_scroll = $("zj_scroll");
    var count = zj_scroll.children.length;
    if(zj_scroll){
        for(var i=0;i<count;i++){
            var newDiv = document.createElement("DIV");
            newDiv.className = "zj_list";
            newDiv.innerHTML = zj_scroll.children[i].innerHTML;
            zj_scroll.appendChild(newDiv);
        }
        zj_scroll.onmouseover = function(){if(zjTime)clearInterval(zjTime);}
        zj_scroll.onmouseout = function(){clearInterval(zjTime);zjTime=setInterval(timeBox,30);}
        zjTime=setInterval(timeBox,30);
    }else{setTimeout(function(){zjqhUp()},500)}
}

function timeBox(){
    scrollUp();
}

function scrollUp(){
    var zj_scroll = $("zj_scroll");
    if(zj_scroll.scrollTop>=nowTop+8){
       nowTop = zj_scroll.children[zjOrder].offsetTop;
       zjqhStop=true;
       zjOrder++;
       stopZJTime()
       if(zjOrder>(zj_scroll.children.length/2)+1){
       startZJTime()
       zjqhStop=false;
       zjOrder=1;
       nowTop=0;
       zj_scroll.scrollTop=8;
       }
    }else{
       startZJTime()
       zjqhStop=false;
       zj_scroll.scrollTop+=8;     
    }
}

function stopZJTime(){
    clearInterval(zjTime);zjTime=setTimeout(function(){zjTime=setInterval(timeBox,30);},5000)
}

function startZJTime(){
    clearInterval(zjTime);zjTime=setInterval(timeBox,30);
}

function onover(obj){
    obj.children[0].className = obj.className + "Sel";
}

function onout(obj){
    obj.children[0].className = "";
}

var speed=40;//速度数值越大速度越慢
function CreateDiv(m1,m2,m3)
{ 
  if($(m2))
  {
     var my=document.createElement("div");
     my.appendChild($(m2));
     var ul=document.createElement("ul");
     ul.id=m1;
     my.appendChild(ul);
     $(m3).appendChild(my);
     Move(m1,m2,m3);  
  }
}
function Move(m1,m2,m3)
{
  var m1=$(m1);
  var m2=$(m2);
  var m3=$(m3);
  m1.innerHTML=m2.innerHTML;
  function Marquee()
  {
     if(m1.offsetTop-m3.scrollTop<=0){m3.scrollTop-=m1.offsetTop;}
     else m3.scrollTop++;
  }
  var mar=setInterval(Marquee,speed); 
  m3.onmouseover=function(){clearInterval(mar);}
  m3.onmouseout=function(){mar=setInterval(Marquee,speed);}
}




function imageslist(w,h,th,ii)
{
    var pics="",links="",texts=""
	for(var i=1;i<ii+1;i++){
	    if(pics!=""){
	        pics=pics+"|";
	        links=links+"|";
	        texts=texts+"|";
	    }
	    pics=pics + eval("imgUrl"+i)
	    links=links + eval("imgLink"+i)
	    texts=texts + eval("imgtext"+i)
	}

	var focus_width=w;
	var focus_height=h;
	var text_height=th;
	var swf_height = focus_height+text_height;
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ focus_width +'" height="'+ swf_height +'">'); 
	document.write('<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="/images/focus.swf"><param name="quality" value="high"><param name="bgcolor" value="#F0F0F0">');
	document.write('<param name="menu" value="false"><param name=wmode value="opaque">');
	document.write('<param name="FlashVars" value="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'">'); 
	document.write('<embed src="/images/focus.swf" wmode="opaque" FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'" menu="false" bgcolor="#F0F0F0" quality="high" width="'+ focus_width +'" height="'+ focus_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	document.write('</object>');
}

function index_nav()
{
    if($("index-nav"))
    {
        index_nav_act();
    }
    else
    {
        setTimeout(function(){index_nav()},500);
    }
}

function index_nav_act()
{
    for(var i=0;i<$("index-nav").children.length;i++)
    {
        $("index-nav").children[i].children[0].order = i;
        $("index-nav").children[i].children[0].onmousemove=function(){index_navtab_act(this.order);};
    }
}

function index_navtab_act(obj)
{
    if($("index-nav").children[obj].children[0].className=="Selected")return;
    for(var i=0;i<$("index-nav").children.length;i++)
    {
        $("index-nav").children[i].children[0].className="";
        $("index-nav").children[i].children[1].className="hide";
    }
    $("index-nav").children[obj].children[0].className="Selected"
    $("index-nav").children[obj].children[1].className=""
}

//index_nav();

//小疾病专题页的选项卡
var pid="xjbbzul";
function smalJbXXk()
{
    if($(pid)) 
    {
        for(var i=0; i< $(pid).children.length;i++)
        {
            $(pid).children[i].children[0].order = i;
            $(pid).children[i].children[0].onmousemove=function(){smalJbXXk_act(this.order);}
        }
    }
    else{setTimeout(function(){smalJbXXk()},500);}
}
function smalJbXXk_act(obj)
{ 
    var objs = $(pid).children[obj].children[1];//获得触发事件的对象的第三个子对象
    if(objs.className=="")return;
    for(var i=0; i< $(pid).children.length;i++)
    {
        $(pid).children[i].children[1].className = "hd_div";
    }
    $(pid).children[obj].children[1].className="";
}

//向上暂停移动 右侧推荐专家用到
function CreateDivU(m1,m2,m3,w,s)
{ 
  if($(m2))
  {
     var my=document.createElement("div");
     my.appendChild($(m2));
     var ul=document.createElement("ul");
     ul.id=m3;
     my.appendChild(ul);
     $(m1).appendChild(my);
     $(m3).innerHTML=$(m2).innerHTML;
     MoveU(m1,m2,m3,w,s);  
  }
}
function MoveU(m1,m2,m3,w,s)
{
   var spp=1;//一个判断的变量
   var numb=w;//它的倍数就是运动到暂停的像素 且必须是bushu的倍数
   var bushu=s;//每次行走9像素
   var zttime=3000;//毫秒暂停时间
   var mar;//setTimeout的变量
   var m1=$(m1);//父容器
   var m2=$(m2);//第一个循环的对象
   var m3=$(m3);//第一个循环的对象的复制品 2个交替循环运动
  function Marquee()
  { 
     if(m3.offsetHeight-m1.scrollTop<=0){ m1.scrollTop-=m3.offsetHeight;}
     else m1.scrollTop=m1.scrollTop+bushu;
     
     if(m1.scrollTop%numb==0){
        clearInterval(mar);
        spp=0; 
        mar=setTimeout(Marquee,zttime);
     }
     else{if(spp==0){ clearInterval(mar); spp=1; mar=setInterval(Marquee,spp);}}
  }
  mar=setInterval(Marquee,spp); 
  m1.onmousemove=function(){ clearInterval(mar);}
  m1.onmouseout=function(){clearInterval(mar);mar=setInterval(Marquee,spp);}
} 

function checkRi_tjzj()
{
    var tel="请输入您的手机或座机号";
    var beizhu="请输入您的病状及备注...";
    if($("tel"))
    {
        if($("tel").value==""){
             $("tel").value=tel;
             $("tel").style.color="#9c9c9c";
             $("tel").onclick=function(){this.value=this.value==tel?"":this.value;this.style.color="#000";}
             $("tel").onblur=function(){this.value=this.value==""?tel:this.value;this.style.color="#9c9c9c";}
         }
    }
    if($("beizhu"))
    {
        if($("beizhu").innerHTML==""){
             $("beizhu").innerHTML=beizhu;
             $("beizhu").style.color="#9c9c9c";
             $("beizhu").onclick=function(){this.innerHTML=this.innerHTML==beizhu?"":$("beizhu").innerHTML;this.style.color="#000";}
             $("beizhu").onblur=function(){this.innerHTML=this.innerHTML==""?beizhu:this.innerHTML;this.style.color="#9c9c9c";}
         }
    }
}

var act = function(){}
//无名编写QQ：171302567
//兼容目前主流浏览器
//无多余BUG
//配置好后页面直接调用satr()函数即可
act.qiehuan=function()
{
    this.k = 100;//初始化第一张图片透明度
    this.imgPath="/images/rongyu/";//图片路径
    this.i = 1; //循环值，对应图片文件名
    this.fl="jpg";//图片文件名字
    this.h = 0; //初始化下一张图片透明度
    this.tmhs = null;//第一个时间初始化
    this.tdhs = null;//第二个时间初始化
    this.margin=-4;//图片覆盖高度
    this.Pize=16;//图片数量
    this.bhTime = 100;//变化时间
    this.stopTime = 1000;//停顿时间
    this.idName = "imgs_"; //图片id名
    this.DivId="text";//父容器
    this.Srcs = new Array();//链接位置;
    this.isHand=false;//是否链接
}

act.qiehuan.prototype=
{
    satr:function()
    {
        $(this.DivId).innerHTML=this.AddImg(0,100);
        var objs = this;
        for(var g=1;g<this.Pize;g++){$(this.DivId).innerHTML+=this.AddImg(g,0);}
        this.tmhs = setTimeout(function(){objs.jb()},100);
    },
    jb:function()
    {
        this.k=this.k-5;
        this.h=this.h+5;
        if(this.k==50){if($(this.idName+this.Pize+"")){}else{$(this.DivId).innerHTML +=this.AddImg(this.i,this.h)}}
        if($(this.idName+(this.i+1))){if(this.obj((this.i+1))){this.IEobj((this.i+1),this.h)}else{this.FFobj((this.i+1),this.h);}}
            else{if(this.i==this.Pize){if(this.obj((1))){this.IEobj(1,this.h);}else{this.FFobj(1,this.h);}}}
        if(this.obj(this.i)){this.IEobj(this.i,this.k)}else{this.FFobj(this.i,this.k);}
        if(this.h!=100){this.clear();}else{this.conunt()}
    },
    AddImg:function(x,p)
    {   
        //if((x+1)!=1){ this.margin=-152;}
        var returnStr = "";
        returnStr = "<img src=\""+ this.imgPath + (x+1) +"."+ this.fl +"\" "
        if(this.isHand) returnStr+= " onclick=\"location.href='"+this.Srcs[x]+"'\""
        returnStr += " style=\""
        if(this.isHand) returnStr+= "cursor:pointer;"
        returnStr += "position:absolute;margin-top:"+ this.margin +"px;filter:alpha(opacity="+ p +");MozOpacity:"+ p +";opacity:"+ p +"\" id = "+ this.idName + (x+1) +" />";
        return returnStr;
    },
    obj:function(n)
    {
        return $(this.idName+n).filters;
    },
    IEobj:function(id,p)
    {
        $(this.idName+id).filters.alpha.opacity=p;
        if(p==0)$(this.idName+id).style.zIndex=0; 
        if(p==100)$(this.idName+id).style.zIndex=50; 
    },
    FFobj:function(id,p)
    {
        $(this.idName+id).style.MozOpacity=p/100;
        $(this.idName+id).style.opacity=p/100;
        if(p==0)$(this.idName+id).style.zIndex=0; 
        if(p==100)$(this.idName+id).style.zIndex=50; 
    },
    clear:function()
    {
        var p = 1;
        if(this.i==this.Pize){p=2;}
        for(var x=p;x<this.i;x++){if(this.obj((x))){this.IEobj(x,0);}else{this.FFobj(x,0);}}
        var objs = this;
        this.tmhs = setTimeout(function(){objs.jb()},this.bhTime);
    },
    conunt:function()
    {
        this.i=this.i+1;
        if(this.i>this.Pize){this.i=1;}
        this.k=100;
        this.h=0;
        var objs = this;
        tmhs = setTimeout(function(){objs.jb()},this.stopTime);
    }
}

//兼容原来的代码写的起始渐变轮换
function satr()
{
    var yyru = new act.qiehuan();
    yyru.satr();
}

function bannerSatr(){
    var qh = new act.qiehuan();
    qh.imgPath = "/images/banner/";
    qh.margin = -2;
    qh.Pize = 3;
    qh.idName = "banner";
    qh.DivId = "qh_banner";
    qh.bhTime = 50;
    qh.stopTime = 5000; 
    qh.isHand = true;
    qh.Srcs = ["/news/2010/12/01/8396.html","/news/2010/12/1/1471.shtml","/news/2010/12/1/8458.html"];
    qh.satr();
}

function jblb_act()
{
    if($("jbbk-list"))
    {
        for(var i=0;i<$("jbbk-list").children.length;i++)
        {
            $("jbbk-list").children[i].children[0].order = i;
            $("jbbk-list").children[i].children[0].onmousemove=function(){jblb_act_text(this.order);};
        }
    }
    else
    {
        setTimeout(function(){jblb_act();},500);
    }
}

function jblb_act_text(obj)
{
    if($("jbbk-list").children[obj].children[0].className=="Selected")return;
    for(var i=0;i<$("jbbk-list").children.length;i++)
    {
        $("jbbk-list").children[i].children[0].className="";
        $("jbbk-list").children[i].children[1].className="hide jbbk-info";
    }
    $("jbbk-list").children[obj].children[0].className="Selected";
    $("jbbk-list").children[obj].children[1].className="jbbk-info";
}

var upzir;
var upzirId=0;
function upzi(){
  if($("LRfloater0")){
  if($("LRfloater0").children[1]){$("LRfloater0").children[1].src="/images/leftent1.gif";if($("LRfloater0_if")){$("LRfloater0_if").style.display="none"; }
     upzirId=1;
    }}
  if(upzirId==0)upzir=setTimeout("upzi()","10");
  else clearTimeout(upzir);
}
function weizhi()
{
   if($("LRfloater1"))
    { 
        if($("LR_Tb2"))
        {
            if($("LR_Tb2").style.display=="none")
            {
                $("LRfloater1").innerHTML="<div style='width:495px; height:243px;background:url(/images/ent264yqk.gif)'><span style='float:left;position:absolute;width:14px;height:14px; right:3px; background:url(/images/dhclose.jpg);cursor:pointer; top:3px;' onclick=LR_HideInvite();LR_RefuseChat();return false;></span> <button style='background:url(/images/mfyy.gif);float:left;width:104px; height:28px;margin-left:246px;margin-top:195px;' onclick=openZoosUrl('chatwin');></button> <button  style='background:url(/images/zxzz.gif);float:left;width:104px; height:28px;margin-left:21px;margin-top:195px;' onclick=openZoosUrl('chatwin');></button></div>";
            }
            else
            {
                $("LR_Tb2").style.display="none";
                $("LRfloater1").innerHTML=$("LRfloater1").innerHTML+"<div style='width:495px; height:243px;background:url(/images/ent264yqk.gif)'><span style='float:left;position:absolute;width:14px;height:14px; right:3px; background:url(/images/dhclose.jpg);cursor:pointer; top:3px;' onclick=LR_HideInvite();LR_RefuseChat();return false;></span> <button style='background:url(/images/mfyy.gif);float:left;width:104px; height:28px;margin-left:246px;margin-top:195px;' onclick=openZoosUrl('chatwin');></button> <button  style='background:url(/images/zxzz.gif);float:left;width:104px; height:28px;margin-left:21px;margin-top:195px;' onclick=openZoosUrl('chatwin');></button></div>";
            }
        }
    }
    setTimeout(function(){weizhi()},10);
}
upzi(); weizhi();
function hidflash(){
  $("flashgo").style.display="none";
}

//============================================================================================================================//
//选项卡切换操作
function tabChange2(id,type,effect,autoChange,defaultChoose,sele,show)
{
	/*==============================
     *目标：实现选项卡的切换操作；
     *作者：Jerry_小猪;
     *创作时间：2011-06-03;
     *修改时间：2011-09-06;2011-09-09;2011-09-13;
     *--------------------------------
     *参数说明：
     *1. id：需要进行选项卡操作的元素容器的ID属性值；
     *2. type：选项卡操作的类别，默认值为1；
     *3. effect：用于进行切换效果的选择；
				“0”——默认值，无特殊效果；
				“1”——渐显效果；
				“2”——上下移动切换；
				“3”——左右移动切换；
     *4. autoChange: 选项卡是否自动切换，取值为ture或false，默认值为false；仅用于切换类别三！
     *5. defaultChoose：默认选中的项的序号值，默认值为0;
	 *6. sele：用来定义标题选中状态的class类名，默认值为“sele”；
	 *7. show：用来定义选项卡显示状态的class类名，默认值为“show”；
     *=========================================*/
	if($(id))
	{
	    if(! defaultChoose){defaultChoose=0;}
		if(! sele){sele="sele";}
		if(! show){show="show";}
	    if(! type){type=1;}
		if(! effect){effect=0;}
		
	    
	    var objTab=$(id);
		var tabEles=objTab.children;
	    if(type==1)
	    {
	        //类别一：选项卡标题与内容容器依次位于tab选项卡下，其中偶次元素为标题，奇次元素为内容
		    for(var i=0;i<tabEles.length;i+=2)
		    {
			    tabEles[i].num=i;
			    tabEles[i].onmouseover=function(){tab_over1(this.num)};
			    if(i==defaultChoose){objTab.choose=i;}//保存当前选中项的标题序号
		    }
		}
		else if(type==2)
		{
            //类别二：选项卡标题位于tab选项卡中的第二个子元素，而内容位于第一个子元素中，tab选项卡下共两个子元素
            for(var i=0;i<tabEles[1].children.length;i++)
            {
                tabEles[1].children[i].num=i;
                tabEles[1].children[i].onmouseover=function(){
                    if(autoChange)
                    {
                        clearInterval(tabEles[1].stopIterval);
                        clearTimeout(tabEles[1].stopTimeout);
                        clearInterval(tabEles[1].stopAlpha);
                    }
                    tab_over2(this.num);
                }
                if(i==defaultChoose){objTab.choose=i;}
                if(autoChange)                   
                {
                    tabEles[1].children[i].onmouseout=function(){
                        tabEles[1].stopTimeout=setTimeout(function(){
                            tab_autoChange2();
                        },500);
                    }
                }
            }
           if(autoChange) tab_autoChange2();   //自动切换
		}
	}
    //切换类别1
	function tab_over1(num)
	{
		tabEles[objTab.choose].className=tabEles[objTab.choose].className.replace(new RegExp("\\s*"+sele),"");//去掉原先被选中的标题元素的"sele"类名
		tabEles[objTab.choose+1].className=tabEles[objTab.choose+1].className.replace(new RegExp("\\s*"+show),"");//去掉原先被选中的内容元素的"show"类名
		tabEles[num].className+=" "+sele;		//设置当前标题元素加上"sele"类名
		tabEles[num+1].className+=" "+show;      //设置当前内容容器加上“show”类名
		objTab.choose=num;                      //记录当前被选中标题的序号值
	}
	//切换类2
	function tab_over2(num)
	{
	    var objChildNodes0=tabEles[0].children;
	    var objChildNodes1=tabEles[1].children;
	    objChildNodes0[objTab.choose].className=objChildNodes0[objTab.choose].className.replace(new RegExp("\\s*"+show),"");
	    objChildNodes1[objTab.choose].className=objChildNodes1[objTab.choose].className.replace(new RegExp("\\s*"+sele),"");
	    objChildNodes0[num].className+=" " + show;
	    objChildNodes1[num].className+=" " + sele;
	    objTab.choose=num;
	}
	function tab_autoChange2()
	{
	    tabEles[1].stopIterval=setInterval(function(){
            var currentPos;
            for(var i=0;i<=tabEles[1].children.length;i++)
            {
                if(tabEles[1].children[i].className.indexOf(sele) != -1)
                {
                    currentPos=i;
                    break;
                }
            }
            currentPos=(currentPos==tabEles[1].children.length-1)?0:currentPos+1;
            tab_over2(currentPos);
        },3000);
	}
}

//============================================================================================================================//
//选项卡切换操作
function tabChange(id,type,autoChange,effect)
{
	if($(id))
	{
	    if(! type){type=1;}
	    	    
		var tabEles=$(id).children;
	    if(type==1)
	    {
		    for(var i=0;i<tabEles.length;i+=2)
		    {
			    tabEles[i].num=i;
			    tabEles[i].onmouseover=function(){tab_over1(this.num)};
		    }
		}
		else if(type==2)
		{
		    for(var i=0;i<tabEles[0].children.length;i++)
		    {
		        tabEles[0].children[i].num=i;
		        tabEles[0].children[i].onmouseover=function(){tab_over2(this.num)};                     
		    }
		}
		else if(type==3)
		{
            for(var i=0;i<tabEles[1].children.length;i++)
            {
                tabEles[1].children[i].num=i;
                tabEles[1].children[i].onmouseover=function(){
                    clearAll();
                    if(tabEles[1].currentPos!=this.num){
                        var num=this.num;
                        tabEles[1].stopWait=setTimeout(function(){
                            tab_over3(num);
                        },200);
                    }
                }
                if(autoChange)                   
                {
                    tabEles[1].children[i].onmouseout=function(){
                        tabEles[1].stopTimeout=setTimeout(function(){
                            tab_autoChange3();
                        },500);
                    }
                    tabEles[0].children[i].onmouseout=function(){
                        tabEles[1].stopTimeout=setTimeout(function(){
                            tab_autoChange3();
                        },500);
                    }
                }
            }
            tabEles[1].currentPos=0;
            if(autoChange) tab_autoChange3();
           
           function clearAll()
           {
                if(autoChange)
                {
                    clearInterval(tabEles[1].stopIterval);
                    clearTimeout(tabEles[1].stopTimeout);
                    clearTimeout(tabEles[1].stopWait);
                    clearInterval(tabEles[1].stopAlpha);
                }
           }
		}
	}
	function tab_over1(num)
	{
		for(var i=0;i<tabEles.length;i+=2)
		{
			tabEles[i].className=tabEles[i].className.replace(/\s*sele/,"");
			tabEles[i+1].className=tabEles[i+1].className.replace(/\s*show/,"");
		}
		tabEles[num].className+=" sele";
		tabEles[num+1].className+=" show";
	}
	function tab_over2(num)
	{
	    for(var i=0;i<tabEles[0].children.length;i++)
	    {
	        tabEles[0].children[i].className=tabEles[0].children[i].className.replace(/\s*sele/,"");
	        tabEles[i+1].className=tabEles[i+1].className.replace(/\s*show/,"");
	    }
	    tabEles[0].children[num].className+=" sele";
	    tabEles[num+1].className+=" show";
	}
	function tab_over3(num)
	{
	    var objChildNodes0=tabEles[0].children;
	    var objChildNodes1=tabEles[1].children;
	    
	    for(var i=0;i<objChildNodes1.length;i++)
	    {
	        objChildNodes0[i].className=objChildNodes0[i].className.replace(/\s*show/,"");
	        objChildNodes0[i].style.zIndex=0;
	        objChildNodes1[i].className=objChildNodes1[i].className.replace(/\s*sele/,"");
	    }
	}
	function tab_autoChange3()
	{
	    tabEles[1].stopIterval=setInterval(function(){
            var currentPos=tabEles[1].currentPos;
            currentPos=(currentPos==tabEles[1].children.length-1)?0:currentPos+1;
            tab_over3(currentPos);
        },3000);
	}
}

//============================================================================================================================//
//图层的移动
function marquee2(wrapper,isParent,inner,direct,distance,step,userStep,speed,delay,percent,directChangeAuto,btnLeft,btnRight,btnTop,btnBottom)
{
	if($(wrapper))
	{
		if(step!=0 && !step){step=20;}
		if(! userStep){userStep=20;}
		if(! speed){speed=20;}
		if(! delay && delay!=0){delay=1000;}
		if(! percent && percent!=0){percent=90;}
		if(directChangeAuto==undefined){directChangeAuto=true;}

		var wrapper=$(wrapper);
		var inner=$(inner);
		var inner2=inner.parentNode.appendChild(inner.cloneNode(true));	
		inner2.id+="2";

		wrapper.userMoveLeft=0;	
		wrapper.userMoveRight=0;
		wrapper.userMoveTop=0;
		wrapper.userMoveBottom=0;
		if($(btnLeft)){
			$(btnLeft).onclick=function(){
				stopAll();
				wrapper.userMoveRight=0;
				wrapper.userMoveLeft+=1;
				if(directChangeAuto){direct="left";}
				wrapper.stopMove=setInterval(moveStartLeft,speed);
			}
			$(btnLeft).onmouseout=function(){
				wrapper.userMoveLeft=0;
			}
		}
		if($(btnRight)){
			$(btnRight).onclick=function(){
				stopAll();
				wrapper.userMoveLeft=0;
				wrapper.userMoveRight+=1;
				if(directChangeAuto){direct="right";}
				wrapper.stopMove=setInterval(moveStartRight,speed);
			}
			$(btnRight).onmouseout=function(){
				wrapper.userMoveRight=0;
			}
		}
		if($(btnTop)){
			$(btnTop).onclick=function(){
				stopAll();
				wrapper.serMoveBottom=0;
				wrapper.userMoveTop+=1;
				if(directChangeAuto){direct="top";}
				wrapper.stopMove=setInterval(moveStartTop,speed);
			}
			$(btnTop).onmouseout=function(){
				wrapper.userMoveTop=0;
			}
		}
		if($(btnBottom)){
			$(btnBottom).onclick=function(){
				stopAll();
				wrapper.userMoveTop=0;
				wrapper.userMoveBottom+=1;
				if(directChangeAuto){direct="bottom";}
				wrapper.stopMove=setInterval(moveStartBottom,speed);
			}
			$(btnBottom).onmouseout=function(){
				wrapper.userMoveBottom=0;
			}
		}

		if(step!=0){moveDir(direct);}

		wrapper.stopDelay=0;
		wrapper.stopTimeout=0;

		if(isParent)
		{
			wrapper.onmouseover=function(){mouseover();}
			wrapper.onmouseout=function(){mouseout();}
		}
		else
		{
			wrapper.parentNode.onmouseover=function(){mouseover();}
			wrapper.parentNode.onmouseout=function(){mouseout();}
		}
	}
	function mouseover(){
		if(step!=0){
			setZero();
		}
	}
	function mouseout(){
		if(step!=0){
			setZero();
			moveDir(direct);
		}
	}
	function moveDir(direct)
	{
	    if(direct=="left"){
			wrapper.stopMove=setInterval(moveStartLeft,speed);
		}else if(direct=="right"){
			wrapper.stopMove=setInterval(moveStartRight,speed);
		}else if(direct=="top"){
			wrapper.stopMove=setInterval(moveStartTop,speed);
		}else if(direct=="bottom"){
			wrapper.stopMove=setInterval(moveStartBottom,speed);
		}
	}
	function setZero()
	{
		stopAll();
		wrapper.userMoveLeft=0;
		wrapper.userMoveRight=0;
		wrapper.userMoveTop=0;
		wrapper.userMoveBottom=0;
	}
	function stopAll()
	{
		clearInterval(wrapper.stopMove);
		clearInterval(wrapper.stopDelay);
		clearTimeout(wrapper.stopTimeout);
	}
	function moveDelayLeft(){wrapper.stopMove=setInterval(moveStartLeft,speed);}
	function moveStartLeft()
	{
		if(wrapper.userMoveLeft>0){wrapper.scrollLeft+=userStep;}else{wrapper.scrollLeft+=step;}
		if(wrapper.scrollLeft>=inner.offsetWidth){wrapper.scrollLeft-=inner.offsetWidth;}
		if(delay!=0 && percent!=0 && wrapper.scrollLeft%distance>=(distance*percent/100))
		{
			clearInterval(wrapper.stopMove);
			if(wrapper.userMoveLeft>0){
				wrapper.stopDelay=setInterval(moveStartLeft2,1);
			}else{
				wrapper.stopDelay=setInterval(moveStartLeft2,speed+10);
			}
		}
	}
	function moveStartLeft2()
	{
		if(wrapper.scrollLeft%distance==0){
			clearInterval(wrapper.stopDelay);
			if(wrapper.userMoveLeft>0){wrapper.userMoveLeft-=1;}
			if(wrapper.userMoveLeft==0){
				if(step!=0){
					if(directChangeAuto){
						wrapper.stopTimeout=setTimeout(moveDelayLeft,delay);
					}else{
						if(direct=="left"){
							wrapper.stopTimeout=setTimeout(moveDelayLeft,delay);
						}else{
							wrapper.stopTimeout=setTimeout(moveDelayRight,delay);
						}
					}
				}
			}else{
				wrapper.stopMove=setInterval(moveStartLeft,speed);
			}
		}else{
			wrapper.scrollLeft+=1;
		}
	}
	function moveDelayRight(){wrapper.stopMove=setInterval(moveStartRight,speed);}
	function moveStartRight()
	{
		if(wrapper.userMoveRight>0){wrapper.scrollLeft-=userStep;}else{wrapper.scrollLeft-=step;}
		if(wrapper.scrollLeft<=inner.offsetWidth-wrapper.offsetWidth){wrapper.scrollLeft+=inner.offsetWidth;}
		if(delay!=0 && percent!=0 && wrapper.scrollLeft%distance<=(distance*(1-percent/100)))
		{
			clearInterval(wrapper.stopMove);
			if(wrapper.userMoveRight>0){
				wrapper.stopDelay=setInterval(moveStartRight2,1);
			}else{
				wrapper.stopDelay=setInterval(moveStartRight2,speed+10);
			}
		}
	}
	function moveStartRight2()
	{
		if(wrapper.scrollLeft%distance==0){
			clearInterval(wrapper.stopDelay);
			if(wrapper.userMoveRight>0){wrapper.userMoveRight-=1;}
			if(wrapper.userMoveRight==0){
				if(step!=0){
					if(directChangeAuto){
						wrapper.stopTimeout=setTimeout(moveDelayRight,delay);
					}else{
						if(direct=="right"){
							wrapper.stopTimeout=setTimeout(moveDelayRight,delay);
						}else{
							wrapper.stopTimeout=setTimeout(moveDelayLeft,delay);
						}
					}
				}
			}else{
				wrapper.stopMove=setInterval(moveStartRight,speed);
			}
		}else{
			wrapper.scrollLeft-=1;
		}
	}
	function moveDelayTop(){wrapper.stopMove=setInterval(moveStartTop,speed);}
	function moveStartTop()
	{
		if(wrapper.userMoveTop>0){wrapper.scrollTop+=userStep;}else{wrapper.scrollTop+=step;}
		if(wrapper.scrollTop>=inner.offsetHeight){wrapper.scrollTop-=inner.offsetHeight;}
		if(delay!=0 && percent!=0 && wrapper.scrollTop%distance>=(distance*percent/100))
		{
			clearInterval(wrapper.stopMove);
			if(wrapper.userMoveTop>0){
				wrapper.stopDelay=setInterval(moveStartTop2,1);
			}else{
				wrapper.stopDelay=setInterval(moveStartTop2,speed+10);
			}
		}
	}
	function moveStartTop2()
	{
		if(wrapper.scrollTop%distance==0){
			clearInterval(wrapper.stopDelay);
			if(wrapper.userMoveTop>0){wrapper.userMoveTop-=1;}
			if(wrapper.userMoveTop==0){
				if(step!=0){
					if(directChangeAuto){
						wrapper.stopTimeout=setTimeout(moveDelayTop,delay);
					}else{
						if(direct=="top"){
							wrapper.stopTimeout=setTimeout(moveDelayTop,delay);
						}else{
							wrapper.stopTimeout=setTimeout(moveDelayBottom,delay);
						}
					}
				}
			}else{
				wrapper.stopMove=setInterval(moveStartTop,speed);
			}
		}else{
			wrapper.scrollTop+=1;
		}
	}
	function moveDelayBottom(){wrapper.stopMove=setInterval(moveStartBottom,speed);}
	function moveStartBottom()
	{
		if(wrapper.userMoveBottom>0){wrapper.scrollTop-=userStep;}else{wrapper.scrollTop-=step;}
		if(wrapper.scrollTop<=inner.offsetHeight-wrapper.offsetHeight){wrapper.scrollTop+=inner.offsetHeight;}
		if(delay!=0 && percent!=0 && wrapper.scrollTop%distance<=(distance*(1-percent/100)))
		{
			clearInterval(wrapper.stopMove);
			if(wrapper.userMoveBottom>0){
				wrapper.stopDelay=setInterval(moveStartBottom2,1);
			}else{
				wrapper.stopDelay=setInterval(moveStartBottom2,speed+10);
			}
		}
	}
	function moveStartBottom2()
	{
		if(wrapper.scrollTop%distance==0){
			clearInterval(wrapper.stopDelay);
			if(wrapper.userMoveBottom>0){wrapper.userMoveBottom-=1;}
			if(wrapper.userMoveBottom==0){
				if(step!=0){
					if(directChangeAuto){
						wrapper.stopTimeout=setTimeout(moveDelayBottom,delay);
					}else{
						if(direct=="bottom"){
							wrapper.stopTimeout=setTimeout(moveDelayBottom,delay);
						}else{
							wrapper.stopTimeout=setTimeout(moveDelayTop,delay);
						}
					}
				}
			}else{
				wrapper.stopMove=setInterval(moveStartBottom,speed);
			}
		}else{
			wrapper.scrollTop-=1;
		}
	}
}
//============================================================================================================================//
//设置输入框的占位文本
function placeHolder(id,holderText,holderColor)
{
	if($(id))
	{
		var txtBox=$(id);
		txtBox.oldColor=txtBox.style.color;	
		if(holderColor){
			txtBox.holderColor=holderColor;
		}else{
			txtBox.holderColor="#AEAEAE";
		}
		txtBox.holderText=holderText;

		txtBox.style.color=txtBox.holderColor;
		txtBox.value=txtBox.holderText;

		txtBox.onfocus=function(){
			if(this.value==this.holderText)
			{
				this.value="";
				this.style.color=this.oldColor;
			}
		}
		txtBox.onblur=function(){
			this.value=this.value.replace(/^\s*/,"");
			this.value=this.value.replace(/\s*$/,"");
			if(this.value=="")
			{
				this.value=this.holderText;
				this.style.color=this.holderColor;
			}
		}
	}
}


 function qwjsch1(obj)
  {
        for(var i=1;i<=5;i++)
        {
        var objs=document.getElementById("h"+i);
            objs.onmouseover=function(){
                removeHov(this.className);
                
            }           
        }
  }
        function removeHov(j)
        {
            for(var i=1;i<=5;i++)
            {
              var ii="h"+i;
              if(ii==j){
                 document.getElementById("d"+i).className=document.getElementById("d"+i).className.replace(/\s*none/,"div");
                 
              }else{
              document.getElementById("d"+i).className=document.getElementById("d"+i).className.replace(/\s*div/,"none");
              }
            }

        }
 function index_jbzq_tab(obj)
{
    if($(obj))
    {
        for(var i=0;i<$(obj).children.length;i++){ 
           $(obj).children[i].order=i;
           $(obj).children[i].onmouseover=function(){index_jbzq(this.order,obj);}
        }
        $(obj).children[0].onmouseover();
    }
    else
    {
        setTimeout(function(){index_jbzq_tab(obj)},500);
    }
    
}
function index_jbzq(id,obj){
   for(var i=0;i<$(obj).children.length;i++){
       $(obj).children[i].children[0].className="";
      $(obj).children[i].children[0].children[0].className="a"+(i+1);
      $(obj).children[i].children[1].style.display="none";
   }
   $(obj).children[id].className="hov";
   $(obj).children[id].children[0].className="ish";
   $(obj).children[id].children[0].children[0].className="is a"+(id+1);
   $(obj).children[id].children[1].style.display="inline";
}
        
