var isNav = (navigator.appName.indexOf("Netscape") !=-1);
var value_date_from;
var value_date_till;

if(isNav) { document.captureEvents(Event.LOAD); }
document.onload = initDocument;

function initDocument() {
   var search_form = document.forms["search_form"];
   value_date_from = search_form.elements["date_from"].value;
   value_date_till = search_form.elements["date_till"].value;
}

function purchaseTypeChange(fo) {
   type_id = fo.elements["type_id"];

   var date_from = fo.elements["date_from"];
   var date_till = fo.elements["date_till"];

   if(type_id.options[type_id.selectedIndex].value == 2) {
      value_date_from = date_from.value;
      value_date_till = date_till.value;

      date_from.value = '';
      date_till.value = '';

   } else {
      if(date_from.value == '' && date_till.value == '') {
         date_from.value = value_date_from;
         date_till.value = value_date_till;

      } else {
         value_date_from = date_from.value;
         value_date_till = date_till.value;
      }
   }

   return true;
}

function rowOver(el) {
   el.className = 'list_row_over';
   return true;
}

function rowOut(el) {
   el.className = 'list_row_out';
   return true;
}

function go(url) {
   window.location = url;
   return true;
}

function cursor(el, type) {
   el.style.cursor = type;
   return true;
}

function popup(url, w, h) {
   var dx = Math.round((screen.availWidth - w) / 2);
   var dy = Math.round((screen.availHeight - h) / 2);
   window.open(url,'','width='+w+', height='+h+', left='+dx+', top='+dy+', toolbar=no, statusbar=no, scrollbars=yes, resizable=yes, menubar=no');
}
