﻿
/*测试效果*/

var defaultNum = 1;
var ChangeSearchMenu = function(index) {
    defaultNum = index;
    var objs = document.getElementsByName("searchmenu");
    var isIE = (document.all && window.ActiveXObject && !window.opera) ? true : false;
    if (isIE) {
        var objs = document.getElementById("search_menu").childNodes;
    }
    var num = objs.length;
    for (i = 0; i < num; i++) {
        objs[i].className = "";
    }
    objs[num - 1].className = "clear_bg";
    objs[index].className = "on";
    if (index - 1 >= 0) {
        objs[index - 1].className = "clear_bg";
    }
}

//0:找小区，1：找商家，2：找优惠，3：找情报，4：找商品，5：找好友
var allSearchSubmit = function() {
    if (defaultNum == 0) {
        var tag = document.getElementById("txtKeyWord").value;
        window.location.href = "http://www.szshequ.com/space.php?do=shequ&view=listall&name=" + tag;
        return false;
    }
    else if (defaultNum == 1) {
        var tag = document.getElementById("txtKeyWord").value;
        window.location.href = "http://bl.szshequ.com/Home/Search?Address=%E6%B7%B1%E5%9C%B3%E5%B8%82%E4%B8%AD%E5%BF%83&Tags=" + tag + "&TagsType=1&Business=&Sort=0&Mode=1&Range=0&PageIndex=1&PageSize=10&SearchName=" + tag;
        return false;
    } else if (defaultNum == 2) {
        var tag = document.getElementById("txtKeyWord").value;
        window.location.href = "http://coupon.szshequ.com/home/voucherlist/?key=" + tag + "&address=全市";
        return false;
    }
    else if (defaultNum == 3) {
        var tag = document.getElementById("txtKeyWord").value;
        window.location.href = "http://advices.szshequ.com/home/list/?key=" + tag + "&address=全市";
        return false;
    }
    else if (defaultNum == 4) {
        alert("正在建设中");
        return false;
    }
    else if (defaultNum == 5) {
        var tag = document.getElementById("txtKeyWord").value;
        window.location.href = "http://www.szshequ.com/space.php?do=friend&searchkey=" + tag + "&searchsubmit=%E6%89%BE%E5%A5%BD%E5%8F%8B&searchmode=1";
        return false;
    }
}