
//网站的路径
var ajaxUrl = "../cn/";

//$(function(){
//    sendProduct($("#KeyWord1"),"5");
//    sendProduct($("#KeyWord2"), "25");
//})

//提交数据
function sendNews(obj, key)
{
    if (typeof (key) != undefined && key != null && key != "") {
        $.ajax({
          url: ajaxUrl + "getnews.ashx",
          data: "key=" + escape(key),
          dataType: "html",
          success: function(data){
            obj.html(data); //AJAX请求成功时显示数据
          },
          error:function(xhr){obj.html("Error:"+xhr.status);}
        });
    }
    else{
         obj.html("&nbsp");
    }
}
function NextNews(obj, id,typeid)
{
    if (typeof (id) != undefined && id != null && id != "") {
        $.ajax({
          url: ajaxUrl + "getnews.ashx",
          data: "id=" + escape(id)+"&typeid="+typeid,
          dataType: "html",
          success: function(data){
            obj.html(data); //AJAX请求成功时显示数据
          },
          error:function(xhr){obj.html("Error:"+xhr.status);}
        });
    }
    else{
         obj.html("&nbsp");
    }
}
function NextNewsAspx(obj, id, typeid) {
    if (typeof (id) != undefined && id != null && id != "") {
        $.ajax({
            url: ajaxUrl + "getnewsaspx.ashx",
            data: "id=" + escape(id) + "&typeid=" + typeid,
            dataType: "html",
            success: function(data) {
                obj.html(data); //AJAX请求成功时显示数据
            },
            error: function(xhr) { obj.html("Error:" + xhr.status); }
        });
    }
    else {
        obj.html("&nbsp");
    }
}