/*!
* lowprofilePhotographer JS class for profile controller
*
* @author		Sylvain Hovington <sylvain@prospek.ca>
* @copyright	Copyright (c) 2009 Prospek Creation Inc. All rights reserved.
* @uses			jQuery
*/

var lowprofileProfile = {

	activeProfileText	: '',
	activeProfileId 	: '',

	/*
	* Init
	*
	* @author		Sylvain Hovington <sylvain@prospek.ca>
	* @copyright	Copyright (c) 2009 Prospek Creation Inc.
	* @license		Proprietary
	*/
	init: function() {

		// Get first image
		lowprofileProfile.activeProfileText = jQuery("div#profile_text div:first");

		// Find activeNewsId
		var arr = jQuery("div#profile_links a.profile_links:first").attr('id').split('-',3);
		lowprofileProfile.activeProfileId = arr[2];

		jQuery("div#profile_links a.profile_links").click (

			function() {

				// Find hoverProfileId
				var arr = $(this).attr('id').split('-',3);
				var hoverProfileId = arr[2];

				if (hoverProfileId != lowprofileProfile.activeProfileId) {
					$('#profile-link-' + lowprofileProfile.activeProfileId).removeClass('current_item');
					$('#profile-link-' + hoverProfileId).addClass('current_item');

					$('#profile-text-' + lowprofileProfile.activeProfileId).fadeOut("fast", function() {
						$('#profile-text-' + hoverProfileId).fadeIn("fast");
					});
					lowprofileProfile.activeProfileId = hoverProfileId;
				}
			},
 			function() {}
 		);

	}

};

// init
jQuery(function () {
	lowprofileProfile.init();
});