function openInfoWin(download_id)
{
  win = window.open('./?area=popup_info&download_id='+download_id, "win", "width=302,height=70,scrollbars=no");
  win.window.focus();
}

function evalKeyForSubmit(event)
{
  if(navigator.appName == 'Microsoft Internet Explorer')
  {
    if(event && event.keyCode == 13)
    {
      submitLogin();
    }
    else
    {
      return(true);
    }
  }
  else
  {
    if(event && event.which == 13)
    {
      login();
    }
    else
    {
      return(true);
    }
  }
}

function saveUserData()
{
  document.forms.the_form.area.value = 'save_user_data';
  document.forms.the_form.submit();
}

function savePlayerData()
{
  document.forms.the_form.area.value = 'save_player_data';
  document.forms.the_form.submit();
}

function saveThread()
{
  document.forms.the_form.area.value = 'create_new_thread';
  document.forms.the_form.submit();
}

function savePosting()
{
  document.forms.the_form.area.value = 'create_new_posting';
  document.forms.the_form.submit();
}

/* popups */
function openMapPopup(location_id)
{
  map_win = window.open('../popup.php?area=show_map_location&location_id=' + location_id, 'fileswin','height=500, width=400, scrollbars=no');
  map_win.focus();
}
/* popups */

var pop = null;

function popdown() {
  if (pop && !pop.closed) 
  {
    pop.close();
  }
}

function popup(obj,w,h) {
  var url = (obj.getAttribute) ? obj.getAttribute('href') : obj.href;
  if (!url) 
  {
    return true;
  }
  w = (w) ? w += 20 : 150;  // 150px*150px is the default size
  h = (h) ? h += 25 : 150;
  var args = 'width='+w+',height='+h+',resizable';
  popdown();
  pop = window.open(url,'',args);
  return (pop) ? false : true;
}
