function go_umenu_url(){
  box = document.getElementById('user_nav');
  destination = box.options[box.selectedIndex].value;
  if (destination) location.href = destination;
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function nav_form_submit(faction) {
  document.tnavform.action=faction;
  document.tnavform.submit();
}

function cng_tm_bg(menu_item, style) {
  if(style == 1) {
    menu_item.style.backgroundImage='url(images/tm_mb_sel.jpg)';
  } else {
    menu_item.style.backgroundImage='url(images/tm_mb.jpg)';
  }
}

function cng_image(item, image)
{
  item.src=image;
}

function cng_bg_col(item, color)
{
  item.style.backgroundColor=color;
}

function preloadImages()
{
  if(document.images)
  {
    if(!document.imageArray) document.imageArray = new Array();
    var i,j = document.imageArray.length, args = preloadImages.arguments;
    for(i=0; i<args.length; i++)
    {
      if (args[i].indexOf("#")!=0)
      {
        document.imageArray[j] = new Image;
        document.imageArray[j++].src = args[i];
      }
    }
  }
}

function imageChange(name,src) {
  if (document.images) document.images[name].src = src
}

function imageChange(name,src) {
  if (document.images) document.images[name].src = src
}

function ShowBranch (oElement) {
  var oElementNode = document.getElementById(oElement);
  oElementNode.style.display = 'block';
}

function HideBranch (oElement) {
  var oElementNode = document.getElementById(oElement);
  oElementNode.style.display = 'none';

}

function gallery(src, w, h) {
  new_window = null;
	if (window.screen) {
		aw = screen.availWidth;
		ah = screen.availHeight;
	} else {
		aw = 640;
		ah = 450;
	}

	w+=6;
	h+=6;

  if (new_window==null || new_window.closed) {
		settings=
		"left=" + (aw-w)/2 + ","
		+"top=" + (ah-h)/2 + ","
		+"screenX=" + (aw-w)/2 + ","
		+"screenY=" + (ah-h)/2 + ","
		+"width=" + w + ","
		+"height=" + h + ","
		+"innerWidth=" + w + ","
		+"innerHeight=" + h + ","
		+"toolbar=no,"
		+"location=no,"
		+"directories=no,"
		+"status=yes,"
		+"menubar=no,"
		+"scrollbars=no,"
		+"resizable=no"
		new_window = window.open("", 'foto', settings);
	}
	new_window.document.open();
	new_window.document.clear();
	new_window.document.write(
	"<html><head><title>Ôîòî</title>\n"
	+"</head><BODY bgcolor=#FFFFFF leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 link=#000000 vlink=#000000 alink=#000000>\n"
	+"<table width='100%' height='100%' border='0' cellspacing='0' cellpadding='0' align='center'><tr><td align='center'>"
	+"<a href='javascript:window.close()'><img src="+ src +"  border=1></a>"
	+"</td></tr></table>\n"
	+"</body></html>"
	);

	new_window.document.close();
	new_window.focus();
}

var opened_sub_block = '';

function ShowHideSMenu (oElement) {
  var oElementNode = document.getElementById(oElement);
  if (oElementNode.style.display == 'none' ) {
    if(window.opened_sub_block != ''){
      window.opened_sub_block.style.display = 'none';
    }
    window.opened_sub_block = oElementNode;
    oElementNode.style.display = 'block';
  } else {
    oElementNode.style.display = 'none';
  }
}

function showImage (id, w, h) {
  href = "/screenshot/image_" + id + ".htm";
  w += 20;
  h += 10;
  sh = screen.height - 80;
  if (document.all) sh -= 40;
  sw = screen.width;
  if (h > sh) h = sh;
  if (w > sw) w = sw;
  posX = sw/2 - w/2;
  posY = sh/2 - h/2;
  if (posY < 0) posY = 0;
  if (posX < 0) posX = 0;
  posCode = (document.all) ? ",left=" + posX + ",top=" + posY : ",screenX=" + posX + ",screenY=" + posY;
  moreWin = window.open (href, "royalpack", "status=no, toolbar=no, menubar=no, scrollbars=yes, resizable=no, location=no, width=" + w + ", height=" + h + posCode);
  moreWin.focus();
}
function ShowImage(src,x,y) {
  var wer ="&lt;html&gt; \
    &lt;body bottommargin="+0+" topmargin="+0+" leftmargin="+0+" rightmargin="+0+" marginwidth="+0+" marginheight="+0+"&gt; \
      &lt;a href="+'javascript:window.close()'+"&gt; \
        &lt;img border="+0+" src="+src+" alt="+'Cae?uou'+" hspace="+0+" vspace="+0+" width="+x+" height="+y+"\/&gt; \
      &lt;\/a&gt; \
    &lt;\/body&gt; \
  &lt;/html&gt;";
  myWin=window.open("","","left =20,top=30, menubar=0, toolbar=0, location=0, directories=0, status=0, scrollbars=0, resizable=0, width="+x+", height="+y);
  myWin.document.open();
  myWin.document.write(wer);
  myWin.document.close();
}

function doBookmark() {
 ap=navigator.appName;
 url=location.href;
 t="Èïîòå÷íûé íàâèãàòîð";

 if (window.sidebar) {
 window.sidebar.addPanel(t,url,'');
 } else if (window.external) {
 window.external.AddFavorite(url,t);
 } else if (window.addNet) {
 addNet(url,t);
 } else {
 alert("Your browser does not support this functionality.\nPlease add the bookmark manually.");
 }
}