﻿function checkId(userId){
    //判断浏览者是否安装了贸易通
    if (NewCheckAlitalkInstalled()){
        window.location = "Alitalk:SendIM?"+userId;
    }else{
        //提示安装贸易通
        window.target="_blank";
        window.open("http://china.alibaba.com/community/turbine/template/community%2CATCPromotionDown");
    }
}
function NewCheckAlitalkInstalled() {
  var obj;
  try {
  obj = new ActiveXObject("AlitalkSetup.Install");
  }
  catch(e) {
  }
  if (null!=obj) {
    return true;
  }
  else {
    return false;
  }
}
function Strmenu()
{
eval("close1.style.display=\"none\";");
}
function initWebPolice() {
	var sgDump=null;
//	document.write('<div id="WebPoliceLayer1" style="position:absolute; z-index:100; filter: Alpha(Opacity=100)"><a href="http://www.mmwj.cn/new/110/" target=_blank><img src="/images/jj.gif" border="0" alt=""/></a></div>');
	document.write('<div id="WebPoliceLayer2" style="position:absolute; z-index:100; filter: Alpha(Opacity=100);"><div align="center"><a href="#top"><img src="/images/_top.gif" border="0" style="margin:10px;" /></a></div><div style=" background-image:url(/images/qq_03.jpg);" id="close1"><img src="/images/qq_02.jpg" alt="" width="134" height="21" border="0" usemap="#Map" /><map name="Map" id="Map"><area shape="rect" coords="114,6,126,16" href="javascript:Strmenu();" /></map><br />');
   document.write('<span style="margin-left:10px"><img src="/images/qq_06.jpg"  border="0" /></span><span style="margin-top:-25px;">&nbsp;&nbsp;<a href="http://wpa.qq.com/msgrd?V=1&Uin=85546384&Site=&Menu=yes" class="B" target="_blank">在线加盟</span></a><br />');document.write('<span style="margin-left:10px"><img src="/images/qq_06.jpg"  border="0" /></span><span style="margin-top:-25px;">&nbsp;&nbsp;<a href="http://wpa.qq.com/msgrd?V=1&Uin=565636421&Site=&Menu=yes" class="B" target="_blank">在线客服</span></a><br />');
    document.write('<img src="/images/qq_09.jpg" width="134" height="8" alt="" /><br /></div></div>');
//	sgDump = MoveLayer("1");
	sgDump = MoveLayer("2");
}
initWebPolice()


function MoveLayer(wpLayer,wpHeight,wpWidth){
	var DivObj = document.getElementById('WebPoliceLayer'+wpLayer);
	if (DivObj){
		_divTop = parseInt(DivObj.style.top,10);
		_divLeft = parseInt(DivObj.style.left,10);
		if (1==wpLayer){
			_divHeight = parseInt(DivObj.offsetHeight,10);
			_divWidth = parseInt(DivObj.offsetWidth,35);
		}else{
			_divHeight = parseInt(DivObj.offsetHeight,10);
			_divWidth = parseInt(DivObj.offsetWidth,10);
		}
		if (navigator.userAgent.indexOf("Firefox") >= 0 || navigator.userAgent.indexOf("Opera") >= 0) {
			var _docWidth = parseInt((document.body.clientWidth > document.documentElement.clientWidth)?document.body.clientWidth:document.documentElement.clientWidth);//document.body.clientWidth;
			var _docHeight = parseInt((document.body.clientHeight > document.documentElement.clientHeight)?document.documentElement.clientHeight:document.body.clientHeight);
		}else{
			var _docWidth = parseInt((document.documentElement.clientWidth == 0)?document.body.clientWidth:document.documentElement.clientWidth);
			var _docHeight = parseInt((document.documentElement.clientHeight == 0)?document.body.clientHeight:document.documentElement.clientHeight);
		}

		DivObj.style.top = parseInt((document.body.scrollTop?document.body.scrollTop:document.documentElement.scrollTop),10) + _docHeight - _divHeight-80 +"px";;
		DivObj.style.left = _docWidth - _divWidth-5 +"px";
	}
	//window.status="y:"+DivObj.style.top+";x:"+DivObj.style.left;
	setTimeout('MoveLayer("'+wpLayer+'")', 10)
}
