//var arrNumbers = new Array();
//arrNumbers[4846]=1141;
//arrNumbers[4845]=5012;
//arrNumbers[45878]=1171;
//arrNumbers[45902]=1171;
//arrNumbers[45886]=1645;
//arrNumbers[45888]=1874;
//arrNumbers[45887]=17013;
//arrNumbers[45412]=9915;
//arrNumbers[45414]=5014;
//arrNumbers[45894]=179479;
//arrNumbers[45895]=72170;
//arrNumbers[45893]=2322;
//arrNumbers[45897]=7117;
//arrNumbers[45891]=80888;
//arrNumbers[45900]=4565;
//arrNumbers[45898]=5339;
//arrNumbers[45896]=4545;
//arrNumbers[45901]=9090199;
//arrNumbers[45899]=7910;
//arrNumbers[45903]=0930399999;
//arrNumbers[45906]=90645045;
//arrNumbers[45905]=7796;
//arrNumbers[45910]=1945;
//arrNumbers[45907]=9014;
//arrNumbers[45909]=1121;
//arrNumbers[45904]=83868;
//arrNumbers[45912]=1098;
//
function start_payment() {
	$('#payment_block').css('display', 'block');
	$('#descr_block').css('display', 'none');
	//$.get("index.php?getCountriesList=1", {}, receiveCountries, "text");
	//$('#country').attr('disabled', true);
	$('#country').attr('disabled', false);
	$('#line_2').css('display', 'none');
	getOperators(0);
}

function addOption(val, text, id) {
	var option = document.createElement("option");
	$(option).val(val);
	$(option).html(text);
	$("#" + id).append($(option));
}

function receiveCountries(response, status) {
	arrValues = response.split('|');
	for (i = 0; i < arrValues.length; i++) {
		arrValue = arrValues[i].split('=');
		addOption(arrValue[0], arrValue[1], 'country');
	}
	$('#country').attr('disabled', false);
}

function goToSite(url) {
	setTimeout(function()
	{
		window.open(url);
	}, 0);

}

function getOperators(intCountryID) {
	intCountryID = $('#country').val();
	if (intCountryID > 0) {
		$('#send_text').css('display', 'block');
		$('#attention').css('visibility', 'visible');
		//$('#op_number').html(arrNumbers[intCountryID]);
		$('#op_number').attr("src", "/shownumber.php?n=" + arrNumbers[intCountryID]);
		$('#op_price').html(arrPrices[intCountryID]);
		$('#op_link').attr("href", arrSites[intCountryID]);
	}
	if (intCountryID == 4845) {
		$('#attentionua').css('visibility', 'visible');
	}
	else {
		$('#attentionua').css('visibility', 'hidden');
	}
	return;
	$('#operator').attr('disabled', true);
	$.get("index.php?getOperatorsList=" + intCountryID, {}, receiveOperators, "text");
	$('#send_text').css('display', 'none');
	$('#attention').css('visibility', 'hidden');
}

function receiveOperators(response, status) {
	$('#operator').empty();
	arrValues = response.split('|');
	for (i = 0; i < arrValues.length; i++) {
		arrValue = arrValues[i].split('=');
		addOption(arrValue[0], arrValue[1], 'operator');
	}
	$('#operator').attr('disabled', false);
	intCountryID = $('#country').val();
	if (intCountryID > 0) {
		$('#send_text').css('display', 'block');
		$('#attention').css('visibility', 'visible');
		//$('#op_number').html(arrNumbers[intCountryID]);
		$('#op_number').attr("src", "/shownumber.php?n=" + arrNumbers[intCountryID]);
	}
}


