/* --- component Photo Rate JS --- */

/**
 * Photo Rate javascript class
 */
 
function JSSortProfiles()
{
	/* -- Class constructor -- */
	this._construct = function()
	{
		// integer
		this.curr_photo_id = 0;
		
		// objects
		this.obj_container = $('profile_sort_container');

		this.sort_type = $('sort_profile_select');

		this.distance_type = $('distance_profile_select');
	}
	
	/*
	this.rate_highlight = function( point )
	{
		var className = point ? 'rate_point_on' : 'rate_point_off';
		
		point--; // index begins at 0, points at 1
		
		for( var i = 0; i < this.points.length; i++ )
		{
			if( i == point )
			{
				this.points[i].className = 'rate_point_active';
				className = 'rate_point_off';
				continue;
			}
			
			this.points[i].className = className;
		}
		
		return;
	}
	
	
	this.rate_higlight_reset = function()
	{
		return this.rate_highlight(0);
	}
	
*/	
	this.sort_profiles = function()
	{
		this.obj_container.className = 'profile_sort_area';
		
		xajax_sortProfiles( this.sort_type.value, this.distance_type.value );
	}
	
	
	this.load_profiles = function( resposeto )
	{
		this.obj_container.innerHTML = 'hello';
		
	/*
	this.curr_photo_id = photo_id;
		this.curr_profile_id = profile_id;
		
		this.new_img = new Image();
		
		this.new_img.src = img_url;
		
		if( error_message != '' )
			this.obj_average_score_container.innerHTML = error_message;
		else
		{
			this.obj_average_score.innerHTML = average_score;
			this.obj_average_score_rates.innerHTML = rates;
		}
		
		$('photo_rating_image_screen').innerHTML = '';
		
		$('photo_rating_profile_href').href = profile_href;
		
		var screen = $('photo_rating_image_screen');
		
		if( screen.getElementsByTagName('img').length )
			screen.removeChild( screen.getElementsByTagName('img')[0] );
		
		screen.appendChild(this.new_img);
		
		this.new_img.onload = function()
		{
			$('photo_rating_container').className = '';
		}
		*/
	}
	
	
/*	this.printError = function( text )
	{
		var screen = $('photo_rating_image_screen');
		
		if( screen.getElementsByTagName('img').length )
			screen.removeChild( screen.getElementsByTagName('img')[0] );
		
		screen.innerHTML = text;
		$('photo_rating_container').className = '';
		$('photo_rating_profile_href').href = '#';
	}
*/	
	
	this._construct();
}