function close()
{
	$('#jdialog-overlay').fadeOut();
	$('#jdialog').fadeOut();
	$('#jdialog-container').empty();
	$('#jdialog-title').empty();
}
function open()
{
	$('#jdialog-overlay').css({'opacity':'0.8'});
	$('#jdialog-overlay').fadeIn();
	$('#jdialog').fadeIn();
}
$(document).ready(function(){
	$('#jdialog .close').click(function(){
	close();
	});
});
$(document).ready(function(){


$('span.feedback').click(function(){
		var href = $(this).attr('rel');
		var get = $(this).attr('class');
		var title = $(this).attr('title');
		$.ajax({
			type: 'POST',
			data: 't='+get,
			url:href,
			beforeSend: function()
			{
				open();
				$('#jdialog-container').html('<span class="loading"></span>');
			},
			success: function(html)
			{
				$('#jdialog-title').text(title);
				$('#jdialog-container').html(html);
			},
			error: function()
			{
				$('#jdialog-container').text('404');
			}
		});
		return false;
	});
	$('span.contact').click(function(){
		var href = $(this).attr('rel');
		var get = $(this).attr('class');
		var title = $(this).attr('title');
		$.ajax({
			type: 'POST',
			data: 't='+get,
			url:href,
			beforeSend: function()
			{
				open();
				$('#jdialog-container').html('<span class="loading"></span>');
			},
			success: function(html)
			{
				$('#jdialog-title').text(title);
				$('#jdialog-container').html(html);
			},
			error: function()
			{
				$('#jdialog-container').text('404');
			}
		});
		return false;
	});

});

