﻿hrlist=function(obj)
{
    jQuery.ajaxSetup({cache:false});
               
    hrlist.obj=obj;
    hrlist.obj.method=obj.method||'hrlist';
    hrlist.obj.index=obj.index||1;
    hrlist.obj.size=obj.size||5;
//    hrlist.obj.objuin=Request.QueryString('uin');;
//    hrlist.uin=Request.QueryString('uin');//document.getElementById('hiduin').value;
//    hrlist.pwd=Request.QueryString('pwd');
    hrlist.url=obj.url||'fronthomejson.aspx';
    hrlist.load({index:1});
}
hrlist.load=function(obj)
{
     hrlist.obj.index=obj.index;
     hrlist.obj.size=obj.size;
     jQuery.ajax({
				  type:"GET",
				  url:hrlist.url,
				  dataType:"json",
				  //data:{method:'orderdesk',starttime:obj.starttime,endtime:obj.endtime,mobile:obj.mobile,cardnumber:obj.cardnumber,ispayd:'1',index:obj.index,size:obj.size},
				  data:hrlist.obj,
				  global:false, 
				  //timeout:100,
				   success: function(json){						
				    hrlist.store=json;			
					hrlist.data=hrlist.store[1].Data;					
					hrlist.Total=hrlist.store[0].TotalCount;					
					hrlist.load_html_start({});					
				   },
				   error:function(xmlHttpRequest,textStatus, errorThrown)
				   {
				        //alert(xmlHttpRequest.responseText);
				   }
				});
}
hrlist.obj={};
hrlist.data=[];
hrlist.store=[];
hrlist.Total=0;
hrlist.content="";
//hrlist.uin=document.getElementById('hiduin').value;
//hrlist.pwd=document.getElementById('hidpwd').value;
hrlist.make_content_list=function(obj)
{    
    var html='';
    html='<li><span>2009-07-20</span><a href="#">英国17岁少年谎称办航空公司险些骗得飞机hr</a></li>';
   return html;         
}
hrlist.make_content_title=function(obj)
{
var html='';
html='<h3><span><a href="list.aspx">更多+</a></span><img src="greenimg/righttitimg.gif" alt="我的HR"  /></h3>';
return html;
}

hrlist.load_html_start=function(obj)
{	
	var total_item=hrlist.obj.size;
	var length=hrlist.Total;//Mobile_search_content_array.length;
	var total_page=Math.ceil(hrlist.Total/total_item);
	var begin=0;//(page-1)*total_item;
	var end=hrlist.data.length;//page*total_item;	
	this.message_obj={};
        this.message_obj.index=obj.index;
        this.message_obj.total_page=total_page;
        this.message_obj.size=hrlist.obj.size;
        this.message_obj.total=hrlist.Total;
        this.message_obj.page=obj.index;   
        hrlist.content="";  
	var buf=[];
//	buf.push(hrlist.make_content_title());
	hrlist.content+=hrlist.make_content_title();
	hrlist.content+='<ul class="myList" id="ulMyList">';
	  for(var i=0;i<end;i++){
		      if((i>=begin)&&(i<end)){
//			    buf.push(hrlist.make_content_list(hrlist.data[i]));
			    hrlist.content+=hrlist.make_content_list(hrlist.data[i]);  
		      }
	    }
	hrlist.content+="</ul>";
//	    hrlist.content=buf.join("");
//	 jQuery("#myKJbox").html(buf.join(""));
//	 jQuery("#page_list").html(hrlist.make_content_footer(this.message_obj));
	 
}
//hrlist.appply=function()
//{
//    location.href='applyadd.aspx?uin='+hrlist.uin+'&pwd='+hrlist.pwd;
//}
