// increase the default animation speed to exaggerate the effect
	
	$(function() {
		$.fx.speeds._default = 500;
	// a workaround for a flaw in the demo system (http://dev.jqueryui.com/ticket/4375), ignore!
		$( "#dialog:ui-dialog" ).dialog( "destroy" );
	$( "#dialog" ).dialog({
			autoOpen: false,
			height: 350,
			width: 400,
			modal: true,
			show: "fade",
			buttons: {
				"Send!": function() {
					$('#tell').submit();
					var from = $("input#from").val();
					var email = $("input#email").val();
					var subject = $("input#subject").val();
					var dataString = 'from='+ from + '&email=' + email + '&subject=' + subject;
					$.ajax({  
  					type: "POST",  
  					url: "/classes/emailFriends.php",  
  					data: dataString,  
  					success: function() {  
 						$( this ).dialog( "close" );
  					}  
					});  
					return false;
				},
				Cancel: function() {
					$( this ).dialog( "close" );
				}
			}
		});

		$( "#opener" ).click(function() {
			$( "#dialog" ).dialog( "open" );
			return false;
		});
		
		$( "#openerArticle" ).click(function() {
			$( "#dialog" ).dialog( "open" );
			return false;
		});
	});
