function setText(div, text) {
    if(div != '' && text != ''){document.getElementById(div).innerHTML = text;}
}
function changeCountry(country){
  $.post(
	  'http://sims24.ru/js/country.php',
	  {
		type: "post",
		country: country
	  },
	  onAjaxSuccess
	);
		function onAjaxSuccess(data)
		{
		    dataArr = data.split('/'); // => массив [0=>"number", 1=>"prefix", 2=>"price"]
		    setText("number", dataArr[0]);
		    setText("prefix", dataArr[1]);
		    setText("price", dataArr[2]);
		}
}
function checkPay(file){
  $.post(
	  'http://sims24.ru/js/code.php',
	  {
		type: "post",
		file: file,
		code: $("#code").val()
	  },
	  onAjaxSuccess
	);
		function onAjaxSuccess(data)
		{
			setText("messageSMS", data);
		}
}

function windowState(showHide) {

		$.post(
		'/js/windowPay.php',
		{
		type: "post",
		'showHide': showHide
	 	 },
	 	 onAjaxSuccess
		);
		function onAjaxSuccess(data)
		{
			if( showHide == 'close' )
				$('#payWindow').fadeOut(350);
			else
				$('#payWindow').fadeIn(350);
		}
	
}
