function blocking(nr, cookie, vis_state)
{
        if (document.layers)
        {
                current = (document.layers[nr].display == 'none') ? vis_state : 'none';
                document.layers[nr].display = current;
        }
        else if (document.all)
        {
                current = (document.all[nr].style.display == 'none') ? vis_state : 'none';
                document.all[nr].style.display = current;
//document.getElementById('end').focus();
        }
        else if (document.getElementById)
        {
                display = (document.getElementById(nr).style.display == 'none') ? vis_state : 'none';
                document.getElementById(nr).style.display = display;
        }
}

function ChgCol (trNum,col)
{
//  document.all(trNum).bgColor = col
document.getElementById(trNum).bgColor = col;
}

function SetOrder (col)
{
  Next1.trip_nom.value = col
  Next1.submit ()
}

function SetMesto (col)
{
  Next2.mesto_nom.value = col
  Next2.submit ()
}

function check_step_one() {
    f = document.forms['abit'];
    f.ok.disabled = (f.rules.checked == "")
}

function OnViewSelection()
{
	document.abit.summa.value=document.abit.ostanovka.options[document.abit.ostanovka.selectedIndex].value;
	var DataString = document.abit.summa.value;
	var NewArray = DataString.split(';');
	document.abit.summa.value=NewArray[1];
	document.abit.summa.focus();
	return true;
}

function SetHistTrip() {
	TripHistory.submit();
}

function SetHistZak ()
{
  ZakHistory.submit ()
}

function AllTrips ()
{
  Trips.submit ()
}

function SetHistNom (col)
{
  HistNom.trip_nom.value = col
  HistNom.submit ()
}

function SetEditHistNom (nom, mesto)
{
  EditHistNom.trip_nom.value = nom;
  EditHistNom.edit.value = mesto;
  EditHistNom.submit ()
}

function SetTrip (nom, date, trip)
{
  Next1.trip_nom.value = nom;
  Next1.date_trip.value = date;
  Next1.trip.value = trip;
  Next1.submit ();
}

function SetTripA ()
{
  Next3a.submit ();
}

function FocusTextId() {
  document.abit.id.focus();
  return true;
}

function FocusTextIdKogo() {
  document.abit.idkogo.focus();
  return true;
}

var oPopup = window.createPopup();
function richToolTip()
{
    var lefter = event.offsetY;
    var topper = event.offsetX;
    oPopup.document.body.innerHTML = oToolTip.innerHTML;
    oPopup.show(topper, lefter, 300, 200, ttip);
}

function sendform(a,b) {
	if (document.getElementById('commentform').zakaz_fio.value == "") {
	alert('Пожалуйста, введите Контактное лицо');
	document.getElementById('commentform').zakaz_fio.focus();
	return false;
	} 
	else
	if (document.getElementById('commentform').zakaz_telefon.value == "") {
	alert('Пожалуйста, введите Телефон');
	document.getElementById('commentform').zakaz_telefon.focus();
	return false;
	}

	var A = a;
	var B = b;

	C = A+B;
	c = prompt(A + "+" + B + "=", "?");

	if ( c != C ) {
	return false;
	} else {
	document.getElementById('commentform').c.value = c;
	}

return true;
document.getElementById('commentform').submit();
}

