
function dropDownInit() {
	// active the drop down links to show/hide panels
	$('.dropdownlink').click(function(e){
		e.preventDefault();
		// find element to drop down & its status
		var ele = $('#' + $(this).attr('id') + '-content');
		var status = ele.css('display');
		$('.drop-content').hide();
		// only show if it wasn't shown before
		if (status == 'none') {
			$('#' + $(this).attr('id') + '-content').show();
		}
	});

	// initialize the osm submission link
	$('#osm-poster-form').submit(function(e){
		var fid = ($('#osmpost-feature-id').val());
		e.preventDefault();
		// change content of osm panel to submit
		$('#drop-osm-content').html("<p><img src='/i/ajax-arrows.gif' width='16' height='16' alt='posting...'/> Posting track to OpenStreetmap...</p>");
		// and issue AJAX request
		$.ajax({
			type: 'POST',
			url: '/ajax/osmpost.php',
			data: { feature_id: fid },
			success: function(res) {
				$('#drop-osm-content').html(res);
			},
			error: function(res) {
				$('#drop-osm-content').html("<p class='notify'>sorry, an error occured while posting. Please wait a few minutes and retry.</p>");
			}
		});
	})
}

