function ShowPic(pic, lang)
{
  var temp = '/showpic.php?pic=' + pic + '&lang=' + lang;
  var xpos = (screen.width-100)/2;
  var ypos = (screen.height-100)/2;
  window.open(temp,'displayWindow','scrollbars=0,status=0,width=1,height=1,top='+ypos+',left='+xpos); 
}
function OpenWin(html, lang)
{
  window.open(html,'displayWindow'); 
}
function Mark(s)
{
  var r, i;
  if (s) 
  {
    r = window.document.body.createTextRange();
    for (i=0; r.findText(s); i++) 
    {
      r.execCommand("BackColor", "", "#000000");
      r.execCommand("ForeColor", "", "#FFFFFF");
      r.execCommand("Bold", "", "");
      r.collapse(false);
    }
  }
}
function promo()
{
	var inet = parseInt(document.getElementById('inet').value);
	var zp = parseInt(document.getElementById('zp').value);
	var econ = document.getElementById('econ');
	var val = Math.round(((980/60)*(inet+zp)+100)-200);
	econ.value = (val)?val:0;
}
function HotelSearch (state_url)
{
  document.forms['hotel_search'].action = state_url+'/'+document.forms['hotel_search'].st.value+'/hotels'
  document.forms['hotel_search'].submit ();
}
function ChangeAddress()
{
	obj = document.getElementById('adr');
	obj_m = document.getElementById('adr_m');
	obj_p = document.getElementById('adr_p');
	if (obj.value == 'm')
	{
		obj_m.style.display = 'block';
		obj_p.style.display = 'none';
	}
	if (obj.value == 'p')
	{
		obj_p.style.display = 'block';
		obj_m.style.display = 'none';
	}
}
function set_comp(line)
{
	document.select_tour.comp_line.value = line;
	document.getElementById('next1').style.display='block';
}
function set_hotel()
{
	for (i = 0; i < document.select_hotel.hotel_line.length; i++)
		if (document.select_hotel.hotel_line[i].checked)
			var h = 1;
	for (i = 0; i < document.select_hotel.flight_to_line.length; i++)
		if (document.select_hotel.flight_to_line[i].checked)
			var t = 1;
	for (i = 0; i < document.select_hotel.flight_from_line.length; i++)
		if (document.select_hotel.flight_from_line[i].checked)
			var f = 1;
	if (document.select_hotel.hotel_line.checked)
			var h = 1;
	if (document.select_hotel.flight_to_line.checked)
			var t = 1;
	if (document.select_hotel.flight_from_line.checked)
			var f = 1;
	if (h && t && f)
		document.getElementById('next2').style.display='block';
}
function set_room()
{
	for (i = 0; i < document.select_room.room.length; i++)
		if (document.select_room.room[i].checked)
			var r = 1;
	for (i = 0; i < document.select_room.meal.length; i++)
		if (document.select_room.meal[i].checked)
			var m = 1;
	if (document.select_room.room.checked)
			var r = 1;
	if (document.select_room.meal.checked)
			var m = 1;
	if (r && m)
		document.getElementById('next3').style.display='block';
}
function check_pax()
{
	var ret = true;
	for (i = 0; i < document.pax_info.elements['pax_family[]'].length; i++)
		if (document.pax_info.elements['pax_family[]'][i].value.length < 2)
		{
			alert('не заполнена фамилия...');
			ret = false;
			break;
		}
	for (i = 0; i < document.pax_info.elements['pax_name[]'].length; i++)
		if (document.pax_info.elements['pax_name[]'][i].value.length < 2)
		{
			alert('не заполнено имя...');
			ret = false;
			break;
		}
	for (i = 0; i < document.pax_info.elements['pax_phone[]'].length; i++)
		if (document.pax_info.elements['pax_phone[]'][i].value.length < 2)
		{
			alert('не заполнен телефон...');
			ret = false;
			break;
		}
	return ret;
}

