﻿// JScript 文件
var links = [
    {
  
        childLink : [
        {name:'公司动态',url:'NewsCenter.aspx?SEID=1'},
        {name:'媒体关注',url:'NewsCenter.aspx?SEID=2'},
        {name:'行业展会',url:'NewsCenter.aspx?SEID=3'}
        ],
        title:'新闻中心',
        count:3,
        index : 0
    },
    {
        childLink : [
        {name:'专项技术工程',url:'NewsCenter.aspx?SEID=14'},
        {name:'管理咨询服务',url:'NewsCenter.aspx?SEID=15'},
        {name:'提供全程服务',url:'NewsCenter.aspx?SEID=16'},
        {name:'标准矿山装备',url:'NewsCenter.aspx?SEID=33'}
        ],
        title:'主营业务',
        count:4,
        index : 1
    },
    {
        childLink : [
        {name:'煤矿信息化i-Coal平台 ',url:'NewsCenter.aspx?SEID=42'},
         {name:'煤矿综合自动化平台 ',url:'NewsCenter.aspx?SEID=18'},
        {name:'煤炭行业主管产品体系 ',url:'NewsCenter.aspx?SEID=19'},
       
        {name:'数字化矿山平台 ',url:'NewsCenter.aspx?SEID=17'},
        
       
       {name:'煤炭信息化管理咨询',url:'NewsCenter.aspx?SEID=37'},
         {name:'好矿长产品体系',url:'MainBusiness.aspx?SEID=43'},
        {name:'标准矿山装备',url:'MainBusiness.aspx?SEID=22'}
       
        ],
        title:'产品展示',
        count:7,
        index : 2
    },
    { 
        childLink : [
        {name:'煤炭行业监管部门',url:'NewsCenter.aspx?SEID=4'},
        {name:'大型煤业集团',url:'NewsCenter.aspx?SEID=5'},
        {name:'大型生产矿井',url:'NewsCenter.aspx?SEID=6'},
        {name:'中小型生产矿井',url:'NewsCenter.aspx?SEID=7'},
        {name:'三维可视化系统',url:'NewsCenter.aspx?SEID=39'},
 
        ],
        title:'成功案例',
        count:5,
        index : 3
    },
    {
        childLink : [
        {name:'服务宗旨',url:'SinglePage.aspx?SEID=8'},
        
        {name:'服务策略',url:'SinglePage.aspx?SEID=38'},
        {name:'售后服务标准',url:'SinglePage.aspx?SEID=11'},
       
　　　　{name:'服务网点',url:'SinglePage.aspx?SEID=10'},
        {name:'在线留言',url:'OnLine.aspx'}
        ],
        title:'客户服务',
        count:5,
        index : 4
    },
    {
        childLink : [
         {name:'天科简介',url:'SinglePage.aspx?SEID=27'},
        {name:'天科文化',url:'SinglePage.aspx?SEID=32'},
          {name:'天科团队',url:'SinglePage.aspx?SEID=30'},
          　{name:'分支机构',url:'SinglePage.aspx?SEID=28'},
        {name:'天科资质',url:'SinglePage.aspx?SEID=31'},
       
       
　　　
        {name:'合作伙伴',url:'SinglePage.aspx?SEID=29'}
      
        ],
        title:'关于我们',
        count:6,
        index : 5
    }                   
]
function display(obj,index)
{
    var abc = links;
    if(obj.className != 'navstyle2')
    {
        obj.className = 'navstyle2';
        obj.childNodes[0].style.color = '#0154a2';
    }
      
    var newobj = getObjParam(obj);
    div_navcontent.style.left = newobj.left + 4;
    div_navcontent.style.top = newobj.top + newobj.height;
    
    //生成菜单
    if(index != undefined)
    {
        var menuHtml = '<ul>';
        for(var i=0;i<links[index].count;i++)
        {
            menuHtml += '<li style="text-align:left;width:135px;margin-left:-15px;margin-top:3px;margin-bottom:3px;" onmouseover="this.style.backgroundColor=\'#6197d3\';" onmouseout="this.style.backgroundColor=\'#ffffff\';">'
                     +  '  <a style="color:#0154a2;text-decoration:none;" href="' + links[index].childLink[i].url + '">' + links[index].childLink[i].name + '</a>'
                     +  '</li>'
        }
        menuHtml += '</ul>'
        div_navcontent.innerHTML = menuHtml;
    }
    
    
    div_navcontent.style.display = "block";
    
    div_navcontent.onmousemove = function(){
            if(obj.className != 'navstyle2')
            {
                obj.className = 'navstyle2';
                obj.childNodes[0].style.color = '#0154a2';
            }
            this.style.left = newobj.left + 4;
            this.style.top = newobj.top + newobj.height;
            this.style.display = "block";
    }   
    
    div_navcontent.onmouseout = function(){
            obj.className = 'navstyle';
            this.style.display = "none";
            obj.childNodes[0].style.color = '#ffffff';
    } 
}
function hidden(obj)
{
    obj.className = 'navstyle';
    div_navcontent.style.display = "none";
    obj.childNodes[0].style.color = '#ffffff';
}
function getObjParam(e)
{
    var   t   =   e.offsetTop;   
    var   l   =   e.offsetLeft;   
    var   w   =   e.offsetWidth;   
    var   h   =   e.offsetHeight-1;   
    
    while(e=e.offsetParent)   {   
    t+=e.offsetTop;   
    l+=e.offsetLeft;   
    }   
    return   {   
    top   :   t,   
    left   :   l,   
    width   :   w,   
    height   :   h   
    }   
}