<input type="text" name="" id="" value="">
<script type="text/javascript">
/*
[Discuz!] (C)2001-2099 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: common_extra.js 35188 2015-01-19 04:22:32Z nemohou $
*/
function _showselect(obj, inpid, t, rettype) {
var showselect_row = function (inpid, s, v, notime, rettype) {
if(v >= 0) {
if(!rettype) {
var notime = !notime ? 0 : 1;
var t = today.getTime();
t += 86400000 * v;
var d = new Date();
d.setTime(t);
var month = d.getMonth() + 1;
month = month < 10 ? '0' + month : month;
var day = d.getDate();
day = day < 10 ? '0' + day : day;
var hour = d.getHours();
hour = hour < 10 ? '0' + hour : hour;
var minute = d.getMinutes();
minute = minute < 10 ? '0' + minute : minute;
return '<a href="javascript:;" onclick="$(\'' + inpid + '\').value = \'' + d.getFullYear() + '-' + month + '-' + day + (!notime ? ' ' + hour + ':' + minute: '') + '\'">' + s + '</a>';
} else {
return '<a href="javascript:;" onclick="$(\'' + inpid + '\').value = \'' + v + '\'">' + s + '</a>';
}
} else if(v == -1) {
return '<a href="javascript:;" onclick="$(\'' + inpid + '\').focus()">' + s + '</a>';
} else if(v == -2) {
return '<a href="javascript:;" onclick="$(\'' + inpid + '\').onclick()">' + s + '</a>';
}
};
if(!
obj.id) {
var t = !t ? 0 : t;
var rettype = !rettype ? 0 : rettype;
obj.id = 'calendarexp_' + Math.random();
div = document.createElement('div');
div.id =
obj.id + '_menu';
div.style.display = 'none';
div.className = 'p_pop';
$('append_parent').appendChild(div);
s = '';
if(!t) {
s += showselect_row(inpid, '一天', 1, 0, rettype);
s += showselect_row(inpid, '一周', 7, 0, rettype);
s += showselect_row(inpid, '一个月', 30, 0, rettype);
s += showselect_row(inpid, '三个月', 90, 0, rettype);
s += showselect_row(inpid, '自定义', -2);
} else {
if($(t)) {
var lis = $(t).getElementsByTagName('LI');
for(i = 0;i < lis.length;i++) {
s += '<a href="javascript:;" onclick="$(\'' + inpid + '\').value = this.innerHTML;$(\''+
obj.id+'_menu\').style.display=\'none\'">' + lis[i].innerHTML + '</a>';
}
s += showselect_row(inpid, '自定义', -1);
} else {
s += '<a href="javascript:;" onclick="$(\'' + inpid + '\').value = \'0\'">永久</a>';
s += showselect_row(inpid, '7 天', 7, 1, rettype);
s += showselect_row(inpid, '14 天', 14, 1, rettype);
s += showselect_row(inpid, '一个月', 30, 1, rettype);
s += showselect_row(inpid, '三个月', 90, 1, rettype);
s += showselect_row(inpid, '半年', 182, 1, rettype);
s += showselect_row(inpid, '一年', 365, 1, rettype);
s += showselect_row(inpid, '自定义', -1);
}
}
$(
div.id).innerHTML = s;
}
showMenu({'ctrlid':
obj.id,'evt':'click'});
if(
BROWSER.ie &&
BROWSER.ie < 7) {
doane(event);
}
}
</script>