var zobrPhone = false;

function prep(kam)
{
  if (!document.getElementById(kam))
    return;
//   document.getElementById('mlt').style.display = "none";
  document.getElementById('mlp').style.display = "none";
  document.getElementById('sy').style.display = "none";

  document.getElementById(kam).style.display = "block";

//   document.getElementById('tabmlt').className = "tab";
  document.getElementById('tabmlp').className = "tab";
  document.getElementById('tabsy').className = "tab";

  document.getElementById('tab'+kam).className = "tab seltab";
}

function startujem()
{
    if (!document.getElementsByTagName)
	return false;

    // svinout
    pack();

    // fader
    changeOpac(0, 'rooms');
    document.getElementById('rooms').style.visibility = "inherit";

    hash = document.location.hash;

    if (hash)
	prep(hash.substring(1));
    else
	prep('mlp');
}

function opOn()
{
    if (zobrPhone==false)
	{
	    opacity('rooms', 0, 100, 1000);
	    zobrPhone = true;
	}

//     alert(zobrPhone);
}

function opOff()
{
    if (zobrPhone==true)
	{
	    opacity('rooms', 100, 0, 1000);
// 	    setTimeout("opacity('rooms', 100, 0, 1000);", 5000);
	    zobrPhone = false;
	}
//     alert(zobrPhone);
}

function pack()
{
  if (!document.getElementById('mlp'))
    return;
//   document.getElementById('mlt').style.display = "none";
  document.getElementById('sy').style.display = "none";
}

function showCar(carid)
{
  document.location = "/nabidka-vozu/"+carid+"/";
}

function switchImg(car, x)
{
    document.getElementById('carimg').src = '/images/auta/'+car+'-'+x+'-m.jpg'
    document.getElementById('carimg').parentNode.href = '/images/auta/'+car+'-'+x+'-l.jpg'
}


window.onload = startujem;

