function initializeProfiler(profiles, profile, collapsed)
{	
	
	var options =
	{
		toggleSpeed:				80,
		sliderSpeed:				300,
		toggleGrowText:				'Change',
		toggleShrinkText:			'Done',
		submitButtonText:			'Select',
		initiallyShrunk:			true,
		shrinkOnDone:				false,
		snapArrow:					true,
		alsoSnapOnDrag:				$.browser.msie,
		snapSpeed:					100,
		initialProfileIndex:		profile,
		topBarTextPrefix:			'Your Current Profile: ',
		bottomBarTextPrefix:		'',
		uncommittedText:			' - click done to confirm.',
		mainBarText: 				'You can adjust the content of this site to highlight information relevent to you. To do so simply choose a profile and click the <a class=\'done\'>Done</a> button. Click here to <a class=\'cancel\'>cancel</a>.',
		imagePathPrefix:			__RELATIVE_PATH + '/'
	};
	
	var callbacks =
	{
		onSelect:			myOnSelect,
		onGrow:				myOnGrow,
		onShrink:			myOnShrink,
		onDone:				myOnDone,
		onCancel:			myOnCancel,
		onDrag:				myOnDrag
	};
	
	var classes =
	{
		
	};
	

	var args = {profiles: profiles, options: options, classes: classes, callbacks: callbacks};
	$('div#profiler').profiler('init', args);
	
	// bind the done button
	$('a.done').bind('click', 
		function()
		{
			$('div#profiler').profiler('done');
		});
	
	// bind the cancel button
	$('a.cancel').bind('click', 
		function()
		{
			$('div#profiler').profiler('cancel');
		});
		
	function myOnSelect(obj)
	{
		
	};
	
	function myOnDrag(obj)
	{
		
	};
	
	function myOnGrow(obj)
	{
		/*
		$.ajax({
			type:		"GET",
			data:		'name=profiler_collapsed&value=0&expiry_days=9999&' + __PHPSID,
			url:		__RELATIVE_PATH + "/system/ajax/ajax/save_cookie.ajax.php"
		});	
		*/
	};
	
	function myOnShrink(obj)
	{
		/*
		$.ajax({
			type:		"GET",
			data:		'name=profiler_collapsed&value=1&expiry_days=9999&' + __PHPSID,
			url:		__RELATIVE_PATH + "/system/ajax/ajax/save_cookie.ajax.php"
		});
		*/
	};
	
	function myOnDone(obj)
	{
		if (obj.selectedIndex !== obj.originalIndex)
		{
			$.ajax({
				type:		"GET",
				data:		'name=saved_profile&value=' + obj.selectedTag + '&expiry_days=9999&' + __PHPSID,
				url:		__RELATIVE_PATH + "/system/ajax/ajax/save_cookie.ajax.php",
				success:	function()
							{
								// refresh the page
								location.reload();
							}
			});	
		}
		else
		{
			obj.profiler.profiler('cancel');
		}
	};
	
	function myOnCancel(obj)
	{

	};
	
}
