// JScript 文件

    var showSearchLabel = null;
    function showSearch(id,obj){
        var ajax = new Webservice("/webservice/Search.asmx","getCondition",true,showSearchBack);
        if(Flicker.start(ajax,"keywordDiv","数据获取中")){
		    ajax.ps.sortid = id;
		    ajax.service();
        }
        if(showSearchLabel != null){
            showSearchLabel.className = "index_search_off";
        }
        obj.className = "index_search_on";
        showSearchLabel = obj;
    }
    function showSearchBack(result){
        var contentdiv = Doc.g("keywordDiv");
        Flicker.stop("keywordDiv");
        if(!result.error){
            contentdiv.innerHTML = result[0];
        }
        else{
            contentdiv.innerHTML = "获取数据未成功，请重新加载页面！";            
        }
    }
    var gourl = null;
    function searchClick(sortid){
        var keyword = document.getElementById("keyword");
        if(keyword.value == "输入关键字")
            keyword.value = "";
        if(sortid == 3){
            gourl = "/video/list";
        }
        else if(sortid == 4){
            gourl = "/news/list";
        }
        else if(sortid == 5){
            gourl = "/info/list";
        }
        else if(sortid == 6){
            gourl = "/bbs/list";
        }
        else{
            var region = document.getElementById("region");
            var region1 = document.getElementById("region1");
            var region2 = document.getElementById("region2");
            if(region2.value != "" && region2.selectedIndex != 0){
                region.value = region2.value;
            }
            else if(region1.value != "" && region1.selectedIndex != 0){
                region.value = region1.value;
            }
            gourl = "/source/list";
        }
        document['submitForm'].action = gourl;
        document['submitForm'].submit();
    }
    
    function regionChange(){
        var region1 = document.getElementById("region1");
        var ajax = new Webservice("/webservice/RegionChoice.asmx","getRegionList",true,regionChangeBack);
        ajax.ps.id = "region2";
        ajax.ps.parentid = region1.value;
        ajax.ps.sevent = "";
		ajax.service();
    }
    function regionChangeBack(result){
        if(!result.error){
            var td = document.getElementById("region_div");
            td.innerHTML = result[0];
        }
        else{
            alert("请重新加载!");
        }
    }
    
    //知道搜索
    function search_know(){
        var keyword = document.getElementById("know_key");
        if(keyword.value == "输入关键字")
            keyword.value = "";
        window.location.href = "/know/?keyword="+ keyword.value +"";
    }
    
    //视频播放
   function playVideoChance(){
        var ajax = new Webservice("/webservice/NewsService.asmx","getVideo",true,playVideoChanceBack);
        if(Flicker.start(ajax,"play_video","数据获取中")){
		    ajax.service();
        }
    }
    function playVideoChanceBack(result){
        var contentdiv = document.getElementById("play_video");
        if(!result.error){
            contentdiv.innerHTML = result[0];
        }
        else{
            contentdiv.innerHTML = "获取数据未成功，请重新加载页面！";            
        }
    }
    function search_Click(){
        var keyword = document.getElementById("key");
        if(keyword.value == "输入关键字")
            keyword.value = "";
        all_form.submit();
    }