var MF_FAVORITE_URL = "http://www.xminglu.com";
var MF_FAVORITE_TITLE = "X名录 - 最新企业名录,营销不可少";
function addFavorite(){
    if (document.all){
       window.external.addFavorite(MF_FAVORITE_URL,MF_FAVORITE_TITLE);
    }else if (window.sidebar){
       window.sidebar.addPanel(MF_FAVORITE_TITLE, MF_FAVORITE_URL, "");
    }
}
	
	function openTQ()
	{
		var href = "http://webchat.tq.cn/sendmain.jsp?uin=8743929&ltype=0&page=http://www.xminglu.com/&localurl=xminglulocalurl&uingroup=8743931|8743929&chattype=5&transferpage=1&tq_bottom_ad_url=http://qtt.tq.cn/post/sendmain.html&tq_right_infocard_url=http://qtt.tq.cn/showcard.do&buttonsflag=&buttonsflag=&iscallback=1&agentid=0&isnoshowuser=no&rand=728416241729";
		localurl = location.href;
		href = href.replace('xminglulocalurl',localurl);
		window.open(href,"TQ","height=440,width=596,top=100,left=200,scrollbars=no");   	
	}

	window.onresize = ResizeDiv;
	window.onerror = function(){}
	var divTop,divLeft,divWidth,divHeight,docHeight,docWidth,objTimer,i = 0;
	var px = document.doctype?"px":0;
	var scrollwidth = navigator.userAgent.indexOf("Firefox")>0?16:0;
	var iframeheight = navigator.userAgent.indexOf("MSIE")>0?210-2:215-2;
	String.prototype.Trim  = function(){return this.replace(/^\s+|\s+$/g,"");}
	

	function ShowMsg()
	{
		try{
			divTop = parseInt(document.getElementById("eMeng").style.top,10);
			divLeft = parseInt(document.getElementById("eMeng").style.left,10);
			divHeight = parseInt(document.getElementById("eMeng").offsetHeight,10);
			divWidth = parseInt(document.getElementById("eMeng").offsetWidth,10);

			var scrollPosTop,scrollPosLeft,docWidth,docHeight;
			if (typeof window.pageYOffset != 'undefined') { 
				scrollPosTop = window.pageYOffset; 
				scrollPosLeft = window.pageXOffset; 
				docWidth = window.innerWidth; 
				docHeight = window.innerHeight; 
			} else if (typeof document.compatMode != 'undefined' && document.compatMode != 'BackCompat') {
				scrollPosTop = document.documentElement.scrollTop;
				scrollPosLeft = document.documentElement.scrollLeft;
				docWidth = document.documentElement.clientWidth;
				docHeight = document.documentElement.clientHeight;
			} else if (typeof document.body != 'undefined') { 
				scrollPosTop = document.body.scrollTop;
				scrollPosLeft = document.body.scrollLeft;
				docWidth = document.body.clientWidth;
				docHeight = document.body.clientHeight;
			}

			document.getElementById("eMeng").style.top = parseInt(scrollPosTop,10) + docHeight + 10 + px;// divHeight
			document.getElementById("eMeng").style.left = parseInt(scrollPosLeft,10) + docWidth - divWidth - scrollwidth + px;
			document.getElementById("eMeng").style.visibility="visible";
			objTimer = window.setInterval("Movediv()",10);
		}catch(e){}
	}

	function ResizeDiv()
	{
		i+=1;
		try{
			divHeight = parseInt(document.getElementById("eMeng").offsetHeight,10);
			divWidth = parseInt(document.getElementById("eMeng").offsetWidth,10);

			var scrollPosTop,scrollPosLeft,docWidth,docHeight; 
			if (typeof window.pageYOffset != 'undefined') { 
				scrollPosTop = window.pageYOffset; 
				scrollPosLeft = window.pageXOffset; 
				docWidth = window.innerWidth; 
				docHeight = window.innerHeight; 
			} else if (typeof document.compatMode != 'undefined' && document.compatMode != 'BackCompat') {
				scrollPosTop = document.documentElement.scrollTop;
				scrollPosLeft = document.documentElement.scrollLeft;
				docWidth = document.documentElement.clientWidth;
				docHeight = document.documentElement.clientHeight;
			} else if (typeof document.body != 'undefined') { 
				scrollPosTop = document.body.scrollTop;
				scrollPosLeft = document.body.scrollLeft;
				docWidth = document.body.clientWidth;
				docHeight = document.body.clientHeight;
			}

			document.getElementById("eMeng").style.top = docHeight - divHeight + parseInt(scrollPosTop,10) + px;
			document.getElementById("eMeng").style.left = docWidth - divWidth + parseInt(scrollPosLeft,10) - scrollwidth + px;
		}catch(e){}
	}

	function Movediv()
	{

		var scrollPosTop,scrollPosLeft,docWidth,docHeight; 
		if (typeof window.pageYOffset != 'undefined') { 
			scrollPosTop = window.pageYOffset; 
			scrollPosLeft = window.pageXOffset; 
			docWidth = window.innerWidth; 
			docHeight = window.innerHeight; 
		} else if (typeof document.compatMode != 'undefined' && document.compatMode != 'BackCompat') {
			scrollPosTop = document.documentElement.scrollTop;
			scrollPosLeft = document.documentElement.scrollLeft;
			docWidth = document.documentElement.clientWidth;
			docHeight = document.documentElement.clientHeight;
		} else if (typeof document.body != 'undefined') { 
			scrollPosTop = document.body.scrollTop;
			scrollPosLeft = document.body.scrollLeft;
			docWidth = document.body.clientWidth;
			docHeight = document.body.clientHeight;
		}

		try{
			if(parseInt(document.getElementById("eMeng").style.top,10) <= (docHeight - divHeight + parseInt(scrollPosTop,10)))
			{
				window.clearInterval(objTimer);objTimer = window.setInterval("ResizeDiv()",1);
			}
			divTop = parseInt(document.getElementById("eMeng").style.top,10);
			document.getElementById("eMeng").style.top = divTop - 1 + px;
		}catch(e){}
	}
	function ShowDiv(){
			s='<div id=eMeng style="Z-INDEX:99999;LEFT:0px;POSITION:absolute;TOP:0px;VISIBILITY:hidden;background:#666;">'
				+ '<table width=\"108\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td align=\"left\" valign=\"top\"><img src=\"/html/images/qq-1.jpg\" width=\"108\" height=\"35\" /></td></tr><tr><td align=\"left\" valign=\"top\" background=\"/html/images/qq-2.jpg\"><table width=\"108\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td width=\"41\" align=\"right\" valign=\"center\"><img src=\"http://wpa.qq.com/pa?p=4:1063527093:4\" align=\"absmiddle\" border=\"0\"></td><td width=\"67\" align=\"left\" valign=\"center\" class=\"font-s6\"><a href=\"tencent://message/?uin=1063527093\">1063527093</a></td></tr><tr><td align=\"right\" valign=\"center\"><img src=\"http://wpa.qq.com/pa?p=4:85587669:4\" align=\"absmiddle\" border=\"0\"></td><td align=\"left\" valign=\"center\" class=\"font-s6\"><a href=\"tencent://message/?uin=85587669\">85587669</a></td></tr></table></td></tr><tr><td align=\"left\" valign=\"top\"><a href=\"javascript:onclick=openTQ();\"><img border=\"0\" src=\"/html/images/qq-3.jpg\" /></a></td></tr></table>'
				+'</div>';
		document.writeln(s);
	}
	ShowDiv();
