function on_ugol(id)
{
    var ugol = document.getElementById(id);
    if (ugol==null) return false;
    ugol.style.visibility='visible';
}

function out_ugol(id)
{
    var ugol = document.getElementById(id);
    if (ugol==null) return false;
    ugol.style.visibility='hidden';
}

function popup_win(url)
{
  var width = 810;
  var new_height = Math.round(window.screen.height - 80);
  var new_left = Math.round(window.screen.width / 2 - width / 2);
  var window_params = 'left=' + new_left + ',top=20,width=' + width + ',height=' + new_height + ',scrollbars=yes,resizable=no,help=no,status=no';
  //url = HTTP_BASE_PATH + url.slice(1);
  var myWin = open(url, "photo", window_params);
  myWin.resizeTo(width, new_height);
}

function onAlbumSelectChanged(select)
{
  var current_option = select.childNodes[select.selectedIndex];
  if(!current_option)
    return;

  window.location = HTTP_GATEWAY_PATH + current_option.value + '?action=display_photo';
}

function popup(src)
{
  var default_left=window.screen.width / 2 - 20;
  var default_top=window.screen.height / 2 - 50;
  var window_params = 'width=30,height=10,scrollbars=no,resizable=no,help=no,status=yes,left=' + default_left + ',top=' + default_top;
  var myWin = open("", "", window_params);
  var HTMLtext = "<html><head><meta http-equiv='Content-Type' content='text/html; charset=UTF-8'></head><body style='margin:0; padding:0;' onload='wResize();'>";
  HTMLtext += "<script>function wResize() { var oImg=document.images[0]; var width=oImg.width+6; var height=oImg.height+54; var left = Math.round(window.screen.width / 2 - width / 2); var top = Math.round(window.screen.height / 2 - height / 2); document.getElementById('hide').style.visibility='hidden'; window.moveTo(left, top); window.resizeTo(width, height); oImg.style.visibility='visible'; }</script>";
  HTMLtext += "<img id='img' src='" + src + "' onclick='window.close();' style='visibility:hidden;'><div id='hide' style='color:#FF0000; padding-left:5px;'>��������...</div>";
  HTMLtext += "</body></html>";
  myWin.document.write(HTMLtext);
  myWin.document.close();
}

function popup_video(src, win_width, win_height)
{
  var default_left=window.screen.width / 2 - win_width / 2;
  var default_top=window.screen.height / 2 - win_height / 2;
  var window_params = 'width='+win_width+',height='+win_height+',scrollbars=no,resizable=no,help=yes,status=yes,left=' + default_left + ',top=' + default_top;
  var myWin = open(src, "", window_params);
}