//menu主菜单
function MenuClick(div,key){
   // var key = event.srcElement.innerHTML;
    var str = "";
	for(var i = 0; i < menus.length; i++){
	   if(menus[i]["name"].toUpperCase() == key.toUpperCase().replace(" ","")){
	      str = "<div style='border:1px solid #A7A7A7'>"
		      + "<ul style='list-style:none;width:86px;margin:0;background-color:#165DB2'>";
          var tempArr = menus[i]["List"];
		  for(var j = 0;j < tempArr.length;j++){
		     var content = tempArr[j];
			 var name = tempArr[j].split("|")[0];
			 var url = tempArr[j].split("|")[1];
             var target = "_self";
             if(tempArr[j].split("|").length > 2){
                 target = tempArr[j].split("|")[2];
             }
		     str += "<li class=\"menulink left lh15\" style='margin:0;width:86px' OnMouSeout=\"this.style.background='#165DB2'\" onMouSeover=\"this.style.background='#4784CD'\">";
			 str += "<a href='" + url + "' target='" + target + "'>";
			 str += "&nbsp;" + name + "&nbsp;";
			 str += "</a></li>";
		  }
	      str +="</ul></div>";
	      popMenu(div,str);
		  return;
	   }
	}
  }



  function popMenu(div,str){
    var x = event.srcElement.offsetLeft;
    var y = event.srcElement.offsetTop;
    var parent = event.srcElement.parentElement;
	while(parent.nodeName.toUpperCase()!="BODY"){
       	x += parent.offsetLeft;
		y += parent.offsetTop;

		parent = parent.offsetParent;
	}
	y += event.srcElement.offsetHeight;
    div.innerHTML = str;
	div.style.display = "block";
	if(div.style.width < event.srcElement.offsetWidth){
	    div.offsetwidth = event.srcElement.offsetWidth;
	}
	div.style.pixelLeft = x;
    div.style.pixelTop  = y;

 }

  function hideMenu(div){
     div.style.display='none';
  }


  function hide(){
    var div = document.all.menuDiv;
    hideMenu(div);
  }

  function pop(key){
    var div = document.all.menuDiv;
    MenuClick(div,key);
  }

  //by jamesyang
  function getMenuTD(haveSubs, curKey, curUrl, curUrlTitle, target) {
      if(target == null) {
          target = "_self";
      }
  	var ret = "<li";
  	if(haveSubs) {
  		ret = ret + " onMouseout='hide()' onMouseOver=\"pop('" + curKey + "')\"";
  	}
  	ret = ret + "><a href='" + curUrl + "' target='" + target + "'>" + curUrlTitle + "</a></li>";
  	return ret;
  }

 //-----------------------------------------------------

  var urlRoot = "../../";

  var menus = new Array();
  var pos = -1 ;


  pos++;
  menus[pos] = new Array();
  menus[pos]["name"] = "communion";
  menus[pos]["List"] = new Array();
  var index = 0;
  menus[pos]["List"][index++] = "互动交流|../../jsp/index/LeaveWordSubjectList.jsp?catelogID=63&targetID=31&targetType=LB";
  menus[pos]["List"][index++] = "创业故事|../../jsp/index/NewsList.jsp?targetID=87";

  pos++;
  menus[pos] = new Array();
  menus[pos]["name"] = "train";
  menus[pos]["List"] = new Array();
  var index = 0;
  menus[pos]["List"][index++] = "培训信息|../../jsp/index/NewsList.jsp?targetID=57";
  menus[pos]["List"][index++] = "在线学习平台|../../jsp/index/NewsOneList.jsp?targetID=58";

  pos++;
  menus[pos] = new Array();
  menus[pos]["name"] = "server";
  menus[pos]["List"] = new Array();
  var index = 0;  
  menus[pos]["List"][index++] = "移动电话测试|../../jsp/index/NewsOneList.jsp?targetID=44";  
  menus[pos]["List"][index++] = "集成电路测试|../../jsp/index/NewsOneList.jsp?targetID=45";
  menus[pos]["List"][index++] = "ICC服务|../../jsp/index/NewsList.jsp?targetID=46";
  menus[pos]["List"][index++] = "项目申报|../../jsp/index/NewsList.jsp?targetID=47";
  menus[pos]["List"][index++] = "投融资服务|../../jsp/index/NewsList.jsp?targetID=48";
  menus[pos]["List"][index++] = "辅导员和创业|../../jsp/index/NewsMultListTwo.jsp?targetID=49";
  menus[pos]["List"][index++] = "法律服务|../../jsp/index/NewsMultListFL.jsp?targetID=50";
  menus[pos]["List"][index++] = "财务服务|../../jsp/index/NewsMultListCW.jsp?targetID=51";  
  menus[pos]["List"][index++] = "人才服务|../../jsp/index/NewsMultList.jsp?targetID=52";
  menus[pos]["List"][index++] = "企业资质申请|../../jsp/index/NewsList.jsp?targetID=53";
  menus[pos]["List"][index++] = "知识产权服务|../../jsp/index/NewsList.jsp?targetID=54";
  menus[pos]["List"][index++] = "企业招聘|../../jsp/index/JobList.jsp?targetID=55";
  menus[pos]["List"][index++] = "在孵企业供求|../../jsp/index/NewsList.jsp?targetID=56";
