function leftMenu(menu,mId,sId){
	var str = "";
	var target = "_self";
	str += "<div id='leftmenu'>";
	for(var i=0;i<menu.length;i++){
		var tempStr = menu[i][1];
		if (tempStr.substr(0, 4) == "http") {
			target = "_self"; 
		}
		str += "<div>";
		var mClass = "";
		var sClass = "";
		if(mId==i+1){
			mClass = (menu[i][2].length!=0?" m1":" m2");
			sClass = "sShow";
		}
		str += "<div class='mDiv " + mClass + "'>";
		if(menu[i][1] != ""){
			if(mId==i+1)
				str += "<span>" + menu[i][0] + "</span>";
			else
				str += "<a href='" + menu[i][1] + "' target='" + target + "'>" + menu[i][0] + "</a>";
		}
		else{
			str += "<span>" + menu[i][0] + "</span>";
		}
		str += "</div>";
		var sMenuTitle = menu[i][2];
		var sMenuUrl = menu[i][3];
		sLength = sMenuTitle.length;
		if(sLength != 0){
			for(var j=0;j<sLength;j++){
				str += "<div class='sDiv " + sClass + "'>"
				if(sId==j+1){
					str += "<span><strong>" + sMenuTitle[j] + "</strong></span>";	
				}
				else{
					str += "<a href='" + sMenuUrl[j] + "'>" + sMenuTitle[j] + "</a>";	
				}
				str += "</div>";	
			}
		}
		str += "<img src='http://home.baidu.com/resource/r/home/img/pClose.gif'></div>";
	}
	str += "</div>";
	return str;
}



function menuTop(n){
	 var str = "";
    var menutop = new Array();
    menutop[0] = new Array("首页","/","","");
    menutop[1] = new Array("盈拓介绍","/aboutus/introduce.html",new Array("盈拓简介","盈拓文化","盈拓之路","组织机构","全球足迹"),new Array("/aboutus/introduce.html","/aboutus/culture.html","/aboutus/milestone.html","/aboutus/institution.html","/aboutus/global.html"));
    menutop[2] = new Array("产品中心","/product/expo.html",new Array("展览服务","商务服务","盈拓传媒"),new Array("/product/expo.html","/product/business.html","/product/media.html"));
	menutop[3] = new Array("展会中心","http://www.showguide.cn/expo/",new Array("推荐展会","行业展会","国家展会"),new Array("http://expo.showguide.cn/","http://www.showguide.cn/moretrade.php","http://www.showguide.cn/morecountry.php"));
    menutop[4] = new Array("新闻中心","/nstopreview/",new Array("盈拓展团风采","盈拓展会预告","盈拓重点展会","企业新闻"),new Array("/nstopreview/","/nstopnotice/","/intopexpo/","/events/"));
    menutop[5] = new Array("社会责任","/pr/",new Array("公益活动","同事互助"),new Array("/gongyi/","/huzhu/"));
    menutop[6] = new Array("招贤纳才","/job/",new Array("社会招聘","校园招聘","招聘Q&A"),new Array("/job/","/school/","/job/fqa.html"));
    menutop[7] = new Array("联系我们","/aboutus/contact.html",new Array("联系方式","在线留言"),new Array("/aboutus/contact.html","/guestbook.html"));

	

	
	str += "<ul id='nav'>";
	for(var i=0; i<menutop.length; i++){
		var menuid = menutop[i];
		var target = "",target2="";
		var navClass = 'fix';
		if (i == 0) {
			navClass = 'fix2';
		}

      	//if(i==4) target2 = "target='_self'";
		str += "<li class='li" + i + " ";
		str += (n==i+1?navClass:"");
		str += "'>";
		str += "<a href='" + menuid[1] + "' " + target + ">" + menuid[0] + "</a>";
		if(menuid[2].length!=0){
			str += "<ul onMouseOver=\"parentNode.className+=' fix1'\" onMouseOut=\"setClass(parentNode)\";>";
			for(var j=0; j<menuid[2].length; j++){
				if(i==3 && (j == 1 || j == 2)) target2 = "target='_self'";
				if(i==4 && (j == 1 || j == 2 || j == 3)) target2 = "target='_self'";
				if(i==5 && (j == 1 || j == 2)) target2 = "target='_self'";
				str += "<li>";
				if(menuid[2][j].constructor == window.Array){
					str += "<a href='" + menuid[2][j][1] + "'>" + menuid[2][j][0] + "</a><div class='arr'><img src='img/arr.gif'></div>";
					str += "<ul onMouseOver=\"parentNode.className+=' fix'\" onMouseOut=\"setClass(parentNode)\";>";
					for(var k=0; k<menuid[2][j][2].length; k++){
						str += "<li><a href='" + menuid[2][j][3][k] + "'>" + menuid[2][j][2][k] + "</a></li>";
					}
					str += "</ul>";
				}
				else{
					str += "<a href='" + menuid[3][j] + "' " + target2 +">" + menuid[2][j] + "</a>";
				}
				str += "</li>";
			}
			str += "</ul>";
		}
		str += "</li>";
	}
	str += "</ul>";
	document.write(str);
	showmenu();
}
function setClass(obj){
	obj.className=obj.className.replace(' fix2','');
}

