var posLay = 317;
var topLayval = 127;
var botLayval = 317;
var timeVar;

function moveLay(kindofStep,sizeofStep)
{
  posLay = posLay + sizeofStep;
  document.getElementById("idostuff").style.left = posLay+"px";
  
  if(kindofStep == "goleft" && posLay > topLayval)
  {
    sizeofStep = sizeofStep - 5;
    timeVar = setTimeout("moveLay('"+kindofStep+"',"+sizeofStep+");",80);
  }
  else if(kindofStep == "goright" && posLay < botLayval)
  {
    sizeofStep = sizeofStep + 5;
    timeVar = setTimeout("moveLay('"+kindofStep+"',"+sizeofStep+");",80);
  }
  else
  {
    Layval = (kindofStep == "goleft") ? topLayval : botLayval
    document.getElementById("idostuff").style.left = Layval+"px";
	posLay = Layval;
  }
}

function togglePics(id,picsChange)
{
  document.getElementById(id).src = picsChange;
}

function toggleLayers(id)
{
  document.getElementById(id).style.display = !(document.getElementById(id).style.display == "block") ? "block" : "none";
}

var timewait = null;
var currLay = "starta";

function waitMenu(waitSec,waitLay)
{
  if(currLay!=waitLay&&currLay!="starta")
  {
    document.getElementById(currLay).style.display = "none";
  }
  if(waitSec==1)
  {
    timewait = setTimeout("hideMenu('"+waitLay+"')",800);
  }
  else if(waitSec==2)
  {
    currLay = waitLay;
    clearTimeout(timewait);
  }
}

function showMenu(id)
{
  document.getElementById(id).style.display = "block";
}
function hideMenu(id)
{
  document.getElementById(id).style.display = "none";
}

