function PreloadImages()
{
   var imageObj = new Image();
   var images = new Array();
   images[0]="/img/b1_1_about.png";
   images[1]="/img/b2_2_product.png";
   images[2]="/img/b3_3_contact.png";
   images[3]="/img/b4_4_price.png";
   images[4]="/img/b5_5_zayavka.png";
   images[5]="/img/for-nav.png";
   images[6]="/img/for-nav.png";
   for (var i=0; i<=6; i++)
   {
      imageObj.src = images[i];
   }
}

$(document).ready(function()
{
   $("#RollOver1 .hover").hide();
   $("#RollOver1 a").hover(function()
   {
      $("#RollOver1 .hover").show();
      $(this).children("span").hide();
   }, function()
   {
      $(this).children("span").show();
      $("#RollOver1 .hover").hide();
   })
   $("#RollOver2 .hover").hide();
   $("#RollOver2 a").hover(function()
   {
      $("#RollOver2 .hover").show();
      $(this).children("span").hide();
   }, function()
   {
      $(this).children("span").show();
      $("#RollOver2 .hover").hide();
   })
   $("#RollOver3 .hover").hide();
   $("#RollOver3 a").hover(function()
   {
      $("#RollOver3 .hover").show();
      $(this).children("span").hide();
   }, function()
   {
      $(this).children("span").show();
      $("#RollOver3 .hover").hide();
   })
   $("#RollOver4 .hover").hide();
   $("#RollOver4 a").hover(function()
   {
      $("#RollOver4 .hover").show();
      $(this).children("span").hide();
   }, function()
   {
      $(this).children("span").show();
      $("#RollOver4 .hover").hide();
   })
   $("#RollOver5 .hover").hide();
   $("#RollOver5 a").hover(function()
   {
      $("#RollOver5 .hover").show();
      $(this).children("span").hide();
   }, function()
   {
      $(this).children("span").show();
      $("#RollOver5 .hover").hide();
   })
   $("#RollOver6 .hover").hide();
   $("#RollOver6 a").hover(function()
   {
      $("#RollOver6 .hover").show();
      $(this).children("span").hide();
   }, function()
   {
      $(this).children("span").show();
      $("#RollOver6 .hover").hide();
   })
   $("#RollOver7 .hover").hide();
   $("#RollOver7 a").hover(function()
   {
      $("#RollOver7 .hover").show();
      $(this).children("span").hide();
   }, function()
   {
      $(this).children("span").show();
      $("#RollOver7 .hover").hide();
   })
   $(".SlideMenu1_Folder div").click(function()
   {
      if ($(this).parent().find('ul').is(':hidden'))
      {
         $(this).parent().find('ul').show();
      }
      else
      {
         $(this).parent().find('ul').hide();
      }
   });
});

isMouseover = false;
isDragging = false;

function MouseDownLayer(e)
{
   isIE = document.all;

   documentTag = isIE ? "BODY" : "HTML";
   srcElement = isIE ? event.srcElement : e.target;  
   layerElement = isIE ? document.all.Layer1 : document.getElementById("Layer1");  

   while (srcElement.id != "Layer1TitleBar" && srcElement.tagName != documentTag)
   {
      srcElement = isIE ? srcElement.parentElement : srcElement.parentNode;
   }  
   if (srcElement.id == "Layer1TitleBar")
   {
      offsetX = isIE ? event.clientX : e.clientX;
      offsetY = isIE ? event.clientY : e.clientY;
      currentX = parseInt(layerElement.style.left);
      currentY = parseInt(layerElement.style.top);
      isDragging = true;
      document.onmousemove = MouseMoveLayer;
  }
}

function MouseMoveLayer(e)
{
   if (!isDragging) return;
   
   // Internet Explorer ?
   if (document.all)
   {
      layerElement.style.left = currentX+event.clientX-offsetX; 
      layerElement.style.top = currentY+event.clientY-offsetY;
   }
   else
   {
      layerElement.style.left = currentX+e.clientX-offsetX + "px"; 
      layerElement.style.top = currentY+e.clientY-offsetY + "px";
   }
   return false;  
}

document.onmousedown = MouseDownLayer;
document.onmouseup = Function("isDragging=false");



function clock() 
{
   var digital = new Date();
   var hours = digital.getHours();
   var minutes = digital.getMinutes();
   var seconds = digital.getSeconds();
   if (minutes <= 9) minutes = "0" + minutes;
   if (seconds <= 9) seconds = "0" + seconds;
   dispTime = hours + ":" + minutes + ":" + seconds;

   var basicclock = document.getElementById('basicclock');
   basicclock.innerHTML = dispTime;
   setTimeout("clock()", 1000);
}


