$(document).ready(function() {
	$(".download-link").click( function () { getDlg( $(this).attr("id") ) } );
	$("#id_country").change( function () { init_opers( $(this).val() ) } );
	
	$("#smsform").dialog({
		autoOpen: false,
		position: ["center","center"],
		modal: true,
		width: 790,
		buttons: { 'Закрыть': function() { $(this).dialog('close'); } },
		close: function() { }
	});
	
	$("#freeload").dialog({
		autoOpen: false,
		position: ["center","center"],
		modal: true,
		width: 500,
		buttons: { 'Закрыть': function() { $(this).dialog('close'); } },
		close: function() { }
	});
	
	$("#smsload").dialog({
		autoOpen: false,
		position: ["center","center"],
		modal: true,
		width: 600,
		buttons: { 'Закрыть': function() { $(this).dialog('close'); } },
		close: function() { }
	});
	
	$("#onlinepayload").dialog({
		autoOpen: false,
		position: ["center","center"],
		modal: true,
		width: 600,
		buttons: { 'Закрыть': function() { $(this).dialog('close'); } },
		close: function() { }
	});
	
	if ( $("#phonedescrbox").outerHeight() > 50 ) {
		$("#phonedescrbox").css('height', '50px');
		$("#phonedescrbox").css('display', 'block');
		$(".phonedescrbox_link").css('display', 'block');
		$("#phonedescrbox_link").click( function () { 
			if ( $("#phonedescrbox").css('height') == '50px' ) {
				$("#phonedescrbox").css('height', '100%');
			} else {
				$("#phonedescrbox").css('height', '50px');
			}
		} );
	} else { if ( $("#phonedescrbox").text() ) $("#phonedescrbox").css('display', 'block'); }
});
