﻿//将所有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>");
	 //document.write("<script type='text/javascript' language='javascript' src='Javascript/json.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 GetBigItemList(divid) {
       TopeveryCMS.GetBigItemList
       (function(res) {
       document.getElementById(divid).innerHTML = res.value;
       });
   }
  

//审批结果公示  
function GetScroll(divid,count){
    TopeveryCMS.GetInfoCount(count, function(res) {
    document.getElementById(divid).innerHTML = res.value;
       // $("#imgauditInfolist").hide();
    spResultShow();
    });
}
//文章点击次数
function getArticleClickCount(id,articleid) {

    TopeveryCMS.GetArticleClickCount(articleid, function(res) {
    document.getElementById(id).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();
        }
        );    
		
}

//所有简报  id  绑定的div  type 2 城管简报  ，9数字城管简报,10提升行动简报,8 深圳市梳理行动纪实  count 数量
function getMagazineList(id, type, count) {
    
      if(typeof(count)== 'undefined')
      {
	      count = 10;
	  }
      
      TopeveryCMS.getMagazineList(type,count, function(res) {
      if (res.value != null) {
           
              document.getElementById(id).innerHTML = res.value;
          }
      });
  }
 
  //图片
  function getPictrueList(recordCount,type) {
      if (typeof (recordCount) == 'undefined') {
          recordCount = 10;
      }
      TopeveryCMS.getPictrueList(recordCount,type, function(res) {
          if (res.value != null) {
              document.getElementById("pictrue").innerHTML = res.value;
             picGalleryShow();  // 首页面图片库滚动js
          }
      });

  }
  // 所有公共服务    id  绑定的div     type 1通知公告，2相关文件，3相关下载,4 不知道 ,5 常见问题   Count 多少个  
  function getPublicList(id,type,count) {
      if (typeof (count) == 'undefined') {
          count = 10;
      }
      TopeveryCMS.getPublicList(type, count, function(res) {
      if (res.value != null) 
          {
              document.getElementById(id).innerHTML = res.value;
          }
      });

  }

  // 所有常见问题
  function getQuestionList(id, cateid, count) {
      if (typeof (count) == 'undefined') {
          count = 10;
      }
      TopeveryCMS.getQuestionList(cateid, count, function(res) {
          if (res.value != null) {
              document.getElementById(id).innerHTML = res.value;
          }
      });

  }
 

  
    
       //得到行政审批今日办结，申请条数
  function GetCkbwFile(){
    TopeveryCMS.CountDateCkbwFile(function(res){
        document.getElementById("xzspCountDiv").innerHTML = res.value;      
    });
  
  }
    
      //杂志封面
 function getIMG()
 {


     TopeveryCMS.getIMG(function(res) {

         if (res.value!= null) {
             document.getElementById("imgInfo").innerHTML = res.value;
             $("#imgimgInfo").hide();
         }
     });

 }
 
 
 function GetNewTalkInfo(){ 
    TopeveryCMS.GetNewTalk(function(res){
//        $("#ftTitle").html(res.value.FtTitle);
//        $("#jddw").html(res.value.Jddw);
//        $("#jb").html(res.value.Jb);
//        $("#ftTime").html(res.value.FtTime);
//        $("#ftSummay").html(res.value.FtSummary);
//        $("#TwHref").url(res.value.TwHref);
//        $("#ftCome").url(res.value.FtCome);            
    });
}
  //杂志栏目
 function getCategory()
 {
     TopeveryCMS.getCategory(function(res) {
     if (res.value != null) {
             document.getElementById("cateInfo").innerHTML = res.value;
             $("#imgcateInfo").hide();
         }
     });
 
 }
  //杂志最新两期
 function getPeriodical()
 {
     TopeveryCMS.getPeriodical(function(res) {
     if (res.value != null) {
             document.getElementById("periodical").innerHTML = res.value;
             $("#imgperiodical").hide();
         }
     });

 }
 
  function GetWeather(city){
    TopeveryCMS.GetWeather(city,function(res){
    if (res.value != null) {
            document.getElementById("spn_weathermsg").innerHTML =res.value.WeatherMsg;
        }
    });
 }
 
 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"); 
}
//投诉受理
function getComplain(count) {
    TopeveryCMS.getComplain(count ,function(res) {
    if (res.value != null) {
            document.getElementById("rollText").innerHTML = res.value;
        }
    });

}
//投诉受理
function getQuestion(count) {
    TopeveryCMS.getQuestion(count, function(res) {
    if (res.value != null) {
            document.getElementById("questionlist").innerHTML = res.value;
        }
    });
}
    
    //投诉受理
function getprogramlist(pname ,count,juge) {
    TopeveryCMS.getProgramList(pname,count, juge, function(res) {
    if (res.value != null) {
            document.getElementById("programlist").innerHTML = res.value;
        }
    });

}