function showmenu() {
  var li = document.getElementById("nav").getElementsByTagName("li");
  for (var i=0; i<li.length; i++) {
    li[i].onmouseover = function() {
      this.className += (this.className.length > 0 ? " ": "") + "show";
    }
    li[i].onmouseout = function() {
      this.className = this.className.replace(new RegExp("( ?|^)show\\b"), "");
    }
  }
}

function WriteAd(){
	var adL = ad.length;
	var str;
	var tClass;
	for(var i=0;i<adL;i++){
		str = "";
		str += "<div class=h10></div>";
		str += "<table cellpadding='0' cellspacing='0' class='tb100 ad'><tr>";
		str += "<td class='td td1'>" + ad[i][0] + "</td>";
		for(var j=1;j<ad[i].length;j++){
			tClass = "";
			tClass = j==1?"show":"hide";
			adTypeId = "adType" + i + j;
			adConId = "adCon" + i + j;
			str += "<td id='" + adTypeId + "' class='td2 " + tClass + "' onMouseOver='ShowAd(" + i + "," + j + "," + (ad[i].length-1) +");'>" + ad[i][j][0] + "</td>";
			str += "<td class='td' width=10>&nbsp;</td>";
		}
		str += "<td class='td'>&nbsp;</td>";
		str += "</tr></table>";
		str += "<div class='w100'>";
		str += "<div class='adcon' id='" + adConId + "'>";
		str += "<div id='conR" + i + "' class='fr'><img src='img/mp3_a.gif' width='361' height='271'></div>";
		str += "<div id='conL" + i + "' class='conl txt1'></div>";
		str += "<div class='clear'></div>";
		str += "</div></div>";
		document.write(str);
		g("conL" + i).innerHTML = ad[i][1][1];
		g("conR" + i).innerHTML = "<img src='img/" + ad[i][1][2] + ".gif' width=361 height=271>";
	}
}

function ShowAd(a,b,n){
	var tc = {s:"td2 show", h:"td2 hide"};	
	for(var i=1;i<=n;i++){
		g("adType"+a+i).className = i == b ? tc.s : tc.h;
		g("conL" + a).innerHTML = ad[a][b][1];
		g("conR" + a).innerHTML = "<img src='img/" + ad[a][b][2] + ".gif' width=361 height=271>";
	}
}

function g(objectId) {
  if(document.getElementById(objectId)) {
		return document.getElementById(objectId);
  }
}
function menuFix() {
 var sfEls = document.getElementById("nav_r").getElementsByTagName("li");
 
 for (var i=0; i<sfEls.length; i++) {
  sfEls[i].onmouseover=function() {
  this.className+=(this.className.length>0? " ": "") + "sfhover";
  }
  sfEls[i].onMouseDown=function() {
  this.className+=(this.className.length>0? " ": "") + "sfhover";
  }
  sfEls[i].onMouseUp=function() {
  this.className+=(this.className.length>0? " ": "") + "sfhover";
  }
  sfEls[i].onmouseout=function() {
  this.className=this.className.replace(new RegExp("( ?|^)sfhover\\b"), "");
  }
 }
}

/**
* add by xiefg 2009-04-23
*/
	
function ShowInfo(job) {
	$("#job_info_" + job).toggle();
}
function ShowMore(job) {
	$("div[name=job_more_"+job+"]").toggle();
}
	
function toAddOrder(job_name) {
	  window.location='../job_employ.php?job_name='+encodeURIComponent(job_name)+'&actions=jobss';
	}
	
function mouseOver(name){
	//alert("11");
	name.style.background="#FCFDE7";
}
function mouseOut(name){
	name.style.background="";
}


function demoo(){
var speed=18;
var tab=document.getElementById("demo");
var tab1=document.getElementById("demo1");
var tab2=document.getElementById("demo2");
tab2.innerHTML=tab1.innerHTML;
function Marquee(){
if(tab2.offsetWidth-tab.scrollLeft<=0)
tab.scrollLeft-=tab1.offsetWidth
else{
tab.scrollLeft++;
}
}
var MyMar=setInterval(Marquee,speed);
tab.onmouseover=function() {clearInterval(MyMar)};
tab.onmouseout=function() {MyMar=setInterval(Marquee,speed)};
}
/**
  * end of xiefg add
 */
/*
$(function(){
 
  $('#employfrm')[0].method="post";
   $('#employfrm')[0].enctype="multipart/form-data";
   $('#employfrm')[0].action="/employ/";

   $('#employfrm_tijiao').click(function(){
     
		  $.ajax({
		      type:'post',
			  contentType:'multipart/form-data',
		      url:'job_post.php',
			  data:'{act:sh}',
			  success:function(da){alert(da);}
		  });

   });
 });
    */
 window.onload=menuFix;
