////////////// 顶部导航 开始 //////////////
	//获取触发事件的对象
	function topGetTarget(evt){
		var t = evt.target || evt.srcElement;
		try{
			while(t && 3 == t.nodeType){
				t = t.parentNode;
			}
		}catch(e){}
			return t;
		}

		//添加绑定事件
		function topAddEvent(el,evt,fn){
			if(el.addEventListener){
				el.addEventListener(evt,fn,false);
			}else if(el.attachEvent){
				el.attachEvent("on"+evt,fn);
			}
		}

		//根据id获取html对象
		function topGet(el,root){
			if(!el){
				return;
			};
			if (el && (el.nodeType || el.item)) {// 如果已经是 HTMLElement,那么就直接返回
				return el;
			}else{
				var rt = root || document;
				return rt.getElementById(el) ? rt.getElementById(el) : null;
			}
		}

		//根据tab名获取html对象
		function topGetByTag(tag,root){
			return (topGet(root)|| document).getElementsByTagName(tag);
		}

		//添加class名
		function topAddClass(el,cName){
			var el = topGet(el);
			if (!el || el.nodeType != 1) {
				return;
			};
			el.className = [el.className,cName].join(' ');
		}

		//删除class名
		function topRemoveClass(el,cName){
			var el = topGet(el);
			if (!el || el.nodeType != 1 || !cName) {
				return false;
			};
			el.className = el.className.replace(cName, ' ');
		}

		//获取父级某个tag名的对象
		function topGetParentByTag(el,tName){
			var rootNode = el.ownerDocument;
			var el = topGet(el).parentNode;
			while(el!=rootNode && el.tagName != tName){
				el = el.parentNode;
			}
			return el;
		}
		function preventDefault(evt) {
			if (evt.preventDefault) {
				evt.preventDefault();
			} else {
				evt.returnValue = false;
			}
		}

		//获取第一个节点
		function topGetFirst(el){
			function _topGetNext(el){
				do{
					el = topGet(el).nextSibling;
				}while(el && el.nodeType != 1);
				return el;
			}
			el = topGet(el).firstChild;
			return el && el.nodeType != 1 ? _topGetNext(el):el;
		}

		//显示顶部隐藏的内容
		function topShowMore(){
			try{
				var e = arguments[0] || window.event;
				var DL = topGetParentByTag(topGetTarget(e),'DL');
				var DD = topGetByTag('dd',DL)[0];
				if(!topGetFirst(DD)){
					var sId = DL.id.toString();
					var nId = sId.substring(sId.length-2,sId.length);
					if(topGet('topContainer_'+nId) && topGet('topContainer_'+nId).innerHTML){
						//判断是否存在对应的container内容，如果内容不存在直接退出
						DD.innerHTML = topGet('topContainer_'+nId).innerHTML;
					}else{
						return;
					}
				}
				DD.style.display = "block";
				topAddClass(topGetByTag('dt',DL)[0],'on');
			}catch(e){
				return;
			}
		}

		//隐藏顶部显示的内容
		function topCloseMore(){
			var e = arguments[0] || window.event;
			var DL = topGetParentByTag(topGetTarget(e),'DL');
			topGetByTag('dd',DL)[0].style.display = "none";
			topRemoveClass(topGetByTag('dt',DL)[0],'on');
		}



		function showTopNav(){
			var obj = [topGet('top_t1'),topGet('top_t2'),topGet('top_t3'),topGet('top_t4')];
			for(var i=0;i<obj.length;i++){
				topAddEvent(obj[i],'mouseover',topShowMore);
				topAddEvent(obj[i],'mouseout',topCloseMore);
			}
		}
////////////// 顶部导航 结束 //////////////


////////////// 发发弹出 开始 //////////////
//与用户聊天
function sjb_CallFriend(toTmUsr){
  try{//安装
  	var xmlhttp1 = new ActiveXObject("HCLogin.DetectHcIM");
  	var ret;
	ret = xmlhttp1.IMIsStart();
	if(ret == 1)
	{
		alert("买卖通IM未运行，请先运行买卖通IM！");
	}
	else
	{
		xmlhttp1.chat_with_friend(toTmUsr);	
	}
  }
  catch(e){//没安装 

  	window.open("http://www.im.hc360.com/pop3.htm", "","toolbar=no,location=no,directories=no,status=no,menubar=no, scrollbars=no,resizable=no,copyhistory=no,width=310,height=156");
  	//window.open("http://www.im.hc360.com/IM/files/help.html");
  }
  return false;
}
////////////// 发发弹出 结束 //////////////
