
var getObjX = 0, getObjY = 0;
var show_menu_state = false;
var logWindId='a';
var waitImage;

ns4 = (document.layers)? true:false;
ie4 = (document.all)? true:false;

if(ns4) { this.location = "/index_no_netscape.html"; }

waitImage = '<img src="pict/brick.gif" width="92" height="50">';

function closeL(lay)
{
  var theObj;
  theObj = eval(lay);
  theObj.style.visibility = 'hidden';
}

function openL(lay)
{
  var xObj = eval ( 'document.all.' + lay + '.style' );
  xObj.visibility = 'visible';
  document.all[lay].innerHTML = waitImage;
  xObj.zIndex = Depth++;
}

function loadSource(id,nestref,url,nameframe) {
  if (ns4) {
    var lyr = (nestref)? eval('document.'+nestref+'.document.'+id) : document.layers[id];
    lyr.load(url,lyr.clip.width);
  }
  else if (ie4) {
    var obj_frame = eval('top.'+nameframe+'.document');
    obj_frame.location.href = url;
  }
}

function loadSourceFinish(id, nameframe) {
  var obj_frame = eval('parent.'+nameframe+'.document.body');
  if (obj_frame) {
    if (document.all(id)) {
      if (ie4) document.all(id).innerHTML = obj_frame.innerHTML;
    document.all(id).style.zIndex = Depth++;
    }
  }
}

// Drag code ( custom attribute: dragEnabled ).

document.onmousedown = doMouseDown;
document.onmousemove = doMouseMove;
document.onmouseup = new Function("elDragged = null;");

var elDragged = null;
var Depth = 10;

function doMouseMove() {
	if ((1 == event.button) && (elDragged != null)) {
	   // Move the element.
	   // Save mouse's position in the document
	   var intTop = event.clientY + document.body.scrollTop;
	   var intLeft = event.clientX + document.body.scrollLeft;
	   // Determine what element the mouse is really over.
	   var intLessTop  = 0;
	   var intLessLeft = 0;
	   var elCurrent = elDragged.offsetParent;
	   while (elCurrent.offsetParent != null) {
	      intLessTop += elCurrent.offsetTop;
	      intLessLeft += elCurrent.offsetLeft;
	      elCurrent = elCurrent.offsetParent;
	   }
	   // Set new position.
     elDragged.style.pixelTop  = (intTop - intLessTop - elDragged.y >= 0) ? intTop - intLessTop - elDragged.y : 0;
     elDragged.style.pixelLeft = (intLeft - intLessLeft - elDragged.x >= 0) ? intLeft - intLessLeft - elDragged.x : 0;
	   event.returnValue = false;
	}
}

function checkDrag(elCheck) {
  while (elCheck != null) {
    if (null != elCheck.getAttribute("dragEnabled")) return elCheck;

    elCheck = elCheck.parentElement;
  }
  return null;
}

function doMouseDown() {
  // Store element to be dragged.
  var elCurrent = checkDrag(event.srcElement);

  var el = event.srcElement.offsetParent;
  while ( el != null ) {
    if ( el.tagName == 'DIV' ) {
      el.style.zIndex = Depth++;
    }
    el = el.offsetParent;
  }

  if (null != elCurrent) {
    var op = event.srcElement;
    elDragged = elCurrent;
    // Determine where the mouse is in the element.
    elDragged.x = event.offsetX;
    elDragged.y = event.offsetY;
    // Find real location with respect to element being dragged.
    if ((elDragged != op.offsetParent) && (elDragged != event.srcElement)) {
      while (op != elDragged) {
        elDragged.x += op.offsetLeft;
        elDragged.y += op.offsetTop;
        op = op.offsetParent;
      }
    }
  }
}

// Menus code

document.onmouseover = showHim;
document.onmouseout = hideHim;

function hideAll()
{
  l1kuk.style.display="none";

 
  
  if(TimeOutID) clearTimeout(TimeOutID);
}

function showHim()
{
  srcElement=window.event.srcElement;
  if (srcElement.className=="st03" || srcElement.className=="st05") {
    hideAll();
  }
  if (srcElement.className=="st03") {
    targetid=srcElement.id+"kuk";
    targetElement=document.all(targetid);
    targetElement.style.display="";
    launch_timer();
  }
}

function hideHim() {
  srcElement = window.event.srcElement;
  if (srcElement.className=="olddet") {
    hideAll();
  }
}

// Timers for layers

TimeOutID=null;
time_out=3;

function process_timer() {
  time_out--;
  if(time_out==0) { hideAll(); }
  else TimeOutID = window.setTimeout('process_timer()',1000);
}

function launch_timer() {
  time_out=3;
  clearTimeout(TimeOutID);
  TimeOutID = window.setTimeout('process_timer()',1000);
}

function resetTimer() { time_out=120; }
function resumeTimer() { time_out=1; }

// Show Hand code

var prevHand = 1;

hand=new Image();
hand.src="title/menuhand.gif";
no_hand=new Image();
no_hand.src="title/menuhno.gif";

function showHand(handNum)
{
  // Hide prev hand
  imgName = "HandN"+prevHand;
  document[imgName].src=eval("no_hand.src");
  // Show hand
  imgName = "HandN"+handNum; prevHand = handNum;
  document[imgName].src=eval("hand.src");
}

function iNewWnd(imgName)
{
  imgwnd = window.open("", "oblo", "toolbar=no,directories=no,menubar=no,scrollbars=yes,width=700,height=500,resizable=yes");
    imgwnd.document.write("<HTML><HEAD>");
    imgwnd.document.writeln("<TITLE></TITLE>");
   
   
  imgwnd.document.writeln("<CENTER><img src="+ imgName + "><br>"); 

<!--     -->
    imgwnd.document.writeln("<FORM><INPUT TYPE='button' VALUE=Закрыть onClick='window.close()'></FORM></CENTER>");
    imgwnd.document.writeln("</BODY></HTML>");
  imgwnd.focus();
}
function AWindow() {
AWin = open("","a","toolbar=0,width=700,height=500,scrollbars=yes")
}
