
var dataurl='news14/data2';
var ajaxdata=null; 
function difdate($d){
	return Math.abs(new Date($d.replace(/-/g,'/')) - new Date())/(1000*60*60*24);
} 
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+dataurl+'/'+params.sid,
		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)=='±±ÉÌ'?'´ó×Ú':json.list[i].stitle.substr(0,2),']</div>');
					dd.push('<div class="title">',json.list[i].title,'</div>');
					dd.push('<div class="time">',difdate(json.list[i].createtime)>1?json.list[i].createtime.substr(5,5):json.list[i].createtime.substr(11,5),'</div>');
					dd.push("</li>");
				}
				$("#list").html(dd.join("")).show();
				$("li",$("#list")).hover(function(){
					$(this).css({"background-color":"#28292E"});
				},function(){
					$(this).css({"background-color":"#000000"});	
				});
				$("#list").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;
	 getData({sid:wkstock._GET("sid")});
	
});