function f_ajax(nc,nh){ var post="id_city="+$('#city').val()+"&ncity="+nc; $.ajax({ type: "POST", url: "/content/street.php", data: post, beforeSend: function(){ $('#street').html('<option value="00">-загрузка улиц-</option>');}, error: function(){alert("Error. Ошибка на сервере. Попробуйте позднее.");return false;},
success: function(msg){ if (msg == '-1'){ $('#street').text('Ошибка запросса sql.');} else { $('#street').html(msg);$('#home').html('<option>не выбрана улица</option>'); if (nc!='0' && nh!='0') f_ajaxs(nc,nh); else f_ajaxs('0','0') }  }});}

function f_ajaxs(nc,nh){ var post="id_street="+$('#street').val(); $.ajax({ type: "POST", url: "/content/street.php", data: post, beforeSend: function(){ $('#home').html('<option value="00">-загрузка домов-</option>');}, error: function(){alert("Error. Ошибка на сервере. Попробуйте позднее.");return false;}, success: function(msg){ if (msg == '-1'){ $('#home').text('Ошибка запросса sql.');} else { $('#home').html(msg); if (nc!='0' && nh=='--') f_ajax_nc(nc,nh); } }});}

function f_ajax_nc(nc,nh){var post="n_street="+nc+"&n_home="+$('#home111').val(); $.ajax({ type: "POST", url: "/content/street.php", data: post, beforeSend: function(){ $('#home').html('<option value="00">-загрузка домов-</option>');}, error: function(){alert("Error. Ошибка на сервере. Попробуйте позднее.");return false;}, success: function(msg){ if (msg == '-1'){ $('#home').text('Ошибка запросса sql.');} else { $('#home').html(msg); } }});}

function f_ajax_s(strt){ var post="id_street="+strt; alert(post);}

function switchcontacts()
{
$('#contacts').slideToggle();

}
