﻿function slay4(num)
{
 for(var id = 1;id<=4;id++)
 {
  var ss="list4"+id; 
  if(id==num)
    document.getElementById(ss).style.display="block";
  else
    document.getElementById(ss).style.display="none";
 }  
 for(var id = 1;id<=4;id++)
 {
  var bb="tab4"+id;
  if(id==num)
    document.getElementById(bb).className="active";
  else
    document.getElementById(bb).className="";
 } 
}
function AddToFavorite()  
{
    window.external.AddFavorite("http://www.fdauto.cn","福大商务在线");  
}
function EnterToQuery(QueryFunName)
{
    if(event.keyCode == 13)
    { 
        eval(QueryFunName + "()");
        return false;
    }
}
function CheckKeyWord()
{
  var str = $get("ctl00_txtwordvalue").value;
  str=str.replace(/(^\s+|\s+$)/g,"");
  if(str =="")
  {
       alert("请输入查询内容！");
       $get("ctl00_txtwordvalue").focus();
       return false;
   }  
   window.location.href= encodeURI(document.getElementById("ctl00_DropDownList1").value+document.getElementById("ctl00_txtwordvalue").value);
}
function CheckKeyWordBottm()
{
  var str = $get("ctl00_BottomTxt").value;
  str=str.replace(/(^\s+|\s+$)/g,"");
  if(str =="")
  {
       alert("请输入查询内容！");
       $get("ctl00_BottomTxt").focus();
       return false;
   }  
   window.location.href= encodeURI(document.getElementById("ctl00_DropDownList2").value+document.getElementById("ctl00_BottomTxt").value);
}
function GetMoreInfo(num)
{ 
  if(getObj("DivTitle"+num).className=="ClassInfoTitleMore")
  {
     getObj("DivTitle"+num).className="ClassInfoTitle";
     getObj("DivChild"+num).className="ClassInfoMore";
  }
  else
  {
     getObj("DivTitle"+num).className="ClassInfoTitleMore";
     getObj("DivChild"+num).className="ClassInfo";
  }
}
function GetMoreBrandInfo(num)
{ 
  if(getObj("BrandTitle"+num).className=="ClassInfoTitleMore")
  {
     getObj("BrandTitle"+num).className="ClassInfoTitle";
     getObj("BrandChild"+num).className="ClassInfoMore";
  }
  else
  {
     getObj("BrandTitle"+num).className="ClassInfoTitleMore";
     getObj("BrandChild"+num).className="ClassInfo";
  }
}
function ShowMessage(message)
{
    parent.document.getElementById("ctl00_ContentPlaceHolder1_divMessage").innerText = message;
    parent.document.getElementById("ctl00_ContentPlaceHolder1_FaceLayerDiv").style.visibility = "visible";
    parent.document.getElementById("ctl00_ContentPlaceHolder1_MoveDiv").style.visibility = "visible";
}
    var Obj=''
    document.onmouseup=MUp;
    document.onmousemove=MMove;

function MDown(Object)
{
    Obj=Object.id;
    document.all(Obj).setCapture();
    pX=event.x-document.all(Obj).style.pixelLeft;
    pY=event.y-document.all(Obj).style.pixelTop;
}
function MMove()
{
    if(Obj!='')
    {
    document.all(Obj).style.left=event.x-pX;
    document.all(Obj).style.top=event.y-pY;
}
}
function MUp()
{
    if(Obj!='')
    {
    document.all(Obj).releaseCapture();
    Obj='';
    }
}
function CloseMessage()
{
    FaceLayerDiv = parent.document.getElementById("ctl00_ContentPlaceHolder1_FaceLayerDiv");
    MoveDiv = parent.document.getElementById("ctl00_ContentPlaceHolder1_MoveDiv");
	FaceLayerDiv.style.visibility = "hidden";
	MoveDiv.style.visibility = "hidden";
}
function Back(step)
{
    window.history.back(step);
}
function OpenWindow(url,width,height)
{
    var win=window.open(url,'Materiel','width=' + width + ',height=' + height + ',left=' + (window.screen.width - width) / 2 + ',top=' + (window.screen.height - height) / 2 + ',resizable=yes,scrollbars=yes,menubar=no,status=yes');
}
function ShowModal(Url,Width,Height,ReturnControlID,HiddenValueID)
{
    var Win = window.showModalDialog(Url,"Window","dialogWidth:" + Width + "px;dialogHeight:" + Height + "px;status=no;help=no,resizable=no,scrollbars=auto");
    if (ReturnControlID == null || ReturnControlID == undefined || ReturnControlID == '')
    {
        if (Win != undefined && Win != "")
            return true;
        else
            return false;
    }
    if (Win != undefined && Win != "" && ReturnControlID != undefined && ReturnControlID != "")
    {
        document.getElementById(ReturnControlID).value = Win;
        if(HiddenValueID !=undefined && HiddenValueID !="")
             document.getElementById(HiddenValueID).value = Win;
        return true;
    }
    else
        return false;
}
function Close(ReturnControlID)
{
    if (ReturnControlID != undefined && ReturnControlID != "")
        window.returnValue = document.getElementById(ReturnControlID).value;
	self.close();
}
function ChangeAjaxTextValueBottom()
{   
     if(document.getElementById("ctl00_DropDownList2").value.indexOf("/product/search.htm?Caption=") ==-1)
   {
       $find("AutoCompleteEx1")._completionInterval = 50000;
       $find("AutoCompleteEx1").initializeTimer($find("AutoCompleteEx1")._timer);             
   }
   else
   {
       $find("AutoCompleteEx1")._completionInterval = 500;
       $find("AutoCompleteEx1").initializeTimer($find("AutoCompleteEx1")._timer); 
   }
}
function ChangeAjaxTextValue()
{   
     if(document.getElementById("ctl00_DropDownList1").value.indexOf("/product/search.htm?Caption=") ==-1)
   {
       $find("AutoCompleteEx")._completionInterval = 50000;
       $find("AutoCompleteEx").initializeTimer($find("AutoCompleteEx")._timer);             
   }
   else
   {
       $find("AutoCompleteEx")._completionInterval = 500;
       $find("AutoCompleteEx").initializeTimer($find("AutoCompleteEx")._timer); 
   }
}
function IiaSearch()
{
     var txtKey = document.getElementById("ctl00_ContentPlaceHolder1_IiaSearchBar1_keyword");
     var txtCategory=document.getElementById("ctl00_ContentPlaceHolder1_IiaSearchBar1_DropDownList1");
     var domains = window.location.protocol + "//" + window.location.host;
     document.location.href =domains +"/IiaSearch.htm?k="+ encodeURIComponent(txtKey.value)+"&c=" + encodeURIComponent(txtCategory.value);
}