//rollover
function on(xx,yy)
{ if (document.getElementById)
    document.getElementById(xx).src="/img/"+yy+"_1.gif";
  else
    document.all[xx].src="/img/"+yy+"_1.gif";
}
function off(xx,yy)
{ if (document.getElementById)
    document.getElementById(xx).src="/img/"+yy+"_0.gif";
  else
    document.all[xx].src="/img/"+yy+"_0.gif";
}

//menurollover
function on1(xx,yy)
{ if (document.getElementById)
    document.getElementById(xx).src="/img/menuitem_"+yy+"_1.gif";
  else
    document.all[xx].src="/img/menuitem_"+yy+"_1.gif";
}
function off1(xx,yy)
{ if (document.getElementById)
    document.getElementById(xx).src="/img/menuitem_"+yy+"_0.gif";
  else
    document.all[xx].src="/img/menuitem_"+yy+"_0.gif";
}

function on2(xx,yy)
{ if (document.getElementById)
    document.getElementById(xx).className=yy;
  else
    document.all[xx].className=yy;
}

function off2(xx,yy)
{ if (document.getElementById)
    document.getElementById(xx).className=yy;
  else
    document.all[xx].className=yy;
}


//dropright menu
var occupied_header = new Array();
var occupied_menu = new Array();
for(i=1;i<=99;i++)
{
occupied_header[i] = 0;
occupied_menu[i] = 0;
}


function Turn(id, mode) {
  if(document.all || document.getElementById) {  	if (document.getElementById('smenu'+id))
  	  { if(mode)
          eval("setTimeout(\"On(" + id + ", " + mode + ");\",50)");
    	else
          eval("setTimeout(\"Off(" + id + ", " + mode + ");\",50)");
      }
   }
}

function On(id, mode) {
  if(occupied_header[id])
    if(document.all)
      eval("smenu" + id).style.visibility = 'visible';
    else if (document.getElementById)
      { eval("document.getElementById('smenu" + id + "')").style.visibility = "visible";
      }
}

function Off(id, mode) {
  if(!occupied_menu[id] && !occupied_header[id])
    if(document.all)
      eval("smenu" + id).style.visibility = 'hidden';
    else if (document.getElementById)
      eval("document.getElementById('smenu" + id + "')").style.visibility = "hidden";
}


//form content check

function checkform()
{

	var errcode = 0;

	if (document.all['zkolvo'].value==null || document.all['zkolvo'].value==0)
	{

	 errcode=2;

	}

	if (document.all['zfio'].value==null || document.all['zfio'].value==0)
	{

	  errcode = errcode+3;
	}

	if (document.all['zmail'].value==null || document.all["zmail"].value==0)
	{

	  errcode = errcode+4;
	}





 if (errcode==2)
	{
		document.all['zkolvotxt'].className='redd';
		alert ("Количество каналов записи не указано!");
    }
 if (errcode==3)
	{
		document.all['zfiotxt'].className='redd';
		alert ("Ф.И.О. получателя не указано!");
    }

 if (errcode==4)
	{
		document.all['zmailtxt'].className='redd';
		alert ("E-mail получателя не указан!");
    }


	 if (errcode==5)
	{
		document.all['zfiotxt'].className='redd';
		document.all['zkolvotxt'].className='redd';
		alert ("Количество каналов записи, Ф.И.О. получателя не указаны!");
    }

	 if (errcode==6)
	{
		document.all['zmailtxt'].className='redd';
		document.all['zkolvotxt'].className='redd';
		alert ("Количество каналов записи и E-mail получателя не указаны!");
    }

	 if (errcode==7)
	{
		document.all['zmailtxt'].className='redd';
		document.all['zfiotxt'].className='redd';
		alert ("Ф.И.О. и E-mail получателя не указаны!");
    }

    if (errcode==9)
	{
		document.all['zmailtxt'].className='redd';
		document.all['zfiotxt'].className='redd';
		document.all['zkolvotxt'].className='redd';
		alert ("Количество каналов записи, Ф.И.О. и E-mail получателя не указаны !");
    }

if (errcode > 1)
{
return false;
}
else
zakaz.submit();

}

// form 2 content check
function checkqform()
{

	var errcode = 0;

	if (document.all['qname'].value==null || document.all['qname'].value==0)
	{

	 errcode=2;

	}

	if (document.all['qmail'].value==null || document.all['qmail'].value==0)
	{

	  errcode = errcode+3;
	}

	if (document.all['qmess'].value==null || document.all["qmess"].value==0)
	{

	  errcode = errcode+4;
	}





 if (errcode==2)
	{
		document.all['qnametxt'].className='redd';
		alert ("Имя не указано!");
    }
 if (errcode==3)
	{
		document.all['qmailtxt'].className='redd';
		alert ("E-Mail не указан!");
    }

 if (errcode==4)
	{
		document.all['qmesstxt'].className='redd';
		alert ("Сообщение пустое!");
    }


	 if (errcode==5)
	{
		document.all['qnametxt'].className='redd';
		document.all['qmailtxt'].className='redd';
		alert ("Имя и E-Mail не указаны!");
    }

	 if (errcode==6)
	{
		document.all['qnametxt'].className='redd';
		document.all['qmesstxt'].className='redd';
		alert ("Имя не указано, сообщение пустое!");
    }

	 if (errcode==7)
	{
		document.all['qmailtxt'].className='redd';
		document.all['qmesstxt'].className='redd';
		alert ("E-mail не указан, сообщение пустое!");
    }

    if (errcode==9)
	{
		document.all['qnametxt'].className='redd';
		document.all['qmailtxt'].className='redd';
		document.all['qmesstxt'].className='redd';
		alert ("Имя и E-Mail не указаны, сообщение пустое!");
    }

if (errcode > 1)
{
return false;
}
else
ask.submit();
}
