﻿// JScript 文件
function   keypress()   
{   
  if(event.keyCode==13)   
  {   
     if(document.getElementById("ButLog") !="" & document.getElementById("ButLog") != null) 
     {
          document.getElementById("ButLog").click();   
     }
  }   
}

function   keypresst()   
{   
  if(event.keyCode==13)   
  {   
     if(document.getElementById("imageLogin") !="" & document.getElementById("imageLogin") != null) 
     {
          document.getElementById("imageLogin").click();   
     }
  }   
}

function   keypresscomm()   
{   
  if(event.keyCode==13)   
  {   
     if(document.getElementById("ButSave") !="" & document.getElementById("ButSave") != null) 
     {
          document.getElementById("ButSave").click();   
     }
  }   
}


//添加到收藏夹代码
function bookmarkit()
{
    window.external.addFavorite("http://www.suokei.com",'搜客在线')
}

//商务网站用户登陆
function CheckUser()
{
    if(document.all["TextUser"].value =="" || document.all["TextUser"].value ==null)
    {
        alert("用户名不能为空!");
        return false;
    }
    else if(document.all["TextPassword"].value =="" || document.all["TextPassword"].value ==null)
    {   
        alert("用户密码不能为空!");
        return false;				
    }
    else if(document.all["TextValidate"].value =="" || document.all["TextValidate"].value ==null)
    {   
        alert("验证码不能为空!");
        return false;			
    }
}
  
//商务网站登陆清除
function CheckClr()
{
     document.all["TextUser"].value ="";
     document.all["TextPassword"].value =""
     document.all["TextValidate"].value =""
     return false;
}

function ChangeAnotherImg() 
{ 
  document.getElementById("imgid").src="http://www.suokei.com/CommFile/ValidatePage.aspx?num="+Math.random(); 
}
  
//顶部内容搜索
function checkBoxIt()
{
    var title;
    if(document.all["TopUserControl1_TextInfo"].value =="" || document.all["TopUserControl1_TextInfo"].value ==null)
    {
        alert("请输入要搜索的内容！");
        return false;
    }
    else
    {
        title = document.all["TopUserControl1_TextInfo"].value;
        var   a   =   document.getElementsByName("TopUserControl1$RadTest"); 
        for(var i=0;i <a.length;i++ )       
        { 
            if(a[i].checked == true)
            {   
                if(a[i].value =="Radcomp")
                {
                    type = "gsxx";
                }
                if(a[i].value =="Radproj")
                {
                    type = "cpxx";
                }
                if(a[i].value =="Radbus")
                {
                    type = "sqxx";
                }
            }   
        }
        window.open("http://www.suokei.com/cpss.aspx?strtype="+type+"&title="+title)
     }
}

//顶部内容搜索
function checkBoxIndex()
{
    var title;
    if(document.all["IndexTopUserControl1_TextInfo"].value =="" || document.all["IndexTopUserControl1_TextInfo"].value ==null)
    {
        alert("请输入要搜索的内容！");
        return false;
    }
    else
    {
        title = document.all["IndexTopUserControl1_TextInfo"].value;
        var   a   =   document.getElementsByName("IndexTopUserControl1$RadTest"); 
        for(var i=0;i <a.length;i++ )       
        { 
            if(a[i].checked == true)
            {   
                if(a[i].value =="Radcomp")
                {
                    type = "gsxx";
                }
                if(a[i].value =="Radproj")
                {
                    type = "cpxx";
                }
                if(a[i].value =="Radbus")
                {
                    type = "sqxx";
                }
            }   
        }
        window.open("http://www.suokei.com/cpss.aspx?strtype="+type+"&title="+title)
     }
}

//博客内容搜索
function booksreach()
{
     if(document.getElementById("BookTopUserControl1$TextInfo").value =="" || document.getElementById("BookTopUserControl1$TextInfo").value == null)
     {
         alert("请输入要搜索的内容！");
         return false;
     }
     else
     {
         window.open("http://www.suokei.com/bkss.aspx?title="+document.getElementById("BookTopUserControl1$TextInfo").value);
     }
}

//买卖需知的搜索
 function xzsreach()
 {
     if(document.getElementById("TextInfo").value =="" || document.getElementById("TextInfo").value == null)
     {
         alert("请输入要搜索的内容！");
         return false;
     }
     else
     {
         window.open("http://www.suokei.com/buyss.aspx?title="+document.getElementById("TextInfo").value);
     }
}
    
