function onMonthChange(selmonth, selday, selyear) { var selDay = document.getElementById(selday); var selMonth = document.getElementById(selmonth); var selYear = document.getElementById(selyear); var v = selMonth.value; if (selDay.options[29 - 1] == null) { var varItem = new Option(29, 29); selDay.options.add(varItem); } if (selDay.options[30 - 1] == null) { var varItem = new Option(30, 30); selDay.options.add(varItem); } if (v == 1 || v == 3 || v == 5 || v == 7 || v == 8 || v == 10 || v == 12) { if (selDay.options[31 - 1] == null) { var varItem = new Option(31, 31); selDay.options.add(varItem); } } else if (v == 4 || v == 6 || v == 9 || v == 11) { if (selDay.options[31 - 1] != null) { selDay.options[31 - 1] = null; } } else if (v == 2) { if (selDay.options[31 - 1] != null) { selDay.options[31 - 1] = null; } if (selDay.options[30 - 1] != null) { selDay.options[30 - 1] = null; } if (selDay.options[29 - 1] != null) { vv = selYear.value; if ((vv % 4 == 0 && vv % 100 != 0) || vv % 400 == 0) {} else { selDay.options[29 - 1] = null; } } } } function lunchstr() { var reval = "
" + "
" + "Gregorian" + "- Chinese Calendar Converter" + "
" + "
" + "

" + "

" + "

" + "" + "
" + "
" + "

Gregorian date:

" + "

Chinese lunar calendar date:

" + "

Chinese zodiac sign:

" + "
" + "
"; return reval; } $(function() { if (typeof citsLoad != 'undefined') { try { citsLoad.css(['//data.chinahighlights.com/css/lunarcalendar.css']); citsLoad.js(['//data.chinahighlights.com/js/Lunarcalendar.js']); } catch (e) { } } var str_LC = lunchstr(); $('#thelcbox').append(str_LC); var myDate = new Date(); var dayoption = ''; for (var i = 1; i <= 31; i++) { dayoption += '