﻿/* ========== 舌签构造函数 begin ========== */
//eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('r z=1g.1h.1i("1j")!=-1?I:9;s 6(h,j,k,l,m){5.1k="1.0";5.1l="1m";5.t=6.$(h);7(5.t==q){J B K("6(x)参数错误:x 对像存在!")};7(!6.u){6.u=B 1n()};5.x=6.u.v;6.u.17(5);5.1o=9;5.8=[];5.R=k==q?0:k;5.L=5.R;5.S=l==q?"1p":l;5.T=m==q?"":m;5.M=9;r n=U("6.u["+5.x+"].M = I");r o=U("6.u["+5.x+"].M = 9");7(z){5.t.C("V",n)}w{5.t.D("W",n,9)};7(z){5.t.C("X",o)}w{5.t.D("Y",o,9)};7(Z(j)!="1q"){j="1r"};j=j.1s();1t(j){N"V":5.y="W";E;N"X":5.y="Y";E;N"1u":5.y="1v";E;N"1w":5.y="1x";E;1y:5.y="1z"};5.18=s(a,b,c,d,e){7(6.$(a)==q){J B K("18(19)参数错误:19 对像存在!")};r f=5.8.v;7(c==""){c=q};5.8.17([a,b,c,d,e]);r g=U(\'6.u[\'+5.x+\'].F(\'+f+\')\');7(z){6.$(a).C("1A"+5.y,g)}w{6.$(a).D(5.y,g,9)};7(f==5.R){6.$(a).O=5.S;7(6.$(b)){6.$(b).A.P=""};7(c!=q){5.t.A.1a=c};7(d!=q){G(d)}}w{6.$(a).O=5.T;7(6.$(b)){6.$(b).A.P="1b"}};7(6.$(b)){7(z){6.$(b).C("V",n)}w{6.$(b).D("W",n,9)};7(z){6.$(b).C("X",o)}w{6.$(b).D("Y",o,9)}}};5.F=s(a){7(Z(a)!="10"){J B K("F(1c)参数错误:1c 不是 10 类型!")};r i;11(i=0;i<5.8.v;i++){7(i==a){6.$(5.8[i][0]).O=5.S;7(6.$(5.8[i][1])){6.$(5.8[i][1]).A.P=""};7(5.8[i][2]!=q){5.t.A.1a=5.8[i][2]};7(5.8[i][3]!=q){G(5.8[i][3])}}w 7(5.L==i){6.$(5.8[i][0]).O=5.T;7(6.$(5.8[i][1])){6.$(5.8[i][1]).A.P="1b"};7(5.8[i][4]!=q){G(5.8[i][4])}}};5.L=a};5.12=s(){7(H.v!=5.8.v){J B K("12()参数错误:参数数量与标签数量不符!")};r a=0,i;11(i=0;i<H.v;i++){a+=H[i]};r b=1B.12(),13=0;11(i=0;i<H.v;i++){13+=H[i]/a;7(b<13){5.F(i);E}}};5.Q=9;r p=q;5.14=1C;5.1D=s(a){7(Z(a)=="10"){5.14=a};1d(p);p=1E("6.u["+5.x+"].1e()",5.14);5.Q=I};5.1e=s(){7(5.Q==9||5.M==I){15};r a=5.L;a++;7(a>=5.8.v){a=0};5.F(a)};5.1F=s(){1d(p);5.Q=9}};6.$=s(a){7(16.1f){15 G(\'16.1f("\'+a+\'")\')}w{15 G(\'16.1G.\'+a)}}',62,105,'|||||this|SubShowClass|if|label|false|||||||||||||||||null|var|function|parentObj|childs|length|else|ID|eventType|isIE|style|new|attachEvent|addEventListener|break|select|eval|arguments|true|throw|Error|selectedIndex|mouseIn|case|className|display|autoPlay|defaultID|openClassName|closeClassName|Function|onmouseover|mouseover|onmouseout|mouseout|typeof|number|for|random|percent|spaceTime|return|document|push|addLabel|labelID|background|none|num|clearInterval|nextLabel|getElementById|navigator|appVersion|indexOf|MSIE|version|author|mengjia|Array|lock|selected|string|onmousedown|toLowerCase|switch|onclick|click|onmouseup|mouseup|default|mousedown|on|Math|5000|play|setInterval|stop|all'.split('|'),0,{}))
/* ========== 舌签构造函数 end ========== */
var isIE=navigator.appVersion.indexOf("MSIE")!=-1?true:false;
function SubShowClass(h,j,k,l,m)
{
    //--参数：txtblk02menu","onmouseover",0,"on",""
    this.version="1.0";
    this.author="mengjia";
    this.parentObj=SubShowClass.$(h);
    if(this.parentObj==null)
    {
        throw new Error("SubShowClass(ID)参数错误:ID 对像存在!")
    };
    if(!SubShowClass.childs)
    {
        SubShowClass.childs=new Array()
    };
    this.ID=SubShowClass.childs.length;
    SubShowClass.childs.push(this);
    this.lock=false;
    this.label=[];
    this.defaultID=k==null?0:k;
    this.selectedIndex=this.defaultID;
    this.openClassName=l==null?"selected":l;
    this.closeClassName=m==null?"":m;
    this.mouseIn=false;
    var n=Function("SubShowClass.childs["+this.ID+"].mouseIn = true"); //function("SubShowClass.childs["+this.ID+"].mouseIn = true")
    var o=Function("SubShowClass.childs["+this.ID+"].mouseIn = false");
    if(isIE)
    {
        this.parentObj.attachEvent("onmouseover",n)
    }
    else
    {
        this.parentObj.addEventListener("mouseover",n,false)
    };
    if(isIE)
    {
        this.parentObj.attachEvent("onmouseout",o)
    }
    else
    {
        this.parentObj.addEventListener("mouseout",o,false)
    };
    if(typeof(j)!="string")
    {
        j="onmousedown"
    };
    j=j.toLowerCase();
    switch(j)
    {
        case"onmouseover":
            this.eventType="mouseover";
            break;
        case"onmouseout":
            this.eventType="mouseout";
            break;
        case"onclick":
            this.eventType="click";
            break;
        case"onmouseup":
            this.eventType="mouseup";
            break;
        default:
        this.eventType="mousedown"
    };
    //--------------------------------开始    


    this.addLabel=function(a,b,c,d,e)//初始
    {
        if(SubShowClass.$(a)==null)
        {
            throw new Error("addLabel(labelID)参数错误:labelID 对像存在!")
        };
        var f=this.label.length;
        if(c=="")
        {
            c=null
        };
        this.label.push([a,b,c,d,e]);
        var g=Function('SubShowClass.childs['+this.ID+'].select('+f+')');
        if(isIE)
        {
            SubShowClass.$(a).attachEvent("on"+this.eventType,g)
        }
        else
        {
            SubShowClass.$(a).addEventListener(this.eventType,g,false)
        };
        if(f==this.defaultID)
        {        
            SubShowClass.$(a).className=this.openClassName;
            if(SubShowClass.$(b))
            {
                SubShowClass.$(b).style.display=""
            };
            if(c!=null)
            {
                this.parentObj.style.background=c
            };
            if(d!=null)
            {
                eval(d)
            }
        }
        else
        {
            SubShowClass.$(a).className=this.closeClassName;
            if(SubShowClass.$(b))
            {
                SubShowClass.$(b).style.display="none"
            }
        };
        //if(SubShowClass.$(b)) //--------b=textblk02_c1 - 3
        //{
        //    if(isIE) //--------- 真
        //    {       
        //        SubShowClass.$(b).attachEvent("onmouseover",n)
        //    }
        //    else
        //    {           
        //        SubShowClass.$(b).addEventListener("mouseover",n,false)
        //    };
        //    if(isIE)
        //    {
        //        SubShowClass.$(b).attachEvent("onmouseout",o)
        //    }
        //    else
        //    {
        //        SubShowClass.$(b).addEventListener("mouseout",o,false)
        //    }
        //}
    };
   
    //--------------------------------结束
    //--------------------------------开始    

    this.select=function(a) //-------a=0、1、2 -------此式为function(a){}的整体
    {
        if(typeof(a)!="number")
        {
            throw new Error("select(num)参数错误:num 不是 number 类型!")
        };
        var i;    
        for(i=0;i<this.label.length;i++)
        {
            if(i==a) //呈现选择
            {
                SubShowClass.$(this.label[i][0]).className=this.openClassName;
                if(SubShowClass.$(this.label[i][1]))
                {
                    SubShowClass.$(this.label[i][1]).style.display=""
                };
                if(this.label[i][2]!=null)
                {
                    this.parentObj.style.background=this.label[i][2]
                };
                if(this.label[i][3]!=null)
                {
                    eval(this.label[i][3])
                }              
                document.getElementById(this.label[i][3]).href=this.label[i][4];
                
                //document.getElementById("yssk").href=this.label[i][4]; //---->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>------------------>>>>>>>                              
            }
            else if(this.selectedIndex==i)//隐藏历史
            {
                SubShowClass.$(this.label[i][0]).className=this.closeClassName;
                if(SubShowClass.$(this.label[i][1]))
                {
                    SubShowClass.$(this.label[i][1]).style.display="none"
                };
                if(this.label[i][4]!=null)
                {
                    eval(this.label[i][4])
                }
            }
        };
        this.selectedIndex=a  //历史
    };

    //--------------------------------开始
 //   this.random=function()
 //   {
 //       if(arguments.length!=this.label.length)
 //       {
 //           throw new Error("random()参数错误:参数数量与标签数量不符!")
 //       };
 //       var a=0,i;
 //       for(i=0;i<arguments.length;i++)
 //       {
 //            a+=arguments[i]
 //       };
 //       var b=Math.random(),percent=0;
 //       for(i=0;i<arguments.length;i++)
 //       {
 //           percent+=arguments[i]/a;
 //           if(b<percent)
 //           {
  //              this.select(i);
  //              break
 //           }
 //       }
 //   };
    //--------------------------------结束
    
/*    
    this.autoPlay=false;
    var p=null;
    this.spaceTime=5000;
    this.play=function(a)
    {
        if(typeof(a)=="number")
        { 
            this.spaceTime=a
        };
        clearInterval(p);
        p=setInterval("SubShowClass.childs["+this.ID+"].nextLabel()",this.spaceTime);
        this.autoPlay=true
    };
 */
    
    //--------------------------------开始
/*
    this.nextLabel=function()
    {
        if(this.autoPlay==false||this.mouseIn==true)
        {
            return
        };
        var a=this.selectedIndex;
        a++;
        if(a>=this.label.length)
        {
            a=0
        };
        this.select(a)
    };
*/
//--------------------------------结束

    //--------------------------------开始    
//    this.stop=function()
//    {
//        clearInterval(p);
//        this.autoPlay=false
//    }
    //--------------------------------结束
};
//--------------------------------结束

    //--------------------------------开始
    SubShowClass.$=function(a)
    {    
        if(document.getElementById)
        {     
            return eval('document.getElementById("'+a+'")')
        }
        else
        {     
            return eval('document.all.'+a)
        }
    }
    //--------------------------------结束



