
function ShowShunshun(loginName,State,ImgType)
{
	if (loginName == null || loginName == "")
        return false;

    var str,strImage;

	
	if (State == "0" || State == "-1" || State == "")  //离线
	{
		if(ImgType == "")
			strImage = "ico_online_dd-2.gif";
		
	}
	else
	{
		if(ImgType == "")
			strImage = "ico_online_dd.gif";
		
    }
    str = "<img src=\"http://www.56110.cn/images/ShunShun/OnLine/"+strImage+"\" border=\"0\" align=middle>"; 

	var bb;
	if (State == "0" || State == "-1" || State == "")  //离线
	{
		bb = "<a style=cursor:hand; onclick=\"javascript:window.open('http://www.56110.cn/ShunShun/ShunShunMess.aspx?username="+loginName+"','null','height=400px,width=550px,left=" + (screen.AvailWidth-550)/2 + ",top=" + (screen.AvailHeight-400)/2 + ",toolbar=no,menubar=no,location=no');\" title=\"与该会员留言\">"+str+"</a>";
			document.write(bb);
	}
	else
	{
		bb = "<a href=\"javascript:OpenTalking('"+loginName+"');\" title=\"与该会员洽谈或留言\">"+str+"</a>";
			document.write(bb);
	}
		
	
}

//直接通过WEBSERVICE调用
function ShowShunshunEx(loginName,ImgType)
{
	var bb = ShowShunshunExValue(loginName,ImgType);
	
	document.write(bb);
		
	
}

//直接通过WEBSERVICE调用
function ShowShunshunExValue(loginName,ImgType)
{
    if (loginName == null || loginName == "")
        return false;

    var str,strImage;
    
    if(typeof ActiveXObject =="undefined")
        docSubmit = new XMLHttpRequest();
    else    
        docSubmit = new ActiveXObject("Microsoft.XMLHTTP");
    docSubmit.open("GET","http://www.56110.cn/WebService/Shunshun.asmx/GetUserState?username=" + loginName,false);
    docSubmit.send(null);

	var State = "0";
	
	if(docSubmit.responseXML.documentElement.getElementsByTagName("ID").length > 0)
	    State = docSubmit.responseXML.documentElement.getElementsByTagName("ID")[0].firstChild.nodeValue;
	
	delete docSubmit;
	
	
	if (State == "0" || State == "-1")  //离线
	{
		if(ImgType == "")
			strImage = "ico_online_dd-2.gif";
		
	}
	else
	{
		if(ImgType == "")
			strImage = "ico_online_dd.gif";
		
    }
    str = "<img src=\"http://www.56110.cn/images/ShunShun/OnLine/"+strImage+"\" border=\"0\" align=middle>"; 

	var bb;
	
	if (State == "0" || State == "-1" || State == "")  //离线
	{
		bb = "<a style=cursor:hand; onclick=\"javascript:window.open('http://www.56110.cn/ShunShun/ShunShunMess.aspx?username="+loginName+"','null','height=400px,width=550px,left=" + (screen.AvailWidth-550)/2 + ",top=" + (screen.AvailHeight-400)/2 + ",toolbar=no,menubar=no,location=no');\" title=\"与该会员留言\">"+str+"</a>";
	}
	else
	{
		bb = "<a href=\"javascript:OpenTalking('"+loginName+"');\" title=\"与该会员洽谈或留言\">"+str+"</a>";
	}	
	
	return bb;
}

function OpenTalking(loginName)
{ 

   try
   {
      var obj = null; 
      try
      {
          var obj = new ActiveXObject("IEBHO.CallClientInterface");
      }
      catch (e)
      {
		  //alert('对不起！你还没有安装56顺顺客户端，安装后才可以与他在线沟通。')
         // location.href = "http://www.56110.cn/download.html"; //没有安装软件，跳转到网页通页面。
          		  
		  window.open("http://shunshunwyt.56110.cn/WangYeTong.aspx?userName=" + loginName + "&languageType=0","56顺顺","scrollbars=no,status=no,toolbar=no,location=no,directories=no,menubar=no,resizable=no,copyhistory=no,width=550,height=440,left=150,top=130");
          return;
      }

      if (obj) 
      {
          obj.OpenTalkingForm(loginName);//打开旺页通
          delete obj;
      }
   }
   catch (e)
   {
      alert(e.message);
      
      //alert('对不起！您的顺顺现在是离线状态，请登录后使用。');
   }
}


function ShunShunGoUrl()
{
	var oclass = document.getElementById("tbType_0");
	var oclass1 = document.getElementById("tbType_1");
	var oclass2 = document.getElementById("tbType_2");
	var ofromname = document.getElementById("tbFrom");
	var otoname = document.getElementById("tbTo");
	//var ofromcode = document.getElementById("hAreacode");
	//var otocode = document.getElementById("hAreacodeto");
	
	
	var url = "/line/list";
	var query = "";

	if(oclass.checked)
		url = "/line/list";
	if(oclass1.checked)
		url = "/truck/list";
	if(oclass2.checked)
		url = "/goods/list";

	/*
	if(ofromcode.value != "")
		url = url + "_from" + ofromcode.value;
	
	if(otocode.value != "")
		url = url + "_to" + otocode.value;

	if(ofromcode.value != "" && otocode.value != "")
	{
		url = url + "_china";
	}
	*/
		
	url = url + ".html";
		
	if(ofromname.value != "")
	{
		if( query != "")
			query = query + "&";
		else 
			query = query + "?";
			
		query = query + "fromname=" + escape(ofromname.value);
	}	
		
	if(otoname.value != "")
	{
		if( query != "")
			query = query + "&";
		else 
			query = query + "?";
			
		query = query + "toname=" + escape(otoname.value);
	}	
	
	url = url + query;
		
	window.open( url);
}