﻿// JScript 文件
var Wherestr;
var TopNum;
var where_str;
function get_Terminal_shop_count()
{
    var Terminal_count=Y_Control_Terminal_head.get_Terminal_count().value;
    $('NO_Export_shop').innerHTML ='<div id="NO_membership">北京已开发 '+Terminal_count+'0 家社区店</div>';
}
//联动二级菜单
function redirec(x)
{
　//获取一级菜单长度
var B_S_len = $('s1').options.length;
var S_S = new Array(B_S_len);
//把一级菜单都设为数组
for (i=0; i<B_S_len; i++) 
{
    S_S[i] = new Array();
}
//定义基本选项
S_S[0][0] = new Option('==请选择==','');
S_S[1][0] = new Option("社区宣传资料派发", "社区宣传资料派发");
S_S[1][1] = new Option("社区海报推广", "社区海报推广");
S_S[1][2] = new Option("社区显示条屏推广", "社区显示条屏推广");
S_S[2][0] = new Option("宣传资源派发推广", "宣传资源派发推广");
S_S[2][1] = new Option("社区海报推广", "社区海报推广");
S_S[2][2] = new Option("社区显示条屏推广", "社区显示条屏推广");
S_S[2][3] = new Option("社区节日产品专案推广", "社区节日产品专案推广");
$('s2').length = 0; //初始化下拉列表 清空下拉数据
$('s2').options[0] = new Option('==请选择==',''); //给第一个值
var temp = $('s2'); 
for (i=0;i<S_S[x].length;i++)
{
    temp.options[i]=new Option(S_S[x][i].text,S_S[x][i].value);
}
    temp.options[0].selected=true;
}

//社区搜索
function click_search()
{
   var search_text = $F('search_text'); 
   search_text = JSC_Trim(search_text);
   if(search_text !="" && search_text !=null && search_text != "请输入社区名称进行搜索！")
   {
        var Row_Name='name';
        var TC_ID =Y_Control_Terminal_head.get_TC_ID_byName(Row_Name,search_text,"Terminal_Community").value;
        if(TC_ID !=0 && TC_ID !="")
        {
            location.href = 'Terminal_CommunityInfo.aspx?ID='+TC_ID+'';
        }
        else
        {
            alert("暂无您要搜索的内容！\n 请输入准确信息进行搜索！");
        }
   }
   else
   {
        alert("请输入正确内容进行搜索！");
        $('search_text').value = '';
        $('search_text').focus();
   }
}
//社区生活服务
function get_community_living()
{
    var wherestr="Where type = 3";
    var TopNum = "Top 6";
    $('Expor_community_serve_info').innerHTML = '<div class="loadingDiv">正在加载数据…</div>';
    Y_Control_Terminal_Main.get_community_server_spread(wherestr,TopNum,get_community_living_CallBack);
}
function get_community_living_CallBack(response)
{
    var ds = response.value;
    if(ds != null && typeof(ds) == "object")
    {
        if(ds.Rows.length > 0)
        {
            var inHTML ='';
            inHTML +='<div id="community_serve_left">';
            where_str='img_place =16 ';
            var AD_up=Y_Control_Terminal_Main.get_community_AD(where_str).value;
            if(AD_up != null && typeof(AD_up) == "object")
            {
                if(AD_up.Rows.length > 0)
                {
                    inHTML +='<a href="http://'+AD_up.Rows[0].link_Url+'" title="邮购" target="_blank"><img alt="邮购" src="AD_Img/'+AD_up.Rows[0].adimg_files+'"  class="community_ad_css"/></a>';
                }
            }
            where_str='img_place =17 ';
            var AD_down=Y_Control_Terminal_Main.get_community_AD(where_str).value;
            if(AD_down != null && typeof(AD_down) == "object")
            {
                if(AD_down.Rows.length > 0)
                {
                    inHTML +='<a href="http://'+AD_down.Rows[0].link_Url+'" title="邮购" target="_blank"><img alt="邮购" src="AD_Img/'+AD_down.Rows[0].adimg_files+'" class="community_ad_css" /></a>';
                }
            }
            inHTML += '</div>';
            inHTML += '<div id="community_serve_right">';
            for(var i=0;i<ds.Rows.length;i++)
            {
                inHTML += '<div class="community_serve_text"><a href="YGInfo_display.aspx?T_ID='+ds.Rows[i].ID+'" title="邮购世界—'+ds.Rows[i].title+'" target="_blank">'+ds.Rows[i].title.substring(0,13)+'</a></div>';
            }
            inHTML += '</div><div class="clear"></div>';
            $('Expor_community_serve_info').innerHTML = inHTML;   
        }
    }
}
//终端社区推广
function get_Terminal_community_flack()
{
    var wherestr="Where type = 4";
    var TopNum = "Top 6";
    $('Expor_community_flack_info').innerHTML = '<div class="loadingDiv">正在加载数据…</div>';
    Y_Control_Terminal_Main.get_community_server_spread(wherestr,TopNum,get_Terminal_community_flack_CallBack);
}
function get_Terminal_community_flack_CallBack(response)
{
    var ds = response.value;
    if(ds != null && typeof(ds) == "object")
    {
        if(ds.Rows.length > 0)
        {
            var inHTML ='';
            inHTML +='<div id="community_flack_up"><div id="community_flack_img">';
            where_str='img_place =18 ';
            var AD_F=Y_Control_Terminal_Main.get_community_AD(where_str).value;
            if(AD_F != null && typeof(AD_F) == "object")
            {
                if(AD_F.Rows.length > 0)
                {
                    inHTML +='<a href="http://'+AD_F.Rows[0].link_Url+'" title="邮购" target="_blank"><img alt="邮购" src="AD_Img/'+AD_F.Rows[0].adimg_files+'"  id="community_fad_css"/></a>';
                }
            } 
            inHTML +='</div>';
            inHTML +='<div class="community_flack_text"><a href="YGInfo_display.aspx?T_ID='+ds.Rows[0].ID+'" title="'+ds.Rows[0].title+'" target="_blank">'+ds.Rows[0].title+'</a><br />'+ds.Rows[0].content.substring(0,46)+'．．．</div></div><div class="clear"></div>';
            inHTML +='<div id="Divcommunity_flack_down">';
            for(var i=1;i<ds.Rows.length;i++)
            {
                inHTML += '<div class="Divcommunity_flack_down_list"><a href="YGInfo_display.aspx?T_ID='+ds.Rows[i].ID+'" title="'+ds.Rows[i].title+'" target="_blank">'+ds.Rows[i].title.substring(0,10)+'</a></div>';
            }
            inHTML +='</div><div class="clear"></div>';
            $('Expor_community_flack_info').innerHTML = inHTML;   
        }
    }
}

