// JavaScript Document

document.cookie='c_test=1';

function Twoload(frame1,frame2)
{
 parent.MENU.location.href=frame1;
 parent.DATA.location.href=frame2;
 }
 
 function abox(url, w, h)
{ 
open(url, "", 'menubar=no, directories=no, location=no, resizable=no, scrollbars=no, width=' + w + ', height=' + h );
} 


//функция открывания окна
function abox_t(foto)
  {
  nImage = new Image();
  nImage.src = foto;
  width = screen.width;
  height = screen.height;
  i = nImage.width;
  j = nImage.height;
  k = 'no';
    if (i > screen.width)
      {
        i = screen.width - 80;
        j = nImage.height + 30;
        k = 'yes';
       }
     if (j > screen.height)
       {
         j = screen.height - 100;
         i = nImage.width + 40;
         k = 'yes';
       }
     if (width == 0 || height == 0)
       {
         i = 640;
         j = 480;
         k = 'yes';
       }
     else
       {
         i = i + 40
         j = j + 30
       }
  myWin= open("", "_blank", 
  "width="+i+",height="+j+",status=no,toolbar=no,menubar=no,scrollbars="+k+",resizable="+k+"");
  myWin.document.open();
  myWin.document.write("<html><head><title>Фото</title><link href=style2.css type=text/css rel=stylesheet></head><body bgcolor='FFFFFF' leftmargin='7' onload='fitWindowSize();'><p class='cours' align='center'><img border='0' src='");
  myWin.document.write(foto);
  myWin.document.write("' onClick=window.close() alt='Щёлкните чтобы закрыть окно'></p></body></html>");
  myWin.document.close();}


//функция ресайза открывшегося окна в зависимости от размеров изображения

//var isNav4, isIE4;
//if (parseInt(navigator.appVersion.charAt(0)) >= 4) {
//isNav4 = (navigator.appName == "Netscape") ? 1 : 0;
//isIE4 = (navigator.appName.indexOf("Microsoft") != -1) ? 1 : 0;
//}
function fitWindowSize() 
{
//     if( document.images[0].width < 240 )
//          window.resizeTo( document.images[0].width + 40, document.images[0].height + 40 );
 
//     else
//     {
          var width = document.images[0].width + 40;
          var height = document.images[0].height + 40;
          window.resizeTo( width, height );
//     }
}

function openphoto (url, w, h)
{ 
open(url, "", 'menubar=no, directories=no, location=no, resizable=no, scrollbars=no, width=' + w + ', height=' + h );
}

function openphoto_1 (url, w, h)
{ 
open(url, "", 'menubar=no, directories=no, location=no, resizable=no, scrollbars=yes, width=' + w + ', height=' + h );
}

function openphoto_2 (url, w, h)
{ 
open(url, "", 'menubar=no, directories=no, location=no, resizable=no, scrollbars=no, screenX=50, screenY=30, left=50, top=30, width=' + w + ', height=' + h );
}

// функция смены картинок
var a=new Array();
function getChildren(ob){
  
  var o=ob.childNodes;
  for (var i=0; i<o.length; i++){
    if (o[i].nodeType==1) // Element
      a[a.length]=o[i];
  }
  return a;
}
function change2(ob){
  var o,i;
  o=getChildren(ob.parentNode);
  i=parseInt(ob.getAttribute("i"));
  if (++i==(a.length-1)) i=0;
  ob.style.display="none";
  o[i].style.display="inline";
}

// конец функции смены картинок

// ф-ция сворачивания-разворачивания описания

function changeDisplayStatus(elementID) {
		  var id;
		  id = "Text" + elementID;
      var elm;
      if (document.getElementById) elm = document.getElementById(id);
      else if (document.all) elm = document.all[id];
      if (elm) {
  		  if(elm.style.display=="none") elm.style.display = "inline";
		    else elm.style.display = "none";
      }
		}

// конец




