﻿// JScript source code
        /// <summary>
        ///获取新闻列表
        /// </summary>
        /// <param name="url">调用页面url</param>
        /// <param name="idload">加载动画ID</param>
        /// <param name="idshow">显示的ID</param>
        /// <param name="imageurl">动画路径</param>
        /// <returns>void</returns>
	function getnewslist(url,idload,idshow,imageurl)
	 {
		$("document").ready(function(){
			 $.ajax({
			   type: "get",
			   url: url,
			   beforeSend: function(XMLHttpRequest){
			        $("#"+idshow).hide();
					$("<img src='"+imageurl+"' alt=\"loading..\" />")
					    .insertAfter( $("#"+idload))
						.fadeIn('slow')
						.animate({opacity: 1.0}, 1000)
						.fadeOut('slow', function() {
						  $(this).remove();
						  $("#"+idshow).show();
						});
			   },
			   success: function(data, textStatus){
					$("#"+idshow).html(data);
			   },
			   error: function(){
			         $("#"+idshow).html("数据加载失败!");
					//请求出错处理
			   }
			 });
		 });

}

function getnews(url, idshow) {
    $("#" + idshow).html("<img src='http://www.gyyx.cn/stage_images/loading.gif' alt=\"loading..\" />");
    setTimeout(function() {
    $.getJSON(url + "&jsoncallback=?", function(data) {
    $("#" + idshow).html(data.message);
        })
    }, 20)
}
