var dataurl2='news14/data2',dataurl1='news14/data1';
var ajaxdata=null,ajaxdata1=null; 
getData = function(params) {
	var defaults = {
		page: 1,
		stockCode: "",
		title: "",
		ctime: 1,
		orgid: "",
		orders: "1",
		url: "",
		sid: "1",
		ps: 20
	}
	var url = $("#httphost").val();
	var params = $.extend(defaults, params);
  	$.ajax({
		type: "get",
		url: httphost+dataurl2,
		dataType: "jsonp",
		success: function(json) {
			if (json.list.length > 0) {
				var dd = [];
				for (var i = 0; i < json.list.length; i++) {
					dd.push("<li style=\"cursor:pointer;\" tid=\"" + json.list[i].id +"|"+json.list[i].sid+ "\">");
					//dd.push('<div class="dian">.</div>');
					dd.push('<div class="leibie">[',json.list[i].stitle.substr(0,2),']</div>');
					dd.push('<div class="title">',json.list[i].title,'</div>');
					dd.push('<div class="time">',json.list[i].createtime.substr(11,5),'</div>');
					dd.push("</li>");
				}
				$("#listright").html(dd.join("")).show();
				$("li",$("#listright")).hover(function(){
					$(this).css({"background-color":"#28292E"});
				},function(){
					$(this).css({"background-color":"#000000"});	
				});
				$("#listright").find("li").bind("click",
				function() { 
					wkstock.openUrl(external.getModulePath()+'zgl/zixun/content.html?tid='+$(this).attr("tid"));
				});
			} else
			 {
//				$("#list").find("tbody").html("<tr><td colspan=\"2\" >\u6ca1\u6709\u5173\u4e8e\u76f8\u5173\u4e2a\u80a1\u7684\u8d44\u8baf</td></tr>").show();
//				$("#fenye").hide();
			}
		},
		error: function() {
		}
	}); 
	return false;
}; 


getData1 = function(params) {
	var defaults = {
		page: 1,
		stockCode: "",
		title: "",
		ctime: 1,
		orgid: "",
		orders: "1",
		url: "",
		sid: "1",
		ps: 20
	}
	var url = $("#httphost").val();
	var params = $.extend(defaults, params);
  	$.ajax({
		type: "get",
		url: httphost+dataurl1,
		dataType: "jsonp",
		success: function(json) {
			if (json.list.length > 0) {
				var dd = [];
				for (var i = 0; i < json.list.length; i++) {
					dd.push("<li style=\"cursor:pointer;\" tid=\"" + json.list[i].id +"|"+json.list[i].sid+ "\">");
					//dd.push('<div class="dian">.</div>');
					dd.push('<div class="title">',json.list[i].title,'</div>');
					dd.push('<div class="time">',json.list[i].createtime.substr(11,5),'</div>');
					dd.push("</li>");
				}
				$("#listleft").html(dd.join("")).show();
				$("li",$("#listleft")).hover(function(){
					$(this).css({"background-color":"#28292E"});
				},function(){
					$(this).css({"background-color":"#000000"});	
				});
				$("#listleft").find("li").bind("click",
				function() { 
					wkstock.openUrl(external.getModulePath()+'zgl/zixun/content.html?tid='+$(this).attr("tid"));
				});
			} else
			 {
//				$("#list").find("tbody").html("<tr><td colspan=\"2\" >\u6ca1\u6709\u5173\u4e8e\u76f8\u5173\u4e2a\u80a1\u7684\u8d44\u8baf</td></tr>").show();
//				$("#fenye").hide();
			}
		},
		error: function() {
		}
	});
	return false;
}; 
$(function(){  
	wkstock.opentype=1;
	getData1();
	getData();
});