function buy(id,t)
{
  window.open("/bbs/buy.asp?t="+t+"&id="+id,"","width=500,height=500,left=100,top=50,scrollbars");
}

function search4S(id)
{
  window.open("/inc/list.asp?stype=2&id="+id,"","");
}

function reportError()
{
  var urls=document.location.toString();
  window.open("/inc/message.asp?"+urls,"","width=530,height=320,left=100,top=100,scrollbars");
}

function search(type)
{
  if (type == 1)
  {
    search1.background = "/images/S_U.gif";
    search2.background = "/images/S_D.gif";
    search3.background = "/images/S_D.gif";
    search4.background = "/images/S_D.gif";
    search11.style.display = "";
    search22.style.display = "none";
    search33.style.display = "none";
    search44.style.display = "none";
  }
  if (type == 2)
  {
    search1.background = "/images/S_D.gif";
    search2.background = "/images/S_U.gif";
    search3.background = "/images/S_D.gif";
    search4.background = "/images/S_D.gif";
    search11.style.display = "none";
    search22.style.display = "";
    search33.style.display = "none";
    search44.style.display = "none";
  }
  if (type == 3)
  {
    search1.background = "/images/S_D.gif";
    search2.background = "/images/S_D.gif";
    search3.background = "/images/S_U.gif";
    search4.background = "/images/S_D.gif";
    search11.style.display = "none";
    search22.style.display = "none";
    search33.style.display = "";
    search44.style.display = "none";
  }
  if (type == 4)
  {
    search1.background = "/images/S_D.gif";
    search2.background = "/images/S_D.gif";
    search3.background = "/images/S_D.gif";
    search4.background = "/images/S_U.gif";
    search11.style.display = "none";
    search22.style.display = "none";
    search33.style.display = "none";
    search44.style.display = "";
  }
}

function showBrands(type,obj)
{
  if (type == 0)
  {
    obj.cnbrands.style.display = "";
    obj.imbrands.style.display = "none";
  }
  if (type == 1)
  {
    obj.cnbrands.style.display = "none";
    obj.imbrands.style.display = "";
  }
}

function keydown(type)
{
  if (type == 0 && form1.keyword.value == "车型名称")
    form1.keyword.value = "";
  if (type == 1 && form2.keyword.value == "4S店名称")
    form2.keyword.value = "";
}

function keyup(type)
{
  if (type == 0 && form1.keyword.value == "")
    form1.keyword.value = "车型名称";
  if (type == 1 && form2.keyword.value == "")
    form2.keyword.value = "4S店名称";
}

function checkAuto()
{
  if (((form1.column[0].checked && form1.cnbrands.selectedIndex == 0) || (form1.column[1].checked && form1.imbrands.selectedIndex == 0)) && form1.price.selectedIndex == 0 && form1.autotype.selectedIndex == 0 && (form1.keyword.value == "" || form1.keyword.value == "车型名称"))
  {
    alert("请给出至少一个查询条件！");
    if (form1.column[0].checked)
      form1.cnbrands.focus();
    else
      form1.imbrands.focus();
    return false;
  }
  else
  {
    if (form1.keyword.value == "车型名称")
      form1.keyword.value = "";
    
    return true;
  }
}

function checkSales()
{
  if (((form2.column[0].checked && form2.cnbrands.selectedIndex == 0) || (form2.column[1].checked && form2.imbrands.selectedIndex == 0)) && form2.district.selectedIndex == 0 && (form2.keyword.value == "" || form2.keyword.value == "4S店名称"))
  {
    alert("请给出至少一个查询条件！");
    if (form2.column[0].checked)
      form2.cnbrands.focus();
    else
      form2.imbrands.focus();
    return false;
  }
  else
  {
    if (form2.keyword.value == "4S店名称")
      form2.keyword.value = "";
    
    return true;
  }
}

function checkInfo(frm)
{
  if (frm.keyword.value == "" && frm.column.selectedIndex == 0)
  {
    alert("请给出至少一个查询条件！");
    frm.column.focus();
    return false;
  }
  else
  {
    return true;
  }
}

function searchZone(zoneName)
{
  form6.district.value = zoneName;
  form6.submit();
}

function searchZone1(zoneName)
{
  form5.district.value = zoneName;
  form5.submit();
}

function addFavorite()
{
  window.external.addFavorite(document.location,document.title);
}

function doCommend()
{
  var title = document.title;
  if (title.indexOf(" > ") > -1)
    title = title.substring(0,title.indexOf(" > "));
  var link = document.location;
  window.location = "mailto:?subject="+title+"&body="+link;
}

function doPrint()
{
  window.open("/inc/print.html","","left=100,top=100,width=600,height=500,scrollbars=yes,resizable=yes");
}

function doFont(px)
{
  content.style.fontSize = px + "px";
}
