jQuery(document).ready(function() {       

	$('#check-placement').click(function(e) {
		var obj = $('#check-placement');
		obj.html(js_text_checking);
		
		var action = obj.attr('data-url'),
			$placement_upline = $('#placement_upline'),
			$placement_area = $('#placement_area'),
			$csrf_ssg_ad_token = $('#csrf_ssg_ad_token');
	
		$.post(action, {
				placement_upline: $placement_upline.val(),
				placement_area: $placement_area.val(),
				csrf_ssg_ad_token: $csrf_ssg_ad_token.val()
			},
			function(data){
				obj.html(js_text_registration_check_existing_of_placement);
				alert(data);
			}
		);
	});
	
	$('#check-member').click(function(e) {
		var obj = $('#check-member');
		obj.html(js_text_checking);
		
		var action = obj.attr('data-url'),
			$member_email = $('#member_email'),
			$csrf_ssg_ad_token = $('#csrf_ssg_ad_token');
	
		$.post(action, {
				member_email: $member_email.val(),
				csrf_ssg_ad_token: $csrf_ssg_ad_token.val()
			},
			function(data){
				obj.html(js_text_transfer_check_existing_of_member);
				alert(data);
			}
		);
	});

});