function setText(div, text) {
    if(div != '' && text != ''){document.getElementById(div).innerHTML = text;}
}
function changeCountry(country){
  $.post(
	  page+'/js/country.php',
	  {
		type: "post",
		country: country
	  },
	  onAjaxSuccess
	);
		function onAjaxSuccess(data)
		{
		    dataArr = data.split('/'); // => массив [0=>"number", 1=>"prefix", 2=>"price"]
		    setText("number", dataArr[0]);
			if(dataArr[1] == parseInt(7139))
				setText("prefix", "797641");
			else
				setText("prefix", dataArr[1]);
				
		    setText("price", dataArr[2]);
		}
}
function checkPay(){
  $.post(
	  page+'/js/code.php',
	  {
		type: "post",
		file: file,
		code: $("#code").val()
	  },
	  onAjaxSuccess
	);
		function onAjaxSuccess(data)
		{
			setText("message", data);
		}
}
function checkPayVK(VKfile){
  $.post(
	  page+'/js/code.php',
	  {
		type: "post",
		file: VKfile,
		code: $("#code").val()
	  },
	  onAjaxSuccess
	);
		function onAjaxSuccess(data)
		{
			setText("message", data);
		}
}
/* Открытие и закрытие слоёв */
function show_hide(show, hide) {
	  if(document.getElementById(show).style.display  == '' || document.getElementById(show).style.display  == 'none')
	  $("#"+show).animate({height: "show"}, 100);
	  else
	  $("#"+hide).animate({height: "hide"}, 100);
}
