function loadItem(section, collection, item) {
	tracking(section, collection, item);
	
	if (section == 'terms') {
		loadSection = "inc/" + section + ".php";
	} else {
		loadSection = "inc/" + section + ".php?collection=" + collection + "&item=" + item;
	}
	
	$.get(loadSection, function(data){
		// create a modal dialog with the data
		$(data).modal({
			close: false,
			overlay: 80,
			overlayId: 'popOverlay',
			containerId: 'popContainer',
			onOpen: pop.open,
			onShow: pop.show,
			onClose: pop.close
		});
	});
}

//-- Close modal popup with ESC key
$(document).keydown( function(e) 
{ 
	if (e.keyCode == 27)
	{
	$.modal.close();
	return;
}
});

var pop = {
	message: null,
	open: function (dialog) 
	{
		dialog.overlay.fadeIn(200, function () 
		{
			dialog.container.fadeIn(200, function () 
			{
				dialog.data.fadeIn(800);
				
				// fix png's for IE 6
				if ($.browser.msie && $.browser.version < 7) 
				{
					$('#popContainer .send, #popContainer .cancel').each(function () 
					{
						if ($(this).css('backgroundImage').match(/^url[("']+(.*\.png)[)"']+$/i)) 
						{
							var src = RegExp.$1;
							$(this).css(
							{
								backgroundImage: 'none',
								filter: 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="' +  src + '", sizingMethod="scale")'
							});
						}
					});
				}
				
			});
		});
	},
	
	show: function (dialog) {},

	close: function (dialog) 
	{
		dialog.data.fadeOut(800, function () 
		{
			dialog.container.fadeOut(200, function () 
			{
				dialog.overlay.fadeOut(200, function () 
				{
					$.modal.close();
				});
			});
		});
	}
};