$(document).ready(function(){

  // выбор города
  function adjustCity(){
  	var countryValue = $('#cityout').val();
  	var tmpSelect = $('#cityto');
  	if(countryValue.length == 0) {
  		tmpSelect.attr('disabled','disabled');
  		tmpSelect.clearSelect();
  		//adjustModel();
  	} else {
  		$.getJSON('selectcity.php',{country:countryValue},function(data) { tmpSelect.fillSelect(data).attr('disabled','')}); /*adjustModel(); } );*/
  		/* /bitrix/templates/gtinner/iblock/*/
  	}
  };
	
  $('#cityout').change(function(){
  	adjustCity();
  }).change();
  
  //$('#calc').click(function(){
  //var data = 'city1=' + $("#cityout option:selected").val() + '&city2=' + $("#cityto option:selected").val();
  //$.ajax({
  //  url: '<?=SITE_TEMPLATE_PATH?>/iblock/calc.php',
  //  data: data,
    //method: 'GET',
  //  success: function(answ){
  //    alert(answ);
  //  }
  //});
 //});

  //$('#cityto').change(function(){
  //	$("select option:selected").each(function () {
  //              alert('Выбор сделан: ' + $(this).text());
  //            });
  //});
});