//企业列表搜索
function compTypeSreach()
{
  var province = document.getElementById("TextProvince").options[document.getElementById("TextProvince").selectedIndex].text;
  var city = document.all("TextCity").value
  var content = document.all("TextValue").value;
  var type = document.all("CompType").value;
  if(province =="请选择省份" || province=="" || city == null)
  {
      alert("请您选择省份！");
      return;
  }
  else
  {
      if(content =="" || content == null)
      {
          alert("请您输入要查询的关键字！");
          return false;
      }
      else
      {
           if(city !="" & city != null)
           {
               province = province +"_"+city;
           }
           window.open("http://www.suokei.com/qyflss.aspx?type=" + type + "&city=" + province + "&text=" + content)
           //window.open("http://www.suokei.com/qyflss.aspx?type=" + type + "&city=" + city + "&text=" + content)
      }
   }
}

//产品分类搜索
function projTypeSreach()
{
 
  var province = document.getElementById("TextProvince").options[document.getElementById("TextProvince").selectedIndex].text;
 
  var city = document.all("TextCity").value
  var content = document.all("TextValue").value;
  var type = document.all("ProjType").value;
  if(province =="请选择省份" || province=="" || city == null)
  {
      alert("请您选择省份！");
      return;
  }
  else
  {
      if(content =="" || content == null)
      {
          alert("请您输入要查询的关键字！");
          return false;
      }
      else
      { 
           if(city !="" & city != null)
           {
               province = province +"_"+city;
           }
           window.open("http://www.suokei.com/cpflss.aspx?type=" + type + "&city=" + province + "&text=" + content) 
      } 
   }
}

////产品列表搜索
//function cplbsreach()
//{
//  var city = document.getElementById("TextCity").options[document.getElementById("TextCity").selectedIndex].text;
//  var citytwo = document.all("TextCityTwo").value
//  var content = document.all("TextValue").value;
//  var type = document.all("strtype").value;
//  if(city =="请选择省份" || city=="" || city == null)
//  {
//      alert("请您选择省份！");
//      return;
//  }
//  else
//  {
//      if(content =="" || content == null)
//      {
//          alert("请您输入要查询的关键字！");
//          return false;
//      }
//      else
//      {
//           if(citytwo !="" & citytwo != null)
//           {
//               city = city +"_"+citytwo;
//           }
//           window.open("http://www.suokei.com/cplbss.aspx?strTitleValue=" + type + "&city=" + city + "&text=" + content)
//      }
//   }
//}

//商情分类搜索
function busTypeSreach()
{
  var province = document.getElementById("TextProvince").options[document.getElementById("TextProvince").selectedIndex].text;
 
  var city = document.all("TextCity").value
  var content = document.all("TextValue").value;
  var type = document.all("BusType").value;
  var buytype = document.all("BuyType").value;
  if(province =="请选择省份" || province=="" || city == null)
  {
      alert("请您选择省份！");
      return;
  }
  else
  {
      if(content =="" || content == null)
      {
          alert("请您输入要查询的关键字！");
          return false;
      }
      else
      { 
           if(city !="" & city != null)
           {
               province = province +"_"+city;
           } 
           window.open("http://www.suokei.com/sqflss.aspx?type="+ type +"&buytype=" + buytype + "&city=" + province + "&text=" + content);
      } 
   } 
}
//商情分类搜索
function sqlbsreach(jytype)
{
  var city = document.getElementById("TextCity").options[document.getElementById("TextCity").selectedIndex].text;
  var citytwo = document.all("TextCityTwo").value
  var content = document.all("TextValue").value;
  var type = document.all("strtype").value;
  if(city =="请选择省份" || city=="" || city == null)
  {
      alert("请您选择省份！");
      return;
  }
  else
  {
      if(content =="" || content == null)
      {
          alert("请您输入要查询的关键字！");
          return false;
      }
      else
      {
           if(citytwo !="" & citytwo != null)
           {
               city = city +"_"+citytwo;
           }
           window.open("http://www.suokei.com/sqss.aspx?jytype="+ jytype +"&cptype=" + type + "&city=" + city + "&text=" + content)
      }
   }
}

