// JavaScript Document
/* Setup tipsy */
$(function() {
	$('.tipsy-s').tipsy({gravity: 's'});
	$('.tipsy-n').tipsy({gravity: 'n'});
});

/* Setup the speaker highlight area for the sidebar */
function updateSpeakerHighlight(url) {
	url = url.split('#');
	url = url.pop();
	url = url.replace('spkr-side-','');
	url = url.replace('-content','');
	url = blogurl+'/blog/'+url;
	$('#speaker-side-highlight').empty().html('<div id="loading">The content is being updated</div>');
	$.ajax({
		url: url,
		data: {speakerHighlight:'true'},
		dataType: 'html',
		success: function(response) {
			$('#speaker-side-highlight').html(response);
			$('#speaker-side-highlight a').nyroModal();
		}
	});
}

$(function() {
	$('.ed-spkr-ajax').click(
		function() {
			updateSpeakerHighlight(this.href);
			return false;
		}
	);
});

$(function() {
	$.nyroModalSettings({
		width: 550
	});
});

function highlightSearchForm(what) {
	$(function() {
		$("#"+what).focus(function() {
			$(this).parent().parent().addClass("curFocus")
		});
		$("#"+what).blur(function() {
			$(this).parent().parent().removeClass("curFocus")
		});
	});
	document.getElementById(what).focus();
	return false;
}
