	//by xilou last modify 20081029
	var TopMenuBar = {"Path":""};
	TopMenuBar.Util = {};
	//输出并换行
	TopMenuBar.Util.Br = function (str) {document.write(str+'\n');};
	//返回元素对象
	TopMenuBar.Util.G = function (id) {return document.getElementById(id);};
	//在数组中查找符合的值,反悔true | false
	TopMenuBar.Util.InArray = function (ary, v)
	{
		for(var i = 0; i < ary.length; i++)
		{
			if(ary[i] == v) return true;
		}
		return false;
	};
	/*
	'获取主域名,根据document.domain获得主域名
	'如：news.zseso.net.cn 获得 zseso.net.cn
	'    www.zseso.net.cn 获得 zseso.net.cn
	*/
	TopMenuBar.Util.GetDomain = function (str)
	{
		var ptn = ".com|.net|.org|.biz|.info|.cc|.tv|"
				  +".com.cn|.net.cn|.org.cn|.gov.cn|.tw|.com.ph|.net.ph|"
				  +".org.ph|.ph|.cd|.hk|.us|.cn|.mobi|"
				  +".asia|"
				  +".ac.cn|.bj.cn|.sh.cn|.tj.cn|.cq.cn|.he.cn|.sx.cn|"
				  +".nm.cn|.ln.cn|.jl.cn|.hl.cn|.js.cn|.zj.cn|.ah.cn|"
				  +".fj.cn|.jx.cn|.sd.cn|.ha.cn|.hb.cn|.hn.cn|.gd.cn|"
				  +".gx.cn|.hi.cn|.sc.cn|.gz.cn|.yn.cn|.xz.cn|.sn.cn|"
				  +".gs.cn|.qh.cn|.nx.cn|.xj.cn|.tw.cn|.hk.cn|.mo.cn";
	};
	//元素在页面的x点
	TopMenuBar.pageX = function (elem)
	{
    	return elem.offsetParent ? ( elem.offsetLeft + TopMenuBar.pageX(elem.offsetParent) ) : elem.offsetLeft;
    };
	//元素在页面的y点
	TopMenuBar.pageY = function (elem)
	{
    	return elem.offsetParent ? (elem.offsetTop + TopMenuBar.pageY(elem.offsetParent)) : elem.offsetTop;
    };
	
	TopMenuBar.AddElement = function ()
	{
		//
	};

	
	/*
	'cookie操作
	'name=<value>[; expires=<date>][; domain=<domain>][; path=<path>][; secure]
	'名称=<值>[; expires=<日期>][; domain=<域>][; path=<路径>][; 安全]
	*/
	TopMenuBar.Cookie =
	{
		/*
		'Set({"key":"","value":"","expire":"","path":"","domain":""})
		'{
		'	key      : cookie名称,不区分大小写
		'	value    : cookie值
		'	[expires]: 过期时间，单位：毫秒；可以省略，省略或为0表示关闭浏览器立即过期
		'	[path]	 : cookie路径，可省略
		'	[domain] : 指定可访问cookie的主机名，可省略
		'}
		*/
		Set : function (v)
		{
			//设置不区分大小写
			var arr = document.cookie.split("; ");
			for(var i = 0; i < arr.length; i++)
			{
				var temp = arr[i].split("=");
				if(temp[0].toLowerCase() == v.key.toLowerCase())
				{
					v.key = temp[0];
				}
			}

			var str = v.key + "=" + escape(v.value);
			if(v.expires)
			{
				var dt = new Date();
				dt.setTime(dt.getTime() + v.expires);
				str += "; expires=" + dt.toUTCString();
			}
			str += (v.path) ? "; path=" + v.path : "" ;
			str += (v.domain) ? "; domain=" + v.domain : "" ;
			document.cookie = str;
		},
		//key不区分大小写,获取cookie值,如果不存在则返回null
		Get : function (key)
		{
			var arr = document.cookie.split("; ");
			for(var i = 0; i < arr.length; i++)
			{
				var temp = arr[i].split("=");
				if(temp[0].toLowerCase() == key.toLowerCase()) return unescape(temp[1]);
			}
			return null;
		},
		//清除一个cookie
		Move : function (key)
		{
			if(TopMenuBar.Cookie.Get(key) != null)
			{
				var dt = new Date();
				dt.setTime(dt.getTime()-10000);
				document.cookie = key + "=; expire=" + dt.toUTCString();
			}
		}
	};
	
	//绑定多个事件
	TopMenuBar.Util.AddEvent = function (oElement,sEvent,func)
	{
		if (oElement.attachEvent)
		{
			oElement.attachEvent(sEvent,func);
		}
		else
		{
			sEvent=sEvent.substring(2,sEvent.length);
			oElement.addEventListener(sEvent,func,false);
		}
	};
	TopMenuBar.Util.RemoveEvent = function(oElement,sEvent,func)
	{
		 if(oElement.detachEvent)
		 {
			 oElement.detachEvent('on'+sEvent, func);
		 }
		 else
		 {
			 oElement.removeEventListener(sEvent, func, false);
		 }
	};
	
	//加载样式文件
	TopMenuBar.LoadCssLink = function (url)
	{
		 //document.write('<link href="' + TopMenuBar.CssLink + (new Date()).getTime() + ' rel="stylesheet" type="text/css" />');
		 document.write('<link href="' + url + '?r=' + (new Date()).getTime() + '" rel="stylesheet" type="text/css" />');
	};
	
	//菜单项
	TopMenuBar.MenuBar = function ()
	{
		this.Html = "";
		var lineIndex = 0;
		var lineAry = [];
		lineAry.push([]);
		var itemAry = [];

		//添加菜单
		this.AddItem = function (item)
		{
			lineAry[lineIndex].push(item);
		};
		//清空菜单
		this.ClearItem = function ()
		{
			lineIndex = 0;
			lineAry = [];
		};
		//增加多一行
		this.Br = function ()
		{
			lineIndex++;
			lineAry.push([]);
		};
		//显示菜单
		this.ShowMenu = function ()
		{
			var str = "";
			for(var i = 0; i < lineAry.length; i++)
			{
				//str += "<ul>" + lineAry[i].join("") + "</ul>";
				str += lineAry[i].join("") ;
			}
			//TopMenuBar.Util.Br(str);
			
			var o1 = document.body.firstChild;
			var o2 = document.createElement("div");
			o2.id = "_MENUBOX";
			o2.style.width = "100%";
			document.body.insertBefore(o1, o2);
			//TopMenuBar.Util.G("_MENUBOX").innerHTML = str;
			
		};
		this.AddElement = function (str)
		{
			
			var o1 = document.body.firstChild;
			var o2 = document.createElement("div");
			o2.id = "_MENUBOX";
			o2.style.width = "100%";
			//o2..innerHTML = str;
			document.body.insertBefore(o2, o1);
			//alert(TopMenuBar.Util.G("_MENUBOX"));
			TopMenuBar.Util.G("_MENUBOX").innerHTML = str;
			
		};
	};
	//下拉菜单
	TopMenuBar.ShowMenuList = function (pId, cId)
	{
		var pObj = document.getElementById(pId);
		var cObj = document.getElementById(cId);
		
		cObj.className = "moreDiv_on";
		pObj.className = "more duo";
	};
	TopMenuBar.HideMenuList = function (e,ds)
	{
		if(!e){e = window.event;}
		var obj;
		if(window.event){
			obj = e.srcElement;
		}else{
			obj = e.target;
		}
		if(obj.tagName == "SPAN" || obj.tagName == "DIV"){
			var pObj = document.getElementById("x1");
			var cObj = document.getElementById("y1");
			cObj.className = "moreDiv_off";
			pObj.className = "more";
		}
	};
	//ad
	TopMenuBar.Ad = function ()
	{
		var _self         = this;
		this.Id           = "_AdBox1";
		this.Height       = 200;  //单位：px
		this.Content      = "";   //内容
		this.IntervalTime = 3000; //多长时间显示一次，单位：毫秒
		this.DelayTime    = 1000; //展开后停留多长时间，单位：毫秒
		this.Speed        = 1; //展开收缩速度
		var l             = 0;
		var handle        = null;
		var adAry         = [];
		this.Init = function ()
		{
			var obj = g(_self.Id);
			//obj.style.display  = "none";
			obj.style.height   = "0px";
			obj.style.overflow = "hidden"; //构造0像素高度
			obj.style.clear    = "both"; //构造0像素高度
			var u = location.href;
			//obj.style.fontSize = "0px";
			
			for(var i = 0; i < adAry.length; i++)
			{
				//提取当前可以显示的广告
				var uF = false;
				var uAry = adAry[i][0].split(',');//可允许显示广告的地址
				for(var j = 0; j < uAry.length; j++)
				{
					if(u.toLowerCase().indexOf(uAry[j].toLowerCase()) > -1){uF = true;break;}
				}
				//alert(uF);
				//u.indexOf(adAry[i][0]) > -1 && (!adAry[i][1] || u.indexOf(adAry[i][1]) > -1 )
				if( uF )
				{   
					//要判断是flash还是普通图片还是文字
					switch(adAry[i][5])
					{
						case 1 : //图片
							_self.Content += '<a href="'+adAry[i][4]+'" target="_blank">'
							                +'<img src="'+adAry[i][1]+'" width="'+adAry[i][2]+'" height="'+adAry[i][3]+'" /></a>';
							break;
						case 2 : //flash
							_self.Content += TopMenuBar.LoadFlash(adAry[i][1], adAry[i][2], adAry[i][3]);
							break;
						case 3 : //普通文本
							_self.Content += adAry[i][1];
							break
					}
				}
				if(_self.Content.length)break;
			}
			//alert(_self.Content);
			if(!_self.Content)return;
			obj.innerHTML = _self.Content;
			setInterval
			(
				function()
				{
					var ck = TopMenuBar.Cookie.Get("TopAd_Time");
					//alert(ck);
					if(ck == null)
					{
						//记录到cookie
						TopMenuBar.Cookie.Set
						(
							{
								"key":"TopAd_Time",
								"value":_self.IntervalTime,
								"expires":_self.IntervalTime,
								"path":"/"
							}
						);
						obj.style.display  = "";
						handle = setInterval(show,5);
						//alert(document.domain);
					}
				},
				500
			);
			
		};

		/*
		'添加广告
		'path     : 可以允许显示的路径 如：fdc0760.com/或fdc0760.com/news/
		'adFile   : 广告图片路径
		'adWidth  : 图片或flash宽度
		'adHeight : 图片或flash高度
		'adLink   : 广告图片连接路径
		'adType   : 广告类型 1:图片广告 2:flash广告 3:文字广告
		*/
		this.AddAd = function (path, adFile, adWidth, adHeight, adLink, adType)
		{
			adAry.push([path, adFile, adWidth, adHeight, adLink, adType]);
		};
		//展开
		function show()
		{
			l += _self.Speed;
			if(l >= _self.Height)
			{
				clearInterval(handle);
				setTimeout(function(){handle = setInterval(hide,5);}, _self.DelayTime);
			}
			var obj = g(_self.Id);
			obj.style.height = l + "px";
		};
		//收缩
		function hide()
		{
			l -= _self.Speed;
			if(l <= 0)
			{
				clearInterval(handle);//收回后不用再展开
				//setTimeout(function(){handle = setInterval(show,30);}, _self.DelayTime);
			}
			var obj = g(_self.Id);
			obj.style.height = l + "px";
		};
		//获取元素返回对象
		function g(id){return document.getElementById(id);};
	};
	//输出flash,url : flash 路径
	TopMenuBar.LoadFlash = function(url, w, h)
	{
		var str = '<object classid="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000" id="obj1" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" border="0" width="'+w+'" height="'+h+'">';
		str += '<param name="movie" value="'+url+'">';
		str += '<param name="quality" value="high"> ';
		str += '<param name="wmode" value="transparent"> ';
		str += '<param name="menu" value="false"> ';
		str += '<embed src="'+url+'" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" name="obj1" width="'+w+'" height="'+h+'" quality="High" wmode="transparent">';
		str += '</embed>';
		str += '</object>';
		return str;
	};
	//设为首页,url省略时设当前页为首页
	TopMenuBar.SetHomePage = function(url)
	{
		url = url ? url : window.location.href;
		if (document.all)
		{
			document.body.style.behavior='url(#default#homepage)';
			document.body.setHomePage(url);
		}
		else if (window.sidebar)
		{
			if(window.netscape)
			{
				try
				{
					netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
				}
				catch (e)
				{
					alert( "该操作被浏览器拒绝，如果想启用该功能，请在地址栏内输入 about:config,然后将项 signed.applets.codebase_principal_support 值该为true" ); 
				}
			 }
			 var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components. interfaces.nsIPrefBranch);
			 prefs.setCharPref('browser.startup.homepage',url);
		}
	};
	//加入收藏
	TopMenuBar.AddFav = function (url, title)
	{
		url = url ? url : location.href;
		title = title ? title : document.title;
		if (document.all)
		{
			window.external.addFavorite(url, title);
		}
		else if (window.sidebar)
		{
			window.sidebar.addPanel(title, url, "");
		}
	};


    /*
	'-----------------应用开始--------------------------------------------//
	'注意：如果要远程加载相关的js,css,图片等文件请使用完整路径
	'导航字体颜色样式分别为：
	'黑色：spec1(默认样式);  绿色：spec2;  红色：spec3;  黄色：spec4
	*/

	TopMenuBar.Path = "http://union.zseso.com/js/eso/topmenu2/";//"http://user.myeso.net.cn/newtop/";
    //加载必要的样式文件,如果是远程加载，请使用完整路径
	//TopMenuBar.LoadCssLink(TopMenuBar.Path + "TopMenuBar.css");

	//头部菜单开始
	var mBar = new TopMenuBar.MenuBar();
	mBar.Html = ''
	+'<div class="topMenuDiv">'
	+'<table width="960" border="0" cellpadding="0" cellspacing="0" class="topMenuBox" id="_topMenuBox">'
	+'  <tr>'
	+'	<td width="115" height="20" class="leftBox"><a class="logo" href="http://www.zseso.com" target="_blank"></a></td>'
	+'	<td width="645" class="MiddleBox">'
	+'<a href="http://www.zseSo.com" class="spec1" target="_blank">首页</a>'
	+'<b class="splitor"></b>'
	+'<a href="http://www.163668.com" class="spec3" target="_blank">网址导航</a>'
	+'<b class="splitor"></b>'
	+'<a href="http://auto.zseso.com" class="spec2" target="_blank">汽车</a>'
	+'<b class="splitor"></b>'
	+'<a href="http://life.zseso.com" class="spec3" target="_blank">生活消费</a>'
	+'<b class="splitor"></b>'
	+'<a href="http://life.zseso.com/info" class="spec1" target="_blank">跳蚤</a>'
	+'<b class="splitor"></b>'
	+'<a href="http://zs.anyjob.cn" class="spec3" target="_blank">人才</a>'
	+'<b class="splitor"></b>'
	+'<a href="http://www.fdc0760.com" class="spec4" target="_blank">房产</a>'
	+'<b class="splitor"></b>'
	+'<a href="http://h.zseso.com" class="spec1" target="_blank">酒店</a>'
	+'<b class="splitor"></b>'
	+'<a href="http://s.zseso.com" class="spec1" target="_blank">景点</a>'
	+'<b class="splitor"></b>'
	+'<a href="http://it.zseso.com/" class="spec1" target="_blank">IT数码</a>'
	+'<b class="splitor"></b>'
	+'<a href="http://food.zseso.com" class="spec1" target="_blank">美食</a>'
	+'<b class="splitor"></b>'
	+'<a href="http://wedding.zseSo.com" class="spec3" target="_blank">婚纱摄影</a>'
	+'<b class="splitor"></b>'
	+'<span class="more" onmouseover="TopMenuBar.ShowMenuList(\'x1\',\'y1\')" onmouseout="TopMenuBar.HideMenuList(event,this)" id="x1">'
	+'<a href="http://www.ecenco.com" class="spec1" target="_blank">网络服务&nbsp;&nbsp;&nbsp;</a>'
	+'<div class="moreDiv_off" id="y1">'
	+'<a href="http://www.ecenco.net" class="spec1">域名注册</a>'
	+'<a href="http://www.ecenco.com.cn" class="spec1">网站空间</a>'
	+'<a href="http://www.ecenco.com/mail/" class="spec1">企业邮箱</a>'
	+'<a href="http://www.ecenco.com/webdesign/" class="spec1">网站建设</a>'
	+'<a href="http://www.ecenco.com/idc/" class="spec1">主机托管</a>'
	+'<a href="http://www.ecenco.com/vas/" class="spec1">网络推广</a>'
	+'<a href="http://www.ecenco.com/solution/" class="spec1">客服软件</a>'
	+'<a href="http://www.ecenco.com/contact/" class="spec1">联系我们</a>'
	+'<a href="http://www.ecenco.com/support/" class="spec1">在线客服</a>'
	+'<a href="http://www.ecenco.com/pay/" class="spec1">支付方式</a>'
	+'<a href="http://www.ecenco.com/job/" class="spec1">诚聘英才</a>'
	+'</div>'
	+'</span>'
	+'	</td>'
	+'	<td width="200" class="RightBox">'
	+'<a href="javascript:TopMenuBar.SetHomePage();" class="spec4">设为首页</a>'
	+'<b class="splitor"></b>'
	+'<a href="javascript:TopMenuBar.AddFav();" class="spec4">加入收藏</a>'
	+'<b class="splitor"></b>'
	+'<a href="http://www.ecenco.com/support/" class="help spec4" target="_blank">客服中心</a>'
	+'	</td>'
	+'  </tr>'
	+'</table>'
	+'</div>';

	mBar.Html = mBar.Html.replace('{$PATH}', TopMenuBar.Path);
	TopMenuBar.Util.Br(mBar.Html);
	//根据分辨率调整菜单之间的间距
	(function ()
	{
		var s = screen.width ; //分辨率
		var mrg = (s == 1152) ? '0px 4px 0px 4px' : ( (s == 1280) ? '0px 6px 0px 6px' : '0px 4px 0px 4px');
		var o1 = TopMenuBar.Util.G("_topMenuBox");
		var o2 = o1.getElementsByTagName("a");
		for(var i = 0; i < o2.length ; i ++)
		{
			if(o2[i].className == "splitor")
			{
				o2[i].style.margin = mrg ;
			}
		}
	})();
	//
	//头部菜单结束

	//头部广告开始
	TopMenuBar.Util.Br('<div class="TopAdBox" id="TopAdBox" style="diaplay:none;">');
	TopMenuBar.Util.Br('</div>');
	var topAd = new TopMenuBar.Ad();
	topAd.Id           = "TopAdBox" ;
	topAd.Height       = 215;
	topAd.Speed        = 3; //展开收缩速度
	topAd.DelayTime    = 5000; //多少毫秒后收缩
	topAd.IntervalTime = 86400000; //多长时间显示一次，单位：毫秒

	/*
	'参数说明:
	'topAd.AddAd('可允许显示广告的地址','广告图片地址或flash地址或广告文字',图片或flash宽度,图片或flash宽度,广告连接地址,广告类型,分别为:0 图片广告 1 flash广告 2 文字广告)
	*/

	//图片广告
	//topAd.AddAd('myeso.net.cn,anyhouse.com.cn/','http://union.zseso.com/js/eso/topmenu2/images/demo1.jpg',818,180,'#',1);
	
	//flash广告
	//topAd.AddAd('www.zseso.com,www.zsbuy.net,www.anyjob.cc','http://union.zseso.com/flash/eso/vip_top.swf',900,215,'#',2);
	
	//文字广告
	//topAd.AddAd('myeso.net.cn,anyhouse.com.cn','在此填写广告文字内容，可以包含html代码',960,90,'#',3);

	//TopMenuBar.Util.AddEvent(window, "onload", function(){topAd.Init();});
	//头部广告结束
