function Month_link(targ,sel0bj,restore){ 
	eval(targ+".location='"+sel0bj.options[sel0bj.selectedIndex].value+"'");
	if (restore) sel0bj.selectedIndex=0;
}

function GetArchiveList(start_year, start_month) {
	var now=new Date();
	var now_year=now.getFullYear();
	var now_month=now.getMonth()+1;
	var jumpfunc = 'Month_link(\'parent\',this,1)';

	if (start_year < 2003 || start_year > now_year) {
		document.write("Parameter Error: start_year\n");
		return;
	}
	if (start_month < 1 || start_month > 12) {
		document.write("Parameter Error: start_month\n");
		return;
	}
	
	document.write('<div class="sidetitle">月別アーカイブ</div>'+"\n");
	document.write('<div class="side">'+"\n");
	document.write('<form name="marchives" id="marchives" method="get" action="'+document.URL+'">'+"\n");
	document.write('<select name="marchlist" id="marchlist" onchange="'+jumpfunc+'">'+"\n");
	document.write("<option value=\"\">選択してください</option>\n");
	for (i=now_year; i>=start_year; i--) {
		for (j=12; j>=1; j--) {
			if (i==now_year && j>now_month) continue;
			if (i==start_year && j<start_month) break;
			mstr="0"+j;
			mstr=mstr.substring(mstr.length-2);
			dpage="/d" + i + "-" + mstr + ".html";
			document.write("<option value=\""+dpage+"\">"+i+"年"+mstr+"月</option>\n");
		}
	}
	document.write("</select>\n</form>\n");
	document.write("</div>\n");
}
