// Functions that take a seemingly innocent anchor and change it into a
// dialog generation machine.
//
// Here's the anchor:
//
// <a id="dialog_link" class="ui-state-default ui-corner-all" href="larger.html" target="_blank"><span class="ui-icon ui-icon-newwin">View Larger</span></a> 
//
// Here's what you put in the head of the HTML document:
//
//	<script type="text/javascript" src="jquery-1.4.2.min.js"></script>
//	<script type="text/javascript" src="jquery-ui-1.8.1.custom.min.js"></script>
//	<script type="text/javascript" src="functions.js"></script>
//
// Adjust paths as necessary. Obviously this requires JQuery + a custom
// JQuery-ui download that is set up for dialog box generation. See
// jquery.com and jqueryui.com for these.
//
// Here's what you do at the END of the body of the HTML document:
//
// ........................................
//
//	<script type="text/javascript">
//		$(function() {
//			dialogLinkAdj(title, img, alt);
//		});
//		$(window).bind("load", function() { 
//			dialogInit(imgWidth, imgHeight);
//		});
//	</script>
//
// ........................................
//
// $(function() {...}); runs when the DOM is ready.
//
// $(window).bind("load", function() {...}); runs after all content
// (incl. what's dinked with in the fore-mentioned DOM-ready function) is
// loaded.
//
// Replace arguments to functions with actual useful values, of course.
//
// Yep.


// Edit the anchor to remove bits that were set up for non-JS operation.
// Make it into something JQuery can use to display a dialog box.
//
// Args: 
// 		title - Dialog window title
// 		img   - Relative path to the image
// 		alt   - Alternate text for the image
//
//function dialogLinkAdj(title, img, alt) {
//	var anc = '<div id="dialog" title="' + title + '"><img src="' + img + '" alt="' + alt + '" /></div>';
//	$(anc).insertAfter('#dialog_link');
//	$('#dialog_link').attr('href', '#').removeAttr('target');
//}

// Initialize all the clicky goodness so the dialog box opens when it's
// supposed to.
// 
// Args:
// 		imgWidth  - Width of the image
// 		imgHeight - Height of the image
//
//function dialogInit(imgWidth, imgHeight) {
//	var dialogOpts = {
//		draggable: false,
//		autoOpen: false,
//	  	width: imgWidth,
//		height: imgHeight + 30,
//		modal: true,
//		open: function(event, ui){$('body').css('overflow','hidden');$('.ui-widget-overlay').css('width','100%'); },
//		close: function(event, ui){$('body').css('overflow','auto'); } 
//	};
//	$('#dialog').dialog(dialogOpts);
//	$('#dialog_link').click(function(){  
//	 	$('#dialog').dialog('open');  
//	});  
//}


