window.addEvent('domready', function() {
    if ($("date_from")) { date_from = new DatePicker('#date_from', { pickerClass: 'datepicker_dashboard', format: "d/m/Y", inputOutputFormat: "d/m/Y", allowEmpty: true }); }
    if ($("date_to")) { date_to = new DatePicker('#date_to', { pickerClass: 'datepicker_dashboard', format: "d/m/Y", inputOutputFormat: "d/m/Y", allowEmpty: true }); }


    if ($("box_username")) {
        overtext1 = new OverText($("box_username"));
        overtext2 = new OverText($("box_password"));
    };

    if ($("terms")) {
        $("terms").addEvent("click", function(element) {
 
            element.stop();
            newWindow('/article/terms-of-use?plain=true', '', '600', '700', 'resizable,scrollbars,status');
        });
    }
});


var win = null;
function newWindow(mypage, myname, w, h, features) {
    var winl = (screen.width - w) / 2;
    var wint = (screen.height - h) / 2;
    if (winl < 0) winl = 0;
    if (wint < 0) wint = 0;
    var settings = 'height=' + h + ',';
    settings += 'width=' + w + ',';
    settings += 'top=' + wint + ',';
    settings += 'left=' + winl + ',';
    settings += features;
    win = window.open(mypage, myname, settings);
    win.window.focus();
}