/* file : general.js 2009-1-21 15:38:18 nkballs  */

/* *
 * 根据分类调用对应品牌列表
 */
function change_brand_by_category_for_guide(category)
{
  Ajax.call('common.php?step=change_brand_by_category_for_guide', 'category=' + category, changeBrandsByCategoryForGuideResponse, 'POST', 'JSON');
}

function change_brand_by_category_for_other(category)
{
  Ajax.call('common.php?step=change_brand_by_category_for_other', 'category=' + category, changeBrandsByCategoryForGuideResponse, 'POST', 'JSON');
}

/* *
 * 处理 根据分类调用对应品牌列表 反馈信息
 */
function changeBrandsByCategoryForGuideResponse(result)
{
  if (result.error > 0)
  {
        location.href = './';
  }
  else
  {
    var brands = document.getElementById('CATEGORY_BRAND');

    if (brands)
    {
    	brands.innerHTML = result.content;
    }
  }
}

/* *
 * 根据字符获得品牌列表
 */
function get_brands_by_character(character)
{
  Ajax.call('common.php?step=get_brands_by_character', 'character=' + character, getBrandsByCharacterResponse, 'POST', 'JSON');
}

function get_brands_by_character_for_other(character)
{
  Ajax.call('common.php?step=get_brands_by_character_for_other', 'character=' + character, getBrandsByCharacterResponse, 'POST', 'JSON');
}
/* *
 * 处理 根据字符获得品牌列表 反馈信息
 */
function getBrandsByCharacterResponse(result)
{
  if (result.error > 0)
  {
        location.href = './';
  }
  else
  {
    var brands = document.getElementById('BRAND_LIST');

    if (brands)
    {
    	brands.innerHTML = result.content;
    }
  }
}
/* *
 * 根据字符获得品牌列表
 */
function change_category_by_brand_for_guide(brand)
{
  Ajax.call('common.php?step=change_category_by_brand_for_guide', 'brand=' + brand, changeCategoryByBrandForGuideResponse, 'POST', 'JSON');
}
/* *
 * 根据字符获得品牌列表
 */
function change_category_by_brand_for_other(brand)
{
  Ajax.call('common.php?step=change_category_by_brand_for_other', 'brand=' + brand, changeCategoryByBrandForGuideResponse, 'POST', 'JSON');
}
/* *
 * 处理 根据字符获得品牌列表 反馈信息
 */
function changeCategoryByBrandForGuideResponse(result)
{
  if (result.error > 0)
  {
        location.href = './';
  }
  else
  {
    var categories = document.getElementById('BRAND_CATEGORY');

    if (categories)
    {
    	categories.innerHTML = result.content;
    }
  }
}

