﻿function dk_slideplayer(object,count){
	var _this = this;
	_this.obj = object;
	_this.count = count;
	_this.time = 2000; //停留的时间
	_this.n = 0;
	var t;
	
	this.slide = function(){ //普通的选项卡
		$(_this.obj + " .fwxm_tab1 li").bind("mouseover",function(event){
			$(event.target).removeClass("fwxm_tabunhover");
			$(event.target).addClass("fwxm_tab1On");
			$(event.target).siblings().removeClass("fwxm_tab1On");
			$(event.target).siblings().addClass("fwxm_tabunhover");
			var index = $(_this.obj + " .fwxm_tab1 li").index(this);
			$(_this.obj + " .fwxm_Con .fwxm_con_1").eq(index).show().siblings().hide();
			_this.n = index;
		});
	}
	this.addhover = function(){ //鼠标悬停暂停轮换
		$(_this.obj).hover(function(){clearInterval(t);}, function(){t = setInterval(_this.autoplay,_this.time)});
		
	}
	
	this.autoplay = function(){ //通过模拟鼠标事件实现轮换
		_this.n = _this.n >= (_this.count - 1) ? 0 : ++_this.n;
		$(_this.obj + " .fwxm_tab1 li").eq(_this.n).trigger("mouseover");
	}
	
	this.factory = function(){
		this.slide();
		this.addhover();
		t = setInterval(this.autoplay,_this.time);
	}	
	this.factory();
}

function scrollDoor(){ 
} 
scrollDoor.prototype = { 
    sd : function(menus,divs,openClass,closeClass){ 
        var _this = this; 
        if(menus.length != divs.length) 
        { 
            alert("菜单层数量和内容层数量不一样!"); 
            return false; 
        }                 
        for(var i = 0 ; i < menus.length ; i++) 
        {     
            _this.$(menus[i]).value = i;                 
            _this.$(menus[i]).onmouseover = function(){ 
                     
                for(var j = 0 ; j < menus.length ; j++) 
                {                         
                    _this.$(menus[j]).className = closeClass; 
                    _this.$(divs[j]).style.display = "none"; 
                } 
                _this.$(menus[this.value]).className = openClass;     
                _this.$(divs[this.value]).style.display = "block";                 
            } 
        } 
        }, 
    $ : function(oid){ 
        if(typeof(oid) == "string") 
        return document.getElementById(oid); 
        return oid; 
    } 
} 
function scrollDoor1(){ 
} 
scrollDoor1.prototype = { 
    sd : function(menus,divs,openClass,closeClass){ 
        var _this = this; 
        if(menus.length != divs.length) 
        { 
            alert("菜单层数量和内容层数量不一样!"); 
            return false; 
        }                 
        for(var i = 0 ; i < menus.length ; i++) 
        {     
            _this.$(menus[i]).value = i;                 
            _this.$(menus[i]).onclick= function(){ 
                     
                for(var j = 0 ; j < menus.length ; j++) 
                {                         
                    _this.$(menus[j]).className = closeClass; 
                    _this.$(divs[j]).style.display = "none"; 
                } 
                _this.$(menus[this.value]).className = openClass;     
                _this.$(divs[this.value]).style.display = "block";                 
            } 
        } 
        }, 
    $ : function(oid){ 
        if(typeof(oid) == "string") 
        return document.getElementById(oid); 
        return oid; 
    } 
} 

window.onload = function(){ 
    var SDmodel = new scrollDoor(); 
      SDmodel.sd(["m1","m2","m3","m4","m5"],["c1","c2","c3","c4","c5"],"sd1","sd2"); //硬盘数据恢复
       SDmodel.sd(["m01","m02","m03","m04"],["c01","c02","c03","c04"],"sd1","sd2"); //服务器数据恢复
	  SDmodel.sd(["m001","m002","m003","m004"],["c001","c002","c003","c004"],"sd1","sd2"); //各类故障数据恢复
       SDmodel.sd(["m0001","m0002","m0003","m0004","m0005","m0006"],["c0001","c0002","c0003","c0004","c0005","c0006"],"sd1","sd2"); //数据库数据恢复 
      var SDmodel1=new scrollDoor1();
      SDmodel1.sd(["m00001","m00002","m00003","m00004","m00005","m00006","m00007","m00008"],["c00001","c00002","c00003","c00004","c00005","c00006","c00007","c00008"],"sd01","sd02"); //成功案例 
      }