// JavaScript Document
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 = {
    sd1: 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(["com_fwlc", "com_fwcn"], ["com_fwlc_nr", "com_fwcn_nr"], "com_fwlc_hover", "com_fwlc_bg"); //服务流程，服务承诺滑动门
    SDmodel.sd(["com_jszt_tab", "com_gsxw_tab"], ["com_jszt", "com_gsxw"], "com_fwlc_hover", "com_fwlc_bg"); //公司新闻，技术专题滑动门
  //  var SDmodel1 = new scrollDoor1();
  //  SDmodel1.sd1(["m01", "m02", "m03", "m04", "m05", "m06", "m07", "m08", "m09", "m10", "m11", "m12", "m13", "m14", "m15"], ["c1", "c2", "c3", "c4", "c5", "c6", "c7", "c8", "c9", "c10", "c11", "c12", "c13", "c14", "c15"], "left1_midullihover", "left1_midullibg");
    
}