//集城社区广告
function get_JC_AD()
{
    $('TJ_AD_list').innerHTML = '<div class="loadingDiv">正在加载数据…</div>';
    where_str='img_place =10 ';
    Y_Control_Terminal_Main.get_C_T_AD(where_str,get_JC_AD_CallBack);
}
function get_JC_AD_CallBack(response)
{
    var ds = response.value;
    if(ds != null && typeof(ds) == "object")
    {
        if(ds.Rows.length > 0)
        {
            var inHTML ='';
            for(var i=0;i<ds.Rows.length;i++)
            {
                inHTML += '<div class="NewList_css"><a href="http://'+ds.Rows[i].link_Url+'" title="邮购" target="_blank"><img alt="邮购" src="AD_Img/'+ds.Rows[i].adimg_files+'"></a></div>';
            }
            inHTML += '<div class="clear"></div>';
            $('TJ_AD_list').innerHTML = inHTML;   
        }
        else
        {
            $('TJ_AD_list').innerHTML = "";
        }
    }
}
//新开发社区
function get_New_community()
{
    $('Export_star_list').innerHTML = '<div class="loadingDiv">正在加载数据…</div>';
    Wherestr="Where 0 = 0";
    TopNum =" Top 12"
    Y_Control_Terminal_Main.get_community_byWherestr(Wherestr,TopNum,get_New_community_CallBack);
}
function get_New_community_CallBack(response)
{
    var ds = response.value;
    if(ds != null && typeof(ds) == "object")
    {
        if(ds.Rows.length > 0)
        {
            var inHTML ='';
            for(var i=0;i<ds.Rows.length;i++)
            {
                inHTML += '<div class="TC_star_list_text"><a href="Terminal_CommunityInfo.aspx?ID='+ds.Rows[i].ID+'" title="'+ds.Rows[i].name+'">'+ds.Rows[i].name.substring(0,10)+'</a></div>';
            }
            $('Export_star_list').innerHTML = inHTML; 
        }
    }
}
//读取各区社区—1
function get_region_community()
{
    $('Terminal_community_JS').innerHTML = '<div class="loadingDiv">正在加载数据…</div>';
    Y_Control_Terminal_Main.get_Terminal_region(get_region_community_CallBack);
}
function get_region_community_CallBack(response)
{
    var ds = response.value;
    if(ds != null && typeof(ds) == "object")
    {
        if(ds.Rows.length > 0)
        {
            var inHTML ='';
            for(var i=0;i<ds.Rows.length;i++)
            {
                var adregion=ds.Rows[i].region;
                Wherestr="Where region = '"+adregion+"' and level=1";
                TopNum =" Top 1"
                var ad=Y_Control_Terminal_Main.get_community_byWherestr(Wherestr,TopNum).value;
                if(ad != null && typeof(ad) == "object")
                {
                    if(ad.Rows.length > 0)
                    {
                        for(var j=0;j<ad.Rows.length;j++)
                        {
                            inHTML += '<div class="Terminal_community_list"><div class="Terminal_community_title"><a href="Terminal_CommunityInfo.aspx?ID='+ad.Rows[j].ID+'" title="'+ad.Rows[j].name+'">'+ad.Rows[j].region+'</a></div><a href="Terminal_CommunityInfo.aspx?ID='+ad.Rows[j].ID+'" title="'+ad.Rows[j].name+'"><img alt="邮购终端—'+ad.Rows[j].name+'" class="community_img" src="M_image/'+ad.Rows[j].files+'.jpg" /></a></div>';
                        }  
                    }
                }
                
             } 
             inHTML += '<div class="clear"></div>'; 
             $('Terminal_community_JS').innerHTML = inHTML;       
        }
    }
}
//社区介绍—1
function get_community_info()
{
    Wherestr="Where info_set=1 and [level] = 1 ";
    TopNum ="Top 6"
    $('Community_info').innerHTML = '<div class="loadingDiv">正在加载数据…</div>';
    Y_Control_Terminal_Main.get_community_byWherestr(Wherestr,TopNum,get_community_info_CallBack);
}
function get_community_info_CallBack(response)
{
    var ds = response.value;
    if(ds != null && typeof(ds) == "object")
    {
        if(ds.Rows.length > 0)
        {
            var inHTML ='';
            for(var i=0;i<ds.Rows.length;i++)
            {
                inHTML += '<div class="ZB_info_C"><a href="Terminal_CommunityInfo.aspx?ID='+ds.Rows[i].ID+'"  title="'+ds.Rows[i].name+'"><img alt="邮购社区介绍" src="M_image/'+ds.Rows[i].files+'.jpg" /></a><a href="Terminal_CommunityInfo.aspx?ID='+ds.Rows[i].ID+'" class="ZB_info_T" title="'+ds.Rows[i].name+'">'+ds.Rows[i].name.substring(0,10)+'</a></div>';
            }
            $('Community_info').innerHTML = inHTML; 
        }
    }
}
//社区周边商业—1
function get_community_business()
{
    Wherestr="Where type = 5 and level = 1";
    TopNum ="Top 3"
    $('community_bussiness').innerHTML = '<div class="loadingDiv">正在加载数据…</div>';    
    Y_Control_Terminal_Main.get_community_other_info(Wherestr,TopNum,get_community_business_CallBack);
}
function get_community_business_CallBack(response)
{
    var ds = response.value;
    if(ds != null && typeof(ds) == "object")
    {
        if(ds.Rows.length > 0)
        {
            var inHTML ='';
            for(var i=0;i<ds.Rows.length;i++)
            {
                inHTML += '<div class="ZB_c_list"><a href="YGInfo_display.aspx?T_ID='+ds.Rows[i].ID+'" title="'+ds.Rows[i].title+'"  target="_blank">'+ds.Rows[i].title.substring(0,11)+'</a><br />'+ds.Rows[i].content.substring(0,26)+'…</div>';
            }
            $('community_bussiness').innerHTML = inHTML; 
        }
    }
}
//社区推广度排名—1—1
function get_community_PM()
{
    Wherestr="Where [level] = 1 AND ranking=1";
    TopNum ="Top 3"
    $('Community_PM_fixedness').innerHTML = '<div class="loadingDiv">正在加载数据…</div>';    
    Y_Control_Terminal_Main.get_community_byWherestr(Wherestr,TopNum,get_community_PM_CallBack);
}
function get_community_PM_CallBack(response)
{
    var ds = response.value;
    if(ds != null && typeof(ds) == "object")
    {
        if(ds.Rows.length > 0)
        {
            var inHTML ='';
            for(var i=0;i<ds.Rows.length;i++)
            {
                inHTML += '<div class="PM_list"><img alt="推广排名" src="Image/terminal_fixedness_ico0.jpg" class="PM_ico_css" /><a href="Terminal_CommunityInfo.aspx?ID='+ds.Rows[i].ID+'" title="'+ds.Rows[i].name+'">'+ds.Rows[i].name.substring(0,9)+'</a></div><img src="Image/terminal_fixedness_arrowhead.jpg" class="RPM_ico_css" alt="邮购社区排名" />';
            }            
        }
        else
        {
            inHTML += '';
        }
        $('Community_PM_fixedness').innerHTML = inHTML; 
    }
}
//社区推广度排名—1—UP
function get_community_PM_UP()
{
    Wherestr="Where [level] = 1 AND ranking=2";
    TopNum ="Top 3"
    $('Community_PM_UP').innerHTML = '<div class="loadingDiv">正在加载数据…</div>';    
    Y_Control_Terminal_Main.get_community_byWherestr(Wherestr,TopNum,get_community_PM_UP_CallBack);
}
function get_community_PM_UP_CallBack(response)
{
    var ds = response.value;
    if(ds != null && typeof(ds) == "object")
    {
        if(ds.Rows.length > 0)
        {
            var inHTML ='';
            for(var i=0;i<ds.Rows.length;i++)
            {
                inHTML += '<div class="PM_list"><img alt="推广排名" src="Image/terminal_fixedness_ico0.jpg" class="PM_ico_css" /><a href="Terminal_CommunityInfo.aspx?ID='+ds.Rows[i].ID+'" title="'+ds.Rows[i].name+'">'+ds.Rows[i].name.substring(0,9)+'</a></div><img src="Image/terminal_UP_arrowhead.jpg" class="RPM_ico_css" alt="邮购社区排名" />';
            }
            $('Community_PM_UP').innerHTML = inHTML; 
        }
    }
}
//社区推广度排名—1—Down
function get_community_PM_Down()
{
    Wherestr="Where [level] = 1 AND ranking=3";
    TopNum ="Top 3"
    $('Community_PM_Down').innerHTML = '<div class="loadingDiv">正在加载数据…</div>';    
    Y_Control_Terminal_Main.get_community_byWherestr(Wherestr,TopNum,get_community_PM_Down_CallBack);
}
function get_community_PM_Down_CallBack(response)
{
    var ds = response.value;
    if(ds != null && typeof(ds) == "object")
    {
        if(ds.Rows.length > 0)
        {
            var inHTML ='';
            for(var i=0;i<ds.Rows.length;i++)
            {
                inHTML += '<div class="PM_list"><img alt="推广排名" src="Image/terminal_fixedness_ico0.jpg" class="PM_ico_css" /><a href="Terminal_CommunityInfo.aspx?ID='+ds.Rows[i].ID+'" title="'+ds.Rows[i].name+'">'+ds.Rows[i].name.substring(0,9)+'</a></div><img src="Image/terminal_Down_arrowhead.jpg" class="RPM_ico_css" alt="邮购社区排名" />';
            }
            $('Community_PM_Down').innerHTML = inHTML; 
        }
    }
}
//一级社区广告
function get_C_T_ONEAD()
{
    $('C_T_ONEAD').innerHTML = '<div class="loadingDiv">正在加载数据…</div>';  
    where_str='img_place =19 ';  
    Y_Control_Terminal_Main.get_C_T_AD(where_str,get_C_T_ONEAD_CallBack);
}
function get_C_T_ONEAD_CallBack(response)
{
    var ds = response.value;
    if(ds != null && typeof(ds) == "object")
    {
        if(ds.Rows.length > 0)
        {
            var inHTML ='';
            inHTML += '<a href="http://'+ds.Rows[0].link_Url+'" title="邮购" target="_blank"><img alt="邮购广告" src="AD_Img/'+ds.Rows[0].adimg_files+'" /></a>';
        }
        $('C_T_ONEAD').innerHTML = inHTML;
    }
}
//社区媒体资源—1
function get_community_MT()
{
    Wherestr="Where level = 1 AND type = 6";
    TopNum ="Top 3"
    $('C_T_MT_list').innerHTML = '<div class="loadingDiv">正在加载数据…</div>';
    Y_Control_Terminal_Main.get_community_other_info(Wherestr,TopNum,get_community_MT_CallBack);
}
function get_community_MT_CallBack(response)
{
    var ds = response.value;
    if(ds != null && typeof(ds) == "object")
    {
        if(ds.Rows.length > 0)
        {
            var inHTML ='';
//            for(var i=0;i<ds.Rows.length;i++)
//            {
//                if(ds.Rows[i].media_big_title != "" && ds.Rows[i].media_big_title != null)
//                {
//                    inHTML +='<div class="MT_small_title" >'+ds.Rows[i].media_big_title+'</div>';
//                }
//            }
            for(var j=0;j<ds.Rows.length;j++)
            {
                inHTML += '<div class="MT_C_list"><img alt="邮购媒体" src="Image/list_ico0.jpg" /><a href="YGInfo_display.aspx?T_ID='+ds.Rows[j].ID+'" title="'+ds.Rows[j].title+'" target="_blank">'+ds.Rows[j].title.substring(0,14)+'</a></div>';
            }
            $('C_T_MT_list').innerHTML = inHTML; 
        }
    }
}
//二级社区介绍开始

