Multiple instances of modal dialog box

Multiple instances of modal dialog box


Hi,
I have 3 links to difference modal boxes on a page. Quite messily
I've just duplicated the code in the head[1] 3 times, mainly due to
being a jQuery/javascript novice. Is there a way to neaten this up a
bit?
[1]
<script>
$(document).ready(function() {
$('#helpInfo1').load("includes/file1.html").dialog({
autoOpen: false,
width: 600,
modal: true
});
$('#helpInfo2').load("includes/file2.html").dialog({
autoOpen: false,
width: 600,
modal: true
});
$('#helpInfo3').load("includes/file3.html").dialog({
autoOpen: false,
width: 600,
modal: true
});
$('#helpLink1').click(function() {
$('#helpInfo1').dialog('open');
});
$('#helpLink2').click(function() {
$('#helpInfo2').dialog('open');
});
$('#helpLink3').click(function() {
$('#helpInfo3').dialog('open');
});
});
</script>
Cheers
VK