function setResult(brandid,pclass,Stype)
{
  if(brandid==0 && Stype!=2)
  {
    return false;
  }
  with(document.myform_brands.productlist)
  {
    length = 1;
    selectedIndex=0;
  }
  with(document.myform_brands.typelist)
  {
     if(Stype==0)
     {
       selectedIndex=0;
       length = 1;
     }      
  }
  var ajaxobj=new AJAXRequest;
  ajaxobj.url="/product/ajaxsearch_new.php";
  ajaxobj.content="brandid="+brandid+"&pclass="+pclass+"&type="+Stype;
  ajaxobj.callback=function(xmlObj) {
	  if(xmlObj.responseText!="")
	  {
	    var hstr=xmlObj.responseText;
	    arrstr=hstr.split('|');
	    if(Stype==0)
	    {	      
	      for(j = 1;j <arrstr.length+1;j++)
	      { 	        
          with(document.myform_brands.typelist)  
          {
            length = arrstr.length+1;
            options[j].value = arrstr[j-1];
            options[j].text = arrstr[j-1];
          }
        }
	    }
	    else if(Stype==1&& pclass!='')	   
	    {	      
	      for(j = 1;j < arrstr.length+1;j++)
	      { 	        
          with(document.myform_brands.productlist)  
          {
            length = arrstr.length+1;
            tmpvaluearr=arrstr[j-1].split('#');
            options[j].value = tmpvaluearr[0];
            options[j].text = tmpvaluearr[1];
          }
        }
	    }
	    if(Stype==2)
	    {	      
	      for(j = 1;j <arrstr.length+1;j++)
	      { 	        
          with(document.myform_brands.brandid)  
          {
            length = arrstr.length+1;
            tmpvaluearr=arrstr[j-1].split('#');
            options[j].value = tmpvaluearr[0];
            options[j].text = tmpvaluearr[1];
          }
        }
	    }
		  return false;
		}
  }
  ajaxobj.send();
}