﻿//将所有script代码整合链接
var mainPath = "";
var mainlink = "MainLink.js";
var head = document.getElementsByTagName("head")[0];
var nodes = head.childNodes;
for (var i = 0; i < nodes.length; ++i) {
    var src = nodes.item(i).src;
    if (src) {
        var index = src.indexOf(mainlink);
        if (index >= 0) {
            mainPath = src.substring(0, index);

        }
    }
}


IncludeJavaScript(mainPath + "ajaxpro/prototype.ashx");
IncludeJavaScript(mainPath + "ajaxpro/core.ashx");
IncludeJavaScript(mainPath + "ajaxpro/converter.ashx");
IncludeJavaScript(mainPath + "/ajaxpro/TopeveryCMS,Topevery.CMS.Web.ashx");

function IncludeJavaScript(path) {
    document.write("<script language='javascript' type='text/javascript' src='" + path + "'></script>");
    document.write("<script type='text/javascript' language='javascript' src='/Javascript/jquery-1.2.1.js'></script>");

}

function selectSearch() {
    var keyword = document.getElementById("textfield").value;
    var url = encodeURI("/action/search.aspx?search_key=" + keyword);
    window.open(url);
}

//计数器
function GetCount() {
    TopeveryCMS.GetCount
       (function(res) {
           document.getElementById("sp_divCount").innerHTML = res.value;
       });
}


//首页结果公示  
function GetScroll() {
    TopeveryCMS.GetInfoCount(12, 1, function(res) {
        document.getElementById("auditInfolist").innerHTML = res.value;
        $("#imgauditInfolist").hide();

    });
}

//网上办事结果公示  
function GetWSBSScroll() {
    TopeveryCMS.GetInfoCount(5, 0, function(res) {
        document.getElementById("auditInfolist").innerHTML = res.value;
        $("#imgauditInfolist").hide();

    });
}

function GetHtml(link) {
    $.get(link, function(data) {
        var url = $($("embed", data)).attr("src");
        $("#divHtml").html(url);
        $("#myPlayer").attr("URL", url);

        //$("#myPlayer").Play();
    }
        );

}

//工作简报
function getDrop(recordCount) {

    if (typeof (recordCount) == 'undefined') {
        recordCount = 10;
    }
    TopeveryCMS.getDrop(recordCount, function(res) {
        if (res != null) {
            document.getElementById("publicworkshow").innerHTML = res.value;
            $("#imgpublicworkshow").hide();
        }
    });

}

//得到行政审批今日办结，申请条数
function GetCkbwFile() {
    TopeveryCMS.CountDateCkbwFile(function(res) {
        document.getElementById("xzspCountDiv").innerHTML = res.value;
    });

}

//杂志封面
function getIMG() {


    TopeveryCMS.getIMG(function(res) {

        if (res != null) {
            document.getElementById("imgInfo").innerHTML = res.value;
            $("#imgimgInfo").hide();
        }
    });

}


function GetNewTalkInfo() {
    TopeveryCMS.GetNewTalk(function(res) {
        //        $("#ftTitle").html(res.FtTitle);
        //        $("#jddw").html(res.Jddw);
        //        $("#jb").html(res.Jb);
        //        $("#ftTime").html(res.FtTime);
        //        $("#ftSummay").html(res.FtSummary);
        //        $("#TwHref").url(res.TwHref);
        //        $("#ftCome").url(res.FtCome);            
    });
}
//杂志栏目
function getCategory() {
    TopeveryCMS.getCategory(function(res) {
        if (res != null) {
            document.getElementById("cateInfo").innerHTML = res.value;
            $("#imgcateInfo").hide();
        }
    });

}
//杂志最新两期
function getPeriodical() {
    TopeveryCMS.getPeriodical(function(res) {
        if (res != null) {
            document.getElementById("periodical").innerHTML = res.value;
            $("#imgperiodical").hide();
        }
    });

}

function GetWeather() {
    TopeveryCMS.GetWeather(function(res) {
        if (res != null) {
            //document.getElementById("spn_weathermsg").innerHTML =res.value.WeatherImg+ res.value.WeatherMsg;
        }
    });
}

function GetAppraise(){
    TopeveryCMS.GetAppraise(function(res){
    
       document.getElementById("slaj").innerHTML=res.value.Received_count;
       document.getElementById("yjaj").innerHTML=res.value.Should_finished_count;
       document.getElementById("jasl").innerHTML=res.value.Should_finished_and_finished_count;
       document.getElementById("jal").innerHTML=res.value.Finished_rate;
       
    });
}

function openMagazine(url) {
    window.open(url, "", "height=768,width=1024,toolbar=no,location=no,directories=no,menubar=no,scrollbars=no,resizable=yes,status=no,top=0,left=0");
}