//读取各区社区—2
function get_region_community_TWO()
{
    $('region_community_TWO').innerHTML = '<div class="loadingDiv">正在加载数据…</div>';
    Y_Control_Terminal_Main.get_Terminal_region(get_region_community_TWO_CallBack);
}
function get_region_community_TWO_CallBack(response)
{
    var ds = response.value;
    if(ds != null && typeof(ds) == "object")
    {
        if(ds.Rows.length > 0)
        {
            var inHTML ='';
            for(var i=0;i<ds.Rows.length;i++)
            {
                var adregion=ds.Rows[i].region;
                Wherestr="Where region = '"+adregion+"' and level=2";
                TopNum =" Top 1"
                var ad=Y_Control_Terminal_Main.get_community_byWherestr(Wherestr,TopNum).value;
                if(ad != null && typeof(ad) == "object")
                {
                    if(ad.Rows.length > 0)
                    {
                        for(var j=0;j<ad.Rows.length;j++)
                        {
                            inHTML += '<div class="Terminal_community_list"><div class="Terminal_community_title"><a href="Terminal_CommunityInfo.aspx?ID='+ad.Rows[j].ID+'" title="'+ad.Rows[j].name+'">'+ad.Rows[j].region+'</a></div><a href="Terminal_CommunityInfo.aspx?ID='+ad.Rows[j].ID+'" title="'+ad.Rows[j].name+'"><img alt="邮购终端—'+ad.Rows[j].name+'" class="community_img" src="M_image/'+ad.Rows[j].files+'.jpg" /></a></div>';
                        }  
                    }
                }
                
             } 
             inHTML += '<div class="clear"></div>'; 
             $('region_community_TWO').innerHTML = inHTML;       
        }
    }
}
//社区介绍—2
function get_community_info_TWO()
{
    Wherestr="Where info_set=1 and [level] = 2 ";
    TopNum ="Top 6"
    $('community_info_TWO').innerHTML = '<div class="loadingDiv">正在加载数据…</div>';
    Y_Control_Terminal_Main.get_community_byWherestr(Wherestr,TopNum,get_community_info_TWO_CallBack);
}
function get_community_info_TWO_CallBack(response)
{
    var ds = response.value;
    if(ds != null && typeof(ds) == "object")
    {
        if(ds.Rows.length > 0)
        {
            var inHTML ='';
            for(var i=0;i<ds.Rows.length;i++)
            {
                inHTML += '<div class="ZB_info_C"><a href="Terminal_CommunityInfo.aspx?ID='+ds.Rows[i].ID+'"  title="'+ds.Rows[i].name+'"><img alt="邮购社区介绍" src="M_image/'+ds.Rows[i].files+'.jpg" /></a><a href="Terminal_CommunityInfo.aspx?ID='+ds.Rows[i].ID+'" class="ZB_info_T" title="'+ds.Rows[i].name+'">'+ds.Rows[i].name.substring(0,10)+'</a></div>';
            }
            $('community_info_TWO').innerHTML = inHTML; 
        }
    }
}
//社区周边商业—2
function get_community_business_TWO()
{
    Wherestr="Where type = 5 and level = 2";
    TopNum ="Top 3"
    $('ZB_Business_TWO').innerHTML = '<div class="loadingDiv">正在加载数据…</div>';    
    Y_Control_Terminal_Main.get_community_other_info(Wherestr,TopNum,get_community_business_TWO_CallBack);
}
function get_community_business_TWO_CallBack(response)
{
    var ds = response.value;
    if(ds != null && typeof(ds) == "object")
    {
        if(ds.Rows.length > 0)
        {
            var inHTML ='';
            for(var i=0;i<ds.Rows.length;i++)
            {
                inHTML += '<div class="ZB_c_list"><a href="YGInfo_display.aspx?T_ID='+ds.Rows[i].ID+'" title="'+ds.Rows[i].title+'" target="_blank">'+ds.Rows[i].title.substring(0,11)+'</a><br />'+ds.Rows[i].content.substring(0,26)+'…</div>';
            }
            $('ZB_Business_TWO').innerHTML = inHTML; 
        }
    }
}
//社区推广度排名—2—1
function get_community_PM_TWO()
{
    Wherestr="Where [level] = 2 AND ranking=1";
    TopNum ="Top 3"
    $('community_PM_TWO').innerHTML = '<div class="loadingDiv">正在加载数据…</div>';    
    Y_Control_Terminal_Main.get_community_byWherestr(Wherestr,TopNum,get_community_PM_TWO_CallBack);
}
function get_community_PM_TWO_CallBack(response)
{
    var ds = response.value;
    if(ds != null && typeof(ds) == "object")
    {
        if(ds.Rows.length > 0)
        {
            var inHTML ='';
            for(var i=0;i<ds.Rows.length;i++)
            {
                inHTML += '<div class="PM_list"><img alt="推广排名" src="Image/terminal_fixedness_ico0.jpg" class="PM_ico_css" /><a href="Terminal_CommunityInfo.aspx?ID='+ds.Rows[i].ID+'" title="'+ds.Rows[i].name+'">'+ds.Rows[i].name.substring(0,9)+'</a></div><img src="Image/terminal_fixedness_arrowhead.jpg" class="RPM_ico_css" alt="邮购社区排名" />';
            }
            $('community_PM_TWO').innerHTML = inHTML; 
        }
        else
        {
            $('community_PM_TWO').innerHTML = ""
        } 
    }
}
//社区推广度排名—2—UP
function get_community_PM_UP_TWO()
{
    Wherestr="Where [level] = 2 AND ranking=2";
    TopNum ="Top 3"
    $('PM_UP_TWO').innerHTML = '<div class="loadingDiv">正在加载数据…</div>';    
    Y_Control_Terminal_Main.get_community_byWherestr(Wherestr,TopNum,get_community_PM_UP_TWO_CallBack);
}
function get_community_PM_UP_TWO_CallBack(response)
{
    var ds = response.value;
    if(ds != null && typeof(ds) == "object")
    {
        if(ds.Rows.length > 0)
        {
            var inHTML ='';
            for(var i=0;i<ds.Rows.length;i++)
            {
                inHTML += '<div class="PM_list"><img alt="推广排名" src="Image/terminal_fixedness_ico0.jpg" class="PM_ico_css" /><a href="Terminal_CommunityInfo.aspx?ID='+ds.Rows[i].ID+'" title="'+ds.Rows[i].name+'">'+ds.Rows[i].name.substring(0,9)+'</a></div><img src="Image/terminal_UP_arrowhead.jpg" class="RPM_ico_css" alt="邮购社区排名" />';
            }
            $('PM_UP_TWO').innerHTML = inHTML; 
        }
        else
        {
            $('PM_UP_TWO').innerHTML = ""
        } 
    }
}
//社区推广度排名—2—Down
function get_community_PM_Down_TWO()
{
    Wherestr="Where [level] = 2 AND ranking=3";
    TopNum ="Top 3"
    $('PM_DOWN_TWO').innerHTML = '<div class="loadingDiv">正在加载数据…</div>';    
    Y_Control_Terminal_Main.get_community_byWherestr(Wherestr,TopNum,get_community_PM_Down_TWO_CallBack);
}
function get_community_PM_Down_TWO_CallBack(response)
{
    var ds = response.value;
    if(ds != null && typeof(ds) == "object")
    {
        if(ds.Rows.length > 0)
        {
            var inHTML ='';
            for(var i=0;i<ds.Rows.length;i++)
            {
                inHTML += '<div class="PM_list"><img alt="推广排名" src="Image/terminal_fixedness_ico0.jpg" class="PM_ico_css" /><a href="Terminal_CommunityInfo.aspx?ID='+ds.Rows[i].ID+'" title="'+ds.Rows[i].name+'">'+ds.Rows[i].name.substring(0,9)+'</a></div><img src="Image/terminal_Down_arrowhead.jpg" class="RPM_ico_css" alt="邮购社区排名" />';
            }
            $('PM_DOWN_TWO').innerHTML = inHTML; 
        }
        else
        {
            $('PM_DOWN_TWO').innerHTML = ""
        } 
    }
}
//二级社区广告
function get_C_T_TWOAD()
{
    $('C_T_AD_TWO').innerHTML = '<div class="loadingDiv">正在加载数据…</div>'; 
    where_str='img_place =20 ';     
    Y_Control_Terminal_Main.get_C_T_AD(where_str,get_C_T_TWOAD_CallBack);
}
function get_C_T_TWOAD_CallBack(response)
{
    var ds = response.value;
    if(ds != null && typeof(ds) == "object")
    {
        if(ds.Rows.length > 0)
        {
            var inHTML ='';
            inHTML += '<a href="http://'+ds.Rows[0].link_Url+'" title="邮购" target="_blank"><img alt="邮购广告" src="AD_Img/'+ds.Rows[0].adimg_files+'" /></a>';
        }
        $('C_T_AD_TWO').innerHTML = inHTML; 
    }
}
//社区媒体资源—2
function get_community_MT_TWO()
{
    Wherestr="Where level = 2 AND type =6";
    TopNum ="Top 3"
    $('community_MT_TWO').innerHTML = '<div class="loadingDiv">正在加载数据…</div>';
    Y_Control_Terminal_Main.get_community_other_info(Wherestr,TopNum,get_community_MT_TWO_CallBack);
}
function get_community_MT_TWO_CallBack(response)
{
    var ds = response.value;
    if(ds != null && typeof(ds) == "object")
    {
        if(ds.Rows.length > 0)
        {
            var inHTML ='';
//            for(var i=0;i<ds.Rows.length;i++)
//            {
//                if(ds.Rows[i].media_big_title != "" && ds.Rows[i].media_big_title != null)
//                {
//                    inHTML +='<div class="MT_small_title" >'+ds.Rows[i].media_big_title+'</div>';
//                }
//            }
            for(var j=0;j<ds.Rows.length;j++)
            {
                inHTML += '<div class="MT_C_list"><img alt="邮购媒体" src="Image/list_ico0.jpg" /><a href="YGInfo_display.aspx?T_ID='+ds.Rows[j].ID+'" title="'+ds.Rows[j].title+'" target="_blank">'+ds.Rows[j].title.substring(0,14)+'</a></div>';
            }
            $('community_MT_TWO').innerHTML = inHTML; 
        }
    }
}

