function mover(theid)
{
  var i=0;
  
  for (i=0;i<bas.length;i++)
  {
    if (i==theid)
    {
      bas[i]=1;
    } 
    else bas[i]=0;
  }
  var sss="movermain("+theid.toString()+")";
  setTimeout(sss,600);
}

function movermain(theid)
{
  if (bas[theid]==1)
  {
    MisFNow();
    XianShiBlock(theid);
  }
}

function mout(theid)
{
  var i=0;
  for (i=0;i<bas.length;i++)
  {
    bas[i]=0;
  }
  var sss="moutmain("+theid.toString()+")";
  setTimeout(sss,600);
}

function moutmain(theid)
{
  var i=0;
  var j=0;
  for (i=0;i<bas.length;i++)
  {
     if (bas[i]==1)
     {
       j=1;
       break;
     }
  }
  if (bas[theid]!=1)
  {
    MissBlock(theid);
    if (j==0) GetFNow();
  }
  
}


function MisFNow()
{
  if (BranchID!=-1)
  {
      MissBlock(BranchID);
  }
}

function GetFNow()
{
  if (BranchID!=-1)
  {
    if (BranchID==0||BranchID==1||BranchID==2||BranchID==6||BranchID==17||BranchID==20||BranchID==21||BranchID==22||BranchID==23||BranchID==25||BranchID==27||BranchID==28)
    {
      XianShiBlock(BranchID);
    }
    
  }
}


///ʾĳһ
function MissBlock(theid)
{
    var obj=document.getElementById("ca"+theid);
    if (theid.toString()=="0"||theid.toString()=="3")
    {
      obj.style.width="70px";
      obj.style.lineHeight="32px";
      obj.style.background="url('images/1_26.jpg')  no-repeat";
      
    }
    else
    {
      obj.style.width="70px";
      obj.style.lineHeight="32px";
      obj.style.background="url('images/1_26.jpg')  no-repeat";
      
    }
    var objf=document.getElementById("float"+theid);
    objf.style.display="none";
    var obja=document.getElementById("a"+theid);
    obja.style.color="#ffffff";
}

///ʾĳһ
function XianShiBlock(theid)
{
   var imgurl;
   imgurl="url('images/bag_"+theid+".gif') no-repeat";
   var obj=document.getElementById("ca"+theid);
   obj.style.lineHeight="32px";
   obj.style.background=imgurl;
   if (theid.toString()=="0"||theid.toString()=="3") obj.style.width="70px";
   else obj.style.width="70px";
   var obja=document.getElementById("a"+theid);
   obja.style.color="#DF0170";
   var objf=document.getElementById("float"+theid);
   objf.style.display="block";
}

function XianShiSmallBlock()
{
 if (BranchID!=-1)
  {
    if (DepartmentID!=-1)
    {
       var obj=document.getElementById("cel_"+BranchID.toString()+"_"+DepartmentID.toString()+"_-1");
       try
       {
         if (obj.toString()!="null")
         {
           var bs=ConvertNowID(BranchID);
           obj.style.background="url(http://img.redbaby.com.cn/images/title_2008_03_07/kuang_"+bs.toString()+".gif) no-repeat";
           obj.style.color="#000000";
          }        
       }
       catch(e){}
    }
    else
    {
       if (BrandID!="-1")
       {
          var obj=document.getElementById("cel_"+BranchID.toString()+"_-1_"+BrandID.toString());
          try
          {
            if (obj.toString()!="null")
            {
              var bs=ConvertNowID(BranchID);
              obj.style.background="url(http://img.redbaby.com.cn/images/title_2008_03_07/kuang_"+bs.toString()+".gif) no-repeat";
              obj.style.color="#000000";
            }        
          }
          catch(e){}
       }
    }
    
  }
}

function ConvertNowID(BID)
{
   var a=-1;
   if (BID==2||BID==20||BID==21||BID==23) a=1;
   if (BID==0||BID==28) a=2;
   if (BID==1||BID==25) a=3;
   if (BID==6||BID==17||BID==22||BID==27) a=4;
   if (BID==3) a=5;
   return a;
   
}

function cityover()
{
  var obj=document.getElementById("cityall");
  obj.style.display="block";
}
function cityout()
{
  var obj=document.getElementById("cityall");
  obj.style.display="none";
}

function gosearch()
{
var obj=document.getElementById("Form_ProductSearch");
obj.submit();
}  

function GoCats()
{
  var urlss="https://www.redbaby.com.cn/Shopping/Shopping.aspx?Site="+SiteID;
  top.location.href=urlss;
}


