 function MM_swapImgRestore() { 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() { 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) { 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() { 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 switchLang( lang )
 {
  if ( lang == "ru" || lang == "en" )
  {
   self.document.forms[0].lang.value = lang;
   self.document.forms[0].submit();
  }
 }
 function showPicture( img, dsc )
 {
  var d = document;
  d.getElementById('bigimg').href = self.document.forms[0].picfolder.value+"/big/"+img;
  d.getElementById('fullimg').src = self.document.forms[0].picfolder.value+"/full/"+img;
  d.getElementById('imgdsc').innerHTML = dsc;

 }
 function submenu( name ) 
 { 
  if ( self.document.getElementById( name ).className == 'submenu-off' )
  {
   self.document.getElementById( name ).className='submenu-on';
  }
  else
  {
   self.document.getElementById( name ).className='submenu-off';
  }
 }
 function showImg(ImageSrc,WindowTitle,ImageWidth,ImageHeight)
 {
  var imgwnd;
  NLeft = Math.round(screen.width/2 - ImageWidth/2);
  NTop = Math.round(screen.height/2 - ImageHeight/2);
  if (NTop<0) {NTop=0;}
  if (NLeft<0) {NLeft=0;}
  imgwnd = window.open("","", "menubar=no,toolbar=no,resizable=no,width="+ImageWidth+",height="+ImageHeight+",left=" + NLeft + ",top=" + NTop);
  imgwnd.document.write("<html>");
  imgwnd.document.write(" <head>");
  imgwnd.document.write(" <meta http-equiv=\"content-type\" content=\"text/html; charset=windows-1251\">");
  imgwnd.document.write(" <title>"+WindowTitle+" ("+ImageWidth+"x"+ImageHeight+")</title>");
  imgwnd.document.write(" </head>");
  imgwnd.document.write(" <body bgcolor=\"#ffffff\" topmargin=\"0\" marginheight=\"0\" marginwidth=\"0\" leftmargin=\"0\" rightmargin=\"0\" bottommargin=\"0\"> ");
  imgwnd.document.write("<div style='position:absolute; left:0; top:0'><a href=\"javascript: window.close();\" title=\"Нажмите на картине для закрытия окна\"><img src=\""+self.document.forms[0].picfolder.value+"/big/"+ImageSrc+"\" border=\"0\" width=\""+ImageWidth+"\" height=\""+ImageHeight+"\" alt=\"\"></a></div>");
  imgwnd.document.write(" </body>");
  imgwnd.document.write("</html>");
  imgwnd.focus();
 } 