//  menus[pos]["List"][index++] = "在线问答|../../jsp/index/LeaveWordSubjectList.jsp?catelogID=65&targetID=32&targetType=LB";
  
  pos++;
  menus[pos] = new Array();
  menus[pos]["name"] = "sales";
  menus[pos]["List"] = new Array();
  var index = 0;
  menus[pos]["List"][index++] = "招商热线|../../jsp/index/Zhaoshang.jsp?targetID=38";  
  menus[pos]["List"][index++] = "基地特点|../../jsp/index/NewsOneList.jsp?targetID=39";
  menus[pos]["List"][index++] = "优惠政策|../../jsp/index/NewsOneList.jsp?targetID=40";
  menus[pos]["List"][index++] = "房源信息|../../jsp/index/NewsOneList.jsp?targetID=41";  
  menus[pos]["List"][index++] = "配套设施|../../jsp/index/NewsOneList.jsp?targetID=42";  
  menus[pos]["List"][index++] = "入驻指南|../../jsp/index/NewsList.jsp?targetID=43";  

  pos++;
  menus[pos] = new Array();
  menus[pos]["name"] = "news";
  menus[pos]["List"] = new Array();
  var index = 0;
  menus[pos]["List"][index++] = "基地动态|../../jsp/index/NewsList.jsp?targetID=33"; 
  menus[pos]["List"][index++] = "媒体报道|../../jsp/index/NewsList.jsp?targetID=34"; 
  menus[pos]["List"][index++] = "通知公告|../../jsp/index/NewsList.jsp?targetID=35"; 
  menus[pos]["List"][index++] = "行业追踪|../../jsp/index/NewsList.jsp?targetID=68"; 
  menus[pos]["List"][index++] = "企业动态|../../jsp/index/NewsList.jsp?targetID=36"; 
  menus[pos]["List"][index++] = "沙龙活动专辑|../../jsp/index/NewsList.jsp?targetID=37"; 

  pos++;
  menus[pos] = new Array();
  menus[pos]["name"] = "introduce";
  menus[pos]["List"] = new Array();
  var index = 0;
  menus[pos]["List"][index++] = "基地介绍|../../jsp/index/NewsOneList.jsp?targetID=29";
  menus[pos]["List"][index++] = "机构设置|../../jsp/index/NewsOneList.jsp?targetID=30";
  menus[pos]["List"][index++] = "基地风采|../../jsp/index/NewsList.jsp?targetID=31";
  menus[pos]["List"][index++] = "入驻企业|../../jsp/index/JoinOrgnizationList.jsp";
  menus[pos]["List"][index++] = "联系我们|../../jsp/index/Zhaoshang.jsp?targetID=38";

  pos++;
  menus[pos] = new Array();
  menus[pos]["name"] = "briefing";
  menus[pos]["List"] = new Array();
  var index = 0;
  menus[pos]["List"][index++] = "基地简报|#";

  pos++;
  menus[pos] = new Array();
  menus[pos]["name"] = "downcenter";
  menus[pos]["List"] = new Array();
  var index = 0;
  menus[pos]["List"][index++] = "下载中心|#";

  pos++;
  menus[pos] = new Array();
  menus[pos]["name"] = "law";
  menus[pos]["List"] = new Array();
  var index = 0;
  menus[pos]["List"][index++] = "政策法规|#";

  //----------------------------------------------------------------------------------------------------------

