

function writeWhatsnewMenu(){
	var month = 0;
	var year = 2012;
	var list_item
	if (month < 0)  {  
		month = 12 +  month;
		year = year - 1;
	}
	var shortmonth = new Array ("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
	document.write ("<LABEL For=\'sel_whatsIdx\' style=\'display:none\'>阅览资料库</LABEL>");
	document.write ("<SELECT NAME=\'sel_whatsIdx\' id=\'sel_whatsIdx\' onChange=\'whatsNew_gotoIndex(this)\'>");
	document.write ("<OPTION VALUE=\'\'>阅览资料库</OPTION>");
	ry = year;
	for (i = 0; i<12; i++) {
		rm = month - i;
		if (rm < 0) {
			rm = 12 + (month - i);
			ry = year - 1;
		}
		list_item = "<OPTION VALUE='"+shortmonth[rm]+"_"+ry+".html'>"+ry+" 年 "+(rm+1)+" 月</OPTION>";
		document.write (list_item);
	}
	document.write ("<OPTION VALUE=\'main.html\'>阅览整个资料库</OPTION>");
	document.write ("</SELECT>");
}

function whatsNew_gotoIndex(obj) {
	var url = String(window.location);
	var filepart = obj.options[obj.selectedIndex].value;
	if (filepart =="") return;
	obj.options[0].selected = true;
	if ( url.indexOf("/en/") >= 0 ) {
		window.location = "http://gbcode.ofta.gov.hk/TuniS/www.ofta.gov.hk/en/whats_new/archives/" + filepart; 
	} else {
		window.location = "http://gbcode.ofta.gov.hk/TuniS/www.ofta.gov.hk/zh/whats_new/archives/" + filepart; 
	}
}

document.jsWhatsNew_Loaded = true;

