<script type="text/javascript" src="../../codebase/dhtmlxcommon.js"></script>
<script type="text/javascript" src="../../codebase/dhtmlxtoolbar.js"></script>
<script type="text/javascript" src="../../../dhtmlxCalendar/codebase/dhtmlxcalendar.js"></script>
<link rel="stylesheet" type="text/css" href="../../codebase/skins/dhtmlxtoolbar_dhx_skyblue.css"/>
<link rel="stylesheet" type="text/css" href="../../../dhtmlxCalendar/codebase/dhtmlxcalendar.css"/>
<link rel="stylesheet" type="text/css" href="../../../dhtmlxCalendar/codebase/skins/dhtmlxcalendar_dhx_skyblue.css"/>
<script>var myToolbar;
var myCalendar;
var input_from;
var input_till;
function doOnLoad() {
myToolbar = new dhtmlXToolbarObject("toolbarObj");
myToolbar.setIconsPath("../common/imgs/");
myToolbar.addText("text_from", null, "From");
myToolbar.addInput("date_from", null, "02.07.2012", 75);
myToolbar.addText("text_till", null, "Till");
myToolbar.addInput("date_till", null, "13.07.2012", 75);
myToolbar.addButton("button_apply", null, "Apply Filter", "save.gif");
input_from = myToolbar.getInput("date_from");
input_from.setAttribute("readOnly", "true");
input_from.onclick = function() {
setSens(input_till, "max");
}
input_till = myToolbar.getInput("date_till");
input_till.setAttribute("readOnly", "true");
input_till.onclick = function() {
setSens(input_from, "min");
}
myCalendar = new dhtmlXCalendarObject([input_from, input_till]);
myCalendar.setDateFormat("%d.%m.%Y");
}
function setSens(inp, k) {
if (k == "min") {
myCalendar.setSensitiveRange(inp.value, null);
} else {
myCalendar.setSensitiveRange(null, inp.value);
}
}
</script>
<div style="height: 500px;"><div id="toolbarObj"></div></div>