	$jtag = jQuery.noConflict();	// Make sure our implementation doesn't conflict with anyone elses
	var jtagsPopBoxT = null;			// hold the timeout value for the popup
	var mouseOverBox = false;			// Used to delay the box off function when the mouse is over the box
	var jtagsImgIcon = new Array();			// Going to use this to attach floating boxes after the page is done loading
	var jtagsImgCount = 0;


	$jtag(document).ready(function() {
		// Scroll through all the images created by the figure function that need a descriptive icon
		for (i=0;i<jtagsImgCount;i++)
		{
			jattach_right(jtagsImgIcon[i]['iconId'],jtagsImgIcon[i]['imgId']);		// Attach the icon to the image
			jattach_bottom(jtagsImgIcon[i]['iconId'],jtagsImgIcon[i]['imgId']);		// on the bottom right
			$jtag("#"+jtagsImgIcon[i]['iconId']).fadeTo(0,.7);
		}
		$jtag(".enlarge_image_button").mouseout(function() {
			$jtag(this).fadeTo('fast',.7);
		});
		$jtag(".link_image_button").mouseout(function() {
			$jtag(this).fadeTo('fast',.7);
		});
		$jtag(".enlarge_image_button").mouseover(function() {
			$jtag(this).fadeTo('fast',1);
		});
		$jtag(".link_image_button").mouseover(function() {
			$jtag(this).fadeTo('fast',1);
		});
		$jtag(".enlarge_image_button").show();
		$jtag(".link_image_button").show();
	});	
	
/*
	var jtagsHoldCaller = null;			// Holds the calling object for popups. Theoretically we can use this to give us enough time for the box to resize with the contents

/*	
	// Helper to make it easier to call the left function
	function jtagsSetPop()
	{
	    	set_top("jtagsPopBox",Math.min(get_obj_top(jtagsHoldCaller),document.body.scrollTop+page_bottom()-get_obj_height(jtagsHoldCaller)));
	    	set_left("jtagsPopBox",Math.min(get_obj_left(jtagsHoldCaller)+get_obj_width(jtagsHoldCaller),document.body.clientWidth-get_width("jtagsPopBox")));
	}
/*
	// Send this function anything you want, it will adjust for size
	function jtagsPopOn(caller,info)
	{	
		clearTimeout(jtagsPopBoxT);	// In case we had one about to disappear, force it to not
		// Note, we have a div inside a div so that we can customize the way the innerbox looks to a great degree
		$jtag("#jtagsPopContent").html(info);
		$jtag("#jtagsPopBox").show();
		
		jtagsHoldCaller = caller;
		jtagsSetPop();
		
		// Text boxes were expanding to fill the screen for some reason. This fixes it.
		if ( $jtag("#jtagsPopBox").offset().width > 300 )
			$jtag("#jtagsPopBox").css('width',"300px");
		
		setTimeout("jtagsSetPop();",1000);        
	}
*/		
	// In this case, due to nested quotes or something, we shoved what we want into a div. Pass the ID of the contents to copy
	function jtagsPopOnAttach(attachToId,popId,top,left)
	{
		if (!$jtag("#"+popId).html()) return; 	// If there is nothing to popup, don't	
		
		top = typeof(top) != 'undefined' ? top : 0;		// Default value: attach the popup to the top of the calling object
		left = typeof(left) != 'undefined' ? left : 'right';	// Default value: attach the popup to the rigth edge of the calling object
		
		clearTimeout(jtagsPopBoxT);	// In case we had one about to disappear, force it to not
		// Note, we have a div inside a div so that we can customize the way the innerbox looks to a great degree
		$jtag("#jtagsPopContent").html($jtag("#"+popId).html());
		$jtag("#jtagsPopBox").show();
		callerP = $jtag("#"+attachToId).offset();	

		if (top=="top")
			top = callerP.top-$jtag("#jtagsPopBox").height()-3; 	// Initially set the floater to where it's bottom is the top of the calling object
		else if (top=="bottom")
			top = callerP.top+$jtag("#".attachToId).height(); 	// Initially set the floater to where it's bottom is the top of the calling object
		else 
			top = callerP.top;
		top = Math.max(top,$jtag(window).scrollTop());		// Now make sure it's not off the screen
		$jtag("#jtagsPopBox").css('top',top);
	
		if (left=="left")		
			left = callerP.left-$jtag("#jtagsPopBox").width();
		else								// Default is to attach to the right side
			left = callerP.left+$jtag("#"+attachToId).width()+3;
		left = Math.min(left,$jtag(window).width()-$jtag("#jtagsPopBox").width());	// Either set to the left of the calling object or to whatever will keep it on screen
		left = Math.max(0,left);							// Make sure it doesn't go off the left side of the screen either
		$jtag("#jtagsPopBox").css('left',left);
	}
	

	function jtagsCheckOff()
	{
		if (!mouseOverBox)
		{
			$jtag("#jtagsPopBox").hide();
			$jtag("#jtagsPopBox").css('width',"auto");
		}
		else	// Try again in a few seconds
		        jtagsPopBoxT = setTimeout("jtagsCheckOff()",50);
		}
	              
		
	function jtagsPopOff(){
		jtagsPopBoxT = setTimeout("jtagsCheckOff()",50);
	}  