var menuDiv = "<div id=menuDiv style='position:absolute;left:0px,top:0px;display:none;background-color:#99CCFF;border:0px,z-index:4'"
				+ " onMouseOver=\"this.style.display='block'\" onMouseOut=\"this.style.display='none'\"></div>";

var menuTableTr = "<div class=\"MenuBody\"><div class=\"left\"><img src=\"../../images/index/menu01.gif\" width=\"12\" height=\"35\" border=\"0\"/></a></div><div class=\"left menu\"><ul>"
var menuTrTable = "</ul></div><div class=\"right\"><img src=\"../../images/index/menu03.gif\" width=\"12\" height=\"35\"/></div></div>"

var menuSprTd = "<li class=\"vDashed\"></li>";

document.write(menuDiv + menuTableTr);

document.write(menuSprTd + getMenuTD(false, "index","../../jsp/index/Index.jsp", "<img src='../../images/index/m_index.gif' width='45' height='21' border='0' title='首页'>"));
document.write(menuSprTd + getMenuTD(true, "introduce","../../jsp/index/NewsOneList.jsp?targetID=29", "<img src='../../images/index/m_intro.gif' width='80' height='21' border='0'>"));
document.write(menuSprTd + getMenuTD(true, "news","../../jsp/index/NewsList.jsp?targetID=33", "<img src='../../images/index/m_news.gif' width='80' height='21' border='0'>"));
document.write(menuSprTd + getMenuTD(false, "law","../../jsp/index/NewsMultList.jsp?targetID=22", "<img src='../../images/index/m_law.gif' width='80' height='21' border='0'>"));
document.write(menuSprTd + getMenuTD(true, "sales","../../jsp/index/Zhaoshang.jsp?targetID=38", "<img src='../../images/index/m_sales.gif' width='80' height='21' border='0'>"));
document.write(menuSprTd + getMenuTD(true, "server","../../jsp/index/NewsList.jsp?targetID=44", "<img src='../../images/index/m_server.gif' width='80' height='21' border='0'>"));
document.write(menuSprTd + getMenuTD(false, "downcenter","../../jsp/index/NewsList.jsp?targetID=25", "<img src='../../images/index/m_downcenter.gif' width='80' height='21' border='0'>"));
document.write(menuSprTd + getMenuTD(true, "train","../../jsp/index/NewsList.jsp?targetID=57", "<img src='../../images/index/m_train.gif' width='80' height='21' border='0'>"));
document.write(menuSprTd + getMenuTD(true, "communion","../../jsp/index/LeaveWordSubjectList.jsp?catelogID=63&targetID=31&targetType=LB", "<img src='../../images/index/m_communion.gif' width='80' height='21' border='0'>"));
document.write(menuSprTd + getMenuTD(false, "briefing","../../jsp/index/NewsList.jsp?targetID=28", "<img src='../../images/index/m_briefing.gif' width='80' height='21' border='0'>"));

document.write(menuSprTd);
document.write(menuTrTable);

