function downloadJournal(x) {
  arr = new Array();
  arr['load_id'] = x;
  bajax.call('/downloads/journal', downloadResume, arr);
  }

function downloadResume(x) {
  if (x != 'false') {
    window.open('/downloads/journal/'+x);
    }
  else {
    document.getElementById('gray_bg').style.height = document.body.clientHeight+"px";
    document.getElementById('gray_bg').style.width = document.body.clientWidth+"px";
    document.getElementById('gray_bg').style.display = "block";
    var confirm_win = document.getElementById('confirm_win');
    confirm_win.style.left=document.body.clientHeight / 2 - 50+"px";
    confirm_win.style.top=300+"px";
    confirm_win.style.display = "block";
    }
  }


function closewin() {
  document.getElementById('gray_bg').style.display = "none";
  document.getElementById('confirm_win').style.display = "none";
  }

function log_in(obj) {
  var inputs = obj.getElementsByTagName('INPUT');
  var args = new Array();
  for (i in inputs) {
    if (inputs[i].name == 'login')
       args['login'] = inputs[i].value;
    else if (inputs[i].name == 'password')
       args['password'] = inputs[i].value;
    else if (inputs[i].name == 'load_id')
       args['load_id'] = inputs[i].value;
    }
  bajax.call('/downloads/journal/login', downloadResume, args);
  }

function form_insert(num) {
  document.forms['login'].load_id.value = num;
  }

function showStand(num) {
  var divs = document.getElementsByTagName("DIV");
  var myexp = /descr_/;
  for (i in divs) {
    if (myexp.test(divs[i].id)) {
      divs[i].style.display = "none";
      }
    }
  document.getElementById("descr_"+num).style.display = "block";
  document.getElementById('scrollobj').scrollTop = 0;
  }

timeout = null;
function scrollDown() {
  var scrollobj = document.getElementById('scrollobj');
  scrollobj.scrollTop = scrollobj.scrollTop + 5;
  timeout = setTimeout('scrollDown();', 20);
  }

function scrollUp() {
  var scrollobj = document.getElementById('scrollobj');
  scrollobj.scrollTop = scrollobj.scrollTop - 5;
  timeout = setTimeout('scrollUp();', 20);
  }

function stopScroll() {
  clearTimeout(timeout);
  }