//三级社区介绍开始
//读取各区社区—3
function get_region_community_THREE()
{
    $('region_community_THREE').innerHTML = '<div class="loadingDiv">正在加载数据…</div>';
    Y_Control_Terminal_Main.get_Terminal_region(get_region_community_THREE_CallBack);
}
function get_region_community_THREE_CallBack(response)
{
    var ds = response.value;
    if(ds != null && typeof(ds) == "object")
    {
        if(ds.Rows.length > 0)
        {
            var inHTML ='';
            for(var i=0;i<ds.Rows.length;i++)
            {
                var adregion=ds.Rows[i].region;
                Wherestr="Where region = '"+adregion+"' and level= 3";
                TopNum ="Top 1"
                var ad=Y_Control_Terminal_Main.get_community_byWherestr(Wherestr,TopNum).value;
                if(ad != null && typeof(ad) == "object")
                {
                    if(ad.Rows.length > 0)
                    {
                        for(var j=0;j<ad.Rows.length;j++)
                        {
                            inHTML += '<div class="Terminal_community_list"><div class="Terminal_community_title"><a href="Terminal_CommunityInfo.aspx?ID='+ad.Rows[j].ID+'" title="'+ad.Rows[j].name+'">'+ad.Rows[j].region+'</a></div><a href="Terminal_CommunityInfo.aspx?ID='+ad.Rows[j].ID+'" title="'+ad.Rows[j].name+'"><img alt="邮购终端—'+ad.Rows[j].name+'" class="community_img" src="M_image/'+ad.Rows[j].files+'.jpg"  /></a></div>';
                        }  
                    }
                }
                
             } 
             inHTML += '<div class="clear"></div>'; 
             $('region_community_THREE').innerHTML = inHTML;       
        }
    }
}
//社区介绍—3
function get_community_info_THREE()
{
    Wherestr="Where info_set=1 and [level] = 3 ";
    TopNum ="Top 6"
    $('community_info_THREE').innerHTML = '<div class="loadingDiv">正在加载数据…</div>';
    Y_Control_Terminal_Main.get_community_byWherestr(Wherestr,TopNum,get_community_info_THREE_CallBack);
}
function get_community_info_THREE_CallBack(response)
{
    var ds = response.value;
    if(ds != null && typeof(ds) == "object")
    {
        if(ds.Rows.length > 0)
        {
            var inHTML ='';
            for(var i=0;i<ds.Rows.length;i++)
            {
                inHTML += '<div class="ZB_info_C"><a href="Terminal_CommunityInfo.aspx?ID='+ds.Rows[i].ID+'"  title="'+ds.Rows[i].name+'"><img alt="邮购社区介绍" src="M_image/'+ds.Rows[i].files+'.jpg" /></a><a href="Terminal_CommunityInfo.aspx?ID='+ds.Rows[i].ID+'" class="ZB_info_T" title="'+ds.Rows[i].name+'">'+ds.Rows[i].name.substring(0,10)+'</a></div>';
            }
            $('community_info_THREE').innerHTML = inHTML; 
        }
    }
}
//社区周边商业—3
function get_community_business_THREE()
{
    Wherestr="Where type = 5 and level = 3";
    TopNum ="Top 3"
    $('ZB_Business_THREE').innerHTML = '<div class="loadingDiv">正在加载数据…</div>';    
    Y_Control_Terminal_Main.get_community_other_info(Wherestr,TopNum,get_community_business_THREE_CallBack);
}
function get_community_business_THREE_CallBack(response)
{
    var ds = response.value;
    if(ds != null && typeof(ds) == "object")
    {
        if(ds.Rows.length > 0)
        {
            var inHTML ='';
            for(var i=0;i<ds.Rows.length;i++)
            {
                inHTML += '<div class="ZB_c_list"><a href="YGInfo_display.aspx?T_ID='+ds.Rows[i].ID+'" title="'+ds.Rows[i].title+'" target="_blank">'+ds.Rows[i].title.substring(0,11)+'</a><br />'+ds.Rows[i].content.substring(0,26)+'…</div>';
            }
            $('ZB_Business_THREE').innerHTML = inHTML; 
        }
    }
}
//社区推广度排名—3—1
function get_community_PM_THREE()
{
    Wherestr="Where [level] = 3 AND ranking=1";
    TopNum ="Top 3"
    $('community_PM_THREE').innerHTML = '<div class="loadingDiv">正在加载数据…</div>';    
    Y_Control_Terminal_Main.get_community_byWherestr(Wherestr,TopNum,get_community_PM_THREE_CallBack);
}
function get_community_PM_THREE_CallBack(response)
{
    var ds = response.value;
    if(ds != null && typeof(ds) == "object")
    {
        if(ds.Rows.length > 0)
        {
            var inHTML ='';
            for(var i=0;i<ds.Rows.length;i++)
            {
                inHTML += '<div class="PM_list"><img alt="推广排名" src="Image/terminal_fixedness_ico0.jpg" class="PM_ico_css" /><a href="Terminal_CommunityInfo.aspx?ID='+ds.Rows[i].ID+'" title="'+ds.Rows[i].name+'">'+ds.Rows[i].name.substring(0,9)+'</a></div><img src="Image/terminal_fixedness_arrowhead.jpg" class="RPM_ico_css" alt="邮购社区排名" />';
            }
            $('community_PM_THREE').innerHTML = inHTML;
        }
        else
        {
            $('community_PM_THREE').innerHTML = ""
        }         
    }
}
//社区推广度排名—3—UP
function get_community_PM_UP_THREE()
{
    Wherestr="Where [level] = 3 AND ranking=2";
    TopNum ="Top 3"
    $('PM_UP_THREE').innerHTML = '<div class="loadingDiv">正在加载数据…</div>';    
    Y_Control_Terminal_Main.get_community_byWherestr(Wherestr,TopNum,get_community_PM_UP_THREE_CallBack);
}
function get_community_PM_UP_THREE_CallBack(response)
{
    var ds = response.value;
    if(ds != null && typeof(ds) == "object")
    {
        if(ds.Rows.length > 0)
        {
            var inHTML ='';
            for(var i=0;i<ds.Rows.length;i++)
            {
                inHTML += '<div class="PM_list"><img alt="推广排名" src="Image/terminal_fixedness_ico0.jpg" class="PM_ico_css" /><a href="Terminal_CommunityInfo.aspx?ID='+ds.Rows[i].ID+'" title="'+ds.Rows[i].name+'">'+ds.Rows[i].name.substring(0,9)+'</a></div><img src="Image/terminal_UP_arrowhead.jpg" class="RPM_ico_css" alt="邮购社区排名" />';
            }
            $('PM_UP_THREE').innerHTML = inHTML;             
        }   
        else
        {
            $('PM_UP_THREE').innerHTML = ""
        }         
    }
}
//社区推广度排名—3—Down
function get_community_PM_Down_THREE()
{
    Wherestr="Where [level] = 3 AND ranking=3";
    TopNum ="Top 3"
    $('PM_DOWN_THREE').innerHTML = '<div class="loadingDiv">正在加载数据…</div>';    
    Y_Control_Terminal_Main.get_community_byWherestr(Wherestr,TopNum,get_community_PM_Down_THREE_CallBack);
}
function get_community_PM_Down_THREE_CallBack(response)
{
    var ds = response.value;
    if(ds != null && typeof(ds) == "object")
    {
        if(ds.Rows.length > 0)
        {
            var inHTML ='';
            for(var i=0;i<ds.Rows.length;i++)
            {
                inHTML += '<div class="PM_list"><img alt="推广排名" src="Image/terminal_fixedness_ico0.jpg" class="PM_ico_css" /><a href="Terminal_CommunityInfo.aspx?ID='+ds.Rows[i].ID+'" title="'+ds.Rows[i].name+'">'+ds.Rows[i].name.substring(0,9)+'</a></div><img src="Image/terminal_Down_arrowhead.jpg" class="RPM_ico_css" alt="邮购社区排名" />';
            }
            $('PM_DOWN_THREE').innerHTML = inHTML;             
        }
        else
        {
            $('PM_DOWN_THREE').innerHTML = ""
        }        
    }
}
//三级社区广告
function get_C_T_THREEAD()
{
    $('C_T_AD_THREE').innerHTML = '<div class="loadingDiv">正在加载数据…</div>';  
    where_str='img_place =21 ';    
    Y_Control_Terminal_Main.get_C_T_AD(where_str,get_C_T_THREEAD_CallBack);
}
function get_C_T_THREEAD_CallBack(response)
{
    var ds = response.value;
    if(ds != null && typeof(ds) == "object")
    {
        if(ds.Rows.length > 0)
        {
            var inHTML ='';
            inHTML += '<a href="http://'+ds.Rows[0].link_Url+'" title="邮购" target="_blank"><img alt="邮购广告" src="AD_Img/'+ds.Rows[0].adimg_files+'" /></a>';
            $('C_T_AD_THREE').innerHTML = inHTML;   
        }
        else
        {
            $('C_T_AD_THREE').innerHTML = "";   
        }
       
    }
}
//提交终端资源共享信息
function Join_T_c_Wealth()
{
    var tcw_s1 = $F('s1');
    var tcw_s2 = $F('s2');
    var tcw_username = $F('username');
    var tcw_tel = $F('tel');
    var tcw_T_C_info = $F('T_C_info');
    if(tcw_s1 != "")
    {
        if(tcw_username.length >=2 && JSC_SpecChar(tcw_username))
        {
            if(JSC_checkSum(tcw_tel) && tcw_tel.length >= 8)
            {
                if(tcw_T_C_info.length >= 10 && tcw_T_C_info.length<=200)
                {
                    if(JSC_IsSafeString(tcw_T_C_info))
                    {
                        var wealth_soft=''+tcw_s1+'→'+tcw_s2+'';
                        Y_Control_Terminal_Main.Inster_T_C_Wealth(tcw_username,tcw_tel,wealth_soft,tcw_T_C_info)
                        alert("信息提交成功，\n 我们会及时与您联系 \n 感谢您对我们项目的支持！");
                        location.reload();
                    }
                    else
                    {
                        alert("简介输入有误（含有不安全代码）\n 请重新输入");
                        $('T_C_info').focus();
                    }  
                }
                else
                {
                    alert("输入简介过多或少，请重新输入！");
                    $('T_C_info').focus();
                }
            }
            else
            {
                alert("您输入的电话号不正确，请重新输入！");
                $('tel').focus(); 
            }
        }
        else
        {
            alert("用户名填写不正确，请重新输入！");
            $('username').focus();
        }
        
    }
    else
    {
        alert("请选择资源分类！");
        $('s1').focus(); 
    }
}