 jQuery(document).ready(function()
 {
 	personID = 'I1263';
 	tooltip = '';
	jQuery('a[href*="getperson.php"]').mouseover(function() {
		// Get the query string from the link
		var famURL = jQuery(this).attr("search");
		// Next 4 lines find the PersonID in the query string and save it
		var qstr = famURL.split('&');
		qstr = qstr[0].slice(1);
		qstr = qstr.split('=');
		personID = qstr[1];
		jQuery("#famPop"+personID).load("/scripts/ci/index.php/familypop/method/"+personID);
	});
	jQuery('a[href*="getperson.php"]').qtip(
		{
			content: '<div id="famPop-'+personID+'"></div>',
			position: {
			  corner: {
			     tooltip: 'topLeft', 
			     target: 'rightBottom'
			  }
			},
			show: {
			  when: 'mouseover', // Show it on mouseover...
			  solo: true // ...and hide all others when its shown
			},
			hide: 'unfocus', // Hide it when inactive...
			style: {
			  width: 300,
			  height: 100,
			  padding: 10,
			  color: "#000000",
			  tip: true,
	      border: {
	         width: 5,
	         radius: 5,
	         color: '#666666'
	      },
			  name: 'blue'
			},
			api: {
			   beforeShow: function() {
		         this.loadContent("/scripts/ci/index.php/familypop/method/"+personID);
			      }
			   }
		});
 		//jQuery('div#other').html(tooltip); // Debugging
		//jQuery(this).attr('href', '#');
});
