sdate=new Date();
smonth=sdate.getMonth()+1;
sday=sdate.getDate();
syear=sdate.getYear();
var spanStr2;
spanStr2=" ";
spanStr2+="<table width='210' border='0' cellspacing='1' cellpadding='3' align='center' style='font-size:12px;'>";
spanStr2+="<tr>";
spanStr2+="<td width='30'>日</td>";
spanStr2+="<td width='30'>一</td>";
spanStr2+="<td width='30'>二</td>";
spanStr2+="<td width='30'>三</td>";
spanStr2+="<td width='30'>四</td>";
spanStr2+="<td width='30'>五</td>";
spanStr2+="<td width='30'>六</td>";
spanStr2+="</tr>";
function change(){
  var firstDay;
  var year,month,isMyear,totalDay,today,spanStr,todayStr;
  year=my_getbyid("years").value;
  month=my_getbyid("months").value;
  if(month==""||year=="") return;
  if(month==2){
    if(((year%100!=0)&&(year%4==0))||year%400==0) totalDay=29;
	else totalDay=28;
  }else if(month==4||month==6||month==9||month==11){
    totalDay=30;
  }else{totalDay=31;}
  nowDate=new Date(year,month-1,1);
  firstDay=nowDate.getDay();
  spanStr=spanStr2;
  today=0;
  for(i=1;i<=42;i++){
    if(i%7==1) spanStr+="<tr>";
    if(i<=(firstDay)||today>=totalDay){ 
	   spanStr+="<td>&nbsp;</td>\n";
       continue;   
	}
    today++;
    if(today<10)
	  todayStr="0"+today;
	else
	  todayStr=today;
     spanStr+="<td><a href=other/diary/list.html?AddTime="+year+"-"+month+"-"+today+" target=_blank>"+todayStr+"</a></td>";
	if(parseInt(todayStr)>=31 && i>=parseInt(todayStr)) break;
 }
spanStr+="</tr>";
spanStr+="</table>";
my_getbyid("calendar").innerHTML=spanStr; 
}

function loadinit()
{
	loadpublic();
	loadistop();
	loadbook();
	list_t(1);
	load_tuser();
	}

function loadpublic()
{
	var ajaxobj=new AJAXRequest;
	ajaxobj.method="POST"; 
	ajaxobj.url="/httpreq/diary.asp?action=list&MaxTop=8&&Maxpage=15&Order=0&skin=0&page=1&IsPrivate=0";
	ajaxobj.callback=function(xmlobj) {
		var response = xmlobj.responseText.split("$$");
		document.getElementById("list1").innerHTML =response[0];
		}
	ajaxobj.send();
}
function loadistop()
{var ajaxobj=new AJAXRequest;
	ajaxobj.method="POST"; 
	ajaxobj.url="/httpreq/diary.asp?action=list&MaxTop=8&Maxpage=15&Order=0&skin=0&page=1&IsTop=1";
	ajaxobj.callback=function(xmlobj) {
		var response = xmlobj.responseText.split("$$");
		document.getElementById("list2").innerHTML =response[0];
		}
	ajaxobj.send();
	}
function loadbook()
{
	var ajaxobj=new AJAXRequest;
	ajaxobj.method="POST"; 
	ajaxobj.url="/httpreq/diary.asp?action=blist&MaxTop=8";
	//Att:0公开,1推荐
	ajaxobj.callback=function(xmlobj) {
		var response = xmlobj.responseText;
		document.getElementById("list3").innerHTML =response;
	}
	ajaxobj.send();
}
function list_t(t)
{
	var ajaxobj=new AJAXRequest;
	ajaxobj.method="POST"; 
	ajaxobj.url="/httpreq/diary.asp?action=list&MaxTop=15&Maxpage=15&Order=0&skin=1&TypeID="+escape(t)+"&Page=1";
	//Att:0公开,1推荐
	ajaxobj.callback=function(xmlobj) {
		var response = xmlobj.responseText.split("$$");
		document.getElementById("list").innerHTML =response[0];
	}
	ajaxobj.send();
}
function load_tuser(){
	var ajaxobj=new AJAXRequest;
	ajaxobj.method="POST"; 
	ajaxobj.url="/httpreq/diary.asp?action=topuser";
	//Att:0公开,1推荐
	ajaxobj.callback=function(xmlobj) {
		var response = xmlobj.responseText.split("$$");
		document.getElementById("topimg").innerHTML =response[0];
		document.getElementById("name").innerHTML =response[1];
		document.getElementById("title").innerHTML =response[2];
		document.getElementById("cont").innerHTML =response[3];
	}
	ajaxobj.send();
}