function show(idel)
{
	if(document.getElementById(idel)) document.getElementById(idel).style.display = 'block';
}

function hide(idel)
{
	if(document.getElementById(idel)) document.getElementById(idel).style.display = 'none';
}

function active(idel)
{
	if(document.getElementById(idel)) document.getElementById(idel).checked = 'true';
}

function gotoview(idel)
{
    if(document.getElementById(idel)) document.getElementById(idel).scrollIntoView(true);
}

function clickrf()
{
hide('mir');
hide('rfcard');
hide('rfrobox');
hide('rfnal');
hide('mirwu');
hide('mirrobox');
show('rf');
gotoview('rf');
active('countryrf');
active('rf0');
active('mir0');
}

function clickmir()
{
hide('rf');
hide('rfcard');
hide('rfrobox');
hide('rfnal');
hide('mirwu');
hide('mirrobox');
show('mir');
gotoview('mir');
active('countrymir');
active('rf0');
active('mir0');
}

function clickrfcard()
{
hide('mir');
hide('rfnal');
hide('rfrobox');
hide('mirwu');
hide('mirrobox');
show('rfcard');
gotoview('rfcard');
active('rfrfcard');
}

function clickrfrobox()
{
hide('mir');
hide('rfnal');
hide('rfcard');
hide('mirwu');
hide('mirrobox');
show('rfrobox');
gotoview('rfrobox');
active('rfrfrobox');
}

function clickrfnal()
{
hide('mir');
hide('rfcard');
hide('rfrobox');
hide('mirwu');
hide('mirrobox');
show('rfnal');
gotoview('rfnal');
active('rfrfnal');
}

function clickmirwu()
{
hide('rf');
hide('rfcard');
hide('rfrobox');
hide('rfnal');
hide('mirrobox');
show('mirwu');
gotoview('mirwu');
active('mirmirwu');
}

function clickmirrobox()
{
hide('rf');
hide('rfcard');
hide('rfrobox');
hide('rfnal');
hide('mirwu');
show('mirrobox');
gotoview('mirrobox');
active('mirmirrobox');
}

function checkForm(idel)
{ 
    var F = document.getElementById (idel + 'F'); 
    var I = document.getElementById (idel + 'I');
    var O = document.getElementById (idel + 'O');
    var GOROD = document.getElementById (idel + 'GOROD');
    var ADDRESS = document.getElementById (idel + 'ADDRESS');
    var ADDRESS2 = document.getElementById (idel + 'ADDRESS2');
    var TELEPHONE = document.getElementById (idel + 'TELEPHONE');
    var TELEPHONE2 = document.getElementById (idel + 'TELEPHONE2');
    var EMAIL = document.getElementById (idel + 'EMAIL');
    var zakazSubmit = document.getElementById ('zakaz'+ idel + 'Submit'); 
    if (!F || !I || !O || !GOROD || !ADDRESS || !ADDRESS2 || !TELEPHONE || !TELEPHONE2 || !EMAIL || !zakazSubmit) return; 
 
    zakazSubmit.disabled = !F.value || !I.value || !O.value || !GOROD.value || !ADDRESS.value || !ADDRESS2.value || !TELEPHONE.value || !TELEPHONE2.value || !EMAIL.value;
}

function checkmail(value, idEmail) {
if (!value.match("^([a-z0-9_]|\\-|\\.)+@(([a-z0-9_]|\\-)+\\.)+[a-z]{2,4}\$")) {
document.getElementById(idEmail).focus();
document.getElementById(idEmail).style.backgroundColor="f99";
return false; }
}

function SubmitControl(tocheack, value, idEmail)

{
  if (document.all || document.getElementById)
    {
      for (i=0; i < tocheack.length;i++)
        {
          if(tocheack.elements[i].type.toLowerCase()=="submit"||tocheack.elements[i].type.toLowerCase()=="reset")
          {
            tocheack.elements[i].disabled = true;
          }
        }
    }
}

function start()
{
	if(document.getElementById('knopka')) document.getElementById('knopka').style.display = 'none';
	if(document.getElementById('start')) document.getElementById('start').style.display = 'block';
	active('country0');
	active('rf0');
	active('mir0');
}
