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

var lowprofilePhotographer = {

	activeProfileText	: '',

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

		// Get first image
		lowprofilePhotographer.activeProfileText = jQuery("div#photographer_text div:first");

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

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

			function() {

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

				if (hoverPhotographerId != lowprofilePhotographer.activePhotographerId) {
					$('#photographer-link-' + lowprofilePhotographer.activePhotographerId).removeClass('current_item');
					$('#photographer-link-' + hoverPhotographerId).addClass('current_item');

					$('#photographer-text-' + lowprofilePhotographer.activePhotographerId).fadeOut("fast", function() {
						$('#photographer-text-' + hoverPhotographerId).fadeIn("fast");
					});
					lowprofilePhotographer.activePhotographerId = hoverPhotographerId;
				}
			},
 			function() {}
 		);

	}

};

